feat: add node resource infos

This commit is contained in:
2025-09-16 20:46:17 +02:00
parent 13f771837b
commit fd1c8e5a8c
4 changed files with 375 additions and 28 deletions

View File

@@ -220,7 +220,8 @@ class NodeDetailsViewModel extends ViewModel {
activeTab: 'status',
nodeIp: null,
endpoints: null,
tasksSummary: null
tasksSummary: null,
monitoringResources: null
});
}
@@ -250,6 +251,9 @@ class NodeDetailsViewModel extends ViewModel {
// Load endpoints data
await this.loadEndpointsData();
// Load monitoring resources data
await this.loadMonitoringResources();
} catch (error) {
console.error('Failed to load node details:', error);
this.set('error', error.message);
@@ -284,6 +288,20 @@ class NodeDetailsViewModel extends ViewModel {
}
}
// Load monitoring resources data with state preservation
async loadMonitoringResources() {
try {
const ip = this.get('nodeIp');
const response = await window.apiClient.getMonitoringResources(ip);
// The proxy call returns { data: {...} }, so we need to extract the data
const monitoringData = (response && response.data) ? response.data : null;
this.set('monitoringResources', monitoringData);
} catch (error) {
console.error('Failed to load monitoring resources:', error);
this.set('monitoringResources', null);
}
}
// Invoke an endpoint against this node
async callEndpoint(method, uri, params) {
const ip = this.get('nodeIp');