nodeMonitor.blade.php 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. @extends('admin.layouts')
  2. @section('css')
  3. @endsection
  4. @section('title', '控制面板')
  5. @section('content')
  6. <!-- BEGIN CONTENT BODY -->
  7. <div class="page-content">
  8. <!-- BEGIN PAGE BREADCRUMB -->
  9. <ul class="page-breadcrumb breadcrumb">
  10. <li>
  11. <a href="{{url('admin/nodeList')}}">节点管理</a>
  12. <i class="fa fa-circle"></i>
  13. </li>
  14. <li>
  15. <a href="{{url('admin/nodeList')}}">节点列表</a>
  16. <i class="fa fa-circle"></i>
  17. </li>
  18. <li>
  19. <a href="{{url('admin/nodeMonitor')}}">节点流量监控</a>
  20. </li>
  21. </ul>
  22. <!-- END PAGE BREADCRUMB -->
  23. <!-- BEGIN PAGE BASE CONTENT -->
  24. <div class="row">
  25. <div class="col-md-12">
  26. <div class="portlet light bordered">
  27. <div class="portlet-body">
  28. <div id="chart1" style="width: auto;height:450px;"></div>
  29. </div>
  30. </div>
  31. </div>
  32. </div>
  33. <div class="row">
  34. <div class="col-md-12">
  35. <div class="portlet light bordered">
  36. <div class="portlet-body">
  37. <div id="chart2" style="width: auto;height:450px;"></div>
  38. </div>
  39. </div>
  40. </div>
  41. </div>
  42. <!-- END PAGE BASE CONTENT -->
  43. </div>
  44. <!-- END CONTENT BODY -->
  45. @endsection
  46. @section('script')
  47. <script src="/assets/global/plugins/echarts/echarts.min.js" type="text/javascript"></script>
  48. <script type="text/javascript">
  49. var myChart = echarts.init(document.getElementById('chart1'));
  50. option = {
  51. title: {
  52. text: '24小时内流量',
  53. subtext: '单位M'
  54. },
  55. tooltip: {
  56. trigger: 'axis'
  57. },
  58. toolbox: {
  59. show: true,
  60. feature: {
  61. saveAsImage: {}
  62. }
  63. },
  64. xAxis: {
  65. type: 'category',
  66. boundaryGap: false,
  67. 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']
  68. },
  69. yAxis: {
  70. type: 'value',
  71. axisLabel: {
  72. formatter: '{value} M'
  73. }
  74. },
  75. series: [
  76. @if(!empty($trafficHourly))
  77. @foreach($trafficHourly as $traffic)
  78. {
  79. name:'{{$traffic['nodeName']}}',
  80. type:'line',
  81. data:[{!! $traffic['hourlyData'] !!}],
  82. markPoint: {
  83. data: [
  84. {type: 'max', name: '最大值'}
  85. ]
  86. }
  87. },
  88. @endforeach
  89. @endif
  90. ]
  91. };
  92. myChart.setOption(option);
  93. </script>
  94. <script type="text/javascript">
  95. var myChart = echarts.init(document.getElementById('chart2'));
  96. option = {
  97. title: {
  98. text: '30日内流量',
  99. subtext: '单位M'
  100. },
  101. tooltip: {
  102. trigger: 'axis'
  103. },
  104. toolbox: {
  105. show: true,
  106. feature: {
  107. saveAsImage: {}
  108. }
  109. },
  110. xAxis: {
  111. type: 'category',
  112. boundaryGap: false,
  113. 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']
  114. },
  115. yAxis: {
  116. type: 'value',
  117. axisLabel: {
  118. formatter: '{value} M'
  119. }
  120. },
  121. series: [
  122. @if(!empty($trafficDaily))
  123. @foreach($trafficDaily as $traffic)
  124. {
  125. name:'{{$traffic['nodeName']}}',
  126. type:'line',
  127. data:[{!! $traffic['dailyData'] !!}],
  128. markPoint: {
  129. data: [
  130. {type: 'max', name: '最大值'}
  131. ]
  132. }
  133. },
  134. @endforeach
  135. @endif
  136. ]
  137. };
  138. myChart.setOption(option);
  139. </script>
  140. @endsection