From 7c53307fbc06c0b4c15a2e8099072bb82c703903 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20=C3=81ngel?= Date: Thu, 25 Oct 2018 18:12:58 +0200 Subject: [PATCH] Yarn prettier --- public/controllers/agent/agents.js | 37 +++++++++++++++---------- public/controllers/management/status.js | 6 +--- public/directives/wz-menu/wz-menu.js | 4 +-- 3 files changed, 24 insertions(+), 23 deletions(-) diff --git a/public/controllers/agent/agents.js b/public/controllers/agent/agents.js index 7bd9ab893..d161c055d 100644 --- a/public/controllers/agent/agents.js +++ b/public/controllers/agent/agents.js @@ -283,28 +283,39 @@ class AgentsController { // Switch tab async switchTab(tab, force = false) { try { - if(tab === 'pci') { + if (tab === 'pci') { const pciTabs = await this.commonData.getPCI(); this.$scope.pciTabs = pciTabs; this.$scope.selectedPciIndex = 0; } - if(tab === 'gdpr') { + if (tab === 'gdpr') { const gdprTabs = await this.commonData.getPCI(); this.$scope.gdprTabs = gdprTabs; this.$scope.selectedGdprIndex = 0; } - if(tab === 'syscollector') await this.loadSyscollector(this.$scope.agent.id); + if (tab === 'syscollector') + await this.loadSyscollector(this.$scope.agent.id); if (tab === 'configuration') { - const isSync = await this.apiReq.request('GET', `/agents/${this.$scope.agent.id}/group/is_sync`, {}) + const isSync = await this.apiReq.request( + 'GET', + `/agents/${this.$scope.agent.id}/group/is_sync`, + {} + ); // Configuration synced - this.$scope.isSynchronized = isSync && isSync.data && isSync.data.data && isSync.data.data.synced; + this.$scope.isSynchronized = + isSync && isSync.data && isSync.data.data && isSync.data.data.synced; this.$scope.switchConfigurationTab('welcome'); } else { this.configurationHandler.reset(this.$scope); } - if (tab !== 'configuration' && tab !== 'welcome' && tab !== 'syscollector') + if ( + tab !== 'configuration' && + tab !== 'welcome' && + tab !== 'syscollector' + ) this.tabHistory.push(tab); - if (this.tabHistory.length > 2) this.tabHistory = this.tabHistory.slice(-2); + if (this.tabHistory.length > 2) + this.tabHistory = this.tabHistory.slice(-2); this.tabVisualizations.setTab(tab); if (this.$scope.tab === tab && !force) return; const onlyAgent = this.$scope.tab === tab && force; @@ -333,8 +344,8 @@ class AgentsController { this.shareAgent.deleteTargetLocation(); this.targetLocation = null; - } catch(error) { - return Promise.reject(error) + } catch (error) { + return Promise.reject(error); } if (!this.$scope.$$phase) this.$scope.$digest(); } @@ -451,12 +462,8 @@ class AgentsController { const result = data.map( item => (item && item.data && item.data.data ? item.data.data : false) ); - - const [ - agentInfo, - syscheckLastScan, - rootcheckLastScan - ] = result; + + const [agentInfo, syscheckLastScan, rootcheckLastScan] = result; // Agent this.$scope.agent = agentInfo; diff --git a/public/controllers/management/status.js b/public/controllers/management/status.js index 6604fa718..07cf6dfc6 100644 --- a/public/controllers/management/status.js +++ b/public/controllers/management/status.js @@ -56,11 +56,7 @@ class StatusController { const parsedData = data.map( item => (item && item.data && item.data.data ? item.data.data : false) ); - const [ - stats, - clusterStatus, - managerInfo - ] = parsedData; + const [stats, clusterStatus, managerInfo] = parsedData; // Once Wazuh core fixes agent 000 issues, this should be adjusted const active = stats.Active - 1; diff --git a/public/directives/wz-menu/wz-menu.js b/public/directives/wz-menu/wz-menu.js index 6b1a166e7..e7078703f 100644 --- a/public/directives/wz-menu/wz-menu.js +++ b/public/directives/wz-menu/wz-menu.js @@ -69,8 +69,7 @@ class WzMenu { filtered = list.filter(item => item.id.includes(appState.getCurrentPattern()) ); - if (!filtered.length) - appState.setCurrentPattern(list[0].id); + if (!filtered.length) appState.setCurrentPattern(list[0].id); } const data = filtered @@ -78,7 +77,6 @@ class WzMenu { : await indexPatterns.get(appState.getCurrentPattern()); $scope.theresPattern = true; $scope.currentPattern = data.title; - // Getting the list of index patterns if (list) {