From 95284448f8d1d9af73ec0442e8af3de02642dd3e Mon Sep 17 00:00:00 2001 From: Kekskurse Date: Fri, 22 Nov 2019 18:22:31 +0100 Subject: [PATCH] YoLo --- src/components/Menu2.vue | 4 +- src/router/index.js | 15 +++- src/services/Admin.js | 15 ++++ src/views/Startpage.vue | 8 +- src/views/admin/Settings.vue | 2 +- src/views/admin/User.vue | 69 ++++++++++++++++ src/views/admin/UserEdit.vue | 153 +++++++++++++++++++++++++++++++++++ 7 files changed, 261 insertions(+), 5 deletions(-) create mode 100644 src/views/admin/User.vue create mode 100644 src/views/admin/UserEdit.vue diff --git a/src/components/Menu2.vue b/src/components/Menu2.vue index 42d1785d..fdba853f 100644 --- a/src/components/Menu2.vue +++ b/src/components/Menu2.vue @@ -9,7 +9,7 @@ > - + {{nameBig}}{{nameSmall}} @@ -75,7 +75,7 @@ Settings - + User diff --git a/src/router/index.js b/src/router/index.js index 160fbf2a..ce6bbd3e 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -15,6 +15,8 @@ import Access from '../views/Access' import Profile from '../views/Profile' import AdminSettings from '../views/admin/Settings' +import AdminUserList from '../views/admin/User' +import AdminUserEdit from '../views/admin/UserEdit' Vue.use(Router) @@ -111,6 +113,17 @@ export default new Router({ name: 'adminSettings', component: AdminSettings }, - + { + beforeEnter: admin, + path: '/admin/user', + name: 'adminUserList', + component: AdminUserList + }, + { + beforeEnter: admin, + path: '/admin/user/:id', + name: 'adminUserEdit', + component: AdminUserEdit + }, ] }) diff --git a/src/services/Admin.js b/src/services/Admin.js index 668061ee..a0d54eef 100644 --- a/src/services/Admin.js +++ b/src/services/Admin.js @@ -3,5 +3,20 @@ import Api from '@/services/Api' export default { saveSettings(settings) { return Api().post('/v1/admin/settings', settings); + }, + getUserList() { + return Api().get("/v1/admin/user"); + }, + getUserDetails(id) { + return Api().get("/v1/admin/user/"+id); + }, + updateUser(id, username, admin, developer) { + return Api().put("/v1/admin/user/"+id, {"username": username, "admin": admin, "developer": developer}); + }, + resendValidationMail(id) { + return Api().post("/v1/admin/mail/"+id+"/resend") + }, + validateMail(id) { + return Api().put("/v1/admin/mail/"+id+"/status", {"status": "valide"}); } } diff --git a/src/views/Startpage.vue b/src/views/Startpage.vue index 364e7fae..6cf9a01b 100644 --- a/src/views/Startpage.vue +++ b/src/views/Startpage.vue @@ -99,7 +99,13 @@ this.nameBig = this.$store.getters.getSettingValue("name_big"); this.nameSmall = this.$store.getters.getSettingValue("name_small"); this.slogen = this.$store.getters.getSettingValue("name_slogen"); - this.getStartpageApps(); + + if(this.$store.getters.getSettingValue("startpage") == false) { + this.$router.push({"path": "login"}) + } else { + this.getStartpageApps(); + } + } } diff --git a/src/views/admin/Settings.vue b/src/views/admin/Settings.vue index 06d67ed3..4e442682 100644 --- a/src/views/admin/Settings.vue +++ b/src/views/admin/Settings.vue @@ -44,7 +44,7 @@ > +
+ + + +

Users

+

+

Here you can Administrate your apps

+ + + + +
+
+
+ + +
+ + + + + diff --git a/src/views/admin/UserEdit.vue b/src/views/admin/UserEdit.vue new file mode 100644 index 00000000..4072e10e --- /dev/null +++ b/src/views/admin/UserEdit.vue @@ -0,0 +1,153 @@ + + + +