+
diff --git a/server/layouts/default.vue b/server/layouts/default.vue
index 78a45f83..c46ec2ae 100644
--- a/server/layouts/default.vue
+++ b/server/layouts/default.vue
@@ -1,10 +1,10 @@
-
+
-
+
diff --git a/server/package.json b/server/package.json
index c07e0e10..2ddaf9c7 100644
--- a/server/package.json
+++ b/server/package.json
@@ -18,6 +18,7 @@
"bcrypt": "^5.1.1",
"fast-fuzzy": "^1.12.0",
"file-type-mime": "^0.4.3",
+ "markdown-it": "^14.1.0",
"moment": "^2.30.1",
"nuxt": "^3.13.2",
"prisma": "^5.20.0",
@@ -32,7 +33,9 @@
"packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e",
"devDependencies": {
"@tailwindcss/forms": "^0.5.9",
+ "@tailwindcss/typography": "^0.5.15",
"@types/bcrypt": "^5.0.2",
+ "@types/markdown-it": "^14.1.2",
"@types/turndown": "^5.0.5",
"@types/uuid": "^10.0.0",
"autoprefixer": "^10.4.20",
diff --git a/server/pages/admin/library/[id]/index.vue b/server/pages/admin/library/[id]/index.vue
index dbf8040e..29b938a3 100644
--- a/server/pages/admin/library/[id]/index.vue
+++ b/server/pages/admin/library/[id]/index.vue
@@ -1,11 +1,154 @@
+
+
+
+ {{ game.mName }}
+
+
{{ game.mShortDescription }}
-
+
+
+
+
+
+
+
+
+ Images
+
+
+
+
+
+
+
+
+
+
![]()
+
+
+
+
+
+
+ current banner & cover
+
+
+ current cover
+
+
+ current banner
+
+
+
+
+
+
\ No newline at end of file
+ layout: "admin",
+});
+
+const route = useRoute();
+const gameId = route.params.id.toString();
+const headers = useRequestHeaders(["cookie"]);
+const game = ref(
+ await $fetch
(`/api/v1/admin/game?id=${encodeURIComponent(gameId)}`, {
+ headers,
+ })
+);
+
+const md = markdownit();
+const descriptionHTML = md.render(game.value?.mDescription ?? "");
+
+async function updateBannerImage(id: string) {
+ if (game.value.mBannerId == id) return;
+ const { mBannerId } = await $fetch("/api/v1/admin/game", {
+ method: "PATCH",
+ body: {
+ id: gameId,
+ mBannerId: id,
+ },
+ });
+ game.value.mBannerId = mBannerId;
+}
+
+async function updateCoverImage(id: string) {
+ if (game.value.mCoverId == id) return;
+ const { mCoverId } = await $fetch("/api/v1/admin/game", {
+ method: "PATCH",
+ body: {
+ id: gameId,
+ mCoverId: id,
+ },
+ });
+ game.value.mCoverId = mCoverId;
+}
+
+async function deleteImage(id: string) {
+ const { mBannerId, mImageLibrary } = await $fetch(
+ "/api/v1/admin/game/image",
+ {
+ method: "DELETE",
+ body: {
+ gameId: game.value.id,
+ imageId: id,
+ },
+ }
+ );
+ game.value.mImageLibrary = mImageLibrary;
+ game.value.mBannerId = mBannerId;
+}
+
diff --git a/server/pages/admin/library/index.vue b/server/pages/admin/library/index.vue
index a1edc3c1..2b75d0d9 100644
--- a/server/pages/admin/library/index.vue
+++ b/server/pages/admin/library/index.vue
@@ -28,7 +28,7 @@