From f3b2e02168e77ea8cc9bc68d151aba56e279f9c4 Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Wed, 1 Jun 2022 10:56:46 -0500 Subject: show empty row in tables --- src/slskd/Shares/SharedFileCache.cs | 4 --- .../src/components/System/Shares/ExclusionTable.js | 20 +++++++++------ src/web/src/components/System/Shares/ShareTable.js | 29 ++++++++++++++-------- src/web/src/components/System/Shares/index.js | 7 ------ 4 files changed, 32 insertions(+), 28 deletions(-) diff --git a/src/slskd/Shares/SharedFileCache.cs b/src/slskd/Shares/SharedFileCache.cs index cb1ccdee..8ac52462 100644 --- a/src/slskd/Shares/SharedFileCache.cs +++ b/src/slskd/Shares/SharedFileCache.cs @@ -16,7 +16,6 @@ // using System.IO; -using Microsoft.Extensions.Options; namespace slskd.Shares { @@ -114,7 +113,6 @@ namespace slskd.Shares /// The contents of the cache. public IEnumerable Browse() { - Console.WriteLine(State.ToJson()); if (!State.CurrentValue.Filled) { if (State.CurrentValue.Filling) @@ -168,8 +166,6 @@ namespace slskd.Shares /// The operation context. public async Task FillAsync(IEnumerable shares, IEnumerable filters) { - Console.WriteLine($"Filling: {shares.ToJson()}"); - // obtain the semaphore, or fail if it can't be obtained immediately, indicating that a scan is running. if (!await SyncRoot.WaitAsync(millisecondsTimeout: 0)) { diff --git a/src/web/src/components/System/Shares/ExclusionTable.js b/src/web/src/components/System/Shares/ExclusionTable.js index 90ee2eff..5e010e30 100644 --- a/src/web/src/components/System/Shares/ExclusionTable.js +++ b/src/web/src/components/System/Shares/ExclusionTable.js @@ -5,11 +5,9 @@ import { Icon, } from 'semantic-ui-react'; -const ExclusionTable = ({ exclusions = [] } = {}) => { - if (exclusions.length === 0) { - return <>; - } +import { Switch } from '../../Shared'; +const ExclusionTable = ({ exclusions = [] } = {}) => { return ( @@ -18,9 +16,17 @@ const ExclusionTable = ({ exclusions = [] } = {}) => { - {exclusions.map((share, index) => ( - {share.localPath} - ))} + + + No exclusions configured + + } + > + {exclusions.map((share, index) => ( + {share.localPath} + ))} +
); diff --git a/src/web/src/components/System/Shares/ShareTable.js b/src/web/src/components/System/Shares/ShareTable.js index ecd83e3f..d264fc8f 100644 --- a/src/web/src/components/System/Shares/ShareTable.js +++ b/src/web/src/components/System/Shares/ShareTable.js @@ -6,6 +6,7 @@ import { } from 'semantic-ui-react'; import { Link } from 'react-router-dom'; +import { Switch } from '../../Shared'; const ShareTable = ({ shares, onClick }) => { return ( @@ -20,16 +21,24 @@ const ShareTable = ({ shares, onClick }) => { - {shares.map((share, index) => ( - onClick(share)}> - - {share.localPath} - - {share.directories} - {share.files} - {share.alias} - {share.remotePath} - ))} + + + No shares configured + + } + > + {shares.map((share, index) => ( + onClick(share)}> + + {share.localPath} + + {share.directories} + {share.files} + {share.alias} + {share.remotePath} + ))} + ); diff --git a/src/web/src/components/System/Shares/index.js b/src/web/src/components/System/Shares/index.js index 53018b45..5fe59cb2 100644 --- a/src/web/src/components/System/Shares/index.js +++ b/src/web/src/components/System/Shares/index.js @@ -4,7 +4,6 @@ import { toast } from 'react-toastify'; import * as sharesLib from '../../../lib/shares'; import { LoaderSegment, - PlaceholderSegment, ShrinkableButton, Switch, } from '../../Shared'; @@ -65,12 +64,6 @@ const Index = ({ state = {} } = {}) => { } - empty={shared.length === 0 && - } > -- cgit v1.2.3