mirror of
https://github.com/C9Glax/tranga-website.git
synced 2025-10-15 09:50:48 +02:00
Settings add API Url field
This commit is contained in:
@@ -14,7 +14,7 @@
|
|||||||
author.name
|
author.name
|
||||||
}}</UBadge>
|
}}</UBadge>
|
||||||
<UBadge v-for="tag in manga.tags" :key="tag" variant="outline">{{ tag }}</UBadge>
|
<UBadge v-for="tag in manga.tags" :key="tag" variant="outline">{{ tag }}</UBadge>
|
||||||
<NuxtLink v-for="link in manga.links" :key="link.key" :to="link.url" external noPrefetch>
|
<NuxtLink v-for="link in manga.links" :key="link.key" :to="link.url" external no-prefetch>
|
||||||
<UBadge variant="outline" color="warning">{{ link.provider }}</UBadge>
|
<UBadge variant="outline" color="warning">{{ link.provider }}</UBadge>
|
||||||
</NuxtLink>
|
</NuxtLink>
|
||||||
</div>
|
</div>
|
||||||
|
@@ -1,18 +1,33 @@
|
|||||||
<template>
|
<template>
|
||||||
<UPageBody>
|
<UPageBody>
|
||||||
<UPageSection title="Settings" />
|
<UPageSection title="Settings">
|
||||||
<UPageSection title="Libraries" orientation="horizontal">
|
<UCard>
|
||||||
|
<template #header>
|
||||||
|
<h1>Libraries</h1>
|
||||||
|
</template>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<UButton icon="i-lucide-plus" class="w-fit" @click="addLibraryModal.open()">Add</UButton>
|
<UButton icon="i-lucide-plus" class="w-fit" @click="addLibraryModal.open()">Add</UButton>
|
||||||
</template>
|
</template>
|
||||||
<FileLibraries />
|
<FileLibraries />
|
||||||
</UPageSection>
|
</UCard>
|
||||||
<UPageSection title="Maintenance" orientation="horizontal">
|
<UCard>
|
||||||
|
<template #header>
|
||||||
|
<h1>Maintenance</h1>
|
||||||
|
</template>
|
||||||
<div class="flex flex-col gap-1 items-end basis-1">
|
<div class="flex flex-col gap-1 items-end basis-1">
|
||||||
<UButton icon="i-lucide-database" :loading="cleanUpDatabaseBusy" class="w-fit" @click="cleanUpDatabase"
|
<UButton
|
||||||
|
icon="i-lucide-database"
|
||||||
|
:loading="cleanUpDatabaseBusy"
|
||||||
|
class="w-fit"
|
||||||
|
@click="cleanUpDatabase"
|
||||||
>Clean database</UButton
|
>Clean database</UButton
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
|
<UFormField label="API Url" name="apiUrl">
|
||||||
|
<UInput v-model="apiUrl" class="max-w-full w-lg" placeholder="http://<ip:port>/" />
|
||||||
|
<UButton :loading="reloading" class="mx-1" @click="setUrl">Set</UButton>
|
||||||
|
</UFormField>
|
||||||
|
</UCard>
|
||||||
</UPageSection>
|
</UPageSection>
|
||||||
</UPageBody>
|
</UPageBody>
|
||||||
</template>
|
</template>
|
||||||
@@ -25,6 +40,16 @@ const overlay = useOverlay();
|
|||||||
|
|
||||||
const addLibraryModal = overlay.create(LazyAddLibraryModal);
|
const addLibraryModal = overlay.create(LazyAddLibraryModal);
|
||||||
|
|
||||||
|
const config = useRuntimeConfig();
|
||||||
|
const apiUrl = ref(config.public.openFetch.api.baseURL);
|
||||||
|
const reloading = ref(false);
|
||||||
|
const setUrl = async () => {
|
||||||
|
reloading.value = true;
|
||||||
|
config.public.openFetch.api.baseURL = apiUrl.value;
|
||||||
|
await refreshNuxtData();
|
||||||
|
reloading.value = false;
|
||||||
|
};
|
||||||
|
|
||||||
const cleanUpDatabaseBusy = ref(false);
|
const cleanUpDatabaseBusy = ref(false);
|
||||||
const cleanUpDatabase = async () => {
|
const cleanUpDatabase = async () => {
|
||||||
cleanUpDatabaseBusy.value = true;
|
cleanUpDatabaseBusy.value = true;
|
||||||
|
Reference in New Issue
Block a user