style: 网元版本页面多语言翻译

This commit is contained in:
TsMask
2024-05-09 19:25:14 +08:00
parent c65cda1468
commit c88c146a5e
3 changed files with 36 additions and 16 deletions

View File

@@ -630,6 +630,16 @@ export default {
addTitle: "New Host Commands",
editTitle: "Edit Host Commands",
},
neVersion: {
upgrade: "Upgrade To New Version",
upgradeTip: "Are you sure you want to upgrade to the new version?",
upgradeTipEmpty: "There is currently no upgrade available",
upgradeTipEqual: "The current version is the same as the new version",
rollback: 'Rollback To Previous Version',
rollbackTip: "Are you sure you want to roll back to the previous version?",
rollbackTipEmpty: "There is currently no rollback available",
rollbackTipEqual: 'The current version is the same as the previous version',
},
},
neUser: {
auth: {

View File

@@ -630,6 +630,16 @@ export default {
addTitle: "新增主机命令",
editTitle: "编辑主机命令",
},
neVersion: {
upgrade: "升级到新版本",
upgradeTip: "确认要升级到新版本吗?",
upgradeTipEmpty: "当前没有可用的升级",
upgradeTipEqual: "当前版本与新版本相同",
rollback: '回滚到以前的版本',
rollbackTip: "确认要回滚到上一版本吗?",
rollbackTipEmpty: "目前没有可用的回滚",
rollbackTipEqual: '当前版本与之前版本相同',
},
},
neUser: {
auth: {

View File

@@ -265,36 +265,33 @@ function fnRecordVersion(
action: 'upgrade' | 'rollback',
row: Record<string, any>
) {
let contentTip = `${action} version packages?`;
if (action === 'upgrade') {
contentTip = t('views.ne.neVersion.upgradeTip')
if (row.newVersion === '' || row.newVersion === '-') {
message.warning('There are currently no upgraded versions available', 3);
message.warning(t('views.ne.neVersion.upgradeTipEmpty'), 3);
return;
}
if (row.newVersion === row.version) {
message.warning(
'The current version is the same as the previous version',
3
);
message.warning(t('views.ne.neVersion.upgradeTipEqual'), 3);
return;
}
}
if (action === 'rollback') {
contentTip = t('views.ne.neVersion.rollbackTip')
if (row.preVersion === '' || row.preVersion === '-') {
message.warning('There are currently no rollback versions available', 3);
message.warning(t('views.ne.neVersion.rollbackTipEmpty'), 3);
return;
}
if (row.preVersion === row.version) {
message.warning(
'The current version is the same as the previous version',
3
);
message.warning(t('views.ne.neVersion.rollbackTipEqual'), 3);
return;
}
}
Modal.confirm({
title: t('common.tipTitle'),
content: `${action} version packages?`,
content: contentTip,
onOk() {
if (modalState.confirmLoading) return;
modalState.confirmLoading = true;
@@ -324,7 +321,6 @@ function fnRecordVersion(
return;
}
fnGetList(1);
console.log(res);
} else {
message.error(res.msg, 3);
}
@@ -592,8 +588,10 @@ onMounted(() => {
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'id'">
<a-space :size="8" align="center">
<a-tooltip>
<template #title>Upgrade To Previous version</template>
<a-tooltip placement="topRight">
<template #title>
{{ t('views.ne.neVersion.upgrade') }}
</template>
<a-button
type="link"
@click.prevent="fnRecordVersion('upgrade', record)"
@@ -601,8 +599,10 @@ onMounted(() => {
<template #icon><ThunderboltOutlined /></template>
</a-button>
</a-tooltip>
<a-tooltip>
<template #title>Rollback To New Version</template>
<a-tooltip placement="topRight">
<template #title>
{{ t('views.ne.neVersion.rollback') }}
</template>
<a-button
type="link"
@click.prevent="fnRecordVersion('rollback', record)"