diff --git a/web/admin-gui/src/App.vue b/web/admin-gui/src/App.vue index 873260d..e789439 100644 --- a/web/admin-gui/src/App.vue +++ b/web/admin-gui/src/App.vue @@ -1,7 +1,9 @@ diff --git a/web/admin-gui/src/assets/base.css b/web/admin-gui/src/assets/base.css index 1767f91..72e9c38 100644 --- a/web/admin-gui/src/assets/base.css +++ b/web/admin-gui/src/assets/base.css @@ -21,6 +21,9 @@ --neutral-dark: #121212; --neutral-medium: #707070; --neutral-light: #aaaaaa; + --neutral-verylight: #e7e7e7; + --brand-blue: #00ACD7; + --error: #E80000; } body { @@ -40,9 +43,9 @@ h2, h3, h4, h5, h6 { * { font-family: 'Hind', sans-serif; - box-sizing: border-box; - color: var(--neutral-dark); + + box-sizing: border-box; } .label-input, @@ -75,11 +78,11 @@ h2, h3, h4, h5, h6 { } .label-input-error input { - border: solid 1.75px red; + border: solid 1.75px var(--error); } .label-input-error p { - color: red; + color: var(--error); } .button-primary, diff --git a/web/admin-gui/src/components/Navbar.vue b/web/admin-gui/src/components/Navbar.vue new file mode 100644 index 0000000..f0e45ac --- /dev/null +++ b/web/admin-gui/src/components/Navbar.vue @@ -0,0 +1,79 @@ + + + + + \ No newline at end of file diff --git a/web/admin-gui/src/router/index.ts b/web/admin-gui/src/router/index.ts index cb7ddd6..4031b01 100644 --- a/web/admin-gui/src/router/index.ts +++ b/web/admin-gui/src/router/index.ts @@ -1,9 +1,10 @@ import { createRouter, createWebHistory, type NavigationGuard } from 'vue-router' -import Home from '@/views/Home.vue' -import Debug from '@/views/Debug.vue' -import Login from '@/views/Login.vue' import { useAuthStore } from '@/stores/AuthStore' import { nextTick } from 'vue' +import Debug from '@/views/Debug.vue' +import Login from '@/views/Login.vue' +import Home from '@/views/Home.vue' +import Articles from '@/views/Articles.vue' const router = createRouter({ history: createWebHistory(import.meta.env.BASE_URL), @@ -32,6 +33,14 @@ const router = createRouter({ title: 'GohCMS - Accueil' } }, + { + path: '/articles', + name: 'articles', + component: Articles, + meta: { + title: 'GohCMS - Articles' + } + }, ] }) diff --git a/web/admin-gui/src/stores/AuthStore.ts b/web/admin-gui/src/stores/AuthStore.ts index 3071fc9..7bcab6f 100644 --- a/web/admin-gui/src/stores/AuthStore.ts +++ b/web/admin-gui/src/stores/AuthStore.ts @@ -10,11 +10,16 @@ export interface jwtFormat { } export const useAuthStore = defineStore("AuthStore", () => { - const expire = ref("") - const token = ref("") + const expire = ref('') + const token = ref('') + function clearAll(): void { + expire.value = '' + token.value = '' + } + function isSet(): boolean { - return token.value !== undefined && token.value !== "" + return token.value !== undefined && token.value !== '' } function isExpired(): boolean { @@ -43,5 +48,5 @@ export const useAuthStore = defineStore("AuthStore", () => { initStore() - return { expire, token, isValid } + return { expire, token, isValid, clearAll } }) \ No newline at end of file diff --git a/web/admin-gui/src/utils/cookies.ts b/web/admin-gui/src/utils/cookies.ts index 08ffbd8..95f2123 100644 --- a/web/admin-gui/src/utils/cookies.ts +++ b/web/admin-gui/src/utils/cookies.ts @@ -10,4 +10,12 @@ export function setCookie(cookieData: cookie): void { export function getCookie(cookieName: string): string { return document.cookie.match('(^|;)\\s*' + cookieName + '\\s*=\\s*([^;]+)')?.pop() || '' +} + +export function deleteCookie(cookieName: string): void { + setCookie({ + key: cookieName, + value: '', + expire: new Date(0).toString() + }) } \ No newline at end of file diff --git a/web/admin-gui/src/views/Articles.vue b/web/admin-gui/src/views/Articles.vue new file mode 100644 index 0000000..a1076f6 --- /dev/null +++ b/web/admin-gui/src/views/Articles.vue @@ -0,0 +1,11 @@ + + + + + \ No newline at end of file diff --git a/web/admin-gui/src/views/Home.vue b/web/admin-gui/src/views/Home.vue index 96c0baf..6e99aa4 100644 --- a/web/admin-gui/src/views/Home.vue +++ b/web/admin-gui/src/views/Home.vue @@ -1,9 +1,8 @@