0
0
mirror of https://github.com/vx3r/wg-gen-web.git synced 2025-01-05 03:13:24 +00:00

split frontend into 2 pages, server and client

This commit is contained in:
vx3r 2020-02-20 12:07:13 +09:00
parent fe2ee45032
commit 755cc6adf6
6 changed files with 89 additions and 23 deletions

View File

@ -3,7 +3,21 @@


<v-app-bar app> <v-app-bar app>
<img class="mr-3" :src="require('./assets/logo.png')" height="50" alt="Wg Gen Web"/> <img class="mr-3" :src="require('./assets/logo.png')" height="50" alt="Wg Gen Web"/>
<v-toolbar-title>Wg Gen Web</v-toolbar-title> <v-toolbar-title to="/">Wg Gen Web</v-toolbar-title>

<v-spacer />

<v-toolbar-items>
<v-btn to="/clients">
Clients
<v-icon right dark>mdi-account-network-outline</v-icon>
</v-btn>
<v-btn to="/server">
Server
<v-icon right dark>mdi-vpn</v-icon>
</v-btn>
</v-toolbar-items>

</v-app-bar> </v-app-bar>


<v-content> <v-content>

View File

@ -1,12 +1,20 @@
<template> <template>
<v-container v-if="server"> <v-container v-if="server">
<v-row> <v-row>
<v-col cols="6"> <v-col cols="12">
<v-card dark> <v-card dark>
<v-list-item> <v-list-item>
<v-list-item-content> <v-list-item-content>
<v-list-item-title class="headline">Server's interface configuration</v-list-item-title> <v-list-item-title class="headline">Server's interface configuration</v-list-item-title>
</v-list-item-content> </v-list-item-content>
<v-btn
class="ma-2"
color="warning"
@click="updateServer"
>
Update server configuration
<v-icon right dark>mdi-update</v-icon>
</v-btn>
</v-list-item> </v-list-item>
<div class="d-flex flex-no-wrap justify-space-between"> <div class="d-flex flex-no-wrap justify-space-between">
<v-col cols="12"> <v-col cols="12">
@ -53,12 +61,20 @@
</div> </div>
</v-card> </v-card>
</v-col> </v-col>
<v-col cols="6"> <v-col cols="12">
<v-card dark> <v-card dark>
<v-list-item> <v-list-item>
<v-list-item-content> <v-list-item-content>
<v-list-item-title class="headline">Client's global configuration</v-list-item-title> <v-list-item-title class="headline">Client's global configuration</v-list-item-title>
</v-list-item-content> </v-list-item-content>
<v-btn
class="ma-2"
color="warning"
@click="updateServer"
>
Update server configuration
<v-icon right dark>mdi-update</v-icon>
</v-btn>
</v-list-item> </v-list-item>
<div class="d-flex flex-no-wrap justify-space-between"> <div class="d-flex flex-no-wrap justify-space-between">
<v-col cols="12"> <v-col cols="12">
@ -114,6 +130,14 @@
<v-list-item-content> <v-list-item-content>
<v-list-item-title class="headline">Interface configuration hooks</v-list-item-title> <v-list-item-title class="headline">Interface configuration hooks</v-list-item-title>
</v-list-item-content> </v-list-item-content>
<v-btn
class="ma-2"
color="warning"
@click="updateServer"
>
Update server configuration
<v-icon right dark>mdi-update</v-icon>
</v-btn>
</v-list-item> </v-list-item>
<div class="d-flex flex-no-wrap justify-space-between"> <div class="d-flex flex-no-wrap justify-space-between">
<v-col cols="12"> <v-col cols="12">
@ -140,16 +164,6 @@
</v-row> </v-row>
<v-divider dark/> <v-divider dark/>
<v-divider dark/> <v-divider dark/>
<v-row justify="center">
<v-btn
class="ma-2"
color="warning"
@click="updateServer"
>
Update server configuration
<v-icon right dark>mdi-update</v-icon>
</v-btn>
</v-row>
<Notification v-bind:notification="notification"/> <Notification v-bind:notification="notification"/>
</v-container> </v-container>
</template> </template>

View File

@ -1,21 +1,36 @@
import Vue from 'vue' import Vue from 'vue'
import VueRouter from 'vue-router' import VueRouter from 'vue-router'
import Home from '../views/Home.vue'


Vue.use(VueRouter) Vue.use(VueRouter);


const routes = [ const routes = [
{ {
path: '/', path: '/',
name: 'home', name: 'index',
component: Home component: function () {
return import(/* webpackChunkName: "Index" */ '../views/Index.vue')
},
},
{
path: '/clients',
name: 'clients',
component: function () {
return import(/* webpackChunkName: "Clients" */ '../views/Clients.vue')
},
},
{
path: '/server',
name: 'server',
component: function () {
return import(/* webpackChunkName: "Server" */ '../views/Server.vue')
},
} }
] ];


const router = new VueRouter({ const router = new VueRouter({
mode: 'history', mode: 'history',
base: process.env.BASE_URL, base: process.env.BASE_URL,
routes routes
}) });


export default router export default router

View File

@ -1,18 +1,15 @@
<template> <template>
<v-content> <v-content>
<Server/>
<Clients/> <Clients/>
</v-content> </v-content>
</template> </template>


<script> <script>
import Server from '../components/Server'
import Clients from '../components/Clients' import Clients from '../components/Clients'


export default { export default {
name: 'home', name: 'clients',
components: { components: {
Server,
Clients Clients
} }
} }

10
ui/src/views/Index.vue Normal file
View File

@ -0,0 +1,10 @@
<template>
</template>

<script>
export default {
created () {
this.$router.replace({ name: 'clients' })
}
}
</script>

16
ui/src/views/Server.vue Normal file
View File

@ -0,0 +1,16 @@
<template>
<v-content>
<Server/>
</v-content>
</template>

<script>
import Server from '../components/Server'

export default {
name: 'server',
components: {
Server
}
}
</script>