refactor: remove capabilities in favor of endpoints
This commit is contained in:
@@ -219,7 +219,7 @@ class NodeDetailsViewModel extends ViewModel {
|
||||
error: null,
|
||||
activeTab: 'status',
|
||||
nodeIp: null,
|
||||
capabilities: null,
|
||||
endpoints: null,
|
||||
tasksSummary: null
|
||||
});
|
||||
}
|
||||
@@ -247,8 +247,8 @@ class NodeDetailsViewModel extends ViewModel {
|
||||
// Load tasks data
|
||||
await this.loadTasksData();
|
||||
|
||||
// Load capabilities data
|
||||
await this.loadCapabilitiesData();
|
||||
// Load endpoints data
|
||||
await this.loadEndpointsData();
|
||||
|
||||
} catch (error) {
|
||||
console.error('Failed to load node details:', error);
|
||||
@@ -272,22 +272,22 @@ class NodeDetailsViewModel extends ViewModel {
|
||||
}
|
||||
}
|
||||
|
||||
// Load capabilities data with state preservation
|
||||
async loadCapabilitiesData() {
|
||||
// Load endpoints data with state preservation
|
||||
async loadEndpointsData() {
|
||||
try {
|
||||
const ip = this.get('nodeIp');
|
||||
const response = await window.apiClient.getCapabilities(ip);
|
||||
this.set('capabilities', response || null);
|
||||
const response = await window.apiClient.getEndpoints(ip);
|
||||
this.set('endpoints', response || null);
|
||||
} catch (error) {
|
||||
console.error('Failed to load capabilities:', error);
|
||||
this.set('capabilities', null);
|
||||
console.error('Failed to load endpoints:', error);
|
||||
this.set('endpoints', null);
|
||||
}
|
||||
}
|
||||
|
||||
// Invoke a capability against this node
|
||||
async callCapability(method, uri, params) {
|
||||
// Invoke an endpoint against this node
|
||||
async callEndpoint(method, uri, params) {
|
||||
const ip = this.get('nodeIp');
|
||||
return window.apiClient.callCapability({ ip, method, uri, params });
|
||||
return window.apiClient.callEndpoint({ ip, method, uri, params });
|
||||
}
|
||||
|
||||
// Set active tab with state persistence
|
||||
|
||||
Reference in New Issue
Block a user