-
-
-
- {{item.key || item.name || item.label}}
+
+
+
+
+
+ {{item.key || item.name || item.label}}
+
-
更多
+
+
+
+
更多
@@ -42,10 +55,6 @@ export default {
},
selectValue: {
type: Object
- },
- height: {
- type: Number,
- default: 116
}
},
computed: { },
@@ -65,7 +74,6 @@ export default {
deep: true,
handler (n) {
this.selectValueOut = { ...n }
- // this.$emit('reload', this.selectValue)
}
},
selectValueOut: {
@@ -87,15 +95,40 @@ export default {
window.addEventListener('resize', this.needMore)
},
methods: {
+ casChange (type, key) {
+ const cascs = this.$refs[`${type}_cascader`]
+ if (type === 'assetLabel') { // label特殊处理,组织成{“id”:[“张三”,"lw"],"id":["李四"]}
+ const values = {}
+ cascs.forEach(c => {
+ const nodes = c.getCheckedNodes()
+ nodes.forEach(n => {
+ const metaId = n.data.metaId
+ if (values[`${metaId}`]) {
+ values[`${metaId}`].push(n.data.name)
+ } else {
+ values[`${metaId}`] = [n.data.name]
+ }
+ })
+ })
+ this.selectValueOut[key] = JSON.stringify(values)
+ } else {
+ const values = new Set()
+ cascs.forEach(c => {
+ const nodes = c.getCheckedNodes()
+ nodes.forEach(n => values.add(n.data.id))
+ })
+ this.selectValueOut[key] = [...values]
+ }
+ },
needMore (key) {
- setTimeout(() => {
+ /* setTimeout(() => {
this.contentWidth = this.$refs.searchContent[0].$el.offsetWidth
Object.keys(this.titleSearchListCopy).forEach(key => {
this.titleSearchListCopy[key].width = 0
this.titleSearchListCopy[key].showMore = false
this.titleSearchListCopy[key].children.forEach((item, i) => {
- /* (基础宽度 + 文字宽度) 总和 》 文本长时 显示更多 */
+ /!* (基础宽度 + 文字宽度) 总和 》 文本长时 显示更多 *!/
this.titleSearchListCopy[key].width += 60 + item.name.length * 12
if (this.titleSearchListCopy[key].width > this.contentWidth && !this.titleSearchListCopy[key].showMore) {
this.titleSearchListCopy[key].showMore = true
@@ -103,7 +136,7 @@ export default {
}
})
}, 100)
- })
+ }) */
},
changShowMore (key) {
this.titleSearchListCopy[key].showMore = !this.titleSearchListCopy[key].showMore
@@ -115,56 +148,55 @@ export default {
}
-
diff --git a/nezha-fronted/src/components/common/home.vue b/nezha-fronted/src/components/common/home.vue
deleted file mode 100644
index f9ae157c0..000000000
--- a/nezha-fronted/src/components/common/home.vue
+++ /dev/null
@@ -1,47 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/nezha-fronted/src/components/common/js/constants.js b/nezha-fronted/src/components/common/js/constants.js
index 7aea1d0d9..1bf74d5d5 100644
--- a/nezha-fronted/src/components/common/js/constants.js
+++ b/nezha-fronted/src/components/common/js/constants.js
@@ -80,12 +80,10 @@ export const asset = {
{ value: 3, label: i18n.t('asset.suspended') }
],
authProtocolOptions: [
- { value: 0, label: 'Non' },
{ value: 1, label: 'SSH' },
{ value: 2, label: 'TELNET' }
],
authProtocolData: {
- non: 0,
ssh: 1,
telnet: 2
},
diff --git a/nezha-fronted/src/components/common/language/cn.js b/nezha-fronted/src/components/common/language/cn.js
index bb54084f0..d8f0a47a4 100644
--- a/nezha-fronted/src/components/common/language/cn.js
+++ b/nezha-fronted/src/components/common/language/cn.js
@@ -503,115 +503,11 @@ const cn = {
assetType: '资产类型', // '资产类型'
batchEditAsset: '批量修改资产',
selectAsset: '已选择的资产',
- editAssetTab: {
- title: '新增资产',
- sn: 'SN',
- host: '主机',
- state: '状态',
- modelId: '模块',
- alert: '告警信息',
- assetInfo: '资产信息',
- assetType: '资产类型',
- vendor: '厂商/型号',
- vendorTab: {
- vendor: '厂商/型号',
- vendorName: '新厂商',
- existVendor: '已有厂商',
- modelName: '新型号',
- existModel: '已有型号'
- },
- purchaseDate: '购买日期',
- dataSelectTip: '请选择日期',
- dc: '数据中心',
- dcName: '数据中心名称',
- AddIdcTab: {
- title: '新增数据中心',
- dcName: '数据中心名称',
- location: '地区',
- principal: '负责人',
- tel: '电话'
- },
- editIdcTab: {
- title: '编辑数据中心',
- dcName: '数据中心名称',
- location: '地区',
- principal: '负责人',
- tel: '电话'
- },
- location: '地区',
- principal: '负责人',
- tel: '电话',
- cabinet: '机柜',
- AddCabinetTab: {
- title: '新增机柜',
- name: '名称',
- uSize: 'U位',
- remark: '描述',
- DC: '数据中心'
- },
- editCabinetTab: {
- title: '编辑机柜',
- name: '名称',
- uSize: 'U位',
- remark: '描述',
- DC: '数据中心'
- },
- uSize: 'U位',
- remark: '描述',
- cli: 'CLI账号',
- loginType: '登录类型',
- password: '密码',
- ssh: 'SSH-Key',
- account: '用户名',
- port: '端口',
- upload: '上传',
- clickToUpload: '上传'
- },
- tableTitle: {
- id: 'ID',
- assetType: '资产类型',
- device: 'SN',
- host: 'Host',
- assetState: '状态',
- modules: 'Endpoint',
- alerts: '告警信息',
- dataCenter: '数据中心',
- cabinet: '机柜',
- model: '型号',
- manufacturer: '厂商',
- procurementDate: '购买日期',
- principal: '负责人',
- principalTel: '电话',
- option: '操作',
- assetPing: 'Ping',
- lastReply: 'Ping最后应答',
- vendor: '厂商',
- sn: 'SN',
- name: 'Name',
- manageIp: 'manageIp',
- brand: '品牌',
- dc: '数据中心',
- type: '主机地址',
- state: '主机状态',
- endpoint: 'Endpoint'
- },
- tagTableTitle: {
- projectName: '系统名称',
- moduleName: '模块名称',
- endPoint: 'EndPoint',
- alert: '告警'
- },
assets: '资产',
pingActive: '存活',
assetStatPre: '最后应答:',
assetStatDown: '未Ping通',
pingInactive: '宕机',
- left: {
- dataCenter: '数据中心',
- assetType: '资产类型',
- vendor: '厂商',
- ping: 'Ping'
- },
editAsset: '编辑资产',
createAsset: '新增资产',
host: 'Host',
@@ -665,7 +561,8 @@ const cn = {
privateKey: '秘钥',
usernamePrompt: '用户名提示',
passwordPrompt: '密码提示',
- snmpCredential: 'SNMP凭证'
+ snmpCredential: 'SNMP凭证',
+ authProtocol: '认证协议'
},
config: {
config: '设置',
diff --git a/nezha-fronted/src/components/common/language/en.js b/nezha-fronted/src/components/common/language/en.js
index 84461dc10..24022add3 100644
--- a/nezha-fronted/src/components/common/language/en.js
+++ b/nezha-fronted/src/components/common/language/en.js
@@ -551,111 +551,9 @@ const en = {
assetType: 'Asset type', // '资产类型'
principal: 'Administrator', // '负责人'
tel: 'Telephone', // '电话'
- left: {
- dataCenter: 'Data center',
- vendor: 'Vendor',
- ping: 'Ping'
- },
featureTitle: 'Attribute',
endpointUpNum: 'It\'s a normal number',
endpointNum: 'Represents the total quantity',
- editAssetTab: {
- title: 'New asset', // '新增资产'
- sn: 'SN', // SN
- host: 'Host', // 'Host'
- state: 'State', // '状态'
- modelId: 'Module', // '组件'
- alert: 'Alert information', // '告警信息'
- assetInfo: 'Asset information', // '资产信息'
- assetType: 'Asset type', // '资产类型'
- vendor: 'Vendor', // '厂商/型号'
- vendorTab: {
- vendor: 'Vendor/Model', // '厂商/型号'
- vendorName: 'New vendor', // '新厂商'
- existVendor: 'Existed vendor', // '已有厂商'
- modelName: 'New model', // '新型号'
- existModel: 'Existed model'// '已有型号'
- },
- purchaseDate: 'Purchase date', // '购买日期'
- dataSelectTip: 'Please select date', // '请选择日期'
- dc: 'Data center',
- dcName: 'Data center name', // 'DC名称'
- AddIdcTab: {
- title: 'New Data center', // '新增DC'
- dcName: 'Data center name', // 'DC名称'
- location: 'Location', // '地区'
- principal: 'Administrator', // '负责人'
- tel: 'Telephone'// '电话'
- },
- editIdcTab: {
- title: 'Edit Data center', // '编辑DC'
- dcName: 'Data center name', // 'DC名称'
- location: 'Location', // '地区'
- principal: 'Administrator', // '负责人'
- tel: 'Telephone'// '电话'
- },
- location: 'Location', // '地区'
- principal: 'Administrator', // '负责人'
- tel: 'Telephone', // '电话'
- cabinet: 'Cabinet', // '机柜'
- AddCabinetTab: {
- title: 'New cabinet', // '新增机柜'
- name: 'Name', // '名称'
- uSize: 'U size', // 'U位'
- remark: 'Description', // '描述'
- DC: 'Data center'// DC
- },
- editCabinetTab: {
- title: 'Edit cabinet', // '编辑机柜'
- name: 'Name', // '名称'
- uSize: 'U size', // 'U位'
- remark: 'Description', // '描述'
- DC: 'Data center'// DC
- },
- uSize: 'U size', // 'U位'
- remark: 'Description', // '描述'
- cli: 'CLI account', // 'CLI账号'
- loginType: 'Login type', // '登录类型'
- password: 'Password', // '密码'
- ssh: 'SSH-Key', // 'SSH-Key'
- account: 'Username', // '用户名'
- port: 'Port', // '端口'
- upload: 'Upload', // '上传'
- clickToUpload: 'Upload'// '上传'
- },
- tableTitle: {
- id: 'ID', // ID
- assetType: 'Asset type', // '资产类型'
- device: 'SN', // SN
- host: 'Host', // 'Host'
- assetState: 'State', // '状态'
- assetPing: 'Ping',
- lastReply: 'Ping last reply',
- modules: 'Endpoint', // '组件'
- alerts: 'Alerts', // '告警信息'
- dataCenter: 'Data center', // DC
- cabinet: 'Cabinet', // '机柜'
- model: 'Model', // '型号'
- vendor: 'Vendor', // '厂商'
- procurementDate: 'Purchase date', // '购买日期'
- principal: 'Administrator', // '负责人'
- principalTel: 'Telephone', // '电话'
- option: 'Operation', // "操作"
- sn: 'SN',
- name: 'Name',
- manageIp: 'manageIp',
- brand: 'Brand',
- dc: 'DataCenter',
- type: 'Types',
- state: 'State',
- endpoint: 'Endpoint'
- },
- tagTableTitle: {
- projectName: 'Project name', // '系统名称'
- moduleName: 'Module name', // '组件名称'
- endPoint: 'End point', // 'EndPoint'
- alert: 'Alert'// '告警'
- },
active: 'Alive', // "存活",
total: 'Total', // "总数",
down: 'Down',
@@ -671,7 +569,8 @@ const en = {
privateKey: 'Private key',
usernamePrompt: 'Username prompt',
passwordPrompt: 'Password prompt',
- snmpCredential: 'SNMP credential'
+ snmpCredential: 'SNMP credential',
+ authProtocol: 'Auth protocol'
},
config: {
config: 'Settings', // "设置"
@@ -1094,7 +993,7 @@ const en = {
exprTempImport: 'expression template import',
exprTempExport: 'expression template export',
exprTempImportCancel: 'expression template import rollback',
- copy: 'Copy',
+ copy: 'Duplicate',
name: 'Name',
gname: 'Group',
expression: 'Expression',
diff --git a/nezha-fronted/src/components/common/leftMenu.vue b/nezha-fronted/src/components/common/leftMenu.vue
deleted file mode 100644
index d064e4326..000000000
--- a/nezha-fronted/src/components/common/leftMenu.vue
+++ /dev/null
@@ -1,800 +0,0 @@
-
-
-
-
-
-
-
-
diff --git a/nezha-fronted/src/components/common/rightBox/asset/assetBatchEditBox.vue b/nezha-fronted/src/components/common/rightBox/asset/assetBatchEditBox.vue
index c74d63f1c..03baca0ac 100644
--- a/nezha-fronted/src/components/common/rightBox/asset/assetBatchEditBox.vue
+++ b/nezha-fronted/src/components/common/rightBox/asset/assetBatchEditBox.vue
@@ -83,19 +83,19 @@
-
+
-
-
+
+ 1 ? label.value.splice(i, 1) : ''">
-
+
- {{item.name}}
+ {{item.name}}
@@ -103,15 +103,15 @@
-
+
-
+
-
+
@@ -120,14 +120,14 @@
-
+
-
+
@@ -237,9 +237,10 @@ export default {
url: 'asset/asset',
editData: {
editType: 1,
- authProtocol: 0,
+ authProtocol: 1,
authType: 1,
fields: [],
+ port: 22,
snmpCredentialId: null
},
labelCascProp: {
diff --git a/nezha-fronted/src/components/common/rightBox/asset/assetBox.vue b/nezha-fronted/src/components/common/rightBox/asset/assetBox.vue
index 6935182d3..2ad2a09ee 100644
--- a/nezha-fronted/src/components/common/rightBox/asset/assetBox.vue
+++ b/nezha-fronted/src/components/common/rightBox/asset/assetBox.vue
@@ -79,10 +79,82 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{item.name}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -137,6 +209,9 @@