8000 Added support for adding ZKD index through Web UI. (#14845) · arangodb/arangodb@e05881d · GitHub < 8000 meta name="apple-itunes-app" content="app-id=1477376905, app-argument=https://github.com/arangodb/arangodb/commit/e05881d6dff55ce838304e6ddaf42e69848274d2" />
[go: up one dir, main page]

Skip to content

Commit e05881d

Browse files
authored
Added support for adding ZKD index through Web UI. (#14845)
1 parent 24d920f commit e05881d

File tree

2 files changed

+126
-48
lines changed

2 files changed

+126
-48
lines changed

js/apps/system/_admin/aardvark/APP/frontend/js/templates/indicesView.ejs

Lines changed: 111 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -33,41 +33,48 @@
3333
</table>
3434
</div>
3535
36-
<div id="newIndexView" class="new-index-view" style="display:none">
36+
<div id="newIndexView" class="new-index-view" style="display:none">
3737
<table>
38-
<tr>
39-
<th class="collectionTh">Type:</th>
40-
<th class="">
41-
<select id="newIndexType">
42-
<option style="display: none" disabled selected value="unknown"> -- select an index type -- </option>
43-
<% if (supported.indexOf('persistent') > -1) { %>
44-
<option value="Persistent">Persistent Index</option>
45-
<% } %>
46-
<% if (supported.indexOf('geo') > -1) { %>
47-
<option value="Geo">Geo Index</option>
48-
<% } %>
49-
<% if (supported.indexOf('hash') > -1) { %>
50-
<option value="Hash">Hash Index</option>
51-
<% } %>
52-
<% if (supported.indexOf('fulltext') > -1) { %>
53-
<option value="Fulltext">Fulltext Index</option>
54-
<% } %>
55-
<% if (supported.indexOf('skiplist') > -1) { %>
56-
<option value="Skiplist">Skiplist Index</option>
57-
<% } %>
58-
<% if (supported.indexOf('ttl') > -1) { %>
59-
<option value="Ttl">TTL Index</option>
60-
<% } %>
61-
</select>
62-
</th>
63-
<th class="tooltipInfoTh">
64-
<div class="tooltipDiv">
65-
<a class="index-tooltip" data-toggle="tooltip" data-placement="left" title="Type of index to create. <% if (supported.indexOf('hash') <= -1) { %>Please note that for the RocksDB engine the index types hash, skiplist and persistent are identical, so that they are not offered seperately here.<% } %>">
66-
<span rel="tooltip" class="arangoicon icon_arangodb_info"></span>
67-
</a>
68-
</div>
69-
</th>
70-
</tr>
38+
<tr>
39+
<th class="collectionTh">Type:</th>
40+
<th class="">
41+
<select id="newIndexType">
42+
<option style="display: none" disabled selected value="unknown"> -- select an index type
43+
--
44+
</option>
45+
<% if (supported.indexOf('persistent') > -1) { %>
46+
<option value="Persistent">Persistent Index</option>
47+
<% } %>
48+
<% if (supported.indexOf('geo') > -1) { %>
49+
<option value="Geo">Geo Index</option>
50+
<% } %>
51+
<% if (supported.indexOf('hash') > -1) { %>
52+
<option value="Hash">Hash Index</option>
53+
<% } %>
54+
<% if (supported.indexOf('fulltext') > -1) { %>
55+
<option value="Fulltext">Fulltext Index</option>
56+
<% } %>
57+
<% if (supported.indexOf('skiplist') > -1) { %>
58+
<option value="Skiplist">Skiplist Index</option>
59+
<% } %>
60+
<% if (supported.indexOf('ttl') > -1) { %>
61+
<option value="Ttl">TTL Index</option>
62+
<% } %>
63+
<% if (supported.indexOf('zkd') > -1) { %>
64+
<option value="Zkd">ZKD Index</option>
65+
<% } %>
66+
</select>
67+
</th>
68+
<th class="tooltipInfoTh">
69+
<div class="tooltipDiv">
70+
<a class="index-tooltip" data-toggle="tooltip" data-placement="left"
71+
title="Type of index to create. <% if (supported.indexOf(
72+
'hash') <= -1) { %>Please note that for the RocksDB engine the index types hash, skiplist and persistent are identical, so that they are not offered seperately here.<% } %>">
73+
<span rel="tooltip" class="arangoicon icon_arangodb_info"></span>
74+
</a>
75+
</div>
76+
</th>
77+
</tr>
7178
</table>
7279
<div id="newIndexTypeGeo" class="newIndexClass" style="display: none">
7380
<table>
@@ -485,25 +492,83 @@
485492
<th>
486493
<input id="newTtlBackground" type="checkbox" name="newTtlBackground" value="true">
487494
</th>
488-
<th class="tooltipInfoTh">
489-
<div class="tooltipDiv">
490-
<a class="index-tooltip" data-toggle="tooltip" data-placement="left" title="Create the index in background.">
491-
<span rel="tooltip" class="arangoicon icon_arangodb_info"></span>
492-
</a>
493-
</div>
494-
</th>
495+
<th class="tooltipInfoTh">
496+
<div class="tooltipDiv">
497+
<a class="index-tooltip" data-toggle="tooltip" data-placement="left"
498+
title="Create the index in background.">
499+
<span rel="tooltip" class="arangoicon icon_arangodb_info"></span>
500+
</a>
501+
</div>
502+
</th>
495503
</tr>
496504
</table>
497505
</div>
506+
<div id="newIndexTypeZkd" class="newIndexClass" style="display:none">
507+
<table>
508+
<tr>
509+
<th class="collectionTh">Fields:</th>
510+
<th><input type="text" id="newZkdFields" value=""/></th>
511+
<th class="tooltipInfoTh">
512+
<div class="tooltipDiv">
513+
<a class="index-tooltip" data-toggle="tooltip" data-placement="left"
514+
title="A comma-separated list of attribute paths.">
515+
<span rel="tooltip" class="arangoicon icon_arangodb_info"></span>
516+
</a>
517+
</div>
518+
</th>
519+
</tr>
520+
<tr>
521+
<th class="collectionTh">Name:</th>
522+
<th><input type="text" id="newZkdName" value=""/></th>
523+
<th class="tooltipInfoTh">
524+
<div class="tooltipDiv">
525+
<a class="index-tooltip" data-toggle="tooltip" data-placement="left"
526+
title="Index name. If left blank, a name will be auto-generated. Example: byValue">
527+
<span rel="tooltip" class="arangoicon icon_arangodb_info"></span>
528+
</a>
529+
</div>
530+
</th>
531+
</tr>
532+
<tr>
533+
<th class="collectionTh">Field Value Types:</th>
534+
<th>
535+
<input type="text" id="newZkdFieldValueTypes" value="double" disabled
536+
style="background: #dddddd !important; cursor: not-allowed"/>
537+
</th>
538+
<th class="tooltipInfoTh">
539+
<div class="tooltipDiv">
540+
<a class="index-tooltip" data-toggle="tooltip" data-placement="left"
541+
title="The value type of the fields being indexed (only double supported for now).">
542+
<span rel="tooltip" class="arangoicon icon_arangodb_info"></span>
543+
</a>
544+
</div>
545+
</th>
546+
</tr>
547+
<tr>
548+
<th class="collectionTh">Create in background:</th>
549+
<th>
550+
<input id="newZkdBackground" type="checkbox" name="newZkdBackground" value="true">
551+
</th>
552+
<th class="tooltipInfoTh">
553+
<div class="tooltipDiv">
554+
<a class="index-tooltip" data-toggle="tooltip" data-placement="left"
555+
title="Create the index in background.">
556+
<span rel="tooltip" class="arangoicon icon_arangodb_info"></span>
557+
</a>
558+
</div>
559+
</th>
560+
</tr>
561+
</table>
562+
</div>
498563
<div class="index-button-bar index-button-bar2">
499-
<button id="createIndex" class="button-success" style="margin-left: 15px;">Create</button>
500-
<button id="cancelIndex" class="button-close" style="margin-left: 0;"><i class="fa fa-arrow-left"></i>
501-
<span style="margin-left: 5px;">Back</span>
502-
</button>
564+
<button id="createIndex" class="button-success" style="margin-left: 15px;">Create</button>
565+
<button id="cancelIndex" class="button-close" style="margin-left: 0;"><i class="fa fa-arrow-left"></i>
566+
<span style="margin-left: 5px;">Back</span>
567+
</button>
503568
</div>
504569
</div>
505570
<div id="modal-dialog">
506-
<div class="modal-footer" style="border: none"></div>
571+
<div class="modal-footer" style="border: none"></div>
507572
</div>
508573
</div>
509574
<% } %>

js/apps/system/_admin/aardvark/APP/frontend/js/views/indicesView.js

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,19 @@
133133
var name;
134134

135135
switch (indexType) {
136+
case 'Zkd':
137+
fields = $('#newZkdFields').val();
138+
const fieldValueTypes = $('#newZkdFieldValueTypes').val();
139+
background = self.checkboxToValue('#newZkdBackground');
140+
name = $('#newZkdName').val();
141+
postParameter = {
142+
type: 'zkd',
143+
fields: self.stringToArray(fields),
144+
fieldValueTypes,
145+
inBackground: background,
146+
name
147+
};
148+
break;
136149
case 'Ttl':
137150
fields = $('#newTtlFields').val();
138151
var expireAfter = parseInt($('#newTtlExpireAfter').val(), 10) || 0;
@@ -442,9 +455,9 @@
442455
);
443456
var sparse = (v.hasOwnProperty('sparse') ? v.sparse : 'n/a');
444457
var extras = [];
445-
["deduplicate", "expireAfter", "minLength", "geoJson", "estimates"].forEach(function(k) {
458+
['deduplicate', 'expireAfter', 'minLength', 'geoJson', 'estimates'].forEach(function (k) {
446459
if (v.hasOwnProperty(k)) {
447-
extras.push(k + ": " + v[k]);
460+
extras.push(k + ': ' + v[k]);
448461
}
449462
});
450463

0 commit comments

Comments
 (0)
0