Add class registry (first pass)

In the first pass I add a `register` method and update `defineComponent`
so it calls `register` as well. This made it possible to create a
proof-of-concept for registered classes. Additionally ExportService was
added to expose registered classes to service scripts. This first pass
works, but it would be better if all types of classes (components or
otherwise) were registered via the same method.
This commit is contained in:
KernelDeimos
2024-05-27 21:16:50 -04:00
parent 146ce659e2
commit 51bac4486f
24 changed files with 171 additions and 41 deletions
+5 -2
View File
@@ -49,6 +49,7 @@ const end_process = async (uuid, force) => {
};
class TaskManagerTable extends Component {
static ID = 'ui.component.TaskManagerTable';
static PROPERTIES = {
tasks: { value: [] },
};
@@ -157,9 +158,11 @@ class TaskManagerTable extends Component {
return rows;
};
}
defineComponent('c-task-manager-table', TaskManagerTable);
defineComponent(TaskManagerTable);
class TaskManagerRow extends Component {
static ID = 'ui.component.TaskManagerRow';
static PROPERTIES = {
name: {},
uuid: {},
@@ -291,7 +294,7 @@ class TaskManagerRow extends Component {
});
}
}
defineComponent('c-task-manager-row', TaskManagerRow);
defineComponent(TaskManagerRow);
const UIWindowTaskManager = async function UIWindowTaskManager () {
const svc_process = globalThis.services.get('process');