240 lines
6.9 KiB
HTML
240 lines
6.9 KiB
HTML
<!doctype html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<title>LinuxCNC WASM INI Panel</title>
|
|
<style>
|
|
:root {
|
|
color-scheme: light;
|
|
--bg: #eef3f7;
|
|
--panel: #ffffff;
|
|
--border: #c9d5df;
|
|
--text: #182430;
|
|
--muted: #566676;
|
|
--accent: #1263a3;
|
|
--accent-2: #0f8a70;
|
|
--danger: #b04040;
|
|
}
|
|
* { box-sizing: border-box; }
|
|
body {
|
|
margin: 0;
|
|
font-family: "Segoe UI", "Noto Sans", sans-serif;
|
|
background: linear-gradient(180deg, rgba(18, 99, 163, 0.08), transparent 24rem), var(--bg);
|
|
color: var(--text);
|
|
}
|
|
main {
|
|
max-width: 1180px;
|
|
margin: 0 auto;
|
|
padding: 24px;
|
|
display: grid;
|
|
gap: 16px;
|
|
}
|
|
.header, .panel {
|
|
background: var(--panel);
|
|
border: 1px solid var(--border);
|
|
border-radius: 8px;
|
|
box-shadow: 0 10px 30px rgba(17, 34, 51, 0.06);
|
|
}
|
|
.header { padding: 20px 24px; }
|
|
h1, h2 { margin: 0; font-weight: 600; }
|
|
p { margin: 0; color: var(--muted); line-height: 1.5; }
|
|
.grid {
|
|
display: grid;
|
|
grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
|
|
gap: 16px;
|
|
}
|
|
.panel {
|
|
padding: 16px;
|
|
display: grid;
|
|
gap: 12px;
|
|
}
|
|
.controls {
|
|
display: flex;
|
|
flex-wrap: wrap;
|
|
gap: 8px;
|
|
}
|
|
button {
|
|
border: 1px solid var(--border);
|
|
background: #f6f9fb;
|
|
color: var(--text);
|
|
padding: 10px 14px;
|
|
border-radius: 6px;
|
|
font: inherit;
|
|
cursor: pointer;
|
|
}
|
|
button.primary {
|
|
background: var(--accent);
|
|
border-color: var(--accent);
|
|
color: #fff;
|
|
}
|
|
button.secondary {
|
|
background: var(--accent-2);
|
|
border-color: var(--accent-2);
|
|
color: #fff;
|
|
}
|
|
textarea {
|
|
width: 100%;
|
|
min-height: 420px;
|
|
resize: vertical;
|
|
border: 1px solid var(--border);
|
|
border-radius: 6px;
|
|
padding: 12px;
|
|
font: 13px/1.5 "SFMono-Regular", "Consolas", monospace;
|
|
color: var(--text);
|
|
background: #fbfdff;
|
|
}
|
|
.status { display: grid; gap: 8px; }
|
|
.badge {
|
|
display: inline-block;
|
|
padding: 4px 8px;
|
|
border-radius: 999px;
|
|
font-size: 12px;
|
|
font-weight: 600;
|
|
background: #dbe8f3;
|
|
color: var(--accent);
|
|
}
|
|
.kv {
|
|
display: grid;
|
|
grid-template-columns: 132px 1fr;
|
|
gap: 8px 12px;
|
|
align-items: start;
|
|
border-top: 1px solid #edf2f6;
|
|
padding-top: 12px;
|
|
}
|
|
.kv dt {
|
|
color: var(--muted);
|
|
font-size: 12px;
|
|
text-transform: uppercase;
|
|
letter-spacing: 0.04em;
|
|
}
|
|
.kv dd {
|
|
margin: 0;
|
|
font-family: "SFMono-Regular", "Consolas", monospace;
|
|
font-size: 13px;
|
|
overflow-wrap: anywhere;
|
|
}
|
|
.log {
|
|
border: 1px solid var(--border);
|
|
border-radius: 6px;
|
|
background: #fbfdff;
|
|
padding: 12px;
|
|
min-height: 120px;
|
|
font: 13px/1.5 "SFMono-Regular", "Consolas", monospace;
|
|
white-space: pre-wrap;
|
|
}
|
|
.events {
|
|
border: 1px solid var(--border);
|
|
border-radius: 6px;
|
|
background: #fbfdff;
|
|
padding: 12px;
|
|
min-height: 180px;
|
|
max-height: 320px;
|
|
overflow: auto;
|
|
font: 12px/1.5 "SFMono-Regular", "Consolas", monospace;
|
|
white-space: pre-wrap;
|
|
}
|
|
.event-tools {
|
|
display: grid;
|
|
grid-template-columns: minmax(0, 1fr) auto;
|
|
gap: 8px;
|
|
align-items: center;
|
|
}
|
|
input {
|
|
border: 1px solid var(--border);
|
|
border-radius: 6px;
|
|
padding: 9px 10px;
|
|
font: 13px/1.4 "SFMono-Regular", "Consolas", monospace;
|
|
color: var(--text);
|
|
background: #fbfdff;
|
|
min-width: 0;
|
|
}
|
|
.danger { color: var(--danger); }
|
|
@media (max-width: 960px) {
|
|
.grid { grid-template-columns: 1fr; }
|
|
textarea { min-height: 320px; }
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<main>
|
|
<section class="header">
|
|
<h1>LinuxCNC WASM INI Panel</h1>
|
|
<p>
|
|
This standalone panel uses LinuxCNC's native <code>IniFile</code> parser
|
|
compiled to WASM. It is managed under <code>wasm-port/</code> and reads
|
|
upstream LinuxCNC-style machine configs through the browser host.
|
|
</p>
|
|
</section>
|
|
|
|
<section class="grid">
|
|
<section class="panel">
|
|
<h2>Configuration File</h2>
|
|
<div class="controls">
|
|
<button id="load-sample" class="primary">Load LinuxCNC Sample</button>
|
|
<button id="save-opfs">Save To OPFS</button>
|
|
<button id="load-opfs">Load From OPFS</button>
|
|
<button id="save-machine-files">Save Machine Files</button>
|
|
<button id="load-machine-files">Load Machine Files</button>
|
|
<button id="sync-wasm">Sync To WASM FS</button>
|
|
<button id="query" class="secondary">Query LinuxCNC Fields</button>
|
|
<button id="load-session" class="secondary">Load Machine Session</button>
|
|
<button id="run-gcode" class="secondary">Run G-code</button>
|
|
</div>
|
|
<textarea id="ini-editor" spellcheck="false"></textarea>
|
|
</section>
|
|
|
|
<section class="panel">
|
|
<h2>Control Panel</h2>
|
|
<div class="status">
|
|
<div><span id="wasm-badge" class="badge">INI WASM: loading</span></div>
|
|
<div><span id="interp-badge" class="badge">Interpreter WASM: loading</span></div>
|
|
<div><span id="opfs-badge" class="badge">OPFS: checking</span></div>
|
|
</div>
|
|
|
|
<dl class="kv">
|
|
<dt>Machine</dt>
|
|
<dd id="field-machine">-</dd>
|
|
<dt>Display</dt>
|
|
<dd id="field-display">-</dd>
|
|
<dt>Kinematics</dt>
|
|
<dd id="field-kinematics">-</dd>
|
|
<dt>Joints</dt>
|
|
<dd id="field-joints">-</dd>
|
|
<dt>Coordinates</dt>
|
|
<dd id="field-coordinates">-</dd>
|
|
<dt>Parameter File</dt>
|
|
<dd id="field-parameter-file">-</dd>
|
|
<dt>Tool Table</dt>
|
|
<dd id="field-tool-table">-</dd>
|
|
<dt>OPFS Path</dt>
|
|
<dd id="field-opfs-path">linuxcnc/machines/xyzab-tdr/machine.ini</dd>
|
|
<dt>WASM Path</dt>
|
|
<dd id="field-wasm-path">/work/xyzab-tdr.ini</dd>
|
|
<dt>Session INI</dt>
|
|
<dd id="field-session-ini">-</dd>
|
|
<dt>Session Params</dt>
|
|
<dd id="field-session-parameters">-</dd>
|
|
<dt>Session Tools</dt>
|
|
<dd id="field-session-tool-table">-</dd>
|
|
<dt>Session G-code</dt>
|
|
<dd id="field-session-gcode">-</dd>
|
|
<dt>Run Status</dt>
|
|
<dd id="field-run-status">-</dd>
|
|
</dl>
|
|
|
|
<div class="log" id="log"></div>
|
|
|
|
<h2>Canonical Events</h2>
|
|
<div class="event-tools">
|
|
<input id="event-filter" type="search" placeholder="Filter event text">
|
|
<span id="event-count" class="badge">0 / 0</span>
|
|
</div>
|
|
<pre class="events" id="canon-events"></pre>
|
|
</section>
|
|
</section>
|
|
</main>
|
|
<script type="module" src="./app.js"></script>
|
|
</body>
|
|
</html>
|