feat(settings-server): Add a refretch button
This commit is contained in:
4 files changed
+89
-53
No files matched your search
+2
-1
@@ -2,4 +2,5 @@
|
|||||||
> **Note** : This is an unstable release
|
> **Note** : This is an unstable release
|
||||||
- feat(web): Add new About page (#258) by @prayag17
|
- feat(web): Add new About page (#258) by @prayag17
|
||||||
- feat(web): Allow managing servers from settings dialog by @prayag17
|
- feat(web): Allow managing servers from settings dialog by @prayag17
|
||||||
- feat(search): Add Episode to search by @prayag17
|
- feat(search): Add Episode to search by @prayag17
|
||||||
|
- feat(settings-server): Add a refretch button by @prayag17
|
||||||
@@ -8,6 +8,7 @@ import {
|
|||||||
Fab,
|
Fab,
|
||||||
FormControlLabel,
|
FormControlLabel,
|
||||||
IconButton,
|
IconButton,
|
||||||
|
LinearProgress,
|
||||||
Link,
|
Link,
|
||||||
Skeleton,
|
Skeleton,
|
||||||
Switch,
|
Switch,
|
||||||
@@ -19,7 +20,7 @@ import {
|
|||||||
withStyles,
|
withStyles,
|
||||||
} from "@mui/material";
|
} from "@mui/material";
|
||||||
import { AnimatePresence, motion, transform } from "framer-motion";
|
import { AnimatePresence, motion, transform } from "framer-motion";
|
||||||
import React, { useState } from "react";
|
import React, { useEffect, useState } from "react";
|
||||||
import useSettingsStore, {
|
import useSettingsStore, {
|
||||||
setSettingsDialogOpen,
|
setSettingsDialogOpen,
|
||||||
setSettingsTabValue,
|
setSettingsTabValue,
|
||||||
@@ -154,9 +155,12 @@ const Settings = () => {
|
|||||||
if (bestServer) {
|
if (bestServer) {
|
||||||
setServer(bestServer.systemInfo.Id, bestServer);
|
setServer(bestServer.systemInfo.Id, bestServer);
|
||||||
setAddServerDialog(false);
|
setAddServerDialog(false);
|
||||||
enqueueSnackbar("Client added successfully", {
|
enqueueSnackbar(
|
||||||
variant: "success",
|
"Client added successfully. You might need to refresh client list.",
|
||||||
});
|
{
|
||||||
|
variant: "success",
|
||||||
|
},
|
||||||
|
);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onError: (err) => {
|
onError: (err) => {
|
||||||
@@ -587,28 +591,38 @@ const Settings = () => {
|
|||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
|
<div className="settings-server-fab-container">
|
||||||
<Fab
|
<Fab
|
||||||
variant="extended"
|
onClick={() => serversOnDisk.refetch()}
|
||||||
onClick={() => setAddServerDialog(true)}
|
size="medium"
|
||||||
style={{
|
color="info"
|
||||||
position: "absolute",
|
disabled={serversOnDisk.isFetching}
|
||||||
bottom: "20px",
|
|
||||||
right: "20px",
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<span
|
|
||||||
className="material-symbols-rounded"
|
|
||||||
style={{
|
|
||||||
marginRight: "0.25em",
|
|
||||||
fontVariationSettings:
|
|
||||||
'"FILL" 1, "wght" 300, "GRAD" 25, "opsz" 40',
|
|
||||||
}}
|
|
||||||
>
|
>
|
||||||
add_circle
|
<span
|
||||||
</span>
|
className={
|
||||||
Add server
|
serversOnDisk.isFetching
|
||||||
</Fab>
|
? "material-symbols-rounded animate-rotate"
|
||||||
|
: "material-symbols-rounded"
|
||||||
|
}
|
||||||
|
>
|
||||||
|
autorenew
|
||||||
|
</span>
|
||||||
|
</Fab>
|
||||||
|
<Fab
|
||||||
|
variant="extended"
|
||||||
|
onClick={() => setAddServerDialog(true)}
|
||||||
|
>
|
||||||
|
<span
|
||||||
|
className="material-symbols-rounded fill"
|
||||||
|
style={{
|
||||||
|
marginRight: "0.25em",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
add_circle
|
||||||
|
</span>
|
||||||
|
Add server
|
||||||
|
</Fab>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
& .material-symbols-rounded{
|
& .material-symbols-rounded{
|
||||||
justify-self: center !important;
|
justify-self: center !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
&-scroll{
|
&-scroll{
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
@@ -80,7 +80,7 @@
|
|||||||
padding: 0 !important;
|
padding: 0 !important;
|
||||||
margin: 0 0 0.4em 0!important;
|
margin: 0 0 0.4em 0!important;
|
||||||
}
|
}
|
||||||
|
|
||||||
//serverList
|
//serverList
|
||||||
&-server{
|
&-server{
|
||||||
&-container{
|
&-container{
|
||||||
@@ -90,40 +90,49 @@
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
padding-bottom: 4.6em;
|
padding-bottom: 4.6em;
|
||||||
}
|
}
|
||||||
|
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: 3.4em 1fr auto;
|
grid-template-columns: 3.4em 1fr auto;
|
||||||
justify-items: start;
|
justify-items: start;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 0.8em;
|
gap: 0.8em;
|
||||||
background: rgb(0 0 0 / 0.3);
|
background: rgb(0 0 0 / 0.3);
|
||||||
padding: 1em;
|
padding: 1em;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
border-radius: $border-radius-default;
|
border-radius: $border-radius-default;
|
||||||
|
|
||||||
&-icon {
|
&-icon {
|
||||||
font-size: 3.4em !important;
|
font-size: 3.4em !important;
|
||||||
font-variation-settings: "FILL" 1, "wght" 500, "GRAD" 10, "opsz" 40;
|
font-variation-settings: "FILL" 1, "wght" 500, "GRAD" 10, "opsz" 40;
|
||||||
|
}
|
||||||
}
|
&-info {
|
||||||
&-info {
|
display: flex;
|
||||||
display: flex;
|
flex-direction: column;
|
||||||
flex-direction: column;
|
// width: 100%;
|
||||||
// width: 100%;
|
|
||||||
&-version {
|
&-version {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap:0.4em;
|
gap:0.4em;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
&-buttons {
|
&-buttons {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
gap: 0.5em;
|
gap: 0.5em;
|
||||||
// width: 100%;
|
// width: 100%;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&-fab-container {
|
||||||
|
display: flex;
|
||||||
|
position: absolute;
|
||||||
|
bottom: 14px;
|
||||||
|
right: 14px;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
gap: 0.8em;
|
||||||
|
}
|
||||||
|
|
||||||
// Dialog
|
// Dialog
|
||||||
&-add {
|
&-add {
|
||||||
display: flex;
|
display: flex;
|
||||||
@@ -135,6 +144,5 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.Mui-selected .material-symbols-rounded{
|
.Mui-selected .material-symbols-rounded{
|
||||||
font-variation-settings: "FILL" 1, "wght" 300, "GRAD" 25, "opsz" 40;
|
font-variation-settings: "FILL" 1, "wght" 300, "GRAD" 25, "opsz" 40;
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -199,6 +199,19 @@ h1 {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.animate-rotate{
|
||||||
|
animation: rotation linear 1s infinite;
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes rotation {
|
||||||
|
0%{
|
||||||
|
transform: rotate(0deg);
|
||||||
|
}
|
||||||
|
100%{
|
||||||
|
transform: rotate(360deg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@keyframes iconAnimation {
|
@keyframes iconAnimation {
|
||||||
0% {
|
0% {
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
|
|||||||
Reference in new issue
Block a user