mirror of https://gitee.com/bigwinds/arangodb
ui - support storage engine index types
This commit is contained in:
parent
97d525e9b7
commit
150ffa067e
|
@ -35,11 +35,21 @@
|
||||||
<th class="collectionTh">Type:</th>
|
<th class="collectionTh">Type:</th>
|
||||||
<th class="">
|
<th class="">
|
||||||
<select id="newIndexType">
|
<select id="newIndexType">
|
||||||
|
<% if (supported.indexOf('geo') > -1) { %>
|
||||||
<option value="Geo">Geo Index</option>
|
<option value="Geo">Geo Index</option>
|
||||||
|
<% } %>
|
||||||
|
<% if (supported.indexOf('hash') > -1) { %>
|
||||||
<option value="Hash">Hash Index</option>
|
<option value="Hash">Hash Index</option>
|
||||||
|
<% } %>
|
||||||
|
<% if (supported.indexOf('persistent') > -1) { %>
|
||||||
<option value="Persistent">Persistent Index</option>
|
<option value="Persistent">Persistent Index</option>
|
||||||
|
<% } %>
|
||||||
|
<% if (supported.indexOf('fulltext') > -1) { %>
|
||||||
<option value="Fulltext">Fulltext Index</option>
|
<option value="Fulltext">Fulltext Index</option>
|
||||||
|
<% } %>
|
||||||
|
<% if (supported.indexOf('skiplist') > -1) { %>
|
||||||
<option value="Skiplist">Skip-List Index</option>
|
<option value="Skiplist">Skip-List Index</option>
|
||||||
|
<% } %>
|
||||||
</select>
|
</select>
|
||||||
</th>
|
</th>
|
||||||
<th class="" style="width: 18px"/>
|
<th class="" style="width: 18px"/>
|
||||||
|
|
|
@ -19,14 +19,29 @@
|
||||||
},
|
},
|
||||||
|
|
||||||
render: function () {
|
render: function () {
|
||||||
$(this.el).html(this.template.render({
|
var self = this;
|
||||||
model: this.model
|
|
||||||
|
$.ajax({
|
||||||
|
type: 'GET',
|
||||||
|
cache: false,
|
||||||
|
url: arangoHelper.databaseUrl('/_api/engine'),
|
||||||
|
contentType: 'application/json',
|
||||||
|
processData: false,
|
||||||
|
success: function (data) {
|
||||||
|
$(self.el).html(self.template.render({
|
||||||
|
model: self.model,
|
||||||
|
supported: data.supports.indexes
|
||||||
}));
|
}));
|
||||||
|
|
||||||
this.breadcrumb();
|
self.breadcrumb();
|
||||||
window.arangoHelper.buildCollectionSubNav(this.collectionName, 'Indexes');
|
window.arangoHelper.buildCollectionSubNav(this.collectionName, 'Indexes');
|
||||||
|
|
||||||
this.getIndex();
|
self.getIndex();
|
||||||
|
},
|
||||||
|
error: function () {
|
||||||
|
arangoHelper.arangoNotification('Index', 'Could not fetch index information.');
|
||||||
|
}
|
||||||
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
breadcrumb: function () {
|
breadcrumb: function () {
|
||||||
|
@ -332,6 +347,10 @@
|
||||||
selectIndexType: function () {
|
selectIndexType: function () {
|
||||||
$('.newIndexClass').hide();
|
$('.newIndexClass').hide();
|
||||||
var type = $('#newIndexType').val();
|
var type = $('#newIndexType').val();
|
||||||
|
if (type === null) {
|
||||||
|
type = $('#newIndexType').children().first().attr('value');
|
||||||
|
$('#newIndexType').val(type);
|
||||||
|
}
|
||||||
$('#newIndexType' + type).show();
|
$('#newIndexType' + type).show();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue