feat: frontend optimization, refactoring

This commit is contained in:
2025-08-28 20:46:53 +02:00
parent 9486594199
commit c15654ef5a
4 changed files with 179 additions and 180 deletions

View File

@@ -212,7 +212,8 @@ class NodeDetailsViewModel extends ViewModel {
error: null,
activeTab: 'status',
nodeIp: null,
capabilities: null
capabilities: null,
tasksSummary: null
});
}
@@ -255,10 +256,12 @@ class NodeDetailsViewModel extends ViewModel {
try {
const ip = this.get('nodeIp');
const response = await window.apiClient.getTasksStatus(ip);
this.set('tasks', response || []);
this.set('tasks', (response && Array.isArray(response.tasks)) ? response.tasks : []);
this.set('tasksSummary', response && response.summary ? response.summary : null);
} catch (error) {
console.error('Failed to load tasks:', error);
this.set('tasks', []);
this.set('tasksSummary', null);
}
}