Replit Commit
This commit is contained in:
commit
f49f965a42
41 changed files with 32720 additions and 0 deletions
38
dev/views/TestSimple.jsx
Normal file
38
dev/views/TestSimple.jsx
Normal file
|
@ -0,0 +1,38 @@
|
|||
import { useState } from "react";
|
||||
import { Initiator } from "qualiteer/web-clients";
|
||||
|
||||
const cmd = `node other.js`;
|
||||
export default function Test() {
|
||||
const [job, setJob] = useState({ log: ["INTRO"] });
|
||||
|
||||
function onLog(d) {
|
||||
const j = { ...job };
|
||||
j.log.push(d);
|
||||
setJob(j);
|
||||
}
|
||||
|
||||
async function startJob() {
|
||||
console.log("Wanting to start");
|
||||
const url = "https://Qualiteer.elijahparker3.repl.co";
|
||||
// Create an initiator and make a job request
|
||||
const primary = new Initiator(url);
|
||||
const job = { command: cmd };
|
||||
await primary.newJob(job, onLog, () =>
|
||||
console.log("Primary Job Concluded")
|
||||
);
|
||||
console.log("Started");
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="test">
|
||||
<h1>vv Info vv </h1>
|
||||
<button onClick={startJob}>Start</button>
|
||||
{job.log.map((l, i) => (
|
||||
<div className="line" key={i}>
|
||||
{l}
|
||||
<br />
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue