aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/slskd/Shares/SharedFileCache.cs4
-rw-r--r--src/web/src/components/System/Shares/ExclusionTable.js20
-rw-r--r--src/web/src/components/System/Shares/ShareTable.js29
-rw-r--r--src/web/src/components/System/Shares/index.js7
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 @@
// </copyright>
using System.IO;
-using Microsoft.Extensions.Options;
namespace slskd.Shares
{
@@ -114,7 +113,6 @@ namespace slskd.Shares
/// <returns>The contents of the cache.</returns>
public IEnumerable<Directory> Browse()
{
- Console.WriteLine(State.ToJson());
if (!State.CurrentValue.Filled)
{
if (State.CurrentValue.Filling)
@@ -168,8 +166,6 @@ namespace slskd.Shares
/// <returns>The operation context.</returns>
public async Task FillAsync(IEnumerable<Share> shares, IEnumerable<Regex> 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 (
<Table>
<Table.Header>
@@ -18,9 +16,17 @@ const ExclusionTable = ({ exclusions = [] } = {}) => {
</Table.Row>
</Table.Header>
<Table.Body>
- {exclusions.map((share, index) => (<Table.Row key={index}>
- <Table.Cell><Icon name='x' color='red'/>{share.localPath}</Table.Cell>
- </Table.Row>))}
+ <Switch
+ empty={exclusions.length === 0 && <Table.Row>
+ <Table.Cell style={{ opacity: .5, padding: '10px !important', textAlign: 'center' }}>
+ No exclusions configured
+ </Table.Cell>
+ </Table.Row>}
+ >
+ {exclusions.map((share, index) => (<Table.Row key={index}>
+ <Table.Cell><Icon name='x' color='red'/>{share.localPath}</Table.Cell>
+ </Table.Row>))}
+ </Switch>
</Table.Body>
</Table>
);
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 }) => {
</Table.Row>
</Table.Header>
<Table.Body>
- {shares.map((share, index) => (<Table.Row key={index}>
- <Table.Cell onClick={() => onClick(share)}>
- <Icon name='folder'/>
- <Link to='#'>{share.localPath}</Link>
- </Table.Cell>
- <Table.Cell>{share.directories}</Table.Cell>
- <Table.Cell>{share.files}</Table.Cell>
- <Table.Cell>{share.alias}</Table.Cell>
- <Table.Cell>{share.remotePath}</Table.Cell>
- </Table.Row>))}
+ <Switch
+ empty={shares.length === 0 && <Table.Row>
+ <Table.Cell colSpan={5} style={{ opacity: .5, padding: '10px !important', textAlign: 'center' }}>
+ No shares configured
+ </Table.Cell>
+ </Table.Row>}
+ >
+ {shares.map((share, index) => (<Table.Row key={index}>
+ <Table.Cell onClick={() => onClick(share)}>
+ <Icon name='folder'/>
+ <Link to='#'>{share.localPath}</Link>
+ </Table.Cell>
+ <Table.Cell>{share.directories}</Table.Cell>
+ <Table.Cell>{share.files}</Table.Cell>
+ <Table.Cell>{share.alias}</Table.Cell>
+ <Table.Cell>{share.remotePath}</Table.Cell>
+ </Table.Row>))}
+ </Switch>
</Table.Body>
</Table>
);
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 = {} } = {}) => {
<Divider/>
<Switch
filling={(loading || filling) && <LoaderSegment caption={fillProgress}/>}
- empty={shared.length === 0 &&
- <PlaceholderSegment
- icon='share external'
- caption='No shares configured'
- size='small'
- />}
>
<ShareTable shares={shared} onClick={setModal}/>
<ExclusionTable exclusions={excluded}/>