feat(settings-server): Add a refretch button
This commit is contained in:
4 files changed
+50
-14
No files matched your search
@@ -3,3 +3,4 @@
|
||||
- feat(web): Add new About page (#258) by @prayag17
|
||||
- feat(web): Allow managing servers from settings dialog 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,
|
||||
FormControlLabel,
|
||||
IconButton,
|
||||
LinearProgress,
|
||||
Link,
|
||||
Skeleton,
|
||||
Switch,
|
||||
@@ -19,7 +20,7 @@ import {
|
||||
withStyles,
|
||||
} from "@mui/material";
|
||||
import { AnimatePresence, motion, transform } from "framer-motion";
|
||||
import React, { useState } from "react";
|
||||
import React, { useEffect, useState } from "react";
|
||||
import useSettingsStore, {
|
||||
setSettingsDialogOpen,
|
||||
setSettingsTabValue,
|
||||
@@ -154,9 +155,12 @@ const Settings = () => {
|
||||
if (bestServer) {
|
||||
setServer(bestServer.systemInfo.Id, bestServer);
|
||||
setAddServerDialog(false);
|
||||
enqueueSnackbar("Client added successfully", {
|
||||
enqueueSnackbar(
|
||||
"Client added successfully. You might need to refresh client list.",
|
||||
{
|
||||
variant: "success",
|
||||
});
|
||||
},
|
||||
);
|
||||
}
|
||||
},
|
||||
onError: (err) => {
|
||||
@@ -587,22 +591,31 @@ const Settings = () => {
|
||||
</div>
|
||||
);
|
||||
})}
|
||||
|
||||
<div className="settings-server-fab-container">
|
||||
<Fab
|
||||
onClick={() => serversOnDisk.refetch()}
|
||||
size="medium"
|
||||
color="info"
|
||||
disabled={serversOnDisk.isFetching}
|
||||
>
|
||||
<span
|
||||
className={
|
||||
serversOnDisk.isFetching
|
||||
? "material-symbols-rounded animate-rotate"
|
||||
: "material-symbols-rounded"
|
||||
}
|
||||
>
|
||||
autorenew
|
||||
</span>
|
||||
</Fab>
|
||||
<Fab
|
||||
variant="extended"
|
||||
onClick={() => setAddServerDialog(true)}
|
||||
style={{
|
||||
position: "absolute",
|
||||
bottom: "20px",
|
||||
right: "20px",
|
||||
}}
|
||||
>
|
||||
<span
|
||||
className="material-symbols-rounded"
|
||||
className="material-symbols-rounded fill"
|
||||
style={{
|
||||
marginRight: "0.25em",
|
||||
fontVariationSettings:
|
||||
'"FILL" 1, "wght" 300, "GRAD" 25, "opsz" 40',
|
||||
}}
|
||||
>
|
||||
add_circle
|
||||
@@ -610,6 +623,7 @@ const Settings = () => {
|
||||
Add server
|
||||
</Fab>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* About */}
|
||||
|
||||
@@ -104,7 +104,6 @@
|
||||
&-icon {
|
||||
font-size: 3.4em !important;
|
||||
font-variation-settings: "FILL" 1, "wght" 500, "GRAD" 10, "opsz" 40;
|
||||
|
||||
}
|
||||
&-info {
|
||||
display: flex;
|
||||
@@ -124,6 +123,16 @@
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
&-fab-container {
|
||||
display: flex;
|
||||
position: absolute;
|
||||
bottom: 14px;
|
||||
right: 14px;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 0.8em;
|
||||
}
|
||||
|
||||
// Dialog
|
||||
&-add {
|
||||
display: flex;
|
||||
@@ -136,5 +145,4 @@
|
||||
|
||||
.Mui-selected .material-symbols-rounded{
|
||||
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 {
|
||||
0% {
|
||||
opacity: 1;
|
||||
|
||||
Reference in new issue
Block a user