App.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. <template>
  2. <div id="app">
  3. <header class="grid-content header-color">
  4. <div class="header-content">
  5. <div class="brand">
  6. <a href="#">frp</a>
  7. </div>
  8. <div class="dark-switch">
  9. <el-switch
  10. v-model="darkmodeSwitch"
  11. inline-prompt
  12. active-text="Dark"
  13. inactive-text="Light"
  14. @change="toggleDark"
  15. style="
  16. --el-switch-on-color: #444452;
  17. --el-switch-off-color: #589ef8;
  18. "
  19. />
  20. </div>
  21. </div>
  22. </header>
  23. <section>
  24. <el-row>
  25. <el-col id="side-nav" :xs="24" :md="4">
  26. <el-menu
  27. default-active="/"
  28. mode="vertical"
  29. theme="light"
  30. router="false"
  31. @select="handleSelect"
  32. >
  33. <el-menu-item index="/">Overview</el-menu-item>
  34. <el-sub-menu index="/proxies">
  35. <template #title>
  36. <span>Proxies</span>
  37. </template>
  38. <el-menu-item index="/proxies/tcp">TCP</el-menu-item>
  39. <el-menu-item index="/proxies/udp">UDP</el-menu-item>
  40. <el-menu-item index="/proxies/http">HTTP</el-menu-item>
  41. <el-menu-item index="/proxies/https">HTTPS</el-menu-item>
  42. <el-menu-item index="/proxies/stcp">STCP</el-menu-item>
  43. <el-menu-item index="/proxies/sudp">SUDP</el-menu-item>
  44. </el-sub-menu>
  45. <el-menu-item index="">Help</el-menu-item>
  46. </el-menu>
  47. </el-col>
  48. <el-col :xs="24" :md="20">
  49. <div id="content">
  50. <router-view></router-view>
  51. </div>
  52. </el-col>
  53. </el-row>
  54. </section>
  55. <footer></footer>
  56. </div>
  57. </template>
  58. <script setup lang="ts">
  59. import { ref } from 'vue'
  60. import { useDark, useToggle } from '@vueuse/core'
  61. const isDark = useDark()
  62. const darkmodeSwitch = ref(isDark)
  63. const toggleDark = useToggle(isDark)
  64. const handleSelect = (key: string) => {
  65. if (key == '') {
  66. window.open('https://github.com/fatedier/frp')
  67. }
  68. }
  69. </script>
  70. <style>
  71. body {
  72. margin: 0px;
  73. font-family: -apple-system, BlinkMacSystemFont, Helvetica Neue, sans-serif;
  74. }
  75. header {
  76. width: 100%;
  77. height: 60px;
  78. }
  79. .header-color {
  80. background: #58b7ff;
  81. }
  82. html.dark .header-color {
  83. background: #395c74;
  84. }
  85. .header-content {
  86. display: flex;
  87. align-items: center;
  88. }
  89. #content {
  90. margin-top: 20px;
  91. padding-right: 40px;
  92. }
  93. .brand {
  94. display: flex;
  95. justify-content: flex-start;
  96. }
  97. .brand a {
  98. color: #fff;
  99. background-color: transparent;
  100. margin-left: 20px;
  101. line-height: 25px;
  102. font-size: 25px;
  103. padding: 15px 15px;
  104. height: 30px;
  105. text-decoration: none;
  106. }
  107. .dark-switch {
  108. display: flex;
  109. justify-content: flex-end;
  110. flex-grow: 1;
  111. padding-right: 40px;
  112. }
  113. </style>