mirror of
https://github.com/valitydev/wazuh-kibana-app.git
synced 2024-11-07 02:15:24 +00:00
Yarn prettier
This commit is contained in:
parent
c7cbbbed8c
commit
7c53307fbc
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user