host.html 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  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 class="sortable" data-field="machineIpv4">机器地址</th>
  47. <th class="sortable" data-field="bootTime">启动时间</th>
  48. <th class="sortable" data-field="status">当前状态</th>
  49. <th class="sortable" data-field="lastCheck">上次心跳时间</th>
  50. <th class="sortable" data-field="osArch">系统架构</th>
  51. <th class="sortable" data-field="osName">系统名字</th>
  52. <th class="sortable" 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}}" data-size="800,600"
  73. href="#">设置</a>
  74. </td>
  75. <td>
  76. <a class="open-popup" data-title="设置 SSH 帐号"
  77. th:attr="data-url=@{'/machine/sshauth/'+${item.machineId}}" data-size="800,600"
  78. href="#">设置</a>
  79. </td>
  80. <td>
  81. <a class="open-popup" data-title="WebTerminal"
  82. th:attr="data-url=@{'/machine/webssh/'+${item.machineId}}" data-size="1200,600"
  83. href="#">SSH</a>
  84. </td>
  85. <td>
  86. <a class="open-popup" data-title="机器详细信息" th:attr="data-url=@{'/machine/host/detail/'+${item.machineId}}"
  87. data-size="1200,600" href="#">详细</a>
  88. <a class="open-popup" data-title="编辑" th:attr="data-url=@{'/machine/host/edit/'+${item.machineId}}"
  89. data-size="800,600" href="#">编辑</a>
  90. <a class="ajax-delete" th:attr="data-msg='确定要删除 '+ ${item.machineId} + ' 机器?'"
  91. th:href="@{'/api/machine/host/' + ${item.machineId}}">删除</a>
  92. </td>
  93. </tr>
  94. </tbody>
  95. </table>
  96. </div>
  97. <div th:replace="/common/fragment :: page"></div>
  98. </div>
  99. </div>
  100. <script th:replace="/common/template :: script"></script>
  101. <script type="text/javascript" th:src="@{/js/plugins/jquery-2.2.4.min.js}"></script>
  102. <script type="text/javascript">
  103. function getPageByEnv() {
  104. var selectedOption = $("#getPageByEnv option:selected")
  105. var param = selectedOption.text()
  106. url = '?env=' + param
  107. window.location.href = window.location.pathname + url;
  108. }
  109. </script>
  110. </body>
  111. </html>