1
0
Fork 0

new graph management

This commit is contained in:
gschwab 2014-06-24 16:09:41 +02:00
parent 44c11d3846
commit 8e514b2435
3 changed files with 38 additions and 2 deletions

View File

@ -6,7 +6,7 @@
window.GraphCollection = Backbone.Collection.extend({
model: window.Graph,
url: "/_api/graph",
url: "/_api/gharial",
comparator: "_key",

View File

@ -230,7 +230,12 @@
graphManagement: function () {
if (!this.graphManagementView) {
this.graphManagementView =
new window.GraphManagementView({collection: new window.GraphCollection()});
new window.GraphManagementView(
{
collection: new window.GraphCollection(),
collectionCollection: new window.arangoCollections()
}
);
}
this.graphManagementView.render();
this.naviView.selectMenuItem('graphviewer-menu');

View File

@ -152,6 +152,37 @@
});
},
createNewGraph2: function() {
var _key = $("#createNewGraphName").val(),
vertexCollections = [],
edgeDefinitions = [],
self = this;
if (!_key) {
arangoHelper.arangoNotification(
"A name for the graph has to be provided."
);
return;
}
this.collection.create({
_key: _key,
edgeDefinitions: edgeDefinitions,
vertexCollections: vertexCollections
}, {
success: function() {
self.updateGraphManagementView();
window.modalView.hide();
},
error: function(obj, err) {
var response = JSON.parse(err.responseText),
msg = response.errorMessage;
// Gritter does not display <>
msg = msg.replace("<", "");
msg = msg.replace(">", "");
arangoHelper.arangoError(msg);
}
});
},
createNewGraphModal: function() {
var buttons = [],
tableContent = [];