diff --git a/README.md b/README.md index a96bb0de..06412dd3 100644 --- a/README.md +++ b/README.md @@ -10,8 +10,9 @@ Robonau's Svelte + skeleton tachidesk UI ## Web Server files -The Tachidesk-VUI-Web.zip file in the release is for hosting the ui though a webserver -It should also be possible to replace the contents of the webUI folder in the Tachidesk data directory, though this is not recommended +The Tachidesk-VUI-Web.zip file in the release is for hosting the ui though `server.webUIFlavor = "Custom"` config and replacing the contents of the webUI folder in the Tachidesk data directory + +The files could also be used in a stand alone webserver though you would have to redirect `/api` trafic to tachidesk server ## Docker @@ -20,10 +21,14 @@ It should also be possible to replace the contents of the webUI folder in the Ta ```yaml version: '3.7' services: - tachideskvui: - image: ghcr.io/suwayomi/tachidesk-vui:latest + vui3: + image: ghcr.io/suwayomi/tachidesk-vui ports: - '9013:8080' + environment: + - tachidesk=http://tachidesk:4567/ + # will proxy the tachidesk server to the UI + # if you plan on proxying it externally then this is unnecessary restart: unless-stopped ``` diff --git a/src/lib/simpleStores.ts b/src/lib/simpleStores.ts index f392fab1..fcecadd0 100644 --- a/src/lib/simpleStores.ts +++ b/src/lib/simpleStores.ts @@ -124,7 +124,7 @@ function GlobalMeta() { Meta.subscribe((e) => { store.update((n) => { - const Ncopy = structuredClone(n) as { [key: string]: unknown }; + const Ncopy = structuredClone(trueDefaults) as { [key: string]: unknown }; (Object.keys(n) as (keyof globalMeta)[]).forEach((ee) => { const tmp = e.data.metas?.nodes.find((k) => k.key.replace('VUI3_', '') === ee); if (!tmp) return; @@ -194,11 +194,11 @@ function MangaMetaUpdator(cache: ApolloCache, key: string, value: strin export function MangaMeta(id: number) { const MMeta = getManga({ variables: { id } }); - const store = writable(mangaMetaDefaults); + const store = writable(get(Meta).mangaMetaDefaults); MMeta.subscribe((e) => { store.update((n) => { - const Ncopy = structuredClone(n) as { [key: string]: unknown }; + const Ncopy = structuredClone(get(Meta).mangaMetaDefaults) as { [key: string]: unknown }; (Object.keys(n) as (keyof mangaMeta)[]).forEach((ee) => { const tmp = e.data.manga?.meta.find((k) => k.key.replace('VUI3_', '') === ee); if (!tmp) return; @@ -221,6 +221,8 @@ export function MangaMeta(id: number) { //set if not the truedefault value await setMangaMeta({ variables: { key, value, id } + //update after to keep in sync + // update: (a) => MangaMetaUpdator(a, key, value, id) }); } else if (tmp !== undefined) { //delete if not already undefined diff --git a/src/routes/(app)/manga/[MangaID]/chapter/[ChapterID]/+layout@.svelte b/src/routes/(app)/manga/[MangaID]/chapter/[ChapterID]/+layout@.svelte index 861c62f1..e7506ea5 100644 --- a/src/routes/(app)/manga/[MangaID]/chapter/[ChapterID]/+layout@.svelte +++ b/src/routes/(app)/manga/[MangaID]/chapter/[ChapterID]/+layout@.svelte @@ -13,7 +13,7 @@ id: 'ChapterMenu', width: 'w-[280px] md:w-[480px]', meta: { - id: data.ChapterID + id: data.MangaID } }); } diff --git a/src/routes/(app)/manga/[MangaID]/chapter/[ChapterID]/+page.svelte b/src/routes/(app)/manga/[MangaID]/chapter/[ChapterID]/+page.svelte index e49c66af..b3080f62 100644 --- a/src/routes/(app)/manga/[MangaID]/chapter/[ChapterID]/+page.svelte +++ b/src/routes/(app)/manga/[MangaID]/chapter/[ChapterID]/+page.svelte @@ -20,7 +20,7 @@ import { Layout, MangaMeta, Mode } from '$lib/simpleStores'; export let data: PageData; - const mangaMeta = MangaMeta(data.ChapterID); + const mangaMeta = MangaMeta(data.MangaID); let currentChapterID = data.ChapterID; @@ -107,7 +107,10 @@ } else if (path.menu && pointInPoly([e.x, e.y], polyToPOLLY(path.menu))) { drawerStore.open({ id: 'ChapterMenu', - width: 'w-[280px] md:w-[480px]' + width: 'w-[280px] md:w-[480px]', + meta: { + id: data.MangaID + } }); } } @@ -283,11 +286,17 @@ {/if} {#each chapter.pages as page, pageindex (page)}
{ @@ -304,7 +313,15 @@ bottom={0} top={$mangaMeta.Margins ? 16 : 0} /> -
+