Lint and prettier

This commit is contained in:
JuanCarlos 2019-07-25 16:44:55 +02:00 committed by Jesús Ángel
parent 3797a66e6b
commit b7d160652d
12 changed files with 68 additions and 30 deletions

View File

@ -862,7 +862,9 @@ export class AgentsController {
{}
);
this.errorHandler.info(
`Policy monitoring scan launched successfully on agent ${this.$scope.agent.id}`,
`Policy monitoring scan launched successfully on agent ${
this.$scope.agent.id
}`,
''
);
} catch (error) {

View File

@ -109,13 +109,13 @@ export class FilesController {
isOverwrite: !!this.overwriteError
};
(isNewFile && this.$scope.type === 'rules') ||
(!isNewFile && this.$scope.currentFile.type === 'rule')
(!isNewFile && this.$scope.currentFile.type === 'rule')
? (objParam.rule = isNewFile
? this.selectedItem
: this.$scope.currentFile)
? this.selectedItem
: this.$scope.currentFile)
: (objParam.decoder = isNewFile
? this.selectedItem
: this.$scope.currentFile);
? this.selectedItem
: this.$scope.currentFile);
this.$scope.$broadcast('saveXmlFile', objParam);
this.$scope.$applyAsync();
}
@ -142,7 +142,7 @@ export class FilesController {
this.$scope.$applyAsync();
});
this.$scope.$on('closeRulesetFile', (ev) => {
this.$scope.$on('closeRulesetFile', () => {
this.$scope.closeEditingFile(true);
this.$scope.$applyAsync();
});
@ -170,13 +170,13 @@ export class FilesController {
this.$scope.fetchedXML =
this.$scope.type === 'rules'
? await this.rulesetHandler.getRuleConfiguration(
this.$scope.currentFile.file,
readonly
)
this.$scope.currentFile.file,
readonly
)
: await this.rulesetHandler.getDecoderConfiguration(
this.$scope.currentFile.file,
readonly
);
this.$scope.currentFile.file,
readonly
);
this.$scope.$applyAsync();
if (!readonly) {
this.$scope.$broadcast('fetchedFile', { data: this.$scope.fetchedXML });

View File

@ -537,7 +537,9 @@ export function GroupsController(
}));
$scope.failedErrors = groupBy(failedErrors, 'message') || false;
errorHandler.info(
`Group has been updated but an error has occurred with ${failedIds.length} agents`,
`Group has been updated but an error has occurred with ${
failedIds.length
} agents`,
'',
true
);

View File

@ -205,7 +205,9 @@ export class ApiTable extends Component {
<EuiButtonIcon
onClick={() => this.toggleDetails(item)}
aria-label={
itemIdToExpandedRowMap[item.id] ? 'Collapse edition' : 'Expand edition'
itemIdToExpandedRowMap[item.id]
? 'Collapse edition'
: 'Expand edition'
}
iconType={
itemIdToExpandedRowMap[item.id] ? 'arrowUp' : 'arrowDown'

View File

@ -219,7 +219,9 @@ export class SettingsController {
this.$scope.$applyAsync();
this.errorHandler.info(
`API ${this.apiEntries[index]._source.cluster_info.manager} set as default`,
`API ${
this.apiEntries[index]._source.cluster_info.manager
} set as default`,
'Settings'
);

View File

@ -135,7 +135,10 @@ class WzRegisterAgents {
try {
const data = await apiReq.request(
'PUT',
`/agents/${$scope.registerObj.systems[$scope.registerObj.selectedSystem].steps[3].id}/restart`,
`/agents/${
$scope.registerObj.systems[$scope.registerObj.selectedSystem]
.steps[3].id
}/restart`,
{}
);
const result = ((data || {}).data || {}).data || false;
@ -143,7 +146,10 @@ class WzRegisterAgents {
throw new Error('Unexpected error restarting agent');
}
errorHandler.info(
`Success. Agent ${$scope.registerObj.systems[$scope.registerObj.selectedSystem].steps[0].agentName} has been registered.`
`Success. Agent ${
$scope.registerObj.systems[$scope.registerObj.selectedSystem]
.steps[0].agentName
} has been registered.`
);
$scope.nextStep();
} catch (error) {

View File

@ -286,7 +286,9 @@ app.directive('wzXmlFileEditor', function() {
} catch (err) {
params.showRestartManager = 'warn';
}
const msg = `Success. Node (${params.node}) configuration has been updated`;
const msg = `Success. Node (${
params.node
}) configuration has been updated`;
params.showRestartManager
? params.showRestartManager !== 'warn'
? showRestartMessage(msg, params.node)

View File

@ -159,7 +159,9 @@ export class WazuhApiElasticCtrl {
);
log(
'wazuh-api-elastic:saveAPI',
`${req.payload.user}:*****@${req.payload.url}:${req.payload.port} entry saved successfully`,
`${req.payload.user}:*****@${req.payload.url}:${
req.payload.port
} entry saved successfully`,
'debug'
);

View File

@ -46,7 +46,9 @@ export class WazuhElasticCtrl {
if (source.installationDate && source.lastRestart) {
log(
'wazuh-elastic:getTimeStamp',
`Installation date: ${data.hits.hits[0]._source.installationDate}. Last restart: ${data.hits.hits[0]._source.lastRestart}`,
`Installation date: ${
data.hits.hits[0]._source.installationDate
}. Last restart: ${data.hits.hits[0]._source.lastRestart}`,
'debug'
);
return {
@ -505,7 +507,9 @@ export class WazuhElasticCtrl {
let query = '';
if (title === 'Wazuh App Cluster Overview') {
for (const node of nodes) {
query += `.es(index=${pattern_name},q="cluster.name: ${name} AND cluster.node: ${node.name}").label("${node.name}"),`;
query += `.es(index=${pattern_name},q="cluster.name: ${name} AND cluster.node: ${
node.name
}").label("${node.name}"),`;
}
query = query.substring(0, query.length - 1);
} else if (title === 'Wazuh App Cluster Overview Manager') {

View File

@ -1041,12 +1041,16 @@ export class WazuhReportingCtrl {
if (lastScan && lastScan.data) {
if (lastScan.data.start && lastScan.data.end) {
this.dd.content.push({
text: `Last policy monitoring scan was executed from ${lastScan.data.start} to ${lastScan.data.end}.`,
text: `Last policy monitoring scan was executed from ${
lastScan.data.start
} to ${lastScan.data.end}.`,
style: 'standard'
});
} else if (lastScan.data.start) {
this.dd.content.push({
text: `Policy monitoring scan is currently in progress for this agent (started on ${lastScan.data.start}).`,
text: `Policy monitoring scan is currently in progress for this agent (started on ${
lastScan.data.start
}).`,
style: 'standard'
});
} else {
@ -1164,11 +1168,15 @@ export class WazuhReportingCtrl {
if (lastScan && lastScan.data) {
if (lastScan.data.start && lastScan.data.end) {
this.dd.content.push({
text: `Last file integrity monitoring scan was executed from ${lastScan.data.start} to ${lastScan.data.end}.`
text: `Last file integrity monitoring scan was executed from ${
lastScan.data.start
} to ${lastScan.data.end}.`
});
} else if (lastScan.data.start) {
this.dd.content.push({
text: `File integrity monitoring scan is currently in progress for this agent (started on ${lastScan.data.start}).`
text: `File integrity monitoring scan is currently in progress for this agent (started on ${
lastScan.data.start
}).`
});
} else {
this.dd.content.push({

View File

@ -260,7 +260,9 @@ export function Initialize(server) {
reindexResult.length === 2 &&
log(
'initialize:init',
`${reindexResult[0].value} (${reindexResult[0].result}) / ${reindexResult[1].value} (${reindexResult[1].result})`,
`${reindexResult[0].value} (${reindexResult[0].result}) / ${
reindexResult[1].value
} (${reindexResult[1].result})`,
'debug'
);
} catch (error) {
@ -340,7 +342,9 @@ export function Initialize(server) {
await wzWrapper.getTemplateByName('wazuh-kibana');
log(
'initialize:checkKibanaStatus',
`No need to create the ${wzWrapper.WZ_KIBANA_INDEX} template, already exists.`,
`No need to create the ${
wzWrapper.WZ_KIBANA_INDEX
} template, already exists.`,
'debug'
);
await createEmptyKibanaIndex();

View File

@ -98,7 +98,9 @@ export class Monitoring {
!this.quiet &&
log(
'monitoring:configuration',
`wazuh.monitoring.pattern: ${this.index_pattern} (index prefix: ${this.index_prefix})`,
`wazuh.monitoring.pattern: ${this.index_pattern} (index prefix: ${
this.index_prefix
})`,
'debug'
);
} catch (error) {
@ -265,7 +267,9 @@ export class Monitoring {
};
log(
'monitoring:loadCredentials',
`Calling checkAndSaveStatus for API: ${apiEntry.url}:${apiEntry.port}`,
`Calling checkAndSaveStatus for API: ${apiEntry.url}:${
apiEntry.port
}`,
'debug'
);
await this.checkAndSaveStatus(apiEntry);