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

View File

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

View File

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

View File

@@ -85,6 +85,20 @@ export default {
return this.$store.getters.getTimePickerRange 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: { methods: {
exportLog ({ limit, descending }) { exportLog ({ limit, descending }) {
const params = { const params = {

View File

@@ -70,8 +70,8 @@
<template v-else-if="item.prop === 'lastScrapeDuration'"> <template v-else-if="item.prop === 'lastScrapeDuration'">
<el-tooltip effect="light" placement="right"> <el-tooltip effect="light" placement="right">
<div slot="content"> <div slot="content">
<div><span>Interval:&nbsp;</span>{{ scope.row.discoveredLabels._scrape_interval_ ? scope.row.discoveredLabels._scrape_interval_ + '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_ + 's' : '0s'}}</div> <div><span>Timeout:&nbsp;</span>{{ scope.row.discoveredLabels.__scrape_timeout__ ? scope.row.discoveredLabels.__scrape_timeout__ : '0s'}}</div>
</div> </div>
<span>{{ scope.row.lastScrapeDuration }}</span> <span>{{ scope.row.lastScrapeDuration }}</span>
</el-tooltip> </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> <span class="data-column__span">{{item.label}} <i class="nz-icon nz-icon-label" v-if="item.type==='label'"/></span>
</template> </template>
<template slot-scope="scope" :column="item"> <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> <span>{{getLicense(scope.row)}}</span>
</template> </template>
<template v-else-if="item.prop === 'status'"> <!-- state -->
<template v-else-if="item.prop === 'state'">
<div v-if="scope.row.status === 0"> <div v-if="scope.row.status === 0">
<div class="active-icon green-bg inline-block"></div> {{ $t('overall.active') }} <div class="active-icon green-bg inline-block"></div> {{ $t('overall.active') }}
</div> </div>
@@ -178,12 +184,16 @@ export default {
tableData: [], tableData: [],
tableTitle: [ tableTitle: [
{ {
label: this.$t('asset.server'), label: this.$t('license.hostname'),
prop: 'devicesName' prop: 'hostname'
},
{
label: 'IP:port',
prop: 'ip'
}, },
{ {
label: this.$t('overall.state'), label: this.$t('overall.state'),
prop: 'status' prop: 'state'
} }
], ],
expData: {}, expData: {},