Add bad coders webring, update kumaos.
This commit is contained in:
parent
770369c84b
commit
dc0b9b14cb
17 changed files with 401 additions and 155 deletions
34
static/kumos/apps/taskmanager.mjs
Normal file
34
static/kumos/apps/taskmanager.mjs
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
import { Application, Window, promoteWindow, getScreenRoot, getProcList } from "../kernel.mjs";
|
||||
|
||||
const app = new Application('task', (p) => {
|
||||
function update() {
|
||||
w.content.innerHTML = ``;
|
||||
const list = document.createElement("ul");
|
||||
getProcList().forEach(proc => {
|
||||
const item = document.createElement("li");
|
||||
const link = document.createElement("a");
|
||||
link.innerText = `${proc.pid} -> ${proc.parent.length === 0 ? `` : proc.parent} ${proc.name}`;
|
||||
item.appendChild(link);
|
||||
list.appendChild(item);
|
||||
})
|
||||
|
||||
w.content.appendChild(list);
|
||||
}
|
||||
|
||||
const w = new Window();
|
||||
w.setTitle("Task Manager");
|
||||
w.content.style.padding = "1rem";
|
||||
|
||||
const task = setInterval(update, 100);
|
||||
|
||||
w.close.addEventListener('click', () => {
|
||||
clearInterval(task);
|
||||
p.detach();
|
||||
w.destroy();
|
||||
});
|
||||
|
||||
getScreenRoot().appendChild(w.window);
|
||||
promoteWindow(w);
|
||||
})
|
||||
|
||||
export default app;
|
||||
Loading…
Reference in a new issue