From 378df649f87732a3adaae3b0402ff71360c8a969 Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Wed, 25 May 2022 23:30:00 -0500 Subject: rename 'page' css class to 'view' to avoid conflict --- src/web/src/components/App.css | 4 ++-- src/web/src/components/App.js | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'src/web') diff --git a/src/web/src/components/App.css b/src/web/src/components/App.css index e0935163..82e74b71 100644 --- a/src/web/src/components/App.css +++ b/src/web/src/components/App.css @@ -120,7 +120,7 @@ body { background-color: transparent !important; } -.page { +.view { padding-left: 15px; padding-right: 15px; max-width: 1200px !important; @@ -128,6 +128,6 @@ body { margin-right: auto !important; } -.page:last-child { +.view:last-child { margin-bottom: 17px; } \ No newline at end of file diff --git a/src/web/src/components/App.js b/src/web/src/components/App.js index 09039442..76881c93 100644 --- a/src/web/src/components/App.js +++ b/src/web/src/components/App.js @@ -260,7 +260,7 @@ class App extends Component { - this.withTokenCheck(
+ this.withTokenCheck(
this.withTokenCheck()}/> - this.withTokenCheck(
) + this.withTokenCheck(
) }/> - this.withTokenCheck(
+ this.withTokenCheck(
) }/> -- cgit v1.2.3 From b34d1d9dfbe379d2f1397b0d2503ec73c4fd9a0d Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Wed, 25 May 2022 23:30:16 -0500 Subject: rough in Share components --- src/web/src/components/System/Shares/Share.js | 25 ++++++++ src/web/src/components/System/Shares/index.js | 82 +++++++++++++++++++++++++++ 2 files changed, 107 insertions(+) create mode 100644 src/web/src/components/System/Shares/Share.js create mode 100644 src/web/src/components/System/Shares/index.js (limited to 'src/web') diff --git a/src/web/src/components/System/Shares/Share.js b/src/web/src/components/System/Shares/Share.js new file mode 100644 index 00000000..eadcd07b --- /dev/null +++ b/src/web/src/components/System/Shares/Share.js @@ -0,0 +1,25 @@ +import React from 'react'; + +import { + Item, +} from 'semantic-ui-react'; + +const Share = ({ share = {}, onBrowse } = {}) => { + const { id, remotePath, localPath, mask, alias, isExcluded } = share; + + return ( + + + {remotePath} + Description + +
+            {JSON.stringify({ id, localPath, mask, alias, isExcluded }, null, 2)}
+          
+
+
+
+ ); +}; + +export default Share; \ 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 new file mode 100644 index 00000000..5f3ae971 --- /dev/null +++ b/src/web/src/components/System/Shares/index.js @@ -0,0 +1,82 @@ +import React, { useState, useEffect } from 'react'; +import { toast } from 'react-toastify'; + +import * as sharesLib from '../../../lib/shares'; +import { LoaderSegment } from '../../Shared'; +import Share from './Share'; + +import { + Modal, + Button, +} from 'semantic-ui-react'; + +const Index = () => { + const [loading, setLoading] = useState(true); + const [shares, setShares] = useState([]); + const [everything, setEverything] = useState(); + const [modal, setModal] = useState(false); + + useEffect(() => { + getAll(); + }, []); + + const getAll = async () => { + try { + setLoading(true); + setShares(await sharesLib.getAll()); + setLoading(false); + } catch (error) { + console.error(error); + toast.error(error?.response?.data ?? error?.message ?? error); + } finally { + setLoading(false); + } + }; + + const browse = async ({ id }) => { + setEverything(await sharesLib.browse({ id })); + setModal(true); + }; + + if (loading) { + return LoaderSegment; + } + + return ( + <> +
+
    + {shares.map(share => ( + browse({ id: share.id })}/> + ))} +
+
+          {JSON.stringify(everything, null, 2)}
+        
+
+ setModal(false)} + style={{ color: 'red' }} + > + Delete Your Account + +
+            {JSON.stringify(everything, null, 2)}
+          
+
+ + + + +
+ + ); +}; + +export default Index; \ No newline at end of file -- cgit v1.2.3 From 4c4461bc54cbad68c3ed20ba7faee9625b77c98c Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Wed, 25 May 2022 23:30:27 -0500 Subject: add shares lib --- src/web/src/lib/shares.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 src/web/src/lib/shares.js (limited to 'src/web') diff --git a/src/web/src/lib/shares.js b/src/web/src/lib/shares.js new file mode 100644 index 00000000..34fab679 --- /dev/null +++ b/src/web/src/lib/shares.js @@ -0,0 +1,19 @@ +import api from './api'; + +export const getAll = async () => { + return (await api.get('/shares')).data; +}; + +export const get = async ({ id } = {}) => { + if (!id) throw new Error('unable to get share: id is missing'); + return (await api.get(`/shares/${id}`)).data; +}; + +export const browseAll = async () => { + return (await api.get('/shares/contents')).data; +}; + +export const browse = async ({ id } = {}) => { + if (!id) throw new Error('unable to get share contents: id is missing'); + return (await api.get(`/shares/${id}/contents`)).data; +}; \ No newline at end of file -- cgit v1.2.3 From c16e7614b6a37d542f838459850e599e6eb6dcf3 Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Wed, 25 May 2022 23:30:38 -0500 Subject: add Shares system tab --- src/web/src/components/System/System.js | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/web') diff --git a/src/web/src/components/System/System.js b/src/web/src/components/System/System.js index 9310777f..8955b212 100644 --- a/src/web/src/components/System/System.js +++ b/src/web/src/components/System/System.js @@ -8,6 +8,7 @@ import './System.css'; import Info from './Info'; import Logs from './Logs'; import Options from './Options'; +import Shares from './Shares'; const System = ({ state = {}, options = {} }) => { const { params: { tab }, ...route } = useRouteMatch(); @@ -19,6 +20,9 @@ const System = ({ state = {}, options = {} }) => { route: 'options', menuItem: 'Options', render: () => , }, + { + route: 'shares', menuItem: 'Shares', render: () => , + }, { route: 'logs', menuItem: 'Logs', render: () => }, ]; -- cgit v1.2.3 From 0974475adc31aa5b4179c427ba7670fc96874481 Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Thu, 26 May 2022 16:51:49 -0500 Subject: add a function to fetch options debug --- src/web/src/lib/options.js | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/web') diff --git a/src/web/src/lib/options.js b/src/web/src/lib/options.js index 20f8dd0a..32e48534 100644 --- a/src/web/src/lib/options.js +++ b/src/web/src/lib/options.js @@ -4,6 +4,10 @@ export const getCurrent = async () => { return (await api.get('/options')).data; }; +export const getCurrentDebugView = async () => { + return (await api.get('/options/debug')).data; +}; + export const getYaml = async () => { return (await api.get('/options/yaml')).data; }; -- cgit v1.2.3 From 59623e20ac93565bf377457f70cff87fc4b6e459 Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Thu, 26 May 2022 16:52:36 -0500 Subject: refactor System components --- src/web/src/components/System/Info.js | 70 -------------- src/web/src/components/System/Info/index.js | 74 +++++++++++++++ src/web/src/components/System/Logs.js | 83 ----------------- .../src/components/System/Options/DebugModal.js | 67 ++++++++++++++ src/web/src/components/System/Options/Edit.js | 87 ------------------ src/web/src/components/System/Options/EditModal.js | 101 +++++++++++++++++++++ src/web/src/components/System/Options/View.js | 30 ------ src/web/src/components/System/Options/index.js | 74 +++++++++++++-- src/web/src/components/System/System.css | 36 +++----- src/web/src/components/System/System.js | 37 +++++++- 10 files changed, 355 insertions(+), 304 deletions(-) delete mode 100644 src/web/src/components/System/Info.js create mode 100644 src/web/src/components/System/Info/index.js delete mode 100644 src/web/src/components/System/Logs.js create mode 100644 src/web/src/components/System/Options/DebugModal.js delete mode 100644 src/web/src/components/System/Options/Edit.js create mode 100644 src/web/src/components/System/Options/EditModal.js delete mode 100644 src/web/src/components/System/Options/View.js (limited to 'src/web') diff --git a/src/web/src/components/System/Info.js b/src/web/src/components/System/Info.js deleted file mode 100644 index d9ce8813..00000000 --- a/src/web/src/components/System/Info.js +++ /dev/null @@ -1,70 +0,0 @@ -import React from 'react'; -import YAML from 'yaml'; - -import { restart, shutdown, getVersion } from '../../lib/application'; - -import { Modal, Header } from 'semantic-ui-react'; -import CodeEditor from '../Shared/CodeEditor'; -import ShrinkableButton from '../Shared/ShrinkableButton'; - -const Info = ({ state }) => { - const stateAsYaml = YAML.stringify(state, { simpleKeys: true, sortMapEntries: true }); - - return ( - <> -
- -
-
-
- getVersion({ forceCheck: true })} - > - Check for Updates - -
- - Shut Down - - } - centered - size='mini' - header={
} - content="Are you sure you want to shut the application down? You'll need to manually start it again." - actions={['Cancel', { key: 'done', content: 'Shut Down', negative: true, onClick: shutdown }]} - /> - - Restart - - } - centered - size='mini' - header={
} - content='Are you sure you want restart the application?' - actions={['Cancel', { key: 'done', content: 'Restart', negative: true, onClick: restart }]} - /> -
- - ); -}; - -export default Info; \ No newline at end of file diff --git a/src/web/src/components/System/Info/index.js b/src/web/src/components/System/Info/index.js new file mode 100644 index 00000000..f640716e --- /dev/null +++ b/src/web/src/components/System/Info/index.js @@ -0,0 +1,74 @@ +import React from 'react'; +import YAML from 'yaml'; + +import { restart, shutdown, getVersion } from '../../../lib/application'; + +import { Modal, Header, Divider } from 'semantic-ui-react'; + +import { + CodeEditor, + ShrinkableButton, +} from '../../Shared'; + +const Info = ({ state }) => { + const stateAsYaml = YAML.stringify(state, { simpleKeys: true, sortMapEntries: true }); + + return ( + <> +
+
+ getVersion({ forceCheck: true })} + > + Check for Updates + +
+ + Shut Down + + } + centered + size='mini' + header={
} + content="Are you sure you want to shut the application down? You'll need to manually start it again." + actions={['Cancel', { key: 'done', content: 'Shut Down', negative: true, onClick: shutdown }]} + /> + + Restart + + } + centered + size='mini' + header={
} + content='Are you sure you want restart the application?' + actions={['Cancel', { key: 'done', content: 'Restart', negative: true, onClick: restart }]} + /> +
+ +
+ +
+ + ); +}; + +export default Info; \ No newline at end of file diff --git a/src/web/src/components/System/Logs.js b/src/web/src/components/System/Logs.js deleted file mode 100644 index 4a118414..00000000 --- a/src/web/src/components/System/Logs.js +++ /dev/null @@ -1,83 +0,0 @@ -import React, { Component } from 'react'; -import { Table, Loader, Dimmer } from 'semantic-ui-react'; - -import { createLogsHubConnection } from '../../lib/hubFactory'; - -import './System.css'; - -const initialState = { - logs: [], - connected: false, -}; - -const levels = { - 'Debug': 'DBG', - 'Warning': 'WRN', - 'Error': 'ERR', - 'Information': 'INF', -}; - -const maxLogs = 500; - -class Logs extends Component { - state = initialState; - - componentDidMount = () => { - const logsHub = createLogsHubConnection(); - - logsHub.on('buffer', (buffer) => { - this.setState({ connected: true, logs: buffer.reverse().slice(0, maxLogs) }); - }); - - logsHub.on('log', (log) => { - this.setState({ connected: true, logs: [log].concat(this.state.logs).slice(0, maxLogs) }); - }); - - logsHub.onreconnecting(() => this.setState({ connected: false })); - logsHub.onclose(() => this.setState({ connected: false })); - logsHub.onreconnected(() => this.setState({ connected: true })); - - logsHub.start(); - }; - - formatTimestamp = (timestamp) => { - const date = new Date(timestamp); - return `${date.getHours().toString().padStart(2, '0')}:${date.getMinutes().toString().padStart(2, '0')}:${date.getSeconds().toString().padStart(2, '0')}`; // eslint-disable-line max-len - }; - - render = () => { - const { connected, logs } = this.state; - - return ( -
- {!connected && } - {connected && - - - - Timestamp - Level - Message - - - - {logs.map((log, index) => - - {this.formatTimestamp(log.timestamp)} - {levels[log.level] || log.level} - {log.message} - )} - -
- } -
- ); - }; -} - -export default Logs; \ No newline at end of file diff --git a/src/web/src/components/System/Options/DebugModal.js b/src/web/src/components/System/Options/DebugModal.js new file mode 100644 index 00000000..2f01eb16 --- /dev/null +++ b/src/web/src/components/System/Options/DebugModal.js @@ -0,0 +1,67 @@ +import React, { useState, useEffect } from 'react'; +import { toast } from 'react-toastify'; + +import { + Modal, + Button, + Icon, +} from 'semantic-ui-react'; + +import { getCurrentDebugView } from '../../../lib/options'; +import { CodeEditor, PlaceholderSegment, Switch } from '../../Shared'; + +const DebugModal = ({ open, onClose }) => { + const [loading, setLoading] = useState(true); + const [debugView, setDebugView] = useState(); + + useEffect(() => { + if (open) { + get(); + } + }, [open]); + + const get = async () => { + setLoading(true); + + try { + setDebugView(await getCurrentDebugView()); + } catch (error) { + console.error(error); + toast.error(error?.response?.data ?? error?.message ?? error); + } finally { + setLoading(false); + } + }; + + return ( + + + + Options (Debug View) + + + } + > +
+ +
+
+
+ + + +
); +}; + +export default DebugModal; \ No newline at end of file diff --git a/src/web/src/components/System/Options/Edit.js b/src/web/src/components/System/Options/Edit.js deleted file mode 100644 index f9657022..00000000 --- a/src/web/src/components/System/Options/Edit.js +++ /dev/null @@ -1,87 +0,0 @@ -import React, { useState, useEffect } from 'react'; - -import { Button, Icon, Message } from 'semantic-ui-react'; -import CodeEditor from '../../Shared/CodeEditor'; - -import { getYamlLocation, getYaml, validateYaml, updateYaml } from '../../../lib/options'; -import PlaceholderSegment from '../../Shared/PlaceholderSegment'; - -const Edit = ({ cancelAction }) => { - const [{ loading, error }, setLoading] = useState({ loading: true, error: false }); - const [{ location, yaml, isDirty }, setYaml] = useState({ location: undefined, yaml: undefined, isDirty: false }); - const [yamlError, setYamlError] = useState(); - const [updateError, setUpdateError] = useState(); - - useEffect(() => { - get(); - }, []); - - const get = async () => { - setLoading({ loading: true, error: false }); - - try { - const [location, yaml] = await Promise.all([getYamlLocation(), getYaml()]); - - setYaml({ location, yaml, isDirty: false }); - setLoading({ loading: false, error: false }); - } catch (error) { - setLoading({ loading: false, error: error.message }); - } - }; - - const update = async (yaml) => { - setYaml({ location, yaml, isDirty: true }); - validate(yaml); - }; - - const validate = async (yaml) => { - const response = await validateYaml({ yaml }); - setYamlError(response); - }; - - const save = async (yaml) => { - await validate(yaml); - - if (!yamlError) { - try { - await updateYaml({ yaml }); - cancelAction(); - } - catch (error) { - setUpdateError(error.response.data); - } - } - }; - - if (loading) { - return ; - } - - if (error) { - return ; - } - - return ( - <> - - Editing {location} - -
- update(value)} - /> -
- {(yamlError || updateError) && - {(yamlError ?? '') + (updateError ?? '')}} -
- - -
- - ); -}; - -export default Edit; \ No newline at end of file diff --git a/src/web/src/components/System/Options/EditModal.js b/src/web/src/components/System/Options/EditModal.js new file mode 100644 index 00000000..b02cbf99 --- /dev/null +++ b/src/web/src/components/System/Options/EditModal.js @@ -0,0 +1,101 @@ +import React, { useState, useEffect } from 'react'; + +import { Button, Icon, Message, Modal } from 'semantic-ui-react'; +import CodeEditor from '../../Shared/CodeEditor'; + +import { getYamlLocation, getYaml, validateYaml, updateYaml } from '../../../lib/options'; +import { + PlaceholderSegment, + Switch, +} from '../../Shared'; + +const EditModal = ({ open, onClose }) => { + const [{ loading, error }, setLoading] = useState({ loading: true, error: false }); + const [{ location, yaml, isDirty }, setYaml] = useState({ location: undefined, yaml: undefined, isDirty: false }); + const [yamlError, setYamlError] = useState(); + const [updateError, setUpdateError] = useState(); + + useEffect(() => { + if (open) { + get(); + } + }, [open]); + + const get = async () => { + setLoading({ loading: true, error: false }); + + try { + const [location, yaml] = await Promise.all([getYamlLocation(), getYaml()]); + + setYaml({ location, yaml, isDirty: false }); + setLoading({ loading: false, error: false }); + } catch (error) { + setLoading({ loading: false, error: error.message }); + } + }; + + const update = async (yaml) => { + setYaml({ location, yaml, isDirty: true }); + validate(yaml); + }; + + const validate = async (yaml) => { + const response = await validateYaml({ yaml }); + setYamlError(response); + }; + + const save = async (yaml) => { + await validate(yaml); + + if (!yamlError) { + try { + await updateYaml({ yaml }); + onClose(); + } + catch (error) { + setUpdateError(error.response.data); + } + } + }; + + return ( + + + + Edit Options + + Editing {location} + + + + } + error={error && } + > +
+ update(value)} + /> +
+
+
+ + {(yamlError || updateError) && + + {(yamlError ?? '') + (updateError ?? '')} + } + + + +
+ ); +}; + +export default EditModal; \ No newline at end of file diff --git a/src/web/src/components/System/Options/View.js b/src/web/src/components/System/Options/View.js deleted file mode 100644 index 9d4d7635..00000000 --- a/src/web/src/components/System/Options/View.js +++ /dev/null @@ -1,30 +0,0 @@ -import React from 'react'; -import YAML from 'yaml'; - -import { Icon, Button } from 'semantic-ui-react'; -import CodeEditor from '../../Shared/CodeEditor'; - -const View = ({ options, editAction }) => { - const { remoteConfiguration } = options; - - const optionsAsYaml = YAML.stringify(options, { simpleKeys: true, sortMapEntries: true }); - - return ( - <> -
- -
-
- {remoteConfiguration ? - : - } -
- - ); -}; - -export default View; \ No newline at end of file diff --git a/src/web/src/components/System/Options/index.js b/src/web/src/components/System/Options/index.js index 92535b95..894199e9 100644 --- a/src/web/src/components/System/Options/index.js +++ b/src/web/src/components/System/Options/index.js @@ -1,16 +1,76 @@ import React, { useState } from 'react'; +import YAML from 'yaml'; -import Edit from './Edit'; -import View from './View'; +import DebugModal from './DebugModal'; +import EditModal from './EditModal'; + +import { Divider } from 'semantic-ui-react'; +import { + CodeEditor, + ShrinkableButton, +} from '../../Shared'; const Index = ({ options }) => { - const [mode, setMode] = useState('view'); + const [debugModal, setDebugModal] = useState(false); + const [editModal, setEditModal] = useState(false); + + const { remoteConfiguration, debug } = options; + + const optionsAsYaml = YAML.stringify(options, { simpleKeys: true, sortMapEntries: true }); + + const DebugButton = () => { + if (!debug) return <>; + + return setDebugModal(true)} + > + Debug View + ; + }; + + const EditButton = () => { + if (!remoteConfiguration) { + return Remote Configuration Disabled; + } - if (mode === 'edit') { - return setMode('view')}/>; - } + return setEditModal(true)} + >Edit; + }; - return setMode('edit')}/>; + return ( + <> +
+ + +
+ +
+ +
+ setDebugModal(false)} + /> + setEditModal(false)} + /> + + ); }; export default Index; \ No newline at end of file diff --git a/src/web/src/components/System/System.css b/src/web/src/components/System/System.css index 560cc21a..cbcddf81 100644 --- a/src/web/src/components/System/System.css +++ b/src/web/src/components/System/System.css @@ -24,15 +24,24 @@ min-height: 100px; } -.full-height { - height: calc(100vh - 175px); -} - .no-grow { white-space: nowrap; overflow: overlay; } +.edit-code-header { + margin-top: 1em !important; + font-size: initial !important; +} + +.edit-code-content, .debug-view-content { + padding: 0px !important; +} + +.left-align { + text-align: left; +} + .footer-buttons { margin-top: 14px; text-align: right; @@ -43,23 +52,6 @@ text-align: right; } -.state-code-editor, .view-code-container, .edit-code-container, .edit-code-container-error { - border: 1px solid #d4d4d5; +.edit-code-container, .edit-code-container-error { overflow: auto; -} - -.state-code-container { - height: calc(100vh - 204px); -} - -.view-code-container { - height: calc(100vh - 254px); -} - -.edit-code-container { - height: calc(100vh - 316px); -} - -.edit-code-container-error { - height: calc(100vh - 378px); } \ No newline at end of file diff --git a/src/web/src/components/System/System.js b/src/web/src/components/System/System.js index 8955b212..73904006 100644 --- a/src/web/src/components/System/System.js +++ b/src/web/src/components/System/System.js @@ -15,15 +15,42 @@ const System = ({ state = {}, options = {} }) => { const history = useHistory(); const panes = [ - { route: 'info', menuItem: 'Info', render: () => }, + { + route: 'info', + menuItem: { + key: 'info', + icon: 'info', + content: 'Info', + }, + render: () => , + }, { - route: 'options', menuItem: 'Options', render: () => - , + route: 'options', + menuItem: { + key: 'options', + icon: 'options', + content: 'Options', + }, + render: () => , }, { - route: 'shares', menuItem: 'Shares', render: () => , + route: 'shares', + menuItem: { + key: 'shares', + icon: 'share external', + content: 'Shares', + }, + render: () => , + }, + { + route: 'logs', + menuItem: { + key: 'logs', + icon: 'file outline', + content: 'Logs', + }, + render: () => , }, - { route: 'logs', menuItem: 'Logs', render: () => }, ]; const activeIndex = panes.findIndex(pane => pane.route === tab); -- cgit v1.2.3 From a5b3cd97d037a1a4d7bf62e68d6b94d3fd149175 Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Thu, 26 May 2022 19:08:07 -0500 Subject: add loading prop --- src/web/src/components/Shared/ShrinkableButton.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/web') diff --git a/src/web/src/components/Shared/ShrinkableButton.js b/src/web/src/components/Shared/ShrinkableButton.js index 2f736ade..67c9f660 100644 --- a/src/web/src/components/Shared/ShrinkableButton.js +++ b/src/web/src/components/Shared/ShrinkableButton.js @@ -3,13 +3,13 @@ import React from 'react'; import { useMediaQuery } from 'react-responsive'; import { Button, Icon, Popup } from 'semantic-ui-react'; -const ShrinkableButton = ({ icon, mediaQuery, children, ...rest }) => { +const ShrinkableButton = ({ icon, loading, mediaQuery, children, ...rest }) => { const shouldShrink = useMediaQuery({ query: mediaQuery }); if (!shouldShrink) { return ( ); @@ -20,7 +20,7 @@ const ShrinkableButton = ({ icon, mediaQuery, children, ...rest }) => { content={children} trigger={ } /> -- cgit v1.2.3 From c16695fc69577b95592079c59cce4afec4ea80aa Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Thu, 26 May 2022 19:08:35 -0500 Subject: add rescan --- src/web/src/lib/shares.js | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/web') diff --git a/src/web/src/lib/shares.js b/src/web/src/lib/shares.js index 34fab679..f1d0373c 100644 --- a/src/web/src/lib/shares.js +++ b/src/web/src/lib/shares.js @@ -16,4 +16,8 @@ export const browseAll = async () => { export const browse = async ({ id } = {}) => { if (!id) throw new Error('unable to get share contents: id is missing'); return (await api.get(`/shares/${id}/contents`)).data; +}; + +export const rescan = async () => { + return (await api.put('/shares')).data; }; \ No newline at end of file -- cgit v1.2.3 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 From dc61b2d0f43ee455c0c73bb0118918a77a124082 Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Thu, 26 May 2022 22:52:47 -0500 Subject: add missing Logs component --- src/web/src/components/System/Logs/index.js | 83 +++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 src/web/src/components/System/Logs/index.js (limited to 'src/web') diff --git a/src/web/src/components/System/Logs/index.js b/src/web/src/components/System/Logs/index.js new file mode 100644 index 00000000..51b48f44 --- /dev/null +++ b/src/web/src/components/System/Logs/index.js @@ -0,0 +1,83 @@ +import React, { Component } from 'react'; +import { Table, Loader, Dimmer } from 'semantic-ui-react'; + +import { createLogsHubConnection } from '../../../lib/hubFactory'; + +import '../System.css'; + +const initialState = { + logs: [], + connected: false, +}; + +const levels = { + 'Debug': 'DBG', + 'Warning': 'WRN', + 'Error': 'ERR', + 'Information': 'INF', +}; + +const maxLogs = 500; + +class Logs extends Component { + state = initialState; + + componentDidMount = () => { + const logsHub = createLogsHubConnection(); + + logsHub.on('buffer', (buffer) => { + this.setState({ connected: true, logs: buffer.reverse().slice(0, maxLogs) }); + }); + + logsHub.on('log', (log) => { + this.setState({ connected: true, logs: [log].concat(this.state.logs).slice(0, maxLogs) }); + }); + + logsHub.onreconnecting(() => this.setState({ connected: false })); + logsHub.onclose(() => this.setState({ connected: false })); + logsHub.onreconnected(() => this.setState({ connected: true })); + + logsHub.start(); + }; + + formatTimestamp = (timestamp) => { + const date = new Date(timestamp); + return `${date.getHours().toString().padStart(2, '0')}:${date.getMinutes().toString().padStart(2, '0')}:${date.getSeconds().toString().padStart(2, '0')}`; // eslint-disable-line max-len + }; + + render = () => { + const { connected, logs } = this.state; + + return ( +
+ {!connected && } + {connected && + + + + Timestamp + Level + Message + + + + {logs.map((log, index) => + + {this.formatTimestamp(log.timestamp)} + {levels[log.level] || log.level} + {log.message} + )} + +
+ } +
+ ); + }; +} + +export default Logs; \ No newline at end of file -- cgit v1.2.3 From e32e6f011422190a332f162a9a1dcd301579f591 Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Fri, 27 May 2022 00:59:27 -0500 Subject: display an icon when an action is pending --- src/web/src/components/App.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/web') diff --git a/src/web/src/components/App.js b/src/web/src/components/App.js index 76881c93..7f488643 100644 --- a/src/web/src/components/App.js +++ b/src/web/src/components/App.js @@ -116,7 +116,7 @@ class App extends Component { render = () => { const { login, applicationState = {}, applicationOptions = {}, error, initialized, retriesExhausted } = this.state; - const { version = {}, server } = applicationState; + const { version = {}, server, pendingReconnect, pendingRestart, pendingShareRescan } = applicationState; const { isUpdateAvailable, current, latest } = version; if (!initialized) { @@ -212,6 +212,13 @@ class App extends Component { Disconnected } + {(pendingReconnect || pendingRestart || pendingShareRescan) && + + + + + Pending Action + } {isUpdateAvailable && -- cgit v1.2.3 From 86c510a31fa5e279da49b834808c2a81c6782c74 Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Fri, 27 May 2022 00:59:48 -0500 Subject: tidy up --- src/web/src/components/Search/List/SearchList.js | 50 +++++++++++------------- src/web/src/components/Search/Searches.js | 3 +- 2 files changed, 24 insertions(+), 29 deletions(-) (limited to 'src/web') diff --git a/src/web/src/components/Search/List/SearchList.js b/src/web/src/components/Search/List/SearchList.js index db16fa71..5a77149b 100644 --- a/src/web/src/components/Search/List/SearchList.js +++ b/src/web/src/components/Search/List/SearchList.js @@ -27,33 +27,29 @@ const SearchList = ({ connecting={connecting && } error={error && } > - - - - - - - Search - Files - Locked - Responses - Ended - - - - - {Object.values(searches) - .sort((a, b) => (new Date(b.startedAt) - new Date(a.startedAt))) - .map((search, index) => )} - -
-
-
+ + + + + Search + Files + Locked + Responses + Ended + + + + + {Object.values(searches) + .sort((a, b) => (new Date(b.startedAt) - new Date(a.startedAt))) + .map((search, index) => )} + +
diff --git a/src/web/src/components/Search/Searches.js b/src/web/src/components/Search/Searches.js index fdcda3ac..fb0ce027 100644 --- a/src/web/src/components/Search/Searches.js +++ b/src/web/src/components/Search/Searches.js @@ -91,8 +91,7 @@ const Searches = ({ server }) => { return () => { searchHub.stop(); }; - // eslint-disable-next-line react-hooks/exhaustive-deps - }, []); + }, []); // eslint-disable-line react-hooks/exhaustive-deps // create a new search, and optionally navigate to it to display the details // we do this if the user clicks the search icon, or repeats an existing search -- cgit v1.2.3 From 410dc9db717ad5f01f4b6b40a5a0da41d53b1a74 Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Fri, 27 May 2022 01:00:06 -0500 Subject: add 5px padding back to debug and share view --- src/web/src/components/System/System.css | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/web') diff --git a/src/web/src/components/System/System.css b/src/web/src/components/System/System.css index cbcddf81..e29487f1 100644 --- a/src/web/src/components/System/System.css +++ b/src/web/src/components/System/System.css @@ -34,10 +34,14 @@ font-size: initial !important; } -.edit-code-content, .debug-view-content { +.edit-code-content { padding: 0px !important; } +.debug-view-content, .share-ls-content { + padding: 5px !important; +} + .left-align { text-align: left; } -- cgit v1.2.3 From c9faf80c4988ef52fb2047763f455e7c30f4bbaf Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Fri, 27 May 2022 01:00:22 -0500 Subject: wip --- src/web/src/components/System/Shares/index.js | 122 ++++++++++++++++++-------- 1 file changed, 85 insertions(+), 37 deletions(-) (limited to 'src/web') diff --git a/src/web/src/components/System/Shares/index.js b/src/web/src/components/System/Shares/index.js index aa8db54a..ff054a97 100644 --- a/src/web/src/components/System/Shares/index.js +++ b/src/web/src/components/System/Shares/index.js @@ -1,31 +1,48 @@ import React, { useState, useEffect } from 'react'; import { toast } from 'react-toastify'; +import { orderBy } from 'lodash'; import * as sharesLib from '../../../lib/shares'; -import { LoaderSegment, PlaceholderSegment, ShrinkableButton, Switch } from '../../Shared'; +import { + CodeEditor, + LoaderSegment, + PlaceholderSegment, + ShrinkableButton, + Switch, +} from '../../Shared'; + import Share from './Share'; import { Modal, Button, Divider, + Table, + Icon, } from 'semantic-ui-react'; +import { Link } from 'react-router-dom'; const Index = ({ state }) => { const [loading, setLoading] = useState(true); const [shares, setShares] = useState([]); - const [everything, setEverything] = useState(); const [modal, setModal] = useState(false); + const { filling, filled, faulted, fillProgress, directories, files, excludedDirectories } = state; + useEffect(() => { getAll(); }, []); + useEffect(() => { + if (filled) { + getAll(); + } + }, [filled]); + const getAll = async () => { try { setLoading(true); setShares(await sharesLib.getAll()); - setLoading(false); } catch (error) { console.error(error); toast.error(error?.response?.data ?? error?.message ?? error); @@ -34,20 +51,28 @@ const Index = ({ state }) => { } }; - const browse = async ({ id }) => { - setEverything(await sharesLib.browse({ id })); - setModal(true); - }; + const browse = async (share) => { + const { id, localPath, remotePath } = share; + const contents = await sharesLib.browse({ id }); - const rescan = async () => { - await sharesLib.rescan(); - }; + var directories = contents.map(directory => { + const lines = [directory.name.replace(remotePath, localPath)]; - if (loading) { - return LoaderSegment; - } + orderBy(directory.files, 'filename').forEach(file => { + console.log(file); + lines.push('\t' + file.filename.replace(remotePath, '')); + }); - const { filling, filled, faulted, fillProgress, directories, files, excludedDirectories } = state; + lines.push(''); + + return lines.join('\n'); + }); + + setModal({ id, localPath, remotePath, contents: directories.join('\n') }); + }; + + const shared = shares.filter(share => !share.isExcluded); + const excluded = shares.filter(share => share.isExcluded); return ( <> @@ -58,42 +83,65 @@ const Index = ({ state }) => { loading={filling} disabled={filling} mediaQuery={'(max-width: 516px)'} - onClick={rescan} + onClick={() => sharesLib.rescan()} >{filling ? 'Scanning shares' : 'Rescan Shares'}
} + filling={loading && } > -
-
    - {shares.map(share => ( - browse({ id: share.id })}/> - ))} -
-
-            {JSON.stringify(state, null, 2)}
-          
-
+ + + + Local Path + Directories + Files + Alias + Remote Path + + + + {shared.map((share, index) => ( + browse(share)}> + + {share.localPath} + + {share.directories} + {share.files} + {share.alias} + {share.remotePath} + ))} + +
+ + + + Excluded Paths + + + + {excluded.map((share, index) => ( + {share.localPath} + ))} + +
setModal(false)} - style={{ color: 'red' }} > - Delete Your Account - -
-            {JSON.stringify(everything, null, 2)}
-          
+ {modal.localPath} + + - -
-- cgit v1.2.3 From 21c08b38f13d5ae8a039e1aab5bc5c52508f06b8 Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Fri, 27 May 2022 01:12:46 -0500 Subject: set minimum height of editor, show loader while rescanning --- src/web/src/components/System/Info/index.js | 13 ++++++------- src/web/src/components/System/Options/DebugModal.js | 13 ++++++------- src/web/src/components/System/Options/EditModal.js | 1 + src/web/src/components/System/Options/index.js | 13 ++++++------- src/web/src/components/System/Shares/index.js | 3 ++- 5 files changed, 21 insertions(+), 22 deletions(-) (limited to 'src/web') diff --git a/src/web/src/components/System/Info/index.js b/src/web/src/components/System/Info/index.js index f640716e..d1b504e2 100644 --- a/src/web/src/components/System/Info/index.js +++ b/src/web/src/components/System/Info/index.js @@ -60,13 +60,12 @@ const Info = ({ state }) => { />
-
- -
+ ); }; diff --git a/src/web/src/components/System/Options/DebugModal.js b/src/web/src/components/System/Options/DebugModal.js index 2f01eb16..21514c57 100644 --- a/src/web/src/components/System/Options/DebugModal.js +++ b/src/web/src/components/System/Options/DebugModal.js @@ -47,13 +47,12 @@ const DebugModal = ({ open, onClose }) => { } > -
- -
+
diff --git a/src/web/src/components/System/Options/EditModal.js b/src/web/src/components/System/Options/EditModal.js index b02cbf99..cfcbd3b6 100644 --- a/src/web/src/components/System/Options/EditModal.js +++ b/src/web/src/components/System/Options/EditModal.js @@ -80,6 +80,7 @@ const EditModal = ({ open, onClose }) => { {...{ className: (yamlError || updateError) ? 'edit-code-container-error' : 'edit-code-container' }} > update(value)} /> diff --git a/src/web/src/components/System/Options/index.js b/src/web/src/components/System/Options/index.js index 894199e9..afc1f545 100644 --- a/src/web/src/components/System/Options/index.js +++ b/src/web/src/components/System/Options/index.js @@ -54,13 +54,12 @@ const Index = ({ options }) => {
-
- -
+ setDebugModal(false)} diff --git a/src/web/src/components/System/Shares/index.js b/src/web/src/components/System/Shares/index.js index ff054a97..6ede4cbc 100644 --- a/src/web/src/components/System/Shares/index.js +++ b/src/web/src/components/System/Shares/index.js @@ -88,7 +88,7 @@ const Index = ({ state }) => { } + filling={(loading || filling) && } > @@ -134,6 +134,7 @@ const Index = ({ state }) => { {modal.localPath} Date: Fri, 27 May 2022 08:05:15 -0500 Subject: add fake delay to prevent flashing when navigating --- src/web/src/components/System/Info/index.js | 30 ++++++++++++++------ src/web/src/components/System/Options/index.js | 38 +++++++++++++++++--------- 2 files changed, 47 insertions(+), 21 deletions(-) (limited to 'src/web') diff --git a/src/web/src/components/System/Info/index.js b/src/web/src/components/System/Info/index.js index d1b504e2..063303ac 100644 --- a/src/web/src/components/System/Info/index.js +++ b/src/web/src/components/System/Info/index.js @@ -1,4 +1,4 @@ -import React from 'react'; +import React, { useState, useEffect } from 'react'; import YAML from 'yaml'; import { restart, shutdown, getVersion } from '../../../lib/application'; @@ -7,11 +7,19 @@ import { Modal, Header, Divider } from 'semantic-ui-react'; import { CodeEditor, + LoaderSegment, ShrinkableButton, + Switch, } from '../../Shared'; const Info = ({ state }) => { - const stateAsYaml = YAML.stringify(state, { simpleKeys: true, sortMapEntries: true }); + const [contents, setContents] = useState(); + + useEffect(() => { + setTimeout(() => { + setContents(YAML.stringify(state, { simpleKeys: true, sortMapEntries: true })); + }, 250); + }, [state]); return ( <> @@ -21,6 +29,7 @@ const Info = ({ state }) => { icon='refresh' mediaQuery='(max-width: 516px)' primary + disabled={!contents} onClick={() => getVersion({ forceCheck: true })} > Check for Updates @@ -32,6 +41,7 @@ const Info = ({ state }) => { icon='shutdown' mediaQuery='(max-width: 516px)' negative + disabled={!contents} > Shut Down @@ -48,6 +58,7 @@ const Info = ({ state }) => { icon='redo' mediaQuery='(max-width: 516px)' negative + disabled={!contents} > Restart @@ -60,12 +71,15 @@ const Info = ({ state }) => { /> - + } + > + + ); }; diff --git a/src/web/src/components/System/Options/index.js b/src/web/src/components/System/Options/index.js index afc1f545..16928a29 100644 --- a/src/web/src/components/System/Options/index.js +++ b/src/web/src/components/System/Options/index.js @@ -1,4 +1,4 @@ -import React, { useState } from 'react'; +import React, { useState, useEffect } from 'react'; import YAML from 'yaml'; import DebugModal from './DebugModal'; @@ -7,30 +7,38 @@ import EditModal from './EditModal'; import { Divider } from 'semantic-ui-react'; import { CodeEditor, + LoaderSegment, ShrinkableButton, + Switch, } from '../../Shared'; const Index = ({ options }) => { const [debugModal, setDebugModal] = useState(false); const [editModal, setEditModal] = useState(false); + const [contents, setContents] = useState(); + + useEffect(() => { + setTimeout(() => { + setContents(YAML.stringify(options, { simpleKeys: true, sortMapEntries: true })); + }, 250); + }, [options]); const { remoteConfiguration, debug } = options; - const optionsAsYaml = YAML.stringify(options, { simpleKeys: true, sortMapEntries: true }); - - const DebugButton = () => { + const DebugButton = ({ ...props }) => { if (!debug) return <>; return setDebugModal(true)} + {...props} > Debug View ; }; - const EditButton = () => { + const EditButton = ({ ...props }) => { if (!remoteConfiguration) { return { icon='edit' mediaQuery='(max-width: 516px)' onClick={() => setEditModal(true)} + {...props} >Edit; }; return ( <>
- - + +
- + } + > + + setDebugModal(false)} -- cgit v1.2.3 From 46a33d3974bfeb3cfa0a5bb68e7278ff9fe2db8f Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Fri, 27 May 2022 08:05:33 -0500 Subject: use standard LoaderSegment --- src/web/src/components/System/Logs/index.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/web') diff --git a/src/web/src/components/System/Logs/index.js b/src/web/src/components/System/Logs/index.js index 51b48f44..b30b0a43 100644 --- a/src/web/src/components/System/Logs/index.js +++ b/src/web/src/components/System/Logs/index.js @@ -1,7 +1,8 @@ import React, { Component } from 'react'; -import { Table, Loader, Dimmer } from 'semantic-ui-react'; +import { Table } from 'semantic-ui-react'; import { createLogsHubConnection } from '../../../lib/hubFactory'; +import { LoaderSegment } from '../../Shared'; import '../System.css'; @@ -50,7 +51,7 @@ class Logs extends Component { return (
- {!connected && } + {!connected && } {connected &&
-- cgit v1.2.3 From adcc26ed221085f0cabd827fbd6b06a85fdef12d Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Fri, 27 May 2022 08:05:51 -0500 Subject: hide banner before loaded --- src/web/src/components/System/Options/EditModal.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/web') diff --git a/src/web/src/components/System/Options/EditModal.js b/src/web/src/components/System/Options/EditModal.js index cfcbd3b6..d435bfd8 100644 --- a/src/web/src/components/System/Options/EditModal.js +++ b/src/web/src/components/System/Options/EditModal.js @@ -7,6 +7,7 @@ import { getYamlLocation, getYaml, validateYaml, updateYaml } from '../../../lib import { PlaceholderSegment, Switch, + Div, } from '../../Shared'; const EditModal = ({ open, onClose }) => { @@ -67,9 +68,11 @@ const EditModal = ({ open, onClose }) => { Edit Options - - Editing {location} - + Date: Fri, 27 May 2022 08:06:09 -0500 Subject: move contents modal to a separate file --- .../src/components/System/Shares/ContentsModal.js | 80 ++++++++++++++++++++ src/web/src/components/System/Shares/index.js | 85 ++++++---------------- 2 files changed, 102 insertions(+), 63 deletions(-) create mode 100644 src/web/src/components/System/Shares/ContentsModal.js (limited to 'src/web') diff --git a/src/web/src/components/System/Shares/ContentsModal.js b/src/web/src/components/System/Shares/ContentsModal.js new file mode 100644 index 00000000..b9f0d86d --- /dev/null +++ b/src/web/src/components/System/Shares/ContentsModal.js @@ -0,0 +1,80 @@ +import React, { useEffect, useState } from 'react'; +import { orderBy } from 'lodash'; + +import { browse } from '../../../lib/shares'; + +import { + Modal, + Button, + Icon, +} from 'semantic-ui-react'; + +import { + CodeEditor, LoaderSegment, Switch, +} from '../../Shared'; + +const ContentsModal = ({ share, onClose }) => { + const [loading, setLoading] = useState(true); + const [contents, setContents] = useState(); + + const { id, localPath, remotePath } = share || {}; + + useEffect(() => { + const fetch = async () => { + setLoading(true); + + const contents = await browse({ id }); + + var directories = contents.map(directory => { + const lines = [directory.name.replace(remotePath, localPath)]; + + orderBy(directory.files, 'filename').forEach(file => { + lines.push('\t' + file.filename.replace(remotePath, '')); + }); + + lines.push(''); + + return lines.join('\n'); + }); + + setContents(directories.join('\n')); + setLoading(false); + }; + + if (id) { + fetch(); + } else { + setLoading(true); + setContents(); + } + }, [id]); // eslint-disable-line react-hooks/exhaustive-deps + + return ( + + {localPath} + + } + > + + + + + + + + ); +}; + +export default ContentsModal; \ 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 6ede4cbc..8da95034 100644 --- a/src/web/src/components/System/Shares/index.js +++ b/src/web/src/components/System/Shares/index.js @@ -1,33 +1,29 @@ import React, { useState, useEffect } from 'react'; import { toast } from 'react-toastify'; -import { orderBy } from 'lodash'; import * as sharesLib from '../../../lib/shares'; import { - CodeEditor, - LoaderSegment, - PlaceholderSegment, + LoaderSegment, ShrinkableButton, Switch, + Div, } from '../../Shared'; -import Share from './Share'; +import ContentsModal from './ContentsModal'; import { - Modal, - Button, Divider, Table, Icon, } from 'semantic-ui-react'; import { Link } from 'react-router-dom'; -const Index = ({ state }) => { +const Index = ({ state = {} } = {}) => { const [loading, setLoading] = useState(true); const [shares, setShares] = useState([]); const [modal, setModal] = useState(false); - const { filling, filled, faulted, fillProgress, directories, files, excludedDirectories } = state; + const { filling, filled, fillProgress } = state; useEffect(() => { getAll(); @@ -51,26 +47,6 @@ const Index = ({ state }) => { } }; - const browse = async (share) => { - const { id, localPath, remotePath } = share; - const contents = await sharesLib.browse({ id }); - - var directories = contents.map(directory => { - const lines = [directory.name.replace(remotePath, localPath)]; - - orderBy(directory.files, 'filename').forEach(file => { - console.log(file); - lines.push('\t' + file.filename.replace(remotePath, '')); - }); - - lines.push(''); - - return lines.join('\n'); - }); - - setModal({ id, localPath, remotePath, contents: directories.join('\n') }); - }; - const shared = shares.filter(share => !share.isExcluded); const excluded = shares.filter(share => share.isExcluded); @@ -81,7 +57,7 @@ const Index = ({ state }) => { primary icon='refresh' loading={filling} - disabled={filling} + disabled={filling || loading} mediaQuery={'(max-width: 516px)'} onClick={() => sharesLib.rescan()} >{filling ? 'Scanning shares' : 'Rescan Shares'} @@ -102,7 +78,7 @@ const Index = ({ state }) => { {shared.map((share, index) => ( - browse(share)}> + setModal(share)}> {share.localPath} @@ -113,39 +89,22 @@ const Index = ({ state }) => { ))}
- - - - Excluded Paths - - - - {excluded.map((share, index) => ( - {share.localPath} - ))} - -
+
- setModal(false)} - > - {modal.localPath} - - - - - - - + setModal(false)}/> ); }; -- cgit v1.2.3 From 7fdcc7c2cafd81db446c2ea96b3d620a7a0adf0f Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Fri, 27 May 2022 08:07:31 -0500 Subject: fix loaders not being shown in modals --- src/web/src/components/App.css | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/web') diff --git a/src/web/src/components/App.css b/src/web/src/components/App.css index 82e74b71..9c06bf34 100644 --- a/src/web/src/components/App.css +++ b/src/web/src/components/App.css @@ -130,4 +130,13 @@ body { .view:last-child { margin-bottom: 17px; +} + +/* https://github.com/Semantic-Org/Semantic-UI-React/issues/3133#issuecomment-418766748 */ +.ui.dimmer .ui.modal-loader.loader:before { + border-color: rgba(0,0,0,.1); +} + +.ui.dimmer .ui.modal-loader.loader:after { + border-color: #767676 transparent transparent; } \ No newline at end of file -- cgit v1.2.3 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 (limited to 'src/web') 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 From a1a2ab7961c2107e063e77020877d82e36c7c296 Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Wed, 1 Jun 2022 10:13:45 -0500 Subject: add small placeholder css --- src/web/src/components/App.css | 15 ++++++++++++++- src/web/src/components/Shared/PlaceholderSegment.js | 19 +++++++++++-------- 2 files changed, 25 insertions(+), 9 deletions(-) (limited to 'src/web') diff --git a/src/web/src/components/App.css b/src/web/src/components/App.css index 9c06bf34..78b029b8 100644 --- a/src/web/src/components/App.css +++ b/src/web/src/components/App.css @@ -101,10 +101,23 @@ body { line-height: 1.15 !important; } -.placeholder-segment { +.placeholder-segment, .placeholder-segment-small { opacity: .25; } +.placeholder-segment-small { + min-height: 6rem !important; +} + +.placeholder-segment-small > .ui.icon.header { + font-size: 1em !important; +} + +.placeholder-segment-small > .ui.icon.header > i { + font-size: 2em !important; +} + + .menu-icon-group { font-size: 1.71428571em !important; margin: 0 auto .5rem !important; diff --git a/src/web/src/components/Shared/PlaceholderSegment.js b/src/web/src/components/Shared/PlaceholderSegment.js index 0307b9e0..31ac8e9e 100644 --- a/src/web/src/components/Shared/PlaceholderSegment.js +++ b/src/web/src/components/Shared/PlaceholderSegment.js @@ -2,13 +2,16 @@ import React from 'react'; import { Segment, Header, Icon } from 'semantic-ui-react'; -const PlaceholderSegment = ({ icon, caption, ...rest }) => ( - -
- - {caption} -
-
-); +const PlaceholderSegment = ({ icon, caption, size, ...rest }) => { + const className = size === 'small' ? 'placeholder-segment-small' : 'placeholder-segment'; + + return ( + +
+ + {caption} +
+
); +}; export default PlaceholderSegment; \ No newline at end of file -- cgit v1.2.3 From ccd0e524b7c2d60362ea272140080e5cc52ab08a Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Wed, 1 Jun 2022 10:29:45 -0500 Subject: show placeholder if no shares are configured --- src/web/src/components/System/Shares/index.js | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/web') diff --git a/src/web/src/components/System/Shares/index.js b/src/web/src/components/System/Shares/index.js index 5fe59cb2..53018b45 100644 --- a/src/web/src/components/System/Shares/index.js +++ b/src/web/src/components/System/Shares/index.js @@ -4,6 +4,7 @@ import { toast } from 'react-toastify'; import * as sharesLib from '../../../lib/shares'; import { LoaderSegment, + PlaceholderSegment, ShrinkableButton, Switch, } from '../../Shared'; @@ -64,6 +65,12 @@ const Index = ({ state = {} } = {}) => { } + empty={shared.length === 0 && + } > -- cgit v1.2.3 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(-) (limited to 'src/web') 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 From f67ce78da5d9f6dfb7f4967217ecfbff2cd05dd8 Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Thu, 2 Jun 2022 07:29:06 -0500 Subject: use console.error when logging errors --- src/web/src/components/Browse/Browse.js | 2 +- src/web/src/components/Transfers/TransferGroup.js | 4 ++-- src/web/src/components/Transfers/Transfers.js | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) (limited to 'src/web') diff --git a/src/web/src/components/Browse/Browse.js b/src/web/src/components/Browse/Browse.js index e1a3c7f0..93cf31f0 100644 --- a/src/web/src/components/Browse/Browse.js +++ b/src/web/src/components/Browse/Browse.js @@ -90,7 +90,7 @@ class Browse extends Component { try { localStorage.setItem('soulseek-example-browse-state', lzString.compress(JSON.stringify(this.state))); } catch (error) { - console.log(error); + console.error(error); } }; diff --git a/src/web/src/components/Transfers/TransferGroup.js b/src/web/src/components/Transfers/TransferGroup.js index 023c18a0..ad4ab969 100644 --- a/src/web/src/components/Transfers/TransferGroup.js +++ b/src/web/src/components/Transfers/TransferGroup.js @@ -70,7 +70,7 @@ class TransferGroup extends Component { try { await transfers.download({username, files: [{filename, size }] }); } catch (error) { - console.log(error); + console.error(error); } }; @@ -80,7 +80,7 @@ class TransferGroup extends Component { try { await transfers.getPlaceInQueue({ username, id }); } catch (error) { - console.log(error); + console.error(error); } }; diff --git a/src/web/src/components/Transfers/Transfers.js b/src/web/src/components/Transfers/Transfers.js index 638c0d67..7820400e 100644 --- a/src/web/src/components/Transfers/Transfers.js +++ b/src/web/src/components/Transfers/Transfers.js @@ -64,7 +64,7 @@ const Transfers = ({ direction, server }) => { await transfersLib.download({username, files: [{filename, size }] }); if (!suppressStateChange) setRetrying(false); } catch (error) { - console.log(error); + console.error(error); toast.error(error?.response?.data ?? error?.message ?? error); if (!suppressStateChange) setRetrying(false); } @@ -84,7 +84,7 @@ const Transfers = ({ direction, server }) => { await transfersLib.cancel({ direction, username, id }); if (!suppressStateChange) setCancelling(false); } catch (error) { - console.log(error); + console.error(error); toast.error(error?.response?.data ?? error?.message ?? error); if (!suppressStateChange) setCancelling(false); } @@ -104,7 +104,7 @@ const Transfers = ({ direction, server }) => { await transfersLib.cancel({ direction, username, id, remove: true }); if (!suppressStateChange) setRemoving(false); } catch (error) { - console.log(error); + console.error(error); toast.error(error?.response?.data ?? error?.message ?? error); if (!suppressStateChange) setRemoving(false); } -- cgit v1.2.3 From c3b6ad913e14e58d04d5efc16d4f2cc92a3a1b4d Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Thu, 2 Jun 2022 07:29:40 -0500 Subject: fix state, use exclamation icon for pending action --- src/web/src/components/App.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/web') diff --git a/src/web/src/components/App.js b/src/web/src/components/App.js index 7f488643..fc3f856e 100644 --- a/src/web/src/components/App.js +++ b/src/web/src/components/App.js @@ -116,8 +116,9 @@ class App extends Component { render = () => { const { login, applicationState = {}, applicationOptions = {}, error, initialized, retriesExhausted } = this.state; - const { version = {}, server, pendingReconnect, pendingRestart, pendingShareRescan } = applicationState; + const { version = {}, server, pendingReconnect, pendingRestart, shares = {} } = applicationState; const { isUpdateAvailable, current, latest } = version; + const { scanPending: pendingShareRescan } = shares; if (!initialized) { return ; @@ -215,7 +216,7 @@ class App extends Component { {(pendingReconnect || pendingRestart || pendingShareRescan) && - + Pending Action } -- cgit v1.2.3 From 14f2a4d076b96999f74979ae693ba36fb720f60c Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Thu, 2 Jun 2022 07:58:48 -0500 Subject: add visual cues when user adction is required --- src/web/src/components/App.js | 2 +- src/web/src/components/System/Info/index.js | 5 ++++- src/web/src/components/System/Shares/index.js | 18 ++++++++------- src/web/src/components/System/System.js | 32 +++++++++++++++++---------- 4 files changed, 35 insertions(+), 22 deletions(-) (limited to 'src/web') diff --git a/src/web/src/components/App.js b/src/web/src/components/App.js index fc3f856e..206cea34 100644 --- a/src/web/src/components/App.js +++ b/src/web/src/components/App.js @@ -203,7 +203,7 @@ class App extends Component { {server?.isConnected && disconnect()} > - Connected + Connected } {(!server?.isConnected) && connect()} diff --git a/src/web/src/components/System/Info/index.js b/src/web/src/components/System/Info/index.js index 063303ac..7068e047 100644 --- a/src/web/src/components/System/Info/index.js +++ b/src/web/src/components/System/Info/index.js @@ -21,6 +21,8 @@ const Info = ({ state }) => { }, 250); }, [state]); + const { pendingRestart } = state; + return ( <>
@@ -57,7 +59,8 @@ const Info = ({ state }) => { Restart diff --git a/src/web/src/components/System/Shares/index.js b/src/web/src/components/System/Shares/index.js index 5fe59cb2..ceb5746c 100644 --- a/src/web/src/components/System/Shares/index.js +++ b/src/web/src/components/System/Shares/index.js @@ -22,17 +22,18 @@ const Index = ({ state = {} } = {}) => { const [shares, setShares] = useState([]); const [modal, setModal] = useState(false); - const { filling, filled, fillProgress } = state; + const { scanning, scanProgress, scanPending } = state; + const scanned = !scanning; useEffect(() => { getAll(); }, []); useEffect(() => { - if (filled) { + if (scanned) { getAll(); } - }, [filled]); + }, [scanned]); const getAll = async () => { try { @@ -53,17 +54,18 @@ const Index = ({ state = {} } = {}) => { <>
sharesLib.rescan()} - >{filling ? 'Scanning shares' : 'Rescan Shares'} + >{scanning ? 'Scanning shares' : 'Rescan Shares'}
} + filling={(loading || scanning) && {Math.round(scanProgress * 100)}%} > diff --git a/src/web/src/components/System/System.js b/src/web/src/components/System/System.js index 6c0229cf..2be10f81 100644 --- a/src/web/src/components/System/System.js +++ b/src/web/src/components/System/System.js @@ -1,7 +1,7 @@ import React from 'react'; import { useRouteMatch, useHistory, Redirect } from 'react-router-dom'; -import { Segment, Tab } from 'semantic-ui-react'; +import { Segment, Tab, Menu, Icon } from 'semantic-ui-react'; import './System.css'; @@ -9,6 +9,7 @@ import Info from './Info'; import Logs from './Logs'; import Options from './Options'; import Shares from './Shares'; +import { Switch } from '../Shared'; const System = ({ state = {}, options = {} }) => { const { params: { tab }, ...route } = useRouteMatch(); @@ -17,11 +18,15 @@ const System = ({ state = {}, options = {} }) => { const panes = [ { route: 'info', - menuItem: { - key: 'info', - icon: 'info', - content: 'Info', - }, + menuItem: ( + } + > + + + Info + ), render: () => , }, { @@ -35,12 +40,15 @@ const System = ({ state = {}, options = {} }) => { }, { route: 'shares', - menuItem: { - key: 'shares', - icon: 'share external', - content: 'Shares', - }, - render: () => , + menuItem: ( + } + > + + + Shares + ), + render: () => , }, { route: 'logs', -- cgit v1.2.3 From 9e0013c0317adbaa007fce8dbea06928b1d159ef Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Thu, 2 Jun 2022 08:30:28 -0500 Subject: remove unused import --- src/web/src/components/Search/List/SearchList.js | 1 - 1 file changed, 1 deletion(-) (limited to 'src/web') diff --git a/src/web/src/components/Search/List/SearchList.js b/src/web/src/components/Search/List/SearchList.js index 5a77149b..11cfcb22 100644 --- a/src/web/src/components/Search/List/SearchList.js +++ b/src/web/src/components/Search/List/SearchList.js @@ -9,7 +9,6 @@ import { Table, Icon, Loader, - List, } from 'semantic-ui-react'; const SearchList = ({ -- cgit v1.2.3 From a8f5f652eec420922f01d3009d354d43d72fd994 Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Thu, 2 Jun 2022 10:27:12 -0500 Subject: fix header button alignment on search detail --- .../src/components/Search/Detail/SearchDetailHeader.js | 6 +++--- src/web/src/components/Search/Search.css | 17 ++++++++++++----- 2 files changed, 15 insertions(+), 8 deletions(-) (limited to 'src/web') diff --git a/src/web/src/components/Search/Detail/SearchDetailHeader.js b/src/web/src/components/Search/Detail/SearchDetailHeader.js index ac613249..2071540f 100644 --- a/src/web/src/components/Search/Detail/SearchDetailHeader.js +++ b/src/web/src/components/Search/Detail/SearchDetailHeader.js @@ -63,11 +63,11 @@ const SearchDetailHeader = ({ // if the screen is less than 684 pixels, display the action buttons in a new segment, with full text. return ( <> - -
+ +
{searchText}
- {!isTinyScreen &&
+ {!isTinyScreen &&
} diff --git a/src/web/src/components/Search/Search.css b/src/web/src/components/Search/Search.css index f66a3bc7..ca31d308 100644 --- a/src/web/src/components/Search/Search.css +++ b/src/web/src/components/Search/Search.css @@ -105,12 +105,19 @@ width: 5px !important; } -.search-detail-header { +.search-detail-header-segment { + margin-top: 15px !important; + height: 78px !important; + padding-top: 20px !important; + display: flex; +} + +.search-detail-header-segment > .header { font-weight: normal !important; - margin-top: 12px !important; + margin-top: 8px !important; } -.search-detail-action-button { - float: right; - margin-top: -48px !important; +.search-detail-header-buttons { + display: inline; + margin-left: auto; } \ No newline at end of file -- cgit v1.2.3