Skip to content

Commit bf95bc0

Browse files
committed
Clean up dashboard server remnants
1 parent 4837c8b commit bf95bc0

4 files changed

Lines changed: 7 additions & 27 deletions

File tree

README.md

Lines changed: 5 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -41,18 +41,12 @@ Key concepts for programmers:
4141
3. **Apply Effects**: Use the `EffectsManager` to apply visual effects to the canvas.
4242
4. **Transmit Data**: Socket channels handle sending the rendered canvas data to the remote LED controllers.
4343

44-
The project includes a REST API via the `WebServer` class to control and configure canvases dynamically.
45-
It also includes a browser dashboard served by `DashboardServer` from the `webui` folder.
44+
The project includes a REST API and browser dashboard via the `WebServer` class to control and configure canvases dynamically.
4645
For detailed interface descriptions and class diagrams, refer to the sections below.
4746

48-
### Runtime Servers and Ports
47+
### Runtime Server and Port
4948

50-
At runtime, `ndscpp` starts two HTTP servers:
51-
52-
- **API server (`WebServer`)**: serves all `/api/...` endpoints (default port `7777`)
53-
- **Dashboard server (`DashboardServer`)**: serves static UI assets (`/`, `/index.html`, `/styles.css`, `/app.js`) and runtime config (`/app-config.js`) (default port `9997`)
54-
55-
The dashboard JavaScript calls the API server directly using the configured API port from `/app-config.js`.
49+
At runtime, `ndscpp` starts a single HTTP server, which serves all `/api/...` endpoints and static UI assets. Its default port is `7777`.
5650

5751
### Running `ndscpp`
5852

@@ -64,18 +58,15 @@ Default startup:
6458

6559
Useful options:
6660

67-
- `-p <port>`: API port (default `7777`)
68-
- `-w <webuiport>`: dashboard/UI port (default `9997`)
61+
- `-p <port>`: server port (default `7777`)
6962
- `-c <configfile>`: controller config file (default `config.led`)
7063

7164
Example:
7265

7366
```shell
74-
./ndscpp -p 7777 -w 9997 -c config.led
67+
./ndscpp -p 7777 -c config.led
7568
```
7669

77-
Note: API and Web UI ports must be different.
78-
7970
This repository is designed for programmers familiar with modern C++ (C++20 and later) and concepts like interfaces, threading, and network communication. Jump into the code, and start by exploring the interfaces and their implementing classes to understand the system's structure.
8071

8172
This project uses clang++ and make, and is dependent on the libraries for asio (because Crow uses it), pthreads, z, avformat, avcodec, avutil, swscale, swresample and spdlog. For the "ledmon" monitor application in the monitor directory, the ncurses and curl libraries are required.
@@ -182,11 +173,6 @@ Provides utilities for switching between effects (`NextEffect` and `PreviousEffe
182173
Hosts a REST API for interacting with and controlling LED canvases and their features.
183174
Supports dynamic management of features, canvases, and effects via HTTP endpoints.
184175

185-
### DashboardServer
186-
187-
Hosts the browser dashboard UI and serves static files from `webui/`.
188-
Provides `/app-config.js`, which exposes runtime API port settings consumed by the UI.
189-
190176
### Utilities
191177

192178
Provides static helper functions for byte manipulation, color conversion, and data combination tasks.

config.led.example

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -542,6 +542,5 @@
542542
"width": 32
543543
}
544544
],
545-
"port": 7777,
546-
"webuiport": 9997
545+
"port": 7777
547546
}

webui/app.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,6 @@ function bindElements() {
115115
elements.connectionStatus = document.getElementById("connectionStatus");
116116
elements.connectionStatusText = document.getElementById("connectionStatusText");
117117
elements.apiPortValue = document.getElementById("apiPortValue");
118-
elements.webPortValue = document.getElementById("webPortValue");
119118

120119
elements.tableMetaText = document.getElementById("tableMetaText");
121120
elements.canvasTableBody = document.getElementById("canvasTableBody");
@@ -836,7 +835,6 @@ function render() {
836835
function renderConnectionStatus() {
837836
const controller = state.controller || {};
838837
elements.apiPortValue.textContent = controller.port ?? "--";
839-
elements.webPortValue.textContent = controller.webuiport ?? "--";
840838
elements.connectionStatus.classList.toggle("online", state.connected);
841839
elements.connectionStatus.classList.toggle("offline", !state.connected);
842840
elements.connectionStatusText.textContent = state.connected

webui/index.html

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,7 @@ <h1>NightDriver Web Control</h1>
2727
<span>API</span>
2828
<strong id="apiPortValue">--</strong>
2929
</div>
30-
<div class="port-pill">
31-
<span>WEB</span>
32-
<strong id="webPortValue">--</strong>
33-
</div>
30+
3431
<span class="split-button">
3532
<button id="settingsToggle" class="settings-gear-button" type="button" title="Settings">&#x2699;</button>
3633
<div id="settingsDropdownMenu" class="split-button-menu">

0 commit comments

Comments
 (0)