feat:修改panel 显示的问题 以及 endpoint编辑显示名称错误的问题
This commit is contained in:
@@ -108,3 +108,11 @@
|
|||||||
line-height: 20px;
|
line-height: 20px;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
}
|
}
|
||||||
|
.active-icon{
|
||||||
|
margin-top:0px;
|
||||||
|
width:10px;
|
||||||
|
height:10px;
|
||||||
|
border-radius:50%;
|
||||||
|
display: inline-block;
|
||||||
|
margin-right: 5px;
|
||||||
|
}
|
||||||
|
|||||||
@@ -1690,7 +1690,7 @@ li{
|
|||||||
}
|
}
|
||||||
/*列表中状态字段 的小圆点*/
|
/*列表中状态字段 的小圆点*/
|
||||||
.active-icon{
|
.active-icon{
|
||||||
margin-top:15px;
|
margin-top:0px;
|
||||||
width:8px;
|
width:8px;
|
||||||
height:8px;
|
height:8px;
|
||||||
border-radius:50%;
|
border-radius:50%;
|
||||||
|
|||||||
@@ -674,7 +674,7 @@ export default {
|
|||||||
}
|
}
|
||||||
if (!param.query) delete param.query
|
if (!param.query) delete param.query
|
||||||
// 根据panelId获得panel下的所有图表
|
// 根据panelId获得panel下的所有图表
|
||||||
this.$get('visual/panel/chart?panelId=' + params.panelId + '&pageSize=-1').then(response => {
|
this.$get('visual/panel/chart?panelId=' + params.panelId + '&groupId=0').then(response => {
|
||||||
if (response.code === 200) {
|
if (response.code === 200) {
|
||||||
response.data.list.forEach((item, index) => {
|
response.data.list.forEach((item, index) => {
|
||||||
item.isLoaded = false
|
item.isLoaded = false
|
||||||
|
|||||||
@@ -1149,7 +1149,7 @@ const cn = {
|
|||||||
alerts: 'Alerts',
|
alerts: 'Alerts',
|
||||||
privpin: '隐私密码',
|
privpin: '隐私密码',
|
||||||
asset: 'Asset',
|
asset: 'Asset',
|
||||||
editEndpoint: '编辑 endpoint',
|
editEndpoint: '编辑 Endpoint',
|
||||||
createEndpoint: '新增Endpoint',
|
createEndpoint: '新增Endpoint',
|
||||||
batchEndpoint: '批量 Endpoint',
|
batchEndpoint: '批量 Endpoint',
|
||||||
endpointName: 'Endpoint name'
|
endpointName: 'Endpoint name'
|
||||||
|
|||||||
@@ -1177,7 +1177,7 @@ const en = {
|
|||||||
privpin: 'Priv password',
|
privpin: 'Priv password',
|
||||||
alerts: 'Alerts',
|
alerts: 'Alerts',
|
||||||
asset: 'Asset',
|
asset: 'Asset',
|
||||||
editEndpoint: 'edit endpoint',
|
editEndpoint: 'Edit endpoint',
|
||||||
createEndpoint: 'Created endpoint',
|
createEndpoint: 'Created endpoint',
|
||||||
batchEndpoint: 'Batch Endpoint',
|
batchEndpoint: 'Batch Endpoint',
|
||||||
endpointName: 'Endpoint name',
|
endpointName: 'Endpoint name',
|
||||||
|
|||||||
@@ -173,7 +173,7 @@ import TimePicker from './time'
|
|||||||
import YearTable from '../basic/year-table'
|
import YearTable from '../basic/year-table'
|
||||||
import MonthTable from '../basic/month-table'
|
import MonthTable from '../basic/month-table'
|
||||||
import DateTable from '../basic/date-table'
|
import DateTable from '../basic/date-table'
|
||||||
|
import bus from '@/libs/bus'
|
||||||
export default {
|
export default {
|
||||||
mixins: [Locale],
|
mixins: [Locale],
|
||||||
|
|
||||||
@@ -373,7 +373,7 @@ export default {
|
|||||||
// NOTE: not a permanent solution
|
// NOTE: not a permanent solution
|
||||||
// consider disable "now" button in the future
|
// consider disable "now" button in the future
|
||||||
if ((!this.disabledDate || !this.disabledDate(new Date())) && this.checkDateWithinRange(new Date())) {
|
if ((!this.disabledDate || !this.disabledDate(new Date())) && this.checkDateWithinRange(new Date())) {
|
||||||
this.date = new Date()
|
this.date = new Date(bus.computeTimezoneTime(new Date()))
|
||||||
this.emit(this.date)
|
this.emit(this.date)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1549,7 +1549,6 @@ export default {
|
|||||||
upload () {
|
upload () {
|
||||||
const form = new FormData()
|
const form = new FormData()
|
||||||
form.append('file', this.file)
|
form.append('file', this.file)
|
||||||
console.log(this.file)
|
|
||||||
if (this.uploadPic.name) {
|
if (this.uploadPic.name) {
|
||||||
form.append('name', this.uploadPic.name)
|
form.append('name', this.uploadPic.name)
|
||||||
} else {
|
} else {
|
||||||
@@ -1562,7 +1561,7 @@ export default {
|
|||||||
if (res.code == 200) {
|
if (res.code == 200) {
|
||||||
this.$message({ duration: 2000, type: 'success', message: this.$t('tip.saveSuccess') })
|
this.$message({ duration: 2000, type: 'success', message: this.$t('tip.saveSuccess') })
|
||||||
this.uploadPicShow = false
|
this.uploadPicShow = false
|
||||||
this.dealImg(`monitor/project/topo/icon/${res.data.id}/0`).then((data,header) => {
|
this.dealImg(`monitor/project/topo/icon/${res.data.id}/1`).then((data,header) => {
|
||||||
const group = this.tools.find(tool => tool.group === this.uploadPic.unit)
|
const group = this.tools.find(tool => tool.group === this.uploadPic.unit)
|
||||||
if (group) {
|
if (group) {
|
||||||
group.children.push({
|
group.children.push({
|
||||||
@@ -1618,7 +1617,7 @@ export default {
|
|||||||
res.data.list.forEach((item, index) => {
|
res.data.list.forEach((item, index) => {
|
||||||
item.imageName = item.name
|
item.imageName = item.name
|
||||||
delete item.name
|
delete item.name
|
||||||
promiseArr.push(this.dealImg(`monitor/project/topo/icon/${item.id}/0`))
|
promiseArr.push(this.dealImg(`monitor/project/topo/icon/${item.id}/1`))
|
||||||
imgArr.push({ ...item })
|
imgArr.push({ ...item })
|
||||||
})
|
})
|
||||||
Promise.all(promiseArr).then((res2,header) => {
|
Promise.all(promiseArr).then((res2,header) => {
|
||||||
@@ -1662,7 +1661,7 @@ export default {
|
|||||||
const promiseArr = []
|
const promiseArr = []
|
||||||
imgidList.forEach((item, index) => {
|
imgidList.forEach((item, index) => {
|
||||||
if (item.data.imageId) {
|
if (item.data.imageId) {
|
||||||
promiseArr.push(this.dealImg(`monitor/project/topo/icon/${item.data.imageId}/0`))
|
promiseArr.push(this.dealImg(`monitor/project/topo/icon/${item.data.imageId}/1`))
|
||||||
} else {
|
} else {
|
||||||
promiseArr.push('')
|
promiseArr.push('')
|
||||||
}
|
}
|
||||||
@@ -1688,13 +1687,10 @@ export default {
|
|||||||
if (url) {
|
if (url) {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
this.$axios
|
this.$axios
|
||||||
.get(url, {
|
.get(url)
|
||||||
responseType: 'arraybuffer'
|
.then((res) => {
|
||||||
})
|
|
||||||
.then((res, resHeader) => {
|
|
||||||
return {
|
return {
|
||||||
data: ('data:image/jpeg;base64,' + btoa(new Uint8Array(res.data).reduce((data, byte) => data + String.fromCharCode(byte), ''))),
|
data: ('data:image/jpeg;base64,' + res.data),
|
||||||
header: resHeader
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.then(data => {
|
.then(data => {
|
||||||
|
|||||||
@@ -1549,7 +1549,6 @@ export default {
|
|||||||
upload () {
|
upload () {
|
||||||
const form = new FormData()
|
const form = new FormData()
|
||||||
form.append('file', this.file)
|
form.append('file', this.file)
|
||||||
console.log(this.file)
|
|
||||||
if (this.uploadPic.name) {
|
if (this.uploadPic.name) {
|
||||||
form.append('name', this.uploadPic.name)
|
form.append('name', this.uploadPic.name)
|
||||||
} else {
|
} else {
|
||||||
@@ -1562,7 +1561,7 @@ export default {
|
|||||||
if (res.code == 200) {
|
if (res.code == 200) {
|
||||||
this.$message({ duration: 2000, type: 'success', message: this.$t('tip.saveSuccess') })
|
this.$message({ duration: 2000, type: 'success', message: this.$t('tip.saveSuccess') })
|
||||||
this.uploadPicShow = false
|
this.uploadPicShow = false
|
||||||
this.dealImg(`monitor/project/topo/icon/${res.data.id}/1`).then((data) => {
|
this.dealImg(`monitor/project/topo/icon/${res.data.id}/1`).then((data, header) => {
|
||||||
const group = this.tools.find(tool => tool.group === this.uploadPic.unit)
|
const group = this.tools.find(tool => tool.group === this.uploadPic.unit)
|
||||||
if (group) {
|
if (group) {
|
||||||
group.children.push({
|
group.children.push({
|
||||||
@@ -1621,7 +1620,7 @@ export default {
|
|||||||
promiseArr.push(this.dealImg(`monitor/project/topo/icon/${item.id}/1`))
|
promiseArr.push(this.dealImg(`monitor/project/topo/icon/${item.id}/1`))
|
||||||
imgArr.push({ ...item })
|
imgArr.push({ ...item })
|
||||||
})
|
})
|
||||||
Promise.all(promiseArr).then((res2) => {
|
Promise.all(promiseArr).then((res2, header) => {
|
||||||
this.iconArray = [...res.data.list]
|
this.iconArray = [...res.data.list]
|
||||||
this.iconArray.forEach((item, index) => {
|
this.iconArray.forEach((item, index) => {
|
||||||
item.image = res2[index]
|
item.image = res2[index]
|
||||||
@@ -1688,14 +1687,14 @@ export default {
|
|||||||
if (url) {
|
if (url) {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
this.$axios
|
this.$axios
|
||||||
.get(url, {
|
.get(url)
|
||||||
responseType: 'arraybuffer'
|
.then((res) => {
|
||||||
})
|
return {
|
||||||
.then(res => {
|
data: ('data:image/jpeg;base64,' + res.data)
|
||||||
return ('data:image/jpeg;base64,' + btoa(new Uint8Array(res.data).reduce((data, byte) => data + String.fromCharCode(byte), '')))
|
}
|
||||||
})
|
})
|
||||||
.then(data => {
|
.then(data => {
|
||||||
resolve(data)
|
resolve(data.data, data.header)
|
||||||
// changeImage(data,(img)=>{
|
// changeImage(data,(img)=>{
|
||||||
// resolve(img)
|
// resolve(img)
|
||||||
// })
|
// })
|
||||||
|
|||||||
@@ -37,7 +37,6 @@
|
|||||||
<span class="datepicker-title">start time</span>
|
<span class="datepicker-title">start time</span>
|
||||||
<my-date-picker prefix-icon=" " class="panel-time-picker-hidden " size="mini" ref="calendar"
|
<my-date-picker prefix-icon=" " class="panel-time-picker-hidden " size="mini" ref="calendar"
|
||||||
format="yyyy/MM/dd HH:mm:ss" @change="(val)=>{dateChange(val,'startAt')}" v-model="editAlertSilence.startAt"
|
format="yyyy/MM/dd HH:mm:ss" @change="(val)=>{dateChange(val,'startAt')}" v-model="editAlertSilence.startAt"
|
||||||
:picker-options="optionsStartAt"
|
|
||||||
type="datetime"
|
type="datetime"
|
||||||
:clearable="false"
|
:clearable="false"
|
||||||
popper-class="panel-time-picker-popper"
|
popper-class="panel-time-picker-popper"
|
||||||
@@ -50,7 +49,6 @@
|
|||||||
<span class="datepicker-title">end time</span>
|
<span class="datepicker-title">end time</span>
|
||||||
<my-date-picker prefix-icon=" " class="panel-time-picker-hidden " size="mini" ref="calendar"
|
<my-date-picker prefix-icon=" " class="panel-time-picker-hidden " size="mini" ref="calendar"
|
||||||
format="yyyy/MM/dd HH:mm:ss" @change="(val)=>{dateChange(val,'endAt')}" v-model="editAlertSilence.endAt"
|
format="yyyy/MM/dd HH:mm:ss" @change="(val)=>{dateChange(val,'endAt')}" v-model="editAlertSilence.endAt"
|
||||||
:picker-options="optionsEndAt"
|
|
||||||
type="datetime"
|
type="datetime"
|
||||||
:clearable="false"
|
:clearable="false"
|
||||||
popper-class="panel-time-picker-popper"
|
popper-class="panel-time-picker-popper"
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<!-- begin--标题-->
|
<!-- begin--标题-->
|
||||||
<div class="right-box-title">
|
<div class="right-box-title">
|
||||||
<span v-if="optionType === 'edit'">
|
<span v-if="optionType === 'edit'">
|
||||||
{{ $t("project.module.editEndpoint")}}
|
{{ $t("project.module.editEndpoint")}} {{editEndpoint.id}}
|
||||||
</span>
|
</span>
|
||||||
<span v-if="optionType === 'batch'">
|
<span v-if="optionType === 'batch'">
|
||||||
{{ $t("project.module.batchEndpoint")}}
|
{{ $t("project.module.batchEndpoint")}}
|
||||||
|
|||||||
@@ -42,7 +42,7 @@
|
|||||||
<span v-else-if="item.prop === 'status'">
|
<span v-else-if="item.prop === 'status'">
|
||||||
<el-popover :content="$t('asset.assetStatPre')+(scope.row.checkTime?utcTimeToTimezoneStr(scope.row.checkTime):$t('asset.assetStatDown'))" placement="right" trigger="hover" width="200">
|
<el-popover :content="$t('asset.assetStatPre')+(scope.row.checkTime?utcTimeToTimezoneStr(scope.row.checkTime):$t('asset.assetStatDown'))" placement="right" trigger="hover" width="200">
|
||||||
<div slot="reference" style="width: 20px">
|
<div slot="reference" style="width: 20px">
|
||||||
<div :class="{'active-icon green':scope.row[item.prop] == '1','active-icon red':scope.row[item.prop] == '0' || scope.row[item.prop] == '-1' || scope.row[item.prop] == '-2'}"></div>
|
<div :class="{'active-icon green-bg':scope.row[item.prop] == '1','active-icon red-bg':scope.row[item.prop] == '0' || scope.row[item.prop] == '-1' || scope.row[item.prop] == '-2'}"></div>
|
||||||
</div>
|
</div>
|
||||||
</el-popover>
|
</el-popover>
|
||||||
</span>
|
</span>
|
||||||
|
|||||||
@@ -72,13 +72,13 @@
|
|||||||
</div>
|
</div>
|
||||||
<div slot="reference" style="width: 100px">
|
<div slot="reference" style="width: 100px">
|
||||||
<div v-if="scope.row[item.prop]===0">
|
<div v-if="scope.row[item.prop]===0">
|
||||||
<div class="active-icon red inline-block"></div> down
|
<div class="active-icon red-bg inline-block"></div> down
|
||||||
</div>
|
</div>
|
||||||
<div v-else-if="scope.row[item.prop]===1">
|
<div v-else-if="scope.row[item.prop]===1">
|
||||||
<div class="active-icon green inline-block"></div> up
|
<div class="active-icon green-bg inline-block"></div> up
|
||||||
</div>
|
</div>
|
||||||
<div v-else-if="scope.row[item.prop]">
|
<div v-else-if="scope.row[item.prop]">
|
||||||
<div class="active-icon gray inline-block"></div> suspended
|
<div class="active-icon gray-bg inline-block"></div> suspended
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</el-popover>
|
</el-popover>
|
||||||
@@ -183,16 +183,16 @@ export default {
|
|||||||
let str = ''
|
let str = ''
|
||||||
arr.forEach((item, index) => {
|
arr.forEach((item, index) => {
|
||||||
if (index === 0) {
|
if (index === 0) {
|
||||||
str += `<div>DC <div class="active-icon inline-block ${item == '0' ? 'red' : 'green'}"></div></div>`
|
str += `<div>DC <div class="active-icon inline-block ${item == '0' ? 'red-bg' : 'green-bg'}"></div></div>`
|
||||||
}
|
}
|
||||||
if (index === 1) {
|
if (index === 1) {
|
||||||
str += `<div>ASSET <div class="active-icon inline-block ${item == '0' ? 'red' : 'green'}"></div></div>`
|
str += `<div>ASSET <div class="active-icon inline-block ${item == '0' ? 'red-bg' : 'green-bg'}"></div></div>`
|
||||||
}
|
}
|
||||||
if (index === 2) {
|
if (index === 2) {
|
||||||
str += `<div>ENDPOINT <div class="active-icon inline-block ${item == '0' ? 'red' : 'green'}"></div></div>`
|
str += `<div>ENDPOINT <div class="active-icon inline-block ${item == '0' ? 'red-bg' : 'green-bg'}"></div></div>`
|
||||||
}
|
}
|
||||||
if (index === 3) {
|
if (index === 3) {
|
||||||
str += `<div>PROMETHEUS <div class="active-icon inline-block ${item == '0' ? 'red' : 'green'}"></div></div>`
|
str += `<div>PROMETHEUS <div class="active-icon inline-block ${item == '0' ? 'red-bg' : 'green-bg'}"></div></div>`
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
return str
|
return str
|
||||||
|
|||||||
@@ -65,7 +65,7 @@
|
|||||||
<addEndpointBox v-if="rightBox.show" :endpoint="object" @close="closeRightBox"></addEndpointBox>
|
<addEndpointBox v-if="rightBox.show" :endpoint="object" @close="closeRightBox"></addEndpointBox>
|
||||||
</transition>
|
</transition>
|
||||||
<transition name="right-box">
|
<transition name="right-box">
|
||||||
<edit-endpoint-box-new v-if="rightBox.editShow" :module="object" @close="closeRightEditBox" :disabled="true" :type="'edit'"></edit-endpoint-box-new>
|
<edit-endpoint-box-new v-if="rightBox.editShow" :module="object" @close="closeRightEditBox" :disabled="true" :optionType="'edit'"></edit-endpoint-box-new>
|
||||||
</transition>
|
</transition>
|
||||||
<transition name="right-box">
|
<transition name="right-box">
|
||||||
<batchModifyEndpoint v-if="rightBox.batchModify" :module="object" @close="closeRightBatchModify" :selectEndpointList="batchDeleteObjs" :disabled="true" :type="'edit'"></batchModifyEndpoint>
|
<batchModifyEndpoint v-if="rightBox.batchModify" :module="object" @close="closeRightBatchModify" :selectEndpointList="batchDeleteObjs" :disabled="true" :type="'edit'"></batchModifyEndpoint>
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ export function get (url, params) {
|
|||||||
axios.get(url, {
|
axios.get(url, {
|
||||||
params: params
|
params: params
|
||||||
}).then(response => {
|
}).then(response => {
|
||||||
resolve(response.data, response)
|
resolve(response.data)
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
if (err.response) {
|
if (err.response) {
|
||||||
resolve(err.response.data)
|
resolve(err.response.data)
|
||||||
|
|||||||
@@ -272,6 +272,20 @@ export default new Vue({
|
|||||||
return sourceTime
|
return sourceTime
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
// 将本地时区转为系统配置的时区
|
||||||
|
computeTimezoneTime: function (sourceTime) {
|
||||||
|
let offset = localStorage.getItem('nz-sys-timezone')
|
||||||
|
offset = moment.tz(offset).format('Z')
|
||||||
|
if (offset && offset !== 'undefined') {
|
||||||
|
offset = Number.parseInt(offset)
|
||||||
|
const date = new Date(sourceTime)
|
||||||
|
const localOffset = date.getTimezoneOffset() * 60 * 1000 // 默认 一分钟显示时区偏移的结果
|
||||||
|
const utcTime = date.getTime() + localOffset
|
||||||
|
return utcTime + (offset * 60 * 60 * 1000)
|
||||||
|
} else {
|
||||||
|
return sourceTime
|
||||||
|
}
|
||||||
|
},
|
||||||
getTimezontDateRange: function (offset = -1) {
|
getTimezontDateRange: function (offset = -1) {
|
||||||
return [
|
return [
|
||||||
new Date(new Date(this.computeTimezone(new Date().getTime())).setHours(new Date(this.computeTimezone(new Date().getTime())).getHours() + offset)),
|
new Date(new Date(this.computeTimezone(new Date().getTime())).setHours(new Date(this.computeTimezone(new Date().getTime())).getHours() + offset)),
|
||||||
|
|||||||
Reference in New Issue
Block a user