Merge branch 'dev-factories-single-file' of https://github.com/jesusgn90/wazuh-kibana-app into jesusgn90-dev-factories-single-file

Conflicts:
	public/controllers/groups.js
This commit is contained in:
havidarou 2017-11-08 07:12:53 -05:00
commit 1f4ff21295
9 changed files with 68 additions and 67 deletions

View File

@ -30,6 +30,11 @@ require('plugins/wazuh/kibana-integrations/kibanaSearchbarDirective.js');
// Require controllers
// Factories
require('plugins/wazuh/controllers/common/factories.js');
require('plugins/wazuh/controllers/common/filters.js');
require('plugins/wazuh/controllers/common/directives.js');
// Overview
require('plugins/wazuh/controllers/overview.js');

View File

@ -2,12 +2,6 @@ import rison from 'rison-node';
// Require config
let app = require('ui/modules').get('app/wazuh', []);
// We are using the DataHandler template and customize its path to get information about agents
app.factory('AgentsAutoComplete', function (DataHandler) {
let AgentsAutoComplete = new DataHandler();
AgentsAutoComplete.path = '/agents';
return AgentsAutoComplete;
});
app.controller('agentsController',
function ($scope, $q, $routeParams, $route, $location, $rootScope, Notifier, appState, genericReq, apiReq, AgentsAutoComplete) {

View File

@ -1,12 +1,5 @@
let app = require('ui/modules').get('app/wazuh', []);
// We are using the DataHandler template and customize its path to get information about agents
app.factory('Agents', function (DataHandler) {
let Agents = new DataHandler();
Agents.path = '/agents';
return Agents;
});
app.controller('agentsPreviewController', function ($scope, Notifier, genericReq, apiReq, appState, Agents) {
const notify = new Notifier({ location: 'Agents - Preview' });
$scope.loading = true;

View File

@ -0,0 +1,14 @@
const app = require('ui/modules').get('app/wazuh', []);
app
.directive('dynamic', function($compile) {
return {
restrict: 'A',
replace: true,
link: function(scope, ele, attrs) {
scope.$watch(attrs.dynamic, function(html) {
ele.html(html);
$compile(ele.contents())(scope);
});
},
};
});

View File

@ -0,0 +1,41 @@
const app = require('ui/modules').get('app/wazuh', []);
app
.factory('Groups', function(DataHandler) {
let Groups = new DataHandler();
Groups.path = '/agents/groups';
return Groups;
})
.factory('GroupAgents', function(DataHandler) {
return new DataHandler();
})
.factory('GroupFiles', function(DataHandler) {
return new DataHandler();
})
.factory('AgentsAutoComplete', function (DataHandler) {
let AgentsAutoComplete = new DataHandler();
AgentsAutoComplete.path = '/agents';
return AgentsAutoComplete;
})
.factory('Agents', function (DataHandler) {
let Agents = new DataHandler();
Agents.path = '/agents';
return Agents;
})
.factory('Logs', function (DataHandler) {
let Logs = new DataHandler();
Logs.path = '/manager/logs';
return Logs;
})
.factory('Rules', function (DataHandler) {
let Rules = new DataHandler();
Rules.path = '/rules';
return Rules;
})
.factory('Decoders', function (DataHandler) {
let Decoders = new DataHandler();
Decoders.path = '/decoders';
return Decoders;
});

View File

@ -0,0 +1,8 @@
const app = require('ui/modules').get('app/wazuh', []);
app
.filter('prettyJSON', function() {
return function(json) {
return angular.toJson(json, true);
};
})

View File

@ -1,39 +1,5 @@
let app = require('ui/modules').get('app/wazuh', []);
const beautifier = require('plugins/wazuh/utils/json-beautifier');
// We are using the DataHandler template and customize its path to get information about groups
app
.factory('Groups', function(DataHandler) {
let Groups = new DataHandler();
Groups.path = '/agents/groups';
return Groups;
})
.factory('GroupAgents', function(DataHandler) {
return new DataHandler();
})
.factory('GroupFiles', function(DataHandler) {
return new DataHandler();
})
.filter('prettyJSON', function() {
return function(json) {
return angular.toJson(json, true);
};
})
.directive('dynamic', function($compile) {
return {
restrict: 'A',
replace: true,
link: function(scope, ele, attrs) {
scope.$watch(attrs.dynamic, function(html) {
ele.html(html);
$compile(ele.contents())(scope);
});
},
};
});
app.filter('prettyJSON', function () {
return function(json) { return angular.toJson(json, true); };
});
// Groups preview controller
app.controller('groupsPreviewController',

View File

@ -1,12 +1,5 @@
let app = require('ui/modules').get('app/wazuh', []);
// We are using the DataHandler template and customize its path to get information about logs
app.factory('Logs', function (DataHandler) {
let Logs = new DataHandler();
Logs.path = '/manager/logs';
return Logs;
});
// Logs controller
app.controller('managerLogController', function ($scope, Logs, apiReq) {
$scope.searchTerm = '';

View File

@ -1,18 +1,5 @@
var app = require('ui/modules').get('app/wazuh');
// We are using the DataHandler template and customize its path to get information
app.factory('Rules', function (DataHandler) {
var Rules = new DataHandler();
Rules.path = '/rules';
return Rules;
});
app.factory('Decoders', function (DataHandler) {
var Decoders = new DataHandler();
Decoders.path = '/decoders';
return Decoders;
});
app.controller('rulesController', function ($scope, Notifier, Rules) {
//Initialization
const notify = new Notifier({ location: 'Manager - Rules' });