asset type页面新增列表属性

This commit is contained in:
@changcode
2021-04-28 14:21:01 +08:00
parent 248f72c2e0
commit 0cbba3073d
7 changed files with 59 additions and 10 deletions

View File

@@ -81,7 +81,7 @@ export const asset = {
],
assetType: {
authProtocolOptions: [
{ value: 0, label: '' },
{ value: 0, label: 'nothing' },
{ value: 1, label: 'SSH' },
{ value: 2, label: 'TELNET' }
],

View File

@@ -977,7 +977,10 @@ const en = {
vmh:'VMH',
authProtocol:'AuthProtocol',
snmpEnable: 'SnmpEnable',
snmpCollect:'SnmpCollect',
createModel:'CreateModel',
sshCollect:'SshCollect',
sshCollectScript:'SshCollectScript',
parent: 'Parent',
pname: 'Parent name',
editAssetType: 'Edit asset type',

View File

@@ -46,6 +46,27 @@
:inactive-value="0">
</el-switch>
</el-form-item>
<!--snmpCollect-->
<el-form-item :label='$t("config.assetType.snmpCollect")' prop="snmpCollect">
<el-switch
v-model="editAssetType.snmpCollect"
active-color="#ee9d3f"
:active-value="1"
:inactive-value="0">
</el-switch>
</el-form-item>
<!--sshCollect-->
<el-form-item :label='$t("config.assetType.sshCollect")' prop="sshCollect">
<el-switch
v-model="editAssetType.sshCollect"
active-color="#ee9d3f"
:active-value="1"
:inactive-value="0">
</el-switch>
</el-form-item>
<el-form-item :label='$t("config.assetType.sshCollectScript")' prop="sshCollectScript">
<el-input v-model="editAssetType.sshCollectScript" size="small" type="text"></el-input>
</el-form-item>
<!-- ChartTemplate -->
<!-- <el-form-item :label="$t('config.type.ChartTemplate')" prop="ChartTemplate">
<v-selectpage

View File

@@ -304,8 +304,7 @@ export default {
save () {
if (this.prevent_opt.save) {
return
}
;
};
this.prevent_opt.save = true
this.$refs.editAssetMetaForm.validate((valid) => {
if (valid) {

View File

@@ -42,14 +42,25 @@
</div>
<div v-else-if=" item.prop === 'authProtocol' ">
<div v-if="scope.row[item.prop] === 1">SSH</div>
<div v-else-if="scope.row[item.prop] === 0"></div>
<div v-else-if="scope.row[item.prop] === 0">nothing</div>
<div v-else-if="scope.row[item.prop] === 2">telnet</div>
</div>
<div v-else-if=" item.prop === 'snmpEnable' ">
<div v-if="scope.row[item.prop] === 1">Enabled</div>
<div v-else-if="scope.row[item.prop] === 0">Disabled</div>
</div>
<span v-else-if="scope.row[item.prop]">{{scope.row[item.prop] || '-'}}</span>
<div v-else-if=" item.prop === 'snmpCollect' ">
<div v-if="scope.row[item.prop] === 1">Enabled</div>
<div v-else-if="scope.row[item.prop] === 0">Disabled</div>
</div>
<div v-else-if=" item.prop === 'sshCollect' ">
<div v-if="scope.row[item.prop] === 1">Enabled</div>
<div v-else-if="scope.row[item.prop] === 0">Disabled</div>
</div>
<div v-else-if="item.prop === 'sshCollectScript'">
<div>{{ scope.row[item.prop] || '-' }}</div>
</div>
<span v-else-if="scope.row[item.prop]">{{ scope.row[item.prop] || '-' }}</span>
<template v-else>-</template>
</template>
</el-table-column>
@@ -108,6 +119,20 @@ export default {
label: this.$t('config.assetType.snmpEnable'),
prop: 'snmpEnable',
show: true,
},{
label: this.$t('config.assetType.snmpCollect'),
prop: 'snmpCollect',
show: true,
},
{
label: this.$t('config.assetType.sshCollect'),
prop: 'sshCollect',
show: true,
},
{
label: this.$t('config.assetType.sshCollectScript'),
prop: 'sshCollectScript',
show: true,
}
]
}

View File

@@ -54,12 +54,11 @@
</nz-data-list>
<!--侧滑-->
<transition name="right-box">
<assetMetaBox v-if="rightBox.metaShow" ref="assetMetaBox" :asset-meta="object"
@close="closeRightBox"></assetMetaBox>
<asset-meta-box v-if="rightBox.metaShow" ref="assetMetaBox" v-bind:asset-label="object" @close="closeRightBox"></asset-meta-box>
</transition>
<transition name="right-box">
<assetMetaGroup v-if="rightBox.groupShow" :metaGroup="metaGroup" @close="closeRightBox"
ref="assetMetaBox"></assetMetaGroup>
<asset-meta-group v-if="rightBox.groupShow" :metaGroup="metaGroup" @close="closeRightBox"
ref="assetMetaBox"></asset-meta-group>
</transition>
</div>
</template>

View File

@@ -65,7 +65,9 @@ export default {
vm: '',
vmh:'',
authProtocol:'',
snmpEnable:''
snmpEnable:'',
snmpCollect:'',
sshCollect:''
},
tableId: 'typeConfTable',
searchMsg: { // 给搜索框子组件传递的信息