host.html 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. <!DOCTYPE html>
  2. <html xmlns:th="http://www.thymeleaf.org"
  3. xmlns:mo="https://gitee.com/aun/Timo">
  4. <head th:replace="/common/template :: header(~{::title},~{::link},~{::style})"></head>
  5. <body class="timo-layout-page">
  6. <div class="layui-card">
  7. <div class="layui-card-header timo-card-header">
  8. <span><i class="fa fa-bars"></i> 机器列表</span>
  9. <i class="layui-icon layui-icon-refresh refresh-btn"></i>
  10. </div>
  11. <div class="layui-card-body">
  12. <div class="layui-row timo-card-screen put-row">
  13. <div class="layui-row timo-card-screen put-row">
  14. <div class="pull-left layui-form-pane">
  15. <div class="layui-inline">
  16. <label class="layui-form-label">环境</label>
  17. <div class="layui-input-block timo-search-status">
  18. <select id="getPageByEnv" class="timo-search-select" name="env" onchange="getPageByEnv()"
  19. mo:dict="ENVIRONMENT" mo-selected="${env}"></select>
  20. </div>
  21. </div>
  22. <div class="layui-inline timo-search-box">
  23. <label class="layui-form-label">机器地址</label>
  24. <div class="layui-input-block">
  25. <input type="text" name="machineIpv4" th:value="${param.machineIpv4}" placeholder="请输入机器地址"
  26. autocomplete="off" class="layui-input">
  27. </div>
  28. </div>
  29. <div class="layui-inline">
  30. <button class="layui-btn timo-search-btn">
  31. <i class="fa fa-search"></i>
  32. </button>
  33. </div>
  34. </div>
  35. </div>
  36. </div>
  37. <div class="timo-table-wrap">
  38. <table class="layui-table timo-table">
  39. <thead>
  40. <tr>
  41. <!-- TODO 使用 checkbox 批量设置环境 -->
  42. <th class="timo-table-checkbox">
  43. <label class="timo-checkbox"><input type="checkbox">
  44. <i class="layui-icon layui-icon-ok"></i></label>
  45. </th>
  46. <th data-field="machineIpv4">机器地址</th>
  47. <th data-field="bootTime">启动时间</th>
  48. <th data-field="status">当前状态</th>
  49. <th data-field="lastCheck">上次心跳时间</th>
  50. <th data-field="osArch">系统架构</th>
  51. <th data-field="osName">系统名字</th>
  52. <th data-field="osVersion">系统版本</th>
  53. <th>通知组</th>
  54. <th>SSH 认证</th>
  55. <th>SSH 控制台</th>
  56. <th>操作</th>
  57. </tr>
  58. </thead>
  59. <tbody>
  60. <tr th:each="item:${list}">
  61. <td><label class="timo-checkbox"><input type="checkbox" th:value="${item.machineId}">
  62. <i class="layui-icon layui-icon-ok"></i></label></td>
  63. <td th:text="${item.machineIpv4}">机器地址</td>
  64. <td th:text="${item.bootTime}">启动时间</td>
  65. <td th:text="${item.status}">当前状态</td>
  66. <td th:text="${item.lastCheck}">上次心跳时间</td>
  67. <td th:text="${item.osArch}">系统架构</td>
  68. <td th:text="${item.osName}">系统名字</td>
  69. <td th:text="${item.osVersion}">系统版本</td>
  70. <td>
  71. <a class="open-popup" data-title="设置通知组"
  72. th:attr="data-url=@{'/machine/notify/'+${item.machineId}}" href="#">设置</a>
  73. </td>
  74. <td>
  75. <a class="open-popup" data-title="设置 SSH 帐号"
  76. th:attr="data-url=@{'/machine/sshauth/'+${item.machineId}}" href="#">设置</a>
  77. </td>
  78. <td>
  79. <a class="open-popup" data-title="WebTerminal"
  80. th:attr="data-url=@{'/machine/webssh/'+${item.machineId}}"
  81. href="#">SSH</a>
  82. </td>
  83. <td>
  84. <a class="open-popup" data-title="机器详细信息" th:attr="data-url=@{'/machine/host/detail/'+${item.machineId}}"
  85. data-size="960,480" href="#">详细</a>
  86. <a class="open-popup" data-title="编辑" th:attr="data-url=@{'/machine/host/edit/'+${item.machineId}}"
  87. href="#">编辑</a>
  88. <a class="ajax-delete" th:attr="data-msg='确定要删除 '+ ${item.machineId} + ' 机器?'"
  89. th:href="@{'/api/machine/host/' + ${item.machineId}}">删除</a>
  90. </td>
  91. </tr>
  92. </tbody>
  93. </table>
  94. </div>
  95. <div th:replace="/common/fragment :: page"></div>
  96. </div>
  97. </div>
  98. <script th:replace="/common/template :: script"></script>
  99. <script type="text/javascript" th:src="@{/js/plugins/jquery-2.2.4.min.js}"></script>
  100. <script type="text/javascript">
  101. function getPageByEnv() {
  102. var selectedOption = $("#getPageByEnv option:selected")
  103. var param = selectedOption.text()
  104. url = '?env=' + param
  105. window.location.href = window.location.pathname + url;
  106. }
  107. </script>
  108. </body>
  109. </html>