diff --git a/index.html b/index.html index 8978abc..cd60305 100644 --- a/index.html +++ b/index.html @@ -248,6 +248,23 @@ __ __ _ __ ____ __ } term.onData(readData); + function hddCallback(state) + { + var h = document.getElementById("hddactivity"); + if(state == "ready") + h.textContent = "\u{1F7E2}"; + else + h.textContent = "\u{1F7E0}"; + } + function cpuCallback(state) + { + var h = document.getElementById("cpuactivity"); + if(state == "ready") + h.textContent = "\u{1F7E2}"; + else + h.textContent = "\u{1F7E0}"; + } + //Actual CheerpX and bash specific logic function runBash() { @@ -277,6 +294,8 @@ __ __ _ __ ____ __ async function runTest(cx) { + cx.registerCallback("cpuActivity", cpuCallback); + cx.registerCallback("diskActivity", hddCallback); registerNetworkLogin(cx, networkInterface); term.scrollToBottom(); @@ -308,24 +327,8 @@ __ __ _ __ ____ __ { printOnTerm.printError(printOnTerm.getErrorMessage(err)); } - function devCallback(state) - { - var h = document.getElementById("hddactivity"); - if(state == "ready") - h.textContent = "\u{1F7E2}"; - else - h.textContent = "\u{1F7E0}"; - } - function cpuCallback(state) - { - var h = document.getElementById("cpuactivity"); - if(state == "ready") - h.textContent = "\u{1F7E2}"; - else - h.textContent = "\u{1F7E0}"; - } // The device url and 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); + 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}).then(runTest, failCallback); } function initialMessage() {