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(); await handleFetchConfigMap();
saving.value = false; 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> </script>
<template> <template>
<VPageHeader :title="authProvider?.spec.displayName"> <VPageHeader :title="displayName">
<template #icon> <template #icon>
<VAvatar <VAvatar
v-if="authProvider" :src="authProvider?.spec.logo"
:src="authProvider.spec.logo" :alt="authProvider?.spec.displayName"
:alt="authProvider.spec.displayName"
class="mr-2" class="mr-2"
size="sm" size="sm"
/> />
@ -168,13 +189,13 @@ const handleSaveConfigMap = async () => {
:label=" :label="
$t('core.identity_authentication.detail.fields.display_name') $t('core.identity_authentication.detail.fields.display_name')
" "
:content="authProvider?.spec.displayName" :content="displayName"
/> />
<VDescriptionItem <VDescriptionItem
:label=" :label="
$t('core.identity_authentication.detail.fields.description') $t('core.identity_authentication.detail.fields.description')
" "
:content="authProvider?.spec.description" :content="description"
/> />
<VDescriptionItem <VDescriptionItem
:label="$t('core.identity_authentication.detail.fields.website')" :label="$t('core.identity_authentication.detail.fields.website')"

View File

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

View File

@ -1135,12 +1135,11 @@ core:
title: Disable identity authentication method title: Disable identity authentication method
disable_privileged: disable_privileged:
tooltip: The authentication method reserved by the system cannot be disabled tooltip: The authentication method reserved by the system cannot be disabled
list: fields:
fields: display_name:
display_name: local: Login with credentials
local: Login with credentials description:
description: local: Default login method built into Halo
local: Default login method built into Halo
detail: detail:
title: Identity authentication detail title: Identity authentication detail
fields: fields:

View File

@ -1063,12 +1063,11 @@ core:
title: 停用认证方式 title: 停用认证方式
disable_privileged: disable_privileged:
tooltip: 系统保留的认证方式,无法禁用 tooltip: 系统保留的认证方式,无法禁用
list: fields:
fields: display_name:
display_name: local: 账号密码登录
local: 账号密码登录 description:
description: local: Halo 内置的默认登录方式
local: Halo 内置的默认登录方式
detail: detail:
title: 身份认证详情 title: 身份认证详情
fields: fields:

View File

@ -1040,12 +1040,11 @@ core:
title: 停用認證方式 title: 停用認證方式
disable_privileged: disable_privileged:
tooltip: 系統保留的認證方式,無法禁用 tooltip: 系統保留的認證方式,無法禁用
list: fields:
fields: display_name:
display_name: local: 帳號密碼登入
local: 帳號密碼登入 description:
description: local: Halo 內建的默認登入方式
local: Halo 內建的默認登入方式
detail: detail:
title: 身份認證詳情 title: 身份認證詳情
fields: fields: