index.html 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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="level" onchange="getPageByEnv()"
  19. mo:dict="LOGLEVEL" mo-selected="${level}"></select>
  20. </div>
  21. </div>
  22. </div>
  23. </div>
  24. </div>
  25. <div class="timo-table-wrap">
  26. <table class="layui-table timo-table">
  27. <thead>
  28. <tr>
  29. <th class="sortable" data-field="app">app</th>
  30. <th class="sortable" data-field="host">host</th>
  31. <th class="sortable" data-field="timestamp">timestamp</th>
  32. <th class="sortable" data-field="level">level</th>
  33. <th class="sortable" data-field="thread">thread</th>
  34. <th class="sortable" data-field="logger">logger</th>
  35. <th class="sortable" data-field="message">message</th>
  36. </tr>
  37. </thead>
  38. <tbody>
  39. <tr th:each="item:${list}">
  40. <td th:text="${item.app}">app</td>
  41. <td th:text="${item.host}">host</td>
  42. <td th:text="${item.timestamp}">timestamp</td>
  43. <td th:text="${item.level}">level</td>
  44. <td th:text="${item.thread}">thread</td>
  45. <td th:text="${item.logger}">logger</td>
  46. <td th:text="${item.message}">message</td>
  47. </tr>
  48. </tbody>
  49. </table>
  50. </div>
  51. </div>
  52. </div>
  53. <script th:replace="/common/template :: script"></script>
  54. <script type="text/javascript" th:src="@{/js/plugins/jquery-2.2.4.min.js}"></script>
  55. <script type="text/javascript" th:src="@{/js/websocket.js}"></script>
  56. <script type="text/javascript">
  57. function getPageByEnv() {
  58. var selectedOption = $("#getPageByEnv option:selected")
  59. var param = selectedOption.text()
  60. url = '?level=' + param
  61. window.location.href = window.location.pathname + url;
  62. }
  63. /*var client = new WebSocketClient();
  64. //执行连接操作
  65. client.connect({
  66. onError: function (error) {
  67. // 连接失败回调
  68. console.log('WebSocket 连接错误...')
  69. },
  70. onConnect: function () {
  71. // 连接成功回调
  72. console.log('WebSocket 连接成功...')
  73. },
  74. onClose: function () {
  75. // 连接关闭回调
  76. console.log('WebSocket 连接关闭...')
  77. },
  78. onData: function (data) {
  79. // 收到数据时回调
  80. console.log('接收到 WebSocket 的数据...')
  81. const jsonData = JSON.parse(data)
  82. console.log(jsonData)
  83. }
  84. });*/
  85. </script>
  86. </body>
  87. </html>