diff --git a/SimpleHttpClient/SimpleHttpClient.cpp b/SimpleHttpClient/SimpleHttpClient.cpp index 5198df95a3..04225e5fa1 100644 --- a/SimpleHttpClient/SimpleHttpClient.cpp +++ b/SimpleHttpClient/SimpleHttpClient.cpp @@ -58,12 +58,14 @@ namespace triagens { int port, double requestTimeout, double connectTimeout, - size_t connectRetries) : + size_t connectRetries, + bool warn = true) : _hostname(hostname), _port(port), _requestTimeout(requestTimeout), _connectTimeout(connectTimeout), _connectRetries(connectRetries), + _warn(warn), _writeBuffer(TRI_UNKNOWN_MEM_ZONE), _readBuffer(TRI_UNKNOWN_MEM_ZONE) { @@ -129,7 +131,9 @@ namespace triagens { } if (isWorking() && _errorMessage=="" ) { - LOGGER_ERROR << "Request timeout reached."; + if (_warn) { + LOGGER_WARNING << "Request timeout reached."; + } _errorMessage = "Request timeout reached."; } @@ -153,14 +157,15 @@ namespace triagens { _numConnectRetries++; } else { - LOGGER_ERROR << "Could not connect to '" << _hostname << ":" << _port << "'! Connection is dead"; + if (_warn) { + LOGGER_WARNING << "Could not connect to '" << _hostname << ":" << _port << "'! Connection is dead"; + } _state = DEAD; return; } if (_hostname == "" || _port == 0) { _errorMessage = "Could not connect to '" + _hostname + ":" + StringUtils::itoa(_port) + "'"; - LOGGER_ERROR << "Could not connect to '" << _hostname << ":" << _port << "'! Connection is dead"; _state = DEAD; return; } diff --git a/SimpleHttpClient/SimpleHttpClient.h b/SimpleHttpClient/SimpleHttpClient.h index a9b3d5ac5b..5b1cc30f94 100644 --- a/SimpleHttpClient/SimpleHttpClient.h +++ b/SimpleHttpClient/SimpleHttpClient.h @@ -90,7 +90,8 @@ namespace triagens { int port, double requestTimeout, double connectTimeout, - size_t connectRetries); + size_t connectRetries, + bool warn); //////////////////////////////////////////////////////////////////////////////// /// @brief destructs a http client @@ -302,6 +303,7 @@ namespace triagens { double _requestTimeout; double _connectTimeout; size_t _connectRetries; + bool _warn; socket_t _socket; diff --git a/V8Client/V8ClientConnection.cpp b/V8Client/V8ClientConnection.cpp index e2218786a8..3a941914da 100644 --- a/V8Client/V8ClientConnection.cpp +++ b/V8Client/V8ClientConnection.cpp @@ -66,12 +66,13 @@ namespace triagens { int port, double requestTimeout, size_t retries, - double connectionTimeout) : _client(0), _httpResult(0) { + double connectionTimeout, + bool warn) : _client(0), _httpResult(0) { _connected = false; _lastHttpReturnCode = 0; _lastErrorMessage = ""; - _client = new SimpleHttpClient(hostname, port, requestTimeout, retries, connectionTimeout); + _client = new SimpleHttpClient(hostname, port, requestTimeout, retries, connectionTimeout, warn); // connect to server and get version number map headerFields; diff --git a/V8Client/V8ClientConnection.h b/V8Client/V8ClientConnection.h index 762b61fcb5..31e54bcaef 100644 --- a/V8Client/V8ClientConnection.h +++ b/V8Client/V8ClientConnection.h @@ -81,7 +81,8 @@ namespace triagens { int port, double requestTimeout, size_t retries, - double connectionTimeout); + double connectionTimeout, + bool warn); //////////////////////////////////////////////////////////////////////////////// /// @brief destructor diff --git a/V8Client/arangoimp.cpp b/V8Client/arangoimp.cpp index 78d7e27108..d5fe960b47 100644 --- a/V8Client/arangoimp.cpp +++ b/V8Client/arangoimp.cpp @@ -64,9 +64,9 @@ using namespace triagens::v8client; static string DEFAULT_SERVER_NAME = "localhost"; static int DEFAULT_SERVER_PORT = 8529; -static double DEFAULT_REQUEST_TIMEOUT = 10.0; +static int64_t DEFAULT_REQUEST_TIMEOUT = 300; static size_t DEFAULT_RETRIES = 5; -static double DEFAULT_CONNECTION_TIMEOUT = 1.0; +static int64_t DEFAULT_CONNECTION_TIMEOUT = 5; //////////////////////////////////////////////////////////////////////////////// /// @brief server address @@ -86,6 +86,18 @@ V8ClientConnection* clientConnection = 0; static uint64_t maxUploadSize = 500000; +//////////////////////////////////////////////////////////////////////////////// +/// @brief connect timeout (in s) +//////////////////////////////////////////////////////////////////////////////// + +static int64_t connectTimeout = DEFAULT_CONNECTION_TIMEOUT; + +//////////////////////////////////////////////////////////////////////////////// +/// @brief request timeout (in s) +//////////////////////////////////////////////////////////////////////////////// + +static int64_t requestTimeout = DEFAULT_REQUEST_TIMEOUT; + static string QuoteChar = "\""; static string SeparatorChar = ","; static string FileName = ""; @@ -164,6 +176,8 @@ static void ParseProgramOptions (int argc, char* argv[]) { ("quote", &QuoteChar, "quote character") ("separator", &SeparatorChar, "separator character") ("max-upload-size", &maxUploadSize, "maximum size of import chunks") + ("connect-timeout", &connectTimeout, "connect timeout in seconds") + ("request-timeout", &requestTimeout, "request timeout in seconds") ; vector myargs; @@ -218,6 +232,17 @@ int main (int argc, char* argv[]) { // parse the program options ParseProgramOptions(argc, argv); + // check connection args + if (connectTimeout <= 0) { + cout << "invalid value for connect-timeout." << endl; + return EXIT_FAILURE; + } + + if (requestTimeout <= 0) { + cout << "invalid value for request-timeout." << endl; + return EXIT_FAILURE; + } + // processComandLineArguments(argc, argv); if (! splitServerAdress(ServerAddress, DEFAULT_SERVER_NAME, DEFAULT_SERVER_PORT)) { if (ServerAddress.length()) { @@ -228,10 +253,11 @@ int main (int argc, char* argv[]) { clientConnection = new V8ClientConnection( DEFAULT_SERVER_NAME, DEFAULT_SERVER_PORT, - DEFAULT_REQUEST_TIMEOUT, + (double) requestTimeout, DEFAULT_RETRIES, - DEFAULT_CONNECTION_TIMEOUT); - + (double) connectTimeout, + true); + if (clientConnection->isConnected()) { printf("Connected to Arango DB %s:%d Version %s\n", clientConnection->getHostname().c_str(), @@ -239,12 +265,14 @@ int main (int argc, char* argv[]) { clientConnection->getVersion().c_str()); cout << "----------------------------------------" << endl; - cout << "collection : " << CollectionName << endl; - cout << "create : " << (CreateCollection ? "yes" : "no") << endl; - cout << "file : " << FileName << endl; - cout << "type : " << TypeImport << endl; - cout << "quote : " << QuoteChar << endl; - cout << "separator : " << SeparatorChar << endl; + cout << "collection : " << CollectionName << endl; + cout << "create : " << (CreateCollection ? "yes" : "no") << endl; + cout << "file : " << FileName << endl; + cout << "type : " << TypeImport << endl; + cout << "quote : " << QuoteChar << endl; + cout << "separator : " << SeparatorChar << endl; + cout << "connect timeout : " << connectTimeout << endl; + cout << "request timeout : " << requestTimeout << endl; cout << "----------------------------------------" << endl; ImportHelper ih(clientConnection->getHttpClient(), maxUploadSize); @@ -257,7 +285,7 @@ int main (int argc, char* argv[]) { ih.setQuote(QuoteChar[0]); } else { - cout << "Wrong lenght of quote character." << endl; + cout << "Wrong length of quote character." << endl; return EXIT_FAILURE; } @@ -265,7 +293,7 @@ int main (int argc, char* argv[]) { ih.setSeparator(SeparatorChar[0]); } else { - cout << "Wrong lenght of separator character." << endl; + cout << "Wrong length of separator character." << endl; return EXIT_FAILURE; } diff --git a/V8Client/arangosh.cpp b/V8Client/arangosh.cpp index 4f6c893f87..813608bfcc 100644 --- a/V8Client/arangosh.cpp +++ b/V8Client/arangosh.cpp @@ -83,9 +83,9 @@ using namespace triagens::arango; static string DEFAULT_SERVER_NAME = "localhost"; static int DEFAULT_SERVER_PORT = 8529; -static double DEFAULT_REQUEST_TIMEOUT = 10.0; +static int64_t DEFAULT_REQUEST_TIMEOUT = 300; static size_t DEFAULT_RETRIES = 5; -static double DEFAULT_CONNECTION_TIMEOUT = 1.0; +static int64_t DEFAULT_CONNECTION_TIMEOUT = 5; //////////////////////////////////////////////////////////////////////////////// /// @brief quite start @@ -189,6 +189,18 @@ regex_t intRegex; static uint64_t maxUploadSize = 500000; +//////////////////////////////////////////////////////////////////////////////// +/// @brief connect timeout (in s) +//////////////////////////////////////////////////////////////////////////////// + +static int64_t connectTimeout = DEFAULT_CONNECTION_TIMEOUT; + +//////////////////////////////////////////////////////////////////////////////// +/// @brief request timeout (in s) +//////////////////////////////////////////////////////////////////////////////// + +static int64_t requestTimeout = DEFAULT_REQUEST_TIMEOUT; + //////////////////////////////////////////////////////////////////////////////// /// @} //////////////////////////////////////////////////////////////////////////////// @@ -534,6 +546,8 @@ static void ParseProgramOptions (int argc, char* argv[]) { ("pretty-print", "pretty print values") ("no-colors", "deactivate color support") ("no-auto-complete", "disable auto completion") + ("connect-timeout", &connectTimeout, "connect timeout in seconds") + ("request-timeout", &requestTimeout, "request timeout in seconds") ("unit-tests", &UnitTests, "do not start as shell, run unit tests instead") ("max-upload-size", &maxUploadSize, "maximum size of import chunks") (hidden, true) @@ -649,10 +663,8 @@ static v8::Handle ClientConnection_ConstructorCallback (v8::Arguments string server = DEFAULT_SERVER_NAME; int port = DEFAULT_SERVER_PORT; - double requestTimeout = DEFAULT_REQUEST_TIMEOUT; size_t retries = DEFAULT_RETRIES; - double connectionTimeout = DEFAULT_CONNECTION_TIMEOUT; - + if (argv.Length() > 0 && argv[0]->IsString()) { string definition = TRI_ObjectToString(argv[0]); @@ -663,7 +675,7 @@ static v8::Handle ClientConnection_ConstructorCallback (v8::Arguments } - V8ClientConnection* connection = new V8ClientConnection(server, port, requestTimeout, retries, connectionTimeout); + V8ClientConnection* connection = new V8ClientConnection(server, port, (double) requestTimeout, retries, (double) connectTimeout, false); if (connection->isConnected()) { printf("Connected to Arango DB %s:%d Version %s\n", @@ -1153,6 +1165,17 @@ int main (int argc, char* argv[]) { // parse the program options ParseProgramOptions(argc, argv); + + // check connection args + if (connectTimeout <= 0) { + cout << "invalid value for connect-timeout." << endl; + return EXIT_FAILURE; + } + + if (requestTimeout <= 0) { + cout << "invalid value for request-timeout." << endl; + return EXIT_FAILURE; + } v8::HandleScope handle_scope; @@ -1193,9 +1216,10 @@ int main (int argc, char* argv[]) { clientConnection = new V8ClientConnection( DEFAULT_SERVER_NAME, DEFAULT_SERVER_PORT, - DEFAULT_REQUEST_TIMEOUT, + (double) requestTimeout, DEFAULT_RETRIES, - DEFAULT_CONNECTION_TIMEOUT); + (double) connectTimeout, + false); } // ............................................................................. diff --git a/html/admin/css/jquery.dataTables_themeroller.css b/html/admin/css/jquery.dataTables_themeroller.css index 6262c60ef3..c329bc2a7c 100644 --- a/html/admin/css/jquery.dataTables_themeroller.css +++ b/html/admin/css/jquery.dataTables_themeroller.css @@ -15,6 +15,10 @@ table.dataTable thead th { *cursor: hand; } +#subCenterView table.dataTable thead th { + cursor: default !important; +} + table.dataTable tfoot th { padding: 3px 10px; } diff --git a/html/admin/css/layout.css b/html/admin/css/layout.css index b3c0437ed8..364e9a553e 100644 --- a/html/admin/css/layout.css +++ b/html/admin/css/layout.css @@ -7,8 +7,8 @@ } .writeable { - width: 100%; word-wrap: break-word; + width:auto !important; } #delete { @@ -346,6 +346,13 @@ form { float:right; } +#formatshellJSONyesno { + float:right; + padding-right:10px; + margin-top: -3px; + color: #797979; +} + #formatJSONyesno { margin-top: -40px; float:right; @@ -654,7 +661,7 @@ form { line-height: 1; text-align: center; text-shadow: 0 1px 0 #fff; - width: 80px; + width: 90px; } #menue button.minimal:hover { background: #d9d9d9; diff --git a/html/admin/index.html b/html/admin/index.html index 471cac216d..e7c92e5148 100644 --- a/html/admin/index.html +++ b/html/admin/index.html @@ -1,7 +1,7 @@ - WebAdmin + ArangoDB - WebAdmin