diff --git a/web/src/ProviderListPage.js b/web/src/ProviderListPage.js
index 49aa0bae..2b2ce459 100644
--- a/web/src/ProviderListPage.js
+++ b/web/src/ProviderListPage.js
@@ -111,7 +111,7 @@ class ProviderListPage extends React.Component {
title: i18next.t("general:Created time"),
dataIndex: 'createdTime',
key: 'createdTime',
- width: '160px',
+ width: '180px',
sorter: (a, b) => a.createdTime.localeCompare(b.createdTime),
render: (text, record, index) => {
return Setting.getFormattedDate(text);
@@ -136,16 +136,22 @@ class ProviderListPage extends React.Component {
dataIndex: 'type',
key: 'type',
width: '80px',
+ align: 'center',
sorter: (a, b) => a.type.localeCompare(b.type),
render: (text, record, index) => {
- if (record.category !== "OAuth") {
- return text;
+ const url = Provider.getProviderUrl(record);
+ if (url !== "") {
+ return (
+
+
+
+
+
+ )
} else {
return (
-
-
-
+
)
}
diff --git a/web/src/auth/LoginPage.js b/web/src/auth/LoginPage.js
index 9a9d401f..77d4f027 100644
--- a/web/src/auth/LoginPage.js
+++ b/web/src/auth/LoginPage.js
@@ -183,7 +183,7 @@ class LoginPage extends React.Component {
if (size === "small") {
return (
-
+
)
} else {
diff --git a/web/src/auth/Provider.js b/web/src/auth/Provider.js
index 378f13cd..8cf61295 100644
--- a/web/src/auth/Provider.js
+++ b/web/src/auth/Provider.js
@@ -65,24 +65,69 @@ const authInfo = {
scope: "read_user+profile",
endpoint: "https://gitlab.com/oauth/authorize",
},
-}
+};
-export function getAuthLogo(provider) {
- return `${StaticBaseUrl}/img/social_${provider.type.toLowerCase()}.png`;
-}
+const otherProviderInfo = {
+ SMS: {
+ "Aliyun SMS": {
+ logo: `${StaticBaseUrl}/img/social_aliyun.png`,
+ url: "https://aliyun.com/product/sms",
+ },
+ "Tencent Cloud SMS": {
+ logo: `${StaticBaseUrl}/img/social_tencent_cloud.jpg`,
+ url: "https://cloud.tencent.com/product/sms",
+ },
+ "Volc Engine SMS": {
+ logo: `${StaticBaseUrl}/img/social_volc_engine.jpg`,
+ url: "https://www.volcengine.com/products/cloud-sms",
+ },
+ },
+ Email: {
+ "Default": {
+ logo: `${StaticBaseUrl}/img/social_default.png`,
+ url: "",
+ },
+ },
+ Storage: {
+ "Local File System": {
+ logo: `${StaticBaseUrl}/img/social_file.png`,
+ url: "",
+ },
+ "AWS S3": {
+ logo: `${StaticBaseUrl}/img/social_aws.png`,
+ url: "https://aws.amazon.com/s3",
+ },
+ "Aliyun OSS": {
+ logo: `${StaticBaseUrl}/img/social_aliyun.png`,
+ url: "https://aliyun.com/product/oss",
+ },
+ },
+};
-export function getAuthHomepage(provider) {
- const endpoint = authInfo[provider.type].endpoint;
- const urlObj = new URL(endpoint);
-
- let host = urlObj.host;
- let tokens = host.split(".");
- if (tokens.length > 2) {
- tokens = tokens.slice(1);
+export function getProviderLogo(provider) {
+ if (provider.category === "OAuth") {
+ return `${StaticBaseUrl}/img/social_${provider.type.toLowerCase()}.png`;
+ } else {
+ return otherProviderInfo[provider.category][provider.type].logo;
}
- host = tokens.join(".");
+}
- return `${urlObj.protocol}//${host}`;
+export function getProviderUrl(provider) {
+ if (provider.category === "OAuth") {
+ const endpoint = authInfo[provider.type].endpoint;
+ const urlObj = new URL(endpoint);
+
+ let host = urlObj.host;
+ let tokens = host.split(".");
+ if (tokens.length > 2) {
+ tokens = tokens.slice(1);
+ }
+ host = tokens.join(".");
+
+ return `${urlObj.protocol}//${host}`;
+ } else {
+ return otherProviderInfo[provider.category][provider.type].url;
+ }
}
export function getAuthUrl(application, provider, method) {