Skip to content

Commit

Permalink
Merge pull request #121 from Suwayomi/main
Browse files Browse the repository at this point in the history
nginx test
  • Loading branch information
Robonau authored Dec 26, 2023
2 parents 9c39730 + 987def1 commit 679f399
Show file tree
Hide file tree
Showing 15 changed files with 31 additions and 37 deletions.
4 changes: 2 additions & 2 deletions default.conf
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ server {
try_files $uri /index.html =404;
}
location /api {
resolver 127.0.0.11 valid=30s;
resolver 127.0.0.11 172.17.0.10 kube-dns.kube-system.svc.cluster.local valid=30s;
set $upstreame PLACEHOLDER;
proxy_pass $upstreame;
proxy_http_version 1.1;
Expand All @@ -16,7 +16,7 @@ server {
}

location /v1 {
resolver 8.8.8.8 valid=30s ipv6=off;
resolver 127.0.0.11 172.17.0.10 kube-dns.kube-system.svc.cluster.local 8.8.8.8 valid=30s ipv6=off;
set $upstreame https://api.mangaupdates.com;
proxy_pass $upstreame;
proxy_http_version 1.1;
Expand Down
4 changes: 2 additions & 2 deletions schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,7 @@ type Mutation {
updateExtension(input: UpdateExtensionInput!): UpdateExtensionPayload!
updateExtensions(input: UpdateExtensionsInput!): UpdateExtensionsPayload!
clearCachedImages(input: ClearCachedImagesInput!): ClearCachedImagesPayload!
resetWebUIUpdateStatus: WebUIUpdateStatus!
updateWebUI(input: WebUIUpdateInput!): WebUIUpdatePayload!
deleteMangaMeta(input: DeleteMangaMetaInput!): DeleteMangaMetaPayload!
fetchManga(input: FetchMangaInput!): FetchMangaPayload!
Expand Down Expand Up @@ -694,7 +695,6 @@ type WebUIUpdateCheck {
type WebUIUpdateInfo {
channel: String!
tag: String!
updateAvailable: Boolean!
}
type WebUIUpdatePayload {
clientMutationId: String
Expand Down Expand Up @@ -847,7 +847,7 @@ enum TriState {
EXCLUDE
}
enum UpdateState {
STOPPED
IDLE
DOWNLOADING
FINISHED
ERROR
Expand Down
14 changes: 6 additions & 8 deletions src/lib/MountTitleAction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,26 @@
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.

import { afterUpdate, onDestroy } from 'svelte';
import { onDestroy } from 'svelte';
import type { ComponentType, ComponentProps } from 'svelte';
import { readonly, writable, type Writable } from 'svelte/store';
import { readonly, writable } from 'svelte/store';

type actionStoreT<T extends ComponentType = ComponentType> = {
component: T;
props?: ComponentProps<InstanceType<T>>;
};

// i dont really like that i cant type this nicely, AppBarData is typed good though
const actionStore: Writable<actionStoreT | null> = writable(null);
const actionStore = writable<actionStoreT | null>(null);

const titleStore: Writable<string> = writable('loading...');
const titleStore = writable<string>('Loading...');

export const action = readonly(actionStore);
export const title = readonly(titleStore);

export function AppBarData<T extends ComponentType>(title: string, action?: actionStoreT<T>) {
afterUpdate(() => {
if (action) actionStore.set(action);
titleStore.set(title);
});
if (action) actionStore.set(action);
titleStore.set(title);
onDestroy(() => {
actionStore.set(null);
titleStore.set('Loading...');
Expand Down
4 changes: 2 additions & 2 deletions src/lib/generated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -962,6 +962,7 @@ export type Mutation = {
installExternalExtension: InstallExternalExtensionPayload;
reorderChapterDownload: ReorderChapterDownloadPayload;
resetSettings: ResetSettingsPayload;
resetWebUIUpdateStatus: WebUiUpdateStatus;
restoreBackup: RestoreBackupPayload;
setCategoryMeta: SetCategoryMetaPayload;
setChapterMeta: SetChapterMetaPayload;
Expand Down Expand Up @@ -2027,7 +2028,7 @@ export enum UpdateState {
Downloading = 'DOWNLOADING',
Error = 'ERROR',
Finished = 'FINISHED',
Stopped = 'STOPPED'
Idle = 'IDLE'
}

export type UpdateStatus = {
Expand Down Expand Up @@ -2103,7 +2104,6 @@ export type WebUiUpdateInfo = {
__typename?: 'WebUIUpdateInfo';
channel: Scalars['String']['output'];
tag: Scalars['String']['output'];
updateAvailable: Scalars['Boolean']['output'];
};

export type WebUiUpdateInput = {
Expand Down
4 changes: 2 additions & 2 deletions src/routes/(app)/(library)/LibraryStores.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

import type { CategoryQuery } from '$lib/generated';
// import { localStorageStore } from '@skeletonlabs/skeleton';
import { writable, type Writable } from 'svelte/store';
import { writable } from 'svelte/store';

export type MangaType = NonNullable<CategoryQuery['category']>['mangas']['nodes'][0];
export const selected: Writable<MangaType[]> = writable([]);
export const selected = writable<MangaType[]>([]);
export const selectMode = writable(false);
5 changes: 2 additions & 3 deletions src/routes/(app)/browse/BrowseStores.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,16 @@

import { localStorageStore } from '@skeletonlabs/skeleton';
import * as devalue from 'devalue';
import type { Writable } from 'svelte/store';

export const langFilter: Writable<Set<string>> = localStorageStore(
export const langFilter = localStorageStore<Set<string>>(
'Global/MigrateLangfilt',
new Set(['all']),
{
serializer: devalue
}
);

export const SpecificSourceFilter: Writable<Set<string>> = localStorageStore(
export const SpecificSourceFilter = localStorageStore<Set<string>>(
'Global/MigrateSpecificSourceFilter',
new Set([]),
{
Expand Down
5 changes: 2 additions & 3 deletions src/routes/(app)/browse/extensions/ExtensionsStores.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,12 @@

import { localStorageStore } from '@skeletonlabs/skeleton';
import * as devalue from 'devalue';
import type { Writable } from 'svelte/store';

export const lastFetched: Writable<Date> = localStorageStore('lastFetchedExtensions', new Date(0), {
export const lastFetched = localStorageStore<Date>('lastFetchedExtensions', new Date(0), {
serializer: devalue
});

export const langFilter: Writable<Set<string>> = localStorageStore(
export const langFilter = localStorageStore<Set<string>>(
'ExtensionsLangFilter',
new Set(['all', 'en']),
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
export let langs: Set<string>;
export let langFilter: Writable<Set<string>>;
export let rawSources: SourcesQuery['sources'] | undefined;
const tabSet: Writable<number> = localStorageStore('browseTabSet', 0);
const tabSet = localStorageStore<number>('browseTabSet', 0);
$: LangFilteredSources = rawSources?.nodes.filter((source) => {
if (!$langFilter.has(source.lang)) return false;
Expand Down
4 changes: 2 additions & 2 deletions src/routes/(app)/browse/source/[sourceID]/filter/stores.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// file, You can obtain one at http://mozilla.org/MPL/2.0/.

import type { FilterChangeInput } from '$lib/generated';
import { type Writable, writable } from 'svelte/store';
import { writable } from 'svelte/store';

export const filters: Writable<FilterChangeInput[]> = writable([]);
export const filters = writable<FilterChangeInput[]>([]);
export const filtersSause = writable('');
3 changes: 1 addition & 2 deletions src/routes/(app)/browse/sources/SourcesStores.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@
// file, You can obtain one at http://mozilla.org/MPL/2.0/.

import { localStorageStore } from '@skeletonlabs/skeleton';
import type { Writable } from 'svelte/store';
import * as devalue from 'devalue';

export const SourceLangFilter: Writable<Set<string>> = localStorageStore(
export const SourceLangFilter = localStorageStore<Set<string>>(
'SourceLangFilter',
new Set(['all', 'localsourcelang']),
{
Expand Down
3 changes: 1 addition & 2 deletions src/routes/(app)/downloads/downloadsStores.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@

import { localStorageStore } from '@skeletonlabs/skeleton';
import * as devalue from 'devalue';
import type { Writable } from 'svelte/store';

export type Filter = 'QUEUED' | 'DOWNLOADING' | 'FINISHED' | 'ERROR';

export const filter: Writable<Set<Filter>> = localStorageStore('Downlaodsfilter', new Set([]), {
export const filter = localStorageStore<Set<Filter>>('Downlaodsfilter', new Set([]), {
serializer: devalue
});
4 changes: 2 additions & 2 deletions src/routes/(app)/manga/[MangaID]/(manga)/mangaStores.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@

import type { GetMangaQuery } from '$lib/generated';
// import { localStorageStore } from "@skeletonlabs/skeleton";
import { writable, type Writable } from 'svelte/store';
import { writable } from 'svelte/store';

export type chaptertype = GetMangaQuery['manga']['chapters']['nodes'][0];

export const selectMode = writable(false);
export const selected: Writable<chaptertype[]> = writable([]);
export const selected = writable<chaptertype[]>([]);
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
// file, You can obtain one at http://mozilla.org/MPL/2.0/.

// import { localStorageStore } from "@skeletonlabs/skeleton";
import { writable, type Writable } from 'svelte/store';
import { writable } from 'svelte/store';

export const mangaTitle = writable('');
export const chapterTitle = writable('');
export const ViewNav: Writable<boolean> = writable(false);
export const ViewNav = writable<boolean>(false);
4 changes: 2 additions & 2 deletions src/routes/(app)/updates/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import UpdatesActions from './UpdatesActions.svelte';
import { AppBarData } from '$lib/MountTitleAction';
import { updates, type UpdatesQuery } from '$lib/generated';
import { writable, type Writable } from 'svelte/store';
import { writable } from 'svelte/store';
import MangaCard from '$lib/components/MangaCard.svelte';
import { longPress } from '$lib/press';
import { selectMode, selected } from './UpdatesStores';
Expand All @@ -30,7 +30,7 @@
});
let page = writable(0);
let all: Writable<UpdatesQuery['chapters'] | null> = writable(null);
let all = writable<UpdatesQuery['chapters'] | null>(null);
$: update = updates({ variables: { offset: $page } });
$: $update, updateall();
function updateall() {
Expand Down
4 changes: 2 additions & 2 deletions src/routes/(app)/updates/UpdatesStores.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.

import { type Writable, writable } from 'svelte/store';
import { writable } from 'svelte/store';
import type { UpdatesQuery } from '$lib/generated';

export type UpdateNode = UpdatesQuery['chapters']['nodes'][0];

export const selected: Writable<UpdateNode[]> = writable([]);
export const selected = writable<UpdateNode[]>([]);
export const selectMode = writable(false);

0 comments on commit 679f399

Please sign in to comment.