add annotations

This commit is contained in:
ann 2023-02-13 16:00:15 +08:00
parent 54f263243b
commit 5f45450ed7
1 changed files with 10 additions and 0 deletions

View File

@ -202,6 +202,7 @@ export default {
this.getServiceList()
},
methods: {
//
getServiceList() {
getEdgeDataByIpPath({ address: this.$route.query.ip, path: `core-metadata/api/v2/deviceservice/all?offset=0&limit=-1` }).then(e => {
this.blockList = e.data.services || []
@ -214,15 +215,18 @@ export default {
this.getProfileList()
}
},
//
viewAutoEvents(row) {
this.deviceItemData = row
this.dialogAutoEventsVisible = true
},
//
viewSetting(row) {
this.dialogSettingVisible = true
// this.getEventData()
this.serviceData = Object.assign({}, row)
},
// or
deleteItem(row) {
this.$confirm(`您确定要删除吗?`, { type: 'warning' }).then(() => {
deleteService({ address: this.$route.query.ip, path: `/core-metadata/api/v2/${this.activeName === '2' ? 'device' : 'deviceprofile'}/name/` + row.name }).then(e => {
@ -233,6 +237,7 @@ export default {
})
})
},
//
editProfile(row) {
getProfileByIpPath({ address: this.$route.query.ip, path: '/api/v2/profile/yaml/name/' + row.name }).then(e => {
this.dialogEditProfileVisible = true
@ -240,11 +245,13 @@ export default {
this.code = JSON.stringify(e.data, null, 2)
})
},
//
addProfile() {
this.add = true
this.code = ``
this.dialogEditProfileVisible = true
},
//
submitProfile() {
this.add ? postYaml({ address: this.$route.query.ip, profile: JSON.parse(this.code) }).then(e => {
if (e.code === 200) {
@ -260,6 +267,7 @@ export default {
}
})
},
//
ok() {
patchDeviceservice({ address: this.$route.query.ip, path: '/core-metadata/api/v2/deviceservice', updateDeviceServiceRequests: [{ apiVersion: 'v2', service: this.serviceData }] }).then(e => {
if (e.code === 200) {
@ -268,11 +276,13 @@ export default {
}
})
},
//
getDevicelist(filterName) {
getEdgeDataByIpPath({ address: this.$route.query.ip, path: `core-metadata/api/v2/device/all?offset=0&limit=-1` }).then(e => {
this.blockList1 = e.data.devices || []
})
},
//
getProfileList(filterName) {
getEdgeDataByIpPath({ address: this.$route.query.ip, path: `core-metadata/api/v2/deviceprofile/all?offset=0&limit=-1` }).then(e => {
this.blockList2 = e.data.profiles || []