2018-05-15 12:01:26 +00:00
|
|
|
/*
|
2018-05-15 14:11:35 +00:00
|
|
|
* Wazuh app - Factory to store visualization tabs
|
2018-06-19 14:40:03 +00:00
|
|
|
*
|
2018-05-15 12:01:26 +00:00
|
|
|
* Copyright (C) 2018 Wazuh, Inc.
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* Find more information about this on the LICENSE file.
|
|
|
|
*/
|
2018-09-11 09:52:54 +00:00
|
|
|
export class TabVisualizations {
|
2018-09-10 08:32:49 +00:00
|
|
|
constructor() {
|
|
|
|
this.agents = {
|
|
|
|
welcome: 0,
|
|
|
|
general: 7,
|
|
|
|
fim: 7,
|
|
|
|
pm: 4,
|
2018-10-08 10:26:34 +00:00
|
|
|
vuls: 10,
|
2018-09-10 08:32:49 +00:00
|
|
|
oscap: 13,
|
|
|
|
ciscat: 11,
|
|
|
|
audit: 15,
|
|
|
|
gdpr: 3,
|
|
|
|
pci: 3,
|
|
|
|
virustotal: 6,
|
2018-10-03 13:13:49 +00:00
|
|
|
configuration: 0,
|
|
|
|
osquery: 5
|
2018-09-10 08:32:49 +00:00
|
|
|
};
|
2018-06-12 13:23:03 +00:00
|
|
|
|
2018-09-10 08:32:49 +00:00
|
|
|
this.overview = {
|
|
|
|
welcome: 0,
|
|
|
|
general: 11,
|
2018-09-13 07:06:12 +00:00
|
|
|
fim: 8,
|
2018-09-10 08:32:49 +00:00
|
|
|
pm: 5,
|
2018-10-08 10:26:34 +00:00
|
|
|
vuls: 10,
|
2018-09-10 08:32:49 +00:00
|
|
|
oscap: 11,
|
|
|
|
ciscat: 11,
|
|
|
|
audit: 15,
|
|
|
|
pci: 6,
|
|
|
|
gdpr: 6,
|
2018-09-18 10:42:46 +00:00
|
|
|
aws: 6,
|
2018-09-26 16:13:14 +00:00
|
|
|
virustotal: 7,
|
2018-09-29 10:36:26 +00:00
|
|
|
osquery: 5
|
2018-09-10 08:32:49 +00:00
|
|
|
};
|
2018-06-12 13:23:03 +00:00
|
|
|
|
2018-09-10 08:32:49 +00:00
|
|
|
this.tabVisualizations = {};
|
|
|
|
this.currentTab = '';
|
|
|
|
}
|
2018-05-15 12:01:26 +00:00
|
|
|
|
2018-09-10 08:32:49 +00:00
|
|
|
setTab(tab) {
|
|
|
|
this.currentTab = tab;
|
|
|
|
}
|
|
|
|
|
|
|
|
getTab() {
|
|
|
|
return this.currentTab;
|
|
|
|
}
|
|
|
|
|
|
|
|
getItem(item) {
|
|
|
|
return this.tabVisualizations[item];
|
|
|
|
}
|
2018-05-15 12:01:26 +00:00
|
|
|
|
2018-09-10 08:32:49 +00:00
|
|
|
assign(tabs) {
|
|
|
|
if (typeof tabs === 'object') {
|
|
|
|
this.tabVisualizations = tabs;
|
|
|
|
} else if (typeof tabs === 'string') {
|
|
|
|
this.tabVisualizations =
|
|
|
|
tabs === 'overview' ? this.overview : this.agents;
|
2018-05-15 12:01:26 +00:00
|
|
|
}
|
2018-09-10 08:32:49 +00:00
|
|
|
}
|
2018-05-15 12:01:26 +00:00
|
|
|
|
2018-09-10 08:32:49 +00:00
|
|
|
removeAll() {
|
|
|
|
this.tabVisualizations = {};
|
|
|
|
}
|
2018-08-20 07:00:50 +00:00
|
|
|
}
|