feat: config files, settings screen, hardware check
- Add config.py with multi-source config (YAML, .env, env vars) - Add .env.example and config.yaml.example - Add settings API endpoints (GET/POST /api/v1/settings) - Add status endpoint (GET /api/v1/status) with hardware subsystem check - Add settings screen to web client (protected by API token) - Add localization strings for settings UI - Add tests for config module and new endpoints - Update README with config documentation
This commit is contained in:
+58
-11
@@ -8,34 +8,40 @@
|
||||
/>
|
||||
<meta name="apple-mobile-web-app-capable" content="yes" />
|
||||
<meta name="mobile-web-app-capable" content="yes" />
|
||||
<title>PaperDash</title>
|
||||
<title data-i18n="app_name">PaperDash</title>
|
||||
<link rel="stylesheet" href="style.css" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="app">
|
||||
<!-- PIN Login Screen -->
|
||||
<div id="login-screen" class="screen active">
|
||||
<h1>PaperDash</h1>
|
||||
<p>Enter PIN to connect</p>
|
||||
<h1 data-i18n="login_title">PaperDash</h1>
|
||||
<p data-i18n="login_subtitle">Enter PIN to connect</p>
|
||||
<input
|
||||
type="password"
|
||||
id="pin-input"
|
||||
maxlength="4"
|
||||
data-i18n-placeholder="login_placeholder"
|
||||
placeholder="****"
|
||||
autocomplete="off"
|
||||
/>
|
||||
<button id="connect-btn">Connect</button>
|
||||
<button id="connect-btn" data-i18n="login_button">Connect</button>
|
||||
<p id="login-error" class="error"></p>
|
||||
</div>
|
||||
|
||||
<!-- Main Dashboard -->
|
||||
<div id="dashboard-screen" class="screen">
|
||||
<!-- Settings Button -->
|
||||
<button id="btn-settings" class="settings-btn">⚙</button>
|
||||
|
||||
<!-- Media Section -->
|
||||
<section id="media-section" class="panel">
|
||||
<h2>Now Playing</h2>
|
||||
<h2 data-i18n="now_playing">Now Playing</h2>
|
||||
<div id="artwork-container"></div>
|
||||
<div id="track-info">
|
||||
<div id="track-title" class="track-title">No playback</div>
|
||||
<div id="track-title" class="track-title" data-i18n="no_playback">
|
||||
No playback
|
||||
</div>
|
||||
<div id="track-artist" class="track-artist"></div>
|
||||
<div id="track-album" class="track-album"></div>
|
||||
</div>
|
||||
@@ -57,22 +63,24 @@
|
||||
|
||||
<!-- Audio Mixer Section -->
|
||||
<section id="audio-section" class="panel">
|
||||
<h2>Audio Mixer</h2>
|
||||
<h2 data-i18n="audio_mixer">Audio Mixer</h2>
|
||||
<div id="master-volume">
|
||||
<span id="master-label">Master</span>
|
||||
<span id="master-label" data-i18n="master_label">Master</span>
|
||||
<div class="volume-controls">
|
||||
<button id="btn-vol-down" class="volume-btn">-</button>
|
||||
<span id="master-volume-value">50%</span>
|
||||
<button id="btn-vol-up" class="volume-btn">+</button>
|
||||
</div>
|
||||
<button id="btn-mute" class="mute-btn">MUTE</button>
|
||||
<button id="btn-mute" class="mute-btn" data-i18n="mute">
|
||||
MUTE
|
||||
</button>
|
||||
</div>
|
||||
<div id="channels-container"></div>
|
||||
</section>
|
||||
|
||||
<!-- Telemetry Section -->
|
||||
<section id="telemetry-section" class="panel">
|
||||
<h2>System</h2>
|
||||
<h2 data-i18n="system">System</h2>
|
||||
<div id="telemetry-grid">
|
||||
<div class="telemetry-item">
|
||||
<span class="telemetry-label">CPU</span>
|
||||
@@ -95,10 +103,49 @@
|
||||
|
||||
<!-- Notifications Section -->
|
||||
<section id="notifications-section" class="panel">
|
||||
<h2>Notifications</h2>
|
||||
<h2 data-i18n="notifications">Notifications</h2>
|
||||
<div id="notifications-container"></div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<!-- Settings Screen -->
|
||||
<div id="settings-screen" class="screen">
|
||||
<h1 data-i18n="settings_title">Settings</h1>
|
||||
<p data-i18n="settings_subtitle">Enter API token to access settings</p>
|
||||
<input
|
||||
type="password"
|
||||
id="settings-token-input"
|
||||
placeholder="API Token"
|
||||
autocomplete="off"
|
||||
/>
|
||||
<button id="settings-access-btn" data-i18n="access">Access</button>
|
||||
<p id="settings-error" class="error"></p>
|
||||
|
||||
<div id="settings-content" style="display: none;">
|
||||
<section class="panel">
|
||||
<h2 data-i18n="dashboard_pin_label">Dashboard PIN</h2>
|
||||
<input
|
||||
type="text"
|
||||
id="settings-pin"
|
||||
maxlength="4"
|
||||
placeholder="****"
|
||||
/>
|
||||
</section>
|
||||
|
||||
<section class="panel">
|
||||
<h2 data-i18n="api_token_label">API Token</h2>
|
||||
<input
|
||||
type="password"
|
||||
id="settings-token"
|
||||
placeholder="API Token"
|
||||
/>
|
||||
</section>
|
||||
|
||||
<button id="settings-save-btn" data-i18n="save">Save</button>
|
||||
<button id="settings-back-btn" data-i18n="back">Back</button>
|
||||
<p id="settings-status" class="status"></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="app.js"></script>
|
||||
|
||||
Reference in New Issue
Block a user