diff --git a/server/README.md b/server/README.md index ec84d97f..3e960c66 100644 --- a/server/README.md +++ b/server/README.md @@ -19,8 +19,9 @@ Drop uses a utility package called droplet that's written in Rust. It has builts Steps: 1. Copy the `.env.example` to `.env` and add your GiantBomb metadata key (more metadata providers coming) -2. Open up a terminal and navigate to `dev-tools`, and run `docker compose up` -3. Open up a terminal in the root directory of the project and run `yarn` and then `yarn dev` to start the dev server +2. Create the `.data` directory with `mkdir .data` +3. Open up a terminal and navigate to `dev-tools`, and run `docker compose up` +4. Open up a terminal in the root directory of the project and run `yarn` and then `yarn dev` to start the dev server To create an account: Head over to the `/register` page. It's currently a temporary development form for creating a username + password log in. diff --git a/server/components/HeaderUserWidget.vue b/server/components/HeaderUserWidget.vue index eb827a08..073181c3 100644 --- a/server/components/HeaderUserWidget.vue +++ b/server/components/HeaderUserWidget.vue @@ -1,67 +1,88 @@ \ No newline at end of file + } + : undefined, + { + label: "Account settings", + route: "/account", + prefix: "", + }, + { + label: "Sign out", + route: "/signout", + prefix: "", + }, +].filter((e) => e !== undefined); + diff --git a/server/composables/current-page-engine.ts b/server/composables/current-page-engine.ts new file mode 100644 index 00000000..6142949e --- /dev/null +++ b/server/composables/current-page-engine.ts @@ -0,0 +1,28 @@ +import type { RouteLocationNormalized } from "vue-router"; +import type { NavigationItem } from "./types"; + +export const useCurrentNavigationIndex = (navigation: Array) => { + const router = useRouter(); + const route = useRoute(); + + const currentNavigation = ref(-1); + + function calculateCurrentNavIndex(to: RouteLocationNormalized) { + const validOptions = navigation + .map((e, i) => ({ ...e, index: i })) + .filter((e) => to.fullPath.startsWith(e.prefix)); + const bestOption = validOptions + .sort((a, b) => b.route.length - a.route.length) + .at(0); + + return bestOption?.index ?? -1; + } + + currentNavigation.value = calculateCurrentNavIndex(route); + + router.afterEach((to) => { + currentNavigation.value = calculateCurrentNavIndex(to); + }); + + return currentNavigation; +}; diff --git a/server/layouts/admin.vue b/server/layouts/admin.vue index ba534139..5a082672 100644 --- a/server/layouts/admin.vue +++ b/server/layouts/admin.vue @@ -1,2 +1,112 @@ \ No newline at end of file +
+ + + +
+ +
+ +
+
+
+ + +
+
+
+
+ + + diff --git a/server/pages/admin/index.vue b/server/pages/admin/index.vue index ad332541..ca6a7ec9 100644 --- a/server/pages/admin/index.vue +++ b/server/pages/admin/index.vue @@ -1,8 +1,11 @@ - + \ No newline at end of file + layout: "admin", +}); + +useHead({ + title: "Home", +}); + diff --git a/server/pages/admin/libraries.vue b/server/pages/admin/libraries.vue new file mode 100644 index 00000000..51595038 --- /dev/null +++ b/server/pages/admin/libraries.vue @@ -0,0 +1,11 @@ + + + diff --git a/server/pages/signin.vue b/server/pages/signin.vue index 7e5fb8da..88cb4995 100644 --- a/server/pages/signin.vue +++ b/server/pages/signin.vue @@ -64,7 +64,7 @@ name="remember-me" type="checkbox" v-model="rememberMe" - class="h-4 w-4 rounded border-zinc-300 text-blue-600 focus:ring-blue-600" + class="h-4 w-4 rounded bg-zinc-800 border-zinc-700 text-blue-600 focus:ring-blue-600" />