1
0
Fork 0

aardvark, grunt

This commit is contained in:
hkernbach 2016-03-01 11:34:56 +01:00
parent 0d13d6609a
commit f31cee26bd
10 changed files with 89 additions and 31 deletions

View File

@ -330,6 +330,7 @@ controller.post("/job", function(req, res) {
id: req.body().id,
collection: req.body().collection,
type: req.body().type,
model: 'job',
desc: req.body().desc
});
@ -350,8 +351,10 @@ controller.post("/job", function(req, res) {
controller.del("/job/", function(req, res) {
db.aardvark.truncate();
return res.json(true);
db.aardvark.removeByExample({
model: 'job'
}, true);
res.json(true);
}).summary("Store job id of a running job")
.notes("This function stores a job id into a system collection.");

View File

@ -27642,7 +27642,7 @@ window.ArangoUsers = Backbone.Collection.extend({
myQueriesTableDesc: {
id: "arangoMyQueriesTable",
titles: ["Name", "Query", "Actions"],
titles: ["Name", "Actions"],
rows: []
},
@ -27815,6 +27815,15 @@ window.ArangoUsers = Backbone.Collection.extend({
$('#bindParamAceEditor').hide();
$('#bindParamEditor').show();
$('#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();
}
else if ($(e.currentTarget).is('span')) {
name = $(e.currentTarget).parent().parent().prev().prev().text();
name = $(e.currentTarget).parent().parent().prev().text();
}
return name;
},
@ -27893,6 +27902,7 @@ window.ArangoUsers = Backbone.Collection.extend({
this.toggleQueries();
}
$('.aqlEditorWrapper').first().width($(window).width() * 0.66);
this.aqlEditor.setValue(this.getCustomQueryValueByName(name));
this.fillBindParamTable(this.getCustomQueryParameterByName(name));
this.updateBindParams();
@ -27932,12 +27942,22 @@ window.ArangoUsers = Backbone.Collection.extend({
},
downloadQueryResult: function(e) {
console.log($(e.currentTarget));
var count = $(e.currentTarget).attr('counter'),
editor = ace.edit("sentQueryEditor" + count),
query = editor.getValue();
console.log(this.bindParamTableObj);
if (query !== '' || query !== undefined || query !== null) {
window.open("query/result/download/" + encodeURIComponent(btoa(JSON.stringify({ query: query }))));
if (Object.keys(this.bindParamTableObj) === 0) {
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 {
arangoHelper.arangoError("Query error", "could not query result.");
@ -27991,6 +28011,8 @@ window.ArangoUsers = Backbone.Collection.extend({
sentQueryEditor.setOption("vScrollBarAlwaysVisible", true);
outputEditor.setReadOnly(true);
sentQueryEditor.setReadOnly(true);
this.setEditorAutoHeight(outputEditor);
this.setEditorAutoHeight(sentQueryEditor);
this.fillExplain(outputEditor, sentQueryEditor, counter);
this.outputCounter++;
@ -28166,7 +28188,6 @@ window.ArangoUsers = Backbone.Collection.extend({
resizeFunction: function() {
if ($('#toggleQueries1').is(':visible')) {
this.aqlEditor.resize();
//fix bind table resizing issues
$('#arangoBindParamTable thead').css('width', $('#bindParamEditor').width());
$('#arangoBindParamTable thead th').css('width', $('#bindParamEditor').width() / 2);
$('#arangoBindParamTable tr').css('width', $('#bindParamEditor').width());
@ -28177,15 +28198,12 @@ window.ArangoUsers = Backbone.Collection.extend({
}
else {
this.queryPreview.resize();
//fix my queries preview table resizing issues TODO
$('#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 tbody').css('height', $('#queryTable').height() - 18);
$('#arangoMyQueriesTable tbody').css('width', $('#queryTable').width());
$('#arangoMyQueriesTable tbody tr').css('width', $('#queryTable').width());
$('#arangoMyQueriesTable tbody td').css('width', $('#queryTable').width() / 3);
$('#arangoMyQueriesTable tbody td .truncate').css('width', $('#queryTable').width() / 3);
$('#arangoMyQueriesTable tbody td').css('width', $('#queryTable').width() / 2);
}
},
@ -28449,11 +28467,7 @@ window.ArangoUsers = Backbone.Collection.extend({
this.myQueriesTableDesc.rows = this.customQueries;
_.each(this.myQueriesTableDesc.rows, function(k) {
k.secondRow = '<div class="truncate">' +
JSON.stringify(self.collection.findWhere({name: k.name}).get('value')) +
'</div>';
k.thirdRow = '<span class="spanWrapper">' +
k.secondRow = '<span class="spanWrapper">' +
'<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="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({
name: val.name,
secondRow: '<div class="truncate">' + val.value + '</div>',
thirdRow: '<span class="spanWrapper">' +
'<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");
sentQueryEditor.setFontSize("13px");
sentQueryEditor.setReadOnly(true);
this.setEditorAutoHeight(outputEditor);
this.setEditorAutoHeight(sentQueryEditor);
this.fillResult(outputEditor, sentQueryEditor, counter);
this.outputCounter++;
@ -28766,7 +28781,8 @@ window.ArangoUsers = Backbone.Collection.extend({
setEditorAutoHeight: function (editor) {
editor.setOptions({
maxLines: Infinity
maxLines: 100,
minLines: 3
});
},
@ -28834,7 +28850,44 @@ window.ArangoUsers = Backbone.Collection.extend({
warningsFunc(data);
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);
self.setEditorAutoHeight(outputEditor);
@ -28881,6 +28934,7 @@ window.ArangoUsers = Backbone.Collection.extend({
}
}
catch (e) {
console.log(e);
arangoHelper.arangoError("Query", "Something went wrong.");
self.removeOutputEditor(counter);
}
@ -28997,7 +29051,7 @@ window.ArangoUsers = Backbone.Collection.extend({
}
}.bind(self);
self.collection.saveCollectionQueries(callback);
}//TODO
}
self.updateLocalQueries();
if (originCallback) {

View File

@ -2585,7 +2585,7 @@ if (list.length > 0) {
<% } %>
</div>
<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 class="pull-right">
<% if (type === 'Query') { %>

View File

@ -2784,7 +2784,7 @@ if (list.length > 0) {
<% } %>
</div>
<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 class="pull-right">
<% if (type === 'Query') { %>

File diff suppressed because one or more lines are too long

View File

@ -6046,7 +6046,7 @@ div.headerBar {
padding: 5px 8px;
position: relative;
top: 5px; }
.arangoToolbar span:hover {
.arangoToolbar span.action:hover {
background-color: #8aa051;
border-radius: 3px;
color: #fff;
@ -6061,6 +6061,12 @@ div.headerBar {
.arangoToolbar .pull-left {
height: 30px;
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 {
margin-left: 5px; }
.arangoToolbar .pull-right select:first-child,
@ -6070,20 +6076,15 @@ div.headerBar {
font-weight: 100;
margin-left: 10px; }
.arangoToolbar i {
cursor: pointer;
font-size: 11pt;
font-style: normal; }
.arangoToolbar i.fa {
margin-right: 5px; }
.arangoToolbar i.fa-close {
color: #666;
cursor: pointer; }
.arangoToolbar i.fa-close:hover {
color: #000; }
.arangoToolbar .toolbarType {
background: #5bc0de;
border-radius: 3px;
color: #fff; }
color: #fff;
margin-left: 5px; }
.arangoToolbar .styled-select {
width: auto; }