From 065d134793e17eca602742fba9ee456c636b9831 Mon Sep 17 00:00:00 2001 From: khansadaoudi Date: Wed, 31 Jul 2024 16:09:26 +0200 Subject: [PATCH] add more features for super admin --- src/api/backend-api.ts | 6 + src/layouts/AppLayout.vue | 6 - src/pages/Settings.vue | 340 ++++++++++++++++++++++++++++++++------ src/router/index.ts | 29 +--- 4 files changed, 301 insertions(+), 80 deletions(-) diff --git a/src/api/backend-api.ts b/src/api/backend-api.ts index 9f4787a6..89a35fba 100644 --- a/src/api/backend-api.ts +++ b/src/api/backend-api.ts @@ -69,6 +69,12 @@ export default { getProjects() { return API.get('projects'); }, + getMismatchProjects() { + return API.get('projects/mismatch-projects'); + }, + getProjectsLanguages() { + return API.get('projects/project-languages'); + }, createProject(data: createProject_ED) { return API.post('projects/', data); }, diff --git a/src/layouts/AppLayout.vue b/src/layouts/AppLayout.vue index ad1c8505..4a9a3fdd 100644 --- a/src/layouts/AppLayout.vue +++ b/src/layouts/AppLayout.vue @@ -99,12 +99,6 @@ {{ $t('settings') }} - - - - - {{ $t('admin') }} - diff --git a/src/pages/Settings.vue b/src/pages/Settings.vue index 18ede299..a44288e9 100644 --- a/src/pages/Settings.vue +++ b/src/pages/Settings.vue @@ -1,71 +1,215 @@ - diff --git a/src/router/index.ts b/src/router/index.ts index 590a0e7a..5d5f6124 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -5,11 +5,7 @@ import routes from './routes'; import { useProjectStore } from 'src/pinia/modules/project'; import { useKlangStore } from 'src/pinia/modules/klang'; -/* - * If not building with SSR mode, you can - * directly export the Router instantiation - */ -export default route((/* { store, ssrContext } */) => { +export default route(() => { const createHistory = process.env.SERVER ? createMemoryHistory : process.env.VUE_ROUTER_MODE === 'history' @@ -20,31 +16,8 @@ export default route((/* { store, ssrContext } */) => { history: createHistory(process.env.MODE === 'ssr' ? void 0 : process.env.VUE_ROUTER_BASE), scrollBehavior: () => ({ left: 0, top: 0 }), - // mode: 'history', - // hash: false, routes, - - // Leave these as is and change from quasar.conf.js instead! - // quasar.conf.js -> build -> vueRouterMode - // quasar.conf.js -> build -> publicPath - // mode: process.env.VUE_ROUTER_MODE, - // base: process.env.VUE_ROUTER_BASE, - // afterEach: (to) => { - // // aftereach is outsideshow_all_trees - // }, }); - - // Router.onError(error => { - // if (/loading chunk \d* failed./i.test(error.message)) { - // window.location.reload() - // } - // }) - - /* - * After each routing, check if it lands on a project. - * if yes, check if it's a different project from the previous one - * if yes, fetch the config of the project (annotation and display) - */ Router.afterEach((to, from) => { const configStore = useProjectStore(); const klangStore = useKlangStore();