Merge branch 'development' of http://github.com/wazuh/wazuh-kibana-ui into development

This commit is contained in:
Pedro S 2016-09-16 05:36:07 -07:00
commit 615557a011
7 changed files with 85 additions and 36 deletions

View File

@ -1,7 +1,7 @@
// Require config
var app = require('ui/modules').get('app/wazuh', []);
app.controller('agentsController', function ($scope, DataFactory, $mdToast) {
app.controller('agentsController', function ($scope, DataFactory, $mdToast, errlog) {
//Initialisation
$scope.load = true;
$scope.agentInfo = [];
@ -234,7 +234,11 @@ app.controller('agentsPreviewController', function ($scope, DataFactory, $mdToas
};
//Load
load();
try {
load();
} catch (e) {
errlog.log('Unexpected exception loading controller', e);
}
//Destroy
$scope.$on("$destroy", function () {

View File

@ -1,7 +1,7 @@
// Require config
var app = require('ui/modules').get('app/wazuh', []);
app.controller('fimController', function ($scope, $q, DataFactory, $mdToast) {
app.controller('fimController', function ($scope, $q, DataFactory, $mdToast, errlog) {
//Initialisation
$scope.load = true;
var objectsArray = [];
@ -181,7 +181,11 @@ app.controller('fimController', function ($scope, $q, DataFactory, $mdToast) {
};
//Load
load();
try {
load();
} catch (e) {
errlog.log('Unexpected exception loading controller', e);
}
//Destroy
$scope.$on("$destroy", function () {

View File

@ -3,7 +3,7 @@ var kuf = require('plugins/wazuh/utils/kibanaUrlFormatter.js');
// Require config
var app = require('ui/modules').get('app/wazuh', []);
app.controller('generalController', function ($scope, $q, DataFactory, tabProvider, $mdToast, appState) {
app.controller('generalController', function ($scope, $q, DataFactory, tabProvider, $mdToast, appState, errlog) {
//Initialisation
$scope.load = true;
$scope.search = '';
@ -114,15 +114,24 @@ app.controller('generalController', function ($scope, $q, DataFactory, tabProvid
}
};
//Load
DataFactory.initialize('get', '/agents', {}, 256, 0)
.then(function (data) {
objectsArray['/agents'] = data;
DataFactory.get(data).then(function (data) {
DataFactory.filters.register(objectsArray['/agents'], 'search', 'string');
$scope.load = false;
var load = function () {
DataFactory.initialize('get', '/agents', {}, 256, 0)
.then(function (data) {
objectsArray['/agents'] = data;
DataFactory.get(data).then(function (data) {
DataFactory.filters.register(objectsArray['/agents'], 'search', 'string');
$scope.load = false;
}, printError);
}, printError);
}, printError);
};
//Load
try {
load();
} catch (e) {
errlog.log('Unexpected exception loading controller', e);
}
//Destroy
$scope.$on("$destroy", function () {

View File

@ -3,7 +3,7 @@ var kuf = require('plugins/wazuh/utils/kibanaUrlFormatter.js');
// Require config
var app = require('ui/modules').get('app/wazuh', []);
app.controller('managerController', function ($scope, DataFactory, genericReq, tabProvider, $mdDialog, $mdToast) {
app.controller('managerController', function ($scope, DataFactory, genericReq, tabProvider, $mdDialog, $mdToast, errlog) {
//Initialisation
$scope.load = true;
$scope.$parent.state.setManagerState('status');
@ -168,7 +168,11 @@ app.controller('managerController', function ($scope, DataFactory, genericReq, t
};
//Load
load();
try {
load();
} catch (e) {
errlog.log('Unexpected exception loading controller', e);
}
// Timer filter watch
var loadWatch = $scope.$watch(function () {
@ -189,7 +193,7 @@ app.controller('managerController', function ($scope, DataFactory, genericReq, t
});
app.controller('managerConfigurationController', function ($scope, DataFactory, tabProvider) {
app.controller('managerConfigurationController', function ($scope, DataFactory, tabProvider, errlog) {
//Initialisation
$scope.load = true;
$scope.$parent.state.setManagerState('configuration');
@ -283,7 +287,11 @@ app.controller('managerConfigurationController', function ($scope, DataFactory,
};
//Load
load();
try {
load();
} catch (e) {
errlog.log('Unexpected exception loading controller', e);
}
//Destroy
$scope.$on("$destroy", function () {

View File

@ -1,7 +1,7 @@
// Require config
var app = require('ui/modules').get('app/wazuh', []);
app.controller('osseclogController', function ($scope, DataFactory, $sce, $interval, $mdToast) {
app.controller('osseclogController', function ($scope, DataFactory, $sce, $interval, $mdToast, errlog) {
//Initialisation
$scope.load = true;
$scope.text = [];
@ -130,17 +130,25 @@ app.controller('osseclogController', function ($scope, DataFactory, $sce, $inter
}
};
//Load
DataFactory.initialize('get', '/manager/logs', {}, 150, 0)
.then(function (data) {
objectsArray['/manager/logs'] = data;
DataFactory.filters.register(objectsArray['/manager/logs'], 'category', 'string');
DataFactory.filters.register(objectsArray['/manager/logs'], 'type_log', 'string');
DataFactory.get(data).then(function (data) {
$scope.text = data.data.items;
loadSummary();
var load = function () {
DataFactory.initialize('get', '/manager/logs', {}, 150, 0)
.then(function (data) {
objectsArray['/manager/logs'] = data;
DataFactory.filters.register(objectsArray['/manager/logs'], 'category', 'string');
DataFactory.filters.register(objectsArray['/manager/logs'], 'type_log', 'string');
DataFactory.get(data).then(function (data) {
$scope.text = data.data.items;
loadSummary();
}, printError);
}, printError);
}, printError);
}
//Load
try {
load();
} catch (e) {
errlog.log('Unexpected exception loading controller', e);
}
//Destroy

View File

@ -1,7 +1,7 @@
// Require config
var app = require('ui/modules').get('app/wazuh', []);
app.controller('pmController', function ($scope, DataFactory, $mdDialog) {
app.controller('pmController', function ($scope, DataFactory, $mdDialog, errlog) {
//Initialisation
$scope.load = true;
var objectsArray = [];
@ -122,7 +122,11 @@ app.controller('pmController', function ($scope, DataFactory, $mdDialog) {
};
//Load
load();
try {
load();
} catch (e) {
errlog.log('Unexpected exception loading controller', e);
}
//Destroy
$scope.$on("$destroy", function () {

View File

@ -2,7 +2,7 @@
var config = require('plugins/wazuh/config/config.js');
var app = require('ui/modules').get('app/wazuh', []);
app.controller('rulesController', function ($scope, $q, DataFactory, $mdToast) {
app.controller('rulesController', function ($scope, $q, DataFactory, $mdToast, errlog) {
//Initialisation
$scope.load = true;
$scope.$parent.state.setRulesetState('rules');
@ -232,7 +232,11 @@ app.controller('rulesController', function ($scope, $q, DataFactory, $mdToast) {
};
//Load
load();
try {
load();
} catch (e) {
errlog.log('Unexpected exception loading controller', e);
}
//Destroy
$scope.$on("$destroy", function () {
@ -243,7 +247,7 @@ app.controller('rulesController', function ($scope, $q, DataFactory, $mdToast) {
});
app.controller('decodersController', function ($scope, $q, $sce, DataFactory, $mdToast) {
app.controller('decodersController', function ($scope, $q, $sce, DataFactory, $mdToast, errlog) {
//Initialisation
$scope.load = true;
@ -441,7 +445,11 @@ app.controller('decodersController', function ($scope, $q, $sce, DataFactory, $m
};
//Load
load();
try {
load();
} catch (e) {
errlog.log('Unexpected exception loading controller', e);
}
//Destroy
$scope.$on("$destroy", function () {
@ -453,7 +461,7 @@ app.controller('decodersController', function ($scope, $q, $sce, DataFactory, $m
});
app.controller('updateRulesetController', function ($scope, $q, DataFactory, tabProvider, $mdDialog, $mdToast) {
app.controller('updateRulesetController', function ($scope, $q, DataFactory, tabProvider, $mdDialog, $mdToast, errlog) {
//Initialisation
$scope.load = true;
$scope.$parent.state.setRulesetState('update');
@ -610,7 +618,11 @@ app.controller('updateRulesetController', function ($scope, $q, DataFactory, tab
};
//Load
load();
try {
load();
} catch (e) {
errlog.log('Unexpected exception loading controller', e);
}
//Destroy
$scope.$on("$destroy", function () {