wazuh-kibana-app/public/templates/management/logs.html
2019-03-25 13:43:49 +01:00

118 lines
7.1 KiB
HTML

<div layout="column" class="mozilla-table-size-85" 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 -->
<!-- White space between filters and Realtime button -->
<span flex></span>
<button ng-if="!ctrl.realtime" class="height-35 kuiButton kuiButton--secondary no-margin-right"
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="height-35 kuiButton kuiButton--secondary no-margin-right"
ng-click="ctrl.stopRealtime()" aria-label="Stop realtime button">
<i class="fa fa-stop fa-fw" aria-hidden="true"></i>
Stop realtime
</button>
</div>
<!-- End Filters and Realtime button section -->
<div layout="row" flex class="md-padding-h wz-margin-top-16" ng-if="ctrl.logsPath">
<input placeholder="Filter logs..." ng-model="ctrl.custom_search" type="text"
class="kuiLocalSearchInput ng-empty ng-pristine ng-scope ng-touched ng-valid" aria-invalid="false"
wz-enter="ctrl.search(ctrl.custom_search)">
<button type="submit" aria-label="Search" class="kuiLocalSearchButton height-40"
ng-click="ctrl.search(ctrl.custom_search)">
<span class="fa fa-search" aria-hidden="true"></span>
</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">
<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>