common_sider.html 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. {{define "menuItems"}}
  2. <a-menu-item key="{{ .base_path }}xui/">
  3. <a-icon type="dashboard"></a-icon>
  4. <span>系统状态</span>
  5. </a-menu-item>
  6. <a-menu-item key="{{ .base_path }}xui/inbounds">
  7. <a-icon type="user"></a-icon>
  8. <span>入站列表</span>
  9. </a-menu-item>
  10. <a-menu-item key="{{ .base_path }}xui/setting">
  11. <a-icon type="setting"></a-icon>
  12. <span>面板设置</span>
  13. </a-menu-item>
  14. <!--<a-menu-item key="{{ .base_path }}xui/clients">-->
  15. <!-- <a-icon type="laptop"></a-icon>-->
  16. <!-- <span>客户端</span>-->
  17. <!--</a-menu-item>-->
  18. <a-sub-menu>
  19. <template slot="title">
  20. <a-icon type="link"></a-icon>
  21. <span>其他</span>
  22. </template>
  23. <a-menu-item key="https://github.com/vaxilu/x-ui/">
  24. <a-icon type="github"></a-icon>
  25. <span>Github</span>
  26. </a-menu-item>
  27. </a-sub-menu>
  28. <a-menu-item key="{{ .base_path }}logout">
  29. <a-icon type="logout"></a-icon>
  30. <span>退出登录</span>
  31. </a-menu-item>
  32. {{end}}
  33. {{define "commonSider"}}
  34. <a-layout-sider id="sider" collapsible breakpoint="md" collapsed-width="0">
  35. <a-menu theme="dark" mode="inline" :selected-keys="['{{ .request_uri }}']"
  36. @click="({key}) => key.startsWith('http') ? window.open(key) : location.href = key">
  37. {{template "menuItems" .}}
  38. </a-menu>
  39. </a-layout-sider>
  40. <a-drawer id="sider-drawer" placement="left" :closable="false"
  41. @close="siderDrawer.close()"
  42. :visible="siderDrawer.visible" :wrap-style="{ padding: 0 }">
  43. <div class="drawer-handle" @click="siderDrawer.change()" slot="handle">
  44. <a-icon :type="siderDrawer.visible ? 'close' : 'menu-fold'"></a-icon>
  45. </div>
  46. <a-menu theme="light" mode="inline" :selected-keys="['{{ .request_uri }}']"
  47. @click="({key}) => key.startsWith('http') ? window.open(key) : location.href = key">
  48. {{template "menuItems" .}}
  49. </a-menu>
  50. </a-drawer>
  51. <script>
  52. const siderDrawer = {
  53. visible: false,
  54. show() {
  55. this.visible = true;
  56. },
  57. close() {
  58. this.visible = false;
  59. },
  60. change() {
  61. this.visible = !this.visible;
  62. }
  63. };
  64. </script>
  65. {{end}}