-
Notifications
You must be signed in to change notification settings - Fork 28
/
fts_list.html
354 lines (335 loc) · 15.9 KB
/
fts_list.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
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
<div ng-show="!ftsChecking && ftsAvailable" class="fts-indexes-lists indexContainer padding-bottom-6">
<div ng-show="errorMessage" class="error ng-cloak" role="alert">
{{errorMessage}}
</div>
<!-- table of indexes ******************** -->
<span ng-show="indexNamesReady">
<div class="row margin-bottom-half">
<h4>Full Text Indexes</h4>
<button ui-sref="^.search.fts_new({indexType: 'fulltext-index', sourceType: 'couchbase'})"
ng-disabled="!permsCluster.bucket['.'].fts.write">
Add Index
</button>
</div>
<table class="fts-indexes-list table-stroked">
<tr>
<th>index name</th>
<th>bucket</th>
<th>doc count
<span class="fa-stack icon-info raised"
uib-tooltip="Number of documents examined across active index partitions."
tooltip-placement="auto right">
<span class="icon fa-circle-thin fa-stack-2x"></span>
<span class="icon fa-info fa-stack-1x"></span>
</span>
</th>
<th>indexing progress</th>
</tr>
<tbody ng-repeat="(indexName, indexDef) in indexDefs"
class="has-hover"
ng-if="indexDef.type != 'fulltext-alias'"
ng-click="expando(indexName)"
ng-controller="indexViewController">
<tr ng-class="{
'grayblue-bg-5 detailsOpened': detailsOpened[indexName],
'no-stroke': detailsOpened[node.hostname]
}">
<td
class="index-name ellipsis cursor-pointer"
uib-tooltip="{{indexName}}"
tooltip-append-to-body="true"
tooltip-placement="auto top"
tooltip-trigger="'mouseenter'">{{indexName}}</td>
<td>
<span ng-if="indexDef.sourceType != 'couchbase'">
{{indexDef.sourceType}}
/
</span>
{{indexDef.sourceName}}
</td>
<td>
<span ng-bind="indexDocCount"></span>
</td>
<td>
<span ng-if="progressPct">{{progressPct}}%</span>
</td>
</tr>
<!-- index details area ************************* -->
<tr class="grayblue-bg-5" ng-if="detailsOpened[indexName]">
<td colspan="4">
<div class="fts-index-details">
<div class="margin-bottom1">
<form>
<div class="row" style="margin-bottom:1px;">
<!-- index search controls ************************* -->
<div class="fts-query-bar" ng-click="$event.stopPropagation()">
<input id="query_bar_input_{{indexName}}"
ng-model="searchInputs[indexName]"
type="text"
placeholder="search this index..."/>
<button ui-sref="^.search.fts_search({indexName: indexName, q: searchInputs[indexName]})">
Search
</button>
</div>
<!-- index action buttons ************************* -->
<span class="nowrap" ng-click="$event.stopPropagation()">
<button class="outline"
ng-show=showHiddenUI
ng-disabled="!permsCluster.bucket[indexDef.sourceName].fts.write && !permsCluster.bucket['.'].fts.write"
ui-sref="^.search.fts_details({indexName: indexName})">
Details
</button>
<button class="outline"
ng-disabled="!permsCluster.bucket[indexDef.sourceName].fts.write && !permsCluster.bucket['.'].fts.write"
ng-click="deleteIndex(indexName)">
Delete
</button>
<button class="outline"
ng-disabled="!permsCluster.bucket[indexDef.sourceName].fts.write && !permsCluster.bucket['.'].fts.write"
ui-sref="^.search.fts_clone({indexName: indexName})">
Clone
</button>
<button ng-disabled="!permsCluster.bucket[indexDef.sourceName].fts.write && !permsCluster.bucket['.'].fts.write"
ui-sref="^.search.fts_edit({indexName: indexName})">
Edit
</button>
</span>
</div>
</form>
<!-- second row help link ************************* -->
<div class="row query-bar-help"
ng-if="queryHelp && queryHelp.length"
ng-bind-html="queryHelpSafe">
</div>
</div>
<!-- index definition ******************************* -->
<div class="indexDetailsJSON" ng-click="$event.stopPropagation()">
<div
class="disclosure margin-bottom-half"
ng-class="{disclosed: showJSON[indexName]}"
ng-click="showJSON[indexName] = !showJSON[indexName]">
{{showJSON[indexName] ? 'Hide' : 'Show'}} index definition JSON
</div>
<div class="indent-1" ng-show="showJSON[indexName]">
<input
id="for-show-def-fts-curl-{{indexName}}"
type="checkbox"
ng-model="showJSONCurl[indexName]">
<label for="for-show-def-fts-curl-{{indexName}}">
Show curl command to modify this index definition
</label>
</div>
<!-- defintion JSON ******************** -->
<div
ng-show="showJSON[indexName] && !showJSONCurl[indexName]"
class="row items-top json-content">
<pre id="indexDefStr_details-{{indexName}}">{{indexDefStr}}</pre>
<button
class="outline"
ngclipboard data-clipboard-target="#indexDefStr_details-{{indexName}}">
Copy to Clipboard
</button>
</div>
<!-- definition with CURL ****************** -->
<div
ng-show="showJSONCurl[indexName] && showJSON[indexName]"
class="json-content row items-top">
<pre id="indexDefStr_details_curl-{{indexName}}">curl -XPUT -H "Content-Type: application/json" \
-u <username>:<password> http://{{hostPort}}{{api_base}}/api/index/{{indexName}} -d \
'{{escapeCmdLineParam(indexDefStr)}}'</pre>
<button
class="outline copy-to-clipboard"
ngclipboard data-clipboard-target="#indexDefStr_details_curl-{{indexName}}">
Copy to Clipboard
</button>
</div>
</div>
<mn-detail-stats
bucket="{{indexDef.sourceName}}"
mn-title="Search Index Stats"
item-id="{{indexName}}"
service="fts"
prefix="fts"
></mn-detail-stats>
</div>
</td>
</tr>
</tbody>
</table>
<!-- table of aliases ******************** -->
<div class="row margin-bottom-half">
<h4>Full Text Aliases</h4>
<button ui-sref="^.search.fts_new_alias({indexType: 'fulltext-alias', sourceType: 'nil'})"
ng-disabled="!permsCluster.bucket['.'].fts.write">
Add Alias
</button>
</div>
<table class="fts-indexes-list table-stroked">
<tr>
<th>alias name</th>
<th>target indexes</th>
</tr>
<tbody ng-repeat="(indexName, indexDef) in indexDefs"
class="has-hover"
ng-if="indexDef.type == 'fulltext-alias'"
ng-click="detailsOpened[indexName] = !detailsOpened[indexName]">
<tr ng-class="{
'grayblue-bg-5 detailsOpened': detailsOpened[indexName],
'no-stroke': detailsOpened[node.hostname]
}">
<td class="alias-name">{{indexName}}</td>
<td class="alias-targets">
<span ng-repeat="(targetName, targetObj) in indexDef.paramsObj.targets">
{{targetName}}<span ng-show="!$last">, </span>
</span>
</td>
</tr>
<!-- alias details area ************************* -->
<tr class="grayblue-bg-5" ng-if="detailsOpened[indexName]">
<td colspan="2">
<div class="fts-index-details">
<form>
<div class="row margin-bottom1">
<!-- search controls **************************** -->
<div class="fts-query-bar" ng-click="$event.stopPropagation()">
<input
ng-model="searchInputs[indexName]"
type="text"
placeholder="search this alias..."/>
<button ui-sref="^.search.fts_search({indexName: indexName, q: searchInputs[indexName]})">
Search
</button>
</div>
<!-- alias action buttons ************************* -->
<span class="nowrap" ng-click="$event.stopPropagation()">
<button ng-disabled="!permsCluster.bucket['.'].fts.write"
ng-click="deleteIndex(indexName)" class="outline">
Delete
</button>
<button ng-disabled="!permsCluster.bucket['.'].fts.write"
ui-sref="^.search.fts_clone_alias({indexName: indexName})" class="outline">
Clone
</button>
<button ng-disabled="!permsCluster.bucket['.'].fts.write"
ui-sref="^.search.fts_edit_alias({indexName: indexName})">
Edit
</button>
</span>
</div>
</form>
<!-- alias index definition ******************************* -->
<div ng-controller="indexViewController">
<div class="indexDetailsJSON" ng-click="$event.stopPropagation()">
<div
class="disclosure margin-bottom-half"
ng-class="{disclosed: showJSON[indexName]}"
ng-click="showJSON[indexName] = !showJSON[indexName]">
{{showJSON[indexName] ? 'Hide' : 'Show'}} alias definition JSON
</div>
<div class="indent-1" ng-show="showJSON[indexName]">
<input
id="for-show-alias-def-fts-curl-{{indexName}}"
ng-model="showJSONCurl[indexName]"
type="checkbox">
<label for="for-show-alias-def-fts-curl-{{indexName}}">
Show curl command to modify this alias definition
</label>
</div>
<!-- alias definition JSON ******************** -->
<div
ng-show="showJSON[indexName] && !showJSONCurl[indexName]"
class="json-content row items-top">
<pre id="indexDefStr_details-{{indexName}}">{{indexDefStr}}</pre>
<button
class="outline copy-to-clipboard"
ngclipboard data-clipboard-target="#indexDefStr_details-{{indexName}}">
Copy to Clipboard
</button>
</div>
<!-- alias definition with CURL ****************** -->
<div
ng-show="showJSONCurl[indexName] && showJSON[indexName]"
class="json-content row items-top">
<pre id="indexDefStr_details_curl-{{indexName}}">curl -XPUT -H "Content-Type: application/json" \
-u <username>:<password> http://{{hostPort}}{{api_base}}/api/index/{{indexName}} -d \
'{{escapeCmdLineParam(indexDefStr)}}'</pre>
<button
class="outline copy-to-clipboard"
ngclipboard data-clipboard-target="#indexDefStr_details_curl-{{indexName}}">
Copy to Clipboard
</button>
</div>
</div>
</div>
</div>
</td>
</tr>
</tbody>
</table>
</span>
</div>
<!-- display results of check for query nodes ******************** -->
<div ng-show="!ftsChecking && !ftsAvailable && !ftsCheckError" class="margin-top-half">
<p>The full text search interface is only available on Couchbase clusters running the full text search service.</p>
<div ng-show="ftsNodes.length > 0">
<p>The full text search service was found on the following nodes:</p>
<div class="indent-1" ng-repeat="url in ftsNodes">
<a href="{{url}}">{{url}}</a>
</div>
<div class="row flex-left margin-top-1">
<p class="text-small fix-width-7">
<span class="icon fa-warning orange-3"></span>
Note that the above links are provided as a convenience. They may not work
if you are accessing the Web Console via a web proxy or if Couchbase Server
has been deployed in a split horizon DNS environment, with public and
private hostnames and IPs. In the event the links don't work, log directly into the node.
</p>
</div>
</div>
<p ng-show="ftsNodes.length == 0" class="error">No full text search nodes were found on this cluster.</p>
</div>
<div ng-show="!ftsChecking && !ftsAvailable && ftsCheckError"
class="error ng-cloak ftsCheck" role="alert">
{{ftsCheckError}}
</div>
<div ng-init="stats = ['fts_num_bytes_used_ram', 'fts_total_queries_rejected_by_herder', 'fts_curr_batches_blocked_by_herder',
'fts/total_bytes_indexed', 'fts/total_queries', 'fts/num_files_on_disk', 'fts/num_bytes_used_disk']">
<footer
class="footer-fts"
ng-if="ftsAvailable && rbac.bucketNames['.stats!read'].length"
ng-controller="mnFooterStatsController as footerStatsCtl">
<div class="column vertical-divider">
<span class="width-6">RAM Used by Search</span>
<span class="text-right width-6">{{footerStatsCtl.getLatestStat('fts_num_bytes_used_ram')/1024/1024 | number:1}} MB</span><br>
<span class="width-6">Rejected Queries</span>
<span class="text-right width-6">{{footerStatsCtl.getLatestStat('fts_total_queries_rejected_by_herder') | number:0}}</span><br>
<span class="width-6">DCP Batches Blocked</span>
<span class="text-right width-6">{{footerStatsCtl.getLatestStatExponent('fts_curr_batches_blocked_by_herder',2)}}</span>
</div>
<div class="margin-right-1">
<ui-select
class="cbui-select cbui-select-small"
ng-model="footerStatsCtl.currentBucket"
theme="selectize"
ng-disabled="!rbac.bucketNames['.stats!read'].length"
on-select="footerStatsCtl.onSelectBucket($item)">
<ui-select-match class="ui-select-match">{{$select.selected}} </ui-select-match>
<ui-select-choices
class="ui-select-choices"
repeat="name in rbac.bucketNames['.stats!read'] | filter: $select.search">
<span class="select-item ellipsis" ng-bind-html="name | highlight: $select.search"></span>
</ui-select-choices>
</ui-select>
</div>
<div class="column">
<span class="width-6">Index Rate</span>
<span class="text-right width-6">{{footerStatsCtl.getLatestStat('fts/total_bytes_indexed')/1024/1024 | number:1}} MB/sec</span><br>
<span class="width-6">Query Rate</span>
<span class="text-right width-6">{{footerStatsCtl.getLatestStat('fts/total_queries') | number:0}}/sec</span><br>
<span class="width-6">Total Disk Files</span>
<span class="text-right width-6">{{footerStatsCtl.getLatestStat('fts/num_files_on_disk') | number:0}}</span><br>
<span class="width-6">Total Disk Used</span>
<span class="text-right width-6">{{footerStatsCtl.getLatestStat('fts/num_bytes_used_disk')/1024/1024 | number:1}} MB</span>
</div>
</footer>
</div>