feat/admin #33
@ -117,6 +117,7 @@ export interface ContentProviderDTO {
|
|||||||
name: string;
|
name: string;
|
||||||
url?: string;
|
url?: string;
|
||||||
active?: boolean;
|
active?: boolean;
|
||||||
|
supportsContentFetch?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface ContentProviderListDTO {
|
export interface ContentProviderListDTO {
|
||||||
@ -214,9 +215,9 @@ export interface PageMangaImportJobDTO {
|
|||||||
number?: number;
|
number?: number;
|
||||||
pageable?: PageableObject;
|
pageable?: PageableObject;
|
||||||
numberOfElements?: number;
|
numberOfElements?: number;
|
||||||
|
sort?: SortObject;
|
||||||
first?: boolean;
|
first?: boolean;
|
||||||
last?: boolean;
|
last?: boolean;
|
||||||
sort?: SortObject;
|
|
||||||
empty?: boolean;
|
empty?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -277,9 +278,9 @@ export interface PageMangaListDTO {
|
|||||||
number?: number;
|
number?: number;
|
||||||
pageable?: PageableObject;
|
pageable?: PageableObject;
|
||||||
numberOfElements?: number;
|
numberOfElements?: number;
|
||||||
|
sort?: SortObject;
|
||||||
first?: boolean;
|
first?: boolean;
|
||||||
last?: boolean;
|
last?: boolean;
|
||||||
sort?: SortObject;
|
|
||||||
empty?: boolean;
|
empty?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -7,6 +7,7 @@ import {
|
|||||||
import { Badge } from "@/components/ui/badge.tsx";
|
import { Badge } from "@/components/ui/badge.tsx";
|
||||||
import { Button } from "@/components/ui/button.tsx";
|
import { Button } from "@/components/ui/button.tsx";
|
||||||
import { Card } from "@/components/ui/card.tsx";
|
import { Card } from "@/components/ui/card.tsx";
|
||||||
|
import {toast} from "sonner";
|
||||||
|
|
||||||
export const ProviderManager = () => {
|
export const ProviderManager = () => {
|
||||||
const { data } = useGetContentProviders();
|
const { data } = useGetContentProviders();
|
||||||
@ -15,12 +16,26 @@ export const ProviderManager = () => {
|
|||||||
const {
|
const {
|
||||||
mutate: mutateFetchContentProviderMangas,
|
mutate: mutateFetchContentProviderMangas,
|
||||||
isPending: isPendingFetchContentProviderMangas,
|
isPending: isPendingFetchContentProviderMangas,
|
||||||
} = useFetchContentProviderMangas();
|
} = useFetchContentProviderMangas({
|
||||||
|
mutation: {
|
||||||
|
onSuccess: () => {
|
||||||
|
toast.success("Content Provider mangas update queued successfully!");
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
const {
|
const {
|
||||||
mutate: mutateFetchAllContentProviderMangas,
|
mutate: mutateFetchAllContentProviderMangas,
|
||||||
isPending: isPendingFetchAllContentProviderMangas,
|
isPending: isPendingFetchAllContentProviderMangas,
|
||||||
} = useFetchAllContentProviderMangas();
|
} = useFetchAllContentProviderMangas(
|
||||||
|
{
|
||||||
|
mutation: {
|
||||||
|
onSuccess: () => {
|
||||||
|
toast.success("All Content Provider mangas update queued successfully!");
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
const activeCount = providers?.filter((p) => p.active).length;
|
const activeCount = providers?.filter((p) => p.active).length;
|
||||||
|
|
||||||
@ -104,6 +119,7 @@ export const ProviderManager = () => {
|
|||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{provider.supportsContentFetch && (
|
||||||
<Button
|
<Button
|
||||||
variant="outline"
|
variant="outline"
|
||||||
size="sm"
|
size="sm"
|
||||||
@ -124,6 +140,7 @@ export const ProviderManager = () => {
|
|||||||
)}
|
)}
|
||||||
Update
|
Update
|
||||||
</Button>
|
</Button>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
</Card>
|
</Card>
|
||||||
);
|
);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user