diff --git a/src/assets/logoBlack.svg b/src/assets/logoBlack.svg new file mode 100644 index 0000000..ce9c433 --- /dev/null +++ b/src/assets/logoBlack.svg @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/assets/splashBg.png b/src/assets/splashBg.png new file mode 100644 index 0000000..d1e1047 Binary files /dev/null and b/src/assets/splashBg.png differ diff --git a/src/components/appBar/appBar.jsx b/src/components/appBar/appBar.jsx index cf035ce..c3b4c94 100644 --- a/src/components/appBar/appBar.jsx +++ b/src/components/appBar/appBar.jsx @@ -12,7 +12,7 @@ import Menu from "@mui/material/Menu"; import MenuItem from "@mui/material/MenuItem"; import useScrollTrigger from "@mui/material/useScrollTrigger"; -import { MdiMagnify } from "../icons/mdiMagnify"; +import { red } from "@mui/material/colors"; import { useLocation, useNavigate } from "react-router-dom"; @@ -197,10 +197,7 @@ export const AppBar = () => { Settings - navigate("/about")} - disabled - > + navigate("/about")}>
info @@ -218,17 +215,15 @@ export const AppBar = () => { { - await delServer(); - await delUser(); - await relaunch(); + navigate("/servers/list"); }} >
- delete + dns
- Remove Server + Select Server
diff --git a/src/components/utils/iconsCollection.jsx b/src/components/utils/iconsCollection.jsx index c88900c..ab134a4 100644 --- a/src/components/utils/iconsCollection.jsx +++ b/src/components/utils/iconsCollection.jsx @@ -67,7 +67,9 @@ export const getTypeIcon = (icon) => { return
mic
; case BaseItemKind.AudioBook: return ( -
library_book
+
+ speech_to_text +
); case BaseItemKind.Book: return
book
; diff --git a/src/main.jsx b/src/main.jsx index 999afad..0d606be 100644 --- a/src/main.jsx +++ b/src/main.jsx @@ -31,6 +31,7 @@ const init = async () => { const defaultServerInfo = await getServer(defaultServerOnDisk); createApi(defaultServerInfo.address); const userOnDisk = await getUser(); + console.log(userOnDisk); if (userOnDisk) { try { const auth = await useApi diff --git a/src/routes/about/about.module.scss b/src/routes/about/about.module.scss index b58660c..edf181e 100644 --- a/src/routes/about/about.module.scss +++ b/src/routes/about/about.module.scss @@ -1,16 +1,31 @@ /** @format */ .about { - &-sections { - &-container { - position: relative; + display: grid; + grid-template-columns: 1fr 1fr; + padding: 4em; + align-items: start; + &-section { + background: $clr-background-dark; + padding: 1em; + border-radius: 12px; + &.monospace * { + font-family: "JetBrains Mono Variable" !important; } } &-logo { - width: 75% !important; max-width: 50vw; - height: 15em; + height: 5em; object-fit: contain; object-position: center; + margin-bottom: 1em !important; + border-bottom: 1.4px solid rgb(255 255 255 / 0.05); + } + &-grid { + display: grid; + grid-template-columns: 1fr 1fr; + width: 100%; + padding: 0.5em 0; + gap: 1em; } } diff --git a/src/routes/about/index.jsx b/src/routes/about/index.jsx index a05af7f..6ff00e8 100644 --- a/src/routes/about/index.jsx +++ b/src/routes/about/index.jsx @@ -1,10 +1,10 @@ /** @format */ -import React from "react"; +import React, { useEffect } from "react"; import Box from "@mui/material/Box"; import Typography from "@mui/material/Typography"; import Stack from "@mui/material/Stack"; import Paper from "@mui/material/Paper"; -import TableContainer from "@mui/material/TableContainer"; +import CircularProgress from "@mui/material/CircularProgress"; import Table from "@mui/material/Table"; import TableHead from "@mui/material/TableHead"; import TableRow from "@mui/material/TableRow"; @@ -13,16 +13,15 @@ import TableCell from "@mui/material/TableCell"; import Link from "@mui/material/Link"; import logo from "../../assets/logo.svg"; -import jellyfinLogo from "../../assets/jellyfinLogo.svg"; import { useQuery } from "@tanstack/react-query"; import { getSystemApi } from "@jellyfin/sdk/lib/utils/api/system-api"; -import { version } from "../../../package.json"; - import "./about.module.scss"; -import { useApi } from "../../utils/store/api"; +import { axiosClient, useApi } from "../../utils/store/api"; +import { useBackdropStore } from "../../utils/store/backdrop"; +import { useCentralStore } from "../../utils/store/central"; const About = () => { const [api] = useApi((state) => [state.api]); @@ -35,130 +34,128 @@ const About = () => { enabled: Boolean(api), }); + const [setBackdrop] = useBackdropStore((state) => [state.setBackdrop]); + const [applicationVersion] = useCentralStore((state) => [ + state.clientVersion, + ]); + + useEffect(() => { + setBackdrop("", ""); + }, []); + if (systemInfo.isPending) { + return ( +
+ +
+ ); + } return ( - +
- - - +
- - - - - - Version - - - - - {version} - - - - - - - Jellyfin Version - - - - - {systemInfo.isSuccess && - systemInfo.data.Version} - - - - - - - Server OS - - - - - {systemInfo.isSuccess && - systemInfo.data - .OperatingSystemDisplayName} - - - - -
- +
+ + Server + + + {systemInfo.data.ServerName} + +
+ +
+ + Server Version + + + {systemInfo.data.Version} + +
+ +
+ + Operating System + + + {systemInfo.data.OperatingSystemDisplayName} + +
+ +
+ + Architecture + + + {systemInfo.data.SystemArchitecture} + +
+ +
+ + JellyPlayer Version + + + {applicationVersion} + +
+
- +
); }; diff --git a/src/routes/setup/serverList/index.jsx b/src/routes/setup/serverList/index.jsx index f380124..11ae7e7 100644 --- a/src/routes/setup/serverList/index.jsx +++ b/src/routes/setup/serverList/index.jsx @@ -35,9 +35,9 @@ const ServerList = () => { queryFn: async () => await getDefaultServer(), }); const handleServerChange = useMutation({ - mutationFn: () => { - setDefaultServer(serverState); - delUser(); + mutationFn: async () => { + await delUser(); + await setDefaultServer(serverState); }, onSuccess: async () => { await relaunch(); @@ -54,8 +54,9 @@ const ServerList = () => { let tempList = servers.data.filter( (item) => item[0] != defaultServer.data && item[0] != serverId, ); - delServer(serverId).then(() => { + delServer(serverId).then(async () => { // console.log(serverId); + await delUser(); if (serverId == defaultServer.data) { if (tempList.length > 0) { setDefaultServer(tempList[0][0]); diff --git a/src/utils/storage/user.js b/src/utils/storage/user.js index 3213796..c2a0bc6 100644 --- a/src/utils/storage/user.js +++ b/src/utils/storage/user.js @@ -31,5 +31,6 @@ const getUser = async () => { */ const delUser = async () => { await user.clear(); + await user.save(); }; export { saveUser, getUser, delUser }; diff --git a/src/utils/store/central.js b/src/utils/store/central.js index 096e2a2..0ca4b4b 100644 --- a/src/utils/store/central.js +++ b/src/utils/store/central.js @@ -3,7 +3,7 @@ import { create } from "zustand"; import { getAllServer, getDefaultServer, getServer } from "../storage/servers"; import { getUser } from "../storage/user"; - +import { version } from "../../../package.json"; /** * Central Store controls the base state required by the app */ @@ -17,6 +17,7 @@ export const useCentralStore = create(() => ({ userOnDisk: async () => getUser(), /** This is the initial route that app goes to just after app startups */ initialRoute: null, + clientVersion: version, })); /**