mirror of
https://github.com/valitydev/wazuh-kibana-app.git
synced 2024-11-08 10:43:51 +00:00
321 lines
11 KiB
HTML
321 lines
11 KiB
HTML
<div ng-controller="discoverW" class="app-container">
|
|
|
|
<kbn-top-nav name="discover" config="topNavMenu">
|
|
|
|
</kbn-top-nav>
|
|
<!-- Transcluded elements. -->
|
|
<div data-transclude-slots>
|
|
<!-- Breadcrumbs. -->
|
|
<div data-transclude-slot="topLeftCorner" class="kuiLocalBreadcrumbs">
|
|
<h1 tabindex="0" id="kui_local_breadcrumb" class="kuiLocalBreadcrumb">
|
|
<span ng-show="opts.savedSearch.id" class="kuiLocalBreadcrumb__emphasis">
|
|
<span data-test-subj="discoverCurrentQuery" ng-bind="opts.savedSearch.lastSavedTitle"></span>
|
|
<i id="reload_saved_search" tabindex="0" aria-label="Reload Saved Search" tooltip="Reload Saved Search" ng-click="resetQuery();" class="fa fa-undo small"></i>
|
|
</span>
|
|
<span data-test-subj="discoverQueryHits" class="kuiLocalBreadcrumb__emphasis">{{(hits || 0) | number:0}}</span>
|
|
<ng-pluralize count="hits" when="{'1':'hit', 'other':'hits'}"></ng-pluralize>
|
|
</h1>
|
|
</div>
|
|
|
|
<!-- Search. -->
|
|
<form
|
|
data-transclude-slot="bottomRow"
|
|
class="fullWidth"
|
|
role="form"
|
|
name="discoverSearch"
|
|
ng-submit="fetch()"
|
|
>
|
|
<div class="typeahead" kbn-typeahead="discover" on-select="fetch()">
|
|
<div class="kuiLocalSearch">
|
|
<div class="kuiLocalSearchAssistedInput">
|
|
<input
|
|
parse-query
|
|
input-focus
|
|
kbn-typeahead-input
|
|
ng-model="state.query.query"
|
|
placeholder="Search... (e.g. status:200 AND extension:PHP)"
|
|
aria-label="Search input"
|
|
type="text"
|
|
class="kuiLocalSearchInput kuiLocalSearchInput--lucene"
|
|
ng-class="{'kuiLocalSearchInput-isInvalid': discoverSearch.$invalid}"
|
|
>
|
|
<div class="kuiLocalSearchAssistedInput__assistance">
|
|
<p class="kuiText">
|
|
<a
|
|
class="kuiLink"
|
|
ng-href="{{queryDocLinks.luceneQuerySyntax}}"
|
|
target="_blank"
|
|
>
|
|
Uses lucene query syntax
|
|
</a>
|
|
</p>
|
|
</div>
|
|
</div>
|
|
<button
|
|
type="submit"
|
|
aria-label="Search"
|
|
class="kuiLocalSearchButton"
|
|
ng-disabled="discoverSearch.$invalid"
|
|
>
|
|
<span class="kuiIcon fa-search" aria-hidden="true"></span>
|
|
</button>
|
|
</div>
|
|
<kbn-typeahead-items></kbn-typeahead-items>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
<div class="container-fluid" role="main">
|
|
<div class="row">
|
|
<filter-bar
|
|
state="state"
|
|
index-patterns="[indexPattern]"
|
|
></filter-bar>
|
|
</div>
|
|
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-md-2 sidebar-container collapsible-sidebar">
|
|
<div class="sidebar-list">
|
|
<div ng-show="indexPatternList.length > 1">
|
|
<ui-select
|
|
class="index-pattern-selection"
|
|
ng-model="selectedIndexPattern"
|
|
on-select="setIndexPattern($item)"
|
|
>
|
|
<ui-select-match>
|
|
{{$select.selected.get('title')}}
|
|
</ui-select-match>
|
|
<ui-select-choices repeat="pattern in indexPatternList | filter:$select.search">
|
|
<div ng-bind-html="pattern.get('title') | highlight: $select.search"></div>
|
|
</ui-select-choices>
|
|
</ui-select>
|
|
</div>
|
|
<div ng-hide="indexPatternList.length > 1">
|
|
<div class="index-pattern">
|
|
<h2
|
|
class="index-pattern-label"
|
|
id="index_pattern_id"
|
|
tabindex="0"
|
|
css-truncate>
|
|
|
|
{{ indexPattern.title }}</h2>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="sidebar-list-header">
|
|
<h3 class="sidebar-list-header-label" id="selected_fields" tabindex="0">Selected Fields</h3>
|
|
</div>
|
|
<ul class="list-unstyled discover-selected-fields" >
|
|
<discover-field
|
|
ng-repeat="field in fields.raw|filter:{display:true}"
|
|
field="field"
|
|
on-add-field="addColumn"
|
|
on-add-filter="onAddFilter"
|
|
on-remove-field="removeColumn"
|
|
on-show-details="computeDetails"
|
|
>
|
|
</discover-field>
|
|
</ul>
|
|
|
|
<div class="sidebar-list-header sidebar-item">
|
|
<h3 class="sidebar-list-header-label" id="available_fields" tabindex="0">Available Fields
|
|
<span
|
|
ng-class="{ 'fa-chevron-right': !showFields, 'fa-chevron-down': showFields }"
|
|
ng-click="showFields = !showFields"
|
|
aria-hidden="true"
|
|
class="fa visible-xs visible-sm pull-right field-collapse-toggle"
|
|
></span>
|
|
|
|
<button
|
|
type="button"
|
|
ng-class="{ 'kuiButton--basic': !filter.active, 'kuiButton--primary': filter.active, 'hidden-xs': !showFields, 'hidden-sm': !showFields }"
|
|
class="kuiButton kuiButton--small pull-right discover-field-filter-toggle"
|
|
ng-click="showFilter = !showFilter"
|
|
aria-label="Show field settings"
|
|
aria-haspopup="true"
|
|
aria-expanded="{{showFilter}}"
|
|
>
|
|
<span aria-hidden="true" class="kuiIcon fa-gear"></span>
|
|
</button>
|
|
</h3>
|
|
</div>
|
|
|
|
<div class="sidebar-item" ng-show="showFilter">
|
|
<form role="form" class="discover-field-details">
|
|
<div class="form-group">
|
|
<label>
|
|
Aggregatable
|
|
</label>
|
|
<select
|
|
ng-options="opt.value as opt.label for opt in filter.boolOpts"
|
|
ng-model="filter.vals.aggregatable"
|
|
class="form-control">
|
|
</select>
|
|
</div>
|
|
<div class="form-group">
|
|
<label>
|
|
Searchable
|
|
</label>
|
|
<select
|
|
ng-options="opt.value as opt.label for opt in filter.boolOpts"
|
|
ng-model="filter.vals.searchable"
|
|
class="form-control">
|
|
</select>
|
|
</div>
|
|
<div class="form-group">
|
|
<label>
|
|
Type
|
|
</label>
|
|
<select
|
|
ng-options="field as field for field in fieldTypes"
|
|
ng-model="filter.vals.type"
|
|
class="form-control">
|
|
</select>
|
|
</div>
|
|
<div class="form-group">
|
|
<label>
|
|
Field name
|
|
</label>
|
|
<input type="text" class="form-control" ng-model="filter.vals.name">
|
|
</div>
|
|
<div class="form-group">
|
|
<label>
|
|
<input type="checkbox" ng-model="filter.vals.missing">
|
|
Hide Missing Fields
|
|
</label>
|
|
</div>
|
|
</form>
|
|
<button
|
|
ng-click="filter.reset()"
|
|
ng-disabled="!filter.active"
|
|
class="kuiButton kuiButton--danger kuiButton--fullWidth"
|
|
>
|
|
Reset Filters
|
|
</button>
|
|
</div>
|
|
|
|
<ul
|
|
ng-show="(popularFields | filter:filter.isFieldFiltered).length > 0"
|
|
ng-class="{ 'hidden-sm': !showFields, 'hidden-xs': !showFields }"
|
|
class="list-unstyled sidebar-well discover-popular-fields">
|
|
<li class="sidebar-item sidebar-list-header">
|
|
<h6>Popular</h6>
|
|
</li>
|
|
<discover-field
|
|
ng-repeat="field in popularFields | filter:filter.isFieldFiltered"
|
|
field="field"
|
|
on-add-field="addColumn"
|
|
on-add-filter="onAddFilter"
|
|
on-remove-field="removeColumn"
|
|
on-show-details="computeDetails"
|
|
>
|
|
</discover-field>
|
|
</ul>
|
|
|
|
<ul
|
|
ng-class="{ 'hidden-sm': !showFields, 'hidden-xs': !showFields }"
|
|
class="list-unstyled discover-unpopular-fields">
|
|
<discover-field
|
|
ng-repeat="field in unpopularFields | filter:filter.isFieldFiltered"
|
|
field="field"
|
|
on-add-field="addColumn"
|
|
on-add-filter="onAddFilter"
|
|
on-remove-field="removeColumn"
|
|
on-show-details="computeDetails"
|
|
>
|
|
</discover-field>
|
|
</ul>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div class="discover-wrapper col-md-10">
|
|
<div class="discover-content">
|
|
<div ng-show="resultState === 'none'">
|
|
<div class="discover-overlay" style="position: relative !important; opacity: 1 !important;">
|
|
<h2 aria-hidden="true"><i aria-hidden="true" class="fa fa-meh-o"></i></h2>
|
|
<h4>No results found</h4>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- loading -->
|
|
<div ng-show="resultState === 'loading'">
|
|
<div class="discover-overlay" style="position: relative !important; opacity: 1 !important;">
|
|
<h2>Searching</h2>
|
|
<div ng-show="fetchStatus">{{fetchStatus.complete}}/{{fetchStatus.total}}</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- result -->
|
|
<div class="results" ng-show="resultState === 'ready'">
|
|
<div class="discover-timechart" ng-if="opts.timefield" ng-show="true">
|
|
<header>
|
|
<center class="small">
|
|
<span tooltip="To change the time, click the clock icon in the navigation bar">{{timeRange.from | moment}} - {{timeRange.to | moment}}</span> —
|
|
|
|
<span class="results-interval" ng-hide="showInterval">
|
|
<a
|
|
ng-click="toggleInterval()">
|
|
{{ intervalName }}
|
|
</a>
|
|
</span>
|
|
|
|
<span ng-show="showInterval" class="results-interval form-inline">
|
|
<select
|
|
class="form-control"
|
|
ng-model="state.interval"
|
|
ng-options="interval.val as interval.display for interval in intervalOptions | filter: intervalEnabled"
|
|
>
|
|
</select>
|
|
</span>
|
|
</center>
|
|
|
|
</header>
|
|
|
|
<visualization
|
|
ng-if="vis && rows.length != 0 && resultState === 'ready'"
|
|
vis="vis"
|
|
ui-state="uiState"
|
|
vis-data="visData"
|
|
show-spy-panel="true"
|
|
search-source="searchSource"
|
|
style="height: 200px"
|
|
>
|
|
</visualization>
|
|
|
|
</div>
|
|
|
|
<div class="discover-table" fixed-scroll ng-style="{ 'height': tableHeight }" ng-if="state.sort && state.columns">
|
|
<doc-table
|
|
hits="rows"
|
|
index-pattern="indexPattern"
|
|
sorting="state.sort"
|
|
columns="state.columns"
|
|
infinite-scroll="true"
|
|
filter="filterQuery"
|
|
filters="state.filters"
|
|
data-shared-item
|
|
data-title="{{opts.savedSearch.lastSavedTitle}}"
|
|
data-description="{{opts.savedSearch.description}}"
|
|
render-counter
|
|
on-add-column="addColumn"
|
|
on-change-sort-order="setSortOrder"
|
|
on-move-column="moveColumn"
|
|
on-remove-column="removeColumn"
|
|
></doc-table>
|
|
|
|
<div ng-if="rows.length == opts.sampleSize" class="discover-table-footer">
|
|
<center>
|
|
These are the first {{opts.sampleSize}} documents matching the search.
|
|
</center>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|