1
0
Fork 0

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

This commit is contained in:
Kaveh Vahedipour 2016-11-03 16:47:43 +01:00
commit 57a848a46e
2 changed files with 32 additions and 11 deletions

View File

@ -219,7 +219,15 @@
// render
this.graphData.modified = this.parseData(this.graphData.original, this.graphData.graphInfo);
this.renderGraph(this.graphData.modified, null, true);
var success = false;
try {
this.renderGraph(this.graphData.modified, null, true);
success = true;
} catch (ignore) {
}
return success;
},
renderAQL: function (data) {

View File

@ -1726,6 +1726,8 @@
if (window.location.hash === '#queries') {
var outputEditor = ace.edit('outputEditor' + counter);
var success;
// handle explain query case
if (!data.msg) {
// handle usual query
@ -1743,21 +1745,30 @@
$('.outputEditorWrapper .tableWrapper').css('max-height', maxHeight);
$('#outputEditor' + counter).hide();
success = true;
} else if (result.defaultType === 'graph') {
$('#outputEditorWrapper' + counter + ' .arangoToolbarTop').after('<div id="outputGraph' + counter + '"></div>');
$('#outputGraph' + counter).show();
self.renderOutputGraph(result, counter);
success = self.renderOutputGraph(result, counter);
$('#outputEditor' + counter).hide();
if (success) {
$('#outputEditor' + counter).hide();
$('#outputEditorWrapper' + counter + ' #copy2gV').show();
$('#outputEditorWrapper' + counter + ' #copy2gV').bind('click', function () {
self.showResultInGraphViewer(result, counter);
});
$('#outputEditorWrapper' + counter + ' #copy2gV').show();
$('#outputEditorWrapper' + counter + ' #copy2gV').bind('click', function () {
self.showResultInGraphViewer(result, counter);
});
} else {
$('#outputGraph' + counter).remove();
}
}
// add active class to choosen display method
$('#' + result.defaultType + '-switch').addClass('active').css('display', 'inline');
if (success !== false) {
$('#' + result.defaultType + '-switch').addClass('active').css('display', 'inline');
} else {
$('#json-switch').addClass('active').css('display', 'inline');
}
var appendSpan = function (value, icon, css) {
if (!css) {
@ -2094,7 +2105,7 @@
};
var found = false;
if (!Array.isArray(result)) {
toReturn.defaultType = 'json';
return toReturn;
@ -2136,7 +2147,7 @@
var totalb = result.length;
_.each(result, function (obj) {
if (obj._from && obj._to) {
if (obj._from && obj._to && obj._id) {
hitsb++;
}
});
@ -2322,7 +2333,9 @@
id: '#outputGraph' + counter,
data: data
});
this.graphViewer.renderAQLPreview();
var success = this.graphViewer.renderAQLPreview();
return success;
},
showResultInGraphViewer: function (data, counter) {