mirror of https://gitee.com/bigwinds/arangodb
aardvark, grunt
This commit is contained in:
parent
0d13d6609a
commit
f31cee26bd
|
@ -330,6 +330,7 @@ controller.post("/job", function(req, res) {
|
||||||
id: req.body().id,
|
id: req.body().id,
|
||||||
collection: req.body().collection,
|
collection: req.body().collection,
|
||||||
type: req.body().type,
|
type: req.body().type,
|
||||||
|
model: 'job',
|
||||||
desc: req.body().desc
|
desc: req.body().desc
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -350,8 +351,10 @@ controller.post("/job", function(req, res) {
|
||||||
|
|
||||||
controller.del("/job/", function(req, res) {
|
controller.del("/job/", function(req, res) {
|
||||||
|
|
||||||
db.aardvark.truncate();
|
db.aardvark.removeByExample({
|
||||||
return res.json(true);
|
model: 'job'
|
||||||
|
}, true);
|
||||||
|
res.json(true);
|
||||||
|
|
||||||
}).summary("Store job id of a running job")
|
}).summary("Store job id of a running job")
|
||||||
.notes("This function stores a job id into a system collection.");
|
.notes("This function stores a job id into a system collection.");
|
||||||
|
|
|
@ -27642,7 +27642,7 @@ window.ArangoUsers = Backbone.Collection.extend({
|
||||||
|
|
||||||
myQueriesTableDesc: {
|
myQueriesTableDesc: {
|
||||||
id: "arangoMyQueriesTable",
|
id: "arangoMyQueriesTable",
|
||||||
titles: ["Name", "Query", "Actions"],
|
titles: ["Name", "Actions"],
|
||||||
rows: []
|
rows: []
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -27815,6 +27815,15 @@ window.ArangoUsers = Backbone.Collection.extend({
|
||||||
$('#bindParamAceEditor').hide();
|
$('#bindParamAceEditor').hide();
|
||||||
$('#bindParamEditor').show();
|
$('#bindParamEditor').show();
|
||||||
$('#switchTypes').text('JSON');
|
$('#switchTypes').text('JSON');
|
||||||
|
$('.aqlEditorWrapper').first().width($(window).width() * 0.33);
|
||||||
|
this.queryPreview.setValue("No query selected.");
|
||||||
|
this.deselect(this.queryPreview);
|
||||||
|
|
||||||
|
this.resize();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$('.aqlEditorWrapper').first().width($(window).width() * 0.66);
|
||||||
|
this.resize();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -27845,7 +27854,7 @@ window.ArangoUsers = Backbone.Collection.extend({
|
||||||
name = $(e.currentTarget).children().first().text();
|
name = $(e.currentTarget).children().first().text();
|
||||||
}
|
}
|
||||||
else if ($(e.currentTarget).is('span')) {
|
else if ($(e.currentTarget).is('span')) {
|
||||||
name = $(e.currentTarget).parent().parent().prev().prev().text();
|
name = $(e.currentTarget).parent().parent().prev().text();
|
||||||
}
|
}
|
||||||
return name;
|
return name;
|
||||||
},
|
},
|
||||||
|
@ -27893,6 +27902,7 @@ window.ArangoUsers = Backbone.Collection.extend({
|
||||||
this.toggleQueries();
|
this.toggleQueries();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$('.aqlEditorWrapper').first().width($(window).width() * 0.66);
|
||||||
this.aqlEditor.setValue(this.getCustomQueryValueByName(name));
|
this.aqlEditor.setValue(this.getCustomQueryValueByName(name));
|
||||||
this.fillBindParamTable(this.getCustomQueryParameterByName(name));
|
this.fillBindParamTable(this.getCustomQueryParameterByName(name));
|
||||||
this.updateBindParams();
|
this.updateBindParams();
|
||||||
|
@ -27932,13 +27942,23 @@ window.ArangoUsers = Backbone.Collection.extend({
|
||||||
},
|
},
|
||||||
|
|
||||||
downloadQueryResult: function(e) {
|
downloadQueryResult: function(e) {
|
||||||
|
console.log($(e.currentTarget));
|
||||||
var count = $(e.currentTarget).attr('counter'),
|
var count = $(e.currentTarget).attr('counter'),
|
||||||
editor = ace.edit("sentQueryEditor" + count),
|
editor = ace.edit("sentQueryEditor" + count),
|
||||||
query = editor.getValue();
|
query = editor.getValue();
|
||||||
|
|
||||||
|
console.log(this.bindParamTableObj);
|
||||||
if (query !== '' || query !== undefined || query !== null) {
|
if (query !== '' || query !== undefined || query !== null) {
|
||||||
|
if (Object.keys(this.bindParamTableObj) === 0) {
|
||||||
window.open("query/result/download/" + encodeURIComponent(btoa(JSON.stringify({ query: query }))));
|
window.open("query/result/download/" + encodeURIComponent(btoa(JSON.stringify({ query: query }))));
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
window.open("query/result/download/" + encodeURIComponent(btoa(JSON.stringify({
|
||||||
|
query: query,
|
||||||
|
bindVars: this.bindParamTableObj
|
||||||
|
}))));
|
||||||
|
}
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
arangoHelper.arangoError("Query error", "could not query result.");
|
arangoHelper.arangoError("Query error", "could not query result.");
|
||||||
}
|
}
|
||||||
|
@ -27991,6 +28011,8 @@ window.ArangoUsers = Backbone.Collection.extend({
|
||||||
sentQueryEditor.setOption("vScrollBarAlwaysVisible", true);
|
sentQueryEditor.setOption("vScrollBarAlwaysVisible", true);
|
||||||
outputEditor.setReadOnly(true);
|
outputEditor.setReadOnly(true);
|
||||||
sentQueryEditor.setReadOnly(true);
|
sentQueryEditor.setReadOnly(true);
|
||||||
|
this.setEditorAutoHeight(outputEditor);
|
||||||
|
this.setEditorAutoHeight(sentQueryEditor);
|
||||||
|
|
||||||
this.fillExplain(outputEditor, sentQueryEditor, counter);
|
this.fillExplain(outputEditor, sentQueryEditor, counter);
|
||||||
this.outputCounter++;
|
this.outputCounter++;
|
||||||
|
@ -28166,7 +28188,6 @@ window.ArangoUsers = Backbone.Collection.extend({
|
||||||
resizeFunction: function() {
|
resizeFunction: function() {
|
||||||
if ($('#toggleQueries1').is(':visible')) {
|
if ($('#toggleQueries1').is(':visible')) {
|
||||||
this.aqlEditor.resize();
|
this.aqlEditor.resize();
|
||||||
//fix bind table resizing issues
|
|
||||||
$('#arangoBindParamTable thead').css('width', $('#bindParamEditor').width());
|
$('#arangoBindParamTable thead').css('width', $('#bindParamEditor').width());
|
||||||
$('#arangoBindParamTable thead th').css('width', $('#bindParamEditor').width() / 2);
|
$('#arangoBindParamTable thead th').css('width', $('#bindParamEditor').width() / 2);
|
||||||
$('#arangoBindParamTable tr').css('width', $('#bindParamEditor').width());
|
$('#arangoBindParamTable tr').css('width', $('#bindParamEditor').width());
|
||||||
|
@ -28177,15 +28198,12 @@ window.ArangoUsers = Backbone.Collection.extend({
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
this.queryPreview.resize();
|
this.queryPreview.resize();
|
||||||
//fix my queries preview table resizing issues TODO
|
|
||||||
$('#arangoMyQueriesTable thead').css('width', $('#queryTable').width());
|
$('#arangoMyQueriesTable thead').css('width', $('#queryTable').width());
|
||||||
$('#arangoMyQueriesTable thead th').css('width', $('#queryTable').width() / 3);
|
$('#arangoMyQueriesTable thead th').css('width', $('#queryTable').width() / 2);
|
||||||
$('#arangoMyQueriesTable tr').css('width', $('#queryTable').width());
|
$('#arangoMyQueriesTable tr').css('width', $('#queryTable').width());
|
||||||
$('#arangoMyQueriesTable tbody').css('height', $('#queryTable').height() - 18);
|
$('#arangoMyQueriesTable tbody').css('height', $('#queryTable').height() - 18);
|
||||||
$('#arangoMyQueriesTable tbody').css('width', $('#queryTable').width());
|
$('#arangoMyQueriesTable tbody').css('width', $('#queryTable').width());
|
||||||
$('#arangoMyQueriesTable tbody tr').css('width', $('#queryTable').width());
|
$('#arangoMyQueriesTable tbody td').css('width', $('#queryTable').width() / 2);
|
||||||
$('#arangoMyQueriesTable tbody td').css('width', $('#queryTable').width() / 3);
|
|
||||||
$('#arangoMyQueriesTable tbody td .truncate').css('width', $('#queryTable').width() / 3);
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -28449,11 +28467,7 @@ window.ArangoUsers = Backbone.Collection.extend({
|
||||||
|
|
||||||
this.myQueriesTableDesc.rows = this.customQueries;
|
this.myQueriesTableDesc.rows = this.customQueries;
|
||||||
_.each(this.myQueriesTableDesc.rows, function(k) {
|
_.each(this.myQueriesTableDesc.rows, function(k) {
|
||||||
k.secondRow = '<div class="truncate">' +
|
k.secondRow = '<span class="spanWrapper">' +
|
||||||
JSON.stringify(self.collection.findWhere({name: k.name}).get('value')) +
|
|
||||||
'</div>';
|
|
||||||
|
|
||||||
k.thirdRow = '<span class="spanWrapper">' +
|
|
||||||
'<span id="copyQuery" title="Copy query"><i class="fa fa-copy"></i></span>' +
|
'<span id="copyQuery" title="Copy query"><i class="fa fa-copy"></i></span>' +
|
||||||
'<span id="explQuery" title="Explain query"><i class="fa fa-comments"></i></i></span>' +
|
'<span id="explQuery" title="Explain query"><i class="fa fa-comments"></i></i></span>' +
|
||||||
'<span id="runQuery" title="Run query"><i class="fa fa-play-circle-o"></i></i></span>' +
|
'<span id="runQuery" title="Run query"><i class="fa fa-play-circle-o"></i></i></span>' +
|
||||||
|
@ -28485,7 +28499,6 @@ window.ArangoUsers = Backbone.Collection.extend({
|
||||||
}
|
}
|
||||||
self.myQueriesTableDesc.rows.push({
|
self.myQueriesTableDesc.rows.push({
|
||||||
name: val.name,
|
name: val.name,
|
||||||
secondRow: '<div class="truncate">' + val.value + '</div>',
|
|
||||||
thirdRow: '<span class="spanWrapper">' +
|
thirdRow: '<span class="spanWrapper">' +
|
||||||
'<span id="copyQuery" title="Copy query"><i class="fa fa-copy"></i></span></span>'
|
'<span id="copyQuery" title="Copy query"><i class="fa fa-copy"></i></span></span>'
|
||||||
});
|
});
|
||||||
|
@ -28683,6 +28696,8 @@ window.ArangoUsers = Backbone.Collection.extend({
|
||||||
outputEditor.setFontSize("13px");
|
outputEditor.setFontSize("13px");
|
||||||
sentQueryEditor.setFontSize("13px");
|
sentQueryEditor.setFontSize("13px");
|
||||||
sentQueryEditor.setReadOnly(true);
|
sentQueryEditor.setReadOnly(true);
|
||||||
|
this.setEditorAutoHeight(outputEditor);
|
||||||
|
this.setEditorAutoHeight(sentQueryEditor);
|
||||||
|
|
||||||
this.fillResult(outputEditor, sentQueryEditor, counter);
|
this.fillResult(outputEditor, sentQueryEditor, counter);
|
||||||
this.outputCounter++;
|
this.outputCounter++;
|
||||||
|
@ -28766,7 +28781,8 @@ window.ArangoUsers = Backbone.Collection.extend({
|
||||||
|
|
||||||
setEditorAutoHeight: function (editor) {
|
setEditorAutoHeight: function (editor) {
|
||||||
editor.setOptions({
|
editor.setOptions({
|
||||||
maxLines: Infinity
|
maxLines: 100,
|
||||||
|
minLines: 3
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -28834,7 +28850,44 @@ window.ArangoUsers = Backbone.Collection.extend({
|
||||||
warningsFunc(data);
|
warningsFunc(data);
|
||||||
window.progressView.hide();
|
window.progressView.hide();
|
||||||
|
|
||||||
var time = self.timer.getTimeAndReset()/1000 + " s";
|
var appendSpan = function(value, icon) {
|
||||||
|
$('#outputEditorWrapper' + counter + ' .pull-left').append(
|
||||||
|
'<span><i class="fa ' + icon + '"></i><i>' + value + '</i></span>'
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
if (data.extra) {
|
||||||
|
if (data.extra.stats) {
|
||||||
|
console.log(data.extra.stats);
|
||||||
|
if (data.extra.stats.writesExecuted > 0 || data.extra.stats.writesIgnored > 0) {
|
||||||
|
appendSpan(
|
||||||
|
data.extra.stats.writesExecuted + ' writes', 'fa-check-circle positive'
|
||||||
|
);
|
||||||
|
if (data.extra.stats.writesIgnored === 0) {
|
||||||
|
appendSpan(
|
||||||
|
data.extra.stats.writesIgnored + ' writes ignored', 'fa-check-circle positive'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
appendSpan(
|
||||||
|
data.extra.stats.writesIgnored + ' writes ignored', 'fa-exclamation-circle warning'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (data.extra.stats.scannedFull > 0) {
|
||||||
|
appendSpan(
|
||||||
|
data.extra.stats.scannedFull + ' scanned full', 'fa-exclamation-circle warning'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
appendSpan(
|
||||||
|
data.extra.stats.scannedFull + ' scanned full', 'fa-check-circle positive'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var time = self.timer.getTimeAndReset() / 1000 + " s";
|
||||||
$('#outputEditorWrapper' + counter + ' .queryExecutionTime2').text(time);
|
$('#outputEditorWrapper' + counter + ' .queryExecutionTime2').text(time);
|
||||||
|
|
||||||
self.setEditorAutoHeight(outputEditor);
|
self.setEditorAutoHeight(outputEditor);
|
||||||
|
@ -28881,6 +28934,7 @@ window.ArangoUsers = Backbone.Collection.extend({
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (e) {
|
catch (e) {
|
||||||
|
console.log(e);
|
||||||
arangoHelper.arangoError("Query", "Something went wrong.");
|
arangoHelper.arangoError("Query", "Something went wrong.");
|
||||||
self.removeOutputEditor(counter);
|
self.removeOutputEditor(counter);
|
||||||
}
|
}
|
||||||
|
@ -28997,7 +29051,7 @@ window.ArangoUsers = Backbone.Collection.extend({
|
||||||
}
|
}
|
||||||
}.bind(self);
|
}.bind(self);
|
||||||
self.collection.saveCollectionQueries(callback);
|
self.collection.saveCollectionQueries(callback);
|
||||||
}//TODO
|
}
|
||||||
self.updateLocalQueries();
|
self.updateLocalQueries();
|
||||||
|
|
||||||
if (originCallback) {
|
if (originCallback) {
|
||||||
|
|
Binary file not shown.
|
@ -2585,7 +2585,7 @@ if (list.length > 0) {
|
||||||
<% } %>
|
<% } %>
|
||||||
</div>
|
</div>
|
||||||
<div class="pull-right">
|
<div class="pull-right">
|
||||||
<span><i class="fa fa-close" element="outputEditor<%= counter %>"></i></span>
|
<span class="action"><i class="fa fa-close" element="outputEditor<%= counter %>"></i></span>
|
||||||
</div>
|
</div>
|
||||||
<div class="pull-right">
|
<div class="pull-right">
|
||||||
<% if (type === 'Query') { %>
|
<% if (type === 'Query') { %>
|
||||||
|
|
Binary file not shown.
|
@ -2784,7 +2784,7 @@ if (list.length > 0) {
|
||||||
<% } %>
|
<% } %>
|
||||||
</div>
|
</div>
|
||||||
<div class="pull-right">
|
<div class="pull-right">
|
||||||
<span><i class="fa fa-close" element="outputEditor<%= counter %>"></i></span>
|
<span class="action"><i class="fa fa-close" element="outputEditor<%= counter %>"></i></span>
|
||||||
</div>
|
</div>
|
||||||
<div class="pull-right">
|
<div class="pull-right">
|
||||||
<% if (type === 'Query') { %>
|
<% if (type === 'Query') { %>
|
||||||
|
|
File diff suppressed because one or more lines are too long
Binary file not shown.
|
@ -6046,7 +6046,7 @@ div.headerBar {
|
||||||
padding: 5px 8px;
|
padding: 5px 8px;
|
||||||
position: relative;
|
position: relative;
|
||||||
top: 5px; }
|
top: 5px; }
|
||||||
.arangoToolbar span:hover {
|
.arangoToolbar span.action:hover {
|
||||||
background-color: #8aa051;
|
background-color: #8aa051;
|
||||||
border-radius: 3px;
|
border-radius: 3px;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
|
@ -6061,6 +6061,12 @@ div.headerBar {
|
||||||
.arangoToolbar .pull-left {
|
.arangoToolbar .pull-left {
|
||||||
height: 30px;
|
height: 30px;
|
||||||
margin-top: 5px; }
|
margin-top: 5px; }
|
||||||
|
.arangoToolbar .pull-right i.positive,
|
||||||
|
.arangoToolbar .pull-left i.positive {
|
||||||
|
color: #8aa051; }
|
||||||
|
.arangoToolbar .pull-right i.warning,
|
||||||
|
.arangoToolbar .pull-left i.warning {
|
||||||
|
color: #faa732; }
|
||||||
.arangoToolbar .pull-left button {
|
.arangoToolbar .pull-left button {
|
||||||
margin-left: 5px; }
|
margin-left: 5px; }
|
||||||
.arangoToolbar .pull-right select:first-child,
|
.arangoToolbar .pull-right select:first-child,
|
||||||
|
@ -6070,20 +6076,15 @@ div.headerBar {
|
||||||
font-weight: 100;
|
font-weight: 100;
|
||||||
margin-left: 10px; }
|
margin-left: 10px; }
|
||||||
.arangoToolbar i {
|
.arangoToolbar i {
|
||||||
cursor: pointer;
|
|
||||||
font-size: 11pt;
|
font-size: 11pt;
|
||||||
font-style: normal; }
|
font-style: normal; }
|
||||||
.arangoToolbar i.fa {
|
.arangoToolbar i.fa {
|
||||||
margin-right: 5px; }
|
margin-right: 5px; }
|
||||||
.arangoToolbar i.fa-close {
|
|
||||||
color: #666;
|
|
||||||
cursor: pointer; }
|
|
||||||
.arangoToolbar i.fa-close:hover {
|
|
||||||
color: #000; }
|
|
||||||
.arangoToolbar .toolbarType {
|
.arangoToolbar .toolbarType {
|
||||||
background: #5bc0de;
|
background: #5bc0de;
|
||||||
border-radius: 3px;
|
border-radius: 3px;
|
||||||
color: #fff; }
|
color: #fff;
|
||||||
|
margin-left: 5px; }
|
||||||
.arangoToolbar .styled-select {
|
.arangoToolbar .styled-select {
|
||||||
width: auto; }
|
width: auto; }
|
||||||
|
|
||||||
|
|
Binary file not shown.
Loading…
Reference in New Issue