App.vue 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. <template>
  2. <div id="app">
  3. <header class="grid-content header-color">
  4. <el-row>
  5. <a class="brand" href="#">frp</a>
  6. </el-row>
  7. </header>
  8. <section>
  9. <el-row>
  10. <el-col id="side-nav" :xs="24" :md="4">
  11. <el-menu default-active="1" mode="vertical" theme="light" router @select="handleSelect">
  12. <el-menu-item index="/">Overview</el-menu-item>
  13. <el-submenu index="/proxies">
  14. <template slot="title">Proxies</template>
  15. <el-menu-item index="/proxies/tcp">TCP</el-menu-item>
  16. <el-menu-item index="/proxies/udp">UDP</el-menu-item>
  17. <el-menu-item index="/proxies/http">HTTP</el-menu-item>
  18. <el-menu-item index="/proxies/https">HTTPS</el-menu-item>
  19. <el-menu-item index="/proxies/stcp">STCP</el-menu-item>
  20. </el-submenu>
  21. <el-menu-item index="">Help</el-menu-item>
  22. </el-menu>
  23. </el-col>
  24. <el-col :xs="24" :md="20">
  25. <div id="content">
  26. <router-view v-if="serverInfo" />
  27. </div>
  28. </el-col>
  29. </el-row>
  30. </section>
  31. </div>
  32. </template>
  33. <script>
  34. export default {
  35. computed: {
  36. serverInfo() {
  37. return this.$store.state.serverInfo
  38. }
  39. },
  40. async created() {
  41. this.$store.dispatch('fetchServerInfo')
  42. },
  43. methods: {
  44. handleSelect(key, path) {
  45. if (key === '') {
  46. window.open('https://github.com/fatedier/frp')
  47. }
  48. }
  49. }
  50. }
  51. </script>
  52. <style>
  53. body {
  54. background-color: #fafafa;
  55. margin: 0px;
  56. font-family: -apple-system, BlinkMacSystemFont, Helvetica Neue, sans-serif;
  57. }
  58. header {
  59. width: 100%;
  60. height: 60px;
  61. }
  62. .header-color {
  63. background: #58b7ff;
  64. }
  65. #content {
  66. margin-top: 20px;
  67. padding-right: 40px;
  68. }
  69. .brand {
  70. color: #fff;
  71. background-color: transparent;
  72. margin-left: 20px;
  73. float: left;
  74. line-height: 25px;
  75. font-size: 25px;
  76. padding: 15px 15px;
  77. height: 30px;
  78. text-decoration: none;
  79. }
  80. </style>