mirror of
https://github.com/cesanta/mongoose.git
synced 2026-10-31 13:00:49 +00:00
Event log
This commit is contained in:
1 parent
90051642ef
commit
8534053e57
9 files changed
+182
-96
No files matched your search
@@ -10,22 +10,9 @@
|
||||
debug: true,
|
||||
data: {
|
||||
chart1: {data: ''},
|
||||
controls: {
|
||||
fan: true,
|
||||
relay1: false,
|
||||
relay2: false,
|
||||
},
|
||||
settings: {
|
||||
volume: 12,
|
||||
log_level: 3,
|
||||
name: 'Galway',
|
||||
},
|
||||
metrics: {
|
||||
temperature: 1.2,
|
||||
humidity: 3,
|
||||
cpu: 4,
|
||||
ram: 5,
|
||||
},
|
||||
leds: { led1: true, led2: false, led3: false },
|
||||
settings: { volume: 12, log_level: 3, name: 'Galway' },
|
||||
metrics: { temperature: 1.2, humidity: 3, cpu: 4, ram: 5 },
|
||||
},
|
||||
});
|
||||
</script>
|
||||
@@ -75,7 +62,7 @@
|
||||
<path d="M8 17h5" />
|
||||
<rect x="4" y="4" width="16" height="16" rx="3" />
|
||||
</svg>
|
||||
Events
|
||||
Event Log
|
||||
</a>
|
||||
</nav>
|
||||
</div>
|
||||
@@ -175,30 +162,19 @@
|
||||
|
||||
<!-- Controls Panel -->
|
||||
<div class="panel controls-panel">
|
||||
<div class="panel-title">Controls</div>
|
||||
<div class="panel-title">LED Control</div>
|
||||
<div class="panel-body">
|
||||
<div class="controls-list">
|
||||
<div class="control-row">
|
||||
<div class="control-info">
|
||||
<div class="control-name">Cooling Fan</div>
|
||||
<div class="control-desc">PWM controlled output</div>
|
||||
</div>
|
||||
<input type="checkbox" data-bind="controls.fan" data-autosave="1" class="toggle" />
|
||||
</div>
|
||||
<div class="control-row">
|
||||
<div class="control-info">
|
||||
<div class="control-name">Relay Channel 1</div>
|
||||
<div class="control-desc">Auxiliary load output</div>
|
||||
</div>
|
||||
<input type="checkbox" data-bind="controls.relay1" data-autosave="1" class="toggle" />
|
||||
</div>
|
||||
<div class="control-row">
|
||||
<div class="control-info">
|
||||
<div class="control-name">Relay Channel 2</div>
|
||||
<div class="control-desc">Safety-controlled line</div>
|
||||
</div>
|
||||
<input type="checkbox" data-bind="controls.relay2" data-autosave="1" class="toggle" />
|
||||
</div>
|
||||
<div class="field">
|
||||
<div class="field-label">LED1</div>
|
||||
<input type="checkbox" data-bind="leds.led1" data-autosave="1" class="toggle" />
|
||||
</div>
|
||||
<div class="field">
|
||||
<div class="field-label">LED2</div>
|
||||
<input type="checkbox" data-bind="leds.led2" data-autosave="1" class="toggle" />
|
||||
</div>
|
||||
<div class="field">
|
||||
<div class="field-label">LED3</div>
|
||||
<input type="checkbox" data-bind="leds.led3" data-autosave="1" class="toggle" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -236,6 +212,7 @@
|
||||
</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>
|
||||
<pre id="logs" class="file-content"></pre>
|
||||
</section>
|
||||
</main>
|
||||
</body>
|
||||
|
||||
@@ -86,6 +86,8 @@ 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/";
|
||||
// Show logs
|
||||
fetch('logs/')
|
||||
.then(resp => resp.text())
|
||||
.then(text => document.getElementById("logs").textContent = text);
|
||||
});
|
||||
@@ -265,18 +265,19 @@ body {
|
||||
.field {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
gap: 0.75rem;
|
||||
}
|
||||
|
||||
.field-label {
|
||||
font-size: 0.72rem;
|
||||
font-size: 0.75rem;
|
||||
font-weight: 700;
|
||||
letter-spacing: 0.05em;
|
||||
text-transform: uppercase;
|
||||
color: #94a3b8;
|
||||
width: 4.5rem;
|
||||
flex-shrink: 0;
|
||||
white-space: nowrap;
|
||||
min-width: 6rem;
|
||||
}
|
||||
|
||||
.field-input {
|
||||
@@ -419,6 +420,35 @@ body {
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.file-content {
|
||||
width: 100%;
|
||||
min-height: calc(100vh - 7rem);
|
||||
margin-top: 0.5rem;
|
||||
padding: 1rem 1.15rem;
|
||||
overflow: auto;
|
||||
color: #dbeafe;
|
||||
background:
|
||||
linear-gradient(180deg, rgba(15, 23, 42, 0.96), rgba(15, 23, 42, 0.98)),
|
||||
#0f172a;
|
||||
border: 1px solid rgba(51, 65, 85, 0.9);
|
||||
border-radius: 1rem;
|
||||
box-shadow:
|
||||
inset 0 1px 0 rgba(255, 255, 255, 0.08),
|
||||
0 2px 6px rgba(15, 23, 42, 0.1),
|
||||
0 12px 32px rgba(15, 23, 42, 0.14);
|
||||
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
|
||||
font-size: 0.82rem;
|
||||
line-height: 1.55;
|
||||
white-space: pre-wrap;
|
||||
word-break: break-word;
|
||||
tab-size: 2;
|
||||
}
|
||||
|
||||
.file-content:empty::before {
|
||||
content: "Waiting for events...";
|
||||
color: #64748b;
|
||||
}
|
||||
|
||||
/* Chart */
|
||||
|
||||
.chart-panel {
|
||||
|
||||
Reference in new issue
Block a user