diff --git a/nezha-fronted/src/assets/stylus/main.scss b/nezha-fronted/src/assets/stylus/main.scss
index 6ea3c0064..5361c2ff9 100644
--- a/nezha-fronted/src/assets/stylus/main.scss
+++ b/nezha-fronted/src/assets/stylus/main.scss
@@ -2169,13 +2169,13 @@ li{
height: 70px;
justify-content: space-around;
}
-.right-box-form>.el-form-item.half-form-item-other{
+.right-box-form .half-form-item-other{
display: inline-block;
- width: calc(50% - 15px);
+ width: calc(50% - 30px);
}
-.right-box-form>.el-form-item.half-form-item-other-two{
+.right-box-form .half-form-item-other-two{
display: inline-block;
- width: calc(50% - 15px);
+ width: calc(50% - 30px);
margin-left: 0;
}
.right-box .right-box-form-add,.right-box .right-box-form-minus-box{
diff --git a/nezha-fronted/src/components/charts/chart-list.vue b/nezha-fronted/src/components/charts/chart-list.vue
index 7d0be3dfa..0e320c972 100644
--- a/nezha-fronted/src/components/charts/chart-list.vue
+++ b/nezha-fronted/src/components/charts/chart-list.vue
@@ -230,6 +230,8 @@ import textChart from './text-chart'
import chartPie from './chart-pie'
import chartBarStatis from './chart-bar-statistics'
import chartGroup from './chart-group'
+import { fromRoute } from '@/components/common/js/constants'
+import chartTempData from "@/components/charts/chartTempData";
// import visNetwork from './visNetwork'
export default {
name: 'chartList',
@@ -240,7 +242,8 @@ export default {
detail: Object,
from: { type: String },
panelLock: { type: Boolean, default: false },
- hasGroup: { type: Boolean, default: true }
+ hasGroup: { type: Boolean, default: true },
+ panelDataList: Array
},
components: {
@@ -283,6 +286,12 @@ export default {
// showShadow:false,
}
},
+ watch: {
+ panelDataList (n) {
+ console.log(n)
+ this.getData(this.filter)
+ }
+ },
methods: {
dropmenuChange (id, show) {
if (show) {
@@ -662,9 +671,25 @@ export default {
})
return
}
+ if (param.from == this.$CONSTANTS.fromRoute.chartTemp) {
+ console.log(this.panelDataList)
+ this.dataList = this.panelDataList
+ this.$nextTick(() => {
+ this.dataList.forEach((item, index) => {
+ this.$set(item, 'from', params.from)
+ this.setChartSize(item, index)// 设置该图表宽度
+ const chartBox = document.getElementById('chart-' + item.id)
+ this.handleElementInViewport(chartBox, 0, item, index)
+ if (item.type === 'group') {
+ this.$refs['editChart' + item.id][0].$refs.listGroup.getData(params)
+ }
+ })
+ })
+ return
+ }
if (!param.query) delete param.query
// 根据panelId获得panel下的所有图表
- this.$get('visual/panel/chart?panelId=' + params.panelId).then(response => {
+ this.$get('visual/panel/chart?panelId=' + params.panelId + '&pageSize=-1').then(response => {
if (response.code === 200) {
response.data.list.forEach((item, index) => {
item.isLoaded = false
@@ -918,6 +943,9 @@ export default {
// if(chartInfo.type === 'table'&&chartInfo.param&&chartInfo.param.last == 1){
// return this.$get('/prom/api/v1/query_range?query=' + query + "&start=" + this.$stringTimeParseToUnix(endTime) + "&end=" + this.$stringTimeParseToUnix(endTime) + '&step=' + step);
// }
+ if (this.from === fromRoute.chartTemp) {
+ return chartTempData
+ }
return this.$get('/prom/api/v1/query_range?query=' + query + '&start=' + this.$stringTimeParseToUnix(startTime) + '&end=' + this.$stringTimeParseToUnix(endTime) + '&step=' + step)
})
// 一个图表的所有element单独获取数据
diff --git a/nezha-fronted/src/components/charts/chartTempData.js b/nezha-fronted/src/components/charts/chartTempData.js
new file mode 100644
index 000000000..cec3ca506
--- /dev/null
+++ b/nezha-fronted/src/components/charts/chartTempData.js
@@ -0,0 +1,980 @@
+const chartTempData = {
+ data: {
+ result: [
+ {
+ metric: {
+
+ },
+ values: [
+ [
+ 1619326641,
+ '67234.52306889734'
+ ],
+ [
+ 1619326656,
+ '84768.45245026101'
+ ],
+ [
+ 1619326671,
+ '129634.01007646995'
+ ],
+ [
+ 1619326686,
+ '156542.62882642742'
+ ],
+ [
+ 1619326701,
+ '135705.9448148899'
+ ],
+ [
+ 1619326716,
+ '115572.40233875904'
+ ],
+ [
+ 1619326731,
+ '97737.31879742522'
+ ],
+ [
+ 1619326746,
+ '83827.90092416394'
+ ],
+ [
+ 1619326761,
+ '99792.76711425022'
+ ],
+ [
+ 1619326776,
+ '141957.65742923907'
+ ],
+ [
+ 1619326791,
+ '169193.0479737079'
+ ],
+ [
+ 1619326806,
+ '155332.39710062867'
+ ],
+ [
+ 1619326821,
+ '129349.45882305052'
+ ],
+ [
+ 1619326836,
+ '108301.37872333173'
+ ],
+ [
+ 1619326851,
+ '90034.99368171557'
+ ],
+ [
+ 1619326866,
+ '80273.24280781174'
+ ],
+ [
+ 1619326881,
+ '71427.56847681744'
+ ],
+ [
+ 1619326896,
+ '65009.655216768355'
+ ],
+ [
+ 1619326911,
+ '56202.051900505874'
+ ],
+ [
+ 1619326926,
+ '49175.99200440523'
+ ],
+ [
+ 1619326941,
+ '51675.252768933875'
+ ],
+ [
+ 1619326956,
+ '60142.6817538732'
+ ],
+ [
+ 1619326971,
+ '58492.28986291914'
+ ],
+ [
+ 1619326986,
+ '88647.97630420537'
+ ],
+ [
+ 1619327001,
+ '129227.8284375646'
+ ],
+ [
+ 1619327016,
+ '119235.93213991504'
+ ],
+ [
+ 1619327031,
+ '101160.05700432547'
+ ],
+ [
+ 1619327046,
+ '87795.44901362302'
+ ],
+ [
+ 1619327061,
+ '87315.15463300308'
+ ],
+ [
+ 1619327076,
+ '92489.18937959624'
+ ],
+ [
+ 1619327091,
+ '93086.80666954032'
+ ],
+ [
+ 1619327106,
+ '112996.24939570608'
+ ],
+ [
+ 1619327121,
+ '125622.50409516145'
+ ],
+ [
+ 1619327136,
+ '124043.75671756931'
+ ],
+ [
+ 1619327151,
+ '125915.23892405373'
+ ],
+ [
+ 1619327166,
+ '131860.94148401526'
+ ],
+ [
+ 1619327181,
+ '131323.512587253'
+ ],
+ [
+ 1619327196,
+ '130202.84054319662'
+ ],
+ [
+ 1619327211,
+ '131137.2998550472'
+ ],
+ [
+ 1619327226,
+ '140011.84069068846'
+ ],
+ [
+ 1619327241,
+ '144761.03094652962'
+ ],
+ [
+ 1619327256,
+ '140896.2234628107'
+ ],
+ [
+ 1619327271,
+ '144939.9521471322'
+ ],
+ [
+ 1619327286,
+ '146854.00264563446'
+ ],
+ [
+ 1619327301,
+ '143528.7608647803'
+ ],
+ [
+ 1619327316,
+ '136391.16570184118'
+ ],
+ [
+ 1619327331,
+ '134939.63766213963'
+ ],
+ [
+ 1619327346,
+ '130734.90194389559'
+ ],
+ [
+ 1619327361,
+ '136434.88336788653'
+ ],
+ [
+ 1619327376,
+ '145092.16210718406'
+ ],
+ [
+ 1619327391,
+ '152065.04153079912'
+ ],
+ [
+ 1619327406,
+ '156798.09185927216'
+ ],
+ [
+ 1619327421,
+ '158674.77766447523'
+ ],
+ [
+ 1619327436,
+ '161096.58445758978'
+ ],
+ [
+ 1619327451,
+ '158761.11021276534'
+ ],
+ [
+ 1619327466,
+ '163004.29606041766'
+ ],
+ [
+ 1619327481,
+ '167314.9710412085'
+ ],
+ [
+ 1619327496,
+ '165583.65723135485'
+ ],
+ [
+ 1619327511,
+ '150599.88881636693'
+ ],
+ [
+ 1619327526,
+ '136263.16856828984'
+ ],
+ [
+ 1619327541,
+ '127531.12022245591'
+ ],
+ [
+ 1619327556,
+ '112626.2854714918'
+ ],
+ [
+ 1619327571,
+ '109748.6926587426'
+ ],
+ [
+ 1619327586,
+ '103216.89749119896'
+ ],
+ [
+ 1619327601,
+ '120054.0931496599'
+ ],
+ [
+ 1619327616,
+ '124397.01189137285'
+ ],
+ [
+ 1619327631,
+ '121693.36886313172'
+ ],
+ [
+ 1619327646,
+ '124263.5185058619'
+ ],
+ [
+ 1619327661,
+ '129370.31776538865'
+ ],
+ [
+ 1619327676,
+ '133191.73551700043'
+ ],
+ [
+ 1619327691,
+ '144078.4064984659'
+ ],
+ [
+ 1619327706,
+ '139893.47544839772'
+ ],
+ [
+ 1619327721,
+ '139218.28627794381'
+ ],
+ [
+ 1619327736,
+ '135077.997911198'
+ ],
+ [
+ 1619327751,
+ '137188.8500959387'
+ ],
+ [
+ 1619327766,
+ '136302.6625400467'
+ ],
+ [
+ 1619327781,
+ '135333.82845756598'
+ ],
+ [
+ 1619327796,
+ '141334.01284001715'
+ ],
+ [
+ 1619327811,
+ '137118.18506250918'
+ ],
+ [
+ 1619327826,
+ '131834.77580904771'
+ ],
+ [
+ 1619327841,
+ '125440.56107015046'
+ ],
+ [
+ 1619327856,
+ '129950.61479606191'
+ ],
+ [
+ 1619327871,
+ '132228.4300026117'
+ ],
+ [
+ 1619327886,
+ '126695.44097770381'
+ ],
+ [
+ 1619327901,
+ '140958.99289731166'
+ ],
+ [
+ 1619327916,
+ '145497.2801943425'
+ ],
+ [
+ 1619327931,
+ '132973.074348475'
+ ],
+ [
+ 1619327946,
+ '137179.44736553708'
+ ],
+ [
+ 1619327961,
+ '143180.66659914295'
+ ],
+ [
+ 1619327976,
+ '137765.40360422112'
+ ],
+ [
+ 1619327991,
+ '129042.39839074464'
+ ],
+ [
+ 1619328006,
+ '121699.96972642104'
+ ],
+ [
+ 1619328021,
+ '126221.42670726098'
+ ],
+ [
+ 1619328036,
+ '129724.29089390681'
+ ],
+ [
+ 1619328051,
+ '136616.86970395234'
+ ],
+ [
+ 1619328066,
+ '139008.3170592644'
+ ],
+ [
+ 1619328081,
+ '147551.30851143942'
+ ],
+ [
+ 1619328096,
+ '155084.9733920894'
+ ],
+ [
+ 1619328111,
+ '161961.05584908125'
+ ],
+ [
+ 1619328126,
+ '162768.42434900918'
+ ],
+ [
+ 1619328141,
+ '156259.98260298115'
+ ],
+ [
+ 1619328156,
+ '154439.53586441962'
+ ],
+ [
+ 1619328171,
+ '156135.37586396653'
+ ],
+ [
+ 1619328186,
+ '155884.24195870038'
+ ],
+ [
+ 1619328201,
+ '158386.6374126683'
+ ],
+ [
+ 1619328216,
+ '153855.1064273622'
+ ],
+ [
+ 1619328231,
+ '154296.20722794015'
+ ],
+ [
+ 1619328246,
+ '156068.06042940164'
+ ],
+ [
+ 1619328261,
+ '152266.96251924452'
+ ],
+ [
+ 1619328276,
+ '158288.5803709968'
+ ],
+ [
+ 1619328291,
+ '162867.9908155629'
+ ],
+ [
+ 1619328306,
+ '170007.72483388087'
+ ],
+ [
+ 1619328321,
+ '170739.98543400207'
+ ],
+ [
+ 1619328336,
+ '165015.94268824425'
+ ],
+ [
+ 1619328351,
+ '164295.23424811324'
+ ],
+ [
+ 1619328366,
+ '167809.8241459832'
+ ],
+ [
+ 1619328381,
+ '163713.7187657755'
+ ],
+ [
+ 1619328396,
+ '170231.75566899288'
+ ],
+ [
+ 1619328411,
+ '169801.47429921135'
+ ],
+ [
+ 1619328426,
+ '168025.86124235595'
+ ],
+ [
+ 1619328441,
+ '173188.72482130752'
+ ],
+ [
+ 1619328456,
+ '174727.4231324348'
+ ],
+ [
+ 1619328471,
+ '175981.6730451862'
+ ],
+ [
+ 1619328486,
+ '159560.41549215658'
+ ],
+ [
+ 1619328501,
+ '147907.8587575518'
+ ],
+ [
+ 1619328516,
+ '135063.16044782364'
+ ],
+ [
+ 1619328531,
+ '125265.4855367947'
+ ],
+ [
+ 1619328546,
+ '131484.32374593205'
+ ],
+ [
+ 1619328561,
+ '128506.35314877935'
+ ],
+ [
+ 1619328576,
+ '135645.2532736919'
+ ],
+ [
+ 1619328591,
+ '144056.59948014285'
+ ],
+ [
+ 1619328606,
+ '154336.59859408153'
+ ],
+ [
+ 1619328621,
+ '166894.53898574616'
+ ],
+ [
+ 1619328636,
+ '169942.55611799294'
+ ],
+ [
+ 1619328651,
+ '162718.33839203947'
+ ],
+ [
+ 1619328666,
+ '166353.4185642925'
+ ],
+ [
+ 1619328681,
+ '154666.30677592353'
+ ],
+ [
+ 1619328696,
+ '151539.86711566127'
+ ],
+ [
+ 1619328711,
+ '147111.77171292162'
+ ],
+ [
+ 1619328726,
+ '145664.07148119409'
+ ],
+ [
+ 1619328741,
+ '148277.06701275433'
+ ],
+ [
+ 1619328756,
+ '148253.63143962697'
+ ],
+ [
+ 1619328771,
+ '152678.93662904084'
+ ],
+ [
+ 1619328786,
+ '149142.12352995639'
+ ],
+ [
+ 1619328801,
+ '146774.93188005552'
+ ],
+ [
+ 1619328816,
+ '150737.78019044892'
+ ],
+ [
+ 1619328831,
+ '151467.35529243143'
+ ],
+ [
+ 1619328846,
+ '186328.82006624647'
+ ],
+ [
+ 1619328861,
+ '222879.0034326688'
+ ],
+ [
+ 1619328876,
+ '211274.86995717912'
+ ],
+ [
+ 1619328891,
+ '195136.61403361673'
+ ],
+ [
+ 1619328906,
+ '192917.71153120717'
+ ],
+ [
+ 1619328921,
+ '200290.90163374666'
+ ],
+ [
+ 1619328936,
+ '246708.293331658'
+ ],
+ [
+ 1619328951,
+ '263882.25419267954'
+ ],
+ [
+ 1619328966,
+ '245958.13180563593'
+ ],
+ [
+ 1619328981,
+ '233169.2019982923'
+ ],
+ [
+ 1619328996,
+ '223366.11067840818'
+ ],
+ [
+ 1619329011,
+ '215535.62372111296'
+ ],
+ [
+ 1619329026,
+ '211956.30837713985'
+ ],
+ [
+ 1619329041,
+ '206075.45873981708'
+ ],
+ [
+ 1619329056,
+ '194453.3574888578'
+ ],
+ [
+ 1619329071,
+ '190628.31905188566'
+ ],
+ [
+ 1619329086,
+ '176952.97563925944'
+ ],
+ [
+ 1619329101,
+ '161969.5509223355'
+ ],
+ [
+ 1619329116,
+ '163276.4684482879'
+ ],
+ [
+ 1619329131,
+ '157353.2552160069'
+ ],
+ [
+ 1619329146,
+ '146882.99531941232'
+ ],
+ [
+ 1619329161,
+ '152258.4560985092'
+ ],
+ [
+ 1619329176,
+ '156959.18525475552'
+ ],
+ [
+ 1619329191,
+ '159649.51546564006'
+ ],
+ [
+ 1619329206,
+ '167908.55714451114'
+ ],
+ [
+ 1619329221,
+ '172948.33807402014'
+ ],
+ [
+ 1619329236,
+ '182685.45218821947'
+ ],
+ [
+ 1619329251,
+ '187030.35202671902'
+ ],
+ [
+ 1619329266,
+ '190079.30323855148'
+ ],
+ [
+ 1619329281,
+ '192971.9526461216'
+ ],
+ [
+ 1619329296,
+ '196336.89160028717'
+ ],
+ [
+ 1619329311,
+ '198904.32225845434'
+ ],
+ [
+ 1619329326,
+ '217357.3580010716'
+ ],
+ [
+ 1619329341,
+ '234419.8015930916'
+ ],
+ [
+ 1619329356,
+ '211699.108503841'
+ ],
+ [
+ 1619329371,
+ '194296.97437986446'
+ ],
+ [
+ 1619329386,
+ '177526.51953365305'
+ ],
+ [
+ 1619329401,
+ '174123.3153590256'
+ ],
+ [
+ 1619329416,
+ '174236.0884374152'
+ ],
+ [
+ 1619329431,
+ '175881.42654414504'
+ ],
+ [
+ 1619329446,
+ '181180.89650041307'
+ ],
+ [
+ 1619329461,
+ '179659.1297273033'
+ ],
+ [
+ 1619329476,
+ '166824.4538851082'
+ ],
+ [
+ 1619329491,
+ '167211.34500916823'
+ ],
+ [
+ 1619329506,
+ '157478.16192696424'
+ ],
+ [
+ 1619329521,
+ '166798.5784502148'
+ ],
+ [
+ 1619329536,
+ '158308.49615751408'
+ ],
+ [
+ 1619329551,
+ '157600.86333199075'
+ ],
+ [
+ 1619329566,
+ '143876.78396160837'
+ ],
+ [
+ 1619329581,
+ '142125.21240294934'
+ ],
+ [
+ 1619329596,
+ '134845.72705098847'
+ ],
+ [
+ 1619329611,
+ '136348.216869971'
+ ],
+ [
+ 1619329626,
+ '128227.58563619448'
+ ],
+ [
+ 1619329641,
+ '127366.85129458207'
+ ],
+ [
+ 1619329656,
+ '144952.86329025935'
+ ],
+ [
+ 1619329671,
+ '146120.8645811903'
+ ],
+ [
+ 1619329686,
+ '138372.3693190331'
+ ],
+ [
+ 1619329701,
+ '137356.03166965354'
+ ],
+ [
+ 1619329716,
+ '135886.32810594278'
+ ],
+ [
+ 1619329731,
+ '137777.51698661354'
+ ],
+ [
+ 1619329746,
+ '139546.60952125024'
+ ],
+ [
+ 1619329761,
+ '143152.12746029842'
+ ],
+ [
+ 1619329776,
+ '132632.79505347987'
+ ],
+ [
+ 1619329791,
+ '132902.87719231608'
+ ],
+ [
+ 1619329806,
+ '121644.84048351011'
+ ],
+ [
+ 1619329821,
+ '127381.36242802144'
+ ],
+ [
+ 1619329836,
+ '133454.34768905598'
+ ],
+ [
+ 1619329851,
+ '118548.5648224194'
+ ],
+ [
+ 1619329866,
+ '103759.37104672648'
+ ],
+ [
+ 1619329881,
+ '92858.28975097225'
+ ],
+ [
+ 1619329896,
+ '79393.33731962508'
+ ],
+ [
+ 1619329911,
+ '68176.01390834473'
+ ],
+ [
+ 1619329926,
+ '83274.89339599916'
+ ],
+ [
+ 1619329941,
+ '105078.4121009993'
+ ],
+ [
+ 1619329956,
+ '121687.38734146685'
+ ],
+ [
+ 1619329971,
+ '173787.31134659174'
+ ],
+ [
+ 1619329986,
+ '218940.57387272274'
+ ],
+ [
+ 1619330001,
+ '252832.37563365034'
+ ],
+ [
+ 1619330016,
+ '250250.00475681957'
+ ],
+ [
+ 1619330031,
+ '222391.40952185704'
+ ],
+ [
+ 1619330046,
+ '201470.72138033944'
+ ],
+ [
+ 1619330061,
+ '188387.77045423904'
+ ],
+ [
+ 1619330076,
+ '173486.26445006474'
+ ],
+ [
+ 1619330091,
+ '176695.15924696584'
+ ],
+ [
+ 1619330106,
+ '161362.67228012058'
+ ],
+ [
+ 1619330121,
+ '156280.2942065875'
+ ],
+ [
+ 1619330136,
+ '147856.53518165532'
+ ],
+ [
+ 1619330151,
+ '142447.18670247635'
+ ],
+ [
+ 1619330166,
+ '147411.2790305058'
+ ],
+ [
+ 1619330181,
+ '154897.85213886894'
+ ],
+ [
+ 1619330196,
+ '165502.40762979828'
+ ],
+ [
+ 1619330211,
+ '186345.75300514325'
+ ],
+ [
+ 1619330226,
+ '225214.8040061793'
+ ],
+ [
+ 1619330241,
+ '212569.63634406356'
+ ]
+ ]
+ }
+ ],
+ resultType: 'matrix'
+ },
+ status: 'success'
+}
+export default chartTempData
diff --git a/nezha-fronted/src/components/common/bottomBox/bottomBox.vue b/nezha-fronted/src/components/common/bottomBox/bottomBox.vue
index b87481e18..06109cc53 100644
--- a/nezha-fronted/src/components/common/bottomBox/bottomBox.vue
+++ b/nezha-fronted/src/components/common/bottomBox/bottomBox.vue
@@ -49,6 +49,8 @@