list_services.html 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. <table class="sub-menu" style="background: white;">
  2. <tr>
  3. <td style="padding: 12px 0 8px 6px">
  4. <div style="text-align: right; float: right;">
  5. <form action="/search/" method="get" >
  6. <input type="text" name="q" style="margin: 2px 2px 0px 0px; width: 250px; padding: 3px;" size="30">
  7. <input type="submit" value="Search" class="button" style="font-size: 12px; height: 24px;">
  8. </form>
  9. </div>
  10. <div style="float:left; padding-left: 0px;">
  11. <form action="/bulk/service/" method="post" id="objects">
  12. <a style="padding: 0 4px 0 12px" class="select-controls" href='javascript:checkedAll("objects");'> toggle all </a>
  13. <select style="margin:0 2px 0 0px;" name="action">
  14. <option>apply to selected</option>
  15. <option>stop</option>
  16. <option>start</option>
  17. <option>restart</option>
  18. </select>
  19. <input type="submit" name="ok" value="›" class="button" style="width: 37px; font-size: 12px; height: 24px;">
  20. </div>
  21. <?php
  22. if (!empty($_SESSION['error_srv'])) {
  23. ?>
  24. <div>
  25. <script type="text/javascript">
  26. $(function() {
  27. $( "#dialog:ui-dialog" ).dialog( "destroy" );
  28. $( "#dialog-message" ).dialog({
  29. modal: true,
  30. buttons: {
  31. Ok: function() {
  32. $( this ).dialog( "close" );
  33. }
  34. }
  35. });
  36. });
  37. </script>
  38. <div id="dialog-message" title="Error">
  39. <p><?php echo $_SESSION['error_srv'] ?></p>
  40. </div>
  41. </div>
  42. <?php
  43. unset($_SESSION['error_srv']);
  44. }
  45. ?>
  46. </td>
  47. </tr>
  48. </table>
  49. </td>
  50. </tr>
  51. </table>
  52. <div id="vstobjects">
  53. <table class='data'>
  54. <?php
  55. foreach ($data as $key => $value) {
  56. ++$i;
  57. if ($data[$key]['STATE'] == 'running') {
  58. $status = 'active';
  59. $action = 'stop';
  60. } else {
  61. $status = 'suspended';
  62. $action = 'start';
  63. }
  64. $cpu = $data[$key]['CPU'] / 10;
  65. $cpu = number_format($cpu, 1);
  66. if ($cpu == '0.0') $cpu = 0;
  67. ?>
  68. <tr class="data-row">
  69. <td class="data-dotted" style="padding: 0px 10px 0px 0px" width="150">
  70. <table class="data-col1">
  71. <tr><td style="padding: 18 0 4 18;"><input type="checkbox" name="service[]" value="<?php echo $key ?>" ></td></tr>
  72. <tr><td class="data-<?php echo $status ?>"><b><?php echo $data[$key]['STATE'] ?></b></td></tr>
  73. </table>
  74. </td>
  75. <td class="data-dotted" width="830px" style="vertical-align:top;">
  76. <table width="830px">
  77. <tr>
  78. <td></td>
  79. <td class="data-controls" width="68px"><a href="/restart/service/?srv=<?php echo $key ?>"><img src="/images/reload.png" width="6px" height="7px"> restart</a></td>
  80. <td class="data-controls" width="48px"><a href="/<?php echo $action ?>/service/?srv=<?php echo $key ?>"><img src="/images/<?php echo $action ?>.png" width="7px" height="7px"> <?php echo $action ?></a></td>
  81. </tr>
  82. </table>
  83. <table class="data-col2" width="830px">
  84. <tr>
  85. <td colspan=4 class="domain" style="padding: 0 0 0 4px;">
  86. <b><?php echo $key ?></b>
  87. </td>
  88. </tr>
  89. <tr>
  90. <td style="vertical-align:top;" width="200px">
  91. <table>
  92. <tr>
  93. <td class="counter-name" style="padding: 2px 0 0 0">
  94. <?php echo $data[$key]['SYSTEM'] ?>
  95. </td>
  96. </tr>
  97. </table>
  98. </td>
  99. <td style="vertical-align:top;" width="150px">
  100. <table>
  101. <tr>
  102. <td class="counter-name">
  103. CPU:
  104. </td>
  105. <td>
  106. <a class="counter-value"> <?php echo $cpu ?>%</a>
  107. </td>
  108. </tr>
  109. </table>
  110. </td>
  111. <td style="vertical-align:top;" width="180px">
  112. <table>
  113. <tr>
  114. <td class="counter-name">
  115. Memory:
  116. </td>
  117. <td>
  118. <a class="counter-value"><?php echo $data[$key]['MEM'] ?> mb</a>
  119. </td>
  120. </tr>
  121. </table>
  122. </td>
  123. <td style="vertical-align:top;" >
  124. <table>
  125. <tr>
  126. <td class="counter-name">
  127. Run Time:
  128. </td>
  129. <td>
  130. <a class="counter-value"><?php echo humanize_time($data[$key]['RTIME']) ?> </a>
  131. </td>
  132. </tr>
  133. </table>
  134. </td>
  135. </tr>
  136. </table>
  137. </td>
  138. </tr>
  139. <?php
  140. }
  141. ?>
  142. </table>
  143. </form>
  144. </div>