-
Notifications
You must be signed in to change notification settings - Fork 2
/
search.html
171 lines (162 loc) · 5.37 KB
/
search.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
<div class="container-fluid" ng-controller="TableSearchController">
<ol class="breadcrumb">
<li><a href="#">Top</a></li>
<li><a href="#/tables/">Tables</a></li>
<li><a href="#/tables/{{table}}">{{table}}</a></li>
<li class="active">Search</li>
</ol>
<div class="sidebar">
<div class="panel panel-default">
<div class="panel-heading">
<h2 class="panel-title">Columns</h2>
</div>
<div class="panel-body">
<div class="table-columns">
<table>
<thead>
<tr>
<th>Name</th>
<th>
<span title="Show"
class="glyphicon glyphicon-eye-open"></span>
</th>
<th>
<span title="Drilldown"
class="glyphicon glyphicon-filter"></span>
</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="outputColumn in outputColumns track by $index">
<td>{{outputColumn.name}}</td>
<td><input type="checkbox"
ng-model="outputColumn.show"></td>
<td><input type="checkbox"
ng-model="outputColumn.drilldown"></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="panel panel-default"
ng-repeat="drilldown in drilldowns track by $index">
<div class="panel-heading">
<h2 class="panel-title">
{{drilldown.key}}({{drilldown.nTotalRecords}})
</h2>
</div>
<div class="panel-body">
<ul class="list-group">
<li class="list-group-item"
ng-repeat="record in drilldown.records track by $index">
<a ng-click="selectDrilldown(drilldown.key, record._key)">
{{record._key}}
</a>
<span class="badge">{{record._nsubrecs}}</span>
</li>
</ul>
</div>
</div>
</div>
<div class="main-content">
<div class="alert alert-warning" ng-show="message.length > 0">
<p>{{message}}</p>
</div>
<form role="search">
<div class="form-group">
<div class="input-group">
<span ng-repeat="indexedColumn in indexedColumns track by $index">
<label>
<input type="checkbox"
ng-model="indexedColumn.inUse">
{{indexedColumn.name}}
</label>
</span>
</div>
<div class="input-group">
<span class="input-group-addon">Query</span>
<input type="search" class="form-control" ng-model="parameters.query">
</div>
</div>
<div class="form-group">
<button ng-click="search()" class="btn btn-default">Search</button>
<button ng-click="clear()" class="btn btn-default">Clear</button>
</div>
</form>
<p class="command-line">
<code id="groonga-command-line">{{commandLine}}</code>
</p>
<p class="statistics">
<span id="n-total-records">{{nTotalRecords}} records</span>
<span id="elapsed-time">({{elapsedTimeInMilliseconds | number : 3}}ms)</span>
</p>
<pagination total-items="nTotalRecords"
items-per-page="nRecordsInPage"
max-size="maxNPages"
rotate="false"
ng-model="currentPage"
ng-change="search()">
</pagination>
<ul class="nav nav-tabs" role="tablist">
<li role="tab" data-toggle="tab" class="active">
<a ng-click="style = 'table'">Table</a>
</li>
<li role="tab" data-toggle="tab">
<a ng-click="style = 'list'">List</a>
</li>
<li role="tab" data-toggle="tab">
<a ng-click="style = 'json'">JSON</a>
</li>
</ul>
<div class="table-search-result" ng-show="style == 'table'">
<table>
<thead>
<tr>
<th ng-repeat="column in columns track by $index">
{{column.name}}
<div>
<button type="button"
class="btn btn-default"
ng-click="toggleSort(column)">
<span class="glyphicon {{column.iconClass}}"></span>
</button>
</div>
</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="record in records track by $index">
<td ng-repeat="element in record track by $index">
{{element.value}}
</td>
</tr>
</tbody>
</table>
</div>
<div class="list-search-result" ng-show="style == 'list'">
<div class="row" ng-repeat="record in records track by $index">
<div class="col-md12">
<div class="table-responsive">
<table>
<tbody>
<tr ng-repeat="item in record track by $index">
<th>{{item.column.name}}</th>
<td>{{item.value}}</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
<pre ng-show="style == 'json'">{{rawData | json}}</pre>
<pagination total-items="nTotalRecords"
items-per-page="nRecordsInPage"
max-size="maxNPages"
rotate="false"
ng-model="currentPage"
ng-change="search()">
</pagination>
</div>
</div>