From 492cfe9ad1fcaf2c7d11ca92089ca4e87b28bdc2 Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Thu, 26 May 2022 19:08:38 -0500 Subject: wip --- src/web/src/components/System/Shares/Share.js | 4 +-- src/web/src/components/System/Shares/index.js | 44 ++++++++++++++++++++------- src/web/src/components/System/System.js | 2 +- 3 files changed, 36 insertions(+), 14 deletions(-) (limited to 'src/web') diff --git a/src/web/src/components/System/Shares/Share.js b/src/web/src/components/System/Shares/Share.js index eadcd07b..61080453 100644 --- a/src/web/src/components/System/Shares/Share.js +++ b/src/web/src/components/System/Shares/Share.js @@ -5,7 +5,7 @@ import { } from 'semantic-ui-react'; const Share = ({ share = {}, onBrowse } = {}) => { - const { id, remotePath, localPath, mask, alias, isExcluded } = share; + const { id, remotePath, localPath, mask, alias, isExcluded, directories, files } = share; return ( @@ -14,7 +14,7 @@ const Share = ({ share = {}, onBrowse } = {}) => { Description
-            {JSON.stringify({ id, localPath, mask, alias, isExcluded }, null, 2)}
+            {JSON.stringify({ id, localPath, mask, alias, isExcluded, directories, files }, null, 2)}
           
diff --git a/src/web/src/components/System/Shares/index.js b/src/web/src/components/System/Shares/index.js index 5f3ae971..aa8db54a 100644 --- a/src/web/src/components/System/Shares/index.js +++ b/src/web/src/components/System/Shares/index.js @@ -2,15 +2,16 @@ import React, { useState, useEffect } from 'react'; import { toast } from 'react-toastify'; import * as sharesLib from '../../../lib/shares'; -import { LoaderSegment } from '../../Shared'; +import { LoaderSegment, PlaceholderSegment, ShrinkableButton, Switch } from '../../Shared'; import Share from './Share'; import { Modal, Button, + Divider, } from 'semantic-ui-react'; -const Index = () => { +const Index = ({ state }) => { const [loading, setLoading] = useState(true); const [shares, setShares] = useState([]); const [everything, setEverything] = useState(); @@ -38,22 +39,43 @@ const Index = () => { setModal(true); }; + const rescan = async () => { + await sharesLib.rescan(); + }; + if (loading) { return LoaderSegment; } + const { filling, filled, faulted, fillProgress, directories, files, excludedDirectories } = state; + return ( <> -
-
    - {shares.map(share => ( - browse({ id: share.id })}/> - ))} -
-
-          {JSON.stringify(everything, null, 2)}
-        
+
+ {filling ? 'Scanning shares' : 'Rescan Shares'}
+ + } + > +
+
    + {shares.map(share => ( + browse({ id: share.id })}/> + ))} +
+
+            {JSON.stringify(state, null, 2)}
+          
+
+
{ icon: 'share external', content: 'Shares', }, - render: () => , + render: () => , }, { route: 'logs', -- cgit v1.2.3