2018-04-22 20:16:38 +00:00
|
|
|
/*
|
|
|
|
* Wazuh app - File for app requirements and set up
|
2019-01-14 16:36:47 +00:00
|
|
|
* Copyright (C) 2015-2019 Wazuh, Inc.
|
2018-04-22 20:16:38 +00:00
|
|
|
*
|
|
|
|
* 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-11-12 09:33:53 +00:00
|
|
|
import 'ui/autoload/styles';
|
2018-09-10 08:32:49 +00:00
|
|
|
import 'uiExports/visTypes';
|
|
|
|
import 'uiExports/visResponseHandlers';
|
|
|
|
import 'uiExports/visRequestHandlers';
|
|
|
|
import 'uiExports/visEditorTypes';
|
|
|
|
import 'uiExports/savedObjectTypes';
|
|
|
|
import 'uiExports/spyModes';
|
|
|
|
import 'uiExports/fieldFormats';
|
|
|
|
import 'uiExports/fieldFormatEditors';
|
|
|
|
import 'uiExports/navbarExtensions';
|
|
|
|
import 'uiExports/managementSections';
|
|
|
|
import 'uiExports/devTools';
|
|
|
|
import 'uiExports/docViews';
|
|
|
|
import 'uiExports/embeddableFactories';
|
|
|
|
import 'uiExports/autocompleteProviders';
|
2018-04-22 20:16:38 +00:00
|
|
|
|
2016-06-29 01:43:18 +00:00
|
|
|
// Require CSS
|
2018-06-15 10:42:57 +00:00
|
|
|
import './less/loader';
|
2020-03-12 08:56:52 +00:00
|
|
|
// Require lib to dashboards PDFs
|
|
|
|
require ('./utils/dom-to-image.js');
|
2018-07-31 09:04:36 +00:00
|
|
|
import { uiModules } from 'ui/modules';
|
2019-04-02 15:35:20 +00:00
|
|
|
import chrome from 'ui/chrome';
|
2018-07-31 09:04:36 +00:00
|
|
|
|
2019-04-10 13:07:56 +00:00
|
|
|
// EUI React components wrapper
|
|
|
|
import './components';
|
|
|
|
|
2019-04-11 14:42:31 +00:00
|
|
|
// angular-charts.js
|
|
|
|
import 'angular-chart.js';
|
|
|
|
|
2019-08-20 09:05:43 +00:00
|
|
|
// Font Awesome, Kibana UI framework and others
|
|
|
|
import './utils/fontawesome/css/font-awesome.min.css';
|
|
|
|
|
|
|
|
// Dev tools
|
|
|
|
import './utils/codemirror';
|
|
|
|
|
|
|
|
import './utils/jquery-ui';
|
|
|
|
|
|
|
|
// Material
|
|
|
|
import 'angular-material/angular-material.css';
|
|
|
|
import 'angular-aria/angular-aria';
|
|
|
|
import 'angular-animate/angular-animate';
|
|
|
|
import 'angular-material/angular-material';
|
|
|
|
|
|
|
|
// Cookies
|
|
|
|
import 'angular-cookies/angular-cookies';
|
|
|
|
|
|
|
|
import 'ui/autoload/all';
|
|
|
|
|
|
|
|
// Wazuh
|
|
|
|
import './kibana-integrations';
|
|
|
|
import './services';
|
|
|
|
import './controllers';
|
|
|
|
import './factories';
|
|
|
|
import './directives';
|
|
|
|
|
2016-06-29 01:43:18 +00:00
|
|
|
// Set up Wazuh app
|
2019-04-11 14:42:31 +00:00
|
|
|
const app = uiModules.get('app/wazuh', ['ngCookies', 'ngMaterial', 'chart.js']);
|
2018-03-06 11:03:58 +00:00
|
|
|
|
2018-09-10 08:32:49 +00:00
|
|
|
app.config([
|
|
|
|
'$compileProvider',
|
2019-04-12 10:49:31 +00:00
|
|
|
function($compileProvider) {
|
2018-09-10 08:32:49 +00:00
|
|
|
$compileProvider.aHrefSanitizationWhitelist(
|
|
|
|
/^\s*(https?|ftp|mailto|data|blob):/
|
|
|
|
);
|
|
|
|
}
|
|
|
|
]);
|
2018-03-06 11:03:58 +00:00
|
|
|
|
2018-09-10 08:32:49 +00:00
|
|
|
app.config([
|
|
|
|
'$httpProvider',
|
2019-04-12 10:49:31 +00:00
|
|
|
function($httpProvider) {
|
2018-04-22 20:16:38 +00:00
|
|
|
$httpProvider.useApplyAsync(true);
|
2018-09-10 08:32:49 +00:00
|
|
|
}
|
|
|
|
]);
|
2016-06-29 01:43:18 +00:00
|
|
|
|
2020-03-12 08:56:52 +00:00
|
|
|
app.run(function() {
|
2019-08-20 09:05:43 +00:00
|
|
|
chrome
|
|
|
|
.setRootTemplate('<wz-menu></wz-menu><div ng-view></div>')
|
2020-03-12 08:56:52 +00:00
|
|
|
.setRootController(() => require('./app'))
|
|
|
|
|
2019-01-16 15:16:00 +00:00
|
|
|
});
|
|
|
|
|
2018-06-25 07:47:35 +00:00
|
|
|
// Added due to Kibana 6.3.0. Do not modify.
|
2018-09-10 08:32:49 +00:00
|
|
|
uiModules.get('kibana').provider('dashboardConfig', () => {
|
|
|
|
let hideWriteControls = false;
|
2018-06-25 07:47:35 +00:00
|
|
|
|
2018-09-10 08:32:49 +00:00
|
|
|
return {
|
|
|
|
/**
|
|
|
|
* Part of the exposed plugin API - do not remove without careful consideration.
|
|
|
|
* @type {boolean}
|
|
|
|
*/
|
|
|
|
turnHideWriteControlsOn() {
|
|
|
|
hideWriteControls = true;
|
|
|
|
},
|
|
|
|
$get() {
|
|
|
|
return {
|
|
|
|
getHideWriteControls() {
|
|
|
|
return hideWriteControls;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
|
|
|
};
|
2019-09-03 11:30:09 +00:00
|
|
|
});
|