Skip to content

Commit

Permalink
Merge pull request #636 from veops/dev_ui_ipam
Browse files Browse the repository at this point in the history
feat(ui): add ipam
  • Loading branch information
LHRUN authored Nov 11, 2024
2 parents 57d4bf5 + 8c2cdb1 commit aae43a5
Show file tree
Hide file tree
Showing 47 changed files with 6,250 additions and 66 deletions.
413 changes: 402 additions & 11 deletions cmdb-ui/public/iconfont/demo_index.html

Large diffs are not rendered by default.

78 changes: 73 additions & 5 deletions cmdb-ui/public/iconfont/iconfont.css
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
@font-face {
font-family: "iconfont"; /* Project id 3857903 */
src: url('iconfont.woff2?t=1729157759723') format('woff2'),
url('iconfont.woff?t=1729157759723') format('woff'),
url('iconfont.ttf?t=1729157759723') format('truetype');
src: url('iconfont.woff2?t=1731312848138') format('woff2'),
url('iconfont.woff?t=1731312848138') format('woff'),
url('iconfont.ttf?t=1731312848138') format('truetype');
}

.iconfont {
Expand All @@ -13,6 +13,74 @@
-moz-osx-font-smoothing: grayscale;
}

.ops-setting-holidays:before {
content: "\e9fa";
}

.ops-itsm-logs:before {
content: "\e9f8";
}

.ops-setting-workday:before {
content: "\e9f6";
}

.ops-setting-holiday:before {
content: "\e9f7";
}

.ops-setting-festival:before {
content: "\e9f5";
}

.itsm-calc:before {
content: "\e9f4";
}

.itsm-reports_4:before {
content: "\e9f3";
}

.veops-folder:before {
content: "\e9f2";
}

.veops-entire_network_:before {
content: "\e9f1";
}

.veops-subnet:before {
content: "\e9f0";
}

.veops-map_view:before {
content: "\e9ef";
}

.veops-recycle:before {
content: "\e9ee";
}

.veops-catalog:before {
content: "\e9ed";
}

.veops-ipam:before {
content: "\e9ec";
}

.cmdb-calc:before {
content: "\e9eb";
}

.ai-users:before {
content: "\e9ea";
}

.ai-tokens:before {
content: "\e9e9";
}

.oneterm-mysql:before {
content: "\e9e8";
}
Expand Down Expand Up @@ -961,11 +1029,11 @@
content: "\e914";
}

.itsm-duration:before {
.itsm-reports_3:before {
content: "\e913";
}

.itsm-workload:before {
.itsm-reports_2:before {
content: "\e912";
}

Expand Down
2 changes: 1 addition & 1 deletion cmdb-ui/public/iconfont/iconfont.js

Large diffs are not rendered by default.

123 changes: 121 additions & 2 deletions cmdb-ui/public/iconfont/iconfont.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,125 @@
"css_prefix_text": "",
"description": "",
"glyphs": [
{
"icon_id": "42337844",
"name": "ops-setting-holiday_management-copy",
"font_class": "ops-setting-holidays",
"unicode": "e9fa",
"unicode_decimal": 59898
},
{
"icon_id": "42335414",
"name": "itsm-system_log",
"font_class": "ops-itsm-logs",
"unicode": "e9f8",
"unicode_decimal": 59896
},
{
"icon_id": "42334782",
"name": "ops-setting-adjustday",
"font_class": "ops-setting-workday",
"unicode": "e9f6",
"unicode_decimal": 59894
},
{
"icon_id": "42334768",
"name": "ops-setting-holiday",
"font_class": "ops-setting-holiday",
"unicode": "e9f7",
"unicode_decimal": 59895
},
{
"icon_id": "42334734",
"name": "ops-setting-festival",
"font_class": "ops-setting-festival",
"unicode": "e9f5",
"unicode_decimal": 59893
},
{
"icon_id": "42281202",
"name": "itsm-count",
"font_class": "itsm-calc",
"unicode": "e9f4",
"unicode_decimal": 59892
},
{
"icon_id": "42270632",
"name": "itsm-satisfaction",
"font_class": "itsm-reports_4",
"unicode": "e9f3",
"unicode_decimal": 59891
},
{
"icon_id": "42205149",
"name": "veops-folder",
"font_class": "veops-folder",
"unicode": "e9f2",
"unicode_decimal": 59890
},
{
"icon_id": "42205128",
"name": "veops-entire_network_",
"font_class": "veops-entire_network_",
"unicode": "e9f1",
"unicode_decimal": 59889
},
{
"icon_id": "42205094",
"name": "veops-subnet",
"font_class": "veops-subnet",
"unicode": "e9f0",
"unicode_decimal": 59888
},
{
"icon_id": "42201912",
"name": "veops-map_view",
"font_class": "veops-map_view",
"unicode": "e9ef",
"unicode_decimal": 59887
},
{
"icon_id": "42201676",
"name": "veops-recycle",
"font_class": "veops-recycle",
"unicode": "e9ee",
"unicode_decimal": 59886
},
{
"icon_id": "42201586",
"name": "veops-catalog",
"font_class": "veops-catalog",
"unicode": "e9ed",
"unicode_decimal": 59885
},
{
"icon_id": "42201534",
"name": "veops-ipam",
"font_class": "veops-ipam",
"unicode": "e9ec",
"unicode_decimal": 59884
},
{
"icon_id": "42179262",
"name": "cmdb-calc",
"font_class": "cmdb-calc",
"unicode": "e9eb",
"unicode_decimal": 59883
},
{
"icon_id": "42161413",
"name": "ai-users",
"font_class": "ai-users",
"unicode": "e9ea",
"unicode_decimal": 59882
},
{
"icon_id": "42161417",
"name": "ai-tokens",
"font_class": "ai-tokens",
"unicode": "e9e9",
"unicode_decimal": 59881
},
{
"icon_id": "42155223",
"name": "oneterm-mysql",
Expand Down Expand Up @@ -1667,14 +1786,14 @@
{
"icon_id": "39926816",
"name": "itsm-duration",
"font_class": "itsm-duration",
"font_class": "itsm-reports_3",
"unicode": "e913",
"unicode_decimal": 59667
},
{
"icon_id": "39926833",
"name": "itsm-workload (1)",
"font_class": "itsm-workload",
"font_class": "itsm-reports_2",
"unicode": "e912",
"unicode_decimal": 59666
},
Expand Down
Binary file modified cmdb-ui/public/iconfont/iconfont.ttf
Binary file not shown.
Binary file modified cmdb-ui/public/iconfont/iconfont.woff
Binary file not shown.
Binary file modified cmdb-ui/public/iconfont/iconfont.woff2
Binary file not shown.
109 changes: 109 additions & 0 deletions cmdb-ui/src/modules/cmdb/api/ipam.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
import { axios } from '@/utils/request'

export function getIPAMSubnet() {
return axios({
url: '/v0.1/ipam/subnet',
method: 'GET'
})
}

export function postIPAMSubnet(data) {
return axios({
url: '/v0.1/ipam/subnet',
method: 'POST',
data
})
}

export function getIPAMSubnetById(id) {
return axios({
url: `/v0.1/ipam/subnet/${id}`,
method: 'GET'
})
}

export function putIPAMSubnet(id, data) {
return axios({
url: `/v0.1/ipam/subnet/${id}`,
method: 'PUT',
data
})
}

export function deleteIPAMSubnet(id) {
return axios({
url: `/v0.1/ipam/subnet/${id}`,
method: 'DELETE'
})
}

export function postIPAMScope(data) {
return axios({
url: '/v0.1/ipam/scope',
method: 'POST',
data
})
}

export function putIPAMScope(id, data) {
return axios({
url: `/v0.1/ipam/scope/${id}`,
method: 'PUT',
data
})
}

export function deleteIPAMScope(id) {
return axios({
url: `/v0.1/ipam/scope/${id}`,
method: 'DELETE'
})
}

export function getIPAMAddress(params) {
return axios({
url: '/v0.1/ipam/address',
method: 'GET',
params
})
}

export function getIPAMHosts(params) {
return axios({
url: '/v0.1/ipam/subnet/hosts',
method: 'GET',
params
})
}

export function postIPAMAddress(data) {
return axios({
url: '/v0.1/ipam/address',
method: 'POST',
data
})
}

export function getIPAMHistoryOperate(params) {
return axios({
url: '/v0.1/ipam/history/operate',
method: 'GET',
params
})
}

export function getIPAMHistoryScan(params) {
return axios({
url: '/v0.1/ipam/history/scan',
method: 'GET',
params
})
}

export function getIPAMStats(params) {
return axios({
url: '/v0.1/ipam/stats',
method: 'GET',
params
})
}
34 changes: 30 additions & 4 deletions cmdb-ui/src/modules/cmdb/api/preference.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { axios } from '@/utils/request'
import { CI_DEFAULT_ATTR } from '@/modules/cmdb/utils/const.js'
import i18n from '@/lang'

export function getPreference(instance = true, tree = null) {
return axios({
Expand All @@ -16,10 +18,34 @@ export function getPreference2(instance = true, tree = null) {
})
}

export function getSubscribeAttributes(ciTypeId) {
return axios({
url: `/v0.1/preference/ci_types/${ciTypeId}/attributes`,
method: 'GET'
export function getSubscribeAttributes(ciTypeId, formatDefaultAttr = true) {
return new Promise(async (resolve) => {
const res = await axios({
url: `/v0.1/preference/ci_types/${ciTypeId}/attributes`,
method: 'GET'
})

if (
formatDefaultAttr &&
res?.attributes?.length
) {
res.attributes.forEach((item) => {
switch (item.name) {
case CI_DEFAULT_ATTR.UPDATE_USER:
item.id = item.name
item.alias = i18n.t('cmdb.components.updater')
break
case CI_DEFAULT_ATTR.UPDATE_TIME:
item.id = item.name
item.alias = i18n.t('cmdb.components.updateTime')
break
default:
break
}
})
}

resolve(res)
})
}

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit aae43a5

Please sign in to comment.