Merge branch '3.9-6.5' of https://github.com/wazuh/wazuh-kibana-app into issue-1161

This commit is contained in:
JuanCarlos 2019-01-25 08:45:08 +01:00
commit 0bf6cc5dc7
5 changed files with 39 additions and 13 deletions

View File

@ -15,6 +15,7 @@ All notable changes to the Wazuh app project will be documented in this file.
- Escape XML special characters ([#1159](https://github.com/wazuh/wazuh-kibana-app/pull/1159)).
- Changed empty results message for Wazuh tables ([#1165](https://github.com/wazuh/wazuh-kibana-app/pull/1165)).
- Allowing the same query multiple times on the Dev Tools ([#1174](https://github.com/wazuh/wazuh-kibana-app/pull/1174))
- Refactor JSON/XML viewer for configuration tab ([#1173](https://github.com/wazuh/wazuh-kibana-app/pull/1173), [#1148](https://github.com/wazuh/wazuh-kibana-app/pull/1148)).
### Fixed

View File

@ -22,6 +22,7 @@ import './wz-config-item/wz-config-item.less';
import './wz-tag-filter/wz-tag-filter';
import './wz-tag-filter/wz-tag-filter.less';
import './wz-config-viewer/wz-config-viewer';
import './wz-config-viewer/wz-config-viewer.less';
import './wz-xml-file-editor/wz-xml-file-editor';
import './wz-xml-file-editor/wz-xml-file-editor.less';
import './wz-multiple-selector/wz-multiple-selector';

View File

@ -1,4 +1,4 @@
<div layout="row">
<div layout="row" ng-show="jsoncontent || xmlcontent" style="height: calc(100vh - 240px);">
<!-- JSON card -->
<md-card flex="auto" class="wz-md-card" ng-show="jsoncontent">
@ -18,8 +18,8 @@
<md-divider class="wz-margin-top-10"></md-divider>
<!-- The JSON viewer -->
<div class='wzXmlEditorBody'>
<textarea id='json_box'></textarea>
<div class='wzJsonXmlEditorBody'>
<textarea id='viewer_json_box'></textarea>
</div>
<!-- End JSON viewer -->
</md-card-content>
@ -44,8 +44,8 @@
<md-divider class="wz-margin-top-10"></md-divider>
<!-- The XML viewer -->
<div class='wzXmlEditorBody'>
<textarea id='xml_box' ></textarea>
<div class='wzJsonXmlEditorBody'>
<textarea id='viewer_xml_box' ></textarea>
</div>
<!-- End XML viewer -->
</md-card-content>

View File

@ -33,7 +33,7 @@ class WzConfigViewer {
const setJsonBox = () => {
$scope.jsonCodeBox = CodeMirror.fromTextArea(
$document[0].getElementById('json_box'),
$document[0].getElementById('viewer_json_box'),
{
lineNumbers: true,
matchClosing: true,
@ -49,7 +49,7 @@ class WzConfigViewer {
}
const setXmlBox = () => {
$scope.xmlCodeBox = CodeMirror.fromTextArea(
$document[0].getElementById('xml_box'),
$document[0].getElementById('viewer_xml_box'),
{
lineNumbers: true,
matchClosing: true,
@ -62,17 +62,17 @@ class WzConfigViewer {
gutters: ['CodeMirror-foldgutter']
}
);
}
const init = () => {
setJsonBox();
setXmlBox();
}
const init = () => {}
const refreshJsonBox = json => {
$scope.jsoncontent = json;
if(!$scope.jsonCodeBox){
setJsonBox();
}
if ($scope.jsoncontent != false) {
$scope.jsonCodeBox.setValue($scope.jsoncontent);
setTimeout(function () {
@ -83,7 +83,9 @@ class WzConfigViewer {
const refreshXmlBox = xml => {
$scope.xmlcontent = xml;
if(!$scope.xmlCodeBox){
setXmlBox();
}
if ($scope.xmlcontent != false) {
$scope.xmlCodeBox.setValue($scope.xmlcontent);
setTimeout(function () {

View File

@ -0,0 +1,22 @@
/*
* Wazuh app - Wazuh JSON/XML config viewer stylesheet
* Copyright (C) 2015-2019 Wazuh, Inc.
*
* 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.
*/
/* -------------------------------------------------------------------------- */
/* ------------------ Wazuh JSON/XML config viewer stylesheet --------------- */
/* -------------------------------------------------------------------------- */
.wzJsonXmlEditorBody, .wzJsonXmlEditorBody .CodeMirror{
height: 100%;
min-height: 300px;
}