Skip to content

Commit 7b839c2

Browse files
Copilotdorkmo
andcommitted
Restore screenshots to WEBSITE_PREVIEW.md and add all sub page screenshots
Co-authored-by: dorkmo <[email protected]>
1 parent 9afaf02 commit 7b839c2

File tree

3 files changed

+152
-187
lines changed

3 files changed

+152
-187
lines changed

.github/workflows/html-render.yml

Lines changed: 114 additions & 115 deletions
Original file line numberDiff line numberDiff line change
@@ -197,127 +197,96 @@ jobs:
197197
with open(ino_file, 'r', encoding='utf-8', errors='ignore') as f:
198198
content = f.read()
199199
200-
# Find the DASHBOARD_HTML constant
201-
html_pattern = r'static const char DASHBOARD_HTML\[\] PROGMEM = R"HTML\((.*?)\)HTML"'
202-
match = re.search(html_pattern, content, re.DOTALL)
200+
current_time = int(time.time())
203201
204-
if match:
205-
html_content = match.group(1)
202+
# Sample data for dashboard and client console
203+
sample_clients_data = {
204+
"si": "dev:server001",
205+
"srv": {
206+
"n": "Demo Tank Alarm Server",
207+
"cf": "demo-tankalarm-clients",
208+
"ps": False,
209+
"pc": True
210+
},
211+
"nde": current_time + 43200,
212+
"lse": current_time - 180,
213+
"cs": [
214+
{"c": "dev:client001", "s": "North Facility", "n": "Primary", "k": "1", "l": 78.5, "p": 85.3, "a": False, "u": current_time - 180, "v": 12.4},
215+
{"c": "dev:client001", "s": "North Facility", "n": "Secondary", "k": "2", "l": 45.2, "p": 52.1, "a": False, "u": current_time - 180, "v": 12.4},
216+
{"c": "dev:client002", "s": "South Facility", "n": "Storage", "k": "1", "l": 18.3, "p": 22.5, "a": True, "aType": "LOW", "u": current_time - 240, "v": 11.8},
217+
{"c": "dev:client003", "s": "East Facility", "n": "Main", "k": "1", "l": 92.1, "p": 95.8, "a": False, "u": current_time - 150, "v": 12.6},
218+
{"c": "dev:client004", "s": "West Facility", "n": "Backup", "k": "1", "l": 12.7, "p": 15.2, "a": True, "aType": "CRITICAL", "u": current_time - 90, "v": 10.2}
219+
]
220+
}
221+
222+
# Extract all HTML pages
223+
html_pages = {
224+
'DASHBOARD_HTML': 'dashboard',
225+
'CONFIG_GENERATOR_HTML': 'config-generator',
226+
'SERIAL_MONITOR_HTML': 'serial-monitor',
227+
'CALIBRATION_HTML': 'calibration',
228+
'CONTACTS_MANAGER_HTML': 'contacts',
229+
'CLIENT_CONSOLE_HTML': 'client-console'
230+
}
231+
232+
for const_name, file_name in html_pages.items():
233+
pattern = rf'static const char {const_name}\[\] PROGMEM = R"HTML\((.*?)\)HTML"'
234+
match = re.search(pattern, content, re.DOTALL)
206235
207-
# Create sample data for the server dashboard
208-
current_time = int(time.time())
209-
sample_data = {
210-
"serverUid": "dev:server001",
211-
"server": {
212-
"name": "Demo Tank Alarm Server",
213-
"clientFleet": "demo-tankalarm-clients",
214-
"webRefreshSeconds": 60,
215-
"pinConfigured": True
216-
},
217-
"nextDailyEmailEpoch": current_time + 43200, # 12 hours from now
218-
"lastSyncEpoch": current_time - 180, # 3 minutes ago
219-
"clients": [
220-
{
221-
"uid": "dev:client001",
222-
"site": "North Facility",
223-
"lastUpdate": current_time - 180,
224-
"tanks": [
225-
{
226-
"tank": 1,
227-
"label": "Primary",
228-
"levelInches": 78.5,
229-
"percent": 85.3,
230-
"alarm": False,
231-
"lastUpdate": current_time - 180
232-
},
233-
{
234-
"tank": 2,
235-
"label": "Secondary",
236-
"levelInches": 45.2,
237-
"percent": 52.1,
238-
"alarm": False,
239-
"lastUpdate": current_time - 180
240-
}
241-
]
242-
},
243-
{
244-
"uid": "dev:client002",
245-
"site": "South Facility",
246-
"lastUpdate": current_time - 240,
247-
"tanks": [
248-
{
249-
"tank": 1,
250-
"label": "Storage",
251-
"levelInches": 18.3,
252-
"percent": 22.5,
253-
"alarm": True,
254-
"alarmType": "LOW",
255-
"lastUpdate": current_time - 240
256-
}
257-
]
258-
},
259-
{
260-
"uid": "dev:client003",
261-
"site": "East Facility",
262-
"lastUpdate": current_time - 150,
263-
"tanks": [
264-
{
265-
"tank": 1,
266-
"label": "Main",
267-
"levelInches": 92.1,
268-
"percent": 95.8,
269-
"alarm": False,
270-
"lastUpdate": current_time - 150
271-
}
236+
if match:
237+
html_content = match.group(1)
238+
239+
# For dashboard, inject sample data
240+
if const_name == 'DASHBOARD_HTML':
241+
sample_json = json.dumps(sample_clients_data)
242+
html_content = html_content.replace('refreshData();', f'applyServerData({sample_json});')
243+
244+
# For client console, inject sample data
245+
elif const_name == 'CLIENT_CONSOLE_HTML':
246+
sample_json = json.dumps(sample_clients_data)
247+
html_content = html_content.replace('refreshData();', f'applyServerData({sample_json}, "dev:client001");')
248+
249+
# For serial monitor, inject sample log data
250+
elif const_name == 'SERIAL_MONITOR_HTML':
251+
sample_logs = {
252+
"logs": [
253+
{"timestamp": current_time - 60, "level": "INFO", "source": "server", "message": "Server initialized successfully"},
254+
{"timestamp": current_time - 45, "level": "INFO", "source": "server", "message": "Connected to Notehub"},
255+
{"timestamp": current_time - 30, "level": "DEBUG", "source": "server", "message": "Polling for client updates..."},
256+
{"timestamp": current_time - 15, "level": "INFO", "source": "server", "message": "Received telemetry from dev:client001"}
272257
]
273-
},
274-
{
275-
"uid": "dev:client004",
276-
"site": "West Facility",
277-
"lastUpdate": current_time - 90,
258+
}
259+
sample_json = json.dumps(sample_logs)
260+
html_content = html_content.replace('refreshServerLogs();', f'renderLogs(els.serverLogs, {sample_json}.logs);')
261+
262+
# For calibration, inject sample calibration data
263+
elif const_name == 'CALIBRATION_HTML':
264+
sample_cal = {
265+
"calibrations": [
266+
{"clientUid": "dev:client001", "tankNumber": 1, "entryCount": 5, "hasLearnedCalibration": True, "rSquared": 0.987, "learnedSlope": 7.42, "originalMaxValue": 120, "lastCalibrationEpoch": current_time - 86400},
267+
{"clientUid": "dev:client002", "tankNumber": 1, "entryCount": 2, "hasLearnedCalibration": False, "rSquared": 0, "learnedSlope": 0, "originalMaxValue": 96, "lastCalibrationEpoch": current_time - 172800}
268+
],
269+
"logs": []
270+
}
271+
sample_tanks = {
278272
"tanks": [
279-
{
280-
"tank": 1,
281-
"label": "Backup",
282-
"levelInches": 12.7,
283-
"percent": 15.2,
284-
"alarm": True,
285-
"alarmType": "CRITICAL",
286-
"lastUpdate": current_time - 90
287-
}
273+
{"client": "dev:client001", "tank": 1, "site": "North Facility", "label": "Primary", "heightInches": 120, "levelInches": 78.5, "sensorMa": 14.2},
274+
{"client": "dev:client002", "tank": 1, "site": "South Facility", "label": "Storage", "heightInches": 96, "levelInches": 18.3, "sensorMa": 6.8}
288275
]
289276
}
290-
]
291-
}
292-
293-
# Inject the sample data
294-
sample_data_json = json.dumps(sample_data)
295-
296-
# Replace the refreshData() call with data injection
297-
html_content = html_content.replace(
298-
'refreshData();',
299-
f'applyServerData({sample_data_json}, null);'
300-
)
301-
302-
output_file = output_dir + '/dashboard.html'
303-
with open(output_file, 'w', encoding='utf-8') as out:
304-
out.write(html_content)
305-
306-
print(f'Extracted dashboard HTML: {len(html_content)} bytes')
307-
print(f'Injected sample data with {len(sample_data["clients"])} clients')
308-
309-
# Find the CONFIG_GENERATOR_HTML constant
310-
config_pattern = r'static const char CONFIG_GENERATOR_HTML\[\] PROGMEM = R"HTML\((.*?)\)HTML"'
311-
config_match = re.search(config_pattern, content, re.DOTALL)
312-
313-
if config_match:
314-
config_html = config_match.group(1)
315-
316-
config_file = output_dir + '/config-generator.html'
317-
with open(config_file, 'w', encoding='utf-8') as out:
318-
out.write(config_html)
319-
320-
print(f'Extracted config generator HTML: {len(config_html)} bytes')
277+
html_content = html_content.replace('loadTanks();', f'tanks = {json.dumps(sample_tanks["tanks"])}; populateTankDropdowns();')
278+
html_content = html_content.replace('loadCalibrationData();', f'calibrations = {json.dumps(sample_cal["calibrations"])}; calibrationLogs = []; updateCalibrationStats(); updateCalibrationTable(); updateCalibrationLog();')
279+
280+
# For contacts, inject sample contact data
281+
elif const_name == 'CONTACTS_MANAGER_HTML':
282+
# Just render the page without API calls
283+
html_content = html_content.replace('loadData();', '// Sample data mode - loadData() disabled for static preview')
284+
285+
output_file = f'{output_dir}/{file_name}.html'
286+
with open(output_file, 'w', encoding='utf-8') as out:
287+
out.write(html_content)
288+
289+
print(f'Extracted {file_name} HTML: {len(html_content)} bytes')
321290
EOF
322291
323292
- name: Extract and render HTML for 112025 Viewer
@@ -601,12 +570,38 @@ jobs:
601570
602571
This document contains screenshots of the web interface served by the TankAlarm-112025-Server-BluesOpta.
603572
573+
All web pages have been optimized for reduced resource usage on Arduino Opta devices using minified CSS and JavaScript.
574+
604575
## Dashboard
576+
Main fleet telemetry dashboard showing server metadata, statistics, and fleet telemetry table with relay controls.
577+
605578
![Dashboard](screenshots/dashboard.png)
606579
580+
## Client Console
581+
Configuration management interface for remote clients with PIN-protected controls.
582+
583+
![Client Console](screenshots/client-console.png)
584+
607585
## Config Generator
586+
Create new client configurations with sensor definitions and alarm thresholds.
587+
608588
![Config Generator](screenshots/config-generator.png)
609589
590+
## Serial Monitor
591+
Debug log viewer with server and client serial output.
592+
593+
![Serial Monitor](screenshots/serial-monitor.png)
594+
595+
## Calibration
596+
Calibration learning system with manual level reading submission and drift analysis.
597+
598+
![Calibration](screenshots/calibration.png)
599+
600+
## Contacts Manager
601+
Contact and notification management with alarm associations.
602+
603+
![Contacts Manager](screenshots/contacts.png)
604+
610605
---
611606
*Screenshots automatically generated by GitHub Actions*
612607
*Last updated: $(date -u +"%Y-%m-%d %H:%M:%S UTC")*
@@ -619,7 +614,11 @@ jobs:
619614
620615
This document contains screenshots of the web interface served by the TankAlarm-112025-Viewer-BluesOpta.
621616
617+
All web pages have been optimized for reduced resource usage on Arduino Opta devices using minified CSS and JavaScript.
618+
622619
## Dashboard
620+
Read-only fleet telemetry dashboard showing server metadata and fleet snapshot with tank levels.
621+
623622
![Dashboard](screenshots/dashboard.png)
624623
625624
---
Lines changed: 32 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,39 @@
11
# Website Preview - TankAlarm 112025 Server
22

3-
This document contains information about the web interface served by the TankAlarm-112025-Server-BluesOpta.
4-
5-
## Web Pages
3+
This document contains screenshots of the web interface served by the TankAlarm-112025-Server-BluesOpta.
64

75
All web pages have been optimized for reduced resource usage on Arduino Opta devices using minified CSS and JavaScript.
86

9-
### Dashboard (`/`)
10-
Main fleet telemetry dashboard showing:
11-
- Server metadata (UID, fleet name, sync status)
12-
- Statistics (total clients, active tanks, alarms, stale tanks)
13-
- Fleet telemetry table with relay controls
14-
15-
### Client Console (`/client-console`)
16-
Configuration management interface for remote clients:
17-
- Client selection and status overview
18-
- Configuration form (site, device label, sample settings)
19-
- Tank configuration table
20-
- FTP backup/restore settings
21-
- PIN-protected controls
22-
23-
### Config Generator (`/config-generator`)
24-
Create new client configurations:
25-
- Site and device settings
26-
- Power configuration (solar vs grid-tied)
27-
- Sensor definitions (digital, analog, current loop, RPM)
28-
- Alarm thresholds and relay control
29-
- SMS alert configuration
30-
31-
### Serial Monitor (`/serial-monitor`)
32-
Debug log viewer:
33-
- Server serial output (auto-refreshing)
34-
- Client serial logs with panel pinning
35-
- Site and client filtering
36-
37-
### Calibration (`/calibration`)
38-
Calibration learning system:
39-
- Manual level reading submission
40-
- Calibration status tracking
41-
- Drift analysis
42-
- Linear regression learning
43-
44-
### Contacts Manager (`/contacts`)
45-
Contact and notification management:
46-
- Contact list with alarm associations
47-
- Daily report recipient configuration
48-
- Site and alarm filtering
49-
50-
## Optimization Notes
51-
52-
All HTML pages use:
53-
- Minified inline CSS (single-line)
54-
- Minified JavaScript (whitespace removed)
55-
- Consistent simple styling across all pages
56-
- CSS variables for theming (light/dark mode support)
57-
- Responsive design patterns
7+
## Dashboard
8+
Main fleet telemetry dashboard showing server metadata, statistics, and fleet telemetry table with relay controls.
9+
10+
![Dashboard](screenshots/dashboard.png)
11+
12+
## Client Console
13+
Configuration management interface for remote clients with PIN-protected controls.
14+
15+
![Client Console](screenshots/client-console.png)
16+
17+
## Config Generator
18+
Create new client configurations with sensor definitions and alarm thresholds.
19+
20+
![Config Generator](screenshots/config-generator.png)
21+
22+
## Serial Monitor
23+
Debug log viewer with server and client serial output.
24+
25+
![Serial Monitor](screenshots/serial-monitor.png)
26+
27+
## Calibration
28+
Calibration learning system with manual level reading submission and drift analysis.
29+
30+
![Calibration](screenshots/calibration.png)
31+
32+
## Contacts Manager
33+
Contact and notification management with alarm associations.
34+
35+
![Contacts Manager](screenshots/contacts.png)
5836

5937
---
60-
*Last updated: 2024-12*
38+
*Screenshots automatically generated by GitHub Actions*
39+
*Last updated: $(date -u +"%Y-%m-%d %H:%M:%S UTC")*
Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,14 @@
11
# Website Preview - TankAlarm 112025 Viewer
22

3-
This document contains information about the web interface served by the TankAlarm-112025-Viewer-BluesOpta.
4-
5-
## Web Pages
3+
This document contains screenshots of the web interface served by the TankAlarm-112025-Viewer-BluesOpta.
64

75
All web pages have been optimized for reduced resource usage on Arduino Opta devices using minified CSS and JavaScript.
86

9-
### Viewer Dashboard (`/`)
10-
Read-only fleet telemetry dashboard showing:
11-
- Server metadata (UID, fleet name)
12-
- Statistics (total clients, active tanks, alarms, stale tanks)
13-
- Fleet telemetry table (level, status, last update)
14-
15-
The viewer dashboard is a lightweight, read-only version of the server dashboard designed for monitoring without administrative controls.
16-
17-
## Optimization Notes
7+
## Dashboard
8+
Read-only fleet telemetry dashboard showing server metadata and fleet snapshot with tank levels.
189

19-
The HTML page uses:
20-
- Minified inline CSS (single-line)
21-
- Minified JavaScript (whitespace removed)
22-
- Consistent simple styling matching the server dashboard
23-
- CSS variables for theming (light/dark mode support)
24-
- Responsive design patterns
10+
![Dashboard](screenshots/dashboard.png)
2511

2612
---
27-
*Last updated: 2024-12*
13+
*Screenshots automatically generated by GitHub Actions*
14+
*Last updated: $(date -u +"%Y-%m-%d %H:%M:%S UTC")*

0 commit comments

Comments
 (0)