diff --git a/package.json b/package.json index 95ba78f..d95d61a 100644 --- a/package.json +++ b/package.json @@ -29,14 +29,10 @@ }, "dependencies": { "@elastic/apm-rum": "^5.12.0", - "@sentry/browser": "^7.25.0", - "@sentry/svelte": "^7.25.0", - "@sentry/tracing": "^7.25.0", "fflate": "^0.8.0", "streamsaver": "^2.0.6", "svelte-local-storage-store": "^0.3.1", "svelte-markdown": "^0.2.3", - "swiper": "^8.3.2", - "toucan-js": "^3.0.0" + "swiper": "^8.3.2" } } diff --git a/src/hooks.server.ts b/src/hooks.server.ts index 948ad3f..30579a9 100644 --- a/src/hooks.server.ts +++ b/src/hooks.server.ts @@ -1,37 +1,6 @@ -import { Toucan } from 'toucan-js'; /** @type {import('@sveltejs/kit').HandleClientError} */ export function handleError({ error, event }) { - // @ts-ignore - if(import.meta.env.VITE_SENTRY_DSN !== undefined) { - const sentry = new Toucan({ - // @ts-ignore - dsn: import.meta.env.VITE_SENTRY_DSN, - - // @ts-ignore - environment: import.meta.env.VITE_SENTRY_ENVIRONMENT, - // @ts-ignore - release: import.meta.env.VITE_SENTRY_RELEASE, - request: event.request, - requestDataOptions: { - allowedHeaders: [ - 'user-agent', - 'cf-challenge', - 'accept-encoding', - 'accept-language', - 'cf-ray', - 'content-length', - 'content-type', - 'x-real-ip', - 'host', - ], - allowedSearchParams: /(.*)/ - } - }); - - sentry.captureException(error); - } - return { ...error, code: error?.code ?? 'UNKNOWN' diff --git a/src/lib/components/chapter.svelte b/src/lib/components/chapter.svelte index 8c12cd5..6d445db 100644 --- a/src/lib/components/chapter.svelte +++ b/src/lib/components/chapter.svelte @@ -6,6 +6,7 @@ export var selected; export var disabledDownload = false; export var progress = 0; + export var read; var scanlationGroup = chapter.relationships.find(t => t.type === "scanlation_group")?.attributes.name; /** @@ -25,7 +26,7 @@ } - + {chapter.attributes.volume ? "Vol " + chapter.attributes.volume : ""} {chapter.attributes.chapter ? "Chapter " + chapter.attributes.chapter : ""} @@ -43,6 +44,9 @@ background-repeat: no-repeat; user-select: none; } + .read { + color: grey; + } .scanlation { color: grey; font-size: 0.9rem; diff --git a/src/lib/util/anilist.ts b/src/lib/util/anilist.ts index 935a1fa..c0f42d6 100644 --- a/src/lib/util/anilist.ts +++ b/src/lib/util/anilist.ts @@ -1,5 +1,4 @@ -import * as Sentry from "@sentry/browser"; -// import { apm } from "./tracing"; +import { apm } from "./tracing"; var isLogedInCache: boolean | null = null; var isLogedInCacheTime: number | null = null; @@ -22,8 +21,7 @@ export function isLogedIn() { export function getUserID() { const token = localStorage.getItem("token")!; let data = JSON.parse(atob(token.substring(token.indexOf(".") + 1, token.lastIndexOf(".")))); - Sentry.setUser({ id: data.sub }); - // apm.setUserContext({ id: data.sub }); + apm.setUserContext({ id: data.sub }); return data.sub; } diff --git a/src/lib/util/tracing.ts b/src/lib/util/tracing.ts index f3a624a..67cf607 100644 --- a/src/lib/util/tracing.ts +++ b/src/lib/util/tracing.ts @@ -1,22 +1,22 @@ -// import { browser } from '$app/environment'; -// import { ApmBase, init as initApm } from '@elastic/apm-rum' +import { browser } from '$app/environment'; +import { ApmBase, init as initApm } from '@elastic/apm-rum' -// var apm_: ApmBase; +var apm_: ApmBase; -// if(browser) { -// apm_ = initApm({ -// // Set required service name (allowed characters: a-z, A-Z, 0-9, -, _, and space) -// serviceName: 'mangades', +if(browser) { + apm_ = initApm({ + // Set required service name (allowed characters: a-z, A-Z, 0-9, -, _, and space) + serviceName: 'mangades', -// // Set custom APM Server URL (default: http://localhost:8200) -// serverUrl: 'https://apm.elasticsearch.danbulant.cloud', + // Set custom APM Server URL (default: http://localhost:8200) + serverUrl: 'https://apm.elasticsearch.danbulant.cloud', -// // Set the service version (required for source map feature) + // Set the service version (required for source map feature) // serviceVersion: import.meta.env.VITE_SENTRY_RELEASE, - -// // Set the service environment -// environment: import.meta.env.VITE_SENTRY_ENVIRONMENT || 'production' -// }); -// } -// export const apm = apm_; \ No newline at end of file + // Set the service environment + environment: import.meta.env.VITE_SENTRY_ENVIRONMENT || 'production' + }); +} + +export const apm = apm_; \ No newline at end of file diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte index 25aa000..2bc9e3f 100644 --- a/src/routes/+layout.svelte +++ b/src/routes/+layout.svelte @@ -2,34 +2,14 @@ import { afterNavigate } from "$app/navigation"; import { logs } from "$lib/util/logs"; import PageTransition from "./pageTransition.svelte"; - import * as Sentry from '@sentry/svelte'; - import { BrowserTracing } from "@sentry/tracing"; import { browser } from '$app/environment'; - // import { apm } from "$lib/util/tracing"; - // import { page } from "$app/stores"; + import { apm } from "$lib/util/tracing"; + import { page } from "$app/stores"; export var data; - // @ts-ignore - if(import.meta.env.VITE_SENTRY_DSN && browser) { - Sentry.init({ - // @ts-ignore - dsn: import.meta.env.VITE_SENTRY_DSN, - // @ts-ignore - environment: import.meta.env.VITE_SENTRY_ENVIRONMENT, - // @ts-ignore - release: import.meta.env.VITE_SENTRY_RELEASE, - integrations: [ - new BrowserTracing({ - tracePropagationTargets: ["localhost", "manga.danbulant.eu", "tachiyomi.manga-d7tp.pages.dev", "manga-d7tp.pages.dev", /^\/.*/] - }), - ], - tracesSampleRate: 1, - autoSessionTracking: false - }); + if(browser) { + apm.setInitialPageLoadName($page.route.id); } - // if(browser) { - // apm.setInitialPageLoadName($page.route.id); - // } let skipFirst = true; let last = typeof window !== "undefined" && window.location.pathname; diff --git a/src/routes/[manga]/+page.svelte b/src/routes/[manga]/+page.svelte index 797122f..2572cfb 100644 --- a/src/routes/[manga]/+page.svelte +++ b/src/routes/[manga]/+page.svelte @@ -17,6 +17,7 @@ import Favicon from "./favicon.svelte"; import RelatedManga from "./relatedManga.svelte"; import { anilistInfo } from "./anilistInfo"; + import { isLogedIn } from "$lib/util/anilist"; export var data; @@ -275,6 +276,7 @@ var scrollY, innerHeight; let additionalImages = []; + let alReadProgress $: if(anilistData) anilistData.then(data => { if(data && data.bannerImage && !additionalImages.find(t => t.src === data.bannerImage)) { @@ -293,6 +295,7 @@ width: 3 }); additionalImages = additionalImages; + alReadProgress = data.mediaListEntry?.progress; tabs = [...defaultTabs, "Characters"]; } }); else { @@ -318,13 +321,18 @@ var selectedCharacter = null; $: if(!selectedImage) selectedCharacter = null; + + let expanded = false; + + let uniqueChapterCount; + $: uniqueChapterCount = chapters?.data.filter((t, i, a) => a.findIndex(t2 => Math.floor(t2.attributes.chapter) === Math.floor(t.attributes.chapter)) === i).length; {title} - Chapter list - + @@ -402,12 +410,12 @@ {#if smallScreenMode && manga.description.en}
- +
{/if} {#if manga.tags} -
+
{#each manga.tags as tag} {tag.attributes.name.en || tag.attributes.name.jp || Object.values(tag.attributes.name)[0]} {/each} @@ -416,7 +424,23 @@ @@ -489,7 +513,7 @@ {#each chapters.data as chapter} - select(chapter)} on:download={() => downloadSingle(chapter)} /> + = parseInt(chapter.attributes.chapter)} progress={(progressMap.get(chapter.id) || 0) / chapter.attributes.pages} {chapter} disabledDownload={!!progress} selected={selected.includes(chapter)} on:select={() => select(chapter)} on:download={() => downloadSingle(chapter)} /> {/each}
@@ -497,13 +521,13 @@
-
+
-
+
{#if anilistData} {#await anilistData then data} {#if data}
Genres: {data.genres.join(", ")} @@ -646,6 +670,9 @@ display: flex; overflow: auto; } + .tags.expanded { + flex-wrap: wrap; + } .tag { margin: 5px; padding: 5px; diff --git a/src/routes/[manga]/expandableDescription.svelte b/src/routes/[manga]/expandableDescription.svelte index 6b77d79..30b7d65 100644 --- a/src/routes/[manga]/expandableDescription.svelte +++ b/src/routes/[manga]/expandableDescription.svelte @@ -4,7 +4,7 @@ export var source: string; - export var expanded = false; + export var expanded: boolean = false;
diff --git a/static/global.css b/static/global.css index d8af1fc..3e7b0ba 100644 --- a/static/global.css +++ b/static/global.css @@ -78,4 +78,33 @@ button:focus, .button:focus, button:hover, .button:hover { * { box-sizing: border-box; -} \ No newline at end of file +} + +::-webkit-scrollbar { + width: 10px; + height: 10px; + padding: 5px; +} + +::-webkit-scrollbar-track { + background: transparent; +} + +::-webkit-scrollbar-thumb { + background: rgba(255,255,255,0.3); + border-radius: 5px; + margin: 2px; +} + +::-webkit-scrollbar-thumb:hover { + background: rgba(255,255,255,0.4); +} + +::-webkit-scrollbar-thumb:active { + background: rgba(255,255,255,0.5); +} + +::-webkit-scrollbar-corner { + background: transparent; +} +