From 1152df08d7c7d7f3a6787f26a6946d3f6f07ea43 Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Fri, 27 May 2022 13:12:06 -0500 Subject: tidy up --- .gitignore | 1 - .../src/components/System/Shares/ExclusionTable.js | 29 ++++++++++++++ src/web/src/components/System/Shares/Share.js | 25 ------------ src/web/src/components/System/Shares/ShareTable.js | 38 ++++++++++++++++++ src/web/src/components/System/Shares/index.js | 46 +++------------------- src/web/src/components/System/System.css | 4 ++ 6 files changed, 76 insertions(+), 67 deletions(-) create mode 100644 src/web/src/components/System/Shares/ExclusionTable.js delete mode 100644 src/web/src/components/System/Shares/Share.js create mode 100644 src/web/src/components/System/Shares/ShareTable.js diff --git a/.gitignore b/.gitignore index bcf6c53e..57adbc64 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,5 @@ .vs dist/ -logs/ src/slskd/bin/ src/slskd/obj/ src/slskd/wwwroot/ diff --git a/src/web/src/components/System/Shares/ExclusionTable.js b/src/web/src/components/System/Shares/ExclusionTable.js new file mode 100644 index 00000000..90ee2eff --- /dev/null +++ b/src/web/src/components/System/Shares/ExclusionTable.js @@ -0,0 +1,29 @@ +import React from 'react'; + +import { + Table, + Icon, +} from 'semantic-ui-react'; + +const ExclusionTable = ({ exclusions = [] } = {}) => { + if (exclusions.length === 0) { + return <>; + } + + return ( + + + + Excluded Paths + + + + {exclusions.map((share, index) => ( + {share.localPath} + ))} + +
+ ); +}; + +export default ExclusionTable; \ No newline at end of file diff --git a/src/web/src/components/System/Shares/Share.js b/src/web/src/components/System/Shares/Share.js deleted file mode 100644 index 61080453..00000000 --- a/src/web/src/components/System/Shares/Share.js +++ /dev/null @@ -1,25 +0,0 @@ -import React from 'react'; - -import { - Item, -} from 'semantic-ui-react'; - -const Share = ({ share = {}, onBrowse } = {}) => { - const { id, remotePath, localPath, mask, alias, isExcluded, directories, files } = share; - - return ( - - - {remotePath} - Description - -
-            {JSON.stringify({ id, localPath, mask, alias, isExcluded, directories, files }, null, 2)}
-          
-
-
-
- ); -}; - -export default Share; \ No newline at end of file diff --git a/src/web/src/components/System/Shares/ShareTable.js b/src/web/src/components/System/Shares/ShareTable.js new file mode 100644 index 00000000..ecd83e3f --- /dev/null +++ b/src/web/src/components/System/Shares/ShareTable.js @@ -0,0 +1,38 @@ +import React from 'react'; + +import { + Table, + Icon, +} from 'semantic-ui-react'; + +import { Link } from 'react-router-dom'; + +const ShareTable = ({ shares, onClick }) => { + return ( + + + + Local Path + Directories + Files + Alias + Remote Path + + + + {shares.map((share, index) => ( + onClick(share)}> + + {share.localPath} + + {share.directories} + {share.files} + {share.alias} + {share.remotePath} + ))} + +
+ ); +}; + +export default ShareTable; \ No newline at end of file diff --git a/src/web/src/components/System/Shares/index.js b/src/web/src/components/System/Shares/index.js index 8da95034..5fe59cb2 100644 --- a/src/web/src/components/System/Shares/index.js +++ b/src/web/src/components/System/Shares/index.js @@ -6,17 +6,16 @@ import { LoaderSegment, ShrinkableButton, Switch, - Div, } from '../../Shared'; import ContentsModal from './ContentsModal'; import { Divider, - Table, - Icon, } from 'semantic-ui-react'; -import { Link } from 'react-router-dom'; + +import ExclusionTable from './ExclusionTable'; +import ShareTable from './ShareTable'; const Index = ({ state = {} } = {}) => { const [loading, setLoading] = useState(true); @@ -66,43 +65,8 @@ const Index = ({ state = {} } = {}) => { } > - - - - Local Path - Directories - Files - Alias - Remote Path - - - - {shared.map((share, index) => ( - setModal(share)}> - - {share.localPath} - - {share.directories} - {share.files} - {share.alias} - {share.remotePath} - ))} - -
- + +
setModal(false)}/> diff --git a/src/web/src/components/System/System.css b/src/web/src/components/System/System.css index e29487f1..a8e9cb8e 100644 --- a/src/web/src/components/System/System.css +++ b/src/web/src/components/System/System.css @@ -58,4 +58,8 @@ .edit-code-container, .edit-code-container-error { overflow: auto; +} + +.share-count-column { + width: 110px; } \ No newline at end of file -- cgit v1.2.3