Compare commits

...

2 Commits

Author SHA1 Message Date
943aa61869 feat: add provider icons and menus (#1522)
* fix: add provider icons(email and captcha) and menus

* fix: add provider icons and menus
2023-02-06 20:28:40 +08:00
wht
fcc75dd3be feat: fix the Unicode filename encoding bug in storage provider (#1518) 2023-02-04 18:09:18 +08:00
4 changed files with 16 additions and 4 deletions

View File

@ -23,7 +23,7 @@ import (
type Resource struct {
Owner string `xorm:"varchar(100) notnull pk" json:"owner"`
Name string `xorm:"varchar(100) notnull pk" json:"name"`
Name string `xorm:"varchar(180) notnull pk" json:"name"`
CreatedTime string `xorm:"varchar(100)" json:"createdTime"`
User string `xorm:"varchar(100)" json:"user"`

View File

@ -72,8 +72,13 @@ func GetUploadFileUrl(provider *Provider, fullFilePath string, hasTimestamp bool
if provider.Type == "Azure Blob" {
host = util.UrlJoin(host, provider.Bucket)
}
fileUrl := ""
if provider.Type == "Tencent Cloud COS" {
fileUrl = util.UrlJoin(host, objectKey)
} else {
fileUrl = util.UrlJoin(host, escapePath(objectKey))
}
fileUrl := util.UrlJoin(host, escapePath(objectKey))
if hasTimestamp {
fileUrl = fmt.Sprintf("%s?t=%s", fileUrl, util.GetCurrentUnixTime())
}

View File

@ -141,6 +141,8 @@ class ProviderListPage extends BaseListPage {
{text: "SMS", value: "SMS"},
{text: "Storage", value: "Storage"},
{text: "SAML", value: "SAML"},
{text: "Captcha", value: "Captcha"},
{text: "Payment", value: "Payment"},
],
width: "110px",
sorter: true,
@ -159,6 +161,7 @@ class ProviderListPage extends BaseListPage {
{text: "Storage", value: "Storage", children: Setting.getProviderTypeOptions("Storage").map((o) => {return {text: o.id, value: o.name};})},
{text: "SAML", value: "SAML", children: Setting.getProviderTypeOptions("SAML").map((o) => {return {text: o.id, value: o.name};})},
{text: "Captcha", value: "Captcha", children: Setting.getProviderTypeOptions("Captcha").map((o) => {return {text: o.id, value: o.name};})},
{text: "Payment", value: "Payment", children: Setting.getProviderTypeOptions("Payment").map((o) => {return {text: o.id, value: o.name};})},
],
sorter: true,
render: (text, record, index) => {

View File

@ -114,7 +114,11 @@ export const OtherProviderInfo = {
},
Email: {
"Default": {
logo: `${StaticBaseUrl}/img/social_default.png`,
logo: `${StaticBaseUrl}/img/email_default.png`,
url: "",
},
"SUBMAIL": {
logo: `${StaticBaseUrl}/img/social_submail.png`,
url: "",
},
},
@ -174,7 +178,7 @@ export const OtherProviderInfo = {
},
Captcha: {
"Default": {
logo: `${StaticBaseUrl}/img/social_default.png`,
logo: `${StaticBaseUrl}/img/captcha_default.png`,
url: "https://pkg.go.dev/github.com/dchest/captcha",
},
"reCAPTCHA": {