Skip to content

Commit

Permalink
Added update textbox
Browse files Browse the repository at this point in the history
  • Loading branch information
jLynx committed Jan 11, 2024
1 parent 324127e commit 56e4aaf
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
Binary file removed public/mayhem_nightly_n_240111_OCI.ppfw.tar
Binary file not shown.
13 changes: 12 additions & 1 deletion src/app/components/Controller/Controller.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import ToggleSwitch from "../ToggleSwitch/ToggleSwitch";
const Controller = () => {
const { serial, consoleMessage } = useSerial();
const [consoleMessageList, setConsoleMessageList] = useState<string>("");
const [updateStatus, setUpdateStatus] = useState<string>("");
const [command, setCommand] = useState<string>("");
const [autoUpdateFrame, setAutoUpdateFrame] = useState<boolean>(true);
const [loadingFrame, setLoadingFrame] = useState<boolean>(true);
Expand Down Expand Up @@ -164,6 +165,11 @@ const Controller = () => {
((i / arrayBuffer.byteLength) * 100).toFixed(2) + "%",
"Estimated time remaining: " + estRemainingTime.toFixed(0) + " seconds"
);
setUpdateStatus(
`${((i / arrayBuffer.byteLength) * 100).toFixed(
2
)}% Estimated time remaining: ${estRemainingTime.toFixed(0)} seconds`
);

// reset start time for next iteration
startTime = Date.now();
Expand Down Expand Up @@ -453,14 +459,19 @@ const Controller = () => {
</button>
) : (
<div className="mt-10 flex w-[80%] flex-row items-center justify-center gap-5">
<div className="flex gap-1 self-start">
<div className="flex h-full flex-col gap-1 self-start">
<button
// onClick={() => downloadFile("PLAYLIST.TXT")}
onClick={() => flashLatestFirmware()}
className="self-end justify-self-end rounded bg-blue-400 text-white disabled:opacity-50"
>
Update Firmware to latest nightly
</button>
<textarea
className="h-full w-full rounded bg-gray-200 p-2 text-black"
readOnly
value={updateStatus}
/>
</div>
<div className="flex w-full flex-col items-center justify-center gap-1">
<div className="flex w-full flex-row items-center justify-center gap-1">
Expand Down

0 comments on commit 56e4aaf

Please sign in to comment.