mirror of https://gitee.com/bigwinds/arangodb
new graph management
This commit is contained in:
parent
44c11d3846
commit
8e514b2435
|
@ -6,7 +6,7 @@
|
|||
window.GraphCollection = Backbone.Collection.extend({
|
||||
model: window.Graph,
|
||||
|
||||
url: "/_api/graph",
|
||||
url: "/_api/gharial",
|
||||
|
||||
comparator: "_key",
|
||||
|
||||
|
|
|
@ -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');
|
||||
|
|
|
@ -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 = [];
|
||||
|
|
Loading…
Reference in New Issue