aboutsummaryrefslogtreecommitdiffstats
path: root/src/web
diff options
context:
space:
mode:
authorJP Dillingham <jp@dillingham.me>2022-06-01 10:56:46 -0500
committerJP Dillingham <jp@dillingham.me>2022-06-01 10:58:22 -0500
commitf3b2e02168e77ea8cc9bc68d151aba56e279f9c4 (patch)
treeacb137a6be103a52967fd3b279aa026da88dfb63 /src/web
parent1da4e1f198aff7f5ad7f61381d481acc8dc7119c (diff)
downloadslskd-f3b2e02168e77ea8cc9bc68d151aba56e279f9c4.tar.gz
show empty row in tables
Diffstat (limited to 'src/web')
-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
3 files changed, 32 insertions, 24 deletions
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}/>