diff --git a/nezha-fronted/src/components/page/asset/asset.vue b/nezha-fronted/src/components/page/asset/asset.vue
index 865a4afd8..96177dfca 100644
--- a/nezha-fronted/src/components/page/asset/asset.vue
+++ b/nezha-fronted/src/components/page/asset/asset.vue
@@ -91,7 +91,7 @@
placement="right"
width="200"
trigger="hover"
- :content="scope.row.pingLastUpdate+'['+scope.row.pingRtt+']'">
+ :content="scope.row.pingLastUpdate+'['+(scope.row.pingRtt ? scope.row.pingRtt:'unreachable')+']'">
diff --git a/nezha-fronted/src/components/page/project/project.vue b/nezha-fronted/src/components/page/project/project.vue
index bee4d0b9c..9fc649e37 100644
--- a/nezha-fronted/src/components/page/project/project.vue
+++ b/nezha-fronted/src/components/page/project/project.vue
@@ -1,11 +1,13 @@
@@ -172,6 +174,7 @@
${params.name}`;
+ },
+ },
+ orient:'vertical',
+ x:'center',
+ y:'bottom',
},
grid: {
//height:"50%",
@@ -478,6 +524,7 @@
height:25,
bottom:96
}],
+
xAxis: {
type: 'time',
axisLabel: {
@@ -501,7 +548,35 @@
splitLine:{
show:true
},
+ axisLabel: {
+ formatter: function(num,index) {
+ if (num >= 1000) {
+ const kbNum = num / 1000;
+ if (kbNum >= 1000) {
+ const mbNum = kbNum / 1000;
+ if (mbNum > 1000) {
+ const gbNum = mbNum / 1000;
+ /*
+ if (gbNum > 1000) {
+ const tbNum = gbNum / 1000;
+ if (tbNum > 1000) {
+ const pbNum = tbNum / 1000;
+ return `${pbNum.toFixed(2)}PB`;
+ }
+ return `${tbNum.toFixed(2)}TB`;
+ }*/
+ return `${parseFloat(gbNum.toFixed(2))}B`;
+ }
+ return `${parseFloat(mbNum.toFixed(2))}M`;
+ }
+ return `${parseFloat(kbNum.toFixed(2))}K`;
+ }
+ // return parseFloat(num.toFixed(2));
+ return num;
+ },
+ },
},
+ useUTC: false,//使用本地时间
series: []
}
}
@@ -763,7 +838,7 @@
this.$refs.assetEditUnit.tabView=true;
},
showEndpoint:function(endpoint){
- console.log(endpoint);
+ this.queryEdpLoading=true;
if(endpoint){
this.curEndpoint=endpoint;
this.formatTime='';
@@ -786,6 +861,7 @@
this.endpointQueryTabData.push(edpQueryData);
}
this.tableShow=3;
+ this.queryEdpLoading=false;
}
})
},
@@ -899,9 +975,17 @@
smooth:true, //曲线变平滑
};
chartData.name=queryData.metric.__name__;
+ delete queryData.metric.__name__;
+ chartData.name+="{";
+ Object.keys(queryData.metric).forEach((item,index)=>{
+ let label=item;
+ let value=queryData.metric[label];
+ chartData.name+=label +"='"+value+"',";
+ })
+ chartData.name=chartData.name.charAt(chartData.name.length-1) == ","?chartData.name.substr(0,chartData.name.length-1):chartData.name;
+ chartData.name+="}";
this.lenged.push(chartData.name);
chartData.data=queryData.values.map((dpsItem, dpsIndex) => {
- console.log(typeof Number(dpsItem[1]))
return [dpsItem[0] * 1000, Number(dpsItem[1])];
});
this.chartDatas.push(chartData);
@@ -978,7 +1062,7 @@
this.getModuleList(this.currentProject.id);
},
curEndpoint:function(n,o){
- this.chartOptions.title.text=n.host+ " tsg disk"
+ // this.chartOptions.title.text=n.host+ " tsg disk"
}
}
}