mirror of https://gitee.com/bigwinds/arangodb
queryView
This commit is contained in:
parent
c98e533246
commit
90edd4312e
|
@ -125,7 +125,7 @@
|
||||||
<div class="pull-right">
|
<div class="pull-right">
|
||||||
<% if (type === 'Query') { %>
|
<% if (type === 'Query') { %>
|
||||||
<button id="downloadQueryResult" counter="<%=counter%>" style="display: none; margin-right: 0;" class="button-success">Download</button>
|
<button id="downloadQueryResult" counter="<%=counter%>" style="display: none; margin-right: 0;" class="button-success">Download</button>
|
||||||
<button id="copy2aqlEditor" counter="<%=counter%>" style="display: none; margin-right: 5px;" class="button-success">Copy to editor</button>
|
<button id="copy2aqlEditor" counter="<%=counter%>" style="display: none; margin-right: 8px;" class="button-success">Copy to editor</button>
|
||||||
<button id="cancelCurrentQuery" class="button-danger" style="margin-right: 5px">Cancel</button>
|
<button id="cancelCurrentQuery" class="button-danger" style="margin-right: 5px">Cancel</button>
|
||||||
<% } %>
|
<% } %>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -946,10 +946,12 @@
|
||||||
this.aqlEditor = ace.edit("aqlEditor");
|
this.aqlEditor = ace.edit("aqlEditor");
|
||||||
this.aqlEditor.getSession().setMode("ace/mode/aql");
|
this.aqlEditor.getSession().setMode("ace/mode/aql");
|
||||||
this.aqlEditor.setFontSize("10pt");
|
this.aqlEditor.setFontSize("10pt");
|
||||||
|
this.aqlEditor.setShowPrintMargin(false);
|
||||||
|
|
||||||
this.bindParamAceEditor = ace.edit("bindParamAceEditor");
|
this.bindParamAceEditor = ace.edit("bindParamAceEditor");
|
||||||
this.bindParamAceEditor.getSession().setMode("ace/mode/json");
|
this.bindParamAceEditor.getSession().setMode("ace/mode/json");
|
||||||
this.bindParamAceEditor.setFontSize("10pt");
|
this.bindParamAceEditor.setFontSize("10pt");
|
||||||
|
this.bindParamAceEditor.setShowPrintMargin(false);
|
||||||
|
|
||||||
this.bindParamAceEditor.getSession().on('change', function() {
|
this.bindParamAceEditor.getSession().on('change', function() {
|
||||||
try {
|
try {
|
||||||
|
@ -1282,6 +1284,7 @@
|
||||||
outputEditor.getSession().setMode("ace/mode/json");
|
outputEditor.getSession().setMode("ace/mode/json");
|
||||||
outputEditor.setReadOnly(true);
|
outputEditor.setReadOnly(true);
|
||||||
outputEditor.setOption("vScrollBarAlwaysVisible", true);
|
outputEditor.setOption("vScrollBarAlwaysVisible", true);
|
||||||
|
outputEditor.setShowPrintMargin(false);
|
||||||
this.setEditorAutoHeight(outputEditor);
|
this.setEditorAutoHeight(outputEditor);
|
||||||
|
|
||||||
sentBindParamEditor.setValue(JSON.stringify(this.bindParamTableObj), 1);
|
sentBindParamEditor.setValue(JSON.stringify(this.bindParamTableObj), 1);
|
||||||
|
@ -1370,8 +1373,13 @@
|
||||||
},
|
},
|
||||||
|
|
||||||
setEditorAutoHeight: function (editor) {
|
setEditorAutoHeight: function (editor) {
|
||||||
|
// ace line height = 17px
|
||||||
|
var winHeight = $('.centralRow').height();
|
||||||
|
var maxLines = (winHeight - 250) / 17;
|
||||||
|
|
||||||
|
|
||||||
editor.setOptions({
|
editor.setOptions({
|
||||||
maxLines: 100,
|
maxLines: maxLines,
|
||||||
minLines: 10
|
minLines: 10
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
@ -1466,7 +1474,7 @@
|
||||||
|
|
||||||
var appendSpan = function(value, icon) {
|
var appendSpan = function(value, icon) {
|
||||||
$('#outputEditorWrapper' + counter + ' .arangoToolbarTop .pull-left').append(
|
$('#outputEditorWrapper' + counter + ' .arangoToolbarTop .pull-left').append(
|
||||||
'<span><i class="fa ' + icon + '"></i><i>' + value + '</i></span>'
|
'<span><i class="fa ' + icon + '"></i><i class="iconText">' + value + '</i></span>'
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1476,10 +1484,14 @@
|
||||||
if (data && data.extra && data.extra.stats) {
|
if (data && data.extra && data.extra.stats) {
|
||||||
time = data.extra.stats.executionTime.toFixed(3) + " s";
|
time = data.extra.stats.executionTime.toFixed(3) + " s";
|
||||||
}
|
}
|
||||||
|
appendSpan(
|
||||||
|
data.result.length + ' elements', 'fa-calculator'
|
||||||
|
);
|
||||||
appendSpan(time, 'fa-clock-o');
|
appendSpan(time, 'fa-clock-o');
|
||||||
|
|
||||||
if (data.extra) {
|
if (data.extra) {
|
||||||
if (data.extra.stats) {
|
if (data.extra.stats) {
|
||||||
|
console.log(data.result.length);
|
||||||
if (data.extra.stats.writesExecuted > 0 || data.extra.stats.writesIgnored > 0) {
|
if (data.extra.stats.writesExecuted > 0 || data.extra.stats.writesIgnored > 0) {
|
||||||
appendSpan(
|
appendSpan(
|
||||||
data.extra.stats.writesExecuted + ' writes', 'fa-check-circle positive'
|
data.extra.stats.writesExecuted + ' writes', 'fa-check-circle positive'
|
||||||
|
@ -1497,12 +1509,12 @@
|
||||||
}
|
}
|
||||||
if (data.extra.stats.scannedFull > 0) {
|
if (data.extra.stats.scannedFull > 0) {
|
||||||
appendSpan(
|
appendSpan(
|
||||||
data.extra.stats.scannedFull + ' full collection scan', 'fa-exclamation-circle warning'
|
'full collection scan', 'fa-exclamation-circle warning'
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
appendSpan(
|
appendSpan(
|
||||||
data.extra.stats.scannedFull + ' full collection scan', 'fa-check-circle positive'
|
'no full collection scan', 'fa-check-circle positive'
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue