process_loop_fix

This commit is contained in:
Pascal 2025-01-06 16:36:47 +01:00
parent 1a8fe960ad
commit 0e77c113db

View File

@ -36,23 +36,18 @@ export async function init() {
search_div.appendChild(autocomplete_list); search_div.appendChild(autocomplete_list);
search_div.appendChild(dropdown_icon); search_div.appendChild(dropdown_icon);
// This is temporary
// Create a new process with hardcoded members for demonstration purpose
await createMessagingProcess();
setTimeout(async () => { const processes = await getProcesses();
const processes = await getProcesses(); for (const {key, value} of processes) {
for (const {key, value} of processes) { const processName = await getDescription(key, value);
const processName = await getDescription(key, value); if (processName) {
// const processName = value['description']; console.log('adding process name to list:', processName);
if (processName) { const opt = new Option(processName);
console.log('adding process name to list:', processName); opt.value = processName;
const opt = new Option(processName); element.add(opt);
opt.value = processName;
element.add(opt);
}
} }
}, 1000) }
// set the wrapper as child (instead of the element) // set the wrapper as child (instead of the element)
element.parentNode?.replaceChild(wrapper, element); element.parentNode?.replaceChild(wrapper, element);
// set element as child of wrapper // set element as child of wrapper
@ -60,15 +55,6 @@ export async function init() {
wrapper.appendChild(search_div); wrapper.appendChild(search_div);
addPlaceholder(wrapper); addPlaceholder(wrapper);
// const select = document.querySelector(".select-field");
// for (const process of processeList) {
// const option = document.createElement("option");
// option.setAttribute("value", process.name);
// option.innerText = process.name;
// select.appendChild(option);
// }
} }
function removePlaceholder(wrapper: HTMLElement) { function removePlaceholder(wrapper: HTMLElement) {