CN-697 feat: 增加使用url保存页面状态的功能,此提交实现panel的时间条件和network overview的App list的metric值

This commit is contained in:
chenjinsong
2022-09-07 20:17:38 +08:00
parent 0ee8d7e7c0
commit c4ade1d0ab
6 changed files with 124 additions and 81 deletions

View File

@@ -121,7 +121,7 @@ import unitConvert from '@/utils/unit-convert'
import { storageKey, unitTypes, networkTable, operationType } from '@/utils/constants'
import * as echarts from 'echarts'
import { appListChartOption } from '@/views/charts2/charts/options/echartOption'
import { shallowRef } from 'vue'
import { ref, shallowRef } from 'vue'
import { get, put } from '@/utils/http'
import { api } from '@/utils/api'
import _ from 'lodash'
@@ -131,6 +131,7 @@ import loading from '@/components/common/Loading'
import ChartNoData from '@/views/charts/charts/ChartNoData'
import { appStackedLineTooltipFormatter } from '@/views/charts/charts/tools'
import chartMixin from '@/views/charts2/chart-mixin'
import { useRoute } from 'vue-router'
export default {
name: 'NetworkOverviewApps',
@@ -140,13 +141,15 @@ export default {
},
mixins: [chartMixin],
setup () {
const { query } = useRoute()
const metricFilter = ref(query.appListMetric || 'Bits/s')
return {
metricFilter,
myChart: shallowRef([])
}
},
data () {
return {
metricFilter: 'Bits/s',
metricOptions: [
{
value: 'Bits/s',