diff --git a/nezha-fronted/src/assets/css/common.scss b/nezha-fronted/src/assets/css/common.scss
index b68261d09..63492aab8 100644
--- a/nezha-fronted/src/assets/css/common.scss
+++ b/nezha-fronted/src/assets/css/common.scss
@@ -108,3 +108,11 @@
line-height: 20px;
font-weight: 400;
}
+.active-icon{
+ margin-top:0px;
+ width:10px;
+ height:10px;
+ border-radius:50%;
+ display: inline-block;
+ margin-right: 5px;
+}
diff --git a/nezha-fronted/src/assets/stylus/main.scss b/nezha-fronted/src/assets/stylus/main.scss
index 3ab0311c3..336820f7f 100644
--- a/nezha-fronted/src/assets/stylus/main.scss
+++ b/nezha-fronted/src/assets/stylus/main.scss
@@ -1690,7 +1690,7 @@ li{
}
/*列表中状态字段 的小圆点*/
.active-icon{
- margin-top:15px;
+ margin-top:0px;
width:8px;
height:8px;
border-radius:50%;
diff --git a/nezha-fronted/src/components/charts/chart-list.vue b/nezha-fronted/src/components/charts/chart-list.vue
index 86aa83298..4f9c26796 100644
--- a/nezha-fronted/src/components/charts/chart-list.vue
+++ b/nezha-fronted/src/components/charts/chart-list.vue
@@ -674,7 +674,7 @@ export default {
}
if (!param.query) delete param.query
// 根据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) {
response.data.list.forEach((item, index) => {
item.isLoaded = false
diff --git a/nezha-fronted/src/components/common/language/cn.js b/nezha-fronted/src/components/common/language/cn.js
index f745b600d..4977d22ea 100644
--- a/nezha-fronted/src/components/common/language/cn.js
+++ b/nezha-fronted/src/components/common/language/cn.js
@@ -1149,7 +1149,7 @@ const cn = {
alerts: 'Alerts',
privpin: '隐私密码',
asset: 'Asset',
- editEndpoint: '编辑 endpoint',
+ editEndpoint: '编辑 Endpoint',
createEndpoint: '新增Endpoint',
batchEndpoint: '批量 Endpoint',
endpointName: 'Endpoint name'
diff --git a/nezha-fronted/src/components/common/language/en.js b/nezha-fronted/src/components/common/language/en.js
index e7df133c3..772546252 100644
--- a/nezha-fronted/src/components/common/language/en.js
+++ b/nezha-fronted/src/components/common/language/en.js
@@ -1177,7 +1177,7 @@ const en = {
privpin: 'Priv password',
alerts: 'Alerts',
asset: 'Asset',
- editEndpoint: 'edit endpoint',
+ editEndpoint: 'Edit endpoint',
createEndpoint: 'Created endpoint',
batchEndpoint: 'Batch Endpoint',
endpointName: 'Endpoint name',
diff --git a/nezha-fronted/src/components/common/myDatePicker/src/panel/date.vue b/nezha-fronted/src/components/common/myDatePicker/src/panel/date.vue
index 9c47db359..91afe30eb 100644
--- a/nezha-fronted/src/components/common/myDatePicker/src/panel/date.vue
+++ b/nezha-fronted/src/components/common/myDatePicker/src/panel/date.vue
@@ -173,7 +173,7 @@ import TimePicker from './time'
import YearTable from '../basic/year-table'
import MonthTable from '../basic/month-table'
import DateTable from '../basic/date-table'
-
+import bus from '@/libs/bus'
export default {
mixins: [Locale],
@@ -373,7 +373,7 @@ export default {
// NOTE: not a permanent solution
// consider disable "now" button in the future
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)
}
},
diff --git a/nezha-fronted/src/components/common/project/topologyL5.vue b/nezha-fronted/src/components/common/project/topologyL5.vue
index c8acf506c..5af73549e 100644
--- a/nezha-fronted/src/components/common/project/topologyL5.vue
+++ b/nezha-fronted/src/components/common/project/topologyL5.vue
@@ -1549,7 +1549,6 @@ export default {
upload () {
const form = new FormData()
form.append('file', this.file)
- console.log(this.file)
if (this.uploadPic.name) {
form.append('name', this.uploadPic.name)
} else {
@@ -1562,7 +1561,7 @@ export default {
if (res.code == 200) {
this.$message({ duration: 2000, type: 'success', message: this.$t('tip.saveSuccess') })
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)
if (group) {
group.children.push({
@@ -1618,7 +1617,7 @@ export default {
res.data.list.forEach((item, index) => {
item.imageName = 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 })
})
Promise.all(promiseArr).then((res2,header) => {
@@ -1662,7 +1661,7 @@ export default {
const promiseArr = []
imgidList.forEach((item, index) => {
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 {
promiseArr.push('')
}
@@ -1688,13 +1687,10 @@ export default {
if (url) {
return new Promise((resolve, reject) => {
this.$axios
- .get(url, {
- responseType: 'arraybuffer'
- })
- .then((res, resHeader) => {
+ .get(url)
+ .then((res) => {
return {
- data: ('data:image/jpeg;base64,' + btoa(new Uint8Array(res.data).reduce((data, byte) => data + String.fromCharCode(byte), ''))),
- header: resHeader
+ data: ('data:image/jpeg;base64,' + res.data),
}
})
.then(data => {
diff --git a/nezha-fronted/src/components/common/project/topologyPrev.vue b/nezha-fronted/src/components/common/project/topologyPrev.vue
index 7bfbfafc4..82ef0ceab 100644
--- a/nezha-fronted/src/components/common/project/topologyPrev.vue
+++ b/nezha-fronted/src/components/common/project/topologyPrev.vue
@@ -1549,7 +1549,6 @@ export default {
upload () {
const form = new FormData()
form.append('file', this.file)
- console.log(this.file)
if (this.uploadPic.name) {
form.append('name', this.uploadPic.name)
} else {
@@ -1562,7 +1561,7 @@ export default {
if (res.code == 200) {
this.$message({ duration: 2000, type: 'success', message: this.$t('tip.saveSuccess') })
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)
if (group) {
group.children.push({
@@ -1621,7 +1620,7 @@ export default {
promiseArr.push(this.dealImg(`monitor/project/topo/icon/${item.id}/1`))
imgArr.push({ ...item })
})
- Promise.all(promiseArr).then((res2) => {
+ Promise.all(promiseArr).then((res2, header) => {
this.iconArray = [...res.data.list]
this.iconArray.forEach((item, index) => {
item.image = res2[index]
@@ -1688,14 +1687,14 @@ export default {
if (url) {
return new Promise((resolve, reject) => {
this.$axios
- .get(url, {
- responseType: 'arraybuffer'
- })
- .then(res => {
- return ('data:image/jpeg;base64,' + btoa(new Uint8Array(res.data).reduce((data, byte) => data + String.fromCharCode(byte), '')))
+ .get(url)
+ .then((res) => {
+ return {
+ data: ('data:image/jpeg;base64,' + res.data)
+ }
})
.then(data => {
- resolve(data)
+ resolve(data.data, data.header)
// changeImage(data,(img)=>{
// resolve(img)
// })
diff --git a/nezha-fronted/src/components/common/rightBox/alertSilenceBox.vue b/nezha-fronted/src/components/common/rightBox/alertSilenceBox.vue
index f76b95c23..1830a7054 100644
--- a/nezha-fronted/src/components/common/rightBox/alertSilenceBox.vue
+++ b/nezha-fronted/src/components/common/rightBox/alertSilenceBox.vue
@@ -37,7 +37,6 @@
start time
{dateChange(val,'startAt')}" v-model="editAlertSilence.startAt"
- :picker-options="optionsStartAt"
type="datetime"
:clearable="false"
popper-class="panel-time-picker-popper"
@@ -50,7 +49,6 @@
end time
{dateChange(val,'endAt')}" v-model="editAlertSilence.endAt"
- :picker-options="optionsEndAt"
type="datetime"
:clearable="false"
popper-class="panel-time-picker-popper"
diff --git a/nezha-fronted/src/components/common/rightBox/editEndpointBoxNew.vue b/nezha-fronted/src/components/common/rightBox/editEndpointBoxNew.vue
index 465c57692..5b17088c3 100644
--- a/nezha-fronted/src/components/common/rightBox/editEndpointBoxNew.vue
+++ b/nezha-fronted/src/components/common/rightBox/editEndpointBoxNew.vue
@@ -4,7 +4,7 @@
- {{ $t("project.module.editEndpoint")}}
+ {{ $t("project.module.editEndpoint")}} {{editEndpoint.id}}
{{ $t("project.module.batchEndpoint")}}
diff --git a/nezha-fronted/src/components/common/table/settings/agentTable.vue b/nezha-fronted/src/components/common/table/settings/agentTable.vue
index afc83aaef..786e35d36 100644
--- a/nezha-fronted/src/components/common/table/settings/agentTable.vue
+++ b/nezha-fronted/src/components/common/table/settings/agentTable.vue
@@ -42,7 +42,7 @@
diff --git a/nezha-fronted/src/components/common/table/settings/endpointTable.vue b/nezha-fronted/src/components/common/table/settings/endpointTable.vue
index 2812a1170..e7cf8501e 100644
--- a/nezha-fronted/src/components/common/table/settings/endpointTable.vue
+++ b/nezha-fronted/src/components/common/table/settings/endpointTable.vue
@@ -72,13 +72,13 @@
@@ -183,16 +183,16 @@ export default {
let str = ''
arr.forEach((item, index) => {
if (index === 0) {
- str += ``
+ str += ``
}
if (index === 1) {
- str += ``
+ str += ``
}
if (index === 2) {
- str += ``
+ str += ``
}
if (index === 3) {
- str += ``
+ str += ``
}
})
return str
diff --git a/nezha-fronted/src/components/page/monitor/endpoint/endpointList.vue b/nezha-fronted/src/components/page/monitor/endpoint/endpointList.vue
index e9b290cfa..70199a742 100644
--- a/nezha-fronted/src/components/page/monitor/endpoint/endpointList.vue
+++ b/nezha-fronted/src/components/page/monitor/endpoint/endpointList.vue
@@ -65,7 +65,7 @@
-
+
diff --git a/nezha-fronted/src/http.js b/nezha-fronted/src/http.js
index d7db8162a..8c042466a 100644
--- a/nezha-fronted/src/http.js
+++ b/nezha-fronted/src/http.js
@@ -28,7 +28,7 @@ export function get (url, params) {
axios.get(url, {
params: params
}).then(response => {
- resolve(response.data, response)
+ resolve(response.data)
}).catch(err => {
if (err.response) {
resolve(err.response.data)
diff --git a/nezha-fronted/src/libs/bus.js b/nezha-fronted/src/libs/bus.js
index 16d94d825..72cd8ea68 100644
--- a/nezha-fronted/src/libs/bus.js
+++ b/nezha-fronted/src/libs/bus.js
@@ -272,6 +272,20 @@ export default new Vue({
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) {
return [
new Date(new Date(this.computeTimezone(new Date().getTime())).setHours(new Date(this.computeTimezone(new Date().getTime())).getHours() + offset)),