common_sider.html 2.3 KB

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