asset增加ip列

This commit is contained in:
zyh
2024-04-19 19:42:54 +08:00
parent 67cbcd4f14
commit d6d84d6ad0
13 changed files with 113 additions and 38 deletions

View File

@@ -29,6 +29,28 @@
display: block; display: block;
} }
} }
.ip-info{
.ip-icon{
font-size: 16px;
margin-right: 4px;
}
.red-color {
color: $--color-danger !important;
}
.green-color {
color: $--color-success !important;
}
.document-copy-text{
display: flex;
}
}
.ip-info:hover {
.active-icon-content {
display: block;
}
}
} }
.licenseStatus{ .licenseStatus{

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -5,6 +5,20 @@
"css_prefix_text": "nz-icon-", "css_prefix_text": "nz-icon-",
"description": "", "description": "",
"glyphs": [ "glyphs": [
{
"icon_id": "40012174",
"name": "MGT",
"font_class": "mgt",
"unicode": "e606",
"unicode_decimal": 58886
},
{
"icon_id": "40012142",
"name": "IPMI",
"font_class": "ipmi",
"unicode": "e605",
"unicode_decimal": 58885
},
{ {
"icon_id": "2112052", "icon_id": "2112052",
"name": "磁盘", "name": "磁盘",

File diff suppressed because one or more lines are too long

View File

@@ -105,9 +105,9 @@ export default {
label: 'sn', label: 'sn',
disabled: false disabled: false
}, { }, {
name: 'IP', name: this.$t('config.operationlog.ip'),
type: 'input', type: 'input',
label: 'manageIp', label: 'ip',
disabled: false disabled: false
}, { }, {
name: this.$t('overall.state'), name: this.$t('overall.state'),
@@ -233,7 +233,7 @@ export default {
// this.$store.commit('addConsole', consoleParam) // this.$store.commit('addConsole', consoleParam)
}, },
getTableData (params) { getTableData (params) {
let url = this.url let url = this.url
if (params && Object.keys(params).length > 0) { if (params && Object.keys(params).length > 0) {
for (const key in params) { for (const key in params) {
this.$set(this.searchLabel, key, params[key]) this.$set(this.searchLabel, key, params[key])

View File

@@ -1,7 +1,7 @@
<template> <template>
<div class="document-copy-block"> <div class="document-copy-block">
<span class="document-copy-text"> <span class="document-copy-text">
<slot name="copy-text"></slot> <slot name="copy-text"></slot>
</span> </span>
<i v-if="showInfo" class="nz-icon nz-icon-override" style="visibility: hidden" @click="onCopy(copyData)" :title="$t('overall.copyText')"></i> <i v-if="showInfo" class="nz-icon nz-icon-override" style="visibility: hidden" @click="onCopy(copyData)" :title="$t('overall.copyText')"></i>
</div> </div>

View File

@@ -44,6 +44,9 @@
<el-form-item :label="$t('asset.manageIp')" prop="manageIp"> <el-form-item :label="$t('asset.manageIp')" prop="manageIp">
<el-input maxlength="64" show-word-limit v-model="editAsset.manageIp" size="small"/> <el-input maxlength="64" show-word-limit v-model="editAsset.manageIp" size="small"/>
</el-form-item> </el-form-item>
<el-form-item :label="$t('asset.ipmiIp')" prop="ipmiIp">
<el-input maxlength="64" show-word-limit v-model="editAsset.ipmiIp" size="small"/>
</el-form-item>
<el-form-item :label="$t('asset.sn')" prop="sn"> <el-form-item :label="$t('asset.sn')" prop="sn">
<el-input maxlength="128" show-word-limit v-model="editAsset.sn" size="small"/> <el-input maxlength="128" show-word-limit v-model="editAsset.sn" size="small"/>
</el-form-item> </el-form-item>

View File

@@ -46,16 +46,41 @@
</div> --> </div> -->
<copy :copyData='scope.row.name' :showInfo='scope.row.name'> <copy :copyData='scope.row.name' :showInfo='scope.row.name'>
<template slot="copy-text"> <template slot="copy-text">
{{scope.row.name ? scope.row.name : '-'}} {{scope.row.name ? scope.row.name : '-'}}
</template> </template>
</copy> </copy>
</template> </template>
<template v-else-if="item.prop === 'manageIp'"> <template v-else-if="item.prop === 'ip'">
<copy :copyData='scope.row.manageIp' :showInfo='scope.row.manageIp'> <div class="ip-info">
<template slot="copy-text"> <copy :copyData='scope.row.manageIp' :showInfo='scope.row.manageIp' v-if="scope.row.manageIp">
{{scope.row.manageIp ? scope.row.manageIp : '-'}} <template slot="copy-text">
</template> <i
</copy> class="ip-icon nz-icon nz-icon-mgt"
:class="{
'green-color':scope.row.pingInfo && scope.row.pingInfo.status == 1,
'red-color':!scope.row.pingInfo || scope.row.pingInfo.status == 0,
}"
></i>
{{scope.row.manageIp ? scope.row.manageIp : '-'}}
</template>
</copy>
<copy :copyData='scope.row.ipmiIp' :showInfo='scope.row.ipmiIp' v-if="scope.row.ipmiIp">
<template slot="copy-text">
<i
class="ip-icon nz-icon nz-icon-ipmi"
:class="{
'green-color':scope.row.pingInfo && scope.row.pingInfo.status == 1,
'red-color':!scope.row.pingInfo || scope.row.pingInfo.status == 0,
}"
></i>
{{scope.row.ipmiIp ? scope.row.ipmiIp : ''}}
</template>
</copy>
<div class="active-icon-content" v-if="scope.row.pingInfo">
<p v-if="scope.row.pingInfo.rtt">{{$t('asset.rtt') + (scope.row.pingInfo.rtt ? scope.row.pingInfo.rtt + 'ms':'')}}</p>
<p>{{$t('asset.assetStatPre') + (scope.row.pingInfo.lastUpdate ? utcTimeToTimezoneStr(scope.row.pingInfo.lastUpdate) : $t('asset.assetStatDown'))}}</p>
</div>
</div>
</template> </template>
<template v-else-if="item.prop === 'type'">{{scope.row.type ? scope.row.type.name : '-'}}</template> <template v-else-if="item.prop === 'type'">{{scope.row.type ? scope.row.type.name : '-'}}</template>
<template v-else-if="item.prop === 'state'">{{scope.row.state ? scope.row.state.name : '-'}}</template> <template v-else-if="item.prop === 'state'">{{scope.row.state ? scope.row.state.name : '-'}}</template>
@@ -87,14 +112,14 @@
<span v-if="scope.row.cabinet && scope.row.cabinet !== '--'">{{scope.row.cabinet.name}}&nbsp;{{returnCabinet( scope.row.cabinetStart, scope.row.cabinetEnd)}}</span> <span v-if="scope.row.cabinet && scope.row.cabinet !== '--'">{{scope.row.cabinet.name}}&nbsp;{{returnCabinet( scope.row.cabinetStart, scope.row.cabinetEnd)}}</span>
<span v-else >-</span> <span v-else >-</span>
</template> </template>
<template v-else-if="item.prop === 'pingInfo'"> <!-- <template v-else-if="item.prop === 'pingInfo'">
<div class="ping-info" v-if="scope.row.pingInfo"> <div class="ping-info" v-if="scope.row.pingInfo">
<div :class="{'active-icon green-bg':scope.row.pingInfo.status == 1,'active-icon red-bg':scope.row.pingInfo.status == 0}" style="position: relative"> <div :class="{'active-icon green-bg':scope.row.pingInfo.status == 1,'active-icon red-bg':scope.row.pingInfo.status == 0}" style="position: relative">
</div> </div>
<div class="active-icon-content">{{$t('asset.assetStatPre')+(scope.row.pingInfo.lastUpdate?utcTimeToTimezoneStr(scope.row.pingInfo.lastUpdate):$t('asset.assetStatDown'))}}</div> <div class="active-icon-content">{{$t('asset.assetStatPre')+(scope.row.pingInfo.lastUpdate ? utcTimeToTimezoneStr(scope.row.pingInfo.lastUpdate) : $t('asset.assetStatDown'))}}</div>
{{scope.row.pingInfo.rtt?scope.row.pingInfo.rtt+'ms':''}} {{scope.row.pingInfo.rtt?scope.row.pingInfo.rtt+'ms':''}}
</div> </div>
</template> </template> -->
<template v-else-if="item.prop === 'model'">{{scope.row.model ? scope.row.model.name : '-'}}</template> <template v-else-if="item.prop === 'model'">{{scope.row.model ? scope.row.model.name : '-'}}</template>
<template v-else-if="item.prop === 'parent'"> <template v-else-if="item.prop === 'parent'">
<span <span
@@ -281,10 +306,10 @@ export default {
minWidth: 150, minWidth: 150,
sortable: 'custom' sortable: 'custom'
}, { }, {
label: this.$t('asset.manageIp'), label: this.$t('config.operationlog.ip'),
prop: 'manageIp', prop: 'ip',
show: true, show: true,
minWidth: 140, minWidth: 200,
sortable: 'custom' sortable: 'custom'
}, { }, {
label: this.$t('asset.parent'), label: this.$t('asset.parent'),
@@ -308,11 +333,6 @@ export default {
show: true, show: true,
minWidth: 110, minWidth: 110,
sortable: 'custom' sortable: 'custom'
}, {
label: this.$t('asset.pingInfo'),
prop: 'pingInfo',
show: true,
minWidth: 110
}, { }, {
label: this.$t('overall.dc'), label: this.$t('overall.dc'),
prop: 'dc', prop: 'dc',

View File

@@ -317,10 +317,10 @@ export default {
id: 'sn', id: 'sn',
disabled: false disabled: false
}, { }, {
name: 'IP', name: this.$t('config.operationlog.ip'),
type: 'input', type: 'input',
label: 'manageIp', label: 'ip',
id: 'manageIp', id: 'ip',
disabled: false disabled: false
}, { }, {
name: this.$t('overall.state'), name: this.$t('overall.state'),
@@ -954,16 +954,16 @@ export default {
}, },
jsonKey: 'val' jsonKey: 'val'
}, },
manageIp: { ip: {
target: this.searchLabel, target: this.searchLabel,
isSearchInput: true, isSearchInput: true,
propertyName: 'manageIp', propertyName: 'ip',
type: 'number', type: 'string',
defaultJson: { defaultJson: {
disabled: false, disabled: false,
id: 'manageIp', id: 'ip',
label: 'manageIp', label: 'ip',
name: 'IP', name: this.$t('config.operationlog.ip'),
type: 'input', type: 'input',
val: '' val: ''
}, },