mirror of https://gitee.com/bigwinds/arangodb
Merge branch 'devel' of https://github.com/arangodb/arangodb into devel
This commit is contained in:
commit
57a848a46e
|
@ -219,7 +219,15 @@
|
||||||
|
|
||||||
// render
|
// render
|
||||||
this.graphData.modified = this.parseData(this.graphData.original, this.graphData.graphInfo);
|
this.graphData.modified = this.parseData(this.graphData.original, this.graphData.graphInfo);
|
||||||
|
|
||||||
|
var success = false;
|
||||||
|
try {
|
||||||
this.renderGraph(this.graphData.modified, null, true);
|
this.renderGraph(this.graphData.modified, null, true);
|
||||||
|
success = true;
|
||||||
|
} catch (ignore) {
|
||||||
|
}
|
||||||
|
|
||||||
|
return success;
|
||||||
},
|
},
|
||||||
|
|
||||||
renderAQL: function (data) {
|
renderAQL: function (data) {
|
||||||
|
|
|
@ -1726,6 +1726,8 @@
|
||||||
if (window.location.hash === '#queries') {
|
if (window.location.hash === '#queries') {
|
||||||
var outputEditor = ace.edit('outputEditor' + counter);
|
var outputEditor = ace.edit('outputEditor' + counter);
|
||||||
|
|
||||||
|
var success;
|
||||||
|
|
||||||
// handle explain query case
|
// handle explain query case
|
||||||
if (!data.msg) {
|
if (!data.msg) {
|
||||||
// handle usual query
|
// handle usual query
|
||||||
|
@ -1743,21 +1745,30 @@
|
||||||
$('.outputEditorWrapper .tableWrapper').css('max-height', maxHeight);
|
$('.outputEditorWrapper .tableWrapper').css('max-height', maxHeight);
|
||||||
|
|
||||||
$('#outputEditor' + counter).hide();
|
$('#outputEditor' + counter).hide();
|
||||||
|
success = true;
|
||||||
} else if (result.defaultType === 'graph') {
|
} else if (result.defaultType === 'graph') {
|
||||||
$('#outputEditorWrapper' + counter + ' .arangoToolbarTop').after('<div id="outputGraph' + counter + '"></div>');
|
$('#outputEditorWrapper' + counter + ' .arangoToolbarTop').after('<div id="outputGraph' + counter + '"></div>');
|
||||||
$('#outputGraph' + counter).show();
|
$('#outputGraph' + counter).show();
|
||||||
self.renderOutputGraph(result, counter);
|
success = self.renderOutputGraph(result, counter);
|
||||||
|
|
||||||
|
if (success) {
|
||||||
$('#outputEditor' + counter).hide();
|
$('#outputEditor' + counter).hide();
|
||||||
|
|
||||||
$('#outputEditorWrapper' + counter + ' #copy2gV').show();
|
$('#outputEditorWrapper' + counter + ' #copy2gV').show();
|
||||||
$('#outputEditorWrapper' + counter + ' #copy2gV').bind('click', function () {
|
$('#outputEditorWrapper' + counter + ' #copy2gV').bind('click', function () {
|
||||||
self.showResultInGraphViewer(result, counter);
|
self.showResultInGraphViewer(result, counter);
|
||||||
});
|
});
|
||||||
|
} else {
|
||||||
|
$('#outputGraph' + counter).remove();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// add active class to choosen display method
|
// add active class to choosen display method
|
||||||
|
if (success !== false) {
|
||||||
$('#' + result.defaultType + '-switch').addClass('active').css('display', 'inline');
|
$('#' + result.defaultType + '-switch').addClass('active').css('display', 'inline');
|
||||||
|
} else {
|
||||||
|
$('#json-switch').addClass('active').css('display', 'inline');
|
||||||
|
}
|
||||||
|
|
||||||
var appendSpan = function (value, icon, css) {
|
var appendSpan = function (value, icon, css) {
|
||||||
if (!css) {
|
if (!css) {
|
||||||
|
@ -2136,7 +2147,7 @@
|
||||||
var totalb = result.length;
|
var totalb = result.length;
|
||||||
|
|
||||||
_.each(result, function (obj) {
|
_.each(result, function (obj) {
|
||||||
if (obj._from && obj._to) {
|
if (obj._from && obj._to && obj._id) {
|
||||||
hitsb++;
|
hitsb++;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -2322,7 +2333,9 @@
|
||||||
id: '#outputGraph' + counter,
|
id: '#outputGraph' + counter,
|
||||||
data: data
|
data: data
|
||||||
});
|
});
|
||||||
this.graphViewer.renderAQLPreview();
|
var success = this.graphViewer.renderAQLPreview();
|
||||||
|
|
||||||
|
return success;
|
||||||
},
|
},
|
||||||
|
|
||||||
showResultInGraphViewer: function (data, counter) {
|
showResultInGraphViewer: function (data, counter) {
|
||||||
|
|
Loading…
Reference in New Issue