feat: frontend optimization, refactoring
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user