mirror of https://gitee.com/bigwinds/arangodb
Merge branch 'devel' of github.com:arangodb/arangodb into solaris
This commit is contained in:
commit
d7bd642ed1
|
@ -27590,6 +27590,11 @@ window.ArangoUsers = Backbone.Collection.extend({
|
||||||
outputTemplate: templateEngine.createTemplate("queryViewOutput.ejs"),
|
outputTemplate: templateEngine.createTemplate("queryViewOutput.ejs"),
|
||||||
outputCounter: 0,
|
outputCounter: 0,
|
||||||
|
|
||||||
|
currentQuery: {},
|
||||||
|
|
||||||
|
bindParamRegExp: /@(@?)(\w+(\d*))/,
|
||||||
|
bindParamTableObj: {},
|
||||||
|
|
||||||
bindParamTableDesc: {
|
bindParamTableDesc: {
|
||||||
id: "arangoBindParamTable",
|
id: "arangoBindParamTable",
|
||||||
titles: ["Key", "Value"],
|
titles: ["Key", "Value"],
|
||||||
|
@ -27611,7 +27616,8 @@ window.ArangoUsers = Backbone.Collection.extend({
|
||||||
"click #clearQuery": "clearQuery",
|
"click #clearQuery": "clearQuery",
|
||||||
'click .outputEditorWrapper #downloadQueryResult': 'downloadQueryResult',
|
'click .outputEditorWrapper #downloadQueryResult': 'downloadQueryResult',
|
||||||
'click .outputEditorWrapper .switchAce': 'switchAce',
|
'click .outputEditorWrapper .switchAce': 'switchAce',
|
||||||
"click .outputEditorWrapper .fa-close": "closeResult"
|
"click .outputEditorWrapper .fa-close": "closeResult",
|
||||||
|
"change #arangoBindParamTable input": "updateBindParams"
|
||||||
},
|
},
|
||||||
|
|
||||||
clearQuery: function() {
|
clearQuery: function() {
|
||||||
|
@ -27677,7 +27683,7 @@ window.ArangoUsers = Backbone.Collection.extend({
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.$(this.outputDiv).append(this.outputTemplate.render({
|
this.$(this.outputDiv).prepend(this.outputTemplate.render({
|
||||||
counter: this.outputCounter,
|
counter: this.outputCounter,
|
||||||
type: "Explain"
|
type: "Explain"
|
||||||
}));
|
}));
|
||||||
|
@ -27735,17 +27741,12 @@ window.ArangoUsers = Backbone.Collection.extend({
|
||||||
var queryObject = this.getCachedQuery();
|
var queryObject = this.getCachedQuery();
|
||||||
if (queryObject !== null && queryObject !== undefined && queryObject !== "") {
|
if (queryObject !== null && queryObject !== undefined && queryObject !== "") {
|
||||||
this.aqlEditor.setValue(queryObject.query);
|
this.aqlEditor.setValue(queryObject.query);
|
||||||
if (queryObject.parameter === '' || queryObject === undefined) {
|
if (queryObject.parameter !== '' || queryObject !== undefined) {
|
||||||
//TODO update bind param table
|
//TODO update bind param table
|
||||||
//varsEditor.setValue('{}');
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
//TODO update bind param table
|
|
||||||
//varsEditor.setValue(queryObject.parameter);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
var a = this.aqlEditor.getValue();
|
var a = this.aqlEditor.getValue();
|
||||||
if (a.length === 1) {
|
if (a.length === 1 | a.length === 0) {
|
||||||
a = "";
|
a = "";
|
||||||
}
|
}
|
||||||
this.setCachedQuery(a);
|
this.setCachedQuery(a);
|
||||||
|
@ -27756,6 +27757,7 @@ window.ArangoUsers = Backbone.Collection.extend({
|
||||||
var cache = localStorage.getItem("cachedQuery");
|
var cache = localStorage.getItem("cachedQuery");
|
||||||
if (cache !== undefined) {
|
if (cache !== undefined) {
|
||||||
var query = JSON.parse(cache);
|
var query = JSON.parse(cache);
|
||||||
|
this.currentQuery = query;
|
||||||
return query;
|
return query;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -27767,6 +27769,7 @@ window.ArangoUsers = Backbone.Collection.extend({
|
||||||
query: query,
|
query: query,
|
||||||
parameter: vars
|
parameter: vars
|
||||||
};
|
};
|
||||||
|
this.currentQuery = myObject;
|
||||||
localStorage.setItem("cachedQuery", JSON.stringify(myObject));
|
localStorage.setItem("cachedQuery", JSON.stringify(myObject));
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -27798,32 +27801,128 @@ window.ArangoUsers = Backbone.Collection.extend({
|
||||||
},
|
},
|
||||||
|
|
||||||
makeResizeable: function() {
|
makeResizeable: function() {
|
||||||
|
|
||||||
var self = this;
|
var self = this;
|
||||||
|
|
||||||
|
var resizeFunction = function() {
|
||||||
|
self.aqlEditor.resize();
|
||||||
|
$('#arangoBindParamTable thead').css('width', $('#bindParamEditor').width());
|
||||||
|
$('#arangoBindParamTable thead th').css('width', $('#bindParamEditor').width() / 2);
|
||||||
|
$('#arangoBindParamTable tr').css('width', $('#bindParamEditor').width());
|
||||||
|
$('#arangoBindParamTable tbody').css('height', $('#aqlEditor').height() - 18);
|
||||||
|
$('#arangoBindParamTable tbody').css('width', $('#bindParamEditor').width());
|
||||||
|
$('#arangoBindParamTable tbody tr').css('width', $('#bindParamEditor').width());
|
||||||
|
$('#arangoBindParamTable tbody td').css('width', $('#bindParamEditor').width() / 2);
|
||||||
|
};
|
||||||
|
|
||||||
$(".aqlEditorWrapper").resizable({
|
$(".aqlEditorWrapper").resizable({
|
||||||
resize: function() {
|
resize: function() {
|
||||||
self.aqlEditor.resize();
|
resizeFunction();
|
||||||
},
|
},
|
||||||
handles: "e"
|
handles: "e"
|
||||||
});
|
});
|
||||||
|
|
||||||
$(".inputEditorWrapper").resizable({
|
$(".inputEditorWrapper").resizable({
|
||||||
resize: function() {
|
resize: function() {
|
||||||
self.aqlEditor.resize();
|
resizeFunction();
|
||||||
},
|
},
|
||||||
handles: "s"
|
handles: "s"
|
||||||
});
|
});
|
||||||
|
|
||||||
|
//one manual start
|
||||||
|
resizeFunction();
|
||||||
},
|
},
|
||||||
|
|
||||||
initBindParamTable: function() {
|
initBindParamTable: function() {
|
||||||
this.$(this.bindParamId).html(this.table.render({content: this.bindParamTableDesc}));
|
this.$(this.bindParamId).html(this.table.render({content: this.bindParamTableDesc}));
|
||||||
},
|
},
|
||||||
|
|
||||||
|
updateBindParams: function(e) {
|
||||||
|
var id = $(e.currentTarget).attr("name");
|
||||||
|
this.bindParamTableObj[id] = $(e.currentTarget).val();
|
||||||
|
},
|
||||||
|
|
||||||
|
checkForNewBindParams: function() {
|
||||||
|
var self = this,
|
||||||
|
words = (this.aqlEditor.getValue()).split(" "),
|
||||||
|
words1 = [],
|
||||||
|
pos = 0;
|
||||||
|
|
||||||
|
_.each(words, function(word) {
|
||||||
|
word = word.split("\n");
|
||||||
|
_.each(word, function(x) {
|
||||||
|
words1.push(x);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
_.each(words1, function(word) {
|
||||||
|
// remove newlines and whitespaces
|
||||||
|
words[pos] = word.replace(/(\r\n|\n|\r)/gm,"");
|
||||||
|
pos++;
|
||||||
|
});
|
||||||
|
words1.sort();
|
||||||
|
|
||||||
|
var newObject = {};
|
||||||
|
_.each(words1, function(word) {
|
||||||
|
//found a valid bind param expression
|
||||||
|
if (self.bindParamRegExp.test(word)) {
|
||||||
|
//if property is not available
|
||||||
|
newObject[word] = '';
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
Object.keys(newObject).forEach(function(keyNew) {
|
||||||
|
Object.keys(self.bindParamTableObj).forEach(function(keyOld) {
|
||||||
|
if (keyNew === keyOld) {
|
||||||
|
newObject[keyNew] = self.bindParamTableObj[keyOld];
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
self.bindParamTableObj = newObject;
|
||||||
|
},
|
||||||
|
|
||||||
|
renderBindParamTable: function() {
|
||||||
|
var self = this;
|
||||||
|
|
||||||
|
$('#arangoBindParamTable tbody').html('');
|
||||||
|
|
||||||
|
var counter = 0;
|
||||||
|
_.each(this.bindParamTableObj, function(val, key) {
|
||||||
|
$('#arangoBindParamTable tbody').append(
|
||||||
|
"<tr>" +
|
||||||
|
"<td>" + key + "</td>" +
|
||||||
|
'<td><input name=' + key + ' type="text"></input></td>' +
|
||||||
|
"</tr>"
|
||||||
|
);
|
||||||
|
counter ++;
|
||||||
|
_.each($('#arangoBindParamTable input'), function(element) {
|
||||||
|
if ($(element).attr('name') === key) {
|
||||||
|
$(element).val(val);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
if (counter === 0) {
|
||||||
|
$('#arangoBindParamTable tbody').append(
|
||||||
|
'<tr class="noBgColor">' +
|
||||||
|
"<td>No bind parameters defined.</td>" +
|
||||||
|
'<td></td>' +
|
||||||
|
"</tr>"
|
||||||
|
);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
initAce: function() {
|
initAce: function() {
|
||||||
|
|
||||||
|
var self = this;
|
||||||
|
|
||||||
//init aql editor
|
//init aql editor
|
||||||
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("13px");
|
this.aqlEditor.setFontSize("13px");
|
||||||
|
this.aqlEditor.getSession().on('change', function() {
|
||||||
|
self.checkForNewBindParams();
|
||||||
|
self.renderBindParamTable();
|
||||||
|
});
|
||||||
this.aqlEditor.commands.addCommand({
|
this.aqlEditor.commands.addCommand({
|
||||||
name: "togglecomment",
|
name: "togglecomment",
|
||||||
bindKey: {win: "Ctrl-Shift-C", linux: "Ctrl-Shift-C", mac: "Command-Shift-C"},
|
bindKey: {win: "Ctrl-Shift-C", linux: "Ctrl-Shift-C", mac: "Command-Shift-C"},
|
||||||
|
@ -27838,11 +27937,11 @@ window.ArangoUsers = Backbone.Collection.extend({
|
||||||
},
|
},
|
||||||
|
|
||||||
afterRender: function() {
|
afterRender: function() {
|
||||||
this.makeResizeable();
|
|
||||||
this.initAce();
|
this.initAce();
|
||||||
this.initBindParamTable();
|
this.initBindParamTable();
|
||||||
this.getCachedQueryAfterRender();
|
this.getCachedQueryAfterRender();
|
||||||
this.fillSelectBoxes();
|
this.fillSelectBoxes();
|
||||||
|
this.makeResizeable();
|
||||||
|
|
||||||
//set height of editor wrapper
|
//set height of editor wrapper
|
||||||
$('.inputEditorWrapper').height($(window).height() / 10 * 3);
|
$('.inputEditorWrapper').height($(window).height() / 10 * 3);
|
||||||
|
@ -27893,7 +27992,7 @@ window.ArangoUsers = Backbone.Collection.extend({
|
||||||
bindVars = JSON.parse(bindVars);
|
bindVars = JSON.parse(bindVars);
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
console.log("could not parse bind parameter");
|
arangoHelper.arangoError("Query", "Could not parse bind parameter");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.collection.add({
|
this.collection.add({
|
||||||
|
|
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
|
@ -2203,7 +2203,7 @@ div.queryline .fa.fa-search:hover {
|
||||||
.navbar .arango-collection-select, div.queryline select,
|
.navbar .arango-collection-select, div.queryline select,
|
||||||
div.queryline input, input.search-input, .modal-body .select2-choices input, .modal-body input,
|
div.queryline input, input.search-input, .modal-body .select2-choices input, .modal-body input,
|
||||||
.modal-body select,
|
.modal-body select,
|
||||||
.modal-body textarea, .login-window .login-input {
|
.modal-body textarea, .login-window .login-input, .inputEditorWrapper .bindParamEditorWrapper table td input {
|
||||||
-moz-border-radius: 3px;
|
-moz-border-radius: 3px;
|
||||||
-webkit-border-radius: 3px;
|
-webkit-border-radius: 3px;
|
||||||
border-radius: 3px;
|
border-radius: 3px;
|
||||||
|
@ -2216,7 +2216,7 @@ div.queryline input, input.search-input, .modal-body .select2-choices input, .mo
|
||||||
.navbar .arango-collection-select:focus, div.queryline select:focus,
|
.navbar .arango-collection-select:focus, div.queryline select:focus,
|
||||||
div.queryline input:focus, input.search-input:focus, .modal-body input:focus,
|
div.queryline input:focus, input.search-input:focus, .modal-body input:focus,
|
||||||
.modal-body select:focus,
|
.modal-body select:focus,
|
||||||
.modal-body textarea:focus, .login-window .login-input:focus {
|
.modal-body textarea:focus, .login-window .login-input:focus, .inputEditorWrapper .bindParamEditorWrapper table td input:focus {
|
||||||
border-color: #999;
|
border-color: #999;
|
||||||
box-shadow: none;
|
box-shadow: none;
|
||||||
outline: none;
|
outline: none;
|
||||||
|
@ -6787,8 +6787,30 @@ toolbar {
|
||||||
background: #eee;
|
background: #eee;
|
||||||
overflow: hidden; }
|
overflow: hidden; }
|
||||||
.inputEditorWrapper .bindParamEditorWrapper table {
|
.inputEditorWrapper .bindParamEditorWrapper table {
|
||||||
border-top: none; }
|
border-top: 0;
|
||||||
|
font: 13px/normal Monaco,Menlo,'Ubuntu Mono',Consolas,source-code-pro,monospace; }
|
||||||
|
.inputEditorWrapper .bindParamEditorWrapper table tbody {
|
||||||
|
display: block;
|
||||||
|
overflow-y: auto; }
|
||||||
|
.inputEditorWrapper .bindParamEditorWrapper table tr.noBgColor {
|
||||||
|
background-color: transparent !important; }
|
||||||
|
.inputEditorWrapper .bindParamEditorWrapper table thead {
|
||||||
|
display: block; }
|
||||||
|
.inputEditorWrapper .bindParamEditorWrapper table td {
|
||||||
|
padding: 0 5px;
|
||||||
|
width: 50%; }
|
||||||
|
.inputEditorWrapper .bindParamEditorWrapper table td input {
|
||||||
|
clear: both;
|
||||||
|
float: right;
|
||||||
|
font: 13px/normal Monaco,Menlo,'Ubuntu Mono',Consolas,source-code-pro,monospace !important;
|
||||||
|
height: 17px;
|
||||||
|
margin-bottom: 3px;
|
||||||
|
margin-top: 3px;
|
||||||
|
width: auto !important; }
|
||||||
.inputEditorWrapper .bindParamEditorWrapper table th {
|
.inputEditorWrapper .bindParamEditorWrapper table th {
|
||||||
|
font: 13px/normal 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', monospace;
|
||||||
|
height: 17px;
|
||||||
|
padding: 0;
|
||||||
width: 50%; }
|
width: 50%; }
|
||||||
.inputEditorWrapper .aqlEditorWrapper,
|
.inputEditorWrapper .aqlEditorWrapper,
|
||||||
.inputEditorWrapper .bindParamEditorWrapper {
|
.inputEditorWrapper .bindParamEditorWrapper {
|
||||||
|
@ -6811,7 +6833,7 @@ toolbar {
|
||||||
|
|
||||||
.outputEditorWrapper {
|
.outputEditorWrapper {
|
||||||
clear: both;
|
clear: both;
|
||||||
height: 300px;
|
height: 100px;
|
||||||
padding-top: 20px;
|
padding-top: 20px;
|
||||||
width: 100%; }
|
width: 100%; }
|
||||||
.outputEditorWrapper .switchAce {
|
.outputEditorWrapper .switchAce {
|
||||||
|
|
Binary file not shown.
|
@ -17,7 +17,7 @@
|
||||||
|
|
||||||
currentQuery: {},
|
currentQuery: {},
|
||||||
|
|
||||||
bindParamRegExp: /@(@?)(\w+(\d*))/g,
|
bindParamRegExp: /@(@?)(\w+(\d*))/,
|
||||||
bindParamTableObj: {},
|
bindParamTableObj: {},
|
||||||
|
|
||||||
bindParamTableDesc: {
|
bindParamTableDesc: {
|
||||||
|
@ -41,7 +41,8 @@
|
||||||
"click #clearQuery": "clearQuery",
|
"click #clearQuery": "clearQuery",
|
||||||
'click .outputEditorWrapper #downloadQueryResult': 'downloadQueryResult',
|
'click .outputEditorWrapper #downloadQueryResult': 'downloadQueryResult',
|
||||||
'click .outputEditorWrapper .switchAce': 'switchAce',
|
'click .outputEditorWrapper .switchAce': 'switchAce',
|
||||||
"click .outputEditorWrapper .fa-close": "closeResult"
|
"click .outputEditorWrapper .fa-close": "closeResult",
|
||||||
|
"change #arangoBindParamTable input": "updateBindParams"
|
||||||
},
|
},
|
||||||
|
|
||||||
clearQuery: function() {
|
clearQuery: function() {
|
||||||
|
@ -107,7 +108,7 @@
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.$(this.outputDiv).append(this.outputTemplate.render({
|
this.$(this.outputDiv).prepend(this.outputTemplate.render({
|
||||||
counter: this.outputCounter,
|
counter: this.outputCounter,
|
||||||
type: "Explain"
|
type: "Explain"
|
||||||
}));
|
}));
|
||||||
|
@ -163,7 +164,6 @@
|
||||||
getCachedQueryAfterRender: function() {
|
getCachedQueryAfterRender: function() {
|
||||||
//get cached query if available
|
//get cached query if available
|
||||||
var queryObject = this.getCachedQuery();
|
var queryObject = this.getCachedQuery();
|
||||||
console.log(queryObject);
|
|
||||||
if (queryObject !== null && queryObject !== undefined && queryObject !== "") {
|
if (queryObject !== null && queryObject !== undefined && queryObject !== "") {
|
||||||
this.aqlEditor.setValue(queryObject.query);
|
this.aqlEditor.setValue(queryObject.query);
|
||||||
//if (queryObject.parameter !== '' || queryObject !== undefined) {
|
//if (queryObject.parameter !== '' || queryObject !== undefined) {
|
||||||
|
@ -226,27 +226,47 @@
|
||||||
},
|
},
|
||||||
|
|
||||||
makeResizeable: function() {
|
makeResizeable: function() {
|
||||||
|
|
||||||
var self = this;
|
var self = this;
|
||||||
|
|
||||||
|
var resizeFunction = function() {
|
||||||
|
self.aqlEditor.resize();
|
||||||
|
$('#arangoBindParamTable thead').css('width', $('#bindParamEditor').width());
|
||||||
|
$('#arangoBindParamTable thead th').css('width', $('#bindParamEditor').width() / 2);
|
||||||
|
$('#arangoBindParamTable tr').css('width', $('#bindParamEditor').width());
|
||||||
|
$('#arangoBindParamTable tbody').css('height', $('#aqlEditor').height() - 18);
|
||||||
|
$('#arangoBindParamTable tbody').css('width', $('#bindParamEditor').width());
|
||||||
|
$('#arangoBindParamTable tbody tr').css('width', $('#bindParamEditor').width());
|
||||||
|
$('#arangoBindParamTable tbody td').css('width', $('#bindParamEditor').width() / 2);
|
||||||
|
};
|
||||||
|
|
||||||
$(".aqlEditorWrapper").resizable({
|
$(".aqlEditorWrapper").resizable({
|
||||||
resize: function() {
|
resize: function() {
|
||||||
self.aqlEditor.resize();
|
resizeFunction();
|
||||||
},
|
},
|
||||||
handles: "e"
|
handles: "e"
|
||||||
});
|
});
|
||||||
|
|
||||||
$(".inputEditorWrapper").resizable({
|
$(".inputEditorWrapper").resizable({
|
||||||
resize: function() {
|
resize: function() {
|
||||||
self.aqlEditor.resize();
|
resizeFunction();
|
||||||
},
|
},
|
||||||
handles: "s"
|
handles: "s"
|
||||||
});
|
});
|
||||||
|
|
||||||
|
//one manual start
|
||||||
|
resizeFunction();
|
||||||
},
|
},
|
||||||
|
|
||||||
initBindParamTable: function() {
|
initBindParamTable: function() {
|
||||||
this.$(this.bindParamId).html(this.table.render({content: this.bindParamTableDesc}));
|
this.$(this.bindParamId).html(this.table.render({content: this.bindParamTableDesc}));
|
||||||
},
|
},
|
||||||
|
|
||||||
|
updateBindParams: function(e) {
|
||||||
|
var id = $(e.currentTarget).attr("name");
|
||||||
|
this.bindParamTableObj[id] = $(e.currentTarget).val();
|
||||||
|
},
|
||||||
|
|
||||||
checkForNewBindParams: function() {
|
checkForNewBindParams: function() {
|
||||||
var self = this,
|
var self = this,
|
||||||
words = (this.aqlEditor.getValue()).split(" "),
|
words = (this.aqlEditor.getValue()).split(" "),
|
||||||
|
@ -265,47 +285,55 @@
|
||||||
words[pos] = word.replace(/(\r\n|\n|\r)/gm,"");
|
words[pos] = word.replace(/(\r\n|\n|\r)/gm,"");
|
||||||
pos++;
|
pos++;
|
||||||
});
|
});
|
||||||
words.sort();
|
words1.sort();
|
||||||
|
|
||||||
|
var newObject = {};
|
||||||
_.each(words1, function(word) {
|
_.each(words1, function(word) {
|
||||||
//found a valid bind param expression
|
//found a valid bind param expression
|
||||||
if (self.bindParamRegExp.test(word)) {
|
if (self.bindParamRegExp.test(word)) {
|
||||||
|
|
||||||
//if property is not available
|
//if property is not available
|
||||||
if (!_.has(self.bindParamTableObj, word)) {
|
newObject[word] = '';
|
||||||
self.bindParamTableObj[word] = '';
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
var newObject = {};
|
Object.keys(newObject).forEach(function(keyNew) {
|
||||||
Object.keys(self.bindParamTableObj).forEach(function(key) {
|
Object.keys(self.bindParamTableObj).forEach(function(keyOld) {
|
||||||
_.each(words1, function(word) {
|
if (keyNew === keyOld) {
|
||||||
if (word === key) {
|
newObject[keyNew] = self.bindParamTableObj[keyOld];
|
||||||
if (self.bindParamTableObj[key] !== '') {
|
|
||||||
newObject[key] = self.bindParamTableObj[key];
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
newObject[key] = '';
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
self.bindParamTableObj = newObject;
|
self.bindParamTableObj = newObject;
|
||||||
},
|
},
|
||||||
|
|
||||||
renderBindParamTable: function() {
|
renderBindParamTable: function() {
|
||||||
|
var self = this;
|
||||||
|
|
||||||
$('#arangoBindParamTable tbody').html('');
|
$('#arangoBindParamTable tbody').html('');
|
||||||
|
|
||||||
|
var counter = 0;
|
||||||
_.each(this.bindParamTableObj, function(val, key) {
|
_.each(this.bindParamTableObj, function(val, key) {
|
||||||
$('#arangoBindParamTable tbody').append(
|
$('#arangoBindParamTable tbody').append(
|
||||||
"<tr>" +
|
"<tr>" +
|
||||||
"<td>" + key + "</td>" +
|
"<td>" + key + "</td>" +
|
||||||
"<td><input>" + val + "</input></td>" +
|
'<td><input name=' + key + ' type="text"></input></td>' +
|
||||||
"</tr>"
|
"</tr>"
|
||||||
);
|
);
|
||||||
|
counter ++;
|
||||||
|
_.each($('#arangoBindParamTable input'), function(element) {
|
||||||
|
if ($(element).attr('name') === key) {
|
||||||
|
$(element).val(val);
|
||||||
|
}
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
if (counter === 0) {
|
||||||
|
$('#arangoBindParamTable tbody').append(
|
||||||
|
'<tr class="noBgColor">' +
|
||||||
|
"<td>No bind parameters defined.</td>" +
|
||||||
|
'<td></td>' +
|
||||||
|
"</tr>"
|
||||||
|
);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
initAce: function() {
|
initAce: function() {
|
||||||
|
@ -334,11 +362,11 @@
|
||||||
},
|
},
|
||||||
|
|
||||||
afterRender: function() {
|
afterRender: function() {
|
||||||
this.makeResizeable();
|
|
||||||
this.initAce();
|
this.initAce();
|
||||||
this.initBindParamTable();
|
this.initBindParamTable();
|
||||||
this.getCachedQueryAfterRender();
|
this.getCachedQueryAfterRender();
|
||||||
this.fillSelectBoxes();
|
this.fillSelectBoxes();
|
||||||
|
this.makeResizeable();
|
||||||
|
|
||||||
//set height of editor wrapper
|
//set height of editor wrapper
|
||||||
$('.inputEditorWrapper').height($(window).height() / 10 * 3);
|
$('.inputEditorWrapper').height($(window).height() / 10 * 3);
|
||||||
|
@ -389,7 +417,7 @@
|
||||||
bindVars = JSON.parse(bindVars);
|
bindVars = JSON.parse(bindVars);
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
console.log("could not parse bind parameter");
|
arangoHelper.arangoError("Query", "Could not parse bind parameter");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.collection.add({
|
this.collection.add({
|
||||||
|
|
|
@ -20,18 +20,50 @@
|
||||||
|
|
||||||
.bindParamEditorWrapper {
|
.bindParamEditorWrapper {
|
||||||
background: #eee;
|
background: #eee;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
|
||||||
table {
|
table {
|
||||||
border-top: none;
|
border-top: 0;
|
||||||
|
font: 13px/normal Monaco,Menlo,'Ubuntu Mono',Consolas,source-code-pro,monospace;
|
||||||
|
|
||||||
th {
|
tbody {
|
||||||
font: 13px/normal 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', monospace;
|
display: block;
|
||||||
height: 17px;
|
overflow-y: auto;
|
||||||
padding: 0;
|
}
|
||||||
width: 50%;
|
|
||||||
}
|
tr {
|
||||||
}
|
&.noBgColor {
|
||||||
|
background-color: rgba(0, 0, 0, 0) !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
thead {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
td {
|
||||||
|
padding: 0 5px;
|
||||||
|
width: 50%;
|
||||||
|
|
||||||
|
input {
|
||||||
|
@extend %inputs;
|
||||||
|
clear: both;
|
||||||
|
float: right;
|
||||||
|
font: 13px/normal Monaco,Menlo,'Ubuntu Mono',Consolas,source-code-pro,monospace !important;
|
||||||
|
height: 17px;
|
||||||
|
margin-bottom: 3px;
|
||||||
|
margin-top: 3px;
|
||||||
|
width: auto !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
th {
|
||||||
|
font: 13px/normal 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', monospace;
|
||||||
|
height: 17px;
|
||||||
|
padding: 0;
|
||||||
|
width: 50%;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.aqlEditorWrapper,
|
.aqlEditorWrapper,
|
||||||
|
|
Loading…
Reference in New Issue