libreoffice-online/indexing/Main.html
Tomaž Vajngerl 02c60302b3 Proof of concept Search WebApp to show how to implement doc. search
This adds the Proof of concept WebApp to show how to glue together
the Solr search platform with COOL server with "convert-to" and
"render-search-result" REST services and combine everything into
a document search solution.

Signed-off-by: Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>
Change-Id: Iea3a2f6e2afee090bc7a27648390025d2a8c94d8
2021-09-13 10:36:15 +02:00

70 lines
3.1 KiB
HTML

<!DOCTYPE html>
<html lang="en" ng-app="SearchApp">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Search - Proof of Concept</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.0/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-KyZXEAg3QhqLMpG8r+8fhAXLRk2vvoC2f3B09zVXn8CA5QIVfZOJ3BCsw2P0p/We" crossorigin="anonymous">
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.8.2/angular.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.8.2/angular-resource.min.js"></script>
<script src="Main.js"></script>
</head>
<body ng-controller="SearchMainController">
<div class="container">
<div class="row">
<div class="col">
<form class="row g-1 justify-content-md-center">
<div class="col-sm-6">
<input class="form-control" type="text" ng-model="searchString" placeholder="Search string..." >
</div>
<div class="col-auto">
<button type="button" ng-click="searchClicked()" ng-disabled="searchDisabled()" class="btn btn-primary mb-3">Search</button>
</div>
<div class="col-auto">
<button type="button" ng-click="reindexClicked()" class="btn btn-primary">Re-index Documents</button>
</div>
</form>
</div>
</div>
<div class="row" ng-show="searchResult.length > 0">
<div class="col"><b>Search Result</b></div>
<table class="table table-vcenter table-striped table-hover table-bordered">
<thead>
<tr>
<th class="col-xs-6">Filename</th>
<th class="col-xs-6">Image</th>
</tr>
</thead>
<tbody>
<tr>
<tr class="table-repeat" ng-repeat="result in searchResult">
<td><a href="{{result.href}}">{{result.filename}}</td>
<td><img data-ng-src="data:image/png;base64,{{result.image}}"/></td>
</tr>
</tbody>
</table>
<button type="button" ng-click="clearSearchResults()" class="btn btn-primary">Clear</button>
</div>
<div class="row" ng-show="searchResult.length == 0">
<table class="table table-vcenter table-striped table-hover table-bordered">
<thead>
<tr>
<th class="col-xs-6">Filename</th>
</tr>
</thead>
<tbody>
<tr>
<tr class="table-repeat" ng-repeat="document in documents">
<td><a href="{{document.href}}">{{document.name}}</a></td>
</tr>
</tbody>
</table>
</div>
<div class="row">
<p>Status: {{status}}</p>
</div>
</div>
</body>
</html>