This commit is contained in:
@@ -6,11 +6,7 @@
|
|||||||
"urec": "./src/urec.mjs",
|
"urec": "./src/urec.mjs",
|
||||||
"uconn": "./src/uconn.mjs"
|
"uconn": "./src/uconn.mjs"
|
||||||
},
|
},
|
||||||
"files": [
|
"files": ["src", "dist", "package.json"],
|
||||||
"src",
|
|
||||||
"dist",
|
|
||||||
"package.json"
|
|
||||||
],
|
|
||||||
"publishConfig": {
|
"publishConfig": {
|
||||||
"access": "public"
|
"access": "public"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ function connect() {
|
|||||||
syncAll();
|
syncAll();
|
||||||
const pending = [...pendingRecords];
|
const pending = [...pendingRecords];
|
||||||
pendingRecords = [];
|
pendingRecords = [];
|
||||||
pending.forEach((f) => sendRecord(f));
|
for (const f of pending) sendRecord(f);
|
||||||
});
|
});
|
||||||
ws.on("close", () => {
|
ws.on("close", () => {
|
||||||
console.log(`Disconnected. Reconnecting in ${backoff / 1000}s...`);
|
console.log(`Disconnected. Reconnecting in ${backoff / 1000}s...`);
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ child.stderr.on("data", (d) => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const signals = ["SIGINT", "SIGTERM"];
|
const signals = ["SIGINT", "SIGTERM"];
|
||||||
signals.forEach((sig) => process.on(sig, () => child.kill(sig)));
|
for (const sig of signals) process.on(sig, () => child.kill(sig));
|
||||||
|
|
||||||
child.on("close", async (exitCode) => {
|
child.on("close", async (exitCode) => {
|
||||||
const finishedAt = new Date().toISOString();
|
const finishedAt = new Date().toISOString();
|
||||||
|
|||||||
@@ -95,11 +95,12 @@ export default function App() {
|
|||||||
</div>
|
</div>
|
||||||
</header>
|
</header>
|
||||||
<div className="filters">
|
<div className="filters">
|
||||||
<button className={!filter ? "active" : ""} onClick={() => setFilter("")}>
|
<button type="button" className={!filter ? "active" : ""} onClick={() => setFilter("")}>
|
||||||
All
|
All
|
||||||
</button>
|
</button>
|
||||||
{devices.map((d) => (
|
{devices.map((d) => (
|
||||||
<button
|
<button
|
||||||
|
type="button"
|
||||||
key={d.name}
|
key={d.name}
|
||||||
className={filter === d.name ? "active" : ""}
|
className={filter === d.name ? "active" : ""}
|
||||||
onClick={() => setFilter(d.name)}
|
onClick={() => setFilter(d.name)}
|
||||||
@@ -111,7 +112,12 @@ export default function App() {
|
|||||||
<div className="records">
|
<div className="records">
|
||||||
{records.length === 0 && <div className="empty">No records yet</div>}
|
{records.length === 0 && <div className="empty">No records yet</div>}
|
||||||
{records.map((r) => (
|
{records.map((r) => (
|
||||||
<div key={r.id} className="record-row" onClick={() => nav(`/record/${r.id}`)}>
|
<button
|
||||||
|
type="button"
|
||||||
|
key={r.id}
|
||||||
|
className="record-row"
|
||||||
|
onClick={() => nav(`/record/${r.id}`)}
|
||||||
|
>
|
||||||
<span className="device-badge">{r.device}</span>
|
<span className="device-badge">{r.device}</span>
|
||||||
<span className="command">{r.command}</span>
|
<span className="command">{r.command}</span>
|
||||||
<span className={`exit-code ${r.exitCode === 0 ? "success" : "error"}`}>
|
<span className={`exit-code ${r.exitCode === 0 ? "success" : "error"}`}>
|
||||||
@@ -119,7 +125,7 @@ export default function App() {
|
|||||||
</span>
|
</span>
|
||||||
<span className="duration">{fmtDuration(r.durationMs)}</span>
|
<span className="duration">{fmtDuration(r.durationMs)}</span>
|
||||||
<span className="time">{timeAgo(r.startedAt)}</span>
|
<span className="time">{timeAgo(r.startedAt)}</span>
|
||||||
</div>
|
</button>
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import App from "./App";
|
|||||||
import RecordDetail from "./RecordDetail";
|
import RecordDetail from "./RecordDetail";
|
||||||
import "./App.css";
|
import "./App.css";
|
||||||
|
|
||||||
ReactDOM.createRoot(document.getElementById("root")!).render(
|
ReactDOM.createRoot(document.getElementById("root") as HTMLElement).render(
|
||||||
<BrowserRouter>
|
<BrowserRouter>
|
||||||
<Routes>
|
<Routes>
|
||||||
<Route path="/" element={<App />} />
|
<Route path="/" element={<App />} />
|
||||||
|
|||||||
Reference in New Issue
Block a user