index.html 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. <div class="row">
  2. <div class="col-md-3">
  3. <div class="widget-small warning coloured-icon"><i class="icon fa fa-html5 fa-3x"></i>
  4. <div class="info">
  5. <h4>客户端连接端口</h4>
  6. <p><b>{{.p}}</b></p>
  7. </div>
  8. </div>
  9. </div>
  10. <div class="col-md-3">
  11. <div class="widget-small danger coloured-icon"><i class="icon fa fa-home fa-3x"></i>
  12. <div class="info">
  13. <h4>域名解析数</h4>
  14. <p><b>{{.data.hostCount}}</b></p>
  15. </div>
  16. </div>
  17. </div>
  18. <div class="col-md-3">
  19. <div class="widget-small primary coloured-icon"><i class="icon fa fa-users fa-3x"></i>
  20. <div class="info">
  21. <h4>总客户端数</h4>
  22. <p><b>{{.data.clientCount}}</b></p>
  23. </div>
  24. </div>
  25. </div>
  26. <div class="col-md-3">
  27. <div class="widget-small info coloured-icon"><i class="icon fa fa-user-secret fa-3x"></i>
  28. <div class="info">
  29. <h4>在线客户端数</h4>
  30. <p><b>{{.data.clientOnlineCount}}</b></p>
  31. </div>
  32. </div>
  33. </div>
  34. </div>
  35. <div class="row">
  36. <div class="col-md-6">
  37. <div class="tile">
  38. <h3 class="tile-title">流量</h3>
  39. <div id="flow" style="width: 600px;height:400px;"></div>
  40. </div>
  41. </div>
  42. <div class="col-md-6">
  43. <div class="tile">
  44. <h3 class="tile-title">代理类型</h3>
  45. <div id="tj" style="width: 600px;height:400px;"></div>
  46. </div>
  47. </div>
  48. </div>
  49. <script>
  50. option = {
  51. title : {
  52. x:'center'
  53. },
  54. tooltip: {
  55. trigger: 'item',
  56. formatter: function (p) {
  57. return p.seriesName + "<br>" + p.name + ":" + change(p.data.value);
  58. },
  59. },
  60. legend: {
  61. orient: 'vertical',
  62. left: 'left',
  63. data: ['入口流量', '出口流量']
  64. },
  65. series : [
  66. {
  67. name: '类型 统计',
  68. type: 'pie',
  69. radius : '55%',
  70. center: ['50%', '60%'],
  71. data:[
  72. {value:{{.data.inletFlowCount}}, name: '入口流量'},
  73. {value:{{.data.exportFlowCount}}, name: '出口流量'},
  74. ],
  75. itemStyle: {
  76. emphasis: {
  77. shadowBlur: 10,
  78. shadowOffsetX: 0,
  79. shadowColor: 'rgba(0, 0, 0, 0.5)'
  80. }
  81. }
  82. }
  83. ]
  84. };
  85. var myChart = echarts.init(document.getElementById('flow'));
  86. myChart.setOption(option);
  87. option = {
  88. title : {
  89. x:'center'
  90. },
  91. tooltip : {
  92. trigger: 'item',
  93. formatter: "{a} <br/>{b} : {c} ({d}%)"
  94. },
  95. legend: {
  96. orient: 'vertical',
  97. left: 'left',
  98. data: ['tcp隧道数','socks5隧道数','http代理隧道数','udp隧道数','域名解析数']
  99. },
  100. series : [
  101. {
  102. name: '类型 统计',
  103. type: 'pie',
  104. radius : '55%',
  105. center: ['50%', '60%'],
  106. data:[
  107. {value:{{.data.tunnelServerCount}}, name:'tcp隧道数'},
  108. {value:{{.data.socks5ServerCount}}, name:'socks5隧道数'},
  109. {value:{{.data.httpProxyServerCount}}, name:'http隧道数'},
  110. {value:{{.data.udpServerCount}}, name:'udp隧道数'},
  111. {value:{{.data.hostCount}}, name:'域名解析数'}
  112. ],
  113. itemStyle: {
  114. emphasis: {
  115. shadowBlur: 10,
  116. shadowOffsetX: 0,
  117. shadowColor: 'rgba(0, 0, 0, 0.5)'
  118. }
  119. }
  120. }
  121. ]
  122. };
  123. var myChart = echarts.init(document.getElementById('tj'));
  124. myChart.setOption(option);
  125. </script>