Merge branch 'dev-3.9' of https://git.mesalab.cn/nezha/nezha-fronted into dev-3.10-uPlot

This commit is contained in:
zhangyu
2023-10-26 10:48:52 +08:00
7 changed files with 44 additions and 17 deletions

View File

@@ -135,7 +135,7 @@ export default {
},
resize () {
this.allProject.forEach((item, index) => {
this.$refs['topology' + index][0] && this.$refs['topology' + index][0].topoResize()
this.$refs['topology' + index] && this.$refs['topology' + index][0] && this.$refs['topology' + index][0].topoResize('autoTopology' + item.id + (this.isFullscreen ? 'screen' : ''))
})
}
},

View File

@@ -684,7 +684,7 @@ export default {
},
chartClick (params) {
// 先取消多表联动 防止其它图表setOption
if (this.isConnect !== 'none') {
if (this.isConnect && this.isConnect !== 'none') {
echarts.disconnect('timeSeriesGroup')
}
getChart(this.chartId).dispatchAction({
@@ -742,7 +742,7 @@ export default {
this.toolbox.clickIndex = params.seriesIndex
const e = params.event.event
this.toolboxPosition(e)
if (this.isConnect !== 'none') {
if (this.isConnect && this.isConnect !== 'none') {
echarts.connect('timeSeriesGroup')
}
},
@@ -752,7 +752,7 @@ export default {
}
},
showSelectedSeries () {
if (this.isConnect !== 'none') {
if (this.isConnect && this.isConnect !== 'none') {
echarts.disconnect('timeSeriesGroup')
}
this.legends.forEach((item, index) => {
@@ -782,13 +782,13 @@ export default {
]
})
if (this.isConnect !== 'none') {
echarts.disconnect('timeSeriesGroup')
if (this.isConnect && this.isConnect !== 'none') {
echarts.connect('timeSeriesGroup')
}
this.clickout()
},
showAllSeries () {
if (this.isConnect !== 'none') {
if (this.isConnect && this.isConnect !== 'none') {
echarts.disconnect('timeSeriesGroup')
}
getChart(this.chartId).dispatchAction({
@@ -808,8 +808,8 @@ export default {
]
})
if (this.isConnect !== 'none') {
echarts.disconnect('timeSeriesGroup')
if (this.isConnect && this.isConnect !== 'none') {
echarts.connect('timeSeriesGroup')
}
this.clickout()
}

View File

@@ -54,8 +54,10 @@ export default {
async handler (n) {
this.loading = true
this.getReadyTableData().then(res => {
this.ringTableData = []
this.getTableData()
}).catch(res => {
this.ringTableData = []
this.ringTableData.push([])
this.$refs.loading.endLoading()
this.loading = false
@@ -80,6 +82,7 @@ export default {
},
methods: {
async getTableData () {
this.servicesTableData = []
await this.getCompactorTableData()
await this.getservicesTableData()
await this.getIngesterTableData()

View File

@@ -206,7 +206,7 @@ export default {
form.append('saId', this.obj.id)
const res = await this.$post('/license/uploadV2C', form, { 'Content-Type': 'multipart/form-data' })
if (res.code === 200) {
this.$message.success()
this.$message.success(this.$t('tip.uploadSuccess'))
} else {
this.$message.error(res.msg)
}

View File

@@ -85,6 +85,20 @@ export default {
return this.$store.getters.getTimePickerRange
}
},
watch: {
obj: {
immediate: false,
deep: true,
handler (n) {
if (this.from === fromRoute.endpoint) {
this.expressions = [`{project="${this.obj.project.name}",module="${this.obj.module.name}",endpoint="${this.obj.name}"}`]
} else if (this.from === fromRoute.asset) {
this.expressions = [`{asset="${this.obj.name}"}`]
}
this.queryLogData()
}
}
},
methods: {
exportLog ({ limit, descending }) {
const params = {

View File

@@ -70,8 +70,8 @@
<template v-else-if="item.prop === 'lastScrapeDuration'">
<el-tooltip effect="light" placement="right">
<div slot="content">
<div><span>Interval:&nbsp;</span>{{ scope.row.discoveredLabels._scrape_interval_ ? scope.row.discoveredLabels._scrape_interval_ + 's' : '0s' }}</div>
<div><span>Timeout:&nbsp;</span>{{ scope.row.discoveredLabels._scrape_timeout_ ? scope.row.discoveredLabels._scrape_timeout_ + 's' : '0s'}}</div>
<div><span>Interval:&nbsp;</span>{{ scope.row.discoveredLabels.__scrape_interval__ ? scope.row.discoveredLabels.__scrape_interval__ : '0s' }}</div>
<div><span>Timeout:&nbsp;</span>{{ scope.row.discoveredLabels.__scrape_timeout__ ? scope.row.discoveredLabels.__scrape_timeout__ : '0s'}}</div>
</div>
<span>{{ scope.row.lastScrapeDuration }}</span>
</el-tooltip>

View File

@@ -75,10 +75,16 @@
<span class="data-column__span">{{item.label}} <i class="nz-icon nz-icon-label" v-if="item.type==='label'"/></span>
</template>
<template slot-scope="scope" :column="item">
<template v-if="item.prop === 'devicesName'">
<!-- hostname -->
<template v-if="item.prop === 'hostname'">
<span>{{scope.row.hostname}}</span>
</template>
<!-- ip -->
<template v-if="item.prop === 'ip'">
<span>{{getLicense(scope.row)}}</span>
</template>
<template v-else-if="item.prop === 'status'">
<!-- state -->
<template v-else-if="item.prop === 'state'">
<div v-if="scope.row.status === 0">
<div class="active-icon green-bg inline-block"></div> {{ $t('overall.active') }}
</div>
@@ -178,12 +184,16 @@ export default {
tableData: [],
tableTitle: [
{
label: this.$t('asset.server'),
prop: 'devicesName'
label: this.$t('license.hostname'),
prop: 'hostname'
},
{
label: 'IP:port',
prop: 'ip'
},
{
label: this.$t('overall.state'),
prop: 'status'
prop: 'state'
}
],
expData: {},