feat: add node resource infos
This commit is contained in:
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user