fix:补充导入信息
This commit is contained in:
@@ -370,8 +370,8 @@ import draggable from 'vuedraggable'
|
||||
// 引入Leaflet对象 挂载到Vue上,便于全局使用,也可以单独页面中单独引用
|
||||
import 'leaflet/dist/leaflet.css'
|
||||
import * as L from 'leaflet'
|
||||
import icon from 'leaflet/dist/images/marker-icon.png';
|
||||
import iconShadow from 'leaflet/dist/images/marker-shadow.png';
|
||||
import icon from 'leaflet/dist/images/marker-icon.png'
|
||||
import iconShadow from 'leaflet/dist/images/marker-shadow.png'
|
||||
export default {
|
||||
name: 'system',
|
||||
components: { draggable },
|
||||
@@ -390,7 +390,7 @@ export default {
|
||||
default_cabinet_usize: '',
|
||||
query_max_series: '',
|
||||
unsaved_change: 'on',
|
||||
map_center_config:{"longitude":116.39,"latitude":39.9,"zoom":4,"minZoom":1,"maxZoom":10}
|
||||
map_center_config: { longitude: 116.39, latitude: 39.9, zoom: 4, minZoom: 1, maxZoom: 10 }
|
||||
},
|
||||
mapConfigVisible: false,
|
||||
map: null,
|
||||
@@ -556,56 +556,56 @@ export default {
|
||||
methods: {
|
||||
initMap: function () {
|
||||
if (this.map) {
|
||||
this.map.remove();
|
||||
this.map=null;
|
||||
this.map.remove()
|
||||
this.map = null
|
||||
}
|
||||
let DefaultIcon = L.icon({
|
||||
const DefaultIcon = L.icon({
|
||||
iconUrl: icon,
|
||||
iconSize: [26, 40],
|
||||
iconAnchor: [13, 40],
|
||||
shadowUrl: iconShadow
|
||||
});
|
||||
L.Marker.prototype.options.icon = DefaultIcon;
|
||||
let map = L.map("map",{
|
||||
})
|
||||
L.Marker.prototype.options.icon = DefaultIcon
|
||||
const map = L.map('map', {
|
||||
minZoom: this.basic.map_center_config.minZoom,
|
||||
maxZoom: this.basic.map_center_config.maxZoom,
|
||||
attributionControl: false,
|
||||
zoomControl: false,
|
||||
maxBounds: L.latLngBounds(L.latLng(-90, -180), L.latLng(90, 180))
|
||||
}).setView([this.basic.map_center_config.latitude,this.basic.map_center_config.longitude],this.basic.map_center_config.zoom);
|
||||
}).setView([this.basic.map_center_config.latitude, this.basic.map_center_config.longitude], this.basic.map_center_config.zoom)
|
||||
|
||||
L.tileLayer(
|
||||
"/static/Tiles/{z}/{x}/{y}.png",
|
||||
'/static/Tiles/{z}/{x}/{y}.png',
|
||||
{ noWrap: true }
|
||||
).addTo(map);
|
||||
).addTo(map)
|
||||
|
||||
let attribution=L.control.attribution({position:'bottomright',prefix:''})
|
||||
const attribution = L.control.attribution({ position: 'bottomright', prefix: '' })
|
||||
attribution.addAttribution(' © OpenStreetMap contributors')
|
||||
attribution.addTo(map)
|
||||
|
||||
L.control.zoom({
|
||||
position: 'bottomright',
|
||||
zoomInText:`<i class="nz-icon nz-icon-enlarge"></i>`,
|
||||
zoomOutText:`<i class="nz-icon nz-icon-narrow"></i>`,
|
||||
zoomInText: '<i class="nz-icon nz-icon-enlarge"></i>',
|
||||
zoomOutText: '<i class="nz-icon nz-icon-narrow"></i>',
|
||||
zoomInTitle: '',
|
||||
zoomOutTitle:'',
|
||||
zoomOutTitle: ''
|
||||
}).addTo(map)
|
||||
|
||||
let marker = L.marker([this.basic.map_center_config.latitude,this.basic.map_center_config.longitude]).addTo(map);
|
||||
map.on("click", function(e) {
|
||||
var lat = e.latlng.lat;
|
||||
var lng = e.latlng.lng;
|
||||
marker.setLatLng([lat,lng]);
|
||||
});
|
||||
this.map = map;
|
||||
this.marker = marker;
|
||||
const marker = L.marker([this.basic.map_center_config.latitude, this.basic.map_center_config.longitude]).addTo(map)
|
||||
map.on('click', function (e) {
|
||||
const lat = e.latlng.lat
|
||||
const lng = e.latlng.lng
|
||||
marker.setLatLng([lat, lng])
|
||||
})
|
||||
this.map = map
|
||||
this.marker = marker
|
||||
},
|
||||
mapClose: function () {
|
||||
this.mapConfigVisible = false
|
||||
let latlng = this.marker.getLatLng();
|
||||
this.basic.map_center_config.latitude = latlng.lat;
|
||||
this.basic.map_center_config.longitude = latlng.lng;
|
||||
this.basic.map_center_config.zoom = this.map.getZoom();
|
||||
const latlng = this.marker.getLatLng()
|
||||
this.basic.map_center_config.latitude = latlng.lat
|
||||
this.basic.map_center_config.longitude = latlng.lng
|
||||
this.basic.map_center_config.zoom = this.map.getZoom()
|
||||
},
|
||||
selectTab: function (tab) {
|
||||
this.querySetInfo(tab.name)
|
||||
@@ -654,14 +654,14 @@ export default {
|
||||
this.prevent_opt.save = true
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
let param={};
|
||||
const param = {}
|
||||
if (type == 'basic') {
|
||||
this.basic.map_center_config = JSON.stringify(this.basic.map_center_config)
|
||||
}
|
||||
param[type] = Object.assign({}, this[type])
|
||||
this.$set(param[type], 'test', 'false')
|
||||
let postParam = Object.assign({}, param)
|
||||
for (let key in postParam[type]) {
|
||||
const postParam = Object.assign({}, param)
|
||||
for (const key in postParam[type]) {
|
||||
postParam[type][key] = postParam[type][key] + ''
|
||||
}
|
||||
this.$put('/sysConfig', postParam).then(response => {
|
||||
@@ -687,11 +687,11 @@ export default {
|
||||
this.prevent_opt.save = true
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
let param = {}
|
||||
const param = {}
|
||||
param[type] = Object.assign({}, this[type])
|
||||
this.$set(param[type], 'test', 'true')
|
||||
let postParam = Object.assign({}, param)
|
||||
for (let key in postParam[type]) {
|
||||
const postParam = Object.assign({}, param)
|
||||
for (const key in postParam[type]) {
|
||||
postParam[type][key] = postParam[type][key] + ''
|
||||
}
|
||||
this.$put('/sysConfig', postParam).then(response => {
|
||||
@@ -709,7 +709,6 @@ export default {
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
resetForm (formName, type) {
|
||||
this.$refs[formName].resetFields()
|
||||
this[type] = Object.assign({}, this[type + 'Copy'])
|
||||
@@ -927,7 +926,7 @@ export default {
|
||||
},
|
||||
// link edit
|
||||
notificationEdit (item) {
|
||||
let index = this.notification.findIndex((item1) => item.id == item1.id)
|
||||
const index = this.notification.findIndex((item1) => item.id == item1.id)
|
||||
this.$set(this.notification, index, { ...this.notification[index], isEdit: true })
|
||||
},
|
||||
// link update
|
||||
@@ -936,7 +935,7 @@ export default {
|
||||
this.prevent_opt.save = true
|
||||
this.$refs['notificationForm' + item.id][0].validate((valid) => {
|
||||
if (valid) {
|
||||
let params = {
|
||||
const params = {
|
||||
id: item.id,
|
||||
name: item.name,
|
||||
filePath: item.filePath
|
||||
@@ -944,7 +943,7 @@ export default {
|
||||
this.$put('/alert/script', params).then(response => {
|
||||
this.prevent_opt.save = false
|
||||
if (response.code == 200) {
|
||||
let index = this.notification.findIndex((item1) => item.id == item1.id)
|
||||
const index = this.notification.findIndex((item1) => item.id == item1.id)
|
||||
this.$set(this.notification, index, { ...this.notification[index], isEdit: false })
|
||||
this.notificationReserved = [...this.notification]
|
||||
// this.$store.commit('setLinkData',this.notification);
|
||||
@@ -961,8 +960,8 @@ export default {
|
||||
},
|
||||
// link cancel
|
||||
notificationCancel (item) {
|
||||
let index = this.notification.findIndex((item1) => item.id == item1.id)
|
||||
let indexReserved = this.notificationReserved.findIndex((item1) => item.id == item1.id)
|
||||
const index = this.notification.findIndex((item1) => item.id == item1.id)
|
||||
const indexReserved = this.notificationReserved.findIndex((item1) => item.id == item1.id)
|
||||
this.$set(this.notification, index, { ...this.notificationReserved[indexReserved], isEdit: false })
|
||||
},
|
||||
// link del
|
||||
|
||||
@@ -151,10 +151,11 @@
|
||||
|
||||
<script>
|
||||
import selectAlertSilence from '../../../common/alert/selectAlertSilence'
|
||||
import editor from './editor'
|
||||
export default {
|
||||
name: 'promqlInput',
|
||||
components: {
|
||||
'editor':editor,
|
||||
editor: editor,
|
||||
selectAlertSilence
|
||||
},
|
||||
props: {
|
||||
@@ -203,7 +204,7 @@ export default {
|
||||
datacenterOption: [],
|
||||
projectOption: [],
|
||||
filterSilence: '',
|
||||
tempBoxId:{},
|
||||
tempBoxId: {}
|
||||
}
|
||||
},
|
||||
created () {
|
||||
@@ -232,8 +233,8 @@ export default {
|
||||
queryMetrics: function () {
|
||||
this.$get('prom/api/v1/label/__name__/values').then(response => {
|
||||
if (response.status == 'success') {
|
||||
let metrics = response.data.sort()
|
||||
let metricMap = new Map()
|
||||
const metrics = response.data.sort()
|
||||
const metricMap = new Map()
|
||||
metrics.forEach((item) => {
|
||||
let key = ''
|
||||
if (/^[a-zA-Z]+?_[a-zA-Z]*/.test(item)) {
|
||||
@@ -244,16 +245,16 @@ export default {
|
||||
key = item
|
||||
}
|
||||
if (metricMap.get(key)) {
|
||||
let values = metricMap.get(key)
|
||||
const values = metricMap.get(key)
|
||||
values.push({ label: item, value: item })
|
||||
} else {
|
||||
let values = [{ label: item, value: item }]
|
||||
const values = [{ label: item, value: item }]
|
||||
metricMap.set(key, values)
|
||||
}
|
||||
// this.metricStore.push({label:item,value:item,insertText:item})
|
||||
})
|
||||
for (let key of metricMap.keys()) {
|
||||
let option = {
|
||||
for (const key of metricMap.keys()) {
|
||||
const option = {
|
||||
label: key,
|
||||
value: key
|
||||
}
|
||||
@@ -269,8 +270,8 @@ export default {
|
||||
})
|
||||
},
|
||||
filterInput: function (queryString, cb) {
|
||||
let metrics = Object.assign([], this.metricStore)
|
||||
let result = queryString
|
||||
const metrics = Object.assign([], this.metricStore)
|
||||
const result = queryString
|
||||
? metrics.filter((item) => {
|
||||
return item.value.toLowerCase().indexOf(queryString.toLowerCase()) != -1
|
||||
})
|
||||
@@ -354,7 +355,7 @@ export default {
|
||||
this.tempBoxShow = flag
|
||||
if (flag) {
|
||||
this.cascaderValue = ''
|
||||
let params = {}
|
||||
const params = {}
|
||||
params.expression = this.tempBox.expression
|
||||
params.varsVal = {}
|
||||
let returnFlag = false
|
||||
@@ -395,8 +396,8 @@ export default {
|
||||
},
|
||||
|
||||
format (str) {
|
||||
let arr = str.split('.')
|
||||
let keyword = arr[0].toLowerCase()
|
||||
const arr = str.split('.')
|
||||
const keyword = arr[0].toLowerCase()
|
||||
switch (keyword) {
|
||||
case 'asset':
|
||||
case 'module':
|
||||
@@ -419,14 +420,14 @@ export default {
|
||||
case 'asset':
|
||||
this.$get('asset', { pageNo: 1, pageSize: -1 }).then(response => {
|
||||
if (response.code == 200) {
|
||||
let arr = []
|
||||
const arr = []
|
||||
response.data.list.forEach(asset => {
|
||||
asset.name = asset.sn
|
||||
let idcF = arr.find(idc => idc.id === asset.idc.id)
|
||||
const idcF = arr.find(idc => idc.id === asset.idc.id)
|
||||
if (idcF) {
|
||||
idcF.children.push(asset)
|
||||
} else {
|
||||
let idc = { ...asset.idc }
|
||||
const idc = { ...asset.idc }
|
||||
idc.children = [asset]
|
||||
arr.push(idc)
|
||||
}
|
||||
@@ -438,13 +439,13 @@ export default {
|
||||
case 'module':
|
||||
this.$get('module', { pageNo: 1, pageSize: -1 }).then(response => {
|
||||
if (response.code == 200) {
|
||||
let arr = []
|
||||
const arr = []
|
||||
response.data.list.forEach(module => {
|
||||
let projectF = arr.find(project => project.id === module.project.id)
|
||||
const projectF = arr.find(project => project.id === module.project.id)
|
||||
if (projectF) {
|
||||
projectF.children.push(module)
|
||||
} else {
|
||||
let project = { ...module.project }
|
||||
const project = { ...module.project }
|
||||
project.children = [module]
|
||||
arr.push(project)
|
||||
}
|
||||
@@ -456,19 +457,19 @@ export default {
|
||||
case 'endpoint':
|
||||
this.$get('endpoint', { pageNo: 1, pageSize: -1 }).then(response => {
|
||||
if (response.code == 200) {
|
||||
let arr = []
|
||||
const arr = []
|
||||
response.data.list.forEach(item => {
|
||||
item.name = item.host
|
||||
let projectF = arr.find(project => item.project.id === project.id)
|
||||
const projectF = arr.find(project => item.project.id === project.id)
|
||||
if (projectF) {
|
||||
let moduleF = projectF.children.find(module => module.id === item.module.id)
|
||||
const moduleF = projectF.children.find(module => module.id === item.module.id)
|
||||
if (moduleF) {
|
||||
moduleF.children.push(item)
|
||||
} else {
|
||||
projectF.children.push({ ...item.module, children: [item] })
|
||||
}
|
||||
} else {
|
||||
let project = { ...item.project }
|
||||
const project = { ...item.project }
|
||||
project.children = [{ ...item.module, children: [item] }]
|
||||
arr.push(project)
|
||||
}
|
||||
@@ -497,7 +498,7 @@ export default {
|
||||
},
|
||||
silenceChange (val, key) {
|
||||
this.tempBox[key] = val.name
|
||||
this.tempBoxId[key]=val.id;
|
||||
this.tempBoxId[key] = val.id
|
||||
},
|
||||
clearValue (key) {
|
||||
this.tempBox[key] = ''
|
||||
|
||||
Reference in New Issue
Block a user