client.tpl 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8" />
  5. <title>欢迎页面-X-admin2.0</title>
  6. <link rel="stylesheet" href="./static/css/font.css">
  7. <link rel="stylesheet" href="./static/css/xadmin.css">
  8. <script type="text/javascript" src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
  9. <script src="./static/lib/layui/layui.js" charset="utf-8"></script>
  10. <script type="text/javascript" src="./static/js/xadmin.js"></script>
  11. </head>
  12. <body>
  13. <input type="text" id="token" value={{.token}} hidden=true>
  14. 场景:
  15. <input id="scene" type="text" value={{.Scene}}>
  16. <br>
  17. 事件ID:
  18. <input id="eventid" type="text" value={{.EventId}}>
  19. <br>
  20. 开始时间:
  21. <input type="date" id="start_time" name="trip-start" value={{.Start_time}} min="2018-01-01 00:00:00" max="2018-12-31 00:00:00" />
  22. <br>
  23. 结束时间:
  24. <input type="date" id="end_time" name="trip-start" value={{.End_time}} min="2018-01-01 23:59:59" max="2018-12-31 23:59:59" />
  25. <br>
  26. <br>
  27. <input class="layui-btn" type="button" onclick="submitUpdate()" value=查询>
  28. <br><br>
  29. <table border="1">
  30. <thead>
  31. <th style="width:200px;">时间</th>
  32. <th style="width:128px;">服务器ID</th>
  33. <th style="width:128px;">场景</th>
  34. <th style="width:128px;">事件ID</th>
  35. <th style="width:400px;">内容</th>
  36. </thead>
  37. <tbody>
  38. {{range .Events}}
  39. <tr>
  40. <td style = "text-align:center;">{{TimeToStr .EventTime}}</td>
  41. <td style = "text-align:center;">{{.ServerId}}</td>
  42. <td style = "text-align:center;">{{.Scene}}</td>
  43. <td style = "text-align:center;">{{.EventId}}</td>
  44. <td style = "text-align:center;">{{.Label}}</td>
  45. </tr>
  46. {{end}}
  47. </tbody>
  48. </table>
  49. <script language="JavaScript">
  50. function submitUpdate () {
  51. var scene = document.getElementById("scene").value;
  52. var eventid = document.getElementById("eventid").value;
  53. var start_time = document.getElementById("start_time").value;
  54. var end_time = document.getElementById("end_time").value;
  55. var text = "token=" + encodeURI(token);
  56. text += "&scene=" + encodeURI(scene);
  57. text += "&eventid=" + encodeURI(eventid);
  58. text += "&start_time=" + encodeURI(start_time);
  59. text += "&end_time=" + encodeURI(end_time);
  60. $.ajax({
  61. type:"get",
  62. url:"/client?" + text,
  63. success:function (data) {
  64. // alert(data.status);
  65. if (data.status){
  66. window.location.href="/client?"+text;
  67. }else{
  68. if (data.info){
  69. alert(data.info);
  70. }else{
  71. window.location.href="/client?"+text;
  72. }
  73. }
  74. }
  75. });
  76. }
  77. </script>
  78. </body>
  79. </html>