feat: improve built-in auth providers' i18n in detail page (#6816)

#### What type of PR is this?

/area ui
/kind improvement
/milestone 2.20.x

#### What this PR does / why we need it:

完善内置的认证提供商详情页面的 i18n,在 https://github.com/halo-dev/halo/pull/6814 中遗漏了详情页面。

<img width="653" alt="image" src="https://github.com/user-attachments/assets/7d4b4789-91d0-45e5-b5e7-98324ddc0899">

#### Does this PR introduce a user-facing change?

```release-note
None
```
pull/6817/head
Ryan Wang 2024-10-10 17:31:01 +08:00 committed by GitHub
parent d0f3933095
commit 53b3124288
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 44 additions and 26 deletions

View File

@ -136,15 +136,36 @@ const handleSaveConfigMap = async () => {
await handleFetchConfigMap();
saving.value = false;
};
const displayName = computed(() => {
if (!authProvider.value) {
return t("core.common.status.loading");
}
return t(
`core.identity_authentication.fields.display_name.${authProvider.value?.metadata.name}`,
authProvider.value?.spec.displayName || ""
);
});
const description = computed(() => {
if (!authProvider.value) {
return t("core.common.status.loading");
}
return t(
`core.identity_authentication.fields.description.${authProvider.value?.metadata.name}`,
authProvider.value?.spec.description || ""
);
});
</script>
<template>
<VPageHeader :title="authProvider?.spec.displayName">
<VPageHeader :title="displayName">
<template #icon>
<VAvatar
v-if="authProvider"
:src="authProvider.spec.logo"
:alt="authProvider.spec.displayName"
:src="authProvider?.spec.logo"
:alt="authProvider?.spec.displayName"
class="mr-2"
size="sm"
/>
@ -168,13 +189,13 @@ const handleSaveConfigMap = async () => {
:label="
$t('core.identity_authentication.detail.fields.display_name')
"
:content="authProvider?.spec.displayName"
:content="displayName"
/>
<VDescriptionItem
:label="
$t('core.identity_authentication.detail.fields.description')
"
:content="authProvider?.spec.description"
:content="description"
/>
<VDescriptionItem
:label="$t('core.identity_authentication.detail.fields.website')"

View File

@ -76,13 +76,13 @@ const handleChangeStatus = async () => {
<VEntityField
:title="
$t(
`core.identity_authentication.list.fields.display_name.${authProvider.name}`,
`core.identity_authentication.fields.display_name.${authProvider.name}`,
authProvider.displayName
)
"
:description="
$t(
`core.identity_authentication.list.fields.description.${authProvider.name}`,
`core.identity_authentication.fields.description.${authProvider.name}`,
authProvider.description || ''
)
"

View File

@ -1135,7 +1135,6 @@ core:
title: Disable identity authentication method
disable_privileged:
tooltip: The authentication method reserved by the system cannot be disabled
list:
fields:
display_name:
local: Login with credentials

View File

@ -1063,7 +1063,6 @@ core:
title: 停用认证方式
disable_privileged:
tooltip: 系统保留的认证方式,无法禁用
list:
fields:
display_name:
local: 账号密码登录

View File

@ -1040,7 +1040,6 @@ core:
title: 停用認證方式
disable_privileged:
tooltip: 系統保留的認證方式,無法禁用
list:
fields:
display_name:
local: 帳號密碼登入