feat: add new about page
This commit is contained in:
9 files changed
+238
-48
No files matched your search
@@ -0,0 +1,21 @@
|
||||
import type { Api } from "@jellyfin/sdk";
|
||||
import { getSystemApi } from "@jellyfin/sdk/lib/utils/api/system-api";
|
||||
import { queryOptions } from "@tanstack/react-query";
|
||||
import { check } from "@tauri-apps/plugin-updater";
|
||||
|
||||
export const getSystemInfoQueryOptions = (api: Api | null | undefined) =>
|
||||
queryOptions({
|
||||
queryKey: ["about", "serverInfo"],
|
||||
queryFn: async () => {
|
||||
if (!api) {
|
||||
throw Error("API is not defined");
|
||||
}
|
||||
const result = await getSystemApi(api).getSystemInfo();
|
||||
return result.data;
|
||||
},
|
||||
});
|
||||
|
||||
export const getUpdateQueryOptions = queryOptions({
|
||||
queryKey: ["about", "checkForUpdates"],
|
||||
queryFn: async () => await check(),
|
||||
});
|
||||
Reference in new issue
Block a user