aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJP Dillingham <jp@dillingham.me>2026-06-09 17:52:07 -0500
committerJP Dillingham <jp@dillingham.me>2026-06-09 17:52:07 -0500
commit6a5e80aee96154cd0adaf74ae2a891bd1b329a00 (patch)
tree83fab17a73c4bfac3c1e4372383115d6c0b88479
parent0990bab6b4db1d719fda714a094af1f8c81db4fd (diff)
downloadslskd-6a5e80aee96154cd0adaf74ae2a891bd1b329a00.tar.gz
stub app footer
-rw-r--r--src/web/src/components/App.css33
-rw-r--r--src/web/src/components/App.jsx234
-rw-r--r--src/web/src/components/AppFooter.jsx48
3 files changed, 202 insertions, 113 deletions
diff --git a/src/web/src/components/App.css b/src/web/src/components/App.css
index 054fe1c4..ecadc1d5 100644
--- a/src/web/src/components/App.css
+++ b/src/web/src/components/App.css
@@ -123,6 +123,12 @@ body {
.pushable > .pusher.app-content {
min-height: calc(100% - 71px);
background: var(--background-color);
+ display: flex;
+ flex-direction: column;
+}
+
+.app-content-body {
+ flex: 1;
}
.navigation {
@@ -264,4 +270,31 @@ body {
.message {
padding: 8px 12px 8px 12px !important;
+}
+
+.footer.ui.menu {
+ position: sticky !important;
+ bottom: 0 !important;
+ margin: 0 !important;
+ border-radius: 0 !important;
+}
+
+.footer-logo {
+ height: 14px;
+ width: auto;
+ margin-right: 6px;
+ vertical-align: middle;
+}
+
+.footer-version {
+ margin-left: 6px;
+ font-family: monospace;
+ font-size: 11px;
+ opacity: 0.6;
+}
+
+.footer-license {
+ margin-left: 6px;
+ font-size: 11px;
+ opacity: 0.4;
} \ No newline at end of file
diff --git a/src/web/src/components/App.jsx b/src/web/src/components/App.jsx
index 92fe925b..8e155b8b 100644
--- a/src/web/src/components/App.jsx
+++ b/src/web/src/components/App.jsx
@@ -7,6 +7,7 @@ import { connect, disconnect } from '../lib/server';
import * as session from '../lib/session';
import { isPassthroughEnabled } from '../lib/token';
import AppContext from './AppContext';
+import AppFooter from './AppFooter';
import Browse from './Browse/Browse';
import Chat from './Chat/Chat';
import LoginForm from './LoginForm';
@@ -522,122 +523,129 @@ class App extends Component {
</Menu>
</Sidebar>
<Sidebar.Pusher className="app-content">
- <AppContext.Provider
- // eslint-disable-next-line no-warning-comments
- // TODO: needs useMemo, but class component. yolo for now.
- // eslint-disable-next-line react/jsx-no-constructed-context-values
- value={{ options: applicationOptions, state: applicationState }}
- >
- {isAgent ? (
- <Switch>
- <Route
- path={`${urlBase}/system/:tab?`}
- render={(props) =>
- this.withTokenCheck(
- <System
- {...props}
- options={applicationOptions}
- state={applicationState}
- />,
- )
- }
- />
- <Redirect
- from="*"
- to={`${urlBase}/system`}
- />
- </Switch>
- ) : (
- <Switch>
- <Route
- path={`${urlBase}/searches/:id?`}
- render={(props) =>
- this.withTokenCheck(
- <div className="view">
- <Searches
- server={applicationState.server}
+ <div className="app-content-body">
+ <AppContext.Provider
+ // eslint-disable-next-line no-warning-comments
+ // TODO: needs useMemo, but class component. yolo for now.
+ // eslint-disable-next-line react/jsx-no-constructed-context-values
+ value={{ options: applicationOptions, state: applicationState }}
+ >
+ {isAgent ? (
+ <Switch>
+ <Route
+ path={`${urlBase}/system/:tab?`}
+ render={(props) =>
+ this.withTokenCheck(
+ <System
{...props}
- />
- </div>,
- )
- }
- />
- <Route
- path={`${urlBase}/browse`}
- render={(props) =>
- this.withTokenCheck(<Browse {...props} />)
- }
- />
- <Route
- path={`${urlBase}/users`}
- render={(props) =>
- this.withTokenCheck(<Users {...props} />)
- }
- />
- <Route
- path={`${urlBase}/chat`}
- render={(props) =>
- this.withTokenCheck(
- <Chat
- {...props}
- state={applicationState}
- />,
- )
- }
- />
- <Route
- path={`${urlBase}/rooms`}
- render={(props) =>
- this.withTokenCheck(<Rooms {...props} />)
- }
- />
- <Route
- path={`${urlBase}/uploads`}
- render={(props) =>
- this.withTokenCheck(
- <div className="view">
- <Transfers
+ options={applicationOptions}
+ state={applicationState}
+ />,
+ )
+ }
+ />
+ <Redirect
+ from="*"
+ to={`${urlBase}/system`}
+ />
+ </Switch>
+ ) : (
+ <Switch>
+ <Route
+ path={`${urlBase}/searches/:id?`}
+ render={(props) =>
+ this.withTokenCheck(
+ <div className="view">
+ <Searches
+ server={applicationState.server}
+ {...props}
+ />
+ </div>,
+ )
+ }
+ />
+ <Route
+ path={`${urlBase}/browse`}
+ render={(props) =>
+ this.withTokenCheck(<Browse {...props} />)
+ }
+ />
+ <Route
+ path={`${urlBase}/users`}
+ render={(props) =>
+ this.withTokenCheck(<Users {...props} />)
+ }
+ />
+ <Route
+ path={`${urlBase}/chat`}
+ render={(props) =>
+ this.withTokenCheck(
+ <Chat
{...props}
- direction="upload"
- />
- </div>,
- )
- }
- />
- <Route
- path={`${urlBase}/downloads`}
- render={(props) =>
- this.withTokenCheck(
- <div className="view">
- <Transfers
+ state={applicationState}
+ />,
+ )
+ }
+ />
+ <Route
+ path={`${urlBase}/rooms`}
+ render={(props) =>
+ this.withTokenCheck(<Rooms {...props} />)
+ }
+ />
+ <Route
+ path={`${urlBase}/uploads`}
+ render={(props) =>
+ this.withTokenCheck(
+ <div className="view">
+ <Transfers
+ {...props}
+ direction="upload"
+ />
+ </div>,
+ )
+ }
+ />
+ <Route
+ path={`${urlBase}/downloads`}
+ render={(props) =>
+ this.withTokenCheck(
+ <div className="view">
+ <Transfers
+ {...props}
+ direction="download"
+ server={applicationState.server}
+ />
+ </div>,
+ )
+ }
+ />
+ <Route
+ path={`${urlBase}/system/:tab?`}
+ render={(props) =>
+ this.withTokenCheck(
+ <System
{...props}
- direction="download"
- server={applicationState.server}
- />
- </div>,
- )
- }
- />
- <Route
- path={`${urlBase}/system/:tab?`}
- render={(props) =>
- this.withTokenCheck(
- <System
- {...props}
- options={applicationOptions}
- state={applicationState}
- theme={theme}
- />,
- )
- }
- />
- <Redirect
- from="*"
- to={`${urlBase}/searches`}
- />
- </Switch>
- )}
- </AppContext.Provider>
+ options={applicationOptions}
+ state={applicationState}
+ theme={theme}
+ />,
+ )
+ }
+ />
+ <Redirect
+ from="*"
+ to={`${urlBase}/searches`}
+ />
+ </Switch>
+ )}
+ </AppContext.Provider>
+ </div>
+ <AppFooter
+ server={server}
+ user={user}
+ version={version}
+ />
</Sidebar.Pusher>
</Sidebar.Pushable>
<ToastContainer
diff --git a/src/web/src/components/AppFooter.jsx b/src/web/src/components/AppFooter.jsx
new file mode 100644
index 00000000..06dd8378
--- /dev/null
+++ b/src/web/src/components/AppFooter.jsx
@@ -0,0 +1,48 @@
+import React from 'react';
+import { Icon, Menu } from 'semantic-ui-react';
+
+const AppFooter = ({ server = {}, user = {}, version = {} }) => {
+ const { isConnected } = server;
+ const { username } = user;
+ const { current } = version;
+
+ return (
+ <Menu
+ className="footer"
+ inverted
+ >
+ <Menu.Item>
+ <Icon
+ color={isConnected ? 'green' : 'red'}
+ name="circle"
+ />
+ {isConnected ? username : 'Disconnected'}
+ </Menu.Item>
+ <Menu.Item>
+ <Icon name="arrow up" />—
+ </Menu.Item>
+ <Menu.Item>
+ <Icon name="arrow down" />—
+ </Menu.Item>
+ <Menu.Menu position="right">
+ <Menu.Item
+ as="a"
+ href="https://github.com/slskd/slskd"
+ rel="noreferrer"
+ target="_blank"
+ >
+ <img
+ alt=""
+ className="footer-logo"
+ src="/favicon.ico"
+ />
+ slskd
+ {current && <span className="footer-version">{current}</span>}
+ <span className="footer-license">AGPL-3.0</span>
+ </Menu.Item>
+ </Menu.Menu>
+ </Menu>
+ );
+};
+
+export default AppFooter;