From 14f2a4d076b96999f74979ae693ba36fb720f60c Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Thu, 2 Jun 2022 07:58:48 -0500 Subject: add visual cues when user adction is required --- src/web/src/components/App.js | 2 +- src/web/src/components/System/Info/index.js | 5 ++++- src/web/src/components/System/Shares/index.js | 18 ++++++++------- src/web/src/components/System/System.js | 32 +++++++++++++++++---------- 4 files changed, 35 insertions(+), 22 deletions(-) (limited to 'src') diff --git a/src/web/src/components/App.js b/src/web/src/components/App.js index fc3f856e..206cea34 100644 --- a/src/web/src/components/App.js +++ b/src/web/src/components/App.js @@ -203,7 +203,7 @@ class App extends Component { {server?.isConnected && disconnect()} > - Connected + Connected } {(!server?.isConnected) && connect()} diff --git a/src/web/src/components/System/Info/index.js b/src/web/src/components/System/Info/index.js index 063303ac..7068e047 100644 --- a/src/web/src/components/System/Info/index.js +++ b/src/web/src/components/System/Info/index.js @@ -21,6 +21,8 @@ const Info = ({ state }) => { }, 250); }, [state]); + const { pendingRestart } = state; + return ( <>
@@ -57,7 +59,8 @@ const Info = ({ state }) => { Restart diff --git a/src/web/src/components/System/Shares/index.js b/src/web/src/components/System/Shares/index.js index 5fe59cb2..ceb5746c 100644 --- a/src/web/src/components/System/Shares/index.js +++ b/src/web/src/components/System/Shares/index.js @@ -22,17 +22,18 @@ const Index = ({ state = {} } = {}) => { const [shares, setShares] = useState([]); const [modal, setModal] = useState(false); - const { filling, filled, fillProgress } = state; + const { scanning, scanProgress, scanPending } = state; + const scanned = !scanning; useEffect(() => { getAll(); }, []); useEffect(() => { - if (filled) { + if (scanned) { getAll(); } - }, [filled]); + }, [scanned]); const getAll = async () => { try { @@ -53,17 +54,18 @@ const Index = ({ state = {} } = {}) => { <>
sharesLib.rescan()} - >{filling ? 'Scanning shares' : 'Rescan Shares'} + >{scanning ? 'Scanning shares' : 'Rescan Shares'}
} + filling={(loading || scanning) && {Math.round(scanProgress * 100)}%} > diff --git a/src/web/src/components/System/System.js b/src/web/src/components/System/System.js index 6c0229cf..2be10f81 100644 --- a/src/web/src/components/System/System.js +++ b/src/web/src/components/System/System.js @@ -1,7 +1,7 @@ import React from 'react'; import { useRouteMatch, useHistory, Redirect } from 'react-router-dom'; -import { Segment, Tab } from 'semantic-ui-react'; +import { Segment, Tab, Menu, Icon } from 'semantic-ui-react'; import './System.css'; @@ -9,6 +9,7 @@ import Info from './Info'; import Logs from './Logs'; import Options from './Options'; import Shares from './Shares'; +import { Switch } from '../Shared'; const System = ({ state = {}, options = {} }) => { const { params: { tab }, ...route } = useRouteMatch(); @@ -17,11 +18,15 @@ const System = ({ state = {}, options = {} }) => { const panes = [ { route: 'info', - menuItem: { - key: 'info', - icon: 'info', - content: 'Info', - }, + menuItem: ( + } + > + + + Info + ), render: () => , }, { @@ -35,12 +40,15 @@ const System = ({ state = {}, options = {} }) => { }, { route: 'shares', - menuItem: { - key: 'shares', - icon: 'share external', - content: 'Shares', - }, - render: () => , + menuItem: ( + } + > + + + Shares + ), + render: () => , }, { route: 'logs', -- cgit v1.2.3