Optimized agent welcome screen - 1

This commit is contained in:
Jesús Ángel 2018-10-25 11:52:33 +02:00
parent 506c1e9b2e
commit ab67abaebb

View File

@ -292,7 +292,9 @@ class AgentsController {
}
// Switch tab
switchTab(tab, force = false) {
async switchTab(tab, force = false) {
try {
if(tab === 'syscollector') await this.loadSyscollector(this.$scope.agent.id);
if (tab === 'configuration') {
this.$scope.switchConfigurationTab('welcome');
} else {
@ -329,6 +331,9 @@ class AgentsController {
this.shareAgent.deleteTargetLocation();
this.targetLocation = null;
} catch(error) {
return Promise.reject(error)
}
}
// Agent data
@ -472,9 +477,9 @@ class AgentsController {
// Configuration synced
this.$scope.isSynchronized = isSync && isSync.synced;
this.$scope.switchTab(this.$scope.tab, true);
await this.$scope.switchTab(this.$scope.tab, true);
await this.loadSyscollector(id);
if(this.$scope.tab === 'syscollector') await this.loadSyscollector(id);
this.$scope.load = false;
if (!this.$scope.$$phase) this.$scope.$digest();
@ -554,7 +559,7 @@ class AgentsController {
this.$scope.load = false;
if (this.$scope.tab !== 'configuration')
this.$scope.switchTab(this.$scope.tab, true);
await this.$scope.switchTab(this.$scope.tab, true);
if (!this.$scope.$$phase) this.$scope.$digest();
return;