1
0
Fork 0

Merge branch 'devel' of https://github.com/triAGENS/ArangoDB into devel

This commit is contained in:
Jan Steemann 2014-11-07 15:14:18 +01:00
commit d685f4ebb1
2 changed files with 34 additions and 7 deletions

View File

@ -129,10 +129,25 @@
return returnval;
},
truncateCollection: function () {
$.ajax({
async: false,
cache: false,
type: 'PUT',
url: "/_api/collection/" + this.get("id") + "/truncate",
success: function () {
arangoHelper.arangoNotification('Collection truncated');
},
error: function () {
arangoHelper.arangoError('Collection error');
}
});
},
loadCollection: function () {
var self = this;
$.ajax({
async:false,
async: false,
cache: false,
type: 'PUT',
url: "/_api/collection/" + this.get("id") + "/load",

View File

@ -74,6 +74,12 @@
window.modalView.hide();
},
truncateCollection: function () {
this.model.truncateCollection();
this.render();
window.modalView.hide();
},
deleteCollection: function () {
this.model.destroy(
{
@ -249,6 +255,18 @@
"change-collection-status", "Status", this.model.get('status'), ""
)
);
buttons.push(
window.modalView.createDeleteButton(
"Delete",
this.deleteCollection.bind(this)
)
);
buttons.push(
window.modalView.createDeleteButton(
"Truncate",
this.truncateCollection.bind(this)
)
);
if(collectionIsLoaded) {
buttons.push(
window.modalView.createNotificationButton(
@ -265,12 +283,6 @@
);
}
buttons.push(
window.modalView.createDeleteButton(
"Delete",
this.deleteCollection.bind(this)
)
);
buttons.push(
window.modalView.createSuccessButton(
"Save",