1
0
Fork 0

Merge branch 'devel' of https://github.com/arangodb/arangodb into spdvpk

This commit is contained in:
Jan Steemann 2016-02-17 12:14:31 +01:00
commit 3359e16262
4 changed files with 44 additions and 6 deletions

View File

@ -107,7 +107,6 @@
data: JSON.stringify(postParameter), data: JSON.stringify(postParameter),
contentType: "application/json", contentType: "application/json",
processData: false, processData: false,
async: true,
success: function (data, textStatus, xhr) { success: function (data, textStatus, xhr) {
if (xhr.getResponseHeader('x-arango-async-id')) { if (xhr.getResponseHeader('x-arango-async-id')) {
window.arangoHelper.addAardvarkJob({ window.arangoHelper.addAardvarkJob({
@ -129,13 +128,28 @@
}, },
deleteIndex: function (id, callback) { deleteIndex: function (id, callback) {
var self = this;
$.ajax({ $.ajax({
cache: false, cache: false,
type: 'DELETE', type: 'DELETE',
url: "/_api/index/"+ this.get("name") +"/"+encodeURIComponent(id), url: "/_api/index/"+ this.get("name") +"/"+encodeURIComponent(id),
async: true, headers: {
success: function () { 'x-arango-async': 'store'
callback(false); },
success: function (data, textStatus, xhr) {
if (xhr.getResponseHeader('x-arango-async-id')) {
window.arangoHelper.addAardvarkJob({
id: xhr.getResponseHeader('x-arango-async-id'),
type: 'index',
collection: self.get("id")
});
callback(false, data);
}
else {
callback(true, data);
}
}, },
error: function (data) { error: function (data) {
callback(true, data); callback(true, data);

View File

@ -591,6 +591,15 @@
}, },
refreshCollectionsView: function() {
var self = this;
window.App.arangoCollectionsStore.fetch({
success: function () {
self.collectionsView.checkLockedCollections();
}
});
},
deleteIndex: function () { deleteIndex: function () {
var callback = function(error) { var callback = function(error) {
if (error) { if (error) {
@ -599,13 +608,21 @@
'<span class="deleteIndex icon_arangodb_roundminus"' + '<span class="deleteIndex icon_arangodb_roundminus"' +
' data-original-title="Delete index" title="Delete index"></span>' ' data-original-title="Delete index" title="Delete index"></span>'
); );
this.model.set("locked", false);
this.refreshCollectionsView();
} }
else { else if (!error && error !== undefined) {
$("tr th:contains('"+ this.lastId+"')").parent().remove(); $("tr th:contains('"+ this.lastId+"')").parent().remove();
this.model.set("locked", false);
this.refreshCollectionsView();
} }
}.bind(this); }.bind(this);
this.model.set("locked", true);
this.model.deleteIndex(this.lastId, callback); this.model.deleteIndex(this.lastId, callback);
this.refreshCollectionsView();
$("tr th:contains('"+ this.lastId+"')").parent().children().last().html( $("tr th:contains('"+ this.lastId+"')").parent().children().last().html(
'<i class="fa fa-circle-o-notch fa-spin"></i>' '<i class="fa fa-circle-o-notch fa-spin"></i>'
); );

View File

@ -907,6 +907,8 @@
if (typeof callback === "function") { if (typeof callback === "function") {
callback(); callback();
} }
$.noty.clearQueue();
$.noty.closeAll();
}, },
error: function (data) { error: function (data) {
window.progressView.hide(); window.progressView.hide();
@ -1098,7 +1100,8 @@
if (xhr.getResponseHeader('x-arango-async-id')) { if (xhr.getResponseHeader('x-arango-async-id')) {
self.queryCallbackFunction(xhr.getResponseHeader('x-arango-async-id'), callback); self.queryCallbackFunction(xhr.getResponseHeader('x-arango-async-id'), callback);
} }
$.noty.clearQueue();
$.noty.closeAll();
}, },
error: function (data) { error: function (data) {
self.switchTab("result-switch"); self.switchTab("result-switch");

View File

@ -47,6 +47,10 @@
margin-left: 10px; margin-left: 10px;
} }
.fa {
margin-left: 13px;
}
} }
.contentIn { .contentIn {