mirror of https://gitee.com/bigwinds/arangodb
Merge branch 'devel' of https://github.com/arangodb/arangodb into devel
This commit is contained in:
commit
86b7becdb6
|
@ -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:
|
|
|
@ -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:
|
|
|
@ -15,6 +15,11 @@
|
||||||
outputTemplate: templateEngine.createTemplate("queryViewOutput.ejs"),
|
outputTemplate: templateEngine.createTemplate("queryViewOutput.ejs"),
|
||||||
outputCounter: 0,
|
outputCounter: 0,
|
||||||
|
|
||||||
|
currentQuery: {},
|
||||||
|
|
||||||
|
bindParamRegExp: /@(@?)(\w+(\d*))/g,
|
||||||
|
bindParamTableObj: {},
|
||||||
|
|
||||||
bindParamTableDesc: {
|
bindParamTableDesc: {
|
||||||
id: "arangoBindParamTable",
|
id: "arangoBindParamTable",
|
||||||
titles: ["Key", "Value"],
|
titles: ["Key", "Value"],
|
||||||
|
@ -158,19 +163,15 @@
|
||||||
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) {
|
||||||
//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);
|
||||||
|
@ -181,6 +182,7 @@
|
||||||
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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -192,6 +194,7 @@
|
||||||
query: query,
|
query: query,
|
||||||
parameter: vars
|
parameter: vars
|
||||||
};
|
};
|
||||||
|
this.currentQuery = myObject;
|
||||||
localStorage.setItem("cachedQuery", JSON.stringify(myObject));
|
localStorage.setItem("cachedQuery", JSON.stringify(myObject));
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -244,11 +247,79 @@
|
||||||
this.$(this.bindParamId).html(this.table.render({content: this.bindParamTableDesc}));
|
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() {
|
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"},
|
||||||
|
|
|
@ -26,6 +26,9 @@
|
||||||
border-top: none;
|
border-top: none;
|
||||||
|
|
||||||
th {
|
th {
|
||||||
|
font: 13px/normal 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', monospace;
|
||||||
|
height: 17px;
|
||||||
|
padding: 0;
|
||||||
width: 50%;
|
width: 50%;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -62,7 +65,7 @@
|
||||||
|
|
||||||
.outputEditorWrapper {
|
.outputEditorWrapper {
|
||||||
clear: both;
|
clear: both;
|
||||||
height: 300px;
|
height: 100px;
|
||||||
padding-top: 20px;
|
padding-top: 20px;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue