Skip to content

Commit 045d573

Browse files
authored
Merge pull request #142 from SenaxInc/copilot/add-website-preview-client-console
Add PIN setup modal screenshot to client console website preview
2 parents 99d30d1 + 1ec75e5 commit 045d573

File tree

1 file changed

+55
-8
lines changed

1 file changed

+55
-8
lines changed

.github/workflows/html-render.yml

Lines changed: 55 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -243,10 +243,38 @@ jobs:
243243
sample_json = json.dumps(sample_clients_data)
244244
html_content = html_content.replace('refreshData();', f'applyServerData({sample_json});')
245245
246-
# For client console, inject sample data
246+
# For client console, inject sample data and create TWO versions
247247
elif const_name == 'CLIENT_CONSOLE_HTML':
248248
sample_json = json.dumps(sample_clients_data)
249-
html_content = html_content.replace('refreshData();', f'applyServerData({sample_json}, "dev:client001");')
249+
250+
# Version 1: With PIN modal showing (PIN setup view)
251+
html_with_pin = html_content.replace('refreshData();', f'''
252+
// Inject sample data
253+
applyServerData({sample_json}, "dev:client001");
254+
255+
// Show PIN setup modal immediately for preview
256+
setTimeout(() => {{
257+
pinState.configured = false;
258+
pinState.value = '';
259+
showPinModal('setup');
260+
}}, 100);
261+
''')
262+
263+
# Version 2: Without PIN modal (unlocked view)
264+
html_unlocked = html_content.replace('refreshData();', f'''
265+
// Inject sample data and simulate unlocked state
266+
pinState.configured = true;
267+
pinState.value = 'PREVIEW'; // Simulated unlocked state for preview only
268+
applyServerData({sample_json}, "dev:client001");
269+
270+
// Force hide the PIN modal for the unlocked preview
271+
setTimeout(() => {{
272+
const modal = document.getElementById('pinModal');
273+
if (modal) {{
274+
modal.classList.add('hidden');
275+
}}
276+
}}, 200);
277+
''')
250278
251279
# For serial monitor, inject sample log data
252280
elif const_name == 'SERIAL_MONITOR_HTML':
@@ -284,11 +312,25 @@ jobs:
284312
# Just render the page without API calls
285313
html_content = html_content.replace('loadData();', '// Sample data mode - loadData() disabled for static preview')
286314

287-
output_file = f'{output_dir}/{file_name}.html'
288-
with open(output_file, 'w', encoding='utf-8') as out:
289-
out.write(html_content)
290-
291-
print(f'Extracted {file_name} HTML: {len(html_content)} bytes')
315+
# For CLIENT_CONSOLE_HTML, write the special versions
316+
if const_name == 'CLIENT_CONSOLE_HTML':
317+
# Write the PIN setup version
318+
output_file_pin = f'{output_dir}/client-console-pin-setup.html'
319+
with open(output_file_pin, 'w', encoding='utf-8') as out:
320+
out.write(html_with_pin)
321+
print(f'Extracted client-console-pin-setup HTML: {len(html_with_pin)} bytes')
322+
323+
# Write the unlocked version as the primary file
324+
output_file = f'{output_dir}/{file_name}.html'
325+
with open(output_file, 'w', encoding='utf-8') as out:
326+
out.write(html_unlocked)
327+
print(f'Extracted client-console (unlocked) HTML: {len(html_unlocked)} bytes')
328+
else:
329+
# Write the primary version for all other pages
330+
output_file = f'{output_dir}/{file_name}.html'
331+
with open(output_file, 'w', encoding='utf-8') as out:
332+
out.write(html_content)
333+
print(f'Extracted {file_name} HTML: {len(html_content)} bytes')
292334
EOF
293335

294336
- name: Extract and render HTML for 112025 Viewer
@@ -577,8 +619,13 @@ jobs:
577619
578620
![Dashboard](screenshots/dashboard.png)
579621
622+
## Client Console - PIN Setup
623+
PIN setup modal shown on first access to secure the configuration interface.
624+
625+
![Client Console - PIN Setup](screenshots/client-console-pin-setup.png)
626+
580627
## Client Console
581-
Configuration management interface for remote clients with PIN-protected controls.
628+
Configuration management interface for remote clients with PIN-protected controls (unlocked view).
582629
583630
![Client Console](screenshots/client-console.png)
584631

0 commit comments

Comments
 (0)