userMonitor.blade.php 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. @extends('admin.layouts')
  2. @section('css')
  3. @endsection
  4. @section('title', '控制面板')
  5. @section('content')
  6. <!-- BEGIN CONTENT BODY -->
  7. <div class="page-content" style="padding-top:0;">
  8. <!-- BEGIN PAGE BASE CONTENT -->
  9. <div class="row">
  10. <div class="col-md-12">
  11. <div class="note note-info">
  12. <h3 class="block">{{$username}}</h3>
  13. <p> 提示:月流量统计不会统计当天,日流量统计不会统计当前小时;如果无统计数据,请检查定时任务是否正常。(每月1日和每日0时因为没有统计流量,不显示流量) </p>
  14. </div>
  15. </div>
  16. </div>
  17. <div class="row">
  18. <div class="col-md-12">
  19. <div class="portlet light bordered">
  20. <div class="portlet-body">
  21. <div id="chart1" style="width: auto;height:450px;"></div>
  22. </div>
  23. </div>
  24. </div>
  25. </div>
  26. <div class="row">
  27. <div class="col-md-12">
  28. <div class="portlet light bordered">
  29. <div class="portlet-body">
  30. <div id="chart2" style="width: auto;height:450px;"></div>
  31. </div>
  32. </div>
  33. </div>
  34. </div>
  35. <!-- END PAGE BASE CONTENT -->
  36. </div>
  37. <!-- END CONTENT BODY -->
  38. @endsection
  39. @section('script')
  40. <script src="/assets/global/plugins/echarts/echarts.min.js" type="text/javascript"></script>
  41. <script type="text/javascript">
  42. var myChart = echarts.init(document.getElementById('chart1'));
  43. option = {
  44. title: {
  45. text: '今日流量',
  46. subtext: '单位G'
  47. },
  48. tooltip: {
  49. trigger: 'axis'
  50. },
  51. toolbox: {
  52. show: true,
  53. feature: {
  54. saveAsImage: {}
  55. }
  56. },
  57. xAxis: {
  58. type: 'category',
  59. boundaryGap: false,
  60. data: ['0','1','2','3','4','5','6','7','8','9','10','11','12','13','14','15','16','17','18','19','20','21','22','23']
  61. },
  62. yAxis: {
  63. type: 'value',
  64. axisLabel: {
  65. formatter: '{value} G'
  66. }
  67. },
  68. series: [
  69. @if(!empty($trafficHourly))
  70. @foreach($trafficHourly as $traffic)
  71. {
  72. name:'{{$traffic['nodeName']}}',
  73. type:'line',
  74. data:[{!! $traffic['hourlyData'] !!}],
  75. markPoint: {
  76. data: [
  77. {type: 'max', name: '最大值'}
  78. ]
  79. }
  80. },
  81. @endforeach
  82. @endif
  83. ]
  84. };
  85. myChart.setOption(option);
  86. </script>
  87. <script type="text/javascript">
  88. var myChart = echarts.init(document.getElementById('chart2'));
  89. option = {
  90. title: {
  91. text: '本月流量',
  92. subtext: '单位G'
  93. },
  94. tooltip: {
  95. trigger: 'axis'
  96. },
  97. toolbox: {
  98. show: true,
  99. feature: {
  100. saveAsImage: {}
  101. }
  102. },
  103. xAxis: {
  104. type: 'category',
  105. boundaryGap: false,
  106. data: ['1','2','3','4','5','6','7','8','9','10','11','12','13','14','15','16','17','18','19','20','21','22','23','24','25','26','27','28','29','30','31']
  107. },
  108. yAxis: {
  109. type: 'value',
  110. axisLabel: {
  111. formatter: '{value} G'
  112. }
  113. },
  114. series: [
  115. @if(!empty($trafficDaily))
  116. @foreach($trafficDaily as $traffic)
  117. {
  118. name:'{{$traffic['nodeName']}}',
  119. type:'line',
  120. data:[{!! $traffic['dailyData'] !!}],
  121. markPoint: {
  122. data: [
  123. {type: 'max', name: '最大值'}
  124. ]
  125. }
  126. },
  127. @endforeach
  128. @endif
  129. ]
  130. };
  131. myChart.setOption(option);
  132. </script>
  133. @endsection