diff --git a/src/components/Menu2.vue b/src/components/Menu2.vue index ccfb2839..e0a43668 100644 --- a/src/components/Menu2.vue +++ b/src/components/Menu2.vue @@ -9,7 +9,7 @@ > - + {{nameBig}}{{nameSmall}} @@ -63,7 +63,7 @@ left bottom offset-y - v-if="this.$store.state.loggedIn" + v-if="this.$store.state.loggedIn && this.$store.getters.getMe.admin" > diff --git a/src/components/MenuMobile.vue b/src/components/MenuMobile.vue index 0d86b0ee..ae7591f1 100644 --- a/src/components/MenuMobile.vue +++ b/src/components/MenuMobile.vue @@ -124,6 +124,54 @@ + + + + mdi-account-badge + + + + Admin + + + + + + Settings + + + + + Users + + + + + Apps + + + + + Invites + + + + diff --git a/src/router/index.js b/src/router/index.js index 11ee0aee..9657fc3c 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -20,6 +20,7 @@ import AdminUserEdit from '../views/admin/UserEdit' import AdminAppsList from '../views/admin/App' import AdminAppDetails from '../views/admin/AppDetail' import AdminInvite from '../views/admin/Invite' +import AdminInviteNew from '../views/admin/InviteNew' Vue.use(Router) @@ -146,6 +147,12 @@ export default new Router({ name: 'adminInvite', component: AdminInvite }, + { + beforeEnter: admin, + path: '/admin/invite/new', + name: 'adminInviteNew', + component: AdminInviteNew + }, ] diff --git a/src/services/Admin.js b/src/services/Admin.js index 7a4963fe..f9ba695b 100644 --- a/src/services/Admin.js +++ b/src/services/Admin.js @@ -27,5 +27,8 @@ export default { }, listInvites() { return Api().get("/v1/admin/invite"); + }, + newInvite(username, comment) { + return Api().post("/v1/admin/invite", {"username": username, "comment": comment}); } } diff --git a/src/views/admin/Invite.vue b/src/views/admin/Invite.vue index cf8605db..763b73f1 100644 --- a/src/views/admin/Invite.vue +++ b/src/views/admin/Invite.vue @@ -3,6 +3,14 @@ + + New Invite + Invites diff --git a/src/views/admin/InviteNew.vue b/src/views/admin/InviteNew.vue new file mode 100644 index 00000000..afc9d708 --- /dev/null +++ b/src/views/admin/InviteNew.vue @@ -0,0 +1,66 @@ + + + + + + New Invite + + + + Invite-Code: {{ invite.code }} + + + + + + Create + + + + + + + + + + + + + +