search.tpl 3.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. {include file='admin/main.tpl'}
  2. <main class="content">
  3. <div class="content-header ui-content-header">
  4. <div class="container">
  5. <h1 class="content-heading">中转链路搜索</h1>
  6. </div>
  7. </div>
  8. <div class="container">
  9. <div class="col-lg-12 col-md-12">
  10. <section class="content-inner margin-top-no">
  11. <div class="card">
  12. <div class="card-main">
  13. <div class="card-inner">
  14. <p>系统中这位用户的链路。</p>
  15. </div>
  16. </div>
  17. </div>
  18. <div class="card">
  19. <div class="card-main">
  20. <div class="card-inner">
  21. <div class="form-group form-group-label">
  22. <label class="floating-label" for="search"> 输入用户 ID 进行搜索链路搜索 </label>
  23. <input class="form-control maxwidth-edit" id="search" type="text">
  24. </div>
  25. </div>
  26. <div class="card-action">
  27. <div class="card-action-btn pull-left">
  28. <a class="btn btn-flat waves-attach waves-light" id="search_button"><span class="icon">search</span>&nbsp;搜索</a>
  29. </div>
  30. </div>
  31. </div>
  32. </div>
  33. <div class="table-responsive">
  34. <table class="mdl-data-table" id="table_1" cellspacing="0" width="100%">
  35. <thead>
  36. <tr>
  37. <th>端口</th>
  38. <th>始发节点</th>
  39. <th>终点节点</th>
  40. <th>途径节点</th>
  41. <th>状态</th>
  42. </tr>
  43. </thead>
  44. <tfoot>
  45. <tr>
  46. <th>端口</th>
  47. <th>始发节点</th>
  48. <th>终点节点</th>
  49. <th>途径节点</th>
  50. <th>状态</th>
  51. </tr>
  52. </tfoot>
  53. <tbody>
  54. {foreach $pathset as $path}
  55. <tr>
  56. <td>{$path->port}</td>
  57. <td>{$path->begin_node->name}</td>
  58. <td>{$path->end_node->name}</td>
  59. <td>{$path->path}</td>
  60. <td>{$path->status}</td>
  61. </tr>
  62. {/foreach}
  63. </tbody>
  64. </table>
  65. </div>
  66. </section>
  67. </div>
  68. </div>
  69. </main>
  70. {include file='admin/footer.tpl'}
  71. <script>
  72. window.addEventListener('load', () => {
  73. table = $('#table_1').DataTable({
  74. "columnDefs": [{
  75. targets: ['_all'],
  76. className: 'mdl-data-table__cell--non-numeric'
  77. }],
  78. {include file='table/lang_chinese.tpl'}
  79. });
  80. let search = () => {
  81. window.location = `/admin/relay/path_search/${ldelim}$$.getElementById('search').value{rdelim}`
  82. };
  83. $$.getElementById('search_button').addEventListener('click', () => {
  84. if ($$.getElementById('search').value !== "") {
  85. search();
  86. }
  87. })
  88. })
  89. </script>