NEZ-1734 fix:页面 国际化的问题

This commit is contained in:
zhangyu
2022-03-24 15:59:05 +08:00
parent 5b6c728d6b
commit fae3c0ab0c
7 changed files with 96 additions and 49 deletions

View File

@@ -169,32 +169,32 @@ export default {
panel: [
{ prop: 'panelTab', name: this.$t('overall.detail'), active: true },
{ prop: 'alertMessageTab', name: this.$t('overall.alert'), active: false },
{ prop: 'endpointTab', name: 'Endpoint', active: false },
{ prop: 'log', name: 'Log', active: false }
{ prop: 'endpointTab', name: this.$t('asset.endpoint'), active: false },
{ prop: 'log', name: this.$t('overall.logs'), active: false }
],
alertMessage: [
{ prop: 'panelTab', name: this.$t('overall.detail'), active: false },
{ prop: 'alertMessageTab', name: this.$t('overall.alert'), active: true },
{ prop: 'endpointTab', name: 'Endpoint', active: false },
{ prop: 'log', name: 'Log', active: false }
{ prop: 'endpointTab', name: this.$t('asset.endpoint'), active: false },
{ prop: 'log', name: this.$t('overall.logs'), active: false }
],
endpoint: [
{ prop: 'panelTab', name: this.$t('overall.detail'), active: false },
{ prop: 'alertMessageTab', name: this.$t('overall.alert'), active: false },
{ prop: 'endpointTab', name: 'Endpoint', active: true },
{ prop: 'log', name: 'Log', active: false }
{ prop: 'endpointTab', name: this.$t('asset.endpoint'), active: true },
{ prop: 'log', name: this.$t('overall.logs'), active: false }
],
log: [
{ prop: 'panelTab', name: this.$t('overall.detail'), active: false },
{ prop: 'alertMessageTab', name: this.$t('overall.alert'), active: false },
{ prop: 'endpointTab', name: 'Endpoint', active: false },
{ prop: 'log', name: 'Log', active: true }
{ prop: 'endpointTab', name: this.$t('asset.endpoint'), active: false },
{ prop: 'log', name: this.$t('overall.logs'), active: true }
],
alertMessageSub: [
{ prop: 'panelTab', name: this.$t('overall.detail'), active: false },
{ prop: 'alertMessageTab', name: this.$t('overall.alert'), active: false },
{ prop: 'endpointTab', name: 'Endpoint', active: false },
{ prop: 'log', name: 'Log', active: false },
{ prop: 'endpointTab', name: this.$t('asset.endpoint'), active: false },
{ prop: 'log', name: this.$t('overall.logs'), active: false },
{ prop: 'assetSubTab', name: this.$t('overall.assetSubTab'), active: true }
]
},
@@ -209,8 +209,8 @@ export default {
endpointTabTitle: [
{ prop: 'panelTab', name: this.$t('overall.detail') },
{ prop: 'endpointAlertMessage', name: this.$t('overall.alert') },
{ prop: 'Metrics', name: 'Metrics' },
{ prop: 'log', name: 'Log' }
{ prop: 'Metrics', name: this.$t('project.metrics.metrics') },
{ prop: 'log', name: this.$t('overall.logs') }
]
},
chartTemp: {
@@ -261,10 +261,10 @@ export default {
const tabs = [
{ prop: 'panelTab', name: this.$t('overall.detail') },
{ prop: 'endpointAlertMessage', name: this.$t('overall.alert') },
{ prop: 'Metrics', name: 'Metrics' }
{ prop: 'Metrics', name: this.$t('project.metrics.metrics') }
]
if (hasLog) {
tabs.push({ prop: 'log', name: 'Log' })
tabs.push({ prop: 'log', name: this.$t('overall.logs') })
}
return tabs
}

View File

@@ -450,7 +450,7 @@
</span>
</el-form-item>
<div @click="addThresholds" class="thresholds-add">
Add thresholds
{{$t('overall.addThresholds')}}
</div>
</el-row>
</transition>
@@ -486,13 +486,13 @@
<transition-group appear tag="div" name="el-zoom-in-top">
<el-row class="thresholds-item" v-show="item.show" :key="1">
<div>
<div class='mapping-display'>Title</div>
<div class='mapping-display'>{{$t('project.topology.title')}}</div>
</div>
<el-form-item :prop="'param.columns.' + index + '.title'" :rules="{ required: true, message: $t('validate.required'), trigger: 'blur'}" class="thresholds-from-item" style="flex: 1">
<el-input size="small" v-model="item.title" @change="change('columns',index)"></el-input>
</el-form-item>
<div>
<div class='mapping-display'>Unit</div>
<div class='mapping-display'>{{$t('dashboard.panel.chartForm.unit')}}</div>
</div>
<el-cascader :id="'columns-unit' + index" v-model="item.unit" :options="unitOptions" :props="{ expandTrigger: 'hover',emitPath:false }" :show-all-levels="false" filterable
placeholder=""
@@ -505,7 +505,7 @@
</el-row>
<el-row class="thresholds-item" v-show="item.show" :key="2">
<div>
<div class='mapping-display'>Display</div>
<div class='mapping-display'>{{$t('dashboard.panel.chartForm.display')}}</div>
</div>
<el-form-item :prop="'param.columns.' + index + '.display'" :rules="{ required: true, message: $t('validate.required'), trigger: 'blur'}" class="thresholds-from-item">
<el-input v-model="item.display" style="margin-right: 10px" size="small" @change="change('columns',index)"/>
@@ -514,7 +514,7 @@
</transition-group>
</div>
<div @click="addColumns" class="thresholds-add">
Add Colums
{{$t('overall.addColumns')}}
</div>
</div>
@@ -583,7 +583,7 @@
<el-option
v-for="item in mappingTypeList"
:value="item.value"
:label="item.label"
:label="$t(item.label)"
:key="item.value"/>
</el-select>
</div>
@@ -645,13 +645,13 @@
</el-row>
<el-row v-show="item.show" :key="2" class="thresholds-item">
<div v-if="isTable(chartConfig.type)">
<div class='mapping-display'>Columns</div>
<div class='mapping-display'>{{$t('dashboard.panel.chartForm.columns')}}</div>
</div>
<el-form-item v-if="isTable(chartConfig.type)" :prop="'param.valueMapping.' + index + '.column'" :rules="{ required: true, message: $t('validate.required'), trigger: 'blur'}" class="thresholds-from-item">
<el-input v-model="item.column" style="margin-right: 10px" :placeholder="$t('placeholder.chart.column')" size="small" @change="change('valueMapping', index)"/>
</el-form-item>
<div>
<div class='mapping-display'>Display</div>
<div class='mapping-display'>{{$t('dashboard.panel.chartForm.display')}}</div>
</div>
<el-form-item :prop="'param.valueMapping.' + index + '.display'" :rules="{ required: true, message: $t('validate.required'), trigger: 'blur'}" class="thresholds-from-item">
<el-input v-model="item.display" style="margin-right: 10px" :placeholder="$t('placeholder.chart.display')" size="small" @change="change('valueMapping', index)"/>
@@ -661,7 +661,7 @@
</transition-group>
</div>
<div @click="addMapping" class="thresholds-add">
Add valueMapping
{{$t('overall.addMapping')}}
</div>
</el-row>
</transition>

View File

@@ -69,16 +69,16 @@
<span>{{$t('dashboard.panel.chartForm.dataConfig')}}</span>
</div>
<el-tabs v-model="editChart.datasource" @tab-click="datasourceChange" type="card">
<el-tab-pane label="Metrics" name="metrics">
<el-tab-pane :label="$t('project.metrics.metrics')" name="metrics">
<chart-config ref="childrenFrommetrics" :type="'metrics'" v-if="editChart.datasource == 'metrics'" :params.sync="editChart" @change="editChartChange"/>
</el-tab-pane>
<el-tab-pane label="Logs" name="logs">
<el-tab-pane :label="$t('overall.logs')" name="logs">
<chart-config ref="childrenFromlogs" :type="'log'" v-if="editChart.datasource == 'logs'" :params.sync="editChart" @change="editChartChange"/>
</el-tab-pane>
<el-tab-pane label="System" name="system">
<el-tab-pane :label="$t('overall.system')" name="system">
<system-chart-config ref="childrenFromsystem" v-if="editChart.datasource == 'system'" :params.sync="editChart" @change="editChartChange"/>
</el-tab-pane>
<el-tab-pane label="Misc" name="misc">
<el-tab-pane :label="$t('overall.misc')" name="misc">
<other-chart-config ref="childrenFrommisc" v-if="editChart.datasource == 'misc'" :params.sync="editChart" @change="editChartChange"/>
</el-tab-pane>
</el-tabs>

View File

@@ -48,13 +48,13 @@ export default {
],
mappingTypeList: [
{
label: 'Value',
label: this.$t('overall.value'),
value: 'value'
}, {
label: 'Range',
label: this.$t('dashboard.panel.chartForm.valMapping.range'),
value: 'range'
}, {
label: 'Regx',
label: this.$t('dashboard.panel.chartForm.valMapping.regx'),
value: 'regx'
}
],

View File

@@ -372,7 +372,54 @@
</el-form-item>
</div>
</transition>
<!--thresholdConfig-->
<div class="form__sub-title">
<span>{{$t('dashboard.panel.chartForm.threshold')}}</span>
<el-switch
v-model="chartConfig.param.enable.thresholds"
size="small"
@change="thresholdShowChange"
></el-switch>
</div>
<transition name="el-zoom-in-top">
<el-row v-if="chartConfig.param.enable.thresholds">
<el-form-item
v-for="(item,index) in chartConfig.param.thresholds"
:key="index"
class="thresholds-item"
:prop="'param.thresholds.' + index + '.value'"
:rules="{ required: true, message: $t('validate.required'), trigger: 'blur'}"
>
<nezhaColor
:value-arr="[{name:'thresholds',value:item.color}]"
:show-text="false"
:color-val="item.color"
@colorChange="(color,key)=>{colorChange(color,key,index)}"
/>
<el-input-number
size="small"
style="margin-top: 2px"
:placeholder="$t('placeholder.chart.threshold')"
v-model.number="item.value"
:controls="false"
@blur="sortThresholds"
@change="change"
/>
<span
@click="delThresholds(index)"
class="del-thresholds-icon"
>
<i class="nz-icon nz-icon-delete" />
</span>
</el-form-item>
<div @click="addThresholds" class="thresholds-add">
{{$t('overall.addThresholds')}}
</div>
</el-row>
</transition>
</div>
<!-- table column-->
<div v-if="isTable(chartConfig.type)">
<div class="form__sub-title">
@@ -403,13 +450,13 @@
<transition-group appear tag="div" name="el-zoom-in-top">
<el-row class="thresholds-item" v-show="item.show" :key="1">
<div>
<div class='mapping-display'>Title</div>
<div class='mapping-display'>{{$t('project.topology.title')}}</div>
</div>
<el-form-item :prop="'param.columns.' + index + '.title'" :rules="{ required: true, message: $t('validate.required'), trigger: 'blur'}" class="thresholds-from-item" style="flex: 1">
<el-input size="small" v-model="item.title" @change="change('columns',index)"></el-input>
</el-form-item>
<div>
<div class='mapping-display'>Unit</div>
<div class='mapping-display'>{{$t('dashboard.panel.chartForm.unit')}}</div>
</div>
<el-cascader :id="'columns-unit' + index" v-model="item.unit" :options="unitOptions" :props="{ expandTrigger: 'hover',emitPath:false }" :show-all-levels="false" filterable
placeholder=""
@@ -422,7 +469,7 @@
</el-row>
<el-row class="thresholds-item" v-show="item.show" :key="2">
<div>
<div class='mapping-display'>Display</div>
<div class='mapping-display'>{{$t('dashboard.panel.chartForm.display')}}</div>
</div>
<el-form-item :prop="'param.columns.' + index + '.display'" :rules="{ required: true, message: $t('validate.required'), trigger: 'blur'}" class="thresholds-from-item">
<el-input v-model="item.display" style="margin-right: 10px" size="small" @change="change('columns',index)"/>
@@ -431,7 +478,7 @@
</transition-group>
</div>
<div @click="addColumns" class="thresholds-add">
Add Colums
{{$t('overall.addColumns')}}
</div>
</div>
@@ -500,7 +547,7 @@
<el-option
v-for="item in mappingTypeList"
:value="item.value"
:label="item.label"
:label="$t(item.label)"
:key="item.value"/>
</el-select>
</div>
@@ -562,13 +609,13 @@
</el-row>
<el-row v-show="item.show" :key="2" class="thresholds-item">
<div v-if="isTable(chartConfig.type)">
<div class='mapping-display'>Columns</div>
<div class='mapping-display'>{{$t('dashboard.panel.chartForm.columns')}}</div>
</div>
<el-form-item v-if="isTable(chartConfig.type)" :prop="'param.valueMapping.' + index + '.column'" :rules="{ required: true, message: $t('validate.required'), trigger: 'blur'}" class="thresholds-from-item">
<el-input v-model="item.column" style="margin-right: 10px" :placeholder="$t('placeholder.chart.column')" size="small" @change="change('valueMapping', index)"/>
</el-form-item>
<div>
<div class='mapping-display'>Display</div>
<div class='mapping-display'>{{$t('dashboard.panel.chartForm.display')}}</div>
</div>
<el-form-item :prop="'param.valueMapping.' + index + '.display'" :rules="{ required: true, message: $t('validate.required'), trigger: 'blur'}" class="thresholds-from-item">
<el-input v-model="item.display" style="margin-right: 10px" :placeholder="$t('placeholder.chart.display')" size="small" @change="change('valueMapping', index)"/>
@@ -578,7 +625,7 @@
</transition-group>
</div>
<div @click="addMapping" class="thresholds-add">
Add valueMapping
{{$t('overall.addMapping')}}
</div>
</el-row>
</transition>

View File

@@ -18,7 +18,7 @@ const searchSelectInfo = { // value: 传给后台的值label显示给用
promType: [ // promServer类型
{
value: 1,
label: 'Global'
label: i18n.t('overall.global')
},
{
value: 2,
@@ -54,22 +54,22 @@ const searchSelectInfo = { // value: 传给后台的值label显示给用
endpointState: [
{
value: 1,
label: 'UP'
label: i18n.t('config.agent.up')
}, {
value: 0,
label: 'DOWN'
label: i18n.t('config.agent.down')
}, {
value: 2,
label: 'SUSPENDED'
label: i18n.t('cconfig.dc.suspended')
}
],
promState: [
{
value: 1,
label: 'UP'
label: i18n.t('config.agent.up')
}, {
value: '0,-1',
label: 'DOWN'
label: i18n.t('config.agent.down')
}
],
pingStatus: [
@@ -240,17 +240,17 @@ const searchSelectInfo = { // value: 传给后台的值label显示给用
searchMetrics: [
{
id: 1,
name: 'Metrics',
name: i18n.t('project.metrics.metrics'),
searchType: 'alertTypes'
},
{
id: 2,
name: 'Logs',
name: i18n.t('overall.logs'),
searchType: 'alertTypes'
},
{
id: 3,
name: 'SNMP trap',
name: i18n.t('overall.SNMPTrap'),
searchType: 'alertTypes'
}
]

View File

@@ -274,12 +274,12 @@ export default {
minWidth: 110,
sortable: 'custom'
}, {
label: 'SN',
label: this.$t('asset.sn'),
prop: 'sn',
show: true,
minWidth: 110
}, {
label: 'Talon',
label: this.$t('asset.talon'),
// prop: 'clientState',
prop: 'talon',
show: true,