Add type column

This commit is contained in:
KernelDeimos 2024-04-14 23:58:14 -04:00
parent 6e7fd2ca95
commit 61f1caa122
3 changed files with 12 additions and 10 deletions

View File

@ -14,12 +14,11 @@ const UIWindowTaskManager = async function UIWindowTaskManager () {
is_resizable: true,
is_droppable: false,
has_head: true,
stay_on_top: true,
selectable_body: true,
draggable_body: false,
allow_context_menu: true,
allow_native_ctxmenu: true,
show_in_taskbar: false,
show_in_taskbar: true,
window_class: 'window-alert',
dominant: true,
body_content: '',
@ -154,7 +153,7 @@ const UIWindowTaskManager = async function UIWindowTaskManager () {
el_taskarea.classList.add('taskmgr-taskarea');
const tasktable = Table({
headings: ['Name', 'Status']
headings: ['Name', 'Type', 'Status']
});
el_taskarea.appendChild(tasktable.el());
@ -172,6 +171,7 @@ const UIWindowTaskManager = async function UIWindowTaskManager () {
},
name: item.name
}));
row.add($(`<span>${item.type}</span>`)[0])
row.add($('<span>open</span>')[0])
tasktable.add(row);

View File

@ -36,24 +36,26 @@ export class Process {
const _to_type_name = (name) => {
return name.replace(/Process$/, '').toLowerCase();
};
return this.type || _to_type_name(this.constructor.name) ||
return this.type_ || _to_type_name(this.constructor.name) ||
'invalid'
}
};
export class InitProccess extends Process {
export class InitProcess extends Process {
static created_ = false;
_construct () {
this.name = 'Puter';
if (InitProccess.created_) {
if (InitProcess.created_) {
throw new Error('InitProccess already created');
}
InitProccess.created_ = true;
InitProcess.created_ = true;
}
}
export class PortalProcess extends Process {};
export class PseudoProcess extends Process {};
export class PseudoProcess extends Process {
_construct () { this.type_ = 'ui' }
};

View File

@ -1,4 +1,4 @@
import { InitProccess, Service } from "../definitions.js";
import { InitProcess, Service } from "../definitions.js";
// The NULL UUID is also the UUID for the init process.
const NULL_UUID = '00000000-0000-0000-0000-000000000000';
@ -9,7 +9,7 @@ export class ProcessService extends Service {
this.processes_map = new Map();
this.uuid_to_treelist = new Map();
const root = new InitProccess({
const root = new InitProcess({
uuid: NULL_UUID,
});
this.register_(root);