Add about page #52 and fix changeServer

This commit is contained in:
Prayag Prajapati committed 2023-11-21 22:33:02 +05:30
1 parent 16c6a26a2e
commit 1dddbca3b2
10 files changed
+178 -140

No files matched your search

+25
View File
@@ -0,0 +1,25 @@
<svg width="5020" height="475" viewBox="0 0 5020 475" fill="none" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<path d="M184.178 464.934C154.522 464.934 126.954 458.251 101.475 444.885C75.9955 431.101 55.1108 412.305 38.8208 388.496C22.5308 364.688 12.9239 338.373 10 309.552H33.182C36.1058 334.196 44.6685 356.751 58.8701 377.218C73.0716 397.268 91.0324 413.14 112.752 424.835C134.89 436.113 158.699 441.752 184.178 441.752C212.163 441.752 237.852 434.86 261.242 421.076C284.633 407.292 303.22 388.287 317.004 364.061C330.788 339.835 337.68 312.685 337.68 282.611V42.6462H142.2V19.4642H360.236V282.611C360.236 316.862 352.299 347.98 336.427 375.965C320.972 403.533 299.67 425.253 272.52 441.125C245.788 456.998 216.34 464.934 184.178 464.934Z" fill="black"/>
<path d="M984.562 455.536V19.4642H1007.74V432.354H1311.62V455.536H984.562Z" fill="black"/>
<path d="M1448.35 455.536V19.4642H1471.53V432.354H1775.4V455.536H1448.35Z" fill="black"/>
<path d="M2389.08 455.536H2365.9V19.4642H2541.33C2570.57 19.4642 2597.51 25.7296 2622.15 38.2604C2647.21 50.7912 2667.05 68.5432 2681.67 91.5163C2696.29 114.489 2703.6 141.013 2703.6 171.087C2703.6 199.908 2696.08 226.431 2681.05 250.657C2666.43 274.883 2646.38 293.471 2620.9 306.419C2598.76 317.697 2572.24 323.336 2541.33 323.336H2389.08V455.536ZM2389.08 300.154H2541.33C2568.06 300.154 2589.99 295.977 2607.11 287.623C2629.25 277.181 2647 261.517 2660.37 240.633C2673.74 219.748 2680.42 196.566 2680.42 171.087C2680.42 146.025 2673.74 123.052 2660.37 102.167C2647 81.2828 2629.04 65.6193 2606.49 55.177C2589.36 46.8231 2567.64 42.6462 2541.33 42.6462H2389.08V300.154Z" fill="black"/>
<path d="M2839.71 455.536V19.4642H2862.89V432.354H3166.76V455.536H2839.71Z" fill="black"/>
<path d="M3747.86 19.4642L3902.61 252.537L4056.11 19.4642H4083.68L3913.89 276.972V455.536H3890.71V276.972L3720.29 19.4642H3747.86Z" fill="black"/>
<path d="M4215.4 19.4642H4522.41V42.6462H4238.58V219.33H4485.44V242.512H4238.58V432.354H4522.41V455.536H4215.4V19.4642Z" fill="black"/>
<path d="M2200.97 19.4642H2228.54L2058.74 276.972V455.536H2035.56V276.972L1865.14 19.4642H1892.71L2047.47 252.537L2200.97 19.4642Z" fill="black"/>
<path d="M505.113 19.4642H812.117V42.6462H528.295V219.33H775.152V242.512H528.295V432.354H812.117V455.536H505.113V19.4642Z" fill="black"/>
<mask id="mask0_941_19" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="3232" y="10" width="1778" height="446">
<path d="M4924.16 33.8748C4949.23 45.5702 4968.86 62.9044 4983.06 85.8775C4997.68 108.851 5004.99 134.33 5004.99 162.315C5004.99 194.895 4994.96 224.134 4974.91 250.031C4955.28 275.51 4924.58 295.842 4893.67 304.196L4674.8 19.4644H4840.83C4859.21 19.4644 4874.88 20.7174 4887.83 23.2236C4901.19 25.312 4913.3 28.8624 4924.16 33.8748Z" fill="black"/>
<path d="M5010 455.536L4893.67 304.196H4674.8V455.536H5010Z" fill="black"/>
<path d="M3643.7 455.536H3232.69L3438.2 10.0662L3643.7 455.536Z" fill="black"/>
</mask>
<g mask="url(#mask0_941_19)">
<rect x="3232" y="10" width="1778" height="446" fill="url(#pattern0)"/>
</g>
<defs>
<pattern id="pattern0" patternContentUnits="objectBoundingBox" width="1" height="1">
<use xlink:href="#image0_941_19" transform="matrix(0 -0.000973278 0.000244141 0 0 2.49327)"/>
</pattern>
<image id="image0_941_19" width="4096" height="4096" xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAEAAAABAACAYAAADyoyQXAAAACXBIWXMAAAsTAAALEwEAm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B9XYUZLWhK7K0LQXxwzAzk3WYWcYx611iDWZGljAjc3InYVot6xG/V76zFs8MYlLXKdEnK/eZyH3OMR7Rmo3EG5kX3YeXTbQPEw0SJyX98nw0hlmrEBfplQWJAbQ+wKcmetMGxdIBqV8Z2Deel6CkPNtXG5LPj+VLedpIfhpWpW9wcK62j8QB9aGGm2Rbjf05aK9V93K3eLY3KOikDEzyzRmybxFBuKCeCO1W/QL+0qZkU8enRpM5JdYxWgbt2s038Mi6RP1Yh/gqMnrzhArzdeMQ8cJ/yvVMRT5JG381Wn2Tt/KswbmH/nnEGT81K/+N/K5nHm+PW/4t5vv4p0RyLIl/Od8l/7LeebyscqL/7BZsHTDB2jqK+hkZzWVHXe8q3B3Uct+51l5yrED6nMy+OJ7N5fpa7Iv4yXn1Yl/J7VN1WB13Nd7qmszgMTj2yCOefMvrs0ceuaucJxjuICKXu5BbJGlQ9/tkdefdqZNlGWM4m5fmj4/rDCQNwnflXF2DLine truncated
</defs>
</svg>

After

Width:  |  Height:  |  Size: 3.7 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 89 KiB

+5 -10
View File
@@ -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 = () => {
</ListItemIcon>
Settings
</MenuItem>
<MenuItem
onClick={() => navigate("/about")}
disabled
>
<MenuItem onClick={() => navigate("/about")}>
<ListItemIcon>
<div className="material-symbols-rounded">
info
@@ -218,17 +215,15 @@ export const AppBar = () => {
</MenuItem>
<MenuItem
onClick={async () => {
await delServer();
await delUser();
await relaunch();
navigate("/servers/list");
}}
>
<ListItemIcon>
<div className="material-symbols-rounded appBar-icon">
delete
dns
</div>
</ListItemIcon>
Remove Server
Select Server
</MenuItem>
</Menu>
</Toolbar>
+3 -1
View File
@@ -67,7 +67,9 @@ export const getTypeIcon = (icon) => {
return <div className="material-symbols-rounded">mic</div>;
case BaseItemKind.AudioBook:
return (
<div className="material-symbols-rounded">library_book</div>
<div className="material-symbols-rounded">
speech_to_text
</div>
);
case BaseItemKind.Book:
return <div className="material-symbols-rounded">book</div>;
+1
View File
@@ -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
+20 -5
View File
@@ -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;
}
}
+116 -119
View File
@@ -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 (
<div
style={{
position: "fixed",
top: "50%",
left: "50%",
transform: "translate(-50%, -50%)",
}}
>
<CircularProgress size={72} thickness={1.4} />
</div>
);
}
return (
<Box
component="main"
className="scrollY"
sx={{
flexGrow: 1,
pt: 11,
px: 3,
pb: 3,
position: "relative",
}}
>
<main className="scrollY about">
<Stack
alignItems="center"
justifyContent="center"
className="about-sections"
className="about-section monospace"
width="75%"
>
<Link
<a
href="https://github.com/prayag17/JellyPlayer"
className="about-logo"
target="_blank"
rel="noreferrer"
>
<img width="100%" height="100%" src={logo} />
</Link>
<TableContainer
component={Paper}
sx={{ width: "50%", borderRadius: "15px" }}
</a>
<div
style={{
display: "flex",
flexDirection: "column",
opacity: 0.9,
}}
>
<Table>
<TableBody>
<TableRow
sx={{
"&:last-child td, &:last-child th":
{
border: 0,
},
"&:hover": {
background:
"rgb(255 255 255 / 0.05)",
},
}}
>
<TableCell>
<Typography
variant="h4"
fontWeight={100}
>
Version
</Typography>
</TableCell>
<TableCell>
<Typography
variant="h4"
sx={{ opacity: 0.7 }}
>
{version}
</Typography>
</TableCell>
</TableRow>
<TableRow
sx={{
"&:last-child td, &:last-child th":
{
border: 0,
},
"&:hover": {
background:
"rgb(255 255 255 / 0.05)",
},
}}
>
<TableCell>
<Typography
variant="h4"
fontWeight={100}
>
Jellyfin Version
</Typography>
</TableCell>
<TableCell>
<Typography
variant="h4"
sx={{ opacity: 0.7 }}
>
{systemInfo.isSuccess &&
systemInfo.data.Version}
</Typography>
</TableCell>
</TableRow>
<TableRow
sx={{
"&:last-child td, &:last-child th":
{
border: 0,
},
"&:hover": {
background:
"rgb(255 255 255 / 0.05)",
},
}}
>
<TableCell>
<Typography
variant="h4"
fontWeight={100}
>
Server OS
</Typography>
</TableCell>
<TableCell>
<Typography
variant="h4"
sx={{ opacity: 0.7 }}
>
{systemInfo.isSuccess &&
systemInfo.data
.OperatingSystemDisplayName}
</Typography>
</TableCell>
</TableRow>
</TableBody>
</Table>
</TableContainer>
<div className="about-grid">
<Typography variant="h6" fontWeight={300}>
Server
</Typography>
<Typography
variant="h6"
fontWeight={300}
sx={{
opacity: 0.7,
}}
>
{systemInfo.data.ServerName}
</Typography>
</div>
<div className="about-grid">
<Typography variant="h6" fontWeight={300}>
Server Version
</Typography>
<Typography
variant="h6"
fontWeight={300}
sx={{
opacity: 0.7,
}}
>
{systemInfo.data.Version}
</Typography>
</div>
<div className="about-grid">
<Typography variant="h6" fontWeight={300}>
Operating System
</Typography>
<Typography
variant="h6"
fontWeight={300}
sx={{
opacity: 0.7,
}}
>
{systemInfo.data.OperatingSystemDisplayName}
</Typography>
</div>
<div className="about-grid">
<Typography variant="h6" fontWeight={300}>
Architecture
</Typography>
<Typography
variant="h6"
fontWeight={300}
sx={{
opacity: 0.7,
}}
>
{systemInfo.data.SystemArchitecture}
</Typography>
</div>
<div className="about-grid">
<Typography variant="h6" fontWeight={300}>
JellyPlayer Version
</Typography>
<Typography
variant="h6"
fontWeight={300}
sx={{
opacity: 0.7,
}}
>
{applicationVersion}
</Typography>
</div>
</div>
</Stack>
</Box>
</main>
);
};
+5 -4
View File
@@ -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]);
+1
View File
@@ -31,5 +31,6 @@ const getUser = async () => {
*/
const delUser = async () => {
await user.clear();
await user.save();
};
export { saveUser, getUser, delUser };
+2 -1
View File
@@ -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,
}));
/**