Update network.html
This commit is contained in:
		
							parent
							
								
									bb48e0912d
								
							
						
					
					
						commit
						a4636ed774
					
				
							
								
								
									
										38
									
								
								resource/template/theme-default/network.html
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										38
									
								
								resource/template/theme-default/network.html
									
									
									
									
										vendored
									
									
								
							@ -186,15 +186,6 @@
 | 
			
		||||
                let tSeries = [];
 | 
			
		||||
                let tLegendData = [];
 | 
			
		||||
                var lcolors = ['#5470c6', '#91cc75', '#fac858', '#ee6666', '#73c0de', '#3ba272', '#fc8452', '#9a60b4', '#ea7ccc'];
 | 
			
		||||
                let maxPing = 0;
 | 
			
		||||
                for (let i = 0; i < monitorInfo.result.length; i++) {
 | 
			
		||||
                	 for (let j = 0; j < monitorInfo.result[i].created_at.length; j++) {
 | 
			
		||||
                	 	avgDelay = Math.round(monitorInfo.result[i].avg_delay[j]);
 | 
			
		||||
                        if ( avgDelay < MaxTCPPingValue && avgDelay > maxPing) {
 | 
			
		||||
                            maxPing = avgDelay;
 | 
			
		||||
                        }
 | 
			
		||||
                	 }
 | 
			
		||||
                }
 | 
			
		||||
                for (let i = 0; i < monitorInfo.result.length; i++) {
 | 
			
		||||
                    var lcolor = lcolors[i % lcolors.length];
 | 
			
		||||
                    var rgbaColorMarker = 'rgba(' + parseInt(lcolor.slice(1, 3), 16) + ',' + parseInt(lcolor.slice(3, 5), 16) + ',' + parseInt(lcolor.slice(5, 7), 16) + ',0.5)';
 | 
			
		||||
@ -209,7 +200,15 @@
 | 
			
		||||
                        }
 | 
			
		||||
                        else {
 | 
			
		||||
                            loss += 1;
 | 
			
		||||
                            datal.push([monitorInfo.result[i].created_at[j], maxPing]);
 | 
			
		||||
                            datal.push({
 | 
			
		||||
                                xAxis: monitorInfo.result[i].created_at[j],
 | 
			
		||||
                                label: { show: false },
 | 
			
		||||
                                emphasis: { disabled: true },
 | 
			
		||||
                                lineStyle: {
 | 
			
		||||
                                    type: "solid",
 | 
			
		||||
                                    color: rgbaColorBar
 | 
			
		||||
                                }
 | 
			
		||||
                            });
 | 
			
		||||
                        }
 | 
			
		||||
                    }
 | 
			
		||||
                    lossRate = ((loss / monitorInfo.result[i].created_at.length) * 100).toFixed(1);
 | 
			
		||||
@ -224,6 +223,11 @@
 | 
			
		||||
                            smooth: true,
 | 
			
		||||
                            symbol: 'none',
 | 
			
		||||
                            data: data,
 | 
			
		||||
                            markLine: {
 | 
			
		||||
                                symbol: "none",
 | 
			
		||||
                                symbolSize :0,
 | 
			
		||||
                                data: datal
 | 
			
		||||
                            },
 | 
			
		||||
                            markPoint: {
 | 
			
		||||
                                data: [
 | 
			
		||||
                                    { type: 'max', symbol: 'pin', name: 'Max', itemStyle: { color: rgbaColorMarker }, symbolSize: 30, label: { fontSize: 8 } },
 | 
			
		||||
@ -231,26 +235,12 @@
 | 
			
		||||
                                ]
 | 
			
		||||
                            }
 | 
			
		||||
                    });
 | 
			
		||||
                    tSeries.push({
 | 
			
		||||
                            name: legendName,
 | 
			
		||||
                            type: 'bar',
 | 
			
		||||
                            smooth: true,
 | 
			
		||||
                            symbol: 'none',
 | 
			
		||||
                            data: datal,
 | 
			
		||||
                            itemStyle: { color: rgbaColorBar }
 | 
			
		||||
                    });
 | 
			
		||||
                }
 | 
			
		||||
                this.option.title.text = monitorInfo.result[0].server_name;
 | 
			
		||||
                this.option.series = tSeries;
 | 
			
		||||
                this.option.legend.data = tLegendData;
 | 
			
		||||
                this.myChart.clear();
 | 
			
		||||
                this.myChart.setOption(this.option);
 | 
			
		||||
            },
 | 
			
		||||
                this.option.title.text = monitorInfo.result[0].server_name;
 | 
			
		||||
                this.option.series = tSeries;
 | 
			
		||||
                this.option.legend.data = tLegendData;
 | 
			
		||||
                this.myChart.clear();
 | 
			
		||||
                this.myChart.setOption(this.option);
 | 
			
		||||
            },
 | 
			
		||||
            isWindowsPlatform(str) {
 | 
			
		||||
                return str.includes('Windows')
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user