Gets searching on dashboard working with paging and viewing field values
This commit is contained in:
@@ -10,6 +10,7 @@ function ExamineManagementController($scope, umbRequestHelper, $http, $q, $timeo
|
||||
vm.selectedSearcher = null;
|
||||
vm.searchResults = null;
|
||||
|
||||
vm.showSearchResultDialog = showSearchResultDialog;
|
||||
vm.showIndexInfo = showIndexInfo;
|
||||
vm.showSearcherInfo = showSearcherInfo;
|
||||
vm.search = search;
|
||||
@@ -22,6 +23,19 @@ function ExamineManagementController($scope, umbRequestHelper, $http, $q, $timeo
|
||||
|
||||
vm.infoOverlay = null;
|
||||
|
||||
function showSearchResultDialog(values) {
|
||||
if (vm.searchResults) {
|
||||
vm.searchResults.overlay = {
|
||||
title: "Field values",
|
||||
searchResultValues: values,
|
||||
view: "views/dashboard/settings/examinemanagementresults.html",
|
||||
close: function () {
|
||||
vm.searchResults.overlay = null;
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
function nextSearchResultPage(pageNumber) {
|
||||
search(vm.selectedIndex ? vm.selectedIndex : vm.selectedSearcher, null, pageNumber);
|
||||
}
|
||||
|
||||
@@ -188,7 +188,7 @@
|
||||
<div>
|
||||
<input type="text" class="search-query"
|
||||
ng-model="vm.searchText" no-dirty-check
|
||||
ng-keypress="vm.search(vm.selectedIndex, $event)"/>
|
||||
ng-keypress="vm.search(vm.selectedIndex, $event)" />
|
||||
|
||||
<umb-button disabled="vm.selectedIndex.isProcessing"
|
||||
type="button"
|
||||
@@ -201,35 +201,36 @@
|
||||
</div>
|
||||
|
||||
<div ng-hide="vm.selectedIndex.isProcessing || !vm.searchResults">
|
||||
<br/>
|
||||
<br />
|
||||
|
||||
<table class="table table-bordered table-condensed">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="score">Score</th>
|
||||
<th class="id">Id</th>
|
||||
<th>Name</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="score">Score</th>
|
||||
<th class="id">Id</th>
|
||||
<th>Name</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr ng-repeat="result in vm.searchResults.results track by result.id">
|
||||
<td>{{result.score}}</td>
|
||||
<td>{{result.id}}</td>
|
||||
<td>
|
||||
<span>{{result.values['nodeName']}}</span>
|
||||
<a class="color-green" href=""><em>({{result.fieldCount}} fields)</em></a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr ng-repeat="result in vm.searchResults.results track by result.id">
|
||||
<td>{{result.score}}</td>
|
||||
<td>{{result.id}}</td>
|
||||
<td>
|
||||
<span>{{result.values['nodeName']}}</span>
|
||||
<a class="color-green" href="" ng-click="vm.showSearchResultDialog(result.values)">
|
||||
<em>({{result.fieldCount}} fields)</em>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<div class="flex justify-center">
|
||||
<umb-pagination
|
||||
page-number="vm.searchResults.pageNumber"
|
||||
total-pages="vm.searchResults.totalPages"
|
||||
on-next="vm.nextSearchResultPage"
|
||||
on-prev="vm.prevSearchResultPage"
|
||||
on-go-to-page="vm.goToPageSearchResultPage">
|
||||
<umb-pagination page-number="vm.searchResults.pageNumber"
|
||||
total-pages="vm.searchResults.totalPages"
|
||||
on-next="vm.nextSearchResultPage"
|
||||
on-prev="vm.prevSearchResultPage"
|
||||
on-go-to-page="vm.goToPageSearchResultPage">
|
||||
</umb-pagination>
|
||||
</div>
|
||||
|
||||
@@ -302,4 +303,10 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<umb-overlay ng-if="vm.searchResults.overlay"
|
||||
position="center"
|
||||
view="vm.searchResults.overlay.view"
|
||||
model="vm.searchResults.overlay">
|
||||
</umb-overlay>
|
||||
|
||||
</div>
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
<div>
|
||||
|
||||
<table class="table table-bordered table-condensed">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="score">Field</th>
|
||||
<th class="id">Value</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr ng-repeat="(key, val) in model.searchResultValues track by key">
|
||||
<td>{{key}}</td>
|
||||
<td>{{val}}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
Reference in New Issue
Block a user