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="">
|
||||
<select id="newIndexType">
|
||||
<option value="Geo">Geo Index</option>
|
||||
<option value="Hash">Hash Index</option>
|
||||
<option value="Persistent">Persistent Index</option>
|
||||
<option value="Fulltext">Fulltext Index</option>
|
||||
<option value="Skiplist">Skip-List Index</option>
|
||||
<% if (supported.indexOf('geo') > -1) { %>
|
||||
<option value="Geo">Geo Index</option>
|
||||
<% } %>
|
||||
<% if (supported.indexOf('hash') > -1) { %>
|
||||
<option value="Hash">Hash Index</option>
|
||||
<% } %>
|
||||
<% if (supported.indexOf('persistent') > -1) { %>
|
||||
<option value="Persistent">Persistent Index</option>
|
||||
<% } %>
|
||||
<% if (supported.indexOf('fulltext') > -1) { %>
|
||||
<option value="Fulltext">Fulltext Index</option>
|
||||
<% } %>
|
||||
<% if (supported.indexOf('skiplist') > -1) { %>
|
||||
<option value="Skiplist">Skip-List Index</option>
|
||||
<% } %>
|
||||
</select>
|
||||
</th>
|
||||
<th class="" style="width: 18px"/>
|
||||
|
|
|
@ -19,14 +19,29 @@
|
|||
},
|
||||
|
||||
render: function () {
|
||||
$(this.el).html(this.template.render({
|
||||
model: this.model
|
||||
}));
|
||||
var self = this;
|
||||
|
||||
this.breadcrumb();
|
||||
window.arangoHelper.buildCollectionSubNav(this.collectionName, 'Indexes');
|
||||
$.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.getIndex();
|
||||
self.breadcrumb();
|
||||
window.arangoHelper.buildCollectionSubNav(this.collectionName, 'Indexes');
|
||||
|
||||
self.getIndex();
|
||||
},
|
||||
error: function () {
|
||||
arangoHelper.arangoNotification('Index', 'Could not fetch index information.');
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
breadcrumb: function () {
|
||||
|
@ -332,6 +347,10 @@
|
|||
selectIndexType: function () {
|
||||
$('.newIndexClass').hide();
|
||||
var type = $('#newIndexType').val();
|
||||
if (type === null) {
|
||||
type = $('#newIndexType').children().first().attr('value');
|
||||
$('#newIndexType').val(type);
|
||||
}
|
||||
$('#newIndexType' + type).show();
|
||||
},
|
||||
|
||||
|
|
Loading…
Reference in New Issue