From 0f1151af710ebf242cb8c61a7b3e28eaebe3feec Mon Sep 17 00:00:00 2001 From: Alessandro Pignotti Date: Mon, 15 May 2023 19:01:19 +0200 Subject: [PATCH] Use the new CX activity callbacks to provide feedback into the machine state --- index.html | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index 482afb5..ff05bd2 100644 --- a/index.html +++ b/index.html @@ -69,6 +69,14 @@ __ __ _ __ ____ __
+
+ CPU + 🟢 +
+
+ HDD + 🟢 +
Connect via Tailscale @@ -286,8 +294,24 @@ __ __ _ __ ____ __ { printOnTerm.printError(printOnTerm.getErrorMessage(err)); } - // The variables IMAGE_URL and DEVICE_TYPE are replaced by Github Actions. - CheerpXApp.create({devices:[{type:DEVICE_TYPE,url:IMAGE_URL,name:"block1"}],mounts:[{type:"ext2",dev:"block1",path:"/"},{type:"cheerpOS",dev:"/app",path:"/app"},{type:"cheerpOS",dev:"/str",path:"/data"},{type:"devs",dev:"",path:"/dev"}], networkInterface}).then(runTest, failCallback); + function devCallback(state) + { + var h = document.getElementById("hddactivity"); + if(state == "ready") + h.textContent = "\u{1F7E2}"; + else + h.textContent = "\u{1F7E1}"; + } + function cpuCallback(state) + { + var h = document.getElementById("cpuactivity"); + if(state == "ready") + h.textContent = "\u{1F7E2}"; + else + h.textContent = "\u{1F7E1}"; + } + // The variables IMAGE_URL and DEVICE_TYPE are replaced by Github Actions. + CheerpXApp.create({devices:[{type:DEVICE_TYPE,url:IMAGE_URL,name:"block1"}],mounts:[{type:"ext2",dev:"block1",path:"/"},{type:"cheerpOS",dev:"/app",path:"/app"},{type:"cheerpOS",dev:"/str",path:"/data"},{type:"devs",dev:"",path:"/dev"}], networkInterface: networkInterface, activityInterface: {cpu: cpuCallback, dev: devCallback}}).then(runTest, failCallback); } function initialMessage() {