style: 快速开站多语言翻译

This commit is contained in:
TsMask
2024-05-24 09:41:20 +08:00
parent 7c78eab431
commit f94b1ef44a
8 changed files with 335 additions and 255 deletions

View File

@@ -59,7 +59,7 @@ function fnTabClose(key: string) {
const item = tabState.panes[tabIndex];
Modal.confirm({
title: t('common.tipTitle'),
content: `确认要删除${item.data.neType}@${item.data.neId}网元信息?`,
content: `${item.data.neName} ${t('views.ne.neInfo.delTip')}`,
onOk() {
delNeInfo(item.data.id).finally(() => {
tabState.panes.splice(tabIndex, 1);
@@ -99,8 +99,8 @@ function fnTabCreate() {
addr: '',
port: 22,
user: '',
authMode: '2',
password: 'user',
authMode: '0',
password: '',
privateKey: '',
passPhrase: '',
remark: '',
@@ -153,7 +153,7 @@ function fnHostTest(row: Record<string, any>) {
/**测试主机连接-免密直连 */
function fnHostAuthorized(row: Record<string, any>) {
if (tabState.confirmLoading) return;
if (tabState.confirmLoading || !row.addr) return;
Modal.confirm({
title: t('common.tipTitle'),
@@ -255,7 +255,7 @@ function fnSaveFinish(pane: any) {
tabItem.status = true;
}
message.success({
content: '操作成功',
content: t('common.operateOk'),
duration: 3,
});
} else {
@@ -288,7 +288,7 @@ function fnSaveFinishFailed(e: any) {
function fnStepPrev() {
Modal.confirm({
title: t('common.tipTitle'),
content: '确认要退出网元安装吗?',
content: t('views.system.quickStart.stepNeInfoStepPrev'),
onOk() {
fnToStepName('SystemConfig');
},
@@ -300,7 +300,7 @@ function fnStepNext(stepName: 'NeInfoConfigPara5G') {
if (stepName === 'NeInfoConfigPara5G') {
Modal.confirm({
title: t('common.tipTitle'),
content: '确认要下一步进行网元公共参数的设置?',
content: t('views.system.quickStart.stepNeInfoStepNext'),
onOk() {
fnToStepName('NeInfoConfigPara5G');
},
@@ -370,7 +370,9 @@ onMounted(() => {
<template #rightExtra>
<a-space :size="8" align="center">
<a-tooltip placement="topRight">
<template #title> 新增网元 </template>
<template #title>
{{ t('views.ne.neInfo.addTitle') }}
</template>
<a-button type="default" shape="circle" @click="fnTabCreate()">
<template #icon><PlusOutlined /></template>
</a-button>
@@ -404,11 +406,11 @@ onMounted(() => {
<a-row :gutter="16">
<a-col :lg="12" :md="12" :xs="24">
<a-form-item
:label="t('views.configManage.neManage.neType')"
:label="t('views.ne.common.neType')"
name="neType"
:rules="{
required: true,
message: '请输入网元类型',
message: t('views.ne.common.neTypePlease'),
}"
>
<a-auto-complete
@@ -422,13 +424,13 @@ onMounted(() => {
>
<a-input
allow-clear
:placeholder="t('common.inputPlease')"
:placeholder="t('views.ne.common.neTypePlease')"
:maxlength="32"
>
<template #prefix>
<a-tooltip placement="topLeft">
<template #title>
{{ t('views.configManage.neManage.neTypeTip') }}
{{ t('views.ne.common.neTypeTip') }}
</template>
<InfoCircleOutlined
style="color: rgba(0, 0, 0, 0.45)"
@@ -441,23 +443,23 @@ onMounted(() => {
</a-col>
<a-col :lg="12" :md="12" :xs="24">
<a-form-item
:label="t('views.configManage.neManage.neId')"
:label="t('views.ne.common.neId')"
name="neId"
:rules="{
required: true,
message: '请输入网元标识',
message: t('views.ne.common.neIdPlease'),
}"
>
<a-input
v-model:value="pane.data.neId"
allow-clear
:placeholder="t('common.inputPlease')"
:placeholder="t('views.ne.common.neIdPlease')"
:maxlength="24"
>
<template #prefix>
<a-tooltip placement="topLeft">
<template #title>
{{ t('views.configManage.neManage.neIdTip') }}
{{ t('views.ne.common.neIdTip') }}
</template>
<InfoCircleOutlined style="color: rgba(0, 0, 0, 0.45)" />
</a-tooltip>
@@ -470,7 +472,7 @@ onMounted(() => {
<a-row :gutter="16">
<a-col :lg="12" :md="12" :xs="24">
<a-form-item
:label="t('views.configManage.neManage.ip')"
:label="t('views.ne.common.ipAddr')"
name="ip"
:rules="{
required: true,
@@ -480,7 +482,7 @@ onMounted(() => {
<a-input
v-model:value="pane.data.ip"
allow-clear
:placeholder="t('common.inputPlease')"
:placeholder="t('views.ne.common.ipAddrPlease')"
:maxlength="128"
@change="e => fnNeIPChange(e, pane.data)"
>
@@ -488,7 +490,7 @@ onMounted(() => {
<a-tooltip placement="topLeft">
<template #title>
<div>
{{ t('views.ne.neInfo.ipAddr') }}
{{ t('views.ne.common.ipAddrTip') }}
</div>
</template>
<InfoCircleOutlined style="color: rgba(0, 0, 0, 0.45)" />
@@ -497,177 +499,146 @@ onMounted(() => {
</a-input>
</a-form-item>
</a-col>
<a-col :lg="12" :md="12" :xs="24">
<a-form-item
:label="t('views.configManage.neManage.port')"
name="port"
:rules="{
required: true,
message: '请输入网元端口',
}"
>
<a-input-number
v-model:value="pane.data.port"
style="width: 100%"
:min="1"
:max="65535"
:maxlength="5"
placeholder="<=65535"
>
<template #prefix>
<a-tooltip placement="topLeft">
<template #title>
<div>
{{ t('views.configManage.neManage.portTip') }}
</div>
</template>
<InfoCircleOutlined style="color: rgba(0, 0, 0, 0.45)" />
</a-tooltip>
</template>
</a-input-number>
</a-form-item>
</a-col>
<a-col :lg="12" :md="12" :xs="24"> </a-col>
</a-row>
<a-divider orientation="left">
{{ t('views.ne.neInfo.hostConfig') }}
</a-divider>
<template v-if="pane.data.hosts.length > 0">
<a-divider orientation="left">
{{ t('views.ne.neInfo.hostConfig') }}
</a-divider>
<!-- 主机连接配置 -->
<a-collapse class="collapse" ghost>
<a-collapse-panel
v-for="host in pane.data.hosts.filter((s:any)=>s.hostType === 'ssh')"
:key="host.title"
:header="`${host.hostType.toUpperCase()} ${host.port}`"
<!-- 主机连接配置 -->
<a-row :gutter="16">
<a-col :lg="12" :md="12" :xs="24">
<a-form-item :label="t('views.ne.neHost.addr')">
<a-input
v-model:value="pane.data.hosts[0].addr"
allow-clear
:maxlength="128"
:placeholder="t('common.inputPlease')"
>
</a-input>
</a-form-item>
</a-col>
<a-col :lg="12" :md="12" :xs="24">
<a-form-item :label="t('views.ne.neHost.port')" name="port">
<a-input-number
v-model:value="pane.data.hosts[0].port"
:min="10"
:max="65535"
:step="1"
:maxlength="5"
:placeholder="t('common.inputPlease')"
style="width: 100%"
></a-input-number>
</a-form-item>
</a-col>
</a-row>
<a-row :gutter="16">
<a-col :lg="12" :md="12" :xs="24">
<a-form-item :label="t('views.ne.neHost.user')">
<a-input
v-model:value="pane.data.hosts[0].user"
allow-clear
:maxlength="32"
:placeholder="t('common.inputPlease')"
>
</a-input>
</a-form-item>
</a-col>
<a-col :lg="12" :md="12" :xs="24">
<a-form-item :label="t('views.ne.neHost.authMode')">
<a-select
v-model:value="pane.data.hosts[0].authMode"
default-value="0"
:options="dict.neHostAuthMode"
>
</a-select>
</a-form-item>
</a-col>
</a-row>
<a-form-item
v-if="pane.data.hosts[0].authMode === '0'"
:label="t('views.ne.neHost.password')"
:label-col="{ span: 3 }"
:label-wrap="true"
>
<a-row :gutter="16">
<a-col :lg="12" :md="12" :xs="24">
<a-form-item :label="t('views.ne.neHost.addr')">
<a-input
v-model:value="host.addr"
allow-clear
:maxlength="128"
:placeholder="t('common.inputPlease')"
>
</a-input>
</a-form-item>
</a-col>
<a-col :lg="12" :md="12" :xs="24">
<a-form-item :label="t('views.ne.neHost.port')" name="port">
<a-input-number
v-model:value="host.port"
:min="10"
:max="65535"
:step="1"
:maxlength="5"
style="width: 100%"
></a-input-number>
</a-form-item>
</a-col>
</a-row>
<a-input-password
v-model:value="pane.data.hosts[0].password"
:maxlength="128"
:placeholder="t('common.inputPlease')"
>
</a-input-password>
</a-form-item>
<a-row :gutter="16">
<a-col :lg="12" :md="12" :xs="24">
<a-form-item :label="t('views.ne.neHost.user')">
<a-input
v-model:value="host.user"
allow-clear
:maxlength="32"
:placeholder="t('common.inputPlease')"
>
</a-input>
</a-form-item>
</a-col>
<a-col :lg="12" :md="12" :xs="24">
<a-form-item :label="t('views.ne.neHost.authMode')">
<a-select
v-model:value="host.authMode"
default-value="0"
:options="dict.neHostAuthMode"
:disabled="host.hostType === 'telnet'"
>
</a-select>
</a-form-item>
</a-col>
</a-row>
<template v-if="pane.data.hosts[0].authMode === '1'">
<a-form-item
:label="t('views.ne.neHost.privateKey')"
:label-col="{ span: 3 }"
:label-wrap="true"
>
<a-textarea
v-model:value="pane.data.hosts[0].privateKey"
:auto-size="{ minRows: 4, maxRows: 6 }"
:maxlength="3000"
:show-count="true"
:placeholder="t('views.ne.neHost.privateKeyPlease')"
/>
</a-form-item>
<a-form-item
v-if="host.authMode === '0'"
:label="t('views.ne.neHost.password')"
:label="t('views.ne.neHost.passPhrase')"
:label-col="{ span: 3 }"
:label-wrap="true"
>
<a-input-password
v-model:value="host.password"
v-model:value="pane.data.hosts[0].passPhrase"
:maxlength="128"
:placeholder="t('common.inputPlease')"
>
</a-input-password>
</a-form-item>
</template>
<template v-if="host.authMode === '1'">
<a-form-item
:label="t('views.ne.neHost.privateKey')"
:label-col="{ span: 3 }"
:label-wrap="true"
>
<a-textarea
v-model:value="host.privateKey"
:auto-size="{ minRows: 4, maxRows: 6 }"
:maxlength="3000"
:show-count="true"
:placeholder="t('views.ne.neHost.privateKeyPlease')"
/>
</a-form-item>
<a-form-item
:label="t('views.ne.neHost.passPhrase')"
:label-col="{ span: 3 }"
:label-wrap="true"
>
<a-input-password
v-model:value="host.passPhrase"
:maxlength="128"
:placeholder="t('common.inputPlease')"
>
</a-input-password>
</a-form-item>
</template>
<a-form-item
:label="t('views.ne.neHost.test')"
name="test"
:label-col="{ span: 3 }"
:label-wrap="true"
<a-form-item
:label="t('views.ne.neHost.test')"
name="test"
:label-col="{ span: 3 }"
:label-wrap="true"
>
<a-button
type="dashed"
shape="round"
@click="fnHostTest(pane.data.hosts[0])"
:disabled="tabState.confirmLoading"
>
<a-button
type="primary"
shape="round"
@click="fnHostTest(host)"
:loading="tabState.confirmLoading"
>
<template #icon><LinkOutlined /></template>
</a-button>
<template #icon><LinkOutlined /></template>
</a-button>
<a-button
type="link"
@click="fnHostAuthorized(host)"
:loading="tabState.confirmLoading"
v-if="host.hostType === 'ssh' && host.authMode !== '2'"
>
免密授权
</a-button>
</a-form-item>
</a-collapse-panel>
</a-collapse>
<a-button
type="link"
@click="fnHostAuthorized(pane.data.hosts[0])"
:disabled="tabState.confirmLoading"
v-if="
pane.data.hosts[0].hostType === 'ssh' &&
pane.data.hosts[0].authMode !== '2'
"
>
{{ t('views.ne.neHost.authRSA') }}
</a-button>
</a-form-item>
</template>
<a-form-item :wrapper-col="{ offset: 10, span: 4 }">
<a-button
type="primary"
ghost
html-type="submit"
:loading="tabState.confirmLoading"
:disabled="tabState.confirmLoading"
>
保存信息
{{ t('views.system.quickStart.save') }}
</a-button>
</a-form-item>
</a-form>
@@ -676,10 +647,12 @@ onMounted(() => {
<div class="ne-oper">
<a-space direction="horizontal" :size="18">
<a-button @click="fnStepPrev()"> 退出 </a-button>
<a-button @click="fnStepPrev()">
{{ t('views.system.quickStart.exit') }}
</a-button>
<a-button type="dashed" @click="fnStepNext('NeInfoConfigPara5G')">
下一步
<a-button type="primary" @click="fnStepNext('NeInfoConfigPara5G')">
{{ t('views.system.quickStart.stepNext') }}
</a-button>
</a-space>
</div>