first commit
This commit is contained in:
35
public/app.js
Executable file
35
public/app.js
Executable file
@@ -0,0 +1,35 @@
|
||||
const services = [
|
||||
{
|
||||
id: "abc",
|
||||
name: "Control GamePad",
|
||||
url: "https://thinkcentre.local:10010/"
|
||||
},
|
||||
{
|
||||
id: "xyz",
|
||||
name: "Guacamole",
|
||||
url: "http://thinkcentre.local:8080/"
|
||||
}
|
||||
];
|
||||
|
||||
const nav = document.getElementById("services");
|
||||
const grid = document.getElementById("service-grid");
|
||||
|
||||
services.forEach(svc => {
|
||||
// Header Button
|
||||
const btn = document.createElement("button");
|
||||
btn.textContent = svc.name;
|
||||
btn.onclick = () => go(svc);
|
||||
nav.appendChild(btn);
|
||||
|
||||
// Card
|
||||
const card = document.createElement("div");
|
||||
card.className = "service-card";
|
||||
card.textContent = svc.name;
|
||||
card.onclick = () => go(svc);
|
||||
grid.appendChild(card);
|
||||
});
|
||||
|
||||
function go(service) {
|
||||
localStorage.setItem("lastService", service.id);
|
||||
window.location.href = service.url;
|
||||
}
|
||||
Reference in New Issue
Block a user