wazuh-kibana-app/public/templates/management/logs.html
2019-04-25 11:11:19 +02:00

115 lines
5.7 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">
<react-component name="EuiIcon"
props="{type:'search', className:'euiFormControlLayoutCustomIcon__icon'}" />
</span>
</div>
<button type="submit" aria-label="Search" class="height-35 kuiButton kuiButton--secondary wz-margin-left-8"
ng-click="ctrl.search(ctrl.custom_search)">
<span>Search</span>
</button>
<div class="euiFlexItem euiFlexItem--flexGrowZero height-35 wz-margin-left-8">
<div class="euiFilterGroup"></div>
</div>
<button class="height-35 kuiButton ng-scope wz-margin-left-8"
ng-class="{'kuiButton--secondary': !ctrl.realtime, 'kuiButton--danger': ctrl.realtime}"
ng-click="!ctrl.realtime ? ctrl.playRealtime() : ctrl.stopRealtime()" aria-label="Realtime button">
<span ng-if="!ctrl.realtime">
<react-component name="EuiIcon" props="{type:'play'}" />
Play realtime
</span>
<span ng-if="ctrl.realtime">
<react-component name="EuiIcon" props="{type:'stop'}" />
Stop realtime
</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" ng-if="XMLContent !== ''">
<button type="button" ng-click="ctrl.downloadCsv()"
class="euiButtonEmpty euiButtonEmpty--primary euiButtonEmpty--small">
<span class="euiButtonEmpty__content">
<react-component name="EuiIcon" props="{type:'importAction'}" />
<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">
<react-component name="EuiIcon" props="{type:'help',className:'euiCallOutHeader__title'}" />
<span class="euiCallOutHeader__title">No results match your search criteria</span>
</div>
</div>
</div>
</div>