diff --git a/nezha-fronted/src/components/common/js/constants.js b/nezha-fronted/src/components/common/js/constants.js index 7538d06fc..f79981f8a 100644 --- a/nezha-fronted/src/components/common/js/constants.js +++ b/nezha-fronted/src/components/common/js/constants.js @@ -364,6 +364,7 @@ export const fromRoute = { menus: 'menus', notify: 'notify', link: 'link', + ipam: 'ipam', apiKey: 'apiKey', chartTemp: 'chartTemp' } diff --git a/nezha-fronted/src/components/common/mixin/dataList.js b/nezha-fronted/src/components/common/mixin/dataList.js index 942645b84..a2e2b49f1 100644 --- a/nezha-fronted/src/components/common/mixin/dataList.js +++ b/nezha-fronted/src/components/common/mixin/dataList.js @@ -851,6 +851,114 @@ export default { jsonKey: 'val' } } + } else if (path === 'ipam') { + searchKeys = { + // key: path 键 + // value: vue set 参数 + pageNo: { target: this.pageObj, propertyName: 'pageNo', type: 'number' }, + pageSize: { target: this.pageObj, propertyName: 'pageSize', type: 'number' }, + orderBy: { target: this.$data, propertyName: 'orderBy', type: 'string' }, + ids: { + target: this.searchLabel, + isSearchInput: true, + propertyName: 'ids', + type: 'string', + defaultJson: { + disabled: false, + label: 'ids', + name: 'ID', + type: 'input', + val: '' + }, + jsonKey: 'val' + }, + name: { + target: this.searchLabel, + isSearchInput: true, + propertyName: 'name', + type: 'string', + defaultJson: { + disabled: false, + id: 'name', + label: 'name', + name: 'Name', + type: 'input', + val: '' + }, + jsonKey: 'val' + }, + type: { + target: this.searchLabel, + isSearchInput: true, + propertyName: 'type', + type: 'number', + defaultJson: { + disabled: false, + label: 'ipamType', + name: 'Type', + readonly: true, + type: 'select', + val: '' + }, + jsonKey: 'val' + }, + addr: { + target: this.searchLabel, + isSearchInput: true, + propertyName: 'addr', + type: 'string', + defaultJson: { + disabled: false, + label: 'addr', + name: 'Addr', + type: 'input', + val: '' + }, + jsonKey: 'val' + }, + mask: { + target: this.searchLabel, + isSearchInput: true, + propertyName: 'mask', + type: 'string', + defaultJson: { + disabled: false, + label: 'mask', + name: 'Mask', + type: 'input', + val: '' + }, + jsonKey: 'val' + }, + vlan: { + target: this.searchLabel, + isSearchInput: true, + propertyName: 'vlan', + type: 'string', + defaultJson: { + disabled: false, + label: 'vlan', + name: 'Vlan', + type: 'input', + val: '' + }, + jsonKey: 'val' + }, + dc: { + target: this.searchLabel, + isSearchInput: true, + propertyName: 'dc', + type: 'string', + defaultJson: { + disabled: false, + label: 'dcId', + name: 'Data center', + type: 'input', + val: '' + }, + jsonKey: 'val' + } + } } this.initQueryFromPath(searchKeys) }, diff --git a/nezha-fronted/src/components/common/popBox/topToolMoreOptions.vue b/nezha-fronted/src/components/common/popBox/topToolMoreOptions.vue index 84829587e..567087b2e 100644 --- a/nezha-fronted/src/components/common/popBox/topToolMoreOptions.vue +++ b/nezha-fronted/src/components/common/popBox/topToolMoreOptions.vue @@ -213,6 +213,8 @@ export default { url = '/dc/cabinet/cancelImport' } else if (this.importUrl.indexOf('dc') > -1) { url = '/dc/cancelImport' + } else if (this.importUrl.indexOf('/ipam/subnet') > -1) { + url = '/ipam/subnet/cancelImport' } this.$delete(url + '?seq=' + this.importResult.seq).then(response => { if (response.code == 200) { @@ -306,8 +308,9 @@ export default { url = '/dc/cabinet/template' } else if (this.importUrl.indexOf('dc') > -1) { url = '/dc/template' + } else if (this.importUrl.indexOf('/ipam/subnet') > -1) { + url = '/ipam/subnet/template' } - if (!url) { console.error('no interface support') } diff --git a/nezha-fronted/src/components/common/rightBox/ipamBox.vue b/nezha-fronted/src/components/common/rightBox/ipamBox.vue new file mode 100644 index 000000000..037e06bef --- /dev/null +++ b/nezha-fronted/src/components/common/rightBox/ipamBox.vue @@ -0,0 +1,171 @@ + + + diff --git a/nezha-fronted/src/components/common/searchInput.vue b/nezha-fronted/src/components/common/searchInput.vue index effebc2c2..19a69227b 100644 --- a/nezha-fronted/src/components/common/searchInput.vue +++ b/nezha-fronted/src/components/common/searchInput.vue @@ -865,7 +865,7 @@ export default { this.select_list.forEach(val => { if (typeof (val.val) !== 'undefined' && val.val != null) { if (val.type === 'select') { - if (val.label === 'alertType' || val.label === 'promType') { + if (val.label === 'alertType' || val.label === 'promType' || val.label === 'ipamType') { objectInfo.type = val.valnum } else if (val.label === 'assetState') { objectInfo.state = val.valnum diff --git a/nezha-fronted/src/components/common/searchSelectInfo.vue b/nezha-fronted/src/components/common/searchSelectInfo.vue index b30c9d3d9..e3f0d0f0a 100644 --- a/nezha-fronted/src/components/common/searchSelectInfo.vue +++ b/nezha-fronted/src/components/common/searchSelectInfo.vue @@ -253,6 +253,10 @@ const searchSelectInfo = { // value: 传给后台的值;label:显示给用 name: 'SNMP trap', searchType: 'alertTypes' } + ], + ipamType: [ + { label: 'IPV4', value: 4 }, + { label: 'IPV6', value: 6 } ] } export default searchSelectInfo diff --git a/nezha-fronted/src/components/common/table/settings/ipamTable.vue b/nezha-fronted/src/components/common/table/settings/ipamTable.vue new file mode 100644 index 000000000..88ebcb731 --- /dev/null +++ b/nezha-fronted/src/components/common/table/settings/ipamTable.vue @@ -0,0 +1,151 @@ + + + diff --git a/nezha-fronted/src/components/page/config/ipam.vue b/nezha-fronted/src/components/page/config/ipam.vue new file mode 100644 index 000000000..8ea5b2b67 --- /dev/null +++ b/nezha-fronted/src/components/page/config/ipam.vue @@ -0,0 +1,143 @@ + + diff --git a/nezha-fronted/src/router/index.js b/nezha-fronted/src/router/index.js index 33096d780..4b2a0b591 100644 --- a/nezha-fronted/src/router/index.js +++ b/nezha-fronted/src/router/index.js @@ -98,6 +98,10 @@ export default new Router({ path: '/about', component: resolve => require(['../components/page/config/about.vue'], resolve) }, + { + path: '/ipam', + component: resolve => require(['../components/page/config/ipam.vue'], resolve) + }, { path: '/profile', component: resolve => require(['../components/page/config/profile.vue'], resolve)