From 61f1caa12294d08ac22be6b1dff4552ce25eb95e Mon Sep 17 00:00:00 2001 From: KernelDeimos Date: Sun, 14 Apr 2024 23:58:14 -0400 Subject: [PATCH] Add type column --- src/UI/UIWindowTaskManager.js | 6 +++--- src/definitions.js | 12 +++++++----- src/services/ProcessService.js | 4 ++-- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/UI/UIWindowTaskManager.js b/src/UI/UIWindowTaskManager.js index 7ce8def0..0caa71ea 100644 --- a/src/UI/UIWindowTaskManager.js +++ b/src/UI/UIWindowTaskManager.js @@ -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($(`${item.type}`)[0]) row.add($('open')[0]) tasktable.add(row); diff --git a/src/definitions.js b/src/definitions.js index 33e2df58..1bb0c7f3 100644 --- a/src/definitions.js +++ b/src/definitions.js @@ -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' } +}; diff --git a/src/services/ProcessService.js b/src/services/ProcessService.js index 3d7c9c1a..8047083c 100644 --- a/src/services/ProcessService.js +++ b/src/services/ProcessService.js @@ -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);