mirror of
https://github.com/casdoor/casdoor.git
synced 2025-07-04 21:30:24 +08:00
Improve provider table in app edit page.
This commit is contained in:
@ -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 "";
|
||||
|
Reference in New Issue
Block a user