1
0
Fork 0

Bug fix 3.3/internal issue 2035 (#6806)

This commit is contained in:
Heiko 2018-10-11 11:30:39 +02:00 committed by Jan
parent 093350821f
commit 9022e3c64b
3 changed files with 73 additions and 24 deletions

View File

@ -1,6 +1,9 @@
v3.3.18 (XXXX-XX-XX)
--------------------
* fix internal issue #2035: the Web UI now updates its indices view to check
whether new indices exist or not.
* fix internal issue #6808: newly created databases within the Web UI did not
appear when used Internet Explorer 11 as a browser.

View File

@ -659,6 +659,9 @@
this.arangoCollectionsStore.fetch({
cache: false,
success: function () {
if (self.indicesView) {
self.indicesView.remove();
}
self.indicesView = new window.IndicesView({
collectionName: colname,
collection: self.arangoCollectionsStore.findWhere({

View File

@ -9,42 +9,79 @@
el: '#content',
initialize: function (options) {
var self = this;
this.collectionName = options.collectionName;
this.model = this.collection;
// rerender
self.interval = window.setInterval(function () {
if (window.location.hash.indexOf('cIndices/' + self.collectionName) !== -1 && window.VISIBLE) {
if ($('#collectionEditIndexTable').is(':visible') && !$('#indexDeleteModal').is(':visible')) {
self.rerender();
}
}
}, self.refreshRate);
},
interval: null,
refreshRate: 10000,
template: templateEngine.createTemplate('indicesView.ejs'),
events: {
},
remove: function () {
if (this.interval) {
window.clearInterval(this.interval);
}
this.$el.empty().off(); /* off to unbind the events */
this.stopListening();
this.unbind();
delete this.el;
return this;
},
render: function () {
var self = this;
$.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
}));
var continueFunction = function (data) {
$(self.el).html(self.template.render({
model: self.model,
supported: data.supports.indexes
}));
self.breadcrumb();
window.arangoHelper.buildCollectionSubNav(self.collectionName, 'Indexes');
self.breadcrumb();
window.arangoHelper.buildCollectionSubNav(self.collectionName, 'Indexes');
self.getIndex();
self.getIndex();
// check permissions and adjust views
arangoHelper.checkCollectionPermissions(self.collectionName, self.changeViewToReadOnly);
},
error: function () {
arangoHelper.arangoNotification('Index', 'Could not fetch index information.');
}
});
// check permissions and adjust views
arangoHelper.checkCollectionPermissions(self.collectionName, self.changeViewToReadOnly);
};
if (!this.engineData) {
$.ajax({
type: 'GET',
cache: false,
url: arangoHelper.databaseUrl('/_api/engine'),
contentType: 'application/json',
processData: false,
success: function (data) {
self.engineData = data;
continueFunction(data);
},
error: function () {
arangoHelper.arangoNotification('Index', 'Could not fetch index information.');
}
});
} else {
continueFunction(this.engineData);
}
},
rerender: function () {
this.getIndex(true);
},
changeViewToReadOnly: function () {
@ -61,12 +98,12 @@
);
},
getIndex: function () {
getIndex: function (rerender) {
var callback = function (error, data, id) {
if (error) {
window.arangoHelper.arangoError('Index', data.errorMessage);
} else {
this.renderIndex(data, id);
this.renderIndex(data, id, rerender);
}
}.bind(this);
@ -152,6 +189,8 @@
} else {
arangoHelper.arangoError('Document error', 'Could not create index.');
}
} else {
arangoHelper.arangoNotification('Index', 'Creation in progress. This may take a while.');
}
// toggle back
self.toggleNewIndexView();
@ -272,7 +311,7 @@
'<i class="fa fa-circle-o-notch fa-spin"></i>'
);
},
renderIndex: function (data, id) {
renderIndex: function (data, id, rerender) {
this.index = data;
// get pending jobs
@ -325,6 +364,10 @@
var fieldString = '';
var actionString = '';
if (rerender) {
$('#collectionEditIndexTable tbody').empty();
}
_.each(this.index.indexes, function (v) {
if (v.type === 'primary' || v.type === 'edge') {
actionString = '<span class="icon_arangodb_locked" ' +