mirror of
https://github.com/cesanta/mongoose.git
synced 2026-10-01 05:52:32 +07:00
Style nits
This commit is contained in:
@@ -45,9 +45,9 @@ static struct mg_field fields_metrics[] = {
|
||||
|
||||
static void sync_metrics(bool is_write) {
|
||||
if (is_write) return;
|
||||
s_ram = 25 + (rand() % 16); // Sumulate metric change
|
||||
s_cpu = 7 + (rand() % 21);
|
||||
s_temperature = 14.8 + ((double)rand() / RAND_MAX) * 20.0;
|
||||
s_ram = 25 + (rand() % 16); // Sumulate metric change
|
||||
s_cpu = 7 + (rand() % 21);
|
||||
s_temperature = 14.8 + ((double) rand() / RAND_MAX) * 20.0;
|
||||
}
|
||||
|
||||
// Read-write device settings
|
||||
@@ -108,7 +108,7 @@ void sync_chart1(bool is_write) {
|
||||
}
|
||||
|
||||
static struct mg_field_set field_sets[] = {
|
||||
{"control", fields_control, sync_control, 0, 0},
|
||||
{"controls", fields_control, sync_control, 0, 0},
|
||||
{"metrics", fields_metrics, sync_metrics, 0, 0},
|
||||
{"settings", fields_settings, sync_settings, 0, 0},
|
||||
{"chart1", fields_chart1, sync_chart1, 0, 0},
|
||||
|
||||
@@ -206,38 +206,37 @@
|
||||
</div>
|
||||
</section>
|
||||
<section id="settings" class="tab-panel" role="tabpanel" aria-labelledby="tab-settings" hidden>
|
||||
<div class="panel-layout">
|
||||
<div class="panel">
|
||||
<div class="panel-title">Device settings</div>
|
||||
<div class="panel-body">
|
||||
<div class="field">
|
||||
<label class="field-label">Name</label>
|
||||
<input class="field-input"type="text" data-bind="settings.name" data-autosave="1" />
|
||||
</div>
|
||||
<div class="field">
|
||||
<label class="field-label">Volume</label>
|
||||
<input class="field-input" type="text" data-bind="settings.volume" />
|
||||
</div>
|
||||
<div class="field">
|
||||
<label class="field-label">Log Level</label>
|
||||
<select class="field-input" data-bind="settings.log_level">
|
||||
<option value="0">Disable logs</option>
|
||||
<option value="1">Error</option>
|
||||
<option value="2">Info</option>
|
||||
<option value="3">Debug</option>
|
||||
<option value="4">Verbose (very noisy)</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="panel" style="width: 22rem;">
|
||||
<div class="panel-title">Device settings</div>
|
||||
<div class="panel-body">
|
||||
<div class="field">
|
||||
<label class="field-label">Name</label>
|
||||
<input class="field-input"type="text" data-bind="settings.name" data-autosave="1" />
|
||||
</div>
|
||||
<div class="panel-footer">
|
||||
<button class="btn btn-secondary" type="button" data-cancel="settings">Cancel</button>
|
||||
<button class="btn btn-primary" type="button" data-save="settings">Save</button>
|
||||
<div class="field">
|
||||
<label class="field-label">Volume</label>
|
||||
<input class="field-input" type="text" data-bind="settings.volume" />
|
||||
</div>
|
||||
<div class="field">
|
||||
<label class="field-label">Log Level</label>
|
||||
<select class="field-input" data-bind="settings.log_level">
|
||||
<option value="0">Disable logs</option>
|
||||
<option value="1">Error</option>
|
||||
<option value="2">Info</option>
|
||||
<option value="3">Debug</option>
|
||||
<option value="4">Verbose (very noisy)</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel-footer">
|
||||
<button class="btn btn-secondary" type="button" data-cancel="settings">Cancel</button>
|
||||
<button class="btn btn-primary" type="button" data-save="settings">Save</button>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<section id="firmware" class="tab-panel" role="tabpanel" aria-labelledby="tab-firmware" hidden></section>
|
||||
<section id="events" class="tab-panel" role="tabpanel" aria-labelledby="tab-events" hidden></section>
|
||||
<section id="events" class="tab-panel" role="tabpanel" aria-labelledby="tab-events" hidden>
|
||||
</section>
|
||||
</main>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -86,4 +86,6 @@ document.addEventListener("DOMContentLoaded", () => {
|
||||
Dashboard.on('change', args => updateGraphPoints(args?.chart1?.data));
|
||||
Dashboard.call('get', 'chart1').then(resp => updateGraphPoints(resp?.data));
|
||||
|
||||
// Set iframe source in JS, to prevent Monolith killing it
|
||||
document.getElementById("logs").src = "/logs/";
|
||||
});
|
||||
|
||||
@@ -34,10 +34,6 @@ body {
|
||||
}
|
||||
|
||||
.header {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
z-index: 50;
|
||||
}
|
||||
|
||||
@@ -48,7 +44,7 @@ body {
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: var(--spacing-4);
|
||||
padding: var(--spacing-2) var(--spacing-4);
|
||||
padding: var(--spacing-2) var(--spacing-6);
|
||||
}
|
||||
|
||||
.header-left {
|
||||
@@ -136,7 +132,7 @@ body {
|
||||
.tab-stage {
|
||||
max-width: var(--max-width);
|
||||
margin: 0 auto;
|
||||
padding: 5.5rem var(--spacing-4) var(--spacing-4);
|
||||
padding: 0.5rem var(--spacing-6) var(--spacing-4);
|
||||
}
|
||||
|
||||
.tab-panel {
|
||||
@@ -247,13 +243,6 @@ body {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* ── Panel ──────────────────────────────────────── */
|
||||
|
||||
.panel-layout {
|
||||
padding-top: 1rem;
|
||||
max-width: 22rem;
|
||||
}
|
||||
|
||||
.panel-body {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
Reference in New Issue
Block a user