Improve provider table in app edit page.

This commit is contained in:
Gucheng Wang
2021-11-28 18:46:20 +08:00
parent a04702a8d0
commit c10ccd8106
3 changed files with 48 additions and 17 deletions

View File

@ -12,6 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.
import React from "react";
import {Tooltip} from "antd";
import * as Util from "./Util";
import {StaticBaseUrl} from "../Setting";
@ -130,6 +132,29 @@ export function getProviderUrl(provider) {
}
}
export function getProviderLogoWidget(provider) {
if (provider === undefined) {
return null;
}
const url = getProviderUrl(provider);
if (url !== "") {
return (
<Tooltip title={provider.type}>
<a target="_blank" rel="noreferrer" href={getProviderUrl(provider)}>
<img width={36} height={36} src={getProviderLogo(provider)} alt={provider.displayName} />
</a>
</Tooltip>
)
} else {
return (
<Tooltip title={provider.type}>
<img width={36} height={36} src={getProviderLogo(provider)} alt={provider.displayName} />
</Tooltip>
)
}
}
export function getAuthUrl(application, provider, method) {
if (application === null || provider === null) {
return "";