wazuh-kibana-app/public/templates/management/logs.html
Jesús González c37b0be82e Fix condition
2019-03-26 20:55:27 +01:00

134 lines
8.4 KiB
HTML

<div layout="column" ng-controller="managerLogController as ctrl" ng-if="!ctrl.loading && mctrl.tab == 'logs'">
<!-- Filters and Realtime button section -->
<div ng-show="!ctrl.loading" layout="row" layout-align="start center" class="md-padding-h wz-margin-top-16">
<!-- Daemon selector -->
<div flex="20" layout="column" layout-align="center" class="wz-margin-right-15 wz-select-input">
<select flex class="kuiSelect wz-border-none cursor-pointer height-35"
ng-disabled="ctrl.realtime || !ctrl.daemons.length" id="categoryBox" ng-model="ctrl.category"
ng-change="ctrl.filter({name:'category',value:ctrl.category})" aria-label="Logs category">
<option value="all">All daemons</option>
<option ng-repeat="daemon in ctrl.daemons | orderObjectBy: 'title'" value="{{daemon.title}}">
{{daemon.title}}</option>
</select>
</div>
<!-- End daemon selector -->
<!-- Level selector -->
<div flex="20" layout="column" layout-align="center" class="wz-select-input wz-margin-right-15">
<select flex class="kuiSelect wz-border-none cursor-pointer height-35" ng-disabled="ctrl.realtime"
id="levelBox" ng-model="ctrl.type_log" ng-change="ctrl.filter({name:'type_log',value:ctrl.type_log})"
aria-label="Logs level">
<option value="all">All log levels</option>
<option value="info">Info</option>
<option value="error">Error</option>
<option value="warning">Warning</option>
<option value="critical">Critical</option>
<option value="debug">Debug</option>
</select>
</div>
<div flex="20" layout="column" ng-show="ctrl.nodeList" layout-align="center"
class="wz-select-input wz-margin-right-15">
<select flex class="kuiSelect wz-border-none cursor-pointer height-35" ng-disabled="ctrl.realtime"
id="categoryBox" ng-model="ctrl.selectedNode" ng-change="ctrl.changeNode(ctrl.selectedNode)"
aria-label="Logs category">
<option ng-repeat="node in ctrl.nodeList" value="{{node}}">{{node}}</option>
</select>
</div>
<div flex="20" layout="column" layout-align="center">
<wz-kbn-switch switch-model="ctrl.sortFilter" switch-change="ctrl.sort()" switch-text="Descending sort">
</wz-kbn-switch>
</div>
<!-- End Level selector -->
</div>
<!-- End Filters and Realtime button section -->
<div layout="row"
class="euiFlexGroup euiFlexGroup--alignItemsCenter euiFormControlLayout__childrenWrapper md-padding-h ng-scope wz-margin-top-16"
ng-if="ctrl.logsPath">
<input placeholder="Filter logs..." ng-model="ctrl.custom_search" type="text"
class="euiFieldSearch euiFieldSearch--fullWidth euiFlexItem height-35 ng-empty ng-pristine ng-touched ng-valid"
aria-invalid="false" wz-enter="ctrl.search(ctrl.custom_search)">
<div class="euiFormControlLayoutIcons wz-margin-left-16"><span class="euiFormControlLayoutCustomIcon"><svg
class="euiIcon euiIcon--medium euiFormControlLayoutCustomIcon__icon" focusable="false"
aria-hidden="true" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
width="16" height="16" viewBox="0 0 16 16">
<defs>
<path id="search-a"
d="M11.271 11.978l3.872 3.873a.502.502 0 0 0 .708 0 .502.502 0 0 0 0-.708l-3.565-3.564c2.38-2.747 2.267-6.923-.342-9.532-2.73-2.73-7.17-2.73-9.898 0-2.728 2.729-2.728 7.17 0 9.9a6.955 6.955 0 0 0 4.949 2.05.5.5 0 0 0 0-1 5.96 5.96 0 0 1-4.242-1.757 6.01 6.01 0 0 1 0-8.486c2.337-2.34 6.143-2.34 8.484 0a6.01 6.01 0 0 1 0 8.486.5.5 0 0 0 .034.738z">
</path>
</defs>
<use xlink:href="#search-a"></use>
</svg></span></div>
<button type="submit" aria-label="Search"
class="euiFlexItem euiFlexItem--flexGrowZero height-35 kuiButton kuiButton--secondary wz-margin-left-8"
ng-click="ctrl.search(ctrl.custom_search)">
Search
</button>
<div class="euiFlexItem euiFlexItem--flexGrowZero height-35 wz-margin-left-8">
<div class="euiFilterGroup"></div>
</div>
<button ng-if="!ctrl.realtime"
class="euiFlexItem euiFlexItem--flexGrowZero height-35 kuiButton kuiButton--secondary ng-scope wz-margin-left-8"
ng-click="ctrl.playRealtime()" aria-label="Play realtime button">
<i class="fa fa-play fa-fw" aria-hidden="true"></i>
Play realtime
</button>
<button ng-if="ctrl.realtime"
class="euiFlexItem euiFlexItem--flexGrowZero height-35 kuiButton kuiButton--danger ng-scope wz-margin-left-8"
ng-click="ctrl.stopRealtime()" aria-label="Stop realtime button">
<i class="fa fa-stop fa-fw" aria-hidden="true"></i>
Stop realtime
</button>
</div>
<!-- Logs section -->
<div layout="row" layout-padding ng-if="ctrl.logsPath" ng-hide="true">
<wz-table path="ctrl.logsPath" keys="[]" implicit-sort="'timestamp'"></wz-table>
</div>
<div ng-show="XMLContent">
<div layout="row" layout-padding class="wz-padding-bottom-0">
<wz-config-viewer flex xmlcontent="XMLContent" hide-header="true" />
</div>
</div>
<div layout="row" class="md-padding layout-align-end" ng-if="XMLContent !== ''">
<button type="button" ng-click="ctrl.downloadCsv()"
class="euiButtonEmpty euiButtonEmpty--primary euiButtonEmpty--small">
<span class="euiButtonEmpty__content">
<svg class="euiIcon euiIcon--medium euiButtonEmpty__icon" focusable="false" aria-hidden="true"
xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
<path
d="M9 10.114l1.85-1.943a.52.52 0 0 1 .77 0c.214.228.214.6 0 .829l-1.95 2.05a1.552 1.552 0 0 1-2.31 0L5.41 9a.617.617 0 0 1 0-.829.52.52 0 0 1 .77 0L8 10.082V1.556C8 1.249 8.224 1 8.5 1s.5.249.5.556v8.558zM4.18 6a.993.993 0 0 0-.972.804l-1.189 6A.995.995 0 0 0 2.991 14h11.018a1 1 0 0 0 .972-1.196l-1.19-6a.993.993 0 0 0-.97-.804H4.18zM6 5v1h5V5h1.825c.946 0 1.76.673 1.946 1.608l1.19 6A2 2 0 0 1 14.016 15H2.984a1.992 1.992 0 0 1-1.945-2.392l1.19-6C2.414 5.673 3.229 5 4.174 5H6z">
</path>
</svg>
<span class="euiButtonEmpty__text">Formatted</span>
</span>
</button>
</div>
<!-- End Logs section -->
<div layout="row" class="md-padding-h" ng-if="XMLContent === ''">
<div flex class="euiCallOut euiCallOut--warning wz-margin-top-17">
<div class="euiCallOutHeader">
<svg class="euiIcon euiIcon--medium euiCallOutHeader__icon" aria-hidden="true"
xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16"
viewBox="0 0 16 16">
<defs>
<path id="help-a"
d="M13.6 12.186l-1.357-1.358c-.025-.025-.058-.034-.084-.056.53-.794.84-1.746.84-2.773a4.977 4.977 0 0 0-.84-2.772c.026-.02.059-.03.084-.056L13.6 3.813a6.96 6.96 0 0 1 0 8.373zM8 15A6.956 6.956 0 0 1 3.814 13.6l1.358-1.358c.025-.025.034-.057.055-.084C6.02 12.688 6.974 13 8 13a4.978 4.978 0 0 0 2.773-.84c.02.026.03.058.056.083l1.357 1.358A6.956 6.956 0 0 1 8 15zm-5.601-2.813a6.963 6.963 0 0 1 0-8.373l1.359 1.358c.024.025.057.035.084.056A4.97 4.97 0 0 0 3 8c0 1.027.31 1.98.842 2.773-.027.022-.06.031-.084.056l-1.36 1.358zm5.6-.187A4 4 0 1 1 8 4a4 4 0 0 1 0 8zM8 1c1.573 0 3.019.525 4.187 1.4l-1.357 1.358c-.025.025-.035.057-.056.084A4.979 4.979 0 0 0 8 3a4.979 4.979 0 0 0-2.773.842c-.021-.027-.03-.059-.055-.084L3.814 2.4A6.957 6.957 0 0 1 8 1zm0-1a8.001 8.001 0 1 0 .003 16.002A8.001 8.001 0 0 0 8 0z">
</path>
</defs>
<use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#help-a" fill-rule="evenodd"></use>
</svg>
<span class="euiCallOutHeader__title">No results match your search criteria</span>
</div>
</div>
</div>
</div>