mirror of
https://github.com/C9Glax/tranga-website.git
synced 2025-10-11 13:19:49 +02:00
Add merge page
This commit is contained in:
@@ -3,23 +3,25 @@
|
|||||||
<UHeader>
|
<UHeader>
|
||||||
<template #left>
|
<template #left>
|
||||||
<NuxtLink to="https://github.com/C9Glax/tranga"><Icon name="i-lucide-github" />API</NuxtLink>
|
<NuxtLink to="https://github.com/C9Glax/tranga"><Icon name="i-lucide-github" />API</NuxtLink>
|
||||||
<NuxtLink to="https://github.com/C9Glax/tranga-website"><Icon name="i-lucide-github" />Website</NuxtLink>
|
<NuxtLink to="https://github.com/C9Glax/tranga-website"
|
||||||
|
><Icon name="i-lucide-github" />Website</NuxtLink
|
||||||
|
>
|
||||||
<NuxtLink to=""><Icon name="i-lucide-book-open" />Swagger</NuxtLink>
|
<NuxtLink to=""><Icon name="i-lucide-book-open" />Swagger</NuxtLink>
|
||||||
</template>
|
</template>
|
||||||
<template #default>
|
<template #default>
|
||||||
<NuxtLink to="/">
|
<NuxtLink to="/">
|
||||||
<div class="h-full flex gap-2 items-center">
|
<div class="h-full flex gap-2 items-center">
|
||||||
<img src="/blahaj.png" class="h-lh cursor-grab" />
|
<img src="/blahaj.png" class="h-lh cursor-grab" />
|
||||||
<p
|
<p
|
||||||
style="
|
style="
|
||||||
background: linear-gradient(110deg, var(--color-pink), var(--color-blue));
|
background: linear-gradient(110deg, var(--color-pink), var(--color-blue));
|
||||||
-webkit-background-clip: text;
|
-webkit-background-clip: text;
|
||||||
-webkit-text-fill-color: transparent;
|
-webkit-text-fill-color: transparent;
|
||||||
"
|
"
|
||||||
class="font-bold cursor-pointer text-3xl">
|
class="font-bold cursor-pointer text-3xl">
|
||||||
Tranga
|
Tranga
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</NuxtLink>
|
</NuxtLink>
|
||||||
</template>
|
</template>
|
||||||
<template #right>
|
<template #right>
|
||||||
@@ -35,5 +37,4 @@
|
|||||||
</UMain>
|
</UMain>
|
||||||
</UApp>
|
</UApp>
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<script setup lang="ts"></script>
|
||||||
</script>
|
|
||||||
|
@@ -1,6 +1,11 @@
|
|||||||
<template>
|
<template>
|
||||||
<UPageList>
|
<UPageList>
|
||||||
<UPageCard v-for="chapter in chapters" :key="chapter.key" :title="chapter.title" orientation="horizontal" :ui="{ container: 'p-2 sm:p-2'}">
|
<UPageCard
|
||||||
|
v-for="chapter in chapters"
|
||||||
|
:key="chapter.key"
|
||||||
|
:title="chapter.title"
|
||||||
|
orientation="horizontal"
|
||||||
|
:ui="{ container: 'p-2 sm:p-2' }">
|
||||||
<template #leading>
|
<template #leading>
|
||||||
<Icon v-if="chapter.downloaded" name="i-lucide-circle-x" />
|
<Icon v-if="chapter.downloaded" name="i-lucide-circle-x" />
|
||||||
<Icon v-else name="i-lucide-circle-check-big" class="stroke-green-500" />
|
<Icon v-else name="i-lucide-circle-check-big" class="stroke-green-500" />
|
||||||
@@ -14,7 +19,11 @@
|
|||||||
</template>
|
</template>
|
||||||
<template #default>
|
<template #default>
|
||||||
<div>
|
<div>
|
||||||
<MangaconnectorIcon v-for="mangaconnectorId in chapter.mangaConnectorIds.sort((a,b) => a.mangaConnectorName < b.mangaConnectorName ? -1 : 1)" v-bind="mangaconnectorId" />
|
<MangaconnectorIcon
|
||||||
|
v-for="mangaconnectorId in chapter.mangaConnectorIds.sort((a, b) =>
|
||||||
|
a.mangaConnectorName < b.mangaConnectorName ? -1 : 1
|
||||||
|
)"
|
||||||
|
v-bind="mangaconnectorId" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</UPageCard>
|
</UPageCard>
|
||||||
@@ -22,12 +31,12 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import {id} from "#ui/locale";
|
import { id } from '#ui/locale';
|
||||||
|
|
||||||
export interface ChaptersListProps {
|
export interface ChaptersListProps {
|
||||||
mangaId: string;
|
mangaId: string;
|
||||||
}
|
}
|
||||||
const props = defineProps<ChaptersListProps>();
|
const props = defineProps<ChaptersListProps>();
|
||||||
|
|
||||||
const { data: chapters } = useApi('/v2/Manga/{MangaId}/Chapters', { path: { MangaId: props.mangaId }})
|
const { data: chapters } = useApi('/v2/Manga/{MangaId}/Chapters', { path: { MangaId: props.mangaId } });
|
||||||
</script>
|
</script>
|
@@ -26,13 +26,12 @@
|
|||||||
<UPageBody class="relative pr-4">
|
<UPageBody class="relative pr-4">
|
||||||
<div class="w-full flex flex-row justify-between">
|
<div class="w-full flex flex-row justify-between">
|
||||||
<div>
|
<div>
|
||||||
<UButton variant="soft" :to="backPath??'/'" icon="i-lucide-arrow-left">Back</UButton>
|
<UButton variant="soft" :to="backPath ?? '/'" icon="i-lucide-arrow-left">Back</UButton>
|
||||||
<p v-if="title" class="text-3xl">{{ title }}</p>
|
<p v-if="title" class="text-3xl">{{ title }}</p>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div v-if="manga" class="flex flex-row gap-2">
|
||||||
<slot name="actions">
|
<UButton trailing-icon="i-lucide-merge" :to="`${manga.key}/merge/`">Merge</UButton>
|
||||||
|
<slot name="actions" />
|
||||||
</slot>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<slot />
|
<slot />
|
||||||
|
@@ -1,6 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<MangaDetailPage :manga="manga" back-path="/search">
|
<MangaDetailPage :manga="manga" back-path="/search"> </MangaDetailPage>
|
||||||
</MangaDetailPage>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
@@ -13,7 +13,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
const { data: manga } = useApi('/v2/Manga/Downloading');
|
const { data: manga } = useApi('/v2/Manga');
|
||||||
const expanded = ref(-1);
|
const expanded = ref(-1);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
29
website/app/pages/manga/[mangaId]/merge/[targetId].vue
Normal file
29
website/app/pages/manga/[mangaId]/merge/[targetId].vue
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
<template>
|
||||||
|
<UPageBody class="flex flex-col items-center">
|
||||||
|
<UButton
|
||||||
|
icon="i-lucide-arrow-left"
|
||||||
|
class="w-fit self-start m-20"
|
||||||
|
variant="soft"
|
||||||
|
:to="`/manga/${mangaId}/merge/`"
|
||||||
|
>Back</UButton
|
||||||
|
>
|
||||||
|
<div class="flex flex-row justify-evenly items-center">
|
||||||
|
<MangaCard v-if="manga" :manga="manga" :expanded="true" />
|
||||||
|
<USkeleton v-else class="max-w-[600px] w-full h-[350px]" />
|
||||||
|
<UIcon name="i-lucide-merge" class="rotate-90 px-20" size="50" />
|
||||||
|
<MangaCard v-if="target" :manga="target" :expanded="true" />
|
||||||
|
<USkeleton v-else class="max-w-[600px] w-full h-[350px]" />
|
||||||
|
</div>
|
||||||
|
<p>This action is irreversible!</p>
|
||||||
|
<UButton color="warning" class="w-fit">Merge</UButton>
|
||||||
|
</UPageBody>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
const route = useRoute();
|
||||||
|
const targetId = route.params.targetId as string;
|
||||||
|
const mangaId = route.params.mangaId as string;
|
||||||
|
|
||||||
|
const { data: target } = useApi('/v2/Manga/{MangaId}', { path: { MangaId: targetId } });
|
||||||
|
const { data: manga } = useApi('/v2/Manga/{MangaId}', { path: { MangaId: mangaId } });
|
||||||
|
</script>
|
15
website/app/pages/manga/[mangaId]/merge/index.vue
Normal file
15
website/app/pages/manga/[mangaId]/merge/index.vue
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
<template>
|
||||||
|
<UPageHeader class="text-3xl px-4">Merge <span v-if="manga">{{ manga.name }}</span><USkeleton v-else as="span" class="w-60 h-lh"></USkeleton> into</UPageHeader>
|
||||||
|
<UPageBody class="p-4 flex flex-row flex-wrap gap-6 mt-0">
|
||||||
|
<NuxtLink v-for="m in mangas" :to="`${m.key}`">
|
||||||
|
<MangaCard :manga="m" />
|
||||||
|
</NuxtLink>
|
||||||
|
</UPageBody>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
const route = useRoute();
|
||||||
|
|
||||||
|
const { data: manga } = useApi('/v2/Manga/{MangaId}', { path: { MangaId: route.params.mangaId as string } });
|
||||||
|
const { data: mangas } = useApi('/v2/Manga');
|
||||||
|
</script>
|
@@ -98,7 +98,7 @@ const search = async (query: string): Promise<MinimalManga[]> => {
|
|||||||
return await $fetch<MinimalManga>(new Request(`${config.public.openFetch.api.baseURL}v2/Search/Url`), {
|
return await $fetch<MinimalManga>(new Request(`${config.public.openFetch.api.baseURL}v2/Search/Url`), {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
body: JSON.stringify(query),
|
body: JSON.stringify(query),
|
||||||
}).then(x => [x]);
|
}).then((x) => [x]);
|
||||||
} else if (connector.value) {
|
} else if (connector.value) {
|
||||||
return await $fetch<MinimalManga[]>(
|
return await $fetch<MinimalManga[]>(
|
||||||
new Request(`${config.public.openFetch.api.baseURL}v2/Search/${connector.value.name}/${query}`)
|
new Request(`${config.public.openFetch.api.baseURL}v2/Search/${connector.value.name}/${query}`)
|
||||||
|
Reference in New Issue
Block a user