diff --git a/resource/static/theme-default/js/mixin.js b/resource/static/theme-default/js/mixin.js index 54646c2438..454f4d32d6 100644 --- a/resource/static/theme-default/js/mixin.js +++ b/resource/static/theme-default/js/mixin.js @@ -2,7 +2,12 @@ const mixinsVue = { delimiters: ['@#', '#@'], data: { preferredTemplate: null, - isMobile: false + isMobile: false, + adaptedTemplates: [ + { key: 'default', name: 'Default', icon: 'th large' }, + { key: 'angel-kanade', name: 'AngelKanade', icon: 'square' }, + { key: 'server-status', name: 'SeverStatus', icon: 'list' } + ] }, created() { this.isMobile = this.checkIsMobile(); diff --git a/resource/static/theme-server-status/js/mixin.js b/resource/static/theme-server-status/js/mixin.js index cdf6c42403..c601febda8 100644 --- a/resource/static/theme-server-status/js/mixin.js +++ b/resource/static/theme-server-status/js/mixin.js @@ -6,7 +6,12 @@ const mixinsVue = { showGroup: false, showGoTop: false, preferredTemplate: null, - isMobile: false + isMobile: false, + adaptedTemplates: [ + { key: 'default', name: 'Default', icon: 'th large' }, + { key: 'angel-kanade', name: 'AngelKanade', icon: 'square' }, + { key: 'server-status', name: 'SeverStatus', icon: 'list' } + ] }, created() { this.isMobile = this.checkIsMobile(); diff --git a/resource/template/theme-angel-kanade/footer.html b/resource/template/theme-angel-kanade/footer.html index 2884f19932..76c6e51cb6 100644 --- a/resource/template/theme-angel-kanade/footer.html +++ b/resource/template/theme-angel-kanade/footer.html @@ -14,7 +14,7 @@ - + diff --git a/resource/template/theme-default/header.html b/resource/template/theme-default/header.html index 4baa373370..41b6030919 100644 --- a/resource/template/theme-default/header.html +++ b/resource/template/theme-default/header.html @@ -19,7 +19,7 @@ - + {{end}} \ No newline at end of file diff --git a/resource/template/theme-default/home.html b/resource/template/theme-default/home.html index 509937ff78..34a4def530 100644 --- a/resource/template/theme-default/home.html +++ b/resource/template/theme-default/home.html @@ -185,7 +185,7 @@ }, renderCharts(id) { if (!this.chartDataList[id - 1]) return; - const MaxTCPPingValue = {{.MaxTCPPingValue}} ? {{.MaxTCPPingValue}} : 300; + const MaxTCPPingValue = {{.Conf.MaxTCPPingValue}} ? {{.Conf.MaxTCPPingValue}} : 300; const isMobile = this.checkIsMobile(); const fontSize = isMobile ? 10 : 9; const itemGap = isMobile ? 6 : 6; @@ -207,11 +207,13 @@ const xAxisData = chartData[0].created_at.map(time => new Date(time).toLocaleString()); const seriesData = chartData.map(item => { let loss = 0; - const data = item.avg_delay.map((avgDelay, index) => { - if (avgDelay > 0.9 * MaxTCPPingValue) { + const data = item.avg_delay.map((avgDelay, index) => { + if(avgDelay > 0 && avgDelay < MaxTCPPingValue){ + loss += avgDelay > 0.9 * MaxTCPPingValue ? 1 : 0; + return [item.created_at[index], avgDelay]; + }else{ loss += 1; } - return [item.created_at[index], avgDelay]; }); const lossRate = ((loss / item.created_at.length) * 100).toFixed(1); item.monitor_name = item.monitor_name.includes("%") ? item.monitor_name : `${item.monitor_name} ${lossRate}%`; @@ -220,7 +222,8 @@ type: 'line', smooth: true, symbol: 'none', - data: data + data: data, + connectNulls: true }; }); const option = { diff --git a/resource/template/theme-default/menu.html b/resource/template/theme-default/menu.html index 9c4d5cd93a..cd0d16b093 100644 --- a/resource/template/theme-default/menu.html +++ b/resource/template/theme-default/menu.html @@ -19,14 +19,17 @@ {{tr "Services" }} {{tr "NetworkSpiter"}} -