mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-12-14 20:06:34 +08:00
商业版首页增加地图/调低各个图表的高度,以便同时可以显示更多的图表
This commit is contained in:
@@ -26,7 +26,7 @@
|
||||
display: inline;
|
||||
}
|
||||
.chart-box {
|
||||
height: 20em;
|
||||
height: 14em;
|
||||
}
|
||||
h4 span {
|
||||
font-size: 0.8em;
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
}
|
||||
|
||||
.chart-box {
|
||||
height: 20em;
|
||||
height: 14em;
|
||||
}
|
||||
|
||||
h4 {
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
display: inline;
|
||||
}
|
||||
.chart-box {
|
||||
height: 20em;
|
||||
height: 14em;
|
||||
}
|
||||
h4 span {
|
||||
font-size: 0.8em;
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
}
|
||||
|
||||
.chart-box {
|
||||
height: 20em;
|
||||
height: 14em;
|
||||
}
|
||||
|
||||
h4 {
|
||||
|
||||
@@ -28,6 +28,6 @@
|
||||
display: inline;
|
||||
}
|
||||
.chart-box {
|
||||
height: 20em;
|
||||
height: 14em;
|
||||
}
|
||||
/*# sourceMappingURL=dns.css.map */
|
||||
@@ -42,5 +42,5 @@
|
||||
}
|
||||
|
||||
.chart-box {
|
||||
height: 20em;
|
||||
height: 14em;
|
||||
}
|
||||
@@ -28,7 +28,13 @@
|
||||
display: inline;
|
||||
}
|
||||
.chart-box {
|
||||
height: 20em;
|
||||
height: 14em;
|
||||
}
|
||||
.traffic-map-box {
|
||||
height: 16em;
|
||||
}
|
||||
.traffic-map-box div::-webkit-scrollbar {
|
||||
width: 4px;
|
||||
}
|
||||
h4 span {
|
||||
font-size: 0.8em;
|
||||
|
||||
@@ -1 +1 @@
|
||||
{"version":3,"sources":["index.less"],"names":[],"mappings":"AAAA,GAAG,QACF,EACC,MAAK;EACJ,kBAAA;EACA,UAAA;EACA,QAAA;;AAKH;EACC,0BAAA;EACA,2BAAA;;AAFD,KAIC;EACC,kBAAA;EACA,4BAAA;;AANF,KAIC,QAIC,IAAG;EACF,iBAAA;;AATH,KAIC,QAIC,IAAG,MAGF;EACC,cAAA;EACA,mBAAA;;AAbJ,KAkBC,QAAO;EACN,eAAA;;AAnBF,KAsBC,GACC;EACC,aAAA;;AAxBH,KA4BC,QAAO,MACN;EACC,eAAA;;AAKH;EACC,YAAA;;AAGD,EACC;EACC,gBAAA;EACA,WAAA","file":"index.css"}
|
||||
{"version":3,"sources":["index.less"],"names":[],"mappings":"AAAA,GAAG,QACF,EACC,MAAK;EACJ,kBAAA;EACA,UAAA;EACA,QAAA;;AAKH;EACC,0BAAA;EACA,2BAAA;;AAFD,KAIC;EACC,kBAAA;EACA,4BAAA;;AANF,KAIC,QAIC,IAAG;EACF,iBAAA;;AATH,KAIC,QAIC,IAAG,MAGF;EACC,cAAA;EACA,mBAAA;;AAbJ,KAkBC,QAAO;EACN,eAAA;;AAnBF,KAsBC,GACC;EACC,aAAA;;AAxBH,KA4BC,QAAO,MACN;EACC,eAAA;;AAKH;EACC,YAAA;;AAGD;EACC,YAAA;;AADD,gBAGC,IAAG;EACF,UAAA;;AAIF,EACC;EACC,gBAAA;EACA,WAAA","file":"index.css"}
|
||||
@@ -1,5 +1,11 @@
|
||||
{$layout}
|
||||
{$template "/echarts"}
|
||||
|
||||
{$var "header"}
|
||||
<!-- world map -->
|
||||
<script type="text/javascript" src="/js/echarts/echarts.min.js"></script>
|
||||
<script type="text/javascript" src="/js/world.js"></script>
|
||||
<script type="text/javascript" src="/js/world-countries-map.js"></script>
|
||||
{$end}
|
||||
|
||||
{$template "menu"}
|
||||
|
||||
@@ -111,6 +117,12 @@
|
||||
|
||||
<div class="ui divider"></div>
|
||||
|
||||
<!-- 流量地图 -->
|
||||
<div class="traffic-map-box" v-if="!isLoading">
|
||||
<traffic-map-box :v-stats="topCountryStats"></traffic-map-box>
|
||||
</div>
|
||||
<div class="ui divider"></div>
|
||||
|
||||
<!-- 流量 -->
|
||||
<div class="ui menu tabular" v-show="!isLoading">
|
||||
<a href="" class="item" :class="{active: trafficTab == 'hourly'}" @click.prevent="selectTrafficTab('hourly')">24小时流量趋势</a>
|
||||
|
||||
@@ -3,6 +3,7 @@ Tea.context(function () {
|
||||
this.trafficTab = "hourly"
|
||||
this.metricCharts = []
|
||||
this.plusExpireDay = ""
|
||||
this.topCountryStats = []
|
||||
|
||||
this.$delay(function () {
|
||||
this.$post("$")
|
||||
|
||||
@@ -44,7 +44,15 @@
|
||||
}
|
||||
|
||||
.chart-box {
|
||||
height: 20em;
|
||||
height: 14em;
|
||||
}
|
||||
|
||||
.traffic-map-box {
|
||||
height: 16em;
|
||||
|
||||
div::-webkit-scrollbar {
|
||||
width: 4px;
|
||||
}
|
||||
}
|
||||
|
||||
h4 {
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
display: inline;
|
||||
}
|
||||
.chart-box {
|
||||
height: 20em;
|
||||
height: 14em;
|
||||
}
|
||||
h4 span {
|
||||
font-size: 0.8em;
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
}
|
||||
|
||||
.chart-box {
|
||||
height: 20em;
|
||||
height: 14em;
|
||||
}
|
||||
|
||||
h4 {
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
display: inline;
|
||||
}
|
||||
.chart-box {
|
||||
height: 20em;
|
||||
height: 14em;
|
||||
}
|
||||
.color-span {
|
||||
font-size: 0.8em;
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
}
|
||||
|
||||
.chart-box {
|
||||
height: 20em;
|
||||
height: 14em;
|
||||
}
|
||||
|
||||
.color-span {
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
display: inline;
|
||||
}
|
||||
.chart-box {
|
||||
height: 20em;
|
||||
height: 14em;
|
||||
}
|
||||
h4 span {
|
||||
font-size: 0.8em;
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
}
|
||||
|
||||
.chart-box {
|
||||
height: 20em;
|
||||
height: 14em;
|
||||
}
|
||||
|
||||
h4 {
|
||||
|
||||
@@ -28,6 +28,6 @@
|
||||
display: inline;
|
||||
}
|
||||
.chart-box {
|
||||
height: 20em;
|
||||
height: 14em;
|
||||
}
|
||||
/*# sourceMappingURL=index.css.map */
|
||||
@@ -42,5 +42,5 @@
|
||||
}
|
||||
|
||||
.chart-box {
|
||||
height: 20em;
|
||||
height: 14em;
|
||||
}
|
||||
@@ -23,7 +23,7 @@
|
||||
display: inline;
|
||||
}
|
||||
.chart-box {
|
||||
height: 20em;
|
||||
height: 14em;
|
||||
}
|
||||
h4 span {
|
||||
font-size: 0.8em;
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
}
|
||||
|
||||
.chart-box {
|
||||
height: 20em;
|
||||
height: 14em;
|
||||
}
|
||||
|
||||
h4 {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
.chart-box {
|
||||
height: 21em;
|
||||
height: 14em;
|
||||
}
|
||||
h4 span.small {
|
||||
font-size: 0.8em;
|
||||
|
||||
@@ -4,27 +4,27 @@ Tea.context(function () {
|
||||
|
||||
this.reloadRequestsChart("minutely-requests-chart", "请求数统计", this.minutelyStats, function (args) {
|
||||
if (args.seriesIndex == 0) {
|
||||
return that.minutelyStats[args.dataIndex].day + " " + that.minutelyStats[args.dataIndex].minute + " 请求数: " + teaweb.formatNumber(that.minutelyStats[args.dataIndex].countRequests)
|
||||
return that.minutelyStats[args.dataIndex].day + " " + that.minutelyStats[args.dataIndex].minute + "<br/>请求数: " + teaweb.formatNumber(that.minutelyStats[args.dataIndex].countRequests)
|
||||
}
|
||||
if (args.seriesIndex == 1) {
|
||||
let ratio = 0
|
||||
if (that.minutelyStats[args.dataIndex].countRequests > 0) {
|
||||
ratio = Math.round(that.minutelyStats[args.dataIndex].countCachedRequests * 10000 / that.minutelyStats[args.dataIndex].countRequests) / 100
|
||||
}
|
||||
return that.minutelyStats[args.dataIndex].day + " " + that.minutelyStats[args.dataIndex].minute + " 缓存请求数: " + teaweb.formatNumber(that.minutelyStats[args.dataIndex].countCachedRequests) + ", 命中率:" + ratio + "%"
|
||||
return that.minutelyStats[args.dataIndex].day + " " + that.minutelyStats[args.dataIndex].minute + "<br/>缓存请求数: " + teaweb.formatNumber(that.minutelyStats[args.dataIndex].countCachedRequests) + "<br/>命中率:" + ratio + "%"
|
||||
}
|
||||
return ""
|
||||
})
|
||||
this.reloadTrafficChart("minutely-traffic-chart", "流量统计", this.minutelyStats, function (args) {
|
||||
if (args.seriesIndex == 0) {
|
||||
return that.minutelyStats[args.dataIndex].day + " " + that.minutelyStats[args.dataIndex].minute + " 流量: " + teaweb.formatBytes(that.minutelyStats[args.dataIndex].bytes)
|
||||
return that.minutelyStats[args.dataIndex].day + " " + that.minutelyStats[args.dataIndex].minute + "<br/>流量: " + teaweb.formatBytes(that.minutelyStats[args.dataIndex].bytes)
|
||||
}
|
||||
if (args.seriesIndex == 1) {
|
||||
let ratio = 0
|
||||
if (that.minutelyStats[args.dataIndex].bytes > 0) {
|
||||
ratio = Math.round(that.minutelyStats[args.dataIndex].cachedBytes * 10000 / that.minutelyStats[args.dataIndex].bytes) / 100
|
||||
}
|
||||
return that.minutelyStats[args.dataIndex].day + " " + that.minutelyStats[args.dataIndex].minute + " 缓存流量: " + teaweb.formatBytes(that.minutelyStats[args.dataIndex].cachedBytes) + ", 命中率:" + ratio + "%"
|
||||
return that.minutelyStats[args.dataIndex].day + " " + that.minutelyStats[args.dataIndex].minute + "<br/>缓存流量: " + teaweb.formatBytes(that.minutelyStats[args.dataIndex].cachedBytes) + "<br/>命中率:" + ratio + "%"
|
||||
}
|
||||
return ""
|
||||
})
|
||||
@@ -36,6 +36,15 @@ Tea.context(function () {
|
||||
return
|
||||
}
|
||||
|
||||
// 每N分钟取一次
|
||||
let newStats = []
|
||||
for (let i = 0; i < stats.length; i++) {
|
||||
if (i % 5 == 0) {
|
||||
newStats.push(stats[i])
|
||||
}
|
||||
}
|
||||
stats = newStats
|
||||
|
||||
let axis = teaweb.countAxis(stats, function (v) {
|
||||
return Math.max(v.countRequests, v.countCachedRequests)
|
||||
})
|
||||
@@ -72,9 +81,7 @@ Tea.context(function () {
|
||||
data: stats.map(function (v) {
|
||||
return v.countRequests / axis.divider
|
||||
}),
|
||||
itemStyle: {
|
||||
color: "#9DD3E8"
|
||||
},
|
||||
|
||||
areaStyle: {
|
||||
color: "#9DD3E8"
|
||||
},
|
||||
@@ -110,6 +117,15 @@ Tea.context(function () {
|
||||
return
|
||||
}
|
||||
|
||||
// 每N分钟取一次
|
||||
let newStats = []
|
||||
for (let i = 0; i < stats.length; i++) {
|
||||
if (i % 5 == 0) {
|
||||
newStats.push(stats[i])
|
||||
}
|
||||
}
|
||||
stats = newStats
|
||||
|
||||
let axis = teaweb.bytesAxis(stats, function (v) {
|
||||
return Math.max(v.bytes, v.cachedBytes)
|
||||
})
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
.chart-box {
|
||||
height: 21em;
|
||||
height: 14em;
|
||||
}
|
||||
|
||||
h4 span.small {
|
||||
|
||||
Reference in New Issue
Block a user