Simplify process display to avoid interface lag
**Motivations :** - Interface was lagging when adding processes one by one - Need to display all processes at once in a simple format **Modifications :** - Changed from adding processes one by one to building all messages first - Display all processes in a single div with pre-line formatting - Use simple text concatenation instead of DOM manipulation loops **Pages affectées :** - src/pages/home/home.ts
This commit is contained in:
parent
6cd46f33d5
commit
cbe49aff5c
@ -621,7 +621,8 @@ async function displayExistingProcesses(): Promise<void> {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Display each process as a separate message
|
// Display all processes as simple text
|
||||||
|
let allMessages = '';
|
||||||
for (const [processId, process] of Object.entries(processes)) {
|
for (const [processId, process] of Object.entries(processes)) {
|
||||||
const processInfo = {
|
const processInfo = {
|
||||||
id: processId.substring(0, 8) + '...',
|
id: processId.substring(0, 8) + '...',
|
||||||
@ -630,14 +631,11 @@ async function displayExistingProcesses(): Promise<void> {
|
|||||||
lastUpdate: process.last_update || 'Unknown'
|
lastUpdate: process.last_update || 'Unknown'
|
||||||
};
|
};
|
||||||
|
|
||||||
const message = `📋 Process ${processInfo.id} - States: ${processInfo.states}, Members: ${processInfo.members}, Updated: ${processInfo.lastUpdate}`;
|
allMessages += `📋 Process ${processInfo.id} - States: ${processInfo.states}, Members: ${processInfo.members}, Updated: ${processInfo.lastUpdate}\n`;
|
||||||
|
}
|
||||||
if (mainStatus) {
|
|
||||||
// Add each message as a separate line
|
if (mainStatus) {
|
||||||
const currentContent = mainStatus.innerHTML;
|
mainStatus.innerHTML = `<div style="text-align: left; white-space: pre-line; font-family: monospace; font-size: 12px;">${allMessages}</div>`;
|
||||||
const newMessage = currentContent ? `${currentContent}<br>${message}` : message;
|
|
||||||
mainStatus.innerHTML = newMessage;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user