mirror of
https://github.com/whyour/qinglong.git
synced 2026-02-12 22:16:42 +08:00
Add internationalization support for SSH key management UI
Co-authored-by: whyour <22700758+whyour@users.noreply.github.com>
This commit is contained in:
parent
bfc26f4791
commit
06123c1fca
|
|
@ -44,7 +44,7 @@ export default {
|
|||
},
|
||||
{
|
||||
path: '/sshKey',
|
||||
name: 'SSH密钥',
|
||||
name: intl.get('SSH密钥'),
|
||||
icon: <IconFont type="ql-icon-key" />,
|
||||
component: '@/pages/sshKey/index',
|
||||
},
|
||||
|
|
|
|||
|
|
@ -104,7 +104,7 @@
|
|||
"序号": "Number",
|
||||
"备注": "Remarks",
|
||||
"更新时间": "Update Time",
|
||||
"创建时间": "Creation Time",
|
||||
"创建时间": "Created Time",
|
||||
"确认删除依赖": "Confirm to delete the dependency",
|
||||
"确认重新安装": "Confirm to reinstall",
|
||||
"确认取消安装": "Confirm to cancel install",
|
||||
|
|
@ -252,7 +252,7 @@
|
|||
"登录日志": "Login Logs",
|
||||
"其他设置": "Other Settings",
|
||||
"关于": "About",
|
||||
"成功": "Success",
|
||||
"成功": "Successfully",
|
||||
"失败": "Failure",
|
||||
"登录时间": "Login Time",
|
||||
"登录地址": "Login Address",
|
||||
|
|
@ -538,5 +538,16 @@
|
|||
"单实例模式:定时启动新任务前会自动停止旧任务;多实例模式:允许同时运行多个任务实例": "Single instance mode: automatically stop old task before starting new scheduled task; Multi-instance mode: allow multiple task instances to run simultaneously",
|
||||
"请选择实例模式": "Please select instance mode",
|
||||
"单实例": "Single Instance",
|
||||
"多实例": "Multi-Instance"
|
||||
"多实例": "Multi-Instance",
|
||||
"SSH密钥": "SSH Keys",
|
||||
"别名": "Alias",
|
||||
"编辑SSH密钥": "Edit SSH Key",
|
||||
"创建SSH密钥": "Create SSH Key",
|
||||
"更新SSH密钥成功": "SSH key updated successfully",
|
||||
"创建SSH密钥成功": "SSH key created successfully",
|
||||
"请输入SSH密钥别名": "Please enter SSH key alias",
|
||||
"请输入SSH私钥": "Please enter SSH private key",
|
||||
"请输入SSH私钥内容(以 -----BEGIN 开头)": "Please enter SSH private key content (starts with -----BEGIN)",
|
||||
"确认删除SSH密钥": "Confirm to delete SSH key",
|
||||
"批量": "Batch"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -538,5 +538,16 @@
|
|||
"单实例模式:定时启动新任务前会自动停止旧任务;多实例模式:允许同时运行多个任务实例": "单实例模式:定时启动新任务前会自动停止旧任务;多实例模式:允许同时运行多个任务实例",
|
||||
"请选择实例模式": "请选择实例模式",
|
||||
"单实例": "单实例",
|
||||
"多实例": "多实例"
|
||||
"多实例": "多实例",
|
||||
"SSH密钥": "SSH密钥",
|
||||
"别名": "别名",
|
||||
"编辑SSH密钥": "编辑SSH密钥",
|
||||
"创建SSH密钥": "创建SSH密钥",
|
||||
"更新SSH密钥成功": "更新SSH密钥成功",
|
||||
"创建SSH密钥成功": "创建SSH密钥成功",
|
||||
"请输入SSH密钥别名": "请输入SSH密钥别名",
|
||||
"请输入SSH私钥": "请输入SSH私钥",
|
||||
"请输入SSH私钥内容(以 -----BEGIN 开头)": "请输入SSH私钥内容(以 -----BEGIN 开头)",
|
||||
"确认删除SSH密钥": "确认删除SSH密钥",
|
||||
"批量": "批量"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -55,14 +55,14 @@ const SshKey = () => {
|
|||
const { headerStyle, isPhone, theme } = useOutletContext<SharedContext>();
|
||||
const columns: any = [
|
||||
{
|
||||
title: '序号',
|
||||
title: intl.get('序号'),
|
||||
width: 80,
|
||||
render: (text: string, record: any, index: number) => {
|
||||
return <span style={{ cursor: 'text' }}>{index + 1} </span>;
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '别名',
|
||||
title: intl.get('别名'),
|
||||
dataIndex: 'alias',
|
||||
key: 'alias',
|
||||
sorter: (a: any, b: any) => a.alias.localeCompare(b.alias),
|
||||
|
|
@ -78,7 +78,7 @@ const SshKey = () => {
|
|||
},
|
||||
},
|
||||
{
|
||||
title: '备注',
|
||||
title: intl.get('备注'),
|
||||
dataIndex: 'remarks',
|
||||
key: 'remarks',
|
||||
width: '35%',
|
||||
|
|
@ -92,17 +92,17 @@ const SshKey = () => {
|
|||
},
|
||||
},
|
||||
{
|
||||
title: '状态',
|
||||
title: intl.get('状态'),
|
||||
key: 'status',
|
||||
dataIndex: 'status',
|
||||
width: 90,
|
||||
filters: [
|
||||
{
|
||||
text: '已启用',
|
||||
text: intl.get('已启用'),
|
||||
value: 0,
|
||||
},
|
||||
{
|
||||
text: '已禁用',
|
||||
text: intl.get('已禁用'),
|
||||
value: 1,
|
||||
},
|
||||
],
|
||||
|
|
@ -112,7 +112,7 @@ const SshKey = () => {
|
|||
},
|
||||
},
|
||||
{
|
||||
title: '创建时间',
|
||||
title: intl.get('创建时间'),
|
||||
dataIndex: 'createdAt',
|
||||
key: 'createdAt',
|
||||
width: 185,
|
||||
|
|
@ -127,7 +127,7 @@ const SshKey = () => {
|
|||
},
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
title: intl.get('操作'),
|
||||
key: 'action',
|
||||
width: 120,
|
||||
render: (text: string, record: any, index: number) => {
|
||||
|
|
@ -145,7 +145,7 @@ const SshKey = () => {
|
|||
{OperationName[record.status]}
|
||||
</a>
|
||||
</Tooltip>
|
||||
<Tooltip title="编辑">
|
||||
<Tooltip title={intl.get('编辑')}>
|
||||
<a
|
||||
onClick={() => {
|
||||
editSSHKey(record);
|
||||
|
|
@ -154,7 +154,7 @@ const SshKey = () => {
|
|||
<EditOutlined />
|
||||
</a>
|
||||
</Tooltip>
|
||||
<Tooltip title="删除">
|
||||
<Tooltip title={intl.get('删除')}>
|
||||
<a
|
||||
onClick={() => {
|
||||
deleteSSHKey(record);
|
||||
|
|
@ -199,14 +199,14 @@ const SshKey = () => {
|
|||
|
||||
const deleteSSHKey = (record: any) => {
|
||||
Modal.confirm({
|
||||
title: '确认删除',
|
||||
title: intl.get('确认删除'),
|
||||
content: (
|
||||
<>
|
||||
确认删除SSH密钥
|
||||
{intl.get('确认删除SSH密钥')}
|
||||
<Text style={{ wordBreak: 'break-all' }} type="warning">
|
||||
{record.alias}
|
||||
</Text>
|
||||
吗
|
||||
{intl.get('吗')}
|
||||
</>
|
||||
),
|
||||
onOk() {
|
||||
|
|
@ -214,7 +214,7 @@ const SshKey = () => {
|
|||
.delete(`${config.apiPrefix}sshKeys`, [record.id])
|
||||
.then(({ code, data }) => {
|
||||
if (code === 200) {
|
||||
message.success('删除成功');
|
||||
message.success(intl.get('删除成功'));
|
||||
getSSHKeys();
|
||||
}
|
||||
});
|
||||
|
|
@ -230,7 +230,7 @@ const SshKey = () => {
|
|||
.put(`${config.apiPrefix}sshKeys/${operationPath}`, ids)
|
||||
.then(({ code, data }) => {
|
||||
if (code === 200) {
|
||||
message.success(`批量${OperationName[OperationPath[operationPath]]}成功`);
|
||||
message.success(`${intl.get('批量')}${OperationName[OperationPath[operationPath]]}${intl.get('成功')}`);
|
||||
getSSHKeys(false);
|
||||
}
|
||||
});
|
||||
|
|
@ -266,10 +266,10 @@ const SshKey = () => {
|
|||
return (
|
||||
<PageContainer
|
||||
className="ql-container-wrapper"
|
||||
title="SSH密钥"
|
||||
title={intl.get('SSH密钥')}
|
||||
extra={[
|
||||
<Button key="1" type="primary" onClick={addSSHKey}>
|
||||
新建
|
||||
{intl.get('新建')}
|
||||
</Button>,
|
||||
]}
|
||||
header={{
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ const SshKeyModal = ({
|
|||
|
||||
if (code === 200) {
|
||||
message.success(
|
||||
sshKey ? '更新SSH密钥成功' : '创建SSH密钥成功',
|
||||
sshKey ? intl.get('更新SSH密钥成功') : intl.get('创建SSH密钥成功'),
|
||||
);
|
||||
handleCancel(data);
|
||||
}
|
||||
|
|
@ -38,7 +38,7 @@ const SshKeyModal = ({
|
|||
|
||||
return (
|
||||
<Modal
|
||||
title={sshKey ? '编辑SSH密钥' : '创建SSH密钥'}
|
||||
title={sshKey ? intl.get('编辑SSH密钥') : intl.get('创建SSH密钥')}
|
||||
open={true}
|
||||
forceRender
|
||||
centered
|
||||
|
|
@ -59,35 +59,35 @@ const SshKeyModal = ({
|
|||
<Form form={form} layout="vertical" name="ssh_key_modal" initialValues={sshKey}>
|
||||
<Form.Item
|
||||
name="alias"
|
||||
label="别名"
|
||||
label={intl.get('别名')}
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
message: '请输入SSH密钥别名',
|
||||
message: intl.get('请输入SSH密钥别名'),
|
||||
whitespace: true,
|
||||
},
|
||||
]}
|
||||
>
|
||||
<Input placeholder="请输入SSH密钥别名" disabled={!!sshKey} />
|
||||
<Input placeholder={intl.get('请输入SSH密钥别名')} disabled={!!sshKey} />
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
name="private_key"
|
||||
label="私钥"
|
||||
label={intl.get('私钥')}
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
message: '请输入SSH私钥',
|
||||
message: intl.get('请输入SSH私钥'),
|
||||
whitespace: true,
|
||||
},
|
||||
]}
|
||||
>
|
||||
<Input.TextArea
|
||||
autoSize={{ minRows: 4, maxRows: 12 }}
|
||||
placeholder="请输入SSH私钥内容(以 -----BEGIN 开头)"
|
||||
placeholder={intl.get('请输入SSH私钥内容(以 -----BEGIN 开头)')}
|
||||
/>
|
||||
</Form.Item>
|
||||
<Form.Item name="remarks" label="备注">
|
||||
<Input placeholder="请输入备注" />
|
||||
<Form.Item name="remarks" label={intl.get('备注')}>
|
||||
<Input placeholder={intl.get('请输入备注')} />
|
||||
</Form.Item>
|
||||
</Form>
|
||||
</Modal>
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user