From 34ce9e1c2734a4dc1b364b76c7042839c9172aef Mon Sep 17 00:00:00 2001 From: crupest Date: Fri, 20 Nov 2020 20:49:05 +0800 Subject: ... --- FrontEnd/src/app/views/admin/UserAdmin.tsx | 50 +++++++++++++---------- FrontEnd/src/app/views/common/OperationDialog.tsx | 3 +- 2 files changed, 30 insertions(+), 23 deletions(-) (limited to 'FrontEnd/src/app/views') diff --git a/FrontEnd/src/app/views/admin/UserAdmin.tsx b/FrontEnd/src/app/views/admin/UserAdmin.tsx index 8fd9b351..3cfd5880 100644 --- a/FrontEnd/src/app/views/admin/UserAdmin.tsx +++ b/FrontEnd/src/app/views/admin/UserAdmin.tsx @@ -15,7 +15,7 @@ import { kUserPermissionList, UserPermission, } from "@/http/user"; -import { useTranslation } from "react-i18next"; +import { Trans, useTranslation } from "react-i18next"; interface DialogProps { open: boolean; @@ -33,13 +33,13 @@ const CreateUserDialog: React.FC> = ({ }) => { return ( @@ -70,12 +70,12 @@ const UserDeleteDialog: React.FC ( - <> - You are deleting user {username} ! - + + 0{username}2 + )} onProcess={() => getHttpUserClient().delete(username, token)} onSuccessAndClose={onSuccess} @@ -93,19 +93,26 @@ const UserModifyDialog: React.FC ( - <> - You are change the password of user - {oldUser.username} ! - + + 0{oldUser.username}2 + )} inputScheme={ [ - { type: "text", label: "New Username", initValue: oldUser.username }, - { type: "text", label: "New Password" }, - { type: "text", label: "New Nickname", initValue: oldUser.nickname }, + { + type: "text", + label: "admin:user.username", + initValue: oldUser.username, + }, + { type: "text", label: "admin:user.password" }, + { + type: "text", + label: "admin:user.nickname", + initValue: oldUser.nickname, + }, ] as const } onProcess={([username, password, nickname]) => @@ -139,13 +146,12 @@ const UserPermissionModifyDialog: React.FC ( - <> - You are modify permission of user - {username} ! - + + 0{username}2 + )} inputScheme={kUserPermissionList.map( (permission, index) => ({ diff --git a/FrontEnd/src/app/views/common/OperationDialog.tsx b/FrontEnd/src/app/views/common/OperationDialog.tsx index 08baf93a..bca5cb87 100644 --- a/FrontEnd/src/app/views/common/OperationDialog.tsx +++ b/FrontEnd/src/app/views/common/OperationDialog.tsx @@ -120,7 +120,8 @@ const OperationDialog = < >( props: OperationDialogProps ): React.ReactElement => { - const inputScheme = props.inputScheme as readonly OperationInputInfo[]; + const inputScheme = (props.inputScheme ?? + []) as readonly OperationInputInfo[]; const { t } = useTranslation(); -- cgit v1.2.3