add server

This commit is contained in:
Florian Schmid 2023-04-13 18:39:04 +02:00
parent 01369bcf90
commit 7d01dcda30
2 changed files with 11 additions and 3 deletions

View File

@ -54,6 +54,8 @@
<br>
<button class="btn btn-lg m-1 mt-2" id="btnDesktop" style="background-color: #3CC3FA;" onclick="btnClick(0)">Desktop</button>
<br>
<button class="btn btn-lg m-1" id="btnServer" style="background-color: #3CC3FA;" onclick="btnClick(3)">Server</button>
<br>
<button class="btn btn-lg m-1" id="btnLaptop" style="background-color: #3CC3FA;" onclick="btnClick(1)">Laptop</button>
<br>
<button class="btn btn-lg m-1" id="btnMobile" style="background-color: #3CC3FA;" onclick="btnClick(2)">Mobile/Embedded</button>

12
gst.js
View File

@ -42,14 +42,14 @@ export async function btnClick(typ) {
// 0 -> Desktop
// 1 -> Laptop
// 2 -> Mobile/Embedded
console.log("Button clicked: typ: " + typ + "cpu type: " + currentCpu.type);
// 3 -> Server
let btnDesktop = document.getElementById("btnDesktop");
let btnLaptop = document.getElementById("btnLaptop");
let btnMobile = document.getElementById("btnMobile");
let btnServer = document.getElementById("btnServer");
let btns = [btnDesktop, btnLaptop, btnMobile];
let btns = [btnDesktop, btnLaptop, btnMobile, btnServer];
switch (typ) {
case 0:
@ -61,6 +61,9 @@ export async function btnClick(typ) {
case 2:
btnMobile.style.backgroundColor = "#FF4444";
break;
case 3:
btnServer.style.backgroundColor = "#FF4444";
break;
}
switch (currentCpu.type) {
@ -73,6 +76,9 @@ export async function btnClick(typ) {
case "Mobile/Embedded":
btnMobile.style.backgroundColor = "lightgreen";
break;
case "Server":
btnServer.style.backgroundColor = "lightgreen";
break;
}
await delay(2000);