Yarn prettier

This commit is contained in:
Jesús Ángel 2019-02-17 15:52:25 +01:00
parent ff88df6f0c
commit 056bc974e4
3 changed files with 26 additions and 22 deletions

View File

@ -16,7 +16,7 @@ import { uiModules } from 'ui/modules';
const app = uiModules.get('app/wazuh', []);
app.directive('wzXmlFileEditor', function () {
app.directive('wzXmlFileEditor', function() {
return {
restrict: 'E',
scope: {
@ -44,7 +44,7 @@ app.directive('wzXmlFileEditor', function () {
* evaluates regular expressions.
* Alternative using split + join, same result.
*/
String.prototype.xmlReplace = function (str, newstr) {
String.prototype.xmlReplace = function(str, newstr) {
return this.split(str).join(newstr);
};
@ -152,10 +152,10 @@ app.directive('wzXmlFileEditor', function () {
var type = single
? 'single'
: closing
? 'closing'
: opening
? 'opening'
: 'other';
? 'closing'
: opening
? 'opening'
: 'other';
var fromTo = lastType + '->' + type;
lastType = type;
var padding = '';
@ -178,15 +178,15 @@ app.directive('wzXmlFileEditor', function () {
const validation = isCluster
? await apiReq.request(
'GET',
`/cluster/configuration/validation`,
{}
)
'GET',
`/cluster/configuration/validation`,
{}
)
: await apiReq.request(
'GET',
`/manager/configuration/validation`,
{}
);
'GET',
`/manager/configuration/validation`,
{}
);
const data = ((validation || {}).data || {}).data || {};
const isOk = data.status === 'OK';
if (!isOk && Array.isArray(data.details)) {
@ -260,7 +260,7 @@ app.directive('wzXmlFileEditor', function () {
}
const msg = `Success. Node (${
params.node
}) configuration has been updated`;
}) configuration has been updated`;
params.showRestartManager
? params.showRestartManager !== 'warn'
? showRestartDialog(msg, params.node)
@ -330,7 +330,7 @@ app.directive('wzXmlFileEditor', function () {
const showRestartDialog = async (msg, target) => {
const confirm = $mdDialog.confirm({
controller: function (
controller: function(
$scope,
scope,
errorHandler,

View File

@ -259,8 +259,10 @@ export default [
_type: 'visualization',
_source: {
title: 'Commonly fired rules',
"visState": "{\"title\":\"Commonly fired rules\",\"type\":\"table\",\"params\":{\"perPage\":10,\"showPartialRows\":false,\"showMetricsAtAllLevels\":false,\"sort\":{\"columnIndex\":null,\"direction\":null},\"showTotal\":false,\"totalFunc\":\"sum\"},\"aggs\":[{\"id\":\"1\",\"enabled\":true,\"type\":\"count\",\"schema\":\"metric\",\"params\":{}},{\"id\":\"2\",\"enabled\":true,\"type\":\"terms\",\"schema\":\"bucket\",\"params\":{\"field\":\"rule.description\",\"size\":5,\"order\":\"desc\",\"orderBy\":\"1\",\"otherBucket\":false,\"otherBucketLabel\":\"Other\",\"missingBucket\":false,\"missingBucketLabel\":\"Missing\",\"customLabel\":\"Description\"}}]}",
"uiStateJSON": "{\"vis\":{\"params\":{\"sort\":{\"columnIndex\":null,\"direction\":null}}}}",
visState:
'{"title":"Commonly fired rules","type":"table","params":{"perPage":10,"showPartialRows":false,"showMetricsAtAllLevels":false,"sort":{"columnIndex":null,"direction":null},"showTotal":false,"totalFunc":"sum"},"aggs":[{"id":"1","enabled":true,"type":"count","schema":"metric","params":{}},{"id":"2","enabled":true,"type":"terms","schema":"bucket","params":{"field":"rule.description","size":5,"order":"desc","orderBy":"1","otherBucket":false,"otherBucketLabel":"Other","missingBucket":false,"missingBucketLabel":"Missing","customLabel":"Description"}}]}',
uiStateJSON:
'{"vis":{"params":{"sort":{"columnIndex":null,"direction":null}}}}',
description: '',
version: 1,
kibanaSavedObjectMeta: {
@ -274,8 +276,10 @@ export default [
_type: 'visualization',
_source: {
title: 'Most active origins',
"visState": "{\"title\":\"Most active origins\",\"type\":\"table\",\"params\":{\"perPage\":10,\"showPartialRows\":false,\"showMetricsAtAllLevels\":false,\"sort\":{\"columnIndex\":null,\"direction\":null},\"showTotal\":false,\"totalFunc\":\"sum\"},\"aggs\":[{\"id\":\"1\",\"enabled\":true,\"type\":\"count\",\"schema\":\"metric\",\"params\":{}},{\"id\":\"2\",\"enabled\":true,\"type\":\"terms\",\"schema\":\"bucket\",\"params\":{\"field\":\"location\",\"size\":5,\"order\":\"desc\",\"orderBy\":\"1\",\"otherBucket\":false,\"otherBucketLabel\":\"Other\",\"missingBucket\":false,\"missingBucketLabel\":\"Missing\",\"customLabel\":\"Description\"}}]}",
"uiStateJSON": "{\"vis\":{\"params\":{\"sort\":{\"columnIndex\":null,\"direction\":null}}}}",
visState:
'{"title":"Most active origins","type":"table","params":{"perPage":10,"showPartialRows":false,"showMetricsAtAllLevels":false,"sort":{"columnIndex":null,"direction":null},"showTotal":false,"totalFunc":"sum"},"aggs":[{"id":"1","enabled":true,"type":"count","schema":"metric","params":{}},{"id":"2","enabled":true,"type":"terms","schema":"bucket","params":{"field":"location","size":5,"order":"desc","orderBy":"1","otherBucket":false,"otherBucketLabel":"Other","missingBucket":false,"missingBucketLabel":"Missing","customLabel":"Description"}}]}',
uiStateJSON:
'{"vis":{"params":{"sort":{"columnIndex":null,"direction":null}}}}',
description: '',
version: 1,
kibanaSavedObjectMeta: {

View File

@ -18,7 +18,7 @@ export function indexDate(interval) {
.replace(/T/, '-')
.replace(/\..+/, '')
.replace(/-/g, '.')
.replace(/:/g, '')
.replace(/:/g, '');
let date = '';
switch (interval) {
case 'h':
@ -48,7 +48,7 @@ export function indexDate(interval) {
}
}
var weekOfYear = function () {
var weekOfYear = function() {
var d = new Date();
d.setHours(0, 0, 0);
d.setDate(d.getDate() + 4 - (d.getDay() || 7));