mirror of https://gitee.com/bigwinds/arangodb
Merge branch 'devel' of github.com:arangodb/ArangoDB into JHMH
This commit is contained in:
commit
2d5d2d881e
|
@ -51,8 +51,8 @@ if ENABLE_V8_DEBUG
|
|||
CXX="$(CXX)" \
|
||||
CXX.host="$(CXX)" \
|
||||
LINK="$(CXX)" \
|
||||
CFLAGS="-O0 -ggdb -fsigned-char -march=armv6 $(DEBUG_V8_FLAGS) $(GOLD_V8_FLAGS)" \
|
||||
CXXFLAGS="-O0 -ggdb -fsigned-char -march=armv6 $(DEBUG_V8_FLAGS) $(GOLD_V8_FLAGS)" \
|
||||
CFLAGS="-O0 -ggdb -fsigned-char -march=armv6 $(DEBUG_V8_FLAGS) $(GOLD_V8_FLAGS) $(STDLIB_FLAGS)" \
|
||||
CXXFLAGS="-O0 -ggdb -fsigned-char -march=armv6 $(DEBUG_V8_FLAGS) $(GOLD_V8_FLAGS) $(STDLIB_FLAGS)" \
|
||||
LDFLAGS="-march=armv6" \
|
||||
debug=on v8_optimized_debug=0 v8_enable_backtrace=on \
|
||||
library=static strictaliasing=off snapshot=off werror=no hardfp=on @V8_TARGET@
|
||||
|
@ -65,8 +65,8 @@ else
|
|||
CXX="$(CXX)" \
|
||||
CXX.host="$(CXX)" \
|
||||
LINK="$(CXX)" \
|
||||
CFLAGS="-O2 -g -fsigned-char -march=armv6 $(GOLD_V8_FLAGS)" \
|
||||
CXXFLAGS="-O2 -g -fsigned-char -march=armv6 $(GOLD_V8_FLAGS)" \
|
||||
CFLAGS="-O2 -g -fsigned-char -march=armv6 $(GOLD_V8_FLAGS) $(STDLIB_FLAGS)" \
|
||||
CXXFLAGS="-O2 -g -fsigned-char -march=armv6 $(GOLD_V8_FLAGS) $(STDLIB_FLAGS)" \
|
||||
LDFLAGS="-march=armv6" \
|
||||
library=static strictaliasing=off snapshot=off werror=no hardfp=on @V8_TARGET@
|
||||
endif
|
||||
|
@ -86,8 +86,8 @@ if ENABLE_V8_DEBUG
|
|||
CXX="$(CXX)" \
|
||||
CXX.host="$(CXX)" \
|
||||
LINK="$(CXX)" \
|
||||
CFLAGS="-O0 -ggdb -fsigned-char -march=armv7 $(DEBUG_V8_FLAGS) $(GOLD_V8_FLAGS)" \
|
||||
CXXFLAGS="-O0 -ggdb -fsigned-char -march=armv7 $(DEBUG_V8_FLAGS) $(GOLD_V8_FLAGS)" \
|
||||
CFLAGS="-O0 -ggdb -fsigned-char -march=armv7 $(DEBUG_V8_FLAGS) $(GOLD_V8_FLAGS) $(STDLIB_FLAGS)" \
|
||||
CXXFLAGS="-O0 -ggdb -fsigned-char -march=armv7 $(DEBUG_V8_FLAGS) $(GOLD_V8_FLAGS) $(STDLIB_FLAGS)" \
|
||||
LDFLAGS="-march=armv7" \
|
||||
debug=on v8_optimized_debug=0 v8_enable_backtrace=on \
|
||||
library=static strictaliasing=off snapshot=off werror=no @V8_TARGET@
|
||||
|
@ -100,8 +100,8 @@ else
|
|||
CXX="$(CXX)" \
|
||||
CXX.host="$(CXX)" \
|
||||
LINK="$(CXX)" \
|
||||
CFLAGS="-O2 -g -fsigned-char -march=armv7 $(GOLD_V8_FLAGS)" \
|
||||
CXXFLAGS="-O2 -g -fsigned-char -march=armv7 $(GOLD_V8_FLAGS)" \
|
||||
CFLAGS="-O2 -g -fsigned-char -march=armv7 $(GOLD_V8_FLAGS) $(STDLIB_FLAGS)" \
|
||||
CXXFLAGS="-O2 -g -fsigned-char -march=armv7 $(GOLD_V8_FLAGS) $(STDLIB_FLAGS)" \
|
||||
LDFLAGS="-march=armv7" \
|
||||
library=static strictaliasing=off snapshot=off werror=no @V8_TARGET@
|
||||
endif
|
||||
|
@ -160,8 +160,8 @@ if ENABLE_V8_DEBUG
|
|||
CXX="$(CXX)" \
|
||||
CXX.host="$(CXX)" \
|
||||
LINK="$(CXX)" \
|
||||
CFLAGS="-O0 -ggdb $(DEBUG_V8_FLAGS) $(GOLD_V8_FLAGS)" \
|
||||
CXXFLAGS="-O0 -ggdb $(DEBUG_V8_FLAGS) $(GOLD_V8_FLAGS)" \
|
||||
CFLAGS="-O0 -ggdb $(DEBUG_V8_FLAGS) $(GOLD_V8_FLAGS) $(STDLIB_FLAGS)" \
|
||||
CXXFLAGS="-O0 -ggdb $(DEBUG_V8_FLAGS) $(GOLD_V8_FLAGS) $(STDLIB_FLAGS)" \
|
||||
debug=on v8_optimized_debug=0 v8_enable_backtrace=on \
|
||||
library=static strictaliasing=off snapshot=off werror=no @V8_TARGET@
|
||||
else # ! ENABLE_V8_DEBUG
|
||||
|
@ -173,8 +173,8 @@ else # ! ENABLE_V8_DEBUG
|
|||
CXX="$(CXX)" \
|
||||
CXX.host="$(CXX)" \
|
||||
LINK="$(CXX)" \
|
||||
CFLAGS="-O3 -fomit-frame-pointer -g $(GOLD_V8_FLAGS)" \
|
||||
CXXFLAGS="-O3 -fomit-frame-pointer -g $(GOLD_V8_FLAGS)" \
|
||||
CFLAGS="-O3 -fomit-frame-pointer -g $(GOLD_V8_FLAGS) $(STDLIB_FLAGS)" \
|
||||
CXXFLAGS="-O3 -fomit-frame-pointer -g $(GOLD_V8_FLAGS) $(STDLIB_FLAGS)" \
|
||||
library=static strictaliasing=off snapshot=off werror=no @V8_TARGET@
|
||||
endif # ENABLE_V8_DEBUG
|
||||
endif # ENABLE_DARWIN
|
||||
|
|
|
@ -58,6 +58,7 @@ extern "C" {
|
|||
int linenoiseHistoryLoad(const char* filename);
|
||||
void linenoiseHistoryFree(void);
|
||||
void linenoiseClearScreen(void);
|
||||
int linenoiseInstallWindowChangeHandler(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -130,7 +130,7 @@ using namespace linenoise_ng;
|
|||
|
||||
typedef unsigned char char8_t;
|
||||
|
||||
ConversionResult copyString8to32 (char32_t* dst, size_t dstSize, size_t& dstCount, const char* src) {
|
||||
static ConversionResult copyString8to32 (char32_t* dst, size_t dstSize, size_t& dstCount, const char* src) {
|
||||
const UTF8* sourceStart = reinterpret_cast<const UTF8*>(src);
|
||||
const UTF8* sourceEnd = sourceStart + strlen(src);
|
||||
UTF32* targetStart = reinterpret_cast<UTF32*>(dst);
|
||||
|
@ -149,11 +149,11 @@ ConversionResult copyString8to32 (char32_t* dst, size_t dstSize, size_t& dstCoun
|
|||
return res;
|
||||
}
|
||||
|
||||
ConversionResult copyString8to32 (char32_t* dst, size_t dstSize, size_t& dstCount, const char8_t* src) {
|
||||
static ConversionResult copyString8to32 (char32_t* dst, size_t dstSize, size_t& dstCount, const char8_t* src) {
|
||||
return copyString8to32(dst, dstSize, dstCount, reinterpret_cast<const char*>(src));
|
||||
}
|
||||
|
||||
size_t strlen32 (const char32_t* str) {
|
||||
static size_t strlen32 (const char32_t* str) {
|
||||
const char32_t* ptr = str;
|
||||
|
||||
while (*ptr) {
|
||||
|
@ -163,15 +163,16 @@ size_t strlen32 (const char32_t* str) {
|
|||
return ptr - str;
|
||||
}
|
||||
|
||||
size_t strlen8 (const char8_t* str) {
|
||||
static size_t strlen8 (const char8_t* str) {
|
||||
return strlen(reinterpret_cast<const char*>(str));
|
||||
}
|
||||
|
||||
char8_t* strdup8 (const char* src) {
|
||||
static char8_t* strdup8 (const char* src) {
|
||||
return reinterpret_cast<char8_t*>(strdup(src));
|
||||
}
|
||||
|
||||
void copyString32to16(char16_t* dst, size_t dstSize, size_t* dstCount, const char32_t* src, size_t srcSize) {
|
||||
#ifdef _WIN32
|
||||
static void copyString32to16(char16_t* dst, size_t dstSize, size_t* dstCount, const char32_t* src, size_t srcSize) {
|
||||
const UTF32* sourceStart = reinterpret_cast<const UTF32*>(src);
|
||||
const UTF32* sourceEnd = sourceStart + srcSize;
|
||||
char16_t* targetStart = reinterpret_cast<char16_t*>(dst);
|
||||
|
@ -187,8 +188,9 @@ void copyString32to16(char16_t* dst, size_t dstSize, size_t* dstCount, const cha
|
|||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
void copyString32to8 (char* dst, size_t dstSize, size_t* dstCount, const char32_t* src, size_t srcSize) {
|
||||
static void copyString32to8 (char* dst, size_t dstSize, size_t* dstCount, const char32_t* src, size_t srcSize) {
|
||||
const UTF32* sourceStart = reinterpret_cast<const UTF32*>(src);
|
||||
const UTF32* sourceEnd = sourceStart + srcSize;
|
||||
UTF8* targetStart = reinterpret_cast<UTF8*>(dst);
|
||||
|
@ -205,12 +207,12 @@ void copyString32to8 (char* dst, size_t dstSize, size_t* dstCount, const char32_
|
|||
}
|
||||
}
|
||||
|
||||
void copyString32to8 (char* dst, size_t dstLen, const char32_t* src) {
|
||||
static void copyString32to8 (char* dst, size_t dstLen, const char32_t* src) {
|
||||
size_t dstCount = 0;
|
||||
copyString32to8 (dst, dstLen, &dstCount, src, strlen32(src));
|
||||
}
|
||||
|
||||
void copyString32 (char32_t* dst, const char32_t* src, size_t len) {
|
||||
static void copyString32 (char32_t* dst, const char32_t* src, size_t len) {
|
||||
while (*src && 1 < len) {
|
||||
*dst++ = *src++;
|
||||
--len;
|
||||
|
@ -219,7 +221,7 @@ void copyString32 (char32_t* dst, const char32_t* src, size_t len) {
|
|||
*dst = 0;
|
||||
}
|
||||
|
||||
int strncmp32 (const char32_t* left, const char32_t* right, size_t len) {
|
||||
static int strncmp32 (const char32_t* left, const char32_t* right, size_t len) {
|
||||
while (0 < len && *left) {
|
||||
if (*left != *right) {
|
||||
return *left - * right;
|
||||
|
@ -233,7 +235,7 @@ int strncmp32 (const char32_t* left, const char32_t* right, size_t len) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
int write32 (int fd, char32_t* text32, int len32) {
|
||||
static int write32 (int fd, char32_t* text32, int len32) {
|
||||
#ifdef _WIN32
|
||||
if (_isatty(fd)) {
|
||||
size_t len16 = 2 * len32 + 1;
|
||||
|
@ -464,6 +466,7 @@ struct PromptBase { // a convenience struct for grouping prompt inf
|
|||
Utf32String promptText; // our copy of the prompt text, edited
|
||||
char* promptCharWidths; // character widths from mk_wcwidth()
|
||||
int promptChars; // chars in promptText
|
||||
int promptBytes; // bytes in promptText
|
||||
int promptExtraLines; // extra lines (beyond 1) occupied by prompt
|
||||
int promptIndentation; // column offset to end of prompt
|
||||
int promptLastLinePosition; // index into promptText where last line begins
|
||||
|
@ -474,6 +477,13 @@ struct PromptBase { // a convenience struct for grouping prompt inf
|
|||
int promptErrorCode; // error code (invalid UTF-8) or zero
|
||||
|
||||
PromptBase() : promptPreviousInputLen(0) {}
|
||||
|
||||
bool write() {
|
||||
if (write32(1, promptText.get(), promptBytes) == -1)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
struct PromptInfo : public PromptBase {
|
||||
|
@ -487,37 +497,78 @@ struct PromptInfo : public PromptBase {
|
|||
// strip control characters from the prompt -- we do allow newline
|
||||
char32_t* pIn = tempUnicode.get();
|
||||
char32_t* pOut = pIn;
|
||||
|
||||
int len = 0;
|
||||
int x = 0;
|
||||
|
||||
#ifdef _WIN32
|
||||
bool const strip = true;
|
||||
#else
|
||||
bool const strip = (isatty(1) != 1);
|
||||
#endif
|
||||
|
||||
while (*pIn) {
|
||||
char32_t c = *pIn;
|
||||
if ('\n' == c || !isControlChar(c)) {
|
||||
*pOut = c;
|
||||
++pOut;
|
||||
++pIn;
|
||||
++len;
|
||||
if ('\n' == c || ++x >= promptScreenColumns) {
|
||||
x = 0;
|
||||
++promptExtraLines;
|
||||
promptLastLinePosition = len;
|
||||
}
|
||||
}
|
||||
else if (c == '\x1b') {
|
||||
if (strip) {
|
||||
// jump over control chars
|
||||
++pIn;
|
||||
if (*pIn == '[') {
|
||||
++pIn;
|
||||
while (*pIn && ((*pIn == ';') || ((*pIn >= '0' && *pIn <= '9')))) {
|
||||
++pIn;
|
||||
}
|
||||
if (*pIn == 'm') {
|
||||
++pIn;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
// copy control chars
|
||||
*pOut = *pIn;
|
||||
++pOut;
|
||||
++pIn;
|
||||
if (*pIn == '[') {
|
||||
*pOut = *pIn;
|
||||
++pOut;
|
||||
++pIn;
|
||||
while (*pIn && ((*pIn == ';') || ((*pIn >= '0' && *pIn <= '9')))) {
|
||||
*pOut = *pIn;
|
||||
++pOut;
|
||||
++pIn;
|
||||
}
|
||||
if (*pIn == 'm') {
|
||||
*pOut = *pIn;
|
||||
++pOut;
|
||||
++pIn;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
++pIn;
|
||||
}
|
||||
}
|
||||
*pOut = 0;
|
||||
promptChars = static_cast<int>(pOut - tempUnicode.get());
|
||||
promptChars = len;
|
||||
promptBytes = static_cast<int>(pOut - tempUnicode.get());
|
||||
promptText = tempUnicode;
|
||||
|
||||
int x = 0;
|
||||
for (int i = 0; i < promptChars; ++i) {
|
||||
char32_t c = promptText[i];
|
||||
if ('\n' == c) {
|
||||
x = 0;
|
||||
++promptExtraLines;
|
||||
promptLastLinePosition = i + 1;
|
||||
} else {
|
||||
++x;
|
||||
if (x >= promptScreenColumns) {
|
||||
x = 0;
|
||||
++promptExtraLines;
|
||||
promptLastLinePosition = i + 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
promptIndentation = promptChars - promptLastLinePosition;
|
||||
promptIndentation = len - promptLastLinePosition;
|
||||
promptCursorRowOffset = promptExtraLines;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
// Used with DynamicPrompt (history search)
|
||||
|
@ -545,6 +596,7 @@ struct DynamicPrompt : public PromptBase {
|
|||
(direction > 0) ? &forwardSearchBasePrompt : &reverseSearchBasePrompt;
|
||||
size_t promptStartLength = basePrompt->length();
|
||||
promptChars = static_cast<int>(promptStartLength + endSearchBasePrompt.length());
|
||||
promptBytes = promptChars;
|
||||
promptLastLinePosition =
|
||||
promptChars; // TODO fix this, we are asssuming that the history prompt won't wrap (!)
|
||||
promptPreviousLen = promptChars;
|
||||
|
@ -564,6 +616,7 @@ struct DynamicPrompt : public PromptBase {
|
|||
(direction > 0) ? &forwardSearchBasePrompt : &reverseSearchBasePrompt;
|
||||
size_t promptStartLength = basePrompt->length();
|
||||
promptChars = static_cast<int>(promptStartLength + searchTextLen + endSearchBasePrompt.length());
|
||||
promptBytes = promptChars;
|
||||
Utf32String tempUnicode(promptChars + 1);
|
||||
memcpy(tempUnicode.get(), basePrompt->get(), sizeof(char32_t) * promptStartLength);
|
||||
memcpy(&tempUnicode[promptStartLength], searchText.get(), sizeof(char32_t) * searchTextLen);
|
||||
|
@ -787,7 +840,7 @@ static int enableRawMode(void) {
|
|||
#else
|
||||
struct termios raw;
|
||||
|
||||
if (!isatty(0))
|
||||
if (!isatty(STDIN_FILENO))
|
||||
goto fatal;
|
||||
if (!atexit_registered) {
|
||||
atexit(linenoiseAtExit);
|
||||
|
@ -955,7 +1008,7 @@ static void dynamicRefresh(PromptBase& pi, char32_t* buf32, int len, int pos) {
|
|||
pi.promptPreviousInputLen = len;
|
||||
|
||||
// display the prompt
|
||||
if (write32(1, pi.promptText.get(), pi.promptChars) == -1)
|
||||
if (! pi.write())
|
||||
return;
|
||||
|
||||
// display the input line
|
||||
|
@ -981,7 +1034,7 @@ static void dynamicRefresh(PromptBase& pi, char32_t* buf32, int len, int pos) {
|
|||
return;
|
||||
|
||||
// display the prompt
|
||||
if (write32(1, pi.promptText.get(), pi.promptChars) == -1)
|
||||
if (! pi.write())
|
||||
return;
|
||||
|
||||
// display the input line
|
||||
|
@ -1919,7 +1972,7 @@ int InputBuffer::completeLine(PromptBase& pi) {
|
|||
if (write(1, "\n", 1) == -1)
|
||||
return 0;
|
||||
}
|
||||
if (write32(1, pi.promptText.get(), pi.promptChars) == -1)
|
||||
if (! pi.write())
|
||||
return 0;
|
||||
#ifndef _WIN32
|
||||
// we have to generate our own newline on line wrap on Linux
|
||||
|
@ -1952,7 +2005,7 @@ void linenoiseClearScreen(void) {
|
|||
|
||||
void InputBuffer::clearScreen(PromptBase& pi) {
|
||||
linenoiseClearScreen();
|
||||
if (write32(1, pi.promptText.get(), pi.promptChars) == -1)
|
||||
if (! pi.write())
|
||||
return;
|
||||
#ifndef _WIN32
|
||||
// we have to generate our own newline on line wrap on Linux
|
||||
|
@ -2190,8 +2243,10 @@ int InputBuffer::incrementalHistorySearch(PromptBase& pi, int startChar) {
|
|||
// leaving history search, restore previous prompt, maybe make searched line current
|
||||
PromptBase pb;
|
||||
pb.promptChars = pi.promptIndentation;
|
||||
Utf32String tempUnicode(pb.promptChars + 1);
|
||||
copyString32(tempUnicode.get(), &pi.promptText[pi.promptLastLinePosition], pb.promptChars + 1);
|
||||
pb.promptBytes = pi.promptBytes;
|
||||
Utf32String tempUnicode(pb.promptBytes + 1);
|
||||
|
||||
copyString32(tempUnicode.get(), &pi.promptText[pi.promptLastLinePosition], pb.promptBytes + 1);
|
||||
tempUnicode.initFromBuffer();
|
||||
pb.promptText = tempUnicode;
|
||||
pb.promptExtraLines = 0;
|
||||
|
@ -2221,6 +2276,10 @@ static bool isCharacterAlphanumeric(char32_t testChar) {
|
|||
return (iswalnum(testChar) != 0 ? true : false);
|
||||
}
|
||||
|
||||
#ifndef _WIN32
|
||||
static bool gotResize = false;
|
||||
#endif
|
||||
|
||||
int InputBuffer::getInputLine(PromptBase& pi) {
|
||||
// The latest history entry is always our current buffer
|
||||
if (len > 0) {
|
||||
|
@ -2235,7 +2294,7 @@ int InputBuffer::getInputLine(PromptBase& pi) {
|
|||
historyRecallMostRecent = false;
|
||||
|
||||
// display the prompt
|
||||
if (write32(1, pi.promptText.get(), pi.promptChars) == -1)
|
||||
if (! pi.write())
|
||||
return -1;
|
||||
|
||||
#ifndef _WIN32
|
||||
|
@ -2264,6 +2323,17 @@ int InputBuffer::getInputLine(PromptBase& pi) {
|
|||
int c;
|
||||
if (terminatingKeystroke == -1) {
|
||||
c = linenoiseReadChar(); // get a new keystroke
|
||||
|
||||
#ifndef _WIN32
|
||||
if (c == 0 && gotResize) {
|
||||
// caught a window resize event
|
||||
// now redraw the prompt and line
|
||||
gotResize = false;
|
||||
pi.promptScreenColumns = getScreenColumns();
|
||||
dynamicRefresh(pi, buf32, len, pos); // redraw the original prompt with current input
|
||||
continue;
|
||||
}
|
||||
#endif
|
||||
} else {
|
||||
c = terminatingKeystroke; // use the terminating keystroke from search
|
||||
terminatingKeystroke = -1; // clear it once we've used it
|
||||
|
@ -2281,7 +2351,7 @@ int InputBuffer::getInputLine(PromptBase& pi) {
|
|||
}
|
||||
|
||||
if (c == -2) {
|
||||
if (write32(1, pi.promptText.get(), pi.promptChars) == -1)
|
||||
if (! pi.write())
|
||||
return -1;
|
||||
refreshLine(pi);
|
||||
continue;
|
||||
|
@ -2707,7 +2777,7 @@ int InputBuffer::getInputLine(PromptBase& pi) {
|
|||
disableRawMode(); // Returning to Linux (whatever) shell, leave raw mode
|
||||
raise(SIGSTOP); // Break out in mid-line
|
||||
enableRawMode(); // Back from Linux shell, re-enter raw mode
|
||||
if (write32(1, pi.promptText.get(), pi.promptChars) == -1)
|
||||
if (! pi.write())
|
||||
break; // Redraw prompt
|
||||
refreshLine(pi); // Refresh the line
|
||||
break;
|
||||
|
@ -2869,6 +2939,9 @@ void linenoisePreloadBuffer(const char* preloadText) {
|
|||
* memory leaks
|
||||
*/
|
||||
char* linenoise(const char* prompt) {
|
||||
#ifndef _WIN32
|
||||
gotResize = false;
|
||||
#endif
|
||||
if (isatty(STDIN_FILENO)) { // input is from a terminal
|
||||
char32_t buf32[LINENOISE_MAX_LINE];
|
||||
char charWidths[LINENOISE_MAX_LINE];
|
||||
|
@ -2879,7 +2952,7 @@ char* linenoise(const char* prompt) {
|
|||
}
|
||||
PromptInfo pi(prompt, getScreenColumns());
|
||||
if (isUnsupportedTerm()) {
|
||||
if (write32(1, pi.promptText.get(), pi.promptChars) == -1)
|
||||
if (! pi.write())
|
||||
return 0;
|
||||
fflush(stdout);
|
||||
if (preloadedBufferContents.empty()) {
|
||||
|
@ -3058,3 +3131,23 @@ int linenoiseHistoryLoad(const char* filename) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
#ifndef _WIN32
|
||||
static void WindowSizeChanged(int) {
|
||||
// do nothing here but setting this flag
|
||||
gotResize = true;
|
||||
}
|
||||
#endif
|
||||
|
||||
int linenoiseInstallWindowChangeHandler(void) {
|
||||
#ifndef _WIN32
|
||||
struct sigaction sa;
|
||||
sigemptyset(&sa.sa_mask);
|
||||
sa.sa_flags = 0;
|
||||
sa.sa_handler = &WindowSizeChanged;
|
||||
|
||||
if (sigaction(SIGWINCH, &sa, nullptr) == -1) {
|
||||
return errno;
|
||||
}
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -1,6 +1,10 @@
|
|||
v2.8.0 (XXXX-XX-XX)
|
||||
-------------------
|
||||
|
||||
* added startup option `--server.hide-product-header` to make the server not send
|
||||
the HTTP response header `"Server: ArangoDB"` in its HTTP responses. By default,
|
||||
the option is turned off so the header is still sent as usual.
|
||||
|
||||
* added new AQL function `UNSET_RECURSIVE` to recursively unset attritutes from
|
||||
objects/documents
|
||||
|
||||
|
|
|
@ -797,6 +797,12 @@ endif ()
|
|||
|
||||
if (MSVC)
|
||||
install_readme(LICENSE . LICENSE.txt)
|
||||
install_readme(LICENSES-OTHER-COMPONENTS.md . LICENSES-OTHER-COMPONENTS.md)
|
||||
else ()
|
||||
install_readme(README share/doc/arangodb README)
|
||||
install_readme(README.md share/doc/arangodb README.md)
|
||||
install_readme(LICENSE share/doc/arangodb LICENSE)
|
||||
install_readme(LICENSES-OTHER-COMPONENTS.md share/doc/arangodb LICENSES-OTHER-COMPONENTS.md)
|
||||
endif ()
|
||||
|
||||
## -----------------------------------------------------------------------------
|
||||
|
@ -908,8 +914,6 @@ if (MSVC)
|
|||
SET(BITS 32)
|
||||
endif()
|
||||
|
||||
|
||||
|
||||
message(STATUS "ARANGO_IMG: ${ARANGO_IMG}")
|
||||
message(STATUS "ARANGO_ICON: ${ARANGO_ICON}")
|
||||
message(STATUS "RELATIVE_ARANGO_ICON: ${RELATIVE_ARANGO_ICON}")
|
||||
|
|
|
@ -8,7 +8,9 @@ instead.
|
|||
|
||||
!SECTION Determining direct connections
|
||||
|
||||
- *EDGES(edgecollection, startvertex, direction, edgeexamples, options)*:
|
||||
!SUBSECTION Edges
|
||||
*EDGES(edgecollection, startvertex, direction, edgeexamples, options)*:
|
||||
|
||||
Return all edges connected to the vertex *startvertex* as an array. The possible values for
|
||||
*direction* are:
|
||||
- *outbound*: Return all outbound edges
|
||||
|
@ -35,7 +37,9 @@ instead.
|
|||
EDGES(friendrelations, "friends/john", "any", null, {includeVertices: true})
|
||||
|
||||
|
||||
- *NEIGHBORS(vertexcollection, edgecollection, startvertex, direction, edgeexamples, options)*:
|
||||
!SUBSECTION Neighbors
|
||||
*NEIGHBORS(vertexcollection, edgecollection, startvertex, direction, edgeexamples, options)*:
|
||||
|
||||
Returns `_id` values of all distinct neighbors that are directly connected to the
|
||||
vertex *startvertex* as an array.
|
||||
|
||||
|
@ -70,7 +74,8 @@ instead.
|
|||
|
||||
!SECTION General-purpose traversals
|
||||
|
||||
- *TRAVERSAL(vertexcollection, edgecollection, startVertex, direction, options)*:
|
||||
!SUBSECTION Traversal
|
||||
*TRAVERSAL(vertexcollection, edgecollection, startVertex, direction, options)*:
|
||||
Traverses the graph described by *vertexcollection* and *edgecollection*,
|
||||
starting at the vertex identified by id *startVertex*. Vertex connectivity is
|
||||
specified by the *direction* parameter:
|
||||
|
@ -317,8 +322,8 @@ instead.
|
|||
data: { attributes: [ "_id", "_key", "name" ] }
|
||||
})
|
||||
|
||||
|
||||
- *TRAVERSAL_TREE(vertexcollection, edgecollection, startVertex, direction, connectName, options)*:
|
||||
!SUBSECTION Traversal Tree
|
||||
*TRAVERSAL_TREE(vertexcollection, edgecollection, startVertex, direction, connectName, options)*:
|
||||
Traverses the graph described by *vertexcollection* and *edgecollection*,
|
||||
starting at the vertex identified by id *startVertex* and creates a hierarchical result.
|
||||
Vertex connectivity is establish by inserted an attribute which has the name specified via
|
||||
|
@ -335,8 +340,8 @@ instead.
|
|||
itemOrder: "forward"
|
||||
})
|
||||
|
||||
|
||||
- *SHORTEST_PATH(vertexcollection, edgecollection, startVertex, endVertex, direction, options)*:
|
||||
!SUBSECTION Shortest Path
|
||||
*SHORTEST_PATH(vertexcollection, edgecollection, startVertex, endVertex, direction, options)*:
|
||||
Determines the first shortest path from the *startVertex* to the *endVertex*.
|
||||
Both vertices must be present in the vertex collection specified in *vertexcollection*,
|
||||
and any connecting edges must be present in the collection specified by *edgecollection*.
|
||||
|
@ -474,10 +479,10 @@ instead.
|
|||
return (edge.underConstruction === false); // don't follow these edges
|
||||
}, false);
|
||||
|
||||
|
||||
!SECTION Other functions
|
||||
|
||||
- *PATHS(vertexcollection, edgecollection, direction, options)*:
|
||||
!SUBSECTION Paths
|
||||
*PATHS(vertexcollection, edgecollection, direction, options)*:
|
||||
returns an array of paths through the graph defined by the nodes in the collection
|
||||
*vertexcollection* and edges in the collection *edgecollection*. For each vertex
|
||||
in *vertexcollection*, it will determine the paths through the graph depending on the
|
||||
|
@ -507,6 +512,18 @@ instead.
|
|||
FILTER p.source._id == "users/123456"
|
||||
RETURN p.vertices[*].name
|
||||
|
||||
!SECTION Graph consistency
|
||||
When [using the graph management functions to remove vertices](../GeneralGraphs/Management.md#remove-a-vertex)
|
||||
you have the guaranty that all referencing edges are also removed.
|
||||
However, if you use document features alone to remove vertices, no edge collections will be adjusted.
|
||||
This results in an edge with its `_from` or `_to` attribute referring to vanished vertices.
|
||||
|
||||
Now we query such a graph using the [neighbors](#neighbors) or the [shortest path](#shortest-path) functions.
|
||||
If *includeData* wasn't enabled, the referred missing vertex will not be queried, and thus the result
|
||||
set will contain the referral to this missing vertex.
|
||||
If *includeData* is enabled, these missing vertices will be touched by the query.
|
||||
|
||||
In order to keep the result set consistent between *includeData* enabled or disabled, a `null` will be padded to fill the gap for each missing vertex.
|
||||
|
||||
!SECTION Performance notes
|
||||
|
||||
|
@ -525,3 +542,5 @@ process is specified by the optional *maxIterations* configuration value. If the
|
|||
vertices processed in a traversal reaches this cap will, the traversal will abort and throw
|
||||
a *too many iterations* exception.
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -32,6 +32,10 @@
|
|||
@startDocuBlock serverDefaultApi
|
||||
|
||||
|
||||
!SUBSECTION Hide Product header
|
||||
@startDocuBlock serverHideProductHeader
|
||||
|
||||
|
||||
!SUBSECTION Allow method override
|
||||
@startDocuBlock serverAllowMethod
|
||||
|
||||
|
|
|
@ -93,55 +93,55 @@ These collections are called orphan collections.
|
|||
If the graph is extended with an edge definition using one of the orphans,
|
||||
it will be removed from the set of orphan collection automatically.
|
||||
|
||||
!SUBSUBSECTION Add
|
||||
!SUBSUBSECTION Add a vertex collection
|
||||
|
||||
@startDocuBlock JSF_general_graph__addVertexCollection
|
||||
|
||||
!SUBSUBSECTION Get
|
||||
!SUBSUBSECTION Get the orphaned collections
|
||||
|
||||
@startDocuBlock JSF_general_graph__orphanCollections
|
||||
|
||||
!SUBSUBSECTION Remove
|
||||
!SUBSUBSECTION Remove a vertex collection
|
||||
|
||||
@startDocuBlock JSF_general_graph__removeVertexCollection
|
||||
|
||||
|
||||
!SECTION Vertex
|
||||
!SECTION Maniuplating Vertices
|
||||
|
||||
!SUBSECTION Save
|
||||
!SUBSECTION Save a vertex
|
||||
|
||||
@startDocuBlock JSF_general_graph_vertex_collection_save
|
||||
|
||||
!SUBSECTION Replace
|
||||
!SUBSECTION Replace a vertex
|
||||
|
||||
@startDocuBlock JSF_general_graph_vertex_collection_replace
|
||||
|
||||
!SUBSECTION Update
|
||||
!SUBSECTION Update a vertex
|
||||
|
||||
@startDocuBlock JSF_general_graph_vertex_collection_update
|
||||
|
||||
!SUBSECTION Remove
|
||||
!SUBSECTION Remove a vertex
|
||||
|
||||
@startDocuBlock JSF_general_graph_vertex_collection_remove
|
||||
|
||||
!SECTION Edge
|
||||
!SECTION Manipulating Edges
|
||||
|
||||
!SUBSECTION Save
|
||||
!SUBSECTION Save a new edge
|
||||
|
||||
@startDocuBlock JSF_general_graph_edge_collection_save
|
||||
|
||||
!SUBSECTION Replace
|
||||
!SUBSECTION Replace an edge
|
||||
|
||||
@startDocuBlock JSF_general_graph_edge_collection_replace
|
||||
|
||||
!SUBSECTION Update
|
||||
!SUBSECTION Update an edge
|
||||
|
||||
@startDocuBlock JSF_general_graph_edge_collection_update
|
||||
|
||||
!SUBSECTION Remove
|
||||
!SUBSECTION Remove an edge
|
||||
|
||||
@startDocuBlock JSF_general_graph_edge_collection_remove
|
||||
|
||||
!SUBSECTION Connect
|
||||
!SUBSECTION Connect edges
|
||||
|
||||
@startDocuBlock JSF_general_graph_connectingEdges
|
21
GNUmakefile
21
GNUmakefile
|
@ -98,7 +98,9 @@ pack-dmg:
|
|||
rm -rf Build && mkdir Build
|
||||
|
||||
./configure \
|
||||
--prefix=/opt/arangodb
|
||||
--prefix=/opt/arangodb \
|
||||
CPPFLAGS="-I`brew --prefix`/opt/openssl/include" \
|
||||
LDFLAGS="-L`brew --prefix`/opt/openssl/lib"
|
||||
|
||||
${MAKE} pack-dmg-cmake
|
||||
|
||||
|
@ -111,6 +113,9 @@ pack-dmg-cmake:
|
|||
-D "CPACK_PACKAGE_VERSION_MINOR=${VERSION_MINOR}" \
|
||||
-D "CPACK_PACKAGE_VERSION_PATCH=${VERSION_PATCH}" \
|
||||
-D "LIBEV_VERSION=${LIBEV_VERSION}" \
|
||||
-D "OPENSSL_INCLUDE=`brew --prefix`/opt/openssl/include" \
|
||||
-D "OPENSSL_LIB_PATH=`brew --prefix`/opt/openssl/lib" \
|
||||
-D "OPENSSL_LIBS=`brew --prefix`/opt/openssl/lib/libssl.a;`brew --prefix`/opt/openssl/lib/libcrypto.a" \
|
||||
-D "V8_VERSION=${V8_VERSION}" \
|
||||
-D "ZLIB_VERSION=${ZLIB_VERSION}" \
|
||||
..
|
||||
|
@ -145,7 +150,9 @@ pack-macosxcode:
|
|||
rm -rf Build && mkdir Build
|
||||
|
||||
./configure \
|
||||
--prefix=/opt/arangodb
|
||||
--prefix=/opt/arangodb \
|
||||
CPPFLAGS="-I`brew --prefix`/opt/openssl/include" \
|
||||
LDFLAGS="-L`brew --prefix`/opt/openssl/lib"
|
||||
|
||||
${MAKE} -f GNUMakefile pack-macosxcode-cmake MOREOPTS='$(MOREOPTS)'
|
||||
|
||||
|
@ -159,6 +166,9 @@ pack-macosxcode-cmake:
|
|||
-D "CPACK_PACKAGE_VERSION_MINOR=${VERSION_MINOR}" \
|
||||
-D "CPACK_PACKAGE_VERSION_PATCH=${VERSION_PATCH}" \
|
||||
-D "LIBEV_VERSION=${LIBEV_VERSION}" \
|
||||
-D "OPENSSL_INCLUDE=`brew --prefix`/opt/openssl/include" \
|
||||
-D "OPENSSL_LIB_PATH=`brew --prefix`/opt/openssl/lib" \
|
||||
-D "OPENSSL_LIBS=`brew --prefix`/opt/openssl/lib/libssl.a;`brew --prefix`/opt/openssl/lib/libcrypto.a" \
|
||||
-D "V8_VERSION=${V8_VERSION}" \
|
||||
-D "ZLIB_VERSION=${ZLIB_VERSION}" \
|
||||
-G Xcode \
|
||||
|
@ -180,7 +190,9 @@ pack-macosx:
|
|||
rm -rf Build && mkdir Build
|
||||
|
||||
./configure \
|
||||
--prefix=/opt/arangodb
|
||||
--prefix=/opt/arangodb \
|
||||
CPPFLAGS="-I`brew --prefix`/opt/openssl/include" \
|
||||
LDFLAGS="-L`brew --prefix`/opt/openssl/lib"
|
||||
|
||||
${MAKE} pack-macosx-cmake MOREOPTS='$(MOREOPTS)'
|
||||
|
||||
|
@ -193,6 +205,9 @@ pack-macosx-cmake:
|
|||
-D "CPACK_PACKAGE_VERSION_MINOR=${VERSION_MINOR}" \
|
||||
-D "CPACK_PACKAGE_VERSION_PATCH=${VERSION_PATCH}" \
|
||||
-D "LIBEV_VERSION=${LIBEV_VERSION}" \
|
||||
-D "OPENSSL_INCLUDE=`brew --prefix`/opt/openssl/include" \
|
||||
-D "OPENSSL_LIB_PATH=`brew --prefix`/opt/openssl/lib" \
|
||||
-D "OPENSSL_LIBS=`brew --prefix`/opt/openssl/lib/libssl.a;`brew --prefix`/opt/openssl/lib/libcrypto.a" \
|
||||
-D "V8_VERSION=${V8_VERSION}" \
|
||||
-D "ZLIB_VERSION=${ZLIB_VERSION}" \
|
||||
$(MOREOPTS) \
|
||||
|
|
|
@ -253,15 +253,16 @@ CLEANUP += @srcdir@/.file-list-js
|
|||
### @brief /var data
|
||||
################################################################################
|
||||
|
||||
#if ENABLE_RELATIVE
|
||||
#else
|
||||
|
||||
install-data-local:
|
||||
test -d $(DESTDIR)$(TRI_LOCALSTATEDIR)/lib/arangodb || mkdir -p $(DESTDIR)$(TRI_LOCALSTATEDIR)/lib/arangodb
|
||||
test -d $(DESTDIR)$(TRI_LOCALSTATEDIR)/lib/arangodb-apps || mkdir -p $(DESTDIR)$(TRI_LOCALSTATEDIR)/lib/arangodb-apps
|
||||
test -d $(DESTDIR)$(TRI_LOCALSTATEDIR)/log/arangodb || mkdir -p $(DESTDIR)$(TRI_LOCALSTATEDIR)/log/arangodb
|
||||
|
||||
#endif
|
||||
################################################################################
|
||||
### @brief /doc
|
||||
################################################################################
|
||||
|
||||
dist_doc_DATA = README README.md LICENSE LICENSES-OTHER-COMPONENTS.md
|
||||
|
||||
################################################################################
|
||||
### @brief symbolic links
|
||||
|
|
|
@ -156,7 +156,7 @@ describe ArangoDB do
|
|||
|
||||
# run a HTTP HEAD query on the existing document, with wrong precondition
|
||||
cmd = "/_api/document/" + did
|
||||
doc = ArangoDB.log_head("#{prefix}-head-check-documentq", cmd, :header => { :"if-match" => "1" })
|
||||
doc = ArangoDB.log_head("#{prefix}-head-check-document", cmd, :header => { :"if-match" => "1" })
|
||||
|
||||
doc.code.should eq(200)
|
||||
doc.response.body.should be_nil
|
||||
|
|
|
@ -2292,10 +2292,18 @@ AqlValue Functions::Neighbors (triagens::aql::Query* query,
|
|||
}
|
||||
|
||||
std::string const collectionName = vertexId.substr(0, split);
|
||||
if (collectionName.compare(vColName) != 0) {
|
||||
THROW_ARANGO_EXCEPTION_FORMAT(TRI_ERROR_GRAPH_INVALID_PARAMETER,
|
||||
"you specified vertex collection `%s` for start vertext from `%s`",
|
||||
vColName.c_str(),
|
||||
collectionName.c_str());
|
||||
}
|
||||
auto coli = resolver->getCollectionStruct(collectionName);
|
||||
|
||||
if (coli == nullptr || collectionName.compare(vColName) != 0) {
|
||||
THROW_ARANGO_EXCEPTION(TRI_ERROR_ARANGO_COLLECTION_NOT_FOUND);
|
||||
if (coli == nullptr) {
|
||||
THROW_ARANGO_EXCEPTION_FORMAT(TRI_ERROR_ARANGO_COLLECTION_NOT_FOUND,
|
||||
"`%s`",
|
||||
collectionName.c_str());
|
||||
}
|
||||
|
||||
VertexId v(coli->_cid, const_cast<char*>(str + split + 1));
|
||||
|
@ -2320,10 +2328,18 @@ AqlValue Functions::Neighbors (triagens::aql::Query* query,
|
|||
}
|
||||
|
||||
std::string const collectionName = vertexId.substr(0, split);
|
||||
if (collectionName.compare(vColName) != 0) {
|
||||
THROW_ARANGO_EXCEPTION_FORMAT(TRI_ERROR_GRAPH_INVALID_PARAMETER,
|
||||
"you specified vertex collection `%s` for start vertext from `%s`",
|
||||
vColName.c_str(),
|
||||
collectionName.c_str());
|
||||
}
|
||||
auto coli = resolver->getCollectionStruct(collectionName);
|
||||
|
||||
if (coli == nullptr || collectionName.compare(vColName) != 0) {
|
||||
THROW_ARANGO_EXCEPTION(TRI_ERROR_ARANGO_COLLECTION_NOT_FOUND);
|
||||
if (coli == nullptr) {
|
||||
THROW_ARANGO_EXCEPTION_FORMAT(TRI_ERROR_ARANGO_COLLECTION_NOT_FOUND,
|
||||
"`%s`",
|
||||
collectionName.c_str());
|
||||
}
|
||||
|
||||
VertexId v(coli->_cid, const_cast<char*>(str + split + 1));
|
||||
|
@ -2512,21 +2528,25 @@ AqlValue Functions::Near (triagens::aql::Query* query,
|
|||
true,
|
||||
true);
|
||||
if (res != TRI_ERROR_NO_ERROR) {
|
||||
THROW_ARANGO_EXCEPTION(res);
|
||||
THROW_ARANGO_EXCEPTION_FORMAT(res, "`%s`", colName.c_str());
|
||||
}
|
||||
|
||||
TRI_EnsureCollectionsTransaction(trx->getInternals());
|
||||
collection = trx->trxCollection(cid);
|
||||
|
||||
if (collection == nullptr) {
|
||||
THROW_ARANGO_EXCEPTION(TRI_ERROR_ARANGO_COLLECTION_NOT_FOUND);
|
||||
THROW_ARANGO_EXCEPTION_FORMAT(TRI_ERROR_ARANGO_COLLECTION_NOT_FOUND,
|
||||
"`%s`",
|
||||
colName.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
auto document = trx->documentCollection(cid);
|
||||
|
||||
if (document == nullptr) {
|
||||
THROW_ARANGO_EXCEPTION(TRI_ERROR_ARANGO_COLLECTION_NOT_FOUND);
|
||||
THROW_ARANGO_EXCEPTION_FORMAT(TRI_ERROR_ARANGO_COLLECTION_NOT_FOUND,
|
||||
"`%s`",
|
||||
colName.c_str());
|
||||
}
|
||||
|
||||
triagens::arango::Index* index = nullptr;
|
||||
|
@ -2678,21 +2698,23 @@ AqlValue Functions::Within (triagens::aql::Query* query,
|
|||
true,
|
||||
true);
|
||||
if (res != TRI_ERROR_NO_ERROR) {
|
||||
THROW_ARANGO_EXCEPTION(res);
|
||||
THROW_ARANGO_EXCEPTION_FORMAT(res, "`%s`", colName.c_str());
|
||||
}
|
||||
|
||||
TRI_EnsureCollectionsTransaction(trx->getInternals());
|
||||
collection = trx->trxCollection(cid);
|
||||
|
||||
if (collection == nullptr) {
|
||||
THROW_ARANGO_EXCEPTION(TRI_ERROR_ARANGO_COLLECTION_NOT_FOUND);
|
||||
THROW_ARANGO_EXCEPTION_FORMAT(TRI_ERROR_ARANGO_COLLECTION_NOT_FOUND,
|
||||
"`%s`",
|
||||
colName.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
auto document = trx->documentCollection(cid);
|
||||
|
||||
if (document == nullptr) {
|
||||
THROW_ARANGO_EXCEPTION(TRI_ERROR_ARANGO_COLLECTION_NOT_FOUND);
|
||||
THROW_ARANGO_EXCEPTION(TRI_ERROR_ARANGO_COLLECTION_NOT_FOUND); /// TODO
|
||||
}
|
||||
|
||||
triagens::arango::Index* index = nullptr;
|
||||
|
@ -2965,7 +2987,9 @@ static void RegisterCollectionInTransaction (triagens::arango::AqlTransaction* t
|
|||
TRI_ASSERT(collection == nullptr);
|
||||
cid = trx->resolver()->getCollectionId(collectionName);
|
||||
if (cid == 0) {
|
||||
THROW_ARANGO_EXCEPTION(TRI_ERROR_ARANGO_COLLECTION_NOT_FOUND);
|
||||
THROW_ARANGO_EXCEPTION_FORMAT(TRI_ERROR_ARANGO_COLLECTION_NOT_FOUND,
|
||||
"`%s`",
|
||||
collectionName.c_str());
|
||||
}
|
||||
// ensure the collection is loaded
|
||||
collection = trx->trxCollection(cid);
|
||||
|
@ -2978,7 +3002,7 @@ static void RegisterCollectionInTransaction (triagens::arango::AqlTransaction* t
|
|||
true,
|
||||
true);
|
||||
if (res != TRI_ERROR_NO_ERROR) {
|
||||
THROW_ARANGO_EXCEPTION(res);
|
||||
THROW_ARANGO_EXCEPTION_FORMAT(res, "`%s`", collectionName.c_str());
|
||||
}
|
||||
TRI_EnsureCollectionsTransaction(trx->getInternals());
|
||||
collection = trx->trxCollection(cid);
|
||||
|
@ -3219,7 +3243,9 @@ AqlValue Functions::Edges (triagens::aql::Query* query,
|
|||
|
||||
TRI_voc_cid_t startCid = resolver->getCollectionId(parts[0]);
|
||||
if (startCid == 0) {
|
||||
THROW_ARANGO_EXCEPTION(TRI_ERROR_ARANGO_COLLECTION_NOT_FOUND);
|
||||
THROW_ARANGO_EXCEPTION_FORMAT(TRI_ERROR_ARANGO_COLLECTION_NOT_FOUND,
|
||||
"`%s`",
|
||||
parts[0].c_str());
|
||||
}
|
||||
|
||||
char* key = const_cast<char*>(parts[1].c_str());
|
||||
|
|
|
@ -285,7 +285,7 @@ void RestSimpleHandler::removeByKeys (TRI_json_t const* json) {
|
|||
{
|
||||
auto const* value = TRI_LookupObjectJson(json, "options");
|
||||
if (TRI_IsObjectJson(value)) {
|
||||
value = TRI_LookupObjectJson(json, "waitForSync");
|
||||
value = TRI_LookupObjectJson(value, "waitForSync");
|
||||
if (TRI_IsBooleanJson(value)) {
|
||||
waitForSync = value->_value._boolean;
|
||||
}
|
||||
|
|
|
@ -601,6 +601,7 @@ void ArangoServer::buildApplicationServer () {
|
|||
("server.allow-use-database", &ALLOW_USE_DATABASE_IN_REST_ACTIONS, "allow change of database in REST actions, only needed for unittests")
|
||||
("server.threads", &_dispatcherThreads, "number of threads for basic operations")
|
||||
("server.additional-threads", &_additionalThreads, "number of threads in additional queues")
|
||||
("server.hide-product-header", &HttpResponse::HideProductHeader, "do not expose \"Server: ArangoDB\" header in HTTP responses")
|
||||
("server.foxx-queues", &_foxxQueues, "enable Foxx queues")
|
||||
("server.foxx-queues-poll-interval", &_foxxQueuesPollInterval, "Foxx queue manager poll interval (in seconds)")
|
||||
("server.session-timeout", &VocbaseContext::ServerSessionTtl, "timeout of web interface server sessions (in seconds)")
|
||||
|
|
|
@ -1728,7 +1728,7 @@ static bool RunScripts (v8::Isolate* isolate,
|
|||
current->ForceSet(TRI_V8_ASCII_STRING("__dirname"), TRI_V8_STRING(dirname));
|
||||
TRI_FreeString(TRI_CORE_MEM_ZONE, dirname);
|
||||
|
||||
TRI_ExecuteGlobalJavaScriptFile(isolate, scripts[i].c_str());
|
||||
ok = TRI_ExecuteGlobalJavaScriptFile(isolate, scripts[i].c_str());
|
||||
|
||||
// restore old values for __dirname and __filename
|
||||
if (oldFilename.IsEmpty() || oldFilename->IsUndefined()) {
|
||||
|
@ -1757,6 +1757,9 @@ static bool RunScripts (v8::Isolate* isolate,
|
|||
ok = false;
|
||||
break;
|
||||
}
|
||||
if (!ok) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
BaseClient.flushLog();
|
||||
|
|
|
@ -148,9 +148,6 @@ case $target in
|
|||
armv7l-*-linux-gnueabihf)
|
||||
tr_ARM="yes"
|
||||
tr_ARM7="yes"
|
||||
CFLAGS="$CFLAGS"
|
||||
CXXFLAGS="$CXXFLAGS"
|
||||
CPPFLAGS="$CPPFLAGS"
|
||||
;;
|
||||
|
||||
armv6l-*-linux-gnueabihf)
|
||||
|
|
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
|
@ -7697,7 +7697,7 @@ var lessons = [
|
|||
},
|
||||
{
|
||||
title: "Creating Documents",
|
||||
text: "Now we have a collection, but it is still empty. So let's create some documents!\n\n" +
|
||||
text: "Now we have a collection, but it is empty. So let's create some documents!\n\n" +
|
||||
" db.places.save({ _key : \"foo\", city : \"foo-city\" });\n" +
|
||||
" for (i = 0; i <= 10; i++) { db.places.save({ _key: \"example\" + i, zipcode: i }) };"
|
||||
},
|
||||
|
@ -21639,7 +21639,7 @@ global.aqlQuery = function () {
|
|||
for (i = 1; i < arguments.length; i++) {
|
||||
value = arguments[i];
|
||||
name = 'value' + (i - 1);
|
||||
if (value.constructor && value.constructor.name === 'ArangoCollection') {
|
||||
if (value && value.constructor && value.constructor.name === 'ArangoCollection') {
|
||||
name = '@' + name;
|
||||
value = value.name();
|
||||
}
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
<script src="sharedLibs.js?version=1446219679364"></script>
|
||||
<script src="libs.js?version=1446219679364"></script>
|
||||
<script src="app.js?version=1446219679364"></script>
|
||||
<script src="sharedLibs.js?version=1446837686877"></script>
|
||||
<script src="libs.js?version=1446837686877"></script>
|
||||
<script src="app.js?version=1446837686877"></script>
|
||||
|
|
|
@ -2290,6 +2290,10 @@ if (list.length > 0) {
|
|||
</div>
|
||||
|
||||
<div id="aqlEditor" class='aql-editor'></div>
|
||||
<div id="varsEditorHeader" class='vars-editor-header'>Bind parameters:
|
||||
<i title='Example: </br> { </br>"@collection": "mycollection", </br>"key": "testkey"</br> } </br> Use bind parameters with @@collection and @key in your query' class="fa fa-info-circle"></i>
|
||||
</div>
|
||||
<div id="varsEditor" class='vars-editor'></div>
|
||||
|
||||
|
||||
<div id="wideButtonDiv" class="wide-button-div">
|
||||
|
@ -2612,4 +2616,4 @@ var cutByResolution = function (str) {
|
|||
<% }); %>
|
||||
</ul>
|
||||
</div>
|
||||
<% } %></script></head><body><nav class="navbar"><div class="resizecontainer"><div class="navlogo"><a class="logo" href="#"><img class="arangodbLogo" src="img/arangodb_logo_small.png"></a></div><div id="progressPlaceholderIcon"></div><div class="statmenu" id="statisticBar"></div><div class="usermenu" id="userBar" style="float:right"></div><div class="notificationmenu" id="notificationBar" style="float:right"></div><div class="navmenu" id="navigationBar"></div></div></nav><div class="centralRow resizecontainer"><div id="content" class="centralContent"></div></div><div id="modalPlaceholder"></div><div id="progressPlaceholder" style="display:none"></div><footer class="footer"><div class="resizecontainer" id="footerBar"></div></footer><script src="sharedLibs.js?version=1446219679364"></script><script src="libs.js?version=1446219679364"></script><script src="app.js?version=1446219679364"></script></body></html>
|
||||
<% } %></script></head><body><nav class="navbar"><div class="resizecontainer"><div class="navlogo"><a class="logo" href="#"><img class="arangodbLogo" src="img/arangodb_logo_small.png"></a></div><div id="progressPlaceholderIcon"></div><div class="statmenu" id="statisticBar"></div><div class="usermenu" id="userBar" style="float:right"></div><div class="notificationmenu" id="notificationBar" style="float:right"></div><div class="navmenu" id="navigationBar"></div></div></nav><div class="centralRow resizecontainer"><div id="content" class="centralContent"></div></div><div id="modalPlaceholder"></div><div id="progressPlaceholder" style="display:none"></div><footer class="footer"><div class="resizecontainer" id="footerBar"></div></footer><script src="sharedLibs.js?version=1446837686877"></script><script src="libs.js?version=1446837686877"></script><script src="app.js?version=1446837686877"></script></body></html>
|
Binary file not shown.
|
@ -2467,6 +2467,10 @@ if (list.length > 0) {
|
|||
</div>
|
||||
|
||||
<div id="aqlEditor" class='aql-editor'></div>
|
||||
<div id="varsEditorHeader" class='vars-editor-header'>Bind parameters:
|
||||
<i title='Example: </br> { </br>"@collection": "mycollection", </br>"key": "testkey"</br> } </br> Use bind parameters with @@collection and @key in your query' class="fa fa-info-circle"></i>
|
||||
</div>
|
||||
<div id="varsEditor" class='vars-editor'></div>
|
||||
|
||||
|
||||
<div id="wideButtonDiv" class="wide-button-div">
|
||||
|
@ -2859,9 +2863,9 @@ var cutByResolution = function (str) {
|
|||
</div>
|
||||
</footer>
|
||||
|
||||
<script src="sharedLibs.js?version=1446219679364"></script>
|
||||
<script src="libs.js?version=1446219679364"></script>
|
||||
<script src="app.js?version=1446219679364"></script>
|
||||
<script src="sharedLibs.js?version=1446837686877"></script>
|
||||
<script src="libs.js?version=1446837686877"></script>
|
||||
<script src="app.js?version=1446837686877"></script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
|
File diff suppressed because one or more lines are too long
Binary file not shown.
|
@ -6199,7 +6199,25 @@ toolbar {
|
|||
.queryMethods button a {
|
||||
color: #fff; }
|
||||
|
||||
.aql-editor {
|
||||
.vars-editor-header {
|
||||
border-top: 1px solid rgba(140, 138, 137, 0.25);
|
||||
margin-top: -5px;
|
||||
padding-left: 5px; }
|
||||
.vars-editor-header i {
|
||||
border-radius: 2px;
|
||||
color: #666;
|
||||
height: 15px;
|
||||
margin-left: 5px;
|
||||
padding-left: 3px;
|
||||
padding-top: 1px;
|
||||
width: 15px; }
|
||||
.vars-editor-header i:hover {
|
||||
background-color: #8aa051;
|
||||
color: #fff;
|
||||
cursor: pointer; }
|
||||
|
||||
.aql-editor,
|
||||
.vars-editor {
|
||||
border-color: #a0a0a0;
|
||||
border-left: 0 !important;
|
||||
border-top: 1px solid rgba(140, 138, 137, 0.25) !important;
|
||||
|
@ -6209,7 +6227,9 @@ toolbar {
|
|||
min-width: 99.8%;
|
||||
width: auto; }
|
||||
.aql-editor .ace_error,
|
||||
.aql-editor .ace_info {
|
||||
.aql-editor .ace_info,
|
||||
.vars-editor .ace_error,
|
||||
.vars-editor .ace_info {
|
||||
background: none; }
|
||||
|
||||
.queryTH {
|
||||
|
@ -6424,7 +6444,8 @@ toolbar {
|
|||
position: relative;
|
||||
top: 0;
|
||||
width: 25px; }
|
||||
.editor-toolbar span:hover {
|
||||
.editor-toolbar span:hover,
|
||||
.editor-toolbar .vars-editor-header i {
|
||||
background-color: #8aa051;
|
||||
color: #fff; }
|
||||
.editor-toolbar i {
|
||||
|
@ -6433,11 +6454,13 @@ toolbar {
|
|||
.editor-toolbar i:hover {
|
||||
cursor: pointer; }
|
||||
.editor-toolbar .fa {
|
||||
color: #666;
|
||||
margin-left: 1px;
|
||||
margin-top: 2px; }
|
||||
.editor-toolbar .fa.fa-upload {
|
||||
margin-top: 1px; }
|
||||
.editor-toolbar .icon_arangodb {
|
||||
color: #666;
|
||||
font-size: 14pt; }
|
||||
.editor-toolbar .icon_arangodb:first-child {
|
||||
margin-right: 10px; }
|
||||
|
|
Binary file not shown.
|
@ -53,8 +53,10 @@
|
|||
var queries = [];
|
||||
|
||||
this.each(function(query) {
|
||||
console.log(query.attributes);
|
||||
queries.push({
|
||||
value: query.attributes.value,
|
||||
parameter: query.attributes.parameter,
|
||||
name: query.attributes.name
|
||||
});
|
||||
});
|
||||
|
@ -100,6 +102,7 @@
|
|||
processData: false,
|
||||
success: function() {
|
||||
window.progressView.hide();
|
||||
arangoHelper.arangoNotification("Queries successfully imported.");
|
||||
callback();
|
||||
},
|
||||
error: function() {
|
||||
|
|
|
@ -32,6 +32,10 @@
|
|||
</div>
|
||||
|
||||
<div id="aqlEditor" class='aql-editor'></div>
|
||||
<div id="varsEditorHeader" class='vars-editor-header'>Bind parameters:
|
||||
<i title='Example: </br> { </br>"@collection": "mycollection", </br>"key": "testkey"</br> } </br> Use bind parameters with @@collection and @key in your query' class="fa fa-info-circle"></i>
|
||||
</div>
|
||||
<div id="varsEditor" class='vars-editor'></div>
|
||||
|
||||
|
||||
<div id="wideButtonDiv" class="wide-button-div">
|
||||
|
|
|
@ -21,7 +21,6 @@
|
|||
"click #result-switch": "switchTab",
|
||||
"click #query-switch": "switchTab",
|
||||
'click #customs-switch': "switchTab",
|
||||
// 'click #explain-switch': "switchTab",
|
||||
'click #submitQueryButton': 'submitQuery',
|
||||
'click #explainQueryButton': 'explainQuery',
|
||||
'click #commentText': 'commentText',
|
||||
|
@ -87,6 +86,9 @@
|
|||
_.each(this.tableDescription.rows, function(k) {
|
||||
k.thirdRow = '<a class="deleteButton"><span class="icon_arangodb_roundminus"' +
|
||||
' title="Delete query"></span></a>';
|
||||
if (k.hasOwnProperty('parameter')) {
|
||||
delete k.parameter;
|
||||
}
|
||||
});
|
||||
|
||||
// escape all columns but the third (which contains HTML)
|
||||
|
@ -96,9 +98,12 @@
|
|||
},
|
||||
|
||||
editCustomQuery: function(e) {
|
||||
var queryName = $(e.target).parent().children().first().text();
|
||||
var inputEditor = ace.edit("aqlEditor");
|
||||
var queryName = $(e.target).parent().children().first().text(),
|
||||
inputEditor = ace.edit("aqlEditor"),
|
||||
varsEditor = ace.edit("varsEditor");
|
||||
inputEditor.setValue(this.getCustomQueryValueByName(queryName));
|
||||
varsEditor.setValue(this.getCustomQueryParameterByName(queryName));
|
||||
this.deselect(varsEditor);
|
||||
this.deselect(inputEditor);
|
||||
$('#querySelect').val(queryName);
|
||||
this.switchTab("query-switch");
|
||||
|
@ -147,9 +152,11 @@
|
|||
},
|
||||
|
||||
clearInput: function () {
|
||||
var inputEditor = ace.edit("aqlEditor");
|
||||
this.setCachedQuery(inputEditor.getValue());
|
||||
var inputEditor = ace.edit("aqlEditor"),
|
||||
varsEditor = ace.edit("varsEditor");
|
||||
this.setCachedQuery(inputEditor.getValue(), varsEditor.getValue());
|
||||
inputEditor.setValue('');
|
||||
varsEditor.setValue('');
|
||||
},
|
||||
|
||||
smallOutput: function () {
|
||||
|
@ -176,7 +183,6 @@
|
|||
|
||||
customQueries: [],
|
||||
|
||||
|
||||
tableDescription: {
|
||||
id: "arangoQueryTable",
|
||||
titles: ["Name", "Content", ""],
|
||||
|
@ -220,17 +226,34 @@
|
|||
multiSelectAction: "forEach"
|
||||
});
|
||||
|
||||
var varsEditor = ace.edit("varsEditor");
|
||||
varsEditor.getSession().setMode("ace/mode/aql");
|
||||
varsEditor.setFontSize("13px");
|
||||
varsEditor.commands.addCommand({
|
||||
name: "togglecomment",
|
||||
bindKey: {win: "Ctrl-Shift-C", linux: "Ctrl-Shift-C", mac: "Command-Shift-C"},
|
||||
exec: function (editor) {
|
||||
editor.toggleCommentLines();
|
||||
},
|
||||
multiSelectAction: "forEach"
|
||||
});
|
||||
|
||||
//get cached query if available
|
||||
var query = this.getCachedQuery();
|
||||
if (query !== null && query !== undefined && query !== "") {
|
||||
inputEditor.setValue(query);
|
||||
var queryObject = this.getCachedQuery();
|
||||
if (queryObject !== null && queryObject !== undefined && queryObject !== "") {
|
||||
inputEditor.setValue(queryObject.query);
|
||||
if (queryObject.parameter === '' || queryObject === undefined) {
|
||||
varsEditor.setValue('{}');
|
||||
}
|
||||
else {
|
||||
varsEditor.setValue(queryObject.parameter);
|
||||
}
|
||||
}
|
||||
|
||||
inputEditor.getSession().selection.on('changeCursor', function () {
|
||||
var inputEditor = ace.edit("aqlEditor");
|
||||
var session = inputEditor.getSession();
|
||||
var cursor = inputEditor.getCursorPosition();
|
||||
var token = session.getTokenAt(cursor.row, cursor.column);
|
||||
var changedFunction = function() {
|
||||
var session = inputEditor.getSession(),
|
||||
cursor = inputEditor.getCursorPosition(),
|
||||
token = session.getTokenAt(cursor.row, cursor.column);
|
||||
if (token) {
|
||||
if (token.type === "comment") {
|
||||
$("#commentText i")
|
||||
|
@ -245,8 +268,27 @@
|
|||
}
|
||||
}
|
||||
//cache query in localstorage
|
||||
self.setCachedQuery(inputEditor.getValue());
|
||||
var a = inputEditor.getValue(),
|
||||
b = varsEditor.getValue();
|
||||
|
||||
if (a.length === 1) {
|
||||
a = "";
|
||||
}
|
||||
if (b.length === 1) {
|
||||
b = "";
|
||||
}
|
||||
|
||||
self.setCachedQuery(a, b);
|
||||
};
|
||||
|
||||
inputEditor.getSession().selection.on('changeCursor', function () {
|
||||
changedFunction();
|
||||
});
|
||||
|
||||
varsEditor.getSession().selection.on('changeCursor', function () {
|
||||
changedFunction();
|
||||
});
|
||||
|
||||
$('#queryOutput').resizable({
|
||||
handles: "s",
|
||||
ghost: true,
|
||||
|
@ -258,12 +300,13 @@
|
|||
}
|
||||
});
|
||||
|
||||
arangoHelper.fixTooltips(".queryTooltips, .icon_arangodb", "top");
|
||||
arangoHelper.fixTooltips(".vars-editor-header i, .queryTooltips, .icon_arangodb", "top");
|
||||
|
||||
$('#aqlEditor .ace_text-input').focus();
|
||||
|
||||
var windowHeight = $(window).height() - 295;
|
||||
$('#aqlEditor').height(windowHeight - 19);
|
||||
$('#aqlEditor').height(windowHeight - 100 - 29);
|
||||
$('#varsEditor').height(100);
|
||||
$('#queryOutput').height(windowHeight);
|
||||
|
||||
inputEditor.resize();
|
||||
|
@ -271,6 +314,7 @@
|
|||
|
||||
this.initTabArray();
|
||||
this.renderSelectboxes();
|
||||
this.deselect(varsEditor);
|
||||
this.deselect(outputEditor);
|
||||
this.deselect(inputEditor);
|
||||
|
||||
|
@ -294,9 +338,13 @@
|
|||
}
|
||||
},
|
||||
|
||||
setCachedQuery: function(query) {
|
||||
setCachedQuery: function(query, vars) {
|
||||
if (typeof(Storage) !== "undefined") {
|
||||
localStorage.setItem("cachedQuery", JSON.stringify(query));
|
||||
var myObject = {
|
||||
query: query,
|
||||
parameter: vars
|
||||
};
|
||||
localStorage.setItem("cachedQuery", JSON.stringify(myObject));
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -345,7 +393,7 @@
|
|||
exportCustomQueries: function () {
|
||||
var name, toExport = {}, exportArray = [];
|
||||
_.each(this.customQueries, function(value, key) {
|
||||
exportArray.push({name: value.name, value: value.value});
|
||||
exportArray.push({name: value.name, value: value.value, parameter: value.parameter});
|
||||
});
|
||||
toExport = {
|
||||
"extra": {
|
||||
|
@ -446,7 +494,8 @@
|
|||
this.collection.each(function(model) {
|
||||
self.customQueries.push({
|
||||
name: model.get("name"),
|
||||
value: model.get("value")
|
||||
value: model.get("value"),
|
||||
parameter: model.get("parameter")
|
||||
});
|
||||
});
|
||||
},
|
||||
|
@ -457,8 +506,10 @@
|
|||
//update queries first, before writing
|
||||
this.refreshAQL();
|
||||
|
||||
var inputEditor = ace.edit("aqlEditor");
|
||||
var saveName = $('#new-query-name').val();
|
||||
var inputEditor = ace.edit("aqlEditor"),
|
||||
varsEditor = ace.edit("varsEditor"),
|
||||
saveName = $('#new-query-name').val(),
|
||||
bindVars = varsEditor.getValue();
|
||||
|
||||
if ($('#new-query-name').hasClass('invalid-input')) {
|
||||
return;
|
||||
|
@ -469,9 +520,9 @@
|
|||
return;
|
||||
}
|
||||
|
||||
var content = inputEditor.getValue();
|
||||
var content = inputEditor.getValue(),
|
||||
//check for already existing entry
|
||||
var quit = false;
|
||||
quit = false;
|
||||
$.each(this.customQueries, function (k, v) {
|
||||
if (v.name === saveName) {
|
||||
v.value = content;
|
||||
|
@ -482,14 +533,21 @@
|
|||
|
||||
if (quit === true) {
|
||||
//Heiko: Form-Validator - name already taken
|
||||
window.modalView.hide();
|
||||
return;
|
||||
// Update model and save
|
||||
this.collection.findWhere({name: saveName}).set("value", content);
|
||||
}
|
||||
else {
|
||||
if (bindVars === '' || bindVars === undefined) {
|
||||
bindVars = '{}';
|
||||
}
|
||||
|
||||
this.collection.add({
|
||||
name: saveName,
|
||||
parameter: bindVars,
|
||||
value: content
|
||||
});
|
||||
}
|
||||
|
||||
this.collection.saveCollectionQueries();
|
||||
|
||||
window.modalView.hide();
|
||||
|
@ -518,13 +576,11 @@
|
|||
},
|
||||
|
||||
getCustomQueryValueByName: function (qName) {
|
||||
var returnVal;
|
||||
$.each(this.customQueries, function (k, v) {
|
||||
if (qName === v.name) {
|
||||
returnVal = v.value;
|
||||
}
|
||||
});
|
||||
return returnVal;
|
||||
return this.collection.findWhere({name: qName}).get("value");
|
||||
},
|
||||
|
||||
getCustomQueryParameterByName: function (qName) {
|
||||
return this.collection.findWhere({name: qName}).get("parameter");
|
||||
},
|
||||
|
||||
refreshAQL: function(select) {
|
||||
|
@ -540,7 +596,8 @@
|
|||
},
|
||||
|
||||
importSelected: function (e) {
|
||||
var inputEditor = ace.edit("aqlEditor");
|
||||
var inputEditor = ace.edit("aqlEditor"),
|
||||
varsEditor = ace.edit("varsEditor");
|
||||
$.each(this.queries, function (k, v) {
|
||||
if ($('#' + e.currentTarget.id).val() === v.name) {
|
||||
inputEditor.setValue(v.value);
|
||||
|
@ -549,6 +606,16 @@
|
|||
$.each(this.customQueries, function (k, v) {
|
||||
if ($('#' + e.currentTarget.id).val() === v.name) {
|
||||
inputEditor.setValue(v.value);
|
||||
|
||||
if (v.hasOwnProperty('parameter')) {
|
||||
if (v.parameter === '' || v.parameter === undefined) {
|
||||
v.parameter = '{}';
|
||||
}
|
||||
varsEditor.setValue(v.parameter);
|
||||
}
|
||||
else {
|
||||
varsEditor.setValue('{}');
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -593,23 +660,9 @@
|
|||
this.customQueries = _.sortBy(this.customQueries, 'name');
|
||||
},
|
||||
|
||||
abortQuery: function () {
|
||||
/*
|
||||
$.ajax({
|
||||
type: "DELETE",
|
||||
url: "/_api/cursor/currentFrontendQuery",
|
||||
contentType: "application/json",
|
||||
processData: false,
|
||||
success: function (data) {
|
||||
},
|
||||
error: function (data) {
|
||||
}
|
||||
});
|
||||
*/
|
||||
},
|
||||
|
||||
readQueryData: function() {
|
||||
var inputEditor = ace.edit("aqlEditor");
|
||||
var varsEditor = ace.edit("varsEditor");
|
||||
var selectedText = inputEditor.session.getTextRange(inputEditor.getSelectionRange());
|
||||
var sizeBox = $('#querySize');
|
||||
var data = {
|
||||
|
@ -617,6 +670,19 @@
|
|||
batchSize: parseInt(sizeBox.val(), 10),
|
||||
id: "currentFrontendQuery"
|
||||
};
|
||||
|
||||
var bindVars = varsEditor.getValue();
|
||||
if (bindVars.length > 0) {
|
||||
try {
|
||||
var params = JSON.parse(bindVars);
|
||||
if (Object.keys(params).length !== 0) {
|
||||
data.bindVars = params;
|
||||
}
|
||||
}
|
||||
catch (e) {
|
||||
arangoHelper.arangoError("Query error", "Could not parse bind parameters.");
|
||||
}
|
||||
}
|
||||
return JSON.stringify(data);
|
||||
},
|
||||
|
||||
|
@ -848,7 +914,6 @@
|
|||
error: function (errObj) {
|
||||
var res = errObj.responseJSON;
|
||||
// Display ErrorMessage
|
||||
console.log("Error:", res.errorMessage);
|
||||
}
|
||||
});
|
||||
*/
|
||||
|
@ -931,7 +996,7 @@
|
|||
try {
|
||||
var temp = JSON.parse(data.responseText);
|
||||
outputEditor.setValue('[' + temp.errorNum + '] ' + temp.errorMessage);
|
||||
arangoHelper.arangoError("Query error", temp.errorNum, temp.errorMessage);
|
||||
//arangoHelper.arangoError("Query error", temp.errorMessage);
|
||||
}
|
||||
catch (e) {
|
||||
outputEditor.setValue('ERROR');
|
||||
|
|
|
@ -68,7 +68,31 @@ toolbar {
|
|||
@extend %toolbar;
|
||||
}
|
||||
|
||||
.aql-editor {
|
||||
.vars-editor-header {
|
||||
border-top: 1px solid $c-content-border;
|
||||
margin-top: -5px;
|
||||
padding-left: 5px;
|
||||
|
||||
i {
|
||||
border-radius: 2px;
|
||||
color: $c-darker-grey;
|
||||
height: 15px;
|
||||
margin-left: 5px;
|
||||
padding-left: 3px;
|
||||
padding-top: 1px;
|
||||
width: 15px;
|
||||
}
|
||||
|
||||
i:hover {
|
||||
background-color: $c-positive;
|
||||
color: $c-white;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.aql-editor,
|
||||
.vars-editor {
|
||||
@extend %toolbar;
|
||||
border-color: $c-editor-toolbar;
|
||||
border-left: 0 !important;
|
||||
|
@ -376,7 +400,8 @@ toolbar {
|
|||
width: 25px;
|
||||
}
|
||||
|
||||
span:hover {
|
||||
span:hover,
|
||||
.vars-editor-header i {
|
||||
background-color: $c-positive;
|
||||
color: $c-white;
|
||||
}
|
||||
|
@ -391,6 +416,7 @@ toolbar {
|
|||
}
|
||||
|
||||
.fa {
|
||||
color: $c-darker-grey;
|
||||
margin-left: 1px;
|
||||
margin-top: 2px;
|
||||
|
||||
|
@ -400,6 +426,7 @@ toolbar {
|
|||
}
|
||||
|
||||
.icon_arangodb {
|
||||
color: $c-darker-grey;
|
||||
font-size: 14pt;
|
||||
|
||||
&:first-child {
|
||||
|
|
|
@ -735,7 +735,7 @@ var loadGraph = function(name) {
|
|||
}
|
||||
|
||||
dropGraph(name);
|
||||
knownGraphs[name]();
|
||||
return knownGraphs[name]();
|
||||
};
|
||||
|
||||
exports.loadGraph = loadGraph;
|
||||
|
|
|
@ -452,7 +452,7 @@ function ahuacatlQueryNeighborsTestSuite () {
|
|||
actual = getQueryResults(queryStart + theFox + queryEnd);
|
||||
assertEqual(actual, [ ]);
|
||||
|
||||
assertQueryError(errors.ERROR_ARANGO_COLLECTION_NOT_FOUND.code, queryStart + "thefox/thefox" + queryEnd);
|
||||
assertQueryError(errors.ERROR_GRAPH_INVALID_PARAMETER.code, queryStart + "thefox/thefox" + queryEnd);
|
||||
|
||||
// Including Data
|
||||
actual = getRawQueryResults(queryStart + v3 + queryEndData);
|
||||
|
@ -504,7 +504,7 @@ function ahuacatlQueryNeighborsTestSuite () {
|
|||
actual = getQueryResults(queryStart + theFox + queryEnd);
|
||||
assertEqual(actual, [ ]);
|
||||
|
||||
assertQueryError(errors.ERROR_ARANGO_COLLECTION_NOT_FOUND.code, queryStart + "thefox/thefox" + queryEnd);
|
||||
assertQueryError(errors.ERROR_GRAPH_INVALID_PARAMETER.code, queryStart + "thefox/thefox" + queryEnd);
|
||||
|
||||
// Inclunding Data
|
||||
actual = getRawQueryResults(queryStart + v3 + queryEndData);
|
||||
|
@ -555,7 +555,7 @@ function ahuacatlQueryNeighborsTestSuite () {
|
|||
actual = getQueryResults(queryStart + theFox + queryEnd);
|
||||
assertEqual(actual, [ ]);
|
||||
|
||||
assertQueryError(errors.ERROR_ARANGO_COLLECTION_NOT_FOUND.code, queryStart + "thefox/thefox" + queryEnd);
|
||||
assertQueryError(errors.ERROR_GRAPH_INVALID_PARAMETER.code, queryStart + "thefox/thefox" + queryEnd);
|
||||
|
||||
// Inclunding Data
|
||||
actual = getRawQueryResults(queryStart + v3 + queryEndData);
|
||||
|
|
|
@ -49,7 +49,6 @@ SET(LIB_ARANGO_CONSOLE
|
|||
Utilities/LinenoiseShell.cpp
|
||||
)
|
||||
|
||||
|
||||
add_library(
|
||||
${LIB_ARANGO}
|
||||
STATIC
|
||||
|
|
|
@ -47,6 +47,12 @@ using namespace std;
|
|||
|
||||
std::string const HttpResponse::BatchErrorHeader = "X-Arango-Errors";
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief hide header "Server: ArangoDB" in HTTP responses
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
bool HttpResponse::HideProductHeader = false;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief http response string
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -266,7 +272,9 @@ HttpResponse::HttpResponse (HttpResponseCode code,
|
|||
_bodySize(0),
|
||||
_freeables() {
|
||||
|
||||
if (! HideProductHeader) {
|
||||
_headers.insert(TRI_CHAR_LENGTH_PAIR("server"), "ArangoDB");
|
||||
}
|
||||
_headers.insert(TRI_CHAR_LENGTH_PAIR("connection"), "Keep-Alive");
|
||||
_headers.insert(TRI_CHAR_LENGTH_PAIR("content-type"), "text/plain; charset=utf-8");
|
||||
}
|
||||
|
|
|
@ -453,6 +453,21 @@ namespace triagens {
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
static std::string const BatchErrorHeader;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief hide the "Server: ArangoDB" header in HTTP responses
|
||||
/// @startDocuBlock serverHideProductHeader
|
||||
/// `--server.hide-product-header`
|
||||
///
|
||||
/// If *true*, the server will exclude the HTTP header "Server: ArangoDB" in
|
||||
/// HTTP responses. If set to *false*, the server will send the header in
|
||||
/// responses.
|
||||
///
|
||||
/// The default is *false*.
|
||||
/// @endDocuBlock
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
static bool HideProductHeader;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -82,6 +82,7 @@ LinenoiseShell::LinenoiseShell (std::string const& history,
|
|||
: ShellBase(history, completer) {
|
||||
COMPLETER = completer;
|
||||
linenoiseSetCompletionCallback(LinenoiseCompletionGenerator);
|
||||
linenoiseInstallWindowChangeHandler();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -101,6 +101,18 @@ namespace arangodb {
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
std::string getLine (const std::string& prompt, bool& eof) override final;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief whether or not the shell implementation supports colors
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
bool supportsColors () const override final {
|
||||
#ifdef _WIN32
|
||||
return false;
|
||||
#else
|
||||
return true;
|
||||
#endif
|
||||
}
|
||||
};
|
||||
}
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue