1
0
Fork 0

Merge branch 'devel' of https://github.com/arangodb/arangodb into devel

This commit is contained in:
jsteemann 2016-02-25 00:00:42 +01:00
commit 86b7becdb6
4 changed files with 82 additions and 157 deletions

View File

@ -1,109 +0,0 @@
# -*- mode: Makefile; -*-
## -----------------------------------------------------------------------------
## --SECTION-- PROGRAM
## -----------------------------------------------------------------------------
################################################################################
### @brief program "arangob"
################################################################################
bin_arangob_CPPFLAGS = \
-I@top_srcdir@/arangosh \
$(AM_CPPFLAGS)
bin_arangob_LDADD = \
lib/libarango_client.a \
lib/libarango.a \
$(LIBS)
bin_arangob_SOURCES = \
lib/Basics/WorkMonitorDummy.cpp \
arangosh/ArangoShell/ArangoClient.cpp \
arangosh/Benchmark/arangob.cpp
################################################################################
### @brief program "arangodump"
################################################################################
bin_arangodump_CPPFLAGS = \
-I@top_srcdir@/arangosh \
$(AM_CPPFLAGS)
bin_arangodump_LDADD = \
lib/libarango_client.a \
lib/libarango.a \
$(LIBS)
bin_arangodump_SOURCES = \
lib/Basics/WorkMonitorDummy.cpp \
arangosh/ArangoShell/ArangoClient.cpp \
arangosh/V8Client/arangodump.cpp
################################################################################
### @brief program "arangoimp"
################################################################################
bin_arangoimp_CPPFLAGS = \
-I@top_srcdir@/arangosh \
$(AM_CPPFLAGS)
bin_arangoimp_LDADD = \
lib/libarango_client.a \
lib/libarango.a \
$(LIBS)
bin_arangoimp_SOURCES = \
lib/Basics/WorkMonitorDummy.cpp \
arangosh/ArangoShell/ArangoClient.cpp \
arangosh/V8Client/ImportHelper.cpp \
arangosh/V8Client/arangoimp.cpp
################################################################################
### @brief program "arangorestore"
################################################################################
bin_arangorestore_CPPFLAGS = \
-I@top_srcdir@/arangosh \
$(AM_CPPFLAGS)
bin_arangorestore_LDADD = \
lib/libarango_client.a \
lib/libarango.a \
$(LIBS)
bin_arangorestore_SOURCES = \
lib/Basics/WorkMonitorDummy.cpp \
arangosh/ArangoShell/ArangoClient.cpp \
arangosh/V8Client/arangorestore.cpp
################################################################################
### @brief program "arangosh"
################################################################################
bin_arangosh_CPPFLAGS = \
-I@top_srcdir@/arangosh \
$(AM_CPPFLAGS)
bin_arangosh_LDADD = \
lib/libarango_v8.a \
lib/libarango_client.a \
lib/libarango.a \
$(LIBS) \
@V8_LIBS@
bin_arangosh_SOURCES = \
lib/Basics/WorkMonitorDummy.cpp \
arangosh/ArangoShell/ArangoClient.cpp \
arangosh/V8Client/ImportHelper.cpp \
arangosh/V8Client/V8ClientConnection.cpp \
arangosh/V8Client/arangosh.cpp
## -----------------------------------------------------------------------------
## --SECTION-- END-OF-FILE
## -----------------------------------------------------------------------------
## Local Variables:
## mode: outline-minor
## outline-regexp: "^\\(### @brief\\|## --SECTION--\\|# -\\*- \\)"
## End:

View File

@ -1,40 +0,0 @@
# -*- mode: Makefile; -*-
## -----------------------------------------------------------------------------
## --SECTION-- CONFIGURATION FILES
## -----------------------------------------------------------------------------
BUILT_SOURCES += \
etc/arangodb/arango-dfdb$(PROGRAM_SUFFIX).conf \
etc/arangodb/arangob$(PROGRAM_SUFFIX).conf \
etc/arangodb/arangod$(PROGRAM_SUFFIX).conf \
etc/arangodb/arangod-docker$(PROGRAM_SUFFIX).conf \
etc/arangodb/arangodump$(PROGRAM_SUFFIX).conf \
etc/arangodb/arangoimp$(PROGRAM_SUFFIX).conf \
etc/arangodb/arangorestore$(PROGRAM_SUFFIX).conf \
etc/arangodb/arangosh$(PROGRAM_SUFFIX).conf \
etc/arangodb/foxx-manager$(PROGRAM_SUFFIX).conf
################################################################################
### @brief config
################################################################################
etc/arangodb/%$(PROGRAM_SUFFIX).conf: etc/arangodb/%.conf.in Makefile
@test -d etc/arangodb || mkdir -p etc/arangodb
sed \
-e 's%@LIBEXECDIR@%${TRI_LIBEXECDIR}%g' \
-e 's%@SBINDIR@%${TRI_SBINDIR}%g' \
-e 's%@LOCALSTATEDIR@%${TRI_LOCALSTATEDIR}%g' \
-e 's%@PKGDATADIR@%${TRI_PKGDATADIR}%g' \
-e 's%@SYSCONFDIR@%${TRI_SYSCONFDIR}%g' \
-e 's%@PROGRAM_SUFFIX@%${PROGRAM_SUFFIX}%g' \
$< > $@
## -----------------------------------------------------------------------------
## --SECTION-- END-OF-FILE
## -----------------------------------------------------------------------------
## Local Variables:
## mode: outline-minor
## outline-regexp: "^\\(### @brief\\|## --SECTION--\\|# -\\*- \\)"
## End:

View File

@ -15,6 +15,11 @@
outputTemplate: templateEngine.createTemplate("queryViewOutput.ejs"),
outputCounter: 0,
currentQuery: {},
bindParamRegExp: /@(@?)(\w+(\d*))/g,
bindParamTableObj: {},
bindParamTableDesc: {
id: "arangoBindParamTable",
titles: ["Key", "Value"],
@ -158,19 +163,15 @@
getCachedQueryAfterRender: function() {
//get cached query if available
var queryObject = this.getCachedQuery();
console.log(queryObject);
if (queryObject !== null && queryObject !== undefined && queryObject !== "") {
this.aqlEditor.setValue(queryObject.query);
if (queryObject.parameter === '' || queryObject === undefined) {
if (queryObject.parameter !== '' || queryObject !== undefined) {
//TODO update bind param table
//varsEditor.setValue('{}');
}
else {
//TODO update bind param table
//varsEditor.setValue(queryObject.parameter);
}
}
var a = this.aqlEditor.getValue();
if (a.length === 1) {
if (a.length === 1 | a.length === 0) {
a = "";
}
this.setCachedQuery(a);
@ -181,6 +182,7 @@
var cache = localStorage.getItem("cachedQuery");
if (cache !== undefined) {
var query = JSON.parse(cache);
this.currentQuery = query;
return query;
}
}
@ -192,6 +194,7 @@
query: query,
parameter: vars
};
this.currentQuery = myObject;
localStorage.setItem("cachedQuery", JSON.stringify(myObject));
}
},
@ -244,11 +247,79 @@
this.$(this.bindParamId).html(this.table.render({content: this.bindParamTableDesc}));
},
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++;
});
words.sort();
_.each(words1, function(word) {
//found a valid bind param expression
if (self.bindParamRegExp.test(word)) {
//if property is not available
if (!_.has(self.bindParamTableObj, word)) {
self.bindParamTableObj[word] = '';
}
}
});
var newObject = {};
Object.keys(self.bindParamTableObj).forEach(function(key) {
_.each(words1, function(word) {
if (word === key) {
if (self.bindParamTableObj[key] !== '') {
newObject[key] = self.bindParamTableObj[key];
}
else {
newObject[key] = '';
}
}
});
});
self.bindParamTableObj = newObject;
},
renderBindParamTable: function() {
$('#arangoBindParamTable tbody').html('');
_.each(this.bindParamTableObj, function(val, key) {
$('#arangoBindParamTable tbody').append(
"<tr>" +
"<td>" + key + "</td>" +
"<td><input>" + val + "</input></td>" +
"</tr>"
);
});
},
initAce: function() {
var self = this;
//init aql editor
this.aqlEditor = ace.edit("aqlEditor");
this.aqlEditor.getSession().setMode("ace/mode/aql");
this.aqlEditor.setFontSize("13px");
this.aqlEditor.getSession().on('change', function() {
self.checkForNewBindParams();
self.renderBindParamTable();
});
this.aqlEditor.commands.addCommand({
name: "togglecomment",
bindKey: {win: "Ctrl-Shift-C", linux: "Ctrl-Shift-C", mac: "Command-Shift-C"},

View File

@ -26,6 +26,9 @@
border-top: none;
th {
font: 13px/normal 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', monospace;
height: 17px;
padding: 0;
width: 50%;
}
}
@ -62,7 +65,7 @@
.outputEditorWrapper {
clear: both;
height: 300px;
height: 100px;
padding-top: 20px;
width: 100%;