diff --git a/CHANGELOG b/CHANGELOG index 69f44d0ad3..227e6873e3 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,21 @@ v1.5.0 (XXXX-XX-XX) ------------------- +* issue #756: set access-control-expose-headers on CORS response + + the following headers are now whitelisted by ArangoDB in CORS responses: + - etag + - content-encoding + - content-length + - location + - server + - x-arango-errors + - x-arango-async-id + +* Several UI improvements. + +* Exchanged icons in the graphviewer toolbar + * always start networking and HTTP listeners when starting the server (even in console mode) @@ -176,6 +191,52 @@ v1.5.0 (XXXX-XX-XX) v1.4.9 (XXXX-XX-XX) ------------------- +* return a document's current etag in response header for HTTP HEAD requests on + documents that return an HTTP 412 (precondition failed) error. This allows + retrieving the document's current revision easily. + +* added AQL function `SKIPLIST` to directly access skiplist indexes from AQL + + This is a shortcut method to use a skiplist index for retrieving specific documents in + indexed order. The function capability is rather limited, but it may be used + for several cases to speed up queries. The documents are returned in index order if + only one condition is used. + + /* return all documents with mycollection.created > 12345678 */ + FOR doc IN SKIPLIST(mycollection, { created: [[ '>', 12345678 ]] }) + RETURN doc + + /* return first document with mycollection.created > 12345678 */ + FOR doc IN SKIPLIST(mycollection, { created: [[ '>', 12345678 ]] }, 0, 1) + RETURN doc + + /* return all documents with mycollection.created between 12345678 and 123456790 */ + FOR doc IN SKIPLIST(mycollection, { created: [[ '>', 12345678 ], [ '<=', 123456790 ]] }) + RETURN doc + + /* return all documents with mycollection.a equal 1 and .b equal 2 */ + FOR doc IN SKIPLIST(mycollection, { a: [[ '==', 1 ]], b: [[ '==', 2 ]] }) + RETURN doc + + The function requires a skiplist index with the exact same attributes to + be present on the specified colelction. All attributes present in the skiplist + index must be specified in the conditions specified for the `SKIPLIST` function. + Attribute declaration order is important, too: attributes must be specified in the + same order in the condition as they have been declared in the skiplist index. + +* added command-line option `--server.disable-authentication-unix-sockets` + + with this option, authentication can be disabled for all requests coming + in via UNIX domain sockets, enabling clients located on the same host as + the ArangoDB server to connect without authentication. + Other connections (e.g. TCP/IP) are not affected by this option. + + The default value for this option is `false`. + Note: this option is only supported on platforms that support Unix domain + sockets. + +* call global arangod instance destructor on shutdown + * issue #755: TRAVERSAL does not use strategy, order and itemOrder options these options were not honored when configuring a traversal via the AQL diff --git a/Documentation/InstallationManual/Compiling.md b/Documentation/InstallationManual/Compiling.md index 2f60f1d430..a2f946ca7d 100644 --- a/Documentation/InstallationManual/Compiling.md +++ b/Documentation/InstallationManual/Compiling.md @@ -127,7 +127,7 @@ database directory you specified exists and can be written into. Use your favorite browser to access the URL - http://127.0.0.1:12345/version + http://127.0.0.1:12345/_api/version This should produce a JSON object like diff --git a/Documentation/InstallationManual/Installing.md b/Documentation/InstallationManual/Installing.md index 12a7d67f1b..987ed55692 100644 --- a/Documentation/InstallationManual/Installing.md +++ b/Documentation/InstallationManual/Installing.md @@ -79,7 +79,7 @@ graphical user interface to start and stop the server. Homebrew {#InstallingMacOSXHomebrew} ------------------------------------ -If you are using @S_EXTREF{http://mxcl.github.com/homebrew/,homebrew}, +If you are using @S_EXTREF{http://brew.sh/}, then you can install the ArangoDB using `brew` as follows: brew install arangodb diff --git a/Documentation/UserManual/Aql.md b/Documentation/UserManual/Aql.md index 284827f6ba..a0eb4994ec 100644 --- a/Documentation/UserManual/Aql.md +++ b/Documentation/UserManual/Aql.md @@ -1727,6 +1727,23 @@ function categories: DOCUMENT("users/john") DOCUMENT([ "users/john", "users/amy" ]) +- @FN{SKIPLIST(@FA{collection}, @FA{condition}, @FA{skip}, @FA{limit})}: return all documents + from a skiplist index on collection @FA{collection} that match the specified @FA{condition}. + This is a shortcut method to use a skiplist index for retrieving specific documents in + indexed order. The skiplist index supports equality and less than/greater than queries. The + @FA{skip} and @FA{limit} parameters are optional but can be specified to further limit the + results: + + SKIPLIST(test, { created: [[ '>', 0 ]] }, 0, 100) + SKIPLIST(test, { age: [[ '>', 25 ], [ '<=', 65 ]] }) + SKIPLIST(test, { a: [[ '==', 10 ]], b: [[ '==', 25 ]] } + + The @FA{condition} document must contain an entry for each attribute that is contained in the + index. It is not allowed to specify just a subset of attributes that are present in an index. + Additionally the attributes in the @FA{condition} document must be specified in the same order + as in the index. + If no suitable skiplist index is found, an error will be raised and the query will be aborted. + High-level operations {#AqlOperations} ====================================== diff --git a/Documentation/UserManual/CommandLine.md b/Documentation/UserManual/CommandLine.md index e3c73a2be9..b2bd3089a2 100644 --- a/Documentation/UserManual/CommandLine.md +++ b/Documentation/UserManual/CommandLine.md @@ -107,6 +107,10 @@ Command-Line Options for arangod {#CommandLineArangod} @anchor CommandLineArangoDisableAuthentication @copydetails triagens::arango::ArangoServer::_disableAuthentication +@CLEARPAGE +@anchor CommandLineArangoDisableAuthenticationUnixSockets +@copydetails triagens::arango::ArangoServer::_disableAuthenticationUnixSockets + @CLEARPAGE @anchor CommandLineArangoAuthenticateSystemOnly @copydetails triagens::arango::ArangoServer::_authenticateSystemOnly diff --git a/Documentation/UserManual/CommandLineTOC.md b/Documentation/UserManual/CommandLineTOC.md index 5b96661a17..5e0ddad2fe 100644 --- a/Documentation/UserManual/CommandLineTOC.md +++ b/Documentation/UserManual/CommandLineTOC.md @@ -18,6 +18,7 @@ TOC {#CommandLineTOC} - @ref CommandLineConsole "console" - @ref CommandLineArangoEndpoint "server.endpoint" - @ref CommandLineArangoDisableAuthentication "server.disable-authentication" + - @ref CommandLineArangoDisableAuthenticationUnixSockets "server.disable-authentication-unix-sockets" - @ref CommandLineArangoAuthenticateSystemOnly "server.authenticate-system-only" - @ref CommandLineArangoKeepAliveTimeout "server.keep-alive-timeout" - @ref CommandLineArangoDefaultApiCompatibility "server.default-api-compatibility" diff --git a/UnitTests/Basics/files-test.cpp b/UnitTests/Basics/files-test.cpp index 0943014c58..14c7eacb44 100644 --- a/UnitTests/Basics/files-test.cpp +++ b/UnitTests/Basics/files-test.cpp @@ -30,6 +30,7 @@ #include "Basics/StringBuffer.h" #include "BasicsC/files.h" #include "BasicsC/json.h" +#include "BasicsC/random.h" using namespace triagens::basics; @@ -44,6 +45,7 @@ struct CFilesSetup { _directory.appendText("/tmp/arangotest-"); _directory.appendInteger((uint64_t) TRI_microtime()); + _directory.appendInteger((uint32_t) TRI_UInt32Random()); TRI_CreateDirectory(_directory.c_str()); } @@ -190,17 +192,10 @@ BOOST_AUTO_TEST_CASE (tst_absolute_paths) { BOOST_AUTO_TEST_CASE (tst_slurp) { size_t length; - char* path; char* filename; char* result; - path = TRI_GetTempPath(); - - if (! TRI_IsDirectory(path)) { - TRI_CreateDirectory(path); - } - - filename = TRI_Concatenate2File(path, "files-unittest.tmp"); + filename = TRI_Concatenate2File(_directory.c_str(), "files-unittest.tmp"); // remove file if it exists TRI_UnlinkFile(filename); @@ -230,7 +225,6 @@ BOOST_AUTO_TEST_CASE (tst_slurp) { TRI_FreeJson(TRI_CORE_MEM_ZONE, json); TRI_Free(TRI_CORE_MEM_ZONE, filename); - TRI_Free(TRI_CORE_MEM_ZONE, path); } //////////////////////////////////////////////////////////////////////////////// diff --git a/arangod/Ahuacatl/ahuacatl-functions.c b/arangod/Ahuacatl/ahuacatl-functions.c index b8d1c3d767..0a15878e5e 100644 --- a/arangod/Ahuacatl/ahuacatl-functions.c +++ b/arangod/Ahuacatl/ahuacatl-functions.c @@ -716,6 +716,7 @@ TRI_associative_pointer_t* TRI_CreateFunctionsAql (void) { REGISTER_FUNCTION("FIRST_LIST", "FIRST_LIST", true, false, ".|+", NULL); REGISTER_FUNCTION("FIRST_DOCUMENT", "FIRST_DOCUMENT", true, false, ".|+", NULL); REGISTER_FUNCTION("PARSE_IDENTIFIER", "PARSE_IDENTIFIER", true, false, ".", NULL); + REGISTER_FUNCTION("SKIPLIST", "SKIPLIST_QUERY", false, false, "h,a|n,n", NULL); if (! result) { TRI_FreeFunctionsAql(functions); diff --git a/arangod/RestHandler/RestDocumentHandler.cpp b/arangod/RestHandler/RestDocumentHandler.cpp index fe2b329517..f14644a09f 100644 --- a/arangod/RestHandler/RestDocumentHandler.cpp +++ b/arangod/RestHandler/RestDocumentHandler.cpp @@ -496,16 +496,18 @@ bool RestDocumentHandler::readDocument () { /// @RESTRETURNCODE{200} /// is returned if the document was found /// -/// @RESTRETURNCODE{404} -/// is returned if the document or collection was not found -/// /// @RESTRETURNCODE{304} /// is returned if the "If-None-Match" header is given and the document has /// the same version /// +/// @RESTRETURNCODE{404} +/// is returned if the document or collection was not found +/// /// @RESTRETURNCODE{412} /// is returned if a "If-Match" header or `rev` is given and the found -/// document has a different version +/// document has a different version. The response will also contain the found +/// document's current revision in the `_rev` attribute. Additionally, the +/// attributes `_id` and `_key` will be returned. /// /// @EXAMPLES /// @@ -916,7 +918,8 @@ bool RestDocumentHandler::getAllDocumentsCoordinator ( /// /// @RESTRETURNCODE{412} /// is returned if a "If-Match" header or `rev` is given and the found -/// document has a different version +/// document has a different version. The response will also contain the found +/// document's current revision in the `etag` header. /// /// @EXAMPLES /// @@ -1065,7 +1068,9 @@ bool RestDocumentHandler::checkDocument () { /// /// @RESTRETURNCODE{412} /// is returned if a "If-Match" header or `rev` is given and the found -/// document has a different version +/// document has a different version. The response will also contain the found +/// document's current revision in the `_rev` attribute. Additionally, the +/// attributes `_id` and `_key` will be returned. /// /// @EXAMPLES /// @@ -1257,7 +1262,9 @@ bool RestDocumentHandler::replaceDocument () { /// /// @RESTRETURNCODE{412} /// is returned if a "If-Match" header or `rev` is given and the found -/// document has a different version +/// document has a different version. The response will also contain the found +/// document's current revision in the `_rev` attribute. Additionally, the +/// attributes `_id` and `_key` will be returned. /// /// @EXAMPLES /// @@ -1638,8 +1645,10 @@ bool RestDocumentHandler::modifyDocumentCoordinator ( /// The response body contains an error document in this case. /// /// @RESTRETURNCODE{412} -/// is returned if a "If-Match" header or `rev` is given and the current -/// document has a different version +/// is returned if a "If-Match" header or `rev` is given and the found +/// document has a different version. The response will also contain the found +/// document's current revision in the `_rev` attribute. Additionally, the +/// attributes `_id` and `_key` will be returned. /// /// @EXAMPLES /// diff --git a/arangod/RestHandler/RestEdgeHandler.cpp b/arangod/RestHandler/RestEdgeHandler.cpp index 76c59a44a7..4927946c51 100644 --- a/arangod/RestHandler/RestEdgeHandler.cpp +++ b/arangod/RestHandler/RestEdgeHandler.cpp @@ -413,16 +413,18 @@ bool RestEdgeHandler::createDocumentCoordinator (string const& collname, /// @RESTRETURNCODE{200} /// is returned if the edge was found /// -/// @RESTRETURNCODE{404} -/// is returned if the edge or collection was not found -/// /// @RESTRETURNCODE{304} /// is returned if the "If-None-Match" header is given and the edge has /// the same version /// +/// @RESTRETURNCODE{404} +/// is returned if the edge or collection was not found +/// /// @RESTRETURNCODE{412} /// is returned if a "If-Match" header or `rev` is given and the found -/// edge has a different version +/// document has a different version. The response will also contain the found +/// document's current revision in the `_rev` attribute. Additionally, the +/// attributes `_id` and `_key` will be returned. //////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// @@ -480,16 +482,17 @@ bool RestEdgeHandler::createDocumentCoordinator (string const& collname, /// @RESTRETURNCODE{200} /// is returned if the edge document was found /// -/// @RESTRETURNCODE{404} -/// is returned if the edge document or collection was not found -/// /// @RESTRETURNCODE{304} /// is returned if the "If-None-Match" header is given and the edge document has /// same version /// +/// @RESTRETURNCODE{404} +/// is returned if the edge document or collection was not found +/// /// @RESTRETURNCODE{412} -/// is returned if a "If-Match" header or `rev` is given and the found edge -/// document has a different version +/// is returned if a "If-Match" header or `rev` is given and the found +/// document has a different version. The response will also contain the found +/// document's current revision in the `etag` header. //////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// @@ -611,8 +614,10 @@ bool RestEdgeHandler::createDocumentCoordinator (string const& collname, /// is returned if the collection or the edge document was not found /// /// @RESTRETURNCODE{412} -/// is returned if a "If-Match" header or `rev` is given and the found edge -/// document has a different version +/// is returned if a "If-Match" header or `rev` is given and the found +/// document has a different version. The response will also contain the found +/// document's current revision in the `_rev` attribute. Additionally, the +/// attributes `_id` and `_key` will be returned. /////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// @@ -711,8 +716,10 @@ bool RestEdgeHandler::createDocumentCoordinator (string const& collname, /// is returned if the collection or the edge document was not found /// /// @RESTRETURNCODE{412} -/// is returned if a "If-Match" header or `rev` is given and the found edge -/// document has a different version +/// is returned if a "If-Match" header or `rev` is given and the found +/// document has a different version. The response will also contain the found +/// document's current revision in the `_rev` attribute. Additionally, the +/// attributes `_id` and `_key` will be returned. //////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// @@ -772,8 +779,10 @@ bool RestEdgeHandler::createDocumentCoordinator (string const& collname, /// The response body contains an error document in this case. /// /// @RESTRETURNCODE{412} -/// is returned if a "If-Match" header or `rev` is given and the current edge -/// document has a different version +/// is returned if a "If-Match" header or `rev` is given and the found +/// document has a different version. The response will also contain the found +/// document's current revision in the `_rev` attribute. Additionally, the +/// attributes `_id` and `_key` will be returned. //////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// diff --git a/arangod/RestHandler/RestVocbaseBaseHandler.cpp b/arangod/RestHandler/RestVocbaseBaseHandler.cpp index a2381c0c95..3d91d50672 100644 --- a/arangod/RestHandler/RestVocbaseBaseHandler.cpp +++ b/arangod/RestHandler/RestVocbaseBaseHandler.cpp @@ -272,8 +272,11 @@ void RestVocbaseBaseHandler::generateForbidden () { void RestVocbaseBaseHandler::generatePreconditionFailed (const TRI_voc_cid_t cid, TRI_voc_key_t key, TRI_voc_rid_t rid) { + const string rev = StringUtils::itoa(rid); + _response = createResponse(HttpResponse::PRECONDITION_FAILED); _response->setContentType("application/json; charset=utf-8"); + _response->setHeader("etag", 4, "\"" + rev + "\""); // _id and _key are safe and do not need to be JSON-encoded _response->body() diff --git a/arangod/RestServer/ArangoServer.cpp b/arangod/RestServer/ArangoServer.cpp index 14d5b32891..b4e096d35b 100644 --- a/arangod/RestServer/ArangoServer.cpp +++ b/arangod/RestServer/ArangoServer.cpp @@ -300,6 +300,7 @@ ArangoServer::ArangoServer (int argc, char** argv) _applicationV8(0), _authenticateSystemOnly(false), _disableAuthentication(false), + _disableAuthenticationUnixSockets(false), _dispatcherThreads(8), _dispatcherQueueSize(8192), _databasePath(), @@ -552,6 +553,9 @@ void ArangoServer::buildApplicationServer () { additional[ApplicationServer::OPTIONS_SERVER + ":help-admin"] ("server.authenticate-system-only", &_authenticateSystemOnly, "use HTTP authentication only for requests to /_api and /_admin") ("server.disable-authentication", &_disableAuthentication, "disable authentication for ALL client requests") +#ifdef TRI_HAVE_LINUX_SOCKETS + ("server.disable-authentication-unix-sockets", &_disableAuthenticationUnixSockets, "disable authentication for requests via UNIX domain sockets") +#endif ("server.disable-replication-logger", &_disableReplicationLogger, "start with replication logger turned off") ("server.disable-replication-applier", &_disableReplicationApplier, "start with replication applier turned off") ; @@ -1022,13 +1026,14 @@ void ArangoServer::openDatabases () { TRI_vocbase_defaults_t defaults; // override with command-line options - defaults.defaultMaximalSize = _defaultMaximalSize; - defaults.removeOnDrop = _removeOnDrop; - defaults.removeOnCompacted = _removeOnCompacted; - defaults.defaultWaitForSync = _defaultWaitForSync; - defaults.forceSyncProperties = _forceSyncProperties; - defaults.requireAuthentication = ! _disableAuthentication; - defaults.authenticateSystemOnly = _authenticateSystemOnly; + defaults.defaultMaximalSize = _defaultMaximalSize; + defaults.removeOnDrop = _removeOnDrop; + defaults.removeOnCompacted = _removeOnCompacted; + defaults.defaultWaitForSync = _defaultWaitForSync; + defaults.forceSyncProperties = _forceSyncProperties; + defaults.requireAuthentication = ! _disableAuthentication; + defaults.requireAuthenticationUnixSockets = ! _disableAuthenticationUnixSockets; + defaults.authenticateSystemOnly = _authenticateSystemOnly; assert(_server != 0); diff --git a/arangod/RestServer/ArangoServer.h b/arangod/RestServer/ArangoServer.h index 2bd5e25a37..ef1a3802c1 100644 --- a/arangod/RestServer/ArangoServer.h +++ b/arangod/RestServer/ArangoServer.h @@ -283,6 +283,26 @@ namespace triagens { bool _disableAuthentication; +//////////////////////////////////////////////////////////////////////////////// +/// @brief disable authentication for requests via UNIX domain sockets +/// +/// @CMDOPT{\--server.disable-authentication-unix-sockets @CA{value}} +/// +/// Setting @CA{value} to true will turn off authentication on the server side +/// for requests coming in via UNIX domain sockets. With this flag enabled, +/// clients located on the same host as the ArangoDB server can use UNIX domain +/// sockets to connect to the server without authentication. +/// Requests coming in by other means (e.g. TCP/IP) are not affected by this +/// option. +/// +/// The default value is @LIT{false}. +/// +/// Note: this option is only available on platforms that support UNIX domain +/// sockets. +//////////////////////////////////////////////////////////////////////////////// + + bool _disableAuthenticationUnixSockets; + //////////////////////////////////////////////////////////////////////////////// /// @brief number of dispatcher threads for non-database worker /// diff --git a/arangod/RestServer/VocbaseContext.cpp b/arangod/RestServer/VocbaseContext.cpp index 09dccb22a1..a1f7484056 100644 --- a/arangod/RestServer/VocbaseContext.cpp +++ b/arangod/RestServer/VocbaseContext.cpp @@ -30,6 +30,7 @@ #include "BasicsC/common.h" #include "BasicsC/logging.h" #include "BasicsC/tri-strings.h" +#include "Rest/ConnectionInfo.h" #include "VocBase/auth.h" #include "VocBase/server.h" #include "VocBase/vocbase.h" @@ -101,6 +102,18 @@ HttpResponse::HttpResponseCode VocbaseContext::authenticate () { return HttpResponse::OK; } +#ifdef TRI_HAVE_LINUX_SOCKETS + // check if we need to run authentication for this type of + // endpoint + ConnectionInfo const& ci = _request->connectionInfo(); + + if (ci.endpointType == Endpoint::DOMAIN_UNIX && + ! _vocbase->_settings.requireAuthenticationUnixSockets) { + // no authentication required for unix socket domain connections + return HttpResponse::OK; + } +#endif + if (_vocbase->_settings.authenticateSystemOnly) { // authentication required, but only for /_api, /_admin etc. const char* path = _request->requestPath(); diff --git a/arangod/RestServer/arango.cpp b/arangod/RestServer/arango.cpp index 5fe590ec5d..e0452b9a59 100644 --- a/arangod/RestServer/arango.cpp +++ b/arangod/RestServer/arango.cpp @@ -458,6 +458,11 @@ int main (int argc, char* argv[]) { TRIAGENS_REST_SHUTDOWN; TRI_GlobalExitFunction(res, NULL); + if (ArangoInstance != 0) { + delete ArangoInstance; + ArangoInstance = 0; + } + return res; } diff --git a/arangod/V8Server/v8-vocbase.cpp b/arangod/V8Server/v8-vocbase.cpp index 550c22fcc9..57a46fc944 100644 --- a/arangod/V8Server/v8-vocbase.cpp +++ b/arangod/V8Server/v8-vocbase.cpp @@ -9091,6 +9091,7 @@ static v8::Handle JS_CreateDatabase (v8::Arguments const& argv) { v8::Local keyDefaultWaitForSync = v8::String::New("defaultWaitForSync"); v8::Local keyForceSyncProperties = v8::String::New("forceSyncProperties"); v8::Local keyRequireAuthentication = v8::String::New("requireAuthentication"); + v8::Local keyRequireAuthenticationUnixSockets = v8::String::New("requireAuthenticationUnixSockets"); v8::Local keyAuthenticateSystemOnly = v8::String::New("authenticateSystemOnly"); // overwrite database defaults from argv[2] @@ -9120,6 +9121,10 @@ static v8::Handle JS_CreateDatabase (v8::Arguments const& argv) { if (options->Has(keyRequireAuthentication)) { defaults.requireAuthentication = options->Get(keyRequireAuthentication)->BooleanValue(); } + + if (options->Has(keyRequireAuthenticationUnixSockets)) { + defaults.requireAuthenticationUnixSockets = options->Get(keyRequireAuthenticationUnixSockets)->BooleanValue(); + } if (options->Has(keyAuthenticateSystemOnly)) { defaults.authenticateSystemOnly = options->Get(keyAuthenticateSystemOnly)->BooleanValue(); diff --git a/arangod/VocBase/vocbase-defaults.c b/arangod/VocBase/vocbase-defaults.c index e7e7e45043..7ea8556ffb 100644 --- a/arangod/VocBase/vocbase-defaults.c +++ b/arangod/VocBase/vocbase-defaults.c @@ -44,13 +44,14 @@ void TRI_ApplyVocBaseDefaults (TRI_vocbase_t* vocbase, TRI_vocbase_defaults_t const* defaults) { - vocbase->_settings.defaultMaximalSize = defaults->defaultMaximalSize; - vocbase->_settings.removeOnDrop = defaults->removeOnDrop; - vocbase->_settings.removeOnCompacted = defaults->removeOnCompacted; - vocbase->_settings.defaultWaitForSync = defaults->defaultWaitForSync; - vocbase->_settings.forceSyncProperties = defaults->forceSyncProperties; - vocbase->_settings.requireAuthentication = defaults->requireAuthentication; - vocbase->_settings.authenticateSystemOnly = defaults->authenticateSystemOnly; + vocbase->_settings.defaultMaximalSize = defaults->defaultMaximalSize; + vocbase->_settings.removeOnDrop = defaults->removeOnDrop; + vocbase->_settings.removeOnCompacted = defaults->removeOnCompacted; + vocbase->_settings.defaultWaitForSync = defaults->defaultWaitForSync; + vocbase->_settings.forceSyncProperties = defaults->forceSyncProperties; + vocbase->_settings.requireAuthentication = defaults->requireAuthentication; + vocbase->_settings.requireAuthenticationUnixSockets = defaults->requireAuthenticationUnixSockets; + vocbase->_settings.authenticateSystemOnly = defaults->authenticateSystemOnly; } //////////////////////////////////////////////////////////////////////////////// @@ -72,6 +73,7 @@ TRI_json_t* TRI_JsonVocBaseDefaults (TRI_memory_zone_t* zone, TRI_Insert3ArrayJson(zone, json, "waitForSync", TRI_CreateBooleanJson(zone, defaults->defaultWaitForSync)); TRI_Insert3ArrayJson(zone, json, "forceSyncProperties", TRI_CreateBooleanJson(zone, defaults->forceSyncProperties)); TRI_Insert3ArrayJson(zone, json, "requireAuthentication", TRI_CreateBooleanJson(zone, defaults->requireAuthentication)); + TRI_Insert3ArrayJson(zone, json, "requireAuthenticationUnixSockets", TRI_CreateBooleanJson(zone, defaults->requireAuthenticationUnixSockets)); TRI_Insert3ArrayJson(zone, json, "authenticateSystemOnly", TRI_CreateBooleanJson(zone, defaults->authenticateSystemOnly)); TRI_Insert3ArrayJson(zone, json, "defaultMaximalSize", TRI_CreateNumberJson(zone, (double) defaults->defaultMaximalSize)); @@ -120,6 +122,12 @@ void TRI_FromJsonVocBaseDefaults (TRI_vocbase_defaults_t* defaults, defaults->requireAuthentication = optionJson->_value._boolean; } + optionJson = TRI_LookupArrayJson(json, "requireAuthenticationUnixSockets"); + + if (TRI_IsBooleanJson(optionJson)) { + defaults->requireAuthenticationUnixSockets = optionJson->_value._boolean; + } + optionJson = TRI_LookupArrayJson(json, "authenticateSystemOnly"); if (TRI_IsBooleanJson(optionJson)) { diff --git a/arangod/VocBase/vocbase-defaults.h b/arangod/VocBase/vocbase-defaults.h index 72318c4e3a..212d68c5de 100644 --- a/arangod/VocBase/vocbase-defaults.h +++ b/arangod/VocBase/vocbase-defaults.h @@ -58,6 +58,7 @@ typedef struct TRI_vocbase_defaults_s { bool defaultWaitForSync; bool forceSyncProperties; bool requireAuthentication; + bool requireAuthenticationUnixSockets; bool authenticateSystemOnly; } TRI_vocbase_defaults_t; diff --git a/js/Makefile.files b/js/Makefile.files index d7d0c97ccb..75c0da5b6a 100644 --- a/js/Makefile.files +++ b/js/Makefile.files @@ -50,10 +50,13 @@ JAVASCRIPT_JSLINT = \ `find @srcdir@/js/common/modules/org -name "*.js"` \ `find @srcdir@/js/client/modules -name "*.js"` \ `find @srcdir@/js/server/modules -name "*.js"` \ + `find @srcdir@/js/client/tests -name "*.js"` \ `find @srcdir@/js/apps/system/aardvark/frontend/js/models -name "*.js"` \ `find @srcdir@/js/apps/system/aardvark/frontend/js/views -name "*.js"` \ `find @srcdir@/js/apps/system/aardvark/frontend/js/collections -name "*.js"` \ `find @srcdir@/js/apps/system/aardvark/frontend/js/routers -name "*.js"` \ + `find @srcdir@/js/apps/system/aardvark/frontend/js/arango -name "*.js"` \ + `find @srcdir@/js/apps/system/aardvark/frontend/js/shell -name "*.js"` \ \ @srcdir@/js/client/client.js \ @srcdir@/js/server/server.js \ diff --git a/js/apps/system/aardvark/aardvark.js b/js/apps/system/aardvark/aardvark.js index c9908f0899..a380b9ce48 100644 --- a/js/apps/system/aardvark/aardvark.js +++ b/js/apps/system/aardvark/aardvark.js @@ -110,6 +110,12 @@ controller.put("/foxxes/:key", function (req, res) { controller.get("/foxxes/thumbnail/:app", function (req, res) { res.transformations = [ "base64decode" ]; res.body = foxxes.thumbnail(req.params("app")); + + // evil mimetype detection attempt... + var start = require("internal").base64Decode(res.body.substr(0, 8)); + if (start.indexOf("PNG") !== -1) { + res.contentType = "image/png"; + } }).pathParam("app", { description: "The appname which is used to identify the foxx in the list of available foxxes.", type: "string", diff --git a/js/apps/system/aardvark/frontend/css/buttons.css b/js/apps/system/aardvark/frontend/css/buttons.css index 22947cce76..5ee4d1b727 100644 --- a/js/apps/system/aardvark/frontend/css/buttons.css +++ b/js/apps/system/aardvark/frontend/css/buttons.css @@ -317,21 +317,24 @@ button.btn-server { a.headerButton { float: left; cursor: pointer; - margin-top: 0px; + margin-top: 2px; margin-left: 5px; - margin-right: 5px; - min-height: 19px; + margin-right: 3px; + min-height: 15px; border-radius: 3px; position: relative; box-shadow: none; - background: #8AA051 !important; - /* - background: #8f8d8c !important; - */ - color:#FFFFFF !important; - height:20px; - width:13px; - padding: 5px 11px 2px 9px; + background: #ddd; + color: #555; + height: 17px; + width: 9px; + padding: 4px 9px 2px 9px; + border: 1px solid #222; +} + +a.headerButton:hover { + background: #fff; + color: #000; } a.paginationButton, ul.arangoPagination a { @@ -340,17 +343,68 @@ a.paginationButton, ul.arangoPagination a { /* better look of some icons */ a.headerButton .icon_arangodb_filter { - top: 1px !important; + top: 3px !important; } a.headerButton .icon_arangodb_import { - top: -1px !important; + top: 1px !important; +} + +a.headerButton .icon_arangodb_checklist { + top: 3px !important; + right: 5px; } a.headerButton .icon_arangodb_arrowleft, a.headerButton .icon_arangodb_arrowright { font-weight:bold; } +/* Graph Viewer */ + +div.toolbox > div.gv_action_button:first-child { + margin-top: 0px; +} + +div.toolbox > div.gv_action_button:last-child { + margin-bottom: 0px; +} + +div.gv_action_button { + text-align: center; + position: relative; + width: 50px; + height: 50px; + background-color: #333333; + color: white; + cursor: pointer; + margin-top: 2px; + margin-bottom: 2px; +} + +div.gv_action_button:hover { + +} + +div.gv_action_button.active { + background-color: #8AA051; +} + +h6.gv_icon_icon, +h6.gv_button_title { + position: absolute; + margin: 0px; + left: 0px; + right: 0px; +} + +h6.gv_icon_icon { + font-size: 22px; + top: 6px; +} + +h6.gv_button_title { + bottom: 1px; +} /* #documentsToolbar span { diff --git a/js/apps/system/aardvark/frontend/css/collectionsItemView.css b/js/apps/system/aardvark/frontend/css/collectionsItemView.css index 2a65989ba6..e304694452 100644 --- a/js/apps/system/aardvark/frontend/css/collectionsItemView.css +++ b/js/apps/system/aardvark/frontend/css/collectionsItemView.css @@ -16,7 +16,8 @@ .span3 h5 { font-family: 'Open Sans', sans-serif !important; - font-weight: 500; + font-weight: 300; + font-size: 12px; white-space: nowrap !important; overflow: hidden !important; text-overflow: ellipsis !important; @@ -42,29 +43,27 @@ .span3 .ICON { position: absolute; + right: 0px; margin-top: 5px; margin-right: 5px; opacity: 0.5; cursor: pointer; - font-size: 25px; + font-size: 18px; } + +.span3 .ICON:hover { + opacity: 1.0; +} + .span3 .glyphicon-edit { margin-top: 4px !important; font-size: 19.5px; } -.span3 .ICON{ - right: 0px; -} - .span3 .spanInfo { right: 25px; } -.span3 .ICON:hover { - opacity: 1.0; -} - .spanDisabled { right: 25px !important; opacity: 0.2 !important; @@ -78,3 +77,8 @@ .span3 .badge-success { font-weight: 300; } + +.badge, .label, .btn { + text-shadow: none !important; + font-size: 11px; +} diff --git a/js/apps/system/aardvark/frontend/css/collectionsView.css b/js/apps/system/aardvark/frontend/css/collectionsView.css index a2035ed275..8c5fc0a925 100644 --- a/js/apps/system/aardvark/frontend/css/collectionsView.css +++ b/js/apps/system/aardvark/frontend/css/collectionsView.css @@ -9,7 +9,7 @@ #newCollection { position: relative; margin-left: 22px; - font-size: 28px; + font-size: 22px; margin-top: -5px; margin-right: 10px; } @@ -34,7 +34,8 @@ } .thumbnails li { - background-color: #f4f3f3; + background-color: rgba(0, 0, 0, 0.05); + /* #f4f3f3; */ } .thumbnails a.add { @@ -47,7 +48,7 @@ .thumbnails .icon { padding-right:5px; padding-left: 5px; - padding-top: 5px; + padding-top: 10px; cursor: pointer; } diff --git a/js/apps/system/aardvark/frontend/css/dashboardView.css b/js/apps/system/aardvark/frontend/css/dashboardView.css index 52f45c71b7..97c4d2a7c5 100644 --- a/js/apps/system/aardvark/frontend/css/dashboardView.css +++ b/js/apps/system/aardvark/frontend/css/dashboardView.css @@ -107,11 +107,11 @@ } .nv-axislabel { - margin-left: 20px; + margin-left: 0px; } .nv-axisMaxMin > text { - font: 10px sans-serif; + /* font: 10px 'Open Sans', sans-serif; */ } .svgCollections { @@ -120,7 +120,7 @@ } .svgClass { - height: 155px; + height: 142px; width: 300px; } @@ -158,7 +158,7 @@ li:hover h6, li.hover h6 { } .boxHeader h6 { - opacity: 0.8; + /* opacity: 0.8; */ padding-top: 0 !important; color: black; margin-left: 5px; @@ -199,7 +199,7 @@ li:hover h6, li.hover h6 { } .nv-x .nv-axislabel { - display: none; + display: none; } .nv-point { @@ -517,6 +517,12 @@ li:hover h6, li.hover h6 { font-weight: 400; } +#dbThumbnailsIn .dashboardH6 { + opacity: 1.0 !important; + font-size: 12px; + font-weight: 300; +} + @media screen and (-webkit-min-device-pixel-ratio:0) { .svgClass{margin-top: 10px !important;} .statSingleClient{margin-top: 10.5px !important;} @@ -524,8 +530,10 @@ li:hover h6, li.hover h6 { } .nvd3 .nv-axis .nv-axisMaxMin text { + /* font-weight: 400; font-size: 12px !important; + */ } .nvd3 .nv-wrap .nv-axis:last-child { diff --git a/js/apps/system/aardvark/frontend/css/dbSelectionView.css b/js/apps/system/aardvark/frontend/css/dbSelectionView.css index 91e057b929..671718fa89 100644 --- a/js/apps/system/aardvark/frontend/css/dbSelectionView.css +++ b/js/apps/system/aardvark/frontend/css/dbSelectionView.css @@ -1,8 +1,8 @@ span.selectDB > select { line-height: 20px; - height: 20px; + height: 30px; width: 150px; - margin: -3px 0px 2px 0px; + margin: -5px 0px; border-radius: 0px !important; border: 1px solid; } diff --git a/js/apps/system/aardvark/frontend/css/font-awesome.css b/js/apps/system/aardvark/frontend/css/font-awesome.css new file mode 100644 index 0000000000..46958c5a03 --- /dev/null +++ b/js/apps/system/aardvark/frontend/css/font-awesome.css @@ -0,0 +1,1338 @@ +/*! + * Font Awesome 4.0.3 by @davegandy - http://fontawesome.io - @fontawesome + * License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License) + */ +/* FONT PATH + * -------------------------- */ +@font-face { + font-family: 'FontAwesome'; + src: url('../fonts/fontawesome/fontawesome-webfont.eot?v=4.0.3'); + src: url('../fonts/fontawesome/fontawesome-webfont.eot?#iefix&v=4.0.3') format('embedded-opentype'), url('../fonts/fontawesome/fontawesome-webfont.woff?v=4.0.3') format('woff'), url('../fonts/fontawesome/fontawesome-webfont.ttf?v=4.0.3') format('truetype'), url('../fonts/fontawesome/fontawesome-webfont.svg?v=4.0.3#fontawesomeregular') format('svg'); + font-weight: normal; + font-style: normal; +} +.fa { + display: inline-block; + font-family: FontAwesome; + font-style: normal; + font-weight: normal; + line-height: 1; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} +/* makes the font 33% larger relative to the icon container */ +.fa-lg { + font-size: 1.3333333333333333em; + line-height: 0.75em; + vertical-align: -15%; +} +.fa-2x { + font-size: 2em; +} +.fa-3x { + font-size: 3em; +} +.fa-4x { + font-size: 4em; +} +.fa-5x { + font-size: 5em; +} +.fa-fw { + width: 1.2857142857142858em; + text-align: center; +} +.fa-ul { + padding-left: 0; + margin-left: 2.142857142857143em; + list-style-type: none; +} +.fa-ul > li { + position: relative; +} +.fa-li { + position: absolute; + left: -2.142857142857143em; + width: 2.142857142857143em; + top: 0.14285714285714285em; + text-align: center; +} +.fa-li.fa-lg { + left: -1.8571428571428572em; +} +.fa-border { + padding: .2em .25em .15em; + border: solid 0.08em #eeeeee; + border-radius: .1em; +} +.pull-right { + float: right; +} +.pull-left { + float: left; +} +.fa.pull-left { + margin-right: .3em; +} +.fa.pull-right { + margin-left: .3em; +} +.fa-spin { + -webkit-animation: spin 2s infinite linear; + -moz-animation: spin 2s infinite linear; + -o-animation: spin 2s infinite linear; + animation: spin 2s infinite linear; +} +@-moz-keyframes spin { + 0% { + -moz-transform: rotate(0deg); + } + 100% { + -moz-transform: rotate(359deg); + } +} +@-webkit-keyframes spin { + 0% { + -webkit-transform: rotate(0deg); + } + 100% { + -webkit-transform: rotate(359deg); + } +} +@-o-keyframes spin { + 0% { + -o-transform: rotate(0deg); + } + 100% { + -o-transform: rotate(359deg); + } +} +@-ms-keyframes spin { + 0% { + -ms-transform: rotate(0deg); + } + 100% { + -ms-transform: rotate(359deg); + } +} +@keyframes spin { + 0% { + transform: rotate(0deg); + } + 100% { + transform: rotate(359deg); + } +} +.fa-rotate-90 { + filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=1); + -webkit-transform: rotate(90deg); + -moz-transform: rotate(90deg); + -ms-transform: rotate(90deg); + -o-transform: rotate(90deg); + transform: rotate(90deg); +} +.fa-rotate-180 { + filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=2); + -webkit-transform: rotate(180deg); + -moz-transform: rotate(180deg); + -ms-transform: rotate(180deg); + -o-transform: rotate(180deg); + transform: rotate(180deg); +} +.fa-rotate-270 { + filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3); + -webkit-transform: rotate(270deg); + -moz-transform: rotate(270deg); + -ms-transform: rotate(270deg); + -o-transform: rotate(270deg); + transform: rotate(270deg); +} +.fa-flip-horizontal { + filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1); + -webkit-transform: scale(-1, 1); + -moz-transform: scale(-1, 1); + -ms-transform: scale(-1, 1); + -o-transform: scale(-1, 1); + transform: scale(-1, 1); +} +.fa-flip-vertical { + filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1); + -webkit-transform: scale(1, -1); + -moz-transform: scale(1, -1); + -ms-transform: scale(1, -1); + -o-transform: scale(1, -1); + transform: scale(1, -1); +} +.fa-stack { + position: relative; + display: inline-block; + width: 2em; + height: 2em; + line-height: 2em; + vertical-align: middle; +} +.fa-stack-1x, +.fa-stack-2x { + position: absolute; + left: 0; + width: 100%; + text-align: center; +} +.fa-stack-1x { + line-height: inherit; +} +.fa-stack-2x { + font-size: 2em; +} +.fa-inverse { + color: #ffffff; +} +/* Font Awesome uses the Unicode Private Use Area (PUA) to ensure screen + readers do not read off random characters that represent icons */ +.fa-glass:before { + content: "\f000"; +} +.fa-music:before { + content: "\f001"; +} +.fa-search:before { + content: "\f002"; +} +.fa-envelope-o:before { + content: "\f003"; +} +.fa-heart:before { + content: "\f004"; +} +.fa-star:before { + content: "\f005"; +} +.fa-star-o:before { + content: "\f006"; +} +.fa-user:before { + content: "\f007"; +} +.fa-film:before { + content: "\f008"; +} +.fa-th-large:before { + content: "\f009"; +} +.fa-th:before { + content: "\f00a"; +} +.fa-th-list:before { + content: "\f00b"; +} +.fa-check:before { + content: "\f00c"; +} +.fa-times:before { + content: "\f00d"; +} +.fa-search-plus:before { + content: "\f00e"; +} +.fa-search-minus:before { + content: "\f010"; +} +.fa-power-off:before { + content: "\f011"; +} +.fa-signal:before { + content: "\f012"; +} +.fa-gear:before, +.fa-cog:before { + content: "\f013"; +} +.fa-trash-o:before { + content: "\f014"; +} +.fa-home:before { + content: "\f015"; +} +.fa-file-o:before { + content: "\f016"; +} +.fa-clock-o:before { + content: "\f017"; +} +.fa-road:before { + content: "\f018"; +} +.fa-download:before { + content: "\f019"; +} +.fa-arrow-circle-o-down:before { + content: "\f01a"; +} +.fa-arrow-circle-o-up:before { + content: "\f01b"; +} +.fa-inbox:before { + content: "\f01c"; +} +.fa-play-circle-o:before { + content: "\f01d"; +} +.fa-rotate-right:before, +.fa-repeat:before { + content: "\f01e"; +} +.fa-refresh:before { + content: "\f021"; +} +.fa-list-alt:before { + content: "\f022"; +} +.fa-lock:before { + content: "\f023"; +} +.fa-flag:before { + content: "\f024"; +} +.fa-headphones:before { + content: "\f025"; +} +.fa-volume-off:before { + content: "\f026"; +} +.fa-volume-down:before { + content: "\f027"; +} +.fa-volume-up:before { + content: "\f028"; +} +.fa-qrcode:before { + content: "\f029"; +} +.fa-barcode:before { + content: "\f02a"; +} +.fa-tag:before { + content: "\f02b"; +} +.fa-tags:before { + content: "\f02c"; +} +.fa-book:before { + content: "\f02d"; +} +.fa-bookmark:before { + content: "\f02e"; +} +.fa-print:before { + content: "\f02f"; +} +.fa-camera:before { + content: "\f030"; +} +.fa-font:before { + content: "\f031"; +} +.fa-bold:before { + content: "\f032"; +} +.fa-italic:before { + content: "\f033"; +} +.fa-text-height:before { + content: "\f034"; +} +.fa-text-width:before { + content: "\f035"; +} +.fa-align-left:before { + content: "\f036"; +} +.fa-align-center:before { + content: "\f037"; +} +.fa-align-right:before { + content: "\f038"; +} +.fa-align-justify:before { + content: "\f039"; +} +.fa-list:before { + content: "\f03a"; +} +.fa-dedent:before, +.fa-outdent:before { + content: "\f03b"; +} +.fa-indent:before { + content: "\f03c"; +} +.fa-video-camera:before { + content: "\f03d"; +} +.fa-picture-o:before { + content: "\f03e"; +} +.fa-pencil:before { + content: "\f040"; +} +.fa-map-marker:before { + content: "\f041"; +} +.fa-adjust:before { + content: "\f042"; +} +.fa-tint:before { + content: "\f043"; +} +.fa-edit:before, +.fa-pencil-square-o:before { + content: "\f044"; +} +.fa-share-square-o:before { + content: "\f045"; +} +.fa-check-square-o:before { + content: "\f046"; +} +.fa-arrows:before { + content: "\f047"; +} +.fa-step-backward:before { + content: "\f048"; +} +.fa-fast-backward:before { + content: "\f049"; +} +.fa-backward:before { + content: "\f04a"; +} +.fa-play:before { + content: "\f04b"; +} +.fa-pause:before { + content: "\f04c"; +} +.fa-stop:before { + content: "\f04d"; +} +.fa-forward:before { + content: "\f04e"; +} +.fa-fast-forward:before { + content: "\f050"; +} +.fa-step-forward:before { + content: "\f051"; +} +.fa-eject:before { + content: "\f052"; +} +.fa-chevron-left:before { + content: "\f053"; +} +.fa-chevron-right:before { + content: "\f054"; +} +.fa-plus-circle:before { + content: "\f055"; +} +.fa-minus-circle:before { + content: "\f056"; +} +.fa-times-circle:before { + content: "\f057"; +} +.fa-check-circle:before { + content: "\f058"; +} +.fa-question-circle:before { + content: "\f059"; +} +.fa-info-circle:before { + content: "\f05a"; +} +.fa-crosshairs:before { + content: "\f05b"; +} +.fa-times-circle-o:before { + content: "\f05c"; +} +.fa-check-circle-o:before { + content: "\f05d"; +} +.fa-ban:before { + content: "\f05e"; +} +.fa-arrow-left:before { + content: "\f060"; +} +.fa-arrow-right:before { + content: "\f061"; +} +.fa-arrow-up:before { + content: "\f062"; +} +.fa-arrow-down:before { + content: "\f063"; +} +.fa-mail-forward:before, +.fa-share:before { + content: "\f064"; +} +.fa-expand:before { + content: "\f065"; +} +.fa-compress:before { + content: "\f066"; +} +.fa-plus:before { + content: "\f067"; +} +.fa-minus:before { + content: "\f068"; +} +.fa-asterisk:before { + content: "\f069"; +} +.fa-exclamation-circle:before { + content: "\f06a"; +} +.fa-gift:before { + content: "\f06b"; +} +.fa-leaf:before { + content: "\f06c"; +} +.fa-fire:before { + content: "\f06d"; +} +.fa-eye:before { + content: "\f06e"; +} +.fa-eye-slash:before { + content: "\f070"; +} +.fa-warning:before, +.fa-exclamation-triangle:before { + content: "\f071"; +} +.fa-plane:before { + content: "\f072"; +} +.fa-calendar:before { + content: "\f073"; +} +.fa-random:before { + content: "\f074"; +} +.fa-comment:before { + content: "\f075"; +} +.fa-magnet:before { + content: "\f076"; +} +.fa-chevron-up:before { + content: "\f077"; +} +.fa-chevron-down:before { + content: "\f078"; +} +.fa-retweet:before { + content: "\f079"; +} +.fa-shopping-cart:before { + content: "\f07a"; +} +.fa-folder:before { + content: "\f07b"; +} +.fa-folder-open:before { + content: "\f07c"; +} +.fa-arrows-v:before { + content: "\f07d"; +} +.fa-arrows-h:before { + content: "\f07e"; +} +.fa-bar-chart-o:before { + content: "\f080"; +} +.fa-twitter-square:before { + content: "\f081"; +} +.fa-facebook-square:before { + content: "\f082"; +} +.fa-camera-retro:before { + content: "\f083"; +} +.fa-key:before { + content: "\f084"; +} +.fa-gears:before, +.fa-cogs:before { + content: "\f085"; +} +.fa-comments:before { + content: "\f086"; +} +.fa-thumbs-o-up:before { + content: "\f087"; +} +.fa-thumbs-o-down:before { + content: "\f088"; +} +.fa-star-half:before { + content: "\f089"; +} +.fa-heart-o:before { + content: "\f08a"; +} +.fa-sign-out:before { + content: "\f08b"; +} +.fa-linkedin-square:before { + content: "\f08c"; +} +.fa-thumb-tack:before { + content: "\f08d"; +} +.fa-external-link:before { + content: "\f08e"; +} +.fa-sign-in:before { + content: "\f090"; +} +.fa-trophy:before { + content: "\f091"; +} +.fa-github-square:before { + content: "\f092"; +} +.fa-upload:before { + content: "\f093"; +} +.fa-lemon-o:before { + content: "\f094"; +} +.fa-phone:before { + content: "\f095"; +} +.fa-square-o:before { + content: "\f096"; +} +.fa-bookmark-o:before { + content: "\f097"; +} +.fa-phone-square:before { + content: "\f098"; +} +.fa-twitter:before { + content: "\f099"; +} +.fa-facebook:before { + content: "\f09a"; +} +.fa-github:before { + content: "\f09b"; +} +.fa-unlock:before { + content: "\f09c"; +} +.fa-credit-card:before { + content: "\f09d"; +} +.fa-rss:before { + content: "\f09e"; +} +.fa-hdd-o:before { + content: "\f0a0"; +} +.fa-bullhorn:before { + content: "\f0a1"; +} +.fa-bell:before { + content: "\f0f3"; +} +.fa-certificate:before { + content: "\f0a3"; +} +.fa-hand-o-right:before { + content: "\f0a4"; +} +.fa-hand-o-left:before { + content: "\f0a5"; +} +.fa-hand-o-up:before { + content: "\f0a6"; +} +.fa-hand-o-down:before { + content: "\f0a7"; +} +.fa-arrow-circle-left:before { + content: "\f0a8"; +} +.fa-arrow-circle-right:before { + content: "\f0a9"; +} +.fa-arrow-circle-up:before { + content: "\f0aa"; +} +.fa-arrow-circle-down:before { + content: "\f0ab"; +} +.fa-globe:before { + content: "\f0ac"; +} +.fa-wrench:before { + content: "\f0ad"; +} +.fa-tasks:before { + content: "\f0ae"; +} +.fa-filter:before { + content: "\f0b0"; +} +.fa-briefcase:before { + content: "\f0b1"; +} +.fa-arrows-alt:before { + content: "\f0b2"; +} +.fa-group:before, +.fa-users:before { + content: "\f0c0"; +} +.fa-chain:before, +.fa-link:before { + content: "\f0c1"; +} +.fa-cloud:before { + content: "\f0c2"; +} +.fa-flask:before { + content: "\f0c3"; +} +.fa-cut:before, +.fa-scissors:before { + content: "\f0c4"; +} +.fa-copy:before, +.fa-files-o:before { + content: "\f0c5"; +} +.fa-paperclip:before { + content: "\f0c6"; +} +.fa-save:before, +.fa-floppy-o:before { + content: "\f0c7"; +} +.fa-square:before { + content: "\f0c8"; +} +.fa-bars:before { + content: "\f0c9"; +} +.fa-list-ul:before { + content: "\f0ca"; +} +.fa-list-ol:before { + content: "\f0cb"; +} +.fa-strikethrough:before { + content: "\f0cc"; +} +.fa-underline:before { + content: "\f0cd"; +} +.fa-table:before { + content: "\f0ce"; +} +.fa-magic:before { + content: "\f0d0"; +} +.fa-truck:before { + content: "\f0d1"; +} +.fa-pinterest:before { + content: "\f0d2"; +} +.fa-pinterest-square:before { + content: "\f0d3"; +} +.fa-google-plus-square:before { + content: "\f0d4"; +} +.fa-google-plus:before { + content: "\f0d5"; +} +.fa-money:before { + content: "\f0d6"; +} +.fa-caret-down:before { + content: "\f0d7"; +} +.fa-caret-up:before { + content: "\f0d8"; +} +.fa-caret-left:before { + content: "\f0d9"; +} +.fa-caret-right:before { + content: "\f0da"; +} +.fa-columns:before { + content: "\f0db"; +} +.fa-unsorted:before, +.fa-sort:before { + content: "\f0dc"; +} +.fa-sort-down:before, +.fa-sort-asc:before { + content: "\f0dd"; +} +.fa-sort-up:before, +.fa-sort-desc:before { + content: "\f0de"; +} +.fa-envelope:before { + content: "\f0e0"; +} +.fa-linkedin:before { + content: "\f0e1"; +} +.fa-rotate-left:before, +.fa-undo:before { + content: "\f0e2"; +} +.fa-legal:before, +.fa-gavel:before { + content: "\f0e3"; +} +.fa-dashboard:before, +.fa-tachometer:before { + content: "\f0e4"; +} +.fa-comment-o:before { + content: "\f0e5"; +} +.fa-comments-o:before { + content: "\f0e6"; +} +.fa-flash:before, +.fa-bolt:before { + content: "\f0e7"; +} +.fa-sitemap:before { + content: "\f0e8"; +} +.fa-umbrella:before { + content: "\f0e9"; +} +.fa-paste:before, +.fa-clipboard:before { + content: "\f0ea"; +} +.fa-lightbulb-o:before { + content: "\f0eb"; +} +.fa-exchange:before { + content: "\f0ec"; +} +.fa-cloud-download:before { + content: "\f0ed"; +} +.fa-cloud-upload:before { + content: "\f0ee"; +} +.fa-user-md:before { + content: "\f0f0"; +} +.fa-stethoscope:before { + content: "\f0f1"; +} +.fa-suitcase:before { + content: "\f0f2"; +} +.fa-bell-o:before { + content: "\f0a2"; +} +.fa-coffee:before { + content: "\f0f4"; +} +.fa-cutlery:before { + content: "\f0f5"; +} +.fa-file-text-o:before { + content: "\f0f6"; +} +.fa-building-o:before { + content: "\f0f7"; +} +.fa-hospital-o:before { + content: "\f0f8"; +} +.fa-ambulance:before { + content: "\f0f9"; +} +.fa-medkit:before { + content: "\f0fa"; +} +.fa-fighter-jet:before { + content: "\f0fb"; +} +.fa-beer:before { + content: "\f0fc"; +} +.fa-h-square:before { + content: "\f0fd"; +} +.fa-plus-square:before { + content: "\f0fe"; +} +.fa-angle-double-left:before { + content: "\f100"; +} +.fa-angle-double-right:before { + content: "\f101"; +} +.fa-angle-double-up:before { + content: "\f102"; +} +.fa-angle-double-down:before { + content: "\f103"; +} +.fa-angle-left:before { + content: "\f104"; +} +.fa-angle-right:before { + content: "\f105"; +} +.fa-angle-up:before { + content: "\f106"; +} +.fa-angle-down:before { + content: "\f107"; +} +.fa-desktop:before { + content: "\f108"; +} +.fa-laptop:before { + content: "\f109"; +} +.fa-tablet:before { + content: "\f10a"; +} +.fa-mobile-phone:before, +.fa-mobile:before { + content: "\f10b"; +} +.fa-circle-o:before { + content: "\f10c"; +} +.fa-quote-left:before { + content: "\f10d"; +} +.fa-quote-right:before { + content: "\f10e"; +} +.fa-spinner:before { + content: "\f110"; +} +.fa-circle:before { + content: "\f111"; +} +.fa-mail-reply:before, +.fa-reply:before { + content: "\f112"; +} +.fa-github-alt:before { + content: "\f113"; +} +.fa-folder-o:before { + content: "\f114"; +} +.fa-folder-open-o:before { + content: "\f115"; +} +.fa-smile-o:before { + content: "\f118"; +} +.fa-frown-o:before { + content: "\f119"; +} +.fa-meh-o:before { + content: "\f11a"; +} +.fa-gamepad:before { + content: "\f11b"; +} +.fa-keyboard-o:before { + content: "\f11c"; +} +.fa-flag-o:before { + content: "\f11d"; +} +.fa-flag-checkered:before { + content: "\f11e"; +} +.fa-terminal:before { + content: "\f120"; +} +.fa-code:before { + content: "\f121"; +} +.fa-reply-all:before { + content: "\f122"; +} +.fa-mail-reply-all:before { + content: "\f122"; +} +.fa-star-half-empty:before, +.fa-star-half-full:before, +.fa-star-half-o:before { + content: "\f123"; +} +.fa-location-arrow:before { + content: "\f124"; +} +.fa-crop:before { + content: "\f125"; +} +.fa-code-fork:before { + content: "\f126"; +} +.fa-unlink:before, +.fa-chain-broken:before { + content: "\f127"; +} +.fa-question:before { + content: "\f128"; +} +.fa-info:before { + content: "\f129"; +} +.fa-exclamation:before { + content: "\f12a"; +} +.fa-superscript:before { + content: "\f12b"; +} +.fa-subscript:before { + content: "\f12c"; +} +.fa-eraser:before { + content: "\f12d"; +} +.fa-puzzle-piece:before { + content: "\f12e"; +} +.fa-microphone:before { + content: "\f130"; +} +.fa-microphone-slash:before { + content: "\f131"; +} +.fa-shield:before { + content: "\f132"; +} +.fa-calendar-o:before { + content: "\f133"; +} +.fa-fire-extinguisher:before { + content: "\f134"; +} +.fa-rocket:before { + content: "\f135"; +} +.fa-maxcdn:before { + content: "\f136"; +} +.fa-chevron-circle-left:before { + content: "\f137"; +} +.fa-chevron-circle-right:before { + content: "\f138"; +} +.fa-chevron-circle-up:before { + content: "\f139"; +} +.fa-chevron-circle-down:before { + content: "\f13a"; +} +.fa-html5:before { + content: "\f13b"; +} +.fa-css3:before { + content: "\f13c"; +} +.fa-anchor:before { + content: "\f13d"; +} +.fa-unlock-alt:before { + content: "\f13e"; +} +.fa-bullseye:before { + content: "\f140"; +} +.fa-ellipsis-h:before { + content: "\f141"; +} +.fa-ellipsis-v:before { + content: "\f142"; +} +.fa-rss-square:before { + content: "\f143"; +} +.fa-play-circle:before { + content: "\f144"; +} +.fa-ticket:before { + content: "\f145"; +} +.fa-minus-square:before { + content: "\f146"; +} +.fa-minus-square-o:before { + content: "\f147"; +} +.fa-level-up:before { + content: "\f148"; +} +.fa-level-down:before { + content: "\f149"; +} +.fa-check-square:before { + content: "\f14a"; +} +.fa-pencil-square:before { + content: "\f14b"; +} +.fa-external-link-square:before { + content: "\f14c"; +} +.fa-share-square:before { + content: "\f14d"; +} +.fa-compass:before { + content: "\f14e"; +} +.fa-toggle-down:before, +.fa-caret-square-o-down:before { + content: "\f150"; +} +.fa-toggle-up:before, +.fa-caret-square-o-up:before { + content: "\f151"; +} +.fa-toggle-right:before, +.fa-caret-square-o-right:before { + content: "\f152"; +} +.fa-euro:before, +.fa-eur:before { + content: "\f153"; +} +.fa-gbp:before { + content: "\f154"; +} +.fa-dollar:before, +.fa-usd:before { + content: "\f155"; +} +.fa-rupee:before, +.fa-inr:before { + content: "\f156"; +} +.fa-cny:before, +.fa-rmb:before, +.fa-yen:before, +.fa-jpy:before { + content: "\f157"; +} +.fa-ruble:before, +.fa-rouble:before, +.fa-rub:before { + content: "\f158"; +} +.fa-won:before, +.fa-krw:before { + content: "\f159"; +} +.fa-bitcoin:before, +.fa-btc:before { + content: "\f15a"; +} +.fa-file:before { + content: "\f15b"; +} +.fa-file-text:before { + content: "\f15c"; +} +.fa-sort-alpha-asc:before { + content: "\f15d"; +} +.fa-sort-alpha-desc:before { + content: "\f15e"; +} +.fa-sort-amount-asc:before { + content: "\f160"; +} +.fa-sort-amount-desc:before { + content: "\f161"; +} +.fa-sort-numeric-asc:before { + content: "\f162"; +} +.fa-sort-numeric-desc:before { + content: "\f163"; +} +.fa-thumbs-up:before { + content: "\f164"; +} +.fa-thumbs-down:before { + content: "\f165"; +} +.fa-youtube-square:before { + content: "\f166"; +} +.fa-youtube:before { + content: "\f167"; +} +.fa-xing:before { + content: "\f168"; +} +.fa-xing-square:before { + content: "\f169"; +} +.fa-youtube-play:before { + content: "\f16a"; +} +.fa-dropbox:before { + content: "\f16b"; +} +.fa-stack-overflow:before { + content: "\f16c"; +} +.fa-instagram:before { + content: "\f16d"; +} +.fa-flickr:before { + content: "\f16e"; +} +.fa-adn:before { + content: "\f170"; +} +.fa-bitbucket:before { + content: "\f171"; +} +.fa-bitbucket-square:before { + content: "\f172"; +} +.fa-tumblr:before { + content: "\f173"; +} +.fa-tumblr-square:before { + content: "\f174"; +} +.fa-long-arrow-down:before { + content: "\f175"; +} +.fa-long-arrow-up:before { + content: "\f176"; +} +.fa-long-arrow-left:before { + content: "\f177"; +} +.fa-long-arrow-right:before { + content: "\f178"; +} +.fa-apple:before { + content: "\f179"; +} +.fa-windows:before { + content: "\f17a"; +} +.fa-android:before { + content: "\f17b"; +} +.fa-linux:before { + content: "\f17c"; +} +.fa-dribbble:before { + content: "\f17d"; +} +.fa-skype:before { + content: "\f17e"; +} +.fa-foursquare:before { + content: "\f180"; +} +.fa-trello:before { + content: "\f181"; +} +.fa-female:before { + content: "\f182"; +} +.fa-male:before { + content: "\f183"; +} +.fa-gittip:before { + content: "\f184"; +} +.fa-sun-o:before { + content: "\f185"; +} +.fa-moon-o:before { + content: "\f186"; +} +.fa-archive:before { + content: "\f187"; +} +.fa-bug:before { + content: "\f188"; +} +.fa-vk:before { + content: "\f189"; +} +.fa-weibo:before { + content: "\f18a"; +} +.fa-renren:before { + content: "\f18b"; +} +.fa-pagelines:before { + content: "\f18c"; +} +.fa-stack-exchange:before { + content: "\f18d"; +} +.fa-arrow-circle-o-right:before { + content: "\f18e"; +} +.fa-arrow-circle-o-left:before { + content: "\f190"; +} +.fa-toggle-left:before, +.fa-caret-square-o-left:before { + content: "\f191"; +} +.fa-dot-circle-o:before { + content: "\f192"; +} +.fa-wheelchair:before { + content: "\f193"; +} +.fa-vimeo-square:before { + content: "\f194"; +} +.fa-turkish-lira:before, +.fa-try:before { + content: "\f195"; +} +.fa-plus-square-o:before { + content: "\f196"; +} diff --git a/js/apps/system/aardvark/frontend/css/general.css b/js/apps/system/aardvark/frontend/css/general.css index f922449d62..42de18918c 100644 --- a/js/apps/system/aardvark/frontend/css/general.css +++ b/js/apps/system/aardvark/frontend/css/general.css @@ -1,6 +1,6 @@ /* Sets the default values shared for content views*/ #content { - background-color: rgba(0, 0, 0, 0.15); + background-color: rgba(0, 0, 0, 0.0675); margin-top: 25px; margin-bottom: 33px; min-height: 80px; diff --git a/js/apps/system/aardvark/frontend/css/graphlayout.css b/js/apps/system/aardvark/frontend/css/graphlayout.css index 4af3f4e271..1c404360ac 100644 --- a/js/apps/system/aardvark/frontend/css/graphlayout.css +++ b/js/apps/system/aardvark/frontend/css/graphlayout.css @@ -48,6 +48,20 @@ img.searchSubmit { border-color: rgb(51, 51, 51); } +.toolbox > .btn { + width: 50px; + height: 50px; + margin-top: 2px; + margin-bottom: 2px; + background-color: rgb(51, 51, 51); + background-size: 50px 50px; +} + +.btn-icon { + padding: 4px 4px; + background-color: rgb(56, 52, 52); +} + .searchByAttribute, .searchEqualsLabel { margin-top: 3px; margin-right: 6px; diff --git a/js/apps/system/aardvark/frontend/css/headerBar.css b/js/apps/system/aardvark/frontend/css/headerBar.css index ef3532f0f3..c4d18af83b 100644 --- a/js/apps/system/aardvark/frontend/css/headerBar.css +++ b/js/apps/system/aardvark/frontend/css/headerBar.css @@ -4,7 +4,7 @@ div.headerBar { margin-top: 5px; margin-left: 5px; margin-right: 5px; - margin-bottom: 0px; + margin-bottom: 5px; background-color: #686766; color: #FFFFFF; height: 36px; diff --git a/js/apps/system/aardvark/frontend/css/jquery.contextmenu.css b/js/apps/system/aardvark/frontend/css/jquery.contextmenu.css new file mode 100644 index 0000000000..621123da3b --- /dev/null +++ b/js/apps/system/aardvark/frontend/css/jquery.contextmenu.css @@ -0,0 +1,41 @@ +/* OSX Theme */ +/* ========= */ +.context-menu-theme-osx { + background-color:white; + opacity: .93; + filter: alpha(opacity=93); + zoom:1.0; + border:1px solid #b2b2b2; + padding: 3px 0px; + border-radius: 4px; +} +.context-menu-theme-osx .context-menu-item { + text-align:left; + cursor:pointer; + color:black; + font-family:Lucida Grande,Arial; + font-weight:700; + font-size:12px; + opacity: 1.0; + filter: alpha(opacity=100); + z-index:1; +} +.context-menu-theme-osx .context-menu-separator { + margin:5px 1px 4px 1px; + font-size:0px; + border-top:1px solid #e4e4e4; +} +.context-menu-theme-osx .context-menu-item:hover { + background-color:#1C44F2; + color:white; +} +.context-menu-theme-osx .context-menu-item .context-menu-item-inner { + padding:2px 10px 2px 22px; + background-color:none; + background-repeat:no-repeat; + background-position:4px center; + background-image:none; +} +.context-menu-theme-osx .context-menu-item-disabled { + color:#939393; +} diff --git a/js/apps/system/aardvark/frontend/css/layout.css b/js/apps/system/aardvark/frontend/css/layout.css index e802c26d2e..a00fadbb46 100644 --- a/js/apps/system/aardvark/frontend/css/layout.css +++ b/js/apps/system/aardvark/frontend/css/layout.css @@ -192,9 +192,9 @@ input,select,option { } li a [class^="icon_arangodb"], li a [class*=" icon_arangodb"] { - font-size: 22px; + font-size: 18px; position: absolute; - right: 5px; + right: 4px; top: 2px; } diff --git a/js/apps/system/aardvark/frontend/css/nv.d3.css b/js/apps/system/aardvark/frontend/css/nv.d3.css index 560d9d352e..1de05ad68d 100644 --- a/js/apps/system/aardvark/frontend/css/nv.d3.css +++ b/js/apps/system/aardvark/frontend/css/nv.d3.css @@ -93,11 +93,15 @@ svg { svg text { - font: normal 12px Arial; + font-weight: 300; + font-size: 10px; + font-family: 'Open Sans', sans-serif; } svg .title { - font: bold 14px Arial; + font-weight: 400; + font-size: 14px; + font-family: 'Open Sans', sans-serif; } .nvd3 .nv-background { @@ -170,7 +174,6 @@ svg .title { } .nvd3 .nv-axis .nv-axisMaxMin text { - font-weight: bold; } .nvd3 .x .nv-axis .nv-axisMaxMin text, @@ -179,8 +182,6 @@ svg .title { text-anchor: middle } - - /********** * Brush */ @@ -278,7 +279,7 @@ svg .title { } .nvd3.nv-pie .hover path { - fill-opacity: .7; + fill-opacity: .8; /* stroke-width: 6px; stroke-opacity: 1; @@ -296,7 +297,7 @@ svg .title { .nvd3 .nv-groups path.nv-line { fill: none; - stroke-width: 2.5px; + stroke-width: 1.25px; /* stroke-linecap: round; shape-rendering: geometricPrecision; diff --git a/js/apps/system/aardvark/frontend/fonts/fontawesome/FontAwesome.otf b/js/apps/system/aardvark/frontend/fonts/fontawesome/FontAwesome.otf new file mode 100644 index 0000000000..8b0f54e47e Binary files /dev/null and b/js/apps/system/aardvark/frontend/fonts/fontawesome/FontAwesome.otf differ diff --git a/js/apps/system/aardvark/frontend/fonts/fontawesome/fontawesome-webfont.eot b/js/apps/system/aardvark/frontend/fonts/fontawesome/fontawesome-webfont.eot new file mode 100755 index 0000000000..7c79c6a6bc Binary files /dev/null and b/js/apps/system/aardvark/frontend/fonts/fontawesome/fontawesome-webfont.eot differ diff --git a/js/apps/system/aardvark/frontend/fonts/fontawesome/fontawesome-webfont.svg b/js/apps/system/aardvark/frontend/fonts/fontawesome/fontawesome-webfont.svg new file mode 100755 index 0000000000..45fdf33830 --- /dev/null +++ b/js/apps/system/aardvark/frontend/fonts/fontawesome/fontawesome-webfont.svg @@ -0,0 +1,414 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/js/apps/system/aardvark/frontend/fonts/fontawesome/fontawesome-webfont.ttf b/js/apps/system/aardvark/frontend/fonts/fontawesome/fontawesome-webfont.ttf new file mode 100755 index 0000000000..e89738de5e Binary files /dev/null and b/js/apps/system/aardvark/frontend/fonts/fontawesome/fontawesome-webfont.ttf differ diff --git a/js/apps/system/aardvark/frontend/fonts/fontawesome/fontawesome-webfont.woff b/js/apps/system/aardvark/frontend/fonts/fontawesome/fontawesome-webfont.woff new file mode 100755 index 0000000000..8c1748aab7 Binary files /dev/null and b/js/apps/system/aardvark/frontend/fonts/fontawesome/fontawesome-webfont.woff differ diff --git a/js/apps/system/aardvark/frontend/js/arango/arango.js b/js/apps/system/aardvark/frontend/js/arango/arango.js index 9a8d40da4c..e85bad77c1 100644 --- a/js/apps/system/aardvark/frontend/js/arango/arango.js +++ b/js/apps/system/aardvark/frontend/js/arango/arango.js @@ -3,6 +3,40 @@ (function() { "use strict"; + window.versionHelper = { + fromString: function (s) { + var parts = s.replace(/-[a-zA-Z0-9_\-]*$/g, '').split('.'); + return { + major: parseInt(parts[0], 10) || 0, + minor: parseInt(parts[1], 10) || 0, + patch: parseInt(parts[2], 10) || 0 + }; + }, + toString: function (v) { + return v.major + '.' + v.minor + '.' + v.patch; + }, + toStringMainLine: function (v) { + return v.major + '.' + v.minor; + }, + compareVersions: function (l, r) { + if (l.major === r.major) { + if (l.minor === r.minor) { + if (l.patch === r.patch) { + return 0; + } + return l.patch - r.patch; + } + return l.minor - r.minor; + } + return l.major - r.major; + }, + compareVersionStrings: function (l, r) { + l = window.versionHelper.fromString(l); + r = window.versionHelper.fromString(r); + return window.versionHelper.compareVersions(l, r); + } + }; + window.arangoHelper = { lastNotificationMessage: null, @@ -71,12 +105,12 @@ $.gritter.removeAll(); this.lastNotificationMessage = null; }, - arangoNotification: function (message) { + arangoNotification: function (message, time) { var returnVal = false; $.gritter.add({ title: "Notice:", text: message, - time: 3000, + time: time || 3000, before_open: function(){ returnVal = true; } diff --git a/js/apps/system/aardvark/frontend/js/bootstrap/module-internal.js b/js/apps/system/aardvark/frontend/js/bootstrap/module-internal.js index a717518f86..375b370ca9 100644 --- a/js/apps/system/aardvark/frontend/js/bootstrap/module-internal.js +++ b/js/apps/system/aardvark/frontend/js/bootstrap/module-internal.js @@ -52,7 +52,6 @@ // cannot use strict here as we are going to delete globals var exports = require("internal"); - var fs = require("fs"); // ----------------------------------------------------------------------------- // --SECTION-- Module "internal" diff --git a/js/apps/system/aardvark/frontend/js/graphViewer/graph/edgeShaper.js b/js/apps/system/aardvark/frontend/js/graphViewer/graph/edgeShaper.js index 6b7b9c84fa..77b49fd253 100644 --- a/js/apps/system/aardvark/frontend/js/graphViewer/graph/edgeShaper.js +++ b/js/apps/system/aardvark/frontend/js/graphViewer/graph/edgeShaper.js @@ -94,7 +94,18 @@ function EdgeShaper(parent, config, idfunc) { * (t.y - s.y) + (t.x - s.x) * (t.x - s.x) - ); + ), + m; + if (s.x === t.x) { + res -= t.z * 18; + } else { + m = Math.abs((t.y - s.y) / (t.x - s.x)); + if (m < 0.4) { + res -= Math.abs((res * t.z * 45) / (t.x - s.x)); + } else { + res -= Math.abs((res * t.z * 18) / (t.y - s.y)); + } + } return res; }, @@ -215,7 +226,7 @@ function EdgeShaper(parent, config, idfunc) { .select("defs") .append("marker") .attr("id", "arrow") - .attr("refX", "22") + .attr("refX", "10") .attr("refY", "5") .attr("markerUnits", "strokeWidth") .attr("markerHeight", "10") diff --git a/js/apps/system/aardvark/frontend/js/graphViewer/graph/nodeShaper.js b/js/apps/system/aardvark/frontend/js/graphViewer/graph/nodeShaper.js index 6a54cf32ae..9a84fa5f29 100644 --- a/js/apps/system/aardvark/frontend/js/graphViewer/graph/nodeShaper.js +++ b/js/apps/system/aardvark/frontend/js/graphViewer/graph/nodeShaper.js @@ -426,6 +426,11 @@ function NodeShaper(parent, flags, idfunc) { return colourMapper.getCommunityColour(); } return colourMapper.getColour(findFirstValue(color.key, n._data)); + }).attr("opacity", function(n) { + if (!n._expanded) { + return "0.8"; + } + return "1"; }); }; addLabelColor = function (n) { diff --git a/js/apps/system/aardvark/frontend/js/graphViewer/graphViewer.js b/js/apps/system/aardvark/frontend/js/graphViewer/graphViewer.js index acb21b53ca..dcadcb296e 100644 --- a/js/apps/system/aardvark/frontend/js/graphViewer/graphViewer.js +++ b/js/apps/system/aardvark/frontend/js/graphViewer/graphViewer.js @@ -112,6 +112,9 @@ function GraphViewer(svg, width, height, adapterConfig, config) { nsConf = config.nodeShaper || {}, idFunc = nsConf.idfunc || undefined, zConf = config.zoom || false; + esConf.shape = esConf.shape || { + type: EdgeShaper.shapes.ARROW + }; parseLayouterConfig(config.layouter); edgeContainer = graphContainer.append("g"); edgeShaper = new EdgeShaper(edgeContainer, esConf); diff --git a/js/apps/system/aardvark/frontend/js/graphViewer/ui/contextMenuHelper.js b/js/apps/system/aardvark/frontend/js/graphViewer/ui/contextMenuHelper.js index 77df15c96a..b718805a7b 100644 --- a/js/apps/system/aardvark/frontend/js/graphViewer/ui/contextMenuHelper.js +++ b/js/apps/system/aardvark/frontend/js/graphViewer/ui/contextMenuHelper.js @@ -40,16 +40,17 @@ function ContextMenu(id) { menu, addEntry = function(label, callback) { - var li, button; - li = document.createElement("li"); - button = document.createElement("button"); - button.onclick = function() { + var item, inner; + item = document.createElement("div"); + item.className = "context-menu-item"; + inner = document.createElement("div"); + inner.className = "context-menu-item-inner"; + inner.appendChild(document.createTextNode(label)); + inner.onclick = function() { callback(d3.select(menu.target).data()[0]); }; - button.className = "btn btn-primary gv_context_button"; - button.appendChild(document.createTextNode(label)); - li.appendChild(button); - ul.appendChild(li); + item.appendChild(inner); + div.appendChild(item); }, bindMenu = function($objects) { @@ -70,11 +71,9 @@ function ContextMenu(id) { div.parentElement.removeChild(div); } div = document.createElement("div"); + div.className = "context-menu context-menu-theme-osx"; div.id = id; - ul = document.createElement("ul"); document.body.appendChild(div); - div.appendChild(ul); - ul = div.firstChild; return div; }; diff --git a/js/apps/system/aardvark/frontend/js/graphViewer/ui/eventDispatcherControls.js b/js/apps/system/aardvark/frontend/js/graphViewer/ui/eventDispatcherControls.js index e929071832..8080a63602 100644 --- a/js/apps/system/aardvark/frontend/js/graphViewer/ui/eventDispatcherControls.js +++ b/js/apps/system/aardvark/frontend/js/graphViewer/ui/eventDispatcherControls.js @@ -47,6 +47,7 @@ function EventDispatcherControls(list, nodeShaper, edgeShaper, start, dispatcher } var self = this, + /* icons = { expand: "expand", add: "add", @@ -56,6 +57,37 @@ function EventDispatcherControls(list, nodeShaper, edgeShaper, start, dispatcher edit: "edit", view: "view" }, + */ + icons = { + expand: { + icon: "expand", + title: "SPOT" + }, + add: { + icon: "plus-square-o", + title: "NODE" + }, + trash: { + icon: "trash-o", + title: "TRASH" + }, + drag: { + icon: "arrows", + title: "DRAG" + }, + edge: { + icon: "link", + title: "EDGE" + }, + edit: { + icon: "pencil", + title: "EDIT" + }, + view: { + icon: "search", + title: "VIEW" + } + }, dispatcher = new EventDispatcher(nodeShaper, edgeShaper, dispatcherConfig), appendToList = function(button) { diff --git a/js/apps/system/aardvark/frontend/js/graphViewer/ui/modalDialogHelper.js b/js/apps/system/aardvark/frontend/js/graphViewer/ui/modalDialogHelper.js index 151c60a458..dfa3f35d29 100644 --- a/js/apps/system/aardvark/frontend/js/graphViewer/ui/modalDialogHelper.js +++ b/js/apps/system/aardvark/frontend/js/graphViewer/ui/modalDialogHelper.js @@ -451,7 +451,6 @@ var modalDialogHelper = modalDialogHelper || {}; modalDialogHelper.createModalChangeDialog = function(title, idprefix, objects, callback) { var table = modalDialogHelper.modalDivTemplate(title, "Change", idprefix, callback); - console.log(objects); _.each(objects, function(o) { insertModalRow(table, idprefix, o); }); diff --git a/js/apps/system/aardvark/frontend/js/graphViewer/ui/uiComponentsHelper.js b/js/apps/system/aardvark/frontend/js/graphViewer/ui/uiComponentsHelper.js index 8ded61658e..56deaa57ad 100644 --- a/js/apps/system/aardvark/frontend/js/graphViewer/ui/uiComponentsHelper.js +++ b/js/apps/system/aardvark/frontend/js/graphViewer/ui/uiComponentsHelper.js @@ -62,17 +62,6 @@ var uiComponentsHelper = uiComponentsHelper || {}; }; uiComponentsHelper.createIconButtonBKP = function(icon, prefix, callback) { - var button = document.createElement("button"), - i = document.createElement("i"); - button.className = "btn btn-icon"; - button.id = prefix; - button.appendChild(i); - i.className = "icon-" + icon + " icon-white"; - button.onclick = callback; - return button; - }; - - uiComponentsHelper.createIconButton = function(icon, prefix, callback) { var button = document.createElement("button"); button.className = "btn btn-icon gv-icon-btn " + icon; button.id = prefix; @@ -86,4 +75,25 @@ var uiComponentsHelper = uiComponentsHelper || {}; return button; }; + uiComponentsHelper.createIconButton = function(iconInfo, prefix, callback) { + var button = document.createElement("div"), + icon = document.createElement("h6"), + label = document.createElement("h6"); + button.className = "gv_action_button"; + button.id = prefix; + button.onclick = function() { + $(".gv_action_button").each(function(i, btn) { + $(btn).toggleClass("active", false); + }); + $(button).toggleClass("active", true); + callback(); + }; + icon.className = "fa gv_icon_icon fa-" + iconInfo.icon; + label.className = "gv_button_title"; + button.appendChild(icon); + button.appendChild(label); + label.appendChild(document.createTextNode(iconInfo.title)); + return button; + }; + }()); diff --git a/js/apps/system/aardvark/frontend/js/routers/router.js b/js/apps/system/aardvark/frontend/js/routers/router.js index 907b990b02..84b5dba5cd 100644 --- a/js/apps/system/aardvark/frontend/js/routers/router.js +++ b/js/apps/system/aardvark/frontend/js/routers/router.js @@ -86,6 +86,8 @@ collection: window.arangoCollectionsStore }); + // this.initVersionCheck(); + var self = this; $(window).resize(function() { self.handleResize(); @@ -103,6 +105,97 @@ }); }, +/* + initVersionCheck: function () { + // this checks for version updates + + var self = this; + var versionCheck = function () { + $.ajax({ + async: true, + crossDomain: true, + dataType: "jsonp", + url: "https://www.arangodb.org/repositories/versions.php?callback=parseVersions", + success: function (json) { + if (typeof json !== 'object') { + return; + } + + // turn our own version string into a version object + var currentVersion = window.versionHelper.fromString(self.footerView.system.version); + + // get our mainline version + var mainLine = window.versionHelper.toStringMainLine(currentVersion); + + var mainLines = Object.keys(json).sort(window.versionHelper.compareVersionStrings); + var latestMainLine; + mainLines.forEach(function (l) { + if (json[l].stable) { + if (window.versionHelper.compareVersionStrings(l, mainLine) > 0) { + latestMainLine = json[l]; + } + } + }); + + var update; + + if (latestMainLine !== undefined && + Object.keys(latestMainLine.versions.length > 0) { + var mainLineVersions = Object.keys(latestMainLine.versions); + mainLineVersions = mainLineVersions.sort(window.versionHelper.compareVersionStrings); + var latest = mainLineVersions[mainLineVersions.length - 1]; + + update = { + type: "major", + version: latest, + changes: latestMainLine.versions[latest].changes + }; + } + + // check which stable mainline versions are available remotely + if (update === undefined && + json.hasOwnProperty(mainLine) && + json[mainLine].stable && + json[mainLine].hasOwnProperty("versions") && + Object.keys(json[mainLine].versions).length > 0) { + // sort by version numbers + var mainLineVersions = Object.keys(json[mainLine].versions); + mainLineVersions = mainLineVersions.sort(window.versionHelper.compareVersionStrings); + var latest = mainLineVersions[mainLineVersions.length - 1]; + + var result = window.versionHelper.compareVersions( + currentVersion, + window.versionHelper.fromString(latest) + ); + if (result < 0) { + update = { + type: "minor", + version: latest, + changes: json[mainLine].versions[latest].changes + }; + } + } + + if (update !== undefined) { + var msg = "A newer version of ArangoDB (" + update.version + + ") has become available. You may want to check the " + + "changelog at " + + update.changes + ""; + arangoHelper.arangoNotification(msg, 15000); + + } + }, + error: function () { + // re-schedule the version check + window.setTimeout(versionCheck, 60000); + } + }); + }; + + window.setTimeout(versionCheck, 5000); + }, +*/ + logsAllowed: function () { return (window.databaseName === '_system'); }, diff --git a/js/apps/system/aardvark/frontend/js/templates/collectionsItemView.ejs b/js/apps/system/aardvark/frontend/js/templates/collectionsItemView.ejs index 3d82fda52c..a2802c18b3 100644 --- a/js/apps/system/aardvark/frontend/js/templates/collectionsItemView.ejs +++ b/js/apps/system/aardvark/frontend/js/templates/collectionsItemView.ejs @@ -4,7 +4,7 @@
- +
<%= attributes.status %>
diff --git a/js/apps/system/aardvark/frontend/js/views/dashboardView.js b/js/apps/system/aardvark/frontend/js/views/dashboardView.js index 8c7c2671fe..340aff5005 100644 --- a/js/apps/system/aardvark/frontend/js/views/dashboardView.js +++ b/js/apps/system/aardvark/frontend/js/views/dashboardView.js @@ -505,32 +505,38 @@ if (self.detailGraph === identifier) { d3.select("#detailGraphChart svg") - .call(chart) - .datum([{ - values: self.seriesData[identifier].values, - key: identifier, - color: "#8AA051" - }]) - .transition().duration(500); + .call(chart) + .datum([{ + values: self.seriesData[identifier].values, + key: identifier, + color: "#8aa14c" + }]) + .attr("stroke-width", "0.5") + .transition().duration(500); } - + //disable ticks/label for small charts d3.select("#" + identifier + "Chart svg") .call(chart) .datum([ { values: self.seriesData[identifier].values, key: identifier, - color: "#8AA051" } + color: "#8aa14c" } ]) - .transition().duration(500); + .attr("stroke-width", "0.5") + .transition().duration(500); + + // Claudius: hide y-axis labels for small charts + $('#' + identifier + ' .nv-y.nv-axis text').attr('display', 'none'); }); this.loadGraphState(); - + // #8AA051 //fix position for last x-value label in detailgraph $('.nv-x.nv-axis .nvd3.nv-wrap.nv-axis:last-child text').attr('x','-5'); //fix position of small graphs $('.svgClass .nv-lineChart').attr('transform','translate(5,5)'); + }, calculateSeries: function (flush) { diff --git a/js/apps/system/aardvark/manifest.json b/js/apps/system/aardvark/manifest.json index 7bdc8022f2..0ee057a82e 100644 --- a/js/apps/system/aardvark/manifest.json +++ b/js/apps/system/aardvark/manifest.json @@ -99,8 +99,10 @@ "frontend/css/swagger/hightlight.default.css", "frontend/css/bootstrap.css", "frontend/css/arangodbIcons.css", + "frontend/css/font-awesome.css", "frontend/css/bootstrap-glyphicons.css", "frontend/css/jquery-ui-1.9.2.custom.css", + "frontend/css/jquery.contextmenu.css", "frontend/css/layout.css", "frontend/css/jquery.dataTables.css", "frontend/css/nv.d3.css", diff --git a/js/apps/system/aardvark/test/specs/graphViewer/helper/uiMatchers.js b/js/apps/system/aardvark/test/specs/graphViewer/helper/uiMatchers.js index c4cc080679..bda67450f7 100644 --- a/js/apps/system/aardvark/test/specs/graphViewer/helper/uiMatchers.js +++ b/js/apps/system/aardvark/test/specs/graphViewer/helper/uiMatchers.js @@ -100,9 +100,8 @@ var uiMatchers = uiMatchers || {}; expect(box).toBeOfClass("btn-group-vertical"); expect(box).toBeOfClass("toolbox"); _.each(box.children, function(btn) { - expect(btn).toBeTag("button"); - expect(btn).toBeOfClass("btn"); - expect(btn).toBeOfClass("btn-icon"); + expect(btn).toBeTag("div"); + expect(btn).toBeOfClass("gv_action_button"); }); return true; }, diff --git a/js/apps/system/aardvark/test/specs/graphViewer/specContextMenu/contextMenuSpec.js b/js/apps/system/aardvark/test/specs/graphViewer/specContextMenu/contextMenuSpec.js index 2cb81bbb98..5057aed82f 100644 --- a/js/apps/system/aardvark/test/specs/graphViewer/specContextMenu/contextMenuSpec.js +++ b/js/apps/system/aardvark/test/specs/graphViewer/specContextMenu/contextMenuSpec.js @@ -3,7 +3,7 @@ /*global describe, it, expect, jasmine */ /*global runs, spyOn, waitsFor, waits */ /*global document, $*/ -/*global ContextMenu*/ +/*global ContextMenu, uiMatchers*/ //////////////////////////////////////////////////////////////////////////////// /// @brief Graph functionality @@ -66,6 +66,7 @@ }; spyOn($.contextMenu, "create").andReturn(fakeMenu); conMenu = new ContextMenu(id); + uiMatchers.define(this); }); it("should create a div in the body", function() { @@ -95,15 +96,19 @@ spyOn(call, "back"); conMenu.addEntry("MyLabel", call.back); // Check if entry is inserted - entry = document.getElementById(id).firstChild; + entry = document.getElementById(id); expect(entry).toBeDefined(); - expect(entry.tagName.toLowerCase()).toEqual("ul"); + expect(entry).toBeTag("div"); + expect(entry).toBeOfClass("context-menu"); + expect(entry).toBeOfClass("context-menu-theme-osx"); entry = entry.firstChild; expect(entry).toBeDefined(); - expect(entry.tagName.toLowerCase()).toEqual("li"); + expect(entry).toBeTag("div"); + expect(entry).toBeOfClass("context-menu-item"); entry = entry.firstChild; expect(entry).toBeDefined(); - expect(entry.tagName.toLowerCase()).toEqual("button"); + expect(entry).toBeTag("div"); + expect(entry).toBeOfClass("context-menu-item-inner"); // Check clicks conMenu.bindMenu(fake); expect(call.back).not.toHaveBeenCalled(); diff --git a/js/apps/system/aardvark/test/specs/graphViewer/specEdgeShaper/edgeShaperSpec.js b/js/apps/system/aardvark/test/specs/graphViewer/specEdgeShaper/edgeShaperSpec.js index 1006921ec9..397c14b16e 100644 --- a/js/apps/system/aardvark/test/specs/graphViewer/specEdgeShaper/edgeShaperSpec.js +++ b/js/apps/system/aardvark/test/specs/graphViewer/specEdgeShaper/edgeShaperSpec.js @@ -38,7 +38,27 @@ describe('Edge Shaper', function() { - var svg; + var svg, + getDistance = function(s, t) { + var res = Math.sqrt( + (t.y - s.y) + * (t.y - s.y) + + (t.x - s.x) + * (t.x - s.x) + ), + m; + if (s.x === t.x) { + res -= t.z * 18; + } else { + m = Math.abs((t.y - s.y) / (t.x - s.x)); + if (m < 0.4) { + res -= Math.abs((res * t.z * 45) / (t.x - s.x)); + } else { + res -= Math.abs((res * t.z * 18) / (t.y - s.y)); + } + } + return res; + }; beforeEach(function () { svg = document.createElement("svg"); @@ -261,35 +281,40 @@ _id: 1, position: { x: 20, - y: 20 + y: 20, + z: 1 } }, NE = { _id: 2, position: { x: 30, - y: 10 + y: 10, + z: 1 } }, SE = { _id: 3, position: { x: 40, - y: 30 + y: 30, + z: 1 } }, SW = { _id: 4, position: { x: 10, - y: 40 + y: 40, + z: 1 } }, NW = { _id: 5, position: { x: 0, - y: 0 + y: 0, + z: 1 } }, edges = [ @@ -328,10 +353,10 @@ expect($("#1-5").attr("transform")).toEqual("translate(20, 20)rotate(-135)"); //Check length of line - expect($("#1-2 line").attr("x2")).toEqual("14.142135623730951"); - expect($("#1-3 line").attr("x2")).toEqual("22.360679774997898"); - expect($("#1-4 line").attr("x2")).toEqual("22.360679774997898"); - expect($("#1-5 line").attr("x2")).toEqual("28.284271247461902"); + expect($("#1-2 line").attr("x2")).toEqual(String(getDistance(center.position, NE.position))); + expect($("#1-3 line").attr("x2")).toEqual(String(getDistance(center.position, SE.position))); + expect($("#1-4 line").attr("x2")).toEqual(String(getDistance(center.position, SW.position))); + expect($("#1-5 line").attr("x2")).toEqual(String(getDistance(center.position, NW.position))); }); it('should be able to draw an edge that follows the cursor', function() { @@ -721,14 +746,16 @@ _id: 1, position: { x: 20, - y: 20 + y: 20, + z: 1 } }, { _id: 2, position: { x: 100, - y: 20 + y: 20, + z: 1 } } ], @@ -744,7 +771,9 @@ ]; shaper.drawEdges(edges); - expect($("#1-2 text").attr("transform")).toEqual("translate(40, -3)"); + expect($("#1-2 text").attr("transform")).toEqual("translate(" + + getDistance(nodes[0].position, nodes[1].position) / 2 + + ", -3)"); }); it('should ignore other attributes', function() { diff --git a/js/apps/system/aardvark/test/specs/graphViewer/specEvents/eventDispatcherUISpec.js b/js/apps/system/aardvark/test/specs/graphViewer/specEvents/eventDispatcherUISpec.js index 7c367a531e..57b860715f 100644 --- a/js/apps/system/aardvark/test/specs/graphViewer/specEvents/eventDispatcherUISpec.js +++ b/js/apps/system/aardvark/test/specs/graphViewer/specEvents/eventDispatcherUISpec.js @@ -179,13 +179,18 @@ this.addMatchers({ toConformToToolbox: function() { var box = this.actual, + icon = $("h6", $(box))[0], + title = $("h6", $(box))[1], foundActive = false, failed = false; _.each(box.children, function(btn) { - expect(btn).toBeTag("button"); - expect(btn).toBeOfClass("btn btn-icon"); - expect(btn).toBeOfClass("btn-icon"); - expect(btn).toBeOfClass("gv-icon-btn"); + expect(btn).toBeTag("div"); + expect(btn).toBeOfClass("gv_action_button"); + expect(icon).toBeTag("h6"); + expect(icon).toBeOfClass("fa"); + expect(icon).toBeOfClass("gv_icon_icon"); + expect(title).toBeTag("h6"); + expect(title).toBeOfClass("gv_button_title"); if ($(btn).hasClass("active")) { if (foundActive) { failed = true; diff --git a/js/apps/system/aardvark/test/specs/graphViewer/specGraphViewer/graphViewerPreviewSpec.js b/js/apps/system/aardvark/test/specs/graphViewer/specGraphViewer/graphViewerPreviewSpec.js index 6ead5d4339..ffc2a3d37d 100644 --- a/js/apps/system/aardvark/test/specs/graphViewer/specGraphViewer/graphViewerPreviewSpec.js +++ b/js/apps/system/aardvark/test/specs/graphViewer/specGraphViewer/graphViewerPreviewSpec.js @@ -170,7 +170,8 @@ jasmine.any(Object), { label: "label", - color: jasmine.any(Object) + color: jasmine.any(Object), + shape: jasmine.any(Object) } ); }); diff --git a/js/client/tests/client.js b/js/client/tests/client.js index 637938b062..92498c2efe 100644 --- a/js/client/tests/client.js +++ b/js/client/tests/client.js @@ -1,3 +1,8 @@ +/*jslint indent: 2, maxlen: 120, vars: true, white: true, plusplus: true, nonpropdel: true, nomen: true, sloppy: true */ +/*global require, assertEqual, assertNotEqual, + print, print_plain, COMPARE_STRING, NORMALIZE_STRING, + help, start_pager, stop_pager, start_pretty_print, stop_pretty_print, start_color_print, stop_color_print */ + //////////////////////////////////////////////////////////////////////////////// /// @brief tests for client-specific functionality /// @@ -25,6 +30,8 @@ /// @author Copyright 2012, triAGENS GmbH, Cologne, Germany //////////////////////////////////////////////////////////////////////////////// +(function () { + var jsunity = require("jsunity"); var db = require("org/arangodb").db; @@ -153,8 +160,8 @@ function clientTestSuite () { //////////////////////////////////////////////////////////////////////////////// testICU_Compare : function () { - nfc = "Gr\u00FC\u00DF Gott."; - nfd = "Gru\u0308\u00DF Gott."; + var nfc = "Gr\u00FC\u00DF Gott."; + var nfd = "Gru\u0308\u00DF Gott."; assertNotEqual(nfc, nfd); assertNotEqual(COMPARE_STRING(nfc, nfd), true); @@ -165,8 +172,8 @@ function clientTestSuite () { //////////////////////////////////////////////////////////////////////////////// testICU_Normalize : function () { - nfc = "Gr\u00FC\u00DF Gott."; - nfd = "Gru\u0308\u00DF Gott."; + var nfc = "Gr\u00FC\u00DF Gott."; + var nfd = "Gru\u0308\u00DF Gott."; assertNotEqual(nfc, nfd); assertEqual(NORMALIZE_STRING(nfd), nfc); @@ -179,15 +186,15 @@ function clientTestSuite () { testICU_Compare_Skiplist_Sorting : function () { db._create("ICU_SORTED"); - db["ICU_SORTED"].ensureSkiplist("test"); - db["ICU_SORTED"].save({ test : "äää" }); - db["ICU_SORTED"].save({ test : "aaa" }); - db["ICU_SORTED"].save({ test : "aab" }); - db["ICU_SORTED"].save({ test : "äaa" }); - db["ICU_SORTED"].save({ test : "äää" }); - db["ICU_SORTED"].save({ test : "Aaa" }); + db.ICU_SORTED.ensureSkiplist("test"); + db.ICU_SORTED.save({ test : "äää" }); + db.ICU_SORTED.save({ test : "aaa" }); + db.ICU_SORTED.save({ test : "aab" }); + db.ICU_SORTED.save({ test : "äaa" }); + db.ICU_SORTED.save({ test : "äää" }); + db.ICU_SORTED.save({ test : "Aaa" }); - var y = db["ICU_SORTED"].range("test", "A", "z") ; + var y = db.ICU_SORTED.range("test", "A", "z") ; assertEqual(y.next().test, "Aaa"); assertEqual(y.next().test, "aaa"); @@ -208,6 +215,8 @@ jsunity.run(clientTestSuite); return jsunity.done(); +}()); + // Local Variables: // mode: outline-minor // outline-regexp: "^\\(/// @brief\\|/// @addtogroup\\|// --SECTION--\\|/// @page\\|/// @}\\)" diff --git a/js/client/tests/shell-auth.js b/js/client/tests/shell-auth.js index bd2cf70e8a..3a358f0916 100644 --- a/js/client/tests/shell-auth.js +++ b/js/client/tests/shell-auth.js @@ -1,5 +1,8 @@ +/*jslint indent: 2, maxlen: 120, vars: true, white: true, plusplus: true, nonpropdel: true, nomen: true, sloppy: true */ +/*global require, fail, assertTrue */ + //////////////////////////////////////////////////////////////////////////////// -/// @brief test the foxx manager +/// @brief test the authentication /// /// @file /// @@ -25,6 +28,7 @@ /// @author Copyright 2013, triAGENS GmbH, Cologne, Germany //////////////////////////////////////////////////////////////////////////////// +(function () { var jsunity = require("jsunity"); var arango = require("org/arangodb").arango; var db = require("internal").db; @@ -241,9 +245,9 @@ function AuthSuite () { jsunity.run(AuthSuite); return jsunity.done(); +}()); // Local Variables: // mode: outline-minor // outline-regexp: "^\\(/// @brief\\|/// @addtogroup\\|// --SECTION--\\|/// @page\\|/// @}\\)" // End: - diff --git a/js/client/tests/shell-endpoints.js b/js/client/tests/shell-endpoints.js index 5662ff22e9..d4d0ad3b30 100644 --- a/js/client/tests/shell-endpoints.js +++ b/js/client/tests/shell-endpoints.js @@ -1,3 +1,6 @@ +/*jslint indent: 2, maxlen: 120, vars: true, white: true, plusplus: true, nonpropdel: true, nomen: true, sloppy: true */ +/*global require, fail, assertTrue, assertEqual */ + //////////////////////////////////////////////////////////////////////////////// /// @brief test the endpoints /// @@ -25,6 +28,8 @@ /// @author Copyright 2013, triAGENS GmbH, Cologne, Germany //////////////////////////////////////////////////////////////////////////////// +(function () { + var jsunity = require("jsunity"); var arangodb = require("org/arangodb"); var arango = arangodb.arango; @@ -166,7 +171,7 @@ function EndpointsSuite () { fail(); } catch (err1) { - assertEqual(ERRORS.ERROR_BAD_PARAMETER.code, err1.errorNum) + assertEqual(ERRORS.ERROR_BAD_PARAMETER.code, err1.errorNum); } try { @@ -175,7 +180,7 @@ function EndpointsSuite () { fail(); } catch (err2) { - assertEqual(ERRORS.ERROR_BAD_PARAMETER.code, err2.errorNum) + assertEqual(ERRORS.ERROR_BAD_PARAMETER.code, err2.errorNum); } try { @@ -184,7 +189,7 @@ function EndpointsSuite () { fail(); } catch (err3) { - assertEqual(ERRORS.ERROR_BAD_PARAMETER.code, err3.errorNum) + assertEqual(ERRORS.ERROR_BAD_PARAMETER.code, err3.errorNum); } }, @@ -257,7 +262,7 @@ function EndpointsSuite () { var base = 30000 + parseInt(Math.random() * 10000, 10); // create a few endpoints - db._configureEndpoint("tcp://127.0.0.1:" + (base + 0), [ ]); + db._configureEndpoint("tcp://127.0.0.1:" + (base), [ ]); db._configureEndpoint("tcp://127.0.0.1:" + (base + 1), [ "UnitTestsDatabase0" ]); db._configureEndpoint("tcp://127.0.0.1:" + (base + 2), [ "UnitTestsDatabase1" ]); db._configureEndpoint("tcp://127.0.0.1:" + (base + 3), [ "UnitTestsDatabase0", "UnitTestsDatabase1" ]); @@ -290,7 +295,7 @@ function EndpointsSuite () { [ "UnitTestsDatabase1", "UnitTestsDatabase1" ] ]; - test("tcp://127.0.0.1:" + (base + 0), endpoints); + test("tcp://127.0.0.1:" + (base), endpoints); endpoints = [ [ "", "UnitTestsDatabase0" ], @@ -354,7 +359,7 @@ function EndpointsSuite () { fail(); } catch (err2) { - assertEqual(ERRORS.ERROR_ARANGO_USE_SYSTEM_DATABASE.code, err2.errorNum) + assertEqual(ERRORS.ERROR_ARANGO_USE_SYSTEM_DATABASE.code, err2.errorNum); } // _configureEndpoint is forbidden @@ -364,7 +369,7 @@ function EndpointsSuite () { fail(); } catch (err3) { - assertEqual(ERRORS.ERROR_ARANGO_USE_SYSTEM_DATABASE.code, err3.errorNum) + assertEqual(ERRORS.ERROR_ARANGO_USE_SYSTEM_DATABASE.code, err3.errorNum); } } @@ -382,6 +387,7 @@ function EndpointsSuite () { jsunity.run(EndpointsSuite); return jsunity.done(); +}()); // Local Variables: // mode: outline-minor diff --git a/js/client/tests/shell-fm.js b/js/client/tests/shell-fm.js index 936796ce4b..4439525284 100644 --- a/js/client/tests/shell-fm.js +++ b/js/client/tests/shell-fm.js @@ -1,3 +1,6 @@ +/*jslint indent: 2, maxlen: 120, vars: true, white: true, plusplus: true, nonpropdel: true, nomen: true, sloppy: true */ +/*global require, fail, assertTrue, assertFalse, assertEqual, assertMatch, assertNotNull */ + //////////////////////////////////////////////////////////////////////////////// /// @brief test the foxx manager /// @@ -25,6 +28,7 @@ /// @author Copyright 2013, triAGENS GmbH, Cologne, Germany //////////////////////////////////////////////////////////////////////////////// +(function () { var jsunity = require("jsunity"); var fm = require("org/arangodb/foxx/manager"); var arango = require("org/arangodb").arango; @@ -119,8 +123,8 @@ function FoxxManagerSuite () { assertTrue(entry.hasOwnProperty("description")); assertTrue(entry.hasOwnProperty("version")); assertTrue(entry.hasOwnProperty("path")); + return; } - return; } fail(); @@ -185,7 +189,7 @@ function FoxxManagerSuite () { assertTrue(entry.hasOwnProperty("author")); assertTrue(entry.hasOwnProperty("versions")); - versions = entry.versions; + var version; for (version in entry.versions) { if (entry.versions.hasOwnProperty(version)) { @@ -302,7 +306,7 @@ function FoxxManagerSuite () { try { fm.uninstall("/itz"); } - catch (err) { + catch (err1) { } try { @@ -310,7 +314,7 @@ function FoxxManagerSuite () { fm.uninstall("/itz"); fail(); } - catch (err) { + catch (err2) { } }, @@ -361,7 +365,7 @@ function FoxxManagerSuite () { try { fm.uninstall("/itz"); } - catch (err) { + catch (err1) { } try { @@ -369,7 +373,7 @@ function FoxxManagerSuite () { fm.unmount("/itz"); fail(); } - catch (err) { + catch (err2) { } }, @@ -408,6 +412,8 @@ jsunity.run(FoxxManagerSuite); return jsunity.done(); +}()); + // Local Variables: // mode: outline-minor // outline-regexp: "^\\(/// @brief\\|/// @addtogroup\\|// --SECTION--\\|/// @page\\|/// @}\\)" diff --git a/js/common/bootstrap/module-internal.js b/js/common/bootstrap/module-internal.js index a717518f86..375b370ca9 100644 --- a/js/common/bootstrap/module-internal.js +++ b/js/common/bootstrap/module-internal.js @@ -52,7 +52,6 @@ // cannot use strict here as we are going to delete globals var exports = require("internal"); - var fs = require("fs"); // ----------------------------------------------------------------------------- // --SECTION-- Module "internal" diff --git a/js/common/tests/shell-collection-volatile.js b/js/common/tests/shell-collection-volatile.js index 6671f7986c..adbae63625 100644 --- a/js/common/tests/shell-collection-volatile.js +++ b/js/common/tests/shell-collection-volatile.js @@ -89,7 +89,7 @@ function CollectionVolatileSuite () { testCreationError : function () { try { // cannot set isVolatile and waitForSync at the same time - var c = internal.db._create(cn, { isVolatile : true, waitForSync : true }); + internal.db._create(cn, { isVolatile : true, waitForSync : true }); fail(); } catch (err) { diff --git a/js/common/tests/shell-collection.js b/js/common/tests/shell-collection.js index cf96a8ac0a..07b5f6ad60 100644 --- a/js/common/tests/shell-collection.js +++ b/js/common/tests/shell-collection.js @@ -870,7 +870,7 @@ function CollectionSuite () { db._drop(cn1); db._drop(cn2); var c1 = db._create(cn1); - var c2 = db._create(cn2); + db._create(cn2); try { c1.rename(cn2); @@ -1506,8 +1506,8 @@ function CollectionDbSuite () { db._drop(cn1); db._drop(cn2); - var c1 = db._createDocumentCollection(cn1); - var c2 = db._createEdgeCollection(cn2); + db._createDocumentCollection(cn1); + db._createEdgeCollection(cn2); var collections = db._collections(); for (var i in collections) { diff --git a/js/common/tests/shell-download.js b/js/common/tests/shell-download.js index f4f68bcc39..1c27818b72 100644 --- a/js/common/tests/shell-download.js +++ b/js/common/tests/shell-download.js @@ -133,7 +133,7 @@ function DownloadSuite () { //////////////////////////////////////////////////////////////////////////////// testGetErrorNoReturn : function () { - var result, response = internal.download(buildUrl("?foo=1&bar=baz&code=404"), undefined, { }, tempName ); + var response = internal.download(buildUrl("?foo=1&bar=baz&code=404"), undefined, { }, tempName ); assertEqual(404, response.code); @@ -287,7 +287,7 @@ function DownloadSuite () { //////////////////////////////////////////////////////////////////////////////// testHead : function () { - var result, response = internal.download(buildUrl(""), undefined, { method: "head" }); + var response = internal.download(buildUrl(""), undefined, { method: "head" }); assertEqual(200, response.code); diff --git a/js/common/tests/shell-fs.js b/js/common/tests/shell-fs.js index b65b6fcdd1..4d0d17e589 100644 --- a/js/common/tests/shell-fs.js +++ b/js/common/tests/shell-fs.js @@ -28,7 +28,6 @@ var jsunity = require("jsunity"); var fs = require("fs"); -var internal = require("internal"); // ----------------------------------------------------------------------------- // --SECTION-- filesystem diff --git a/js/common/tests/shell-graph-algorithms.js b/js/common/tests/shell-graph-algorithms.js index 086c75ae5a..07e9235a6d 100644 --- a/js/common/tests/shell-graph-algorithms.js +++ b/js/common/tests/shell-graph-algorithms.js @@ -32,8 +32,6 @@ var jsunity = require("jsunity"); var console = require("console"); -var Helper = require("org/arangodb/test-helper").Helper; - // ----------------------------------------------------------------------------- // --SECTION-- collection methods // ----------------------------------------------------------------------------- diff --git a/js/common/tests/shell-graph-measurement.js b/js/common/tests/shell-graph-measurement.js index 3430ee765f..588e715be0 100644 --- a/js/common/tests/shell-graph-measurement.js +++ b/js/common/tests/shell-graph-measurement.js @@ -37,7 +37,6 @@ //////////////////////////////////////////////////////////////////////////////// var jsunity = require("jsunity"), - Helper = require("org/arangodb/test-helper").Helper, console = require("console"); // ----------------------------------------------------------------------------- diff --git a/js/common/tests/shell-graph-traversal.js b/js/common/tests/shell-graph-traversal.js index 53ebc7df88..bf51659e56 100644 --- a/js/common/tests/shell-graph-traversal.js +++ b/js/common/tests/shell-graph-traversal.js @@ -75,10 +75,10 @@ function GraphTraversalSuite () { var v2 = g.addVertex("v2"); var v3 = g.addVertex("v3"); var v4 = g.addVertex("v4"); - var e1 = g.addEdge(v1, v2, "v1v2"); - var e3 = g.addEdge(v2, v3, "v2v3"); - var e4 = g.addEdge(v1, v4, "v1v4"); - var e5 = g.addEdge(v4, v3, "v4v3"); + g.addEdge(v1, v2, "v1v2"); + g.addEdge(v2, v3, "v2v3"); + g.addEdge(v1, v4, "v1v4"); + g.addEdge(v4, v3, "v4v3"); }, //////////////////////////////////////////////////////////////////////////////// diff --git a/js/common/tests/shell-hash-index.js b/js/common/tests/shell-hash-index.js index 987e69fb6e..e1dda1383b 100644 --- a/js/common/tests/shell-hash-index.js +++ b/js/common/tests/shell-hash-index.js @@ -30,7 +30,6 @@ var jsunity = require("jsunity"); var internal = require("internal"); -var console = require("console"); var errors = internal.errors; // ----------------------------------------------------------------------------- @@ -158,15 +157,15 @@ function HashIndexSuite() { var d1 = collection.save({ a : 1, b : 1 })._id; var d2 = collection.save({ a : 2, b : 1 })._id; - var d3 = collection.save({ a : 3, b : 1 })._id; - var d4 = collection.save({ a : 4, b : 1 })._id; - var d5 = collection.save({ a : 4, b : 2 })._id; + collection.save({ a : 3, b : 1 })._id; + collection.save({ a : 4, b : 1 })._id; + collection.save({ a : 4, b : 2 })._id; var d6 = collection.save({ a : 1, b : 1 })._id; var d7 = collection.save({ a : 1 })._id; var d8 = collection.save({ a : 1 })._id; - var d9 = collection.save({ a : null, b : 1 })._id; - var d10 = collection.save({ a : null, b : 1 })._id; + collection.save({ a : null, b : 1 })._id; + collection.save({ a : null, b : 1 })._id; var d11 = collection.save({ c : 1 })._id; var d12 = collection.save({ c : 1 })._id; @@ -214,9 +213,9 @@ function HashIndexSuite() { testReadDocumentsUnloaded : function () { var idx = collection.ensureHashIndex("a"); - var d1 = collection.save({ a : 1, b : 1 })._id; + collection.save({ a : 1, b : 1 })._id; var d2 = collection.save({ a : 2, b : 1 })._id; - var d3 = collection.save({ a : 3, b : 1 })._id; + collection.save({ a : 3, b : 1 })._id; collection.unload(); internal.wait(4); diff --git a/js/common/tests/shell-index-geo.js b/js/common/tests/shell-index-geo.js index d61fdb9153..5a91449693 100644 --- a/js/common/tests/shell-index-geo.js +++ b/js/common/tests/shell-index-geo.js @@ -549,7 +549,7 @@ function GeoIndexErrorHandlingSuite() { var d2 = collection.save({ loc : null }); var d3 = collection.save({ loc : [0] }); var d4 = collection.save({ loc : [ -100, -200 ] }); - var d5 = collection.save({ loc : [ -10, -20 ]}); + collection.save({ loc : [ -10, -20 ]}); assertEqual(1, collection.near(0,0).toArray().length); diff --git a/js/common/tests/shell-index.js b/js/common/tests/shell-index.js index 83f321a903..2e3d91ff29 100644 --- a/js/common/tests/shell-index.js +++ b/js/common/tests/shell-index.js @@ -175,7 +175,7 @@ function indexSuite() { testGetNonExistingIndexes : function () { [ "2444334000000", "9999999999999" ].forEach(function (id) { try { - var idx = collection.index(id); + collection.index(id); fail(); } catch (err) { diff --git a/js/common/tests/shell-statement.js b/js/common/tests/shell-statement.js index f12119630e..e06854b62e 100644 --- a/js/common/tests/shell-statement.js +++ b/js/common/tests/shell-statement.js @@ -73,7 +73,7 @@ function StatementSuite () { testConstructNoQuery : function () { try { - var st = new ArangoStatement(db); + new ArangoStatement(db); fail(); } catch (e) { @@ -396,8 +396,8 @@ function StatementSuite () { var st = new ArangoStatement(db, { query : "for u in [ 1 ] return @value" }); st.bind("list", [ 1, 2, 3 ]); try { - var result = st.execute(); - assertFalse(true); + st.execute(); + fail(); } catch (e) { assertEqual(1551, e.errorNum); @@ -413,7 +413,7 @@ function StatementSuite () { st.bind("value", 1); try { st.bind("value", 1); - assertFalse(true); + fail(); } catch (e) { } diff --git a/js/common/tests/shell-unique-constraint.js b/js/common/tests/shell-unique-constraint.js index 6067348552..0637fbefaf 100644 --- a/js/common/tests/shell-unique-constraint.js +++ b/js/common/tests/shell-unique-constraint.js @@ -162,10 +162,10 @@ function UniqueConstraintSuite() { assertEqual(true, idx.isNewlyCreated); var d1 = collection.save({ a : 1, b : 1 })._id; - var d2 = collection.save({ a : 2, b : 1 })._id; - var d3 = collection.save({ a : 3, b : 1 })._id; - var d4 = collection.save({ a : 4, b : 1 })._id; - var d5 = collection.save({ a : 4, b : 2 })._id; + collection.save({ a : 2, b : 1 })._id; + collection.save({ a : 3, b : 1 })._id; + collection.save({ a : 4, b : 1 })._id; + collection.save({ a : 4, b : 2 })._id; collection.save({ a : 1 }); collection.save({ a : 1 }); diff --git a/js/common/tests/shell-unload.js b/js/common/tests/shell-unload.js index 3a35176118..d70f99ed59 100644 --- a/js/common/tests/shell-unload.js +++ b/js/common/tests/shell-unload.js @@ -29,7 +29,6 @@ //////////////////////////////////////////////////////////////////////////////// var jsunity = require("jsunity"); -var arangodb = require("org/arangodb"); var internal = require("internal"); // ----------------------------------------------------------------------------- diff --git a/js/server/modules/org/arangodb/ahuacatl.js b/js/server/modules/org/arangodb/ahuacatl.js index ffb9535338..0dbb1ecfdc 100644 --- a/js/server/modules/org/arangodb/ahuacatl.js +++ b/js/server/modules/org/arangodb/ahuacatl.js @@ -3284,6 +3284,51 @@ function PARSE_IDENTIFIER (value) { THROW(INTERNAL.errors.ERROR_QUERY_FUNCTION_ARGUMENT_TYPE_MISMATCH, "PARSE_IDENTIFIER"); } +//////////////////////////////////////////////////////////////////////////////// +/// @brief query a skiplist index +/// +/// returns a documents from a skiplist index on the specified collection. Only +/// documents that match the specified condition will be returned. +//////////////////////////////////////////////////////////////////////////////// + +function SKIPLIST_QUERY (collection, condition, skip, limit) { + "use strict"; + + var keys = [ ], key, idx; + + for (key in condition) { + if (condition.hasOwnProperty(key)) { + keys.push(key); + } + } + + var c = COLLECTION(collection); + if (c === null) { + THROW(INTERNAL.errors.ERROR_ARANGO_COLLECTION_NOT_FOUND, collection); + } + + idx = c.lookupSkiplist.apply(c, keys); + + if (idx === null) { + THROW(INTERNAL.errors.ERROR_ARANGO_NO_INDEX); + } + + if (skip === undefined || skip === null) { + skip = 0; + } + + if (limit === undefined || limit === null) { + limit = null; + } + + try { + return c.BY_CONDITION_SKIPLIST(idx.id, condition, skip, limit).documents; + } + catch (err) { + THROW(INTERNAL.errors.ERROR_ARANGO_NO_INDEX); + } +} + //////////////////////////////////////////////////////////////////////////////// /// @brief check whether a document has a specific attribute //////////////////////////////////////////////////////////////////////////////// @@ -4210,6 +4255,7 @@ exports.NOT_NULL = NOT_NULL; exports.FIRST_LIST = FIRST_LIST; exports.FIRST_DOCUMENT = FIRST_DOCUMENT; exports.PARSE_IDENTIFIER = PARSE_IDENTIFIER; +exports.SKIPLIST_QUERY = SKIPLIST_QUERY; exports.HAS = HAS; exports.ATTRIBUTES = ATTRIBUTES; exports.UNSET = UNSET; diff --git a/js/server/modules/org/arangodb/arango-collection.js b/js/server/modules/org/arangodb/arango-collection.js index b5a5fd9615..a9cf2cf836 100644 --- a/js/server/modules/org/arangodb/arango-collection.js +++ b/js/server/modules/org/arangodb/arango-collection.js @@ -468,7 +468,6 @@ ArangoCollection.prototype.removeByExample = function (example, throw err; } - shards.forEach(function (shard) { ArangoClusterComm.asyncRequest("put", @@ -478,7 +477,8 @@ ArangoCollection.prototype.removeByExample = function (example, JSON.stringify({ collection: shard, example: example, - waitForSync: waitForSync + waitForSync: waitForSync, + limit: limit || undefined }), { }, options); @@ -570,7 +570,8 @@ ArangoCollection.prototype.replaceByExample = function (example, collection: shard, example: example, newValue: newValue, - waitForSync: waitForSync + waitForSync: waitForSync, + limit: limit || undefined }), { }, options); @@ -666,7 +667,8 @@ ArangoCollection.prototype.updateByExample = function (example, example: example, newValue: newValue, waitForSync: waitForSync, - keepNull: keepNull + keepNull: keepNull, + limit: limit || undefined }), { }, options); diff --git a/js/server/modules/org/arangodb/cluster/kickstarter.js b/js/server/modules/org/arangodb/cluster/kickstarter.js index 93301300a6..7ad74e380a 100644 --- a/js/server/modules/org/arangodb/cluster/kickstarter.js +++ b/js/server/modules/org/arangodb/cluster/kickstarter.js @@ -44,7 +44,6 @@ var exchangePort = require("org/arangodb/cluster/planner").exchangePort; var print = require("internal").print; var launchActions = {}; -var relaunchActions = {}; var shutdownActions = {}; function getAddrPort (endpoint) { diff --git a/js/server/modules/org/arangodb/foxx/base_middleware.js b/js/server/modules/org/arangodb/foxx/base_middleware.js index 996bc8d6e6..1ad1af34e2 100644 --- a/js/server/modules/org/arangodb/foxx/base_middleware.js +++ b/js/server/modules/org/arangodb/foxx/base_middleware.js @@ -1,4 +1,4 @@ -/*jslint indent: 2, nomen: true, maxlen: 120 */ +/*jslint indent: 2, nomen: true, maxlen: 120, vars: true */ /*global module, require, exports */ //////////////////////////////////////////////////////////////////////////////// @@ -209,11 +209,15 @@ BaseMiddleware = function () { if (trace) { if (response.hasOwnProperty("body")) { + var bodyLength = 0; + if (response.body !== undefined) { + bodyLength = parseInt(response.body.length, 10); + } console.log("%s, outgoing response with status %s of type %s, body length: %d", options.mount, response.responseCode, response.contentType, - parseInt(response.body.length, 10)); + bodyLength); } else if (response.hasOwnProperty("bodyFromFile")) { console.log("%s, outgoing response with status %s of type %s, body file: %s", options.mount, diff --git a/js/server/tests/ahuacatl-cross.js b/js/server/tests/ahuacatl-cross.js index 4f6b6ca6f2..9e5dccb6c7 100644 --- a/js/server/tests/ahuacatl-cross.js +++ b/js/server/tests/ahuacatl-cross.js @@ -134,8 +134,8 @@ function ahuacatlCrossCollection () { var d1 = vertex1.save({ _key: "test1", a: 1 }); var d2 = vertex1.save({ _key: "test2", a: 2 }); var d3 = vertex2.save({ _key: "test3", a: 3 }); - var e1 = edge.save(d1._id, d2._id, { }); - var e2 = edge.save(d2._id, d3._id, { }); + edge.save(d1._id, d2._id, { }); + edge.save(d2._id, d3._id, { }); var actual = getQueryResults("FOR t IN TRAVERSAL(" + vn1 + ", " + en + ", " + JSON.stringify(d1._id) + ", 'outbound', { }) RETURN t"); assertEqual(3, actual.length); @@ -153,8 +153,8 @@ function ahuacatlCrossCollection () { var d1 = vertex1.save({ _key: "test1", a: 1 }); var d2 = vertex2.save({ _key: "test2", a: 2 }); var d3 = vertex2.save({ _key: "test3", a: 3 }); - var e1 = edge.save(d1._id, d2._id, { }); - var e2 = edge.save(d2._id, d3._id, { }); + edge.save(d1._id, d2._id, { }); + edge.save(d2._id, d3._id, { }); var actual = getQueryResults("FOR t IN TRAVERSAL(" + vn1 + ", " + en + ", " + JSON.stringify(d2._id) + ", 'outbound', { }) RETURN t"); assertEqual(2, actual.length); diff --git a/js/server/tests/ahuacatl-functions.js b/js/server/tests/ahuacatl-functions.js index 78928f3467..8220a4fcef 100644 --- a/js/server/tests/ahuacatl-functions.js +++ b/js/server/tests/ahuacatl-functions.js @@ -1179,7 +1179,7 @@ function ahuacatlFunctionsTestSuite () { //////////////////////////////////////////////////////////////////////////////// testKeep : function () { - var actual, expected; + var actual; actual = getQueryResults("FOR i IN [ { }, { foo: 1, bar: 2, moo: 3, goof: 4, bang: 5, meow: 6 }, { foo: 0, goof: 1, meow: 2 }, { foo: null }, { foo: true }, { goof: null } ] RETURN KEEP(i, 'foo', 'bar', 'baz', [ 'meow' ], [ ])"); assertEqual([ { }, { bar: 2, foo: 1, meow: 6 }, { foo: 0, meow: 2 }, { foo: null }, { foo: true }, { } ], actual); @@ -1993,7 +1993,7 @@ function ahuacatlFunctionsTestSuite () { actual = getQueryResults("RETURN DOCUMENT(CONCAT(\"" + cn + "\", \"bart\"))"); assertEqual([ null ], actual); - var d3 = cx.save({ _key: "foo", value: "bar" }); + cx.save({ _key: "foo", value: "bar" }); expected = [ { value: "bar" } ]; actual = getQueryResults("RETURN DOCUMENT(CONCAT(\"" + cn + "\", \"foo\"))"); assertEqual([ null ], actual); @@ -2112,7 +2112,7 @@ function ahuacatlFunctionsTestSuite () { var cn = "UnitTestsAhuacatlFunctions"; internal.db._drop(cn); - var cx = internal.db._create(cn); + internal.db._create(cn); var expected, actual; @@ -2147,6 +2147,106 @@ function ahuacatlFunctionsTestSuite () { internal.db._drop(cn); }, +//////////////////////////////////////////////////////////////////////////////// +/// @brief test skiplist function +//////////////////////////////////////////////////////////////////////////////// + + testSkiplist1 : function () { + var cn = "UnitTestsAhuacatlFunctions"; + + internal.db._drop(cn); + var cx = internal.db._create(cn); + cx.ensureSkiplist("created"); + + var i; + for (i = 0; i < 1000; ++i) { + cx.save({ created: i }); + } + + expected = [ { created: 0 } ]; + actual = getQueryResults("FOR x IN SKIPLIST(" + cn + ", { created: [[ '>=', 0 ]] }, 0, 1) RETURN x"); + assertEqual(expected, actual); + actual = getQueryResults("FOR x IN SKIPLIST(" + cn + ", { created: [[ '>=', 0 ], [ '<', 1 ]] }) RETURN x"); + assertEqual(expected, actual); + + expected = [ { created: 1 } ]; + actual = getQueryResults("FOR x IN SKIPLIST(" + cn + ", { created: [[ '>', 0 ]] }, 0, 1) RETURN x"); + assertEqual(expected, actual); + actual = getQueryResults("FOR x IN SKIPLIST(" + cn + ", { created: [[ '>', 0 ], [ '<=', 1 ]] }) RETURN x"); + assertEqual(expected, actual); + + expected = [ { created: 0 }, { created: 1 }, { created: 2 } ]; + actual = getQueryResults("FOR x IN SKIPLIST(" + cn + ", { created: [[ '>=', 0 ]] }, 0, 3) RETURN x"); + assertEqual(expected, actual); + + expected = [ { created: 5 }, { created: 6 } ]; + actual = getQueryResults("FOR x IN SKIPLIST(" + cn + ", { created: [[ '>=', 0 ]] }, 5, 2) RETURN x"); + assertEqual(expected, actual); + + expected = [ { created: 5 }, { created: 6 } ]; + actual = getQueryResults("FOR x IN SKIPLIST(" + cn + ", { created: [[ '>=', 5 ], [ '<=', 6 ]] }, 0, 5) RETURN x"); + assertEqual(expected, actual); + + expected = [ { created: 5 } ]; + actual = getQueryResults("FOR x IN SKIPLIST(" + cn + ", { created: [[ '>=', 5 ], [ '<=', 6 ]] }, 0, 1) RETURN x"); + assertEqual(expected, actual); + + expected = [ { created: 2 }, { created: 3 } ]; + actual = getQueryResults("FOR x IN SKIPLIST(" + cn + ", { created: [[ '<', 4 ]] }, 2, 10) RETURN x"); + assertEqual(expected, actual); + + expected = [ ]; + actual = getQueryResults("FOR x IN SKIPLIST(" + cn + ", { created: [[ '>', 0 ]] }, 10000, 10) RETURN x"); + assertEqual(expected, actual); + + assertQueryError(errors.ERROR_ARANGO_NO_INDEX.code, "RETURN SKIPLIST(" + cn + ", { a: [[ '==', 1 ]] })"); + + internal.db._drop(cn); + }, + +//////////////////////////////////////////////////////////////////////////////// +/// @brief test skiplist function +//////////////////////////////////////////////////////////////////////////////// + + testSkiplist2 : function () { + var cn = "UnitTestsAhuacatlFunctions"; + + internal.db._drop(cn); + var cx = internal.db._create(cn); + + assertQueryError(errors.ERROR_ARANGO_NO_INDEX.code, "RETURN SKIPLIST(" + cn + ", { a: [[ '==', 1 ]], b: [[ '==', 0 ]] })"); + + cx.ensureSkiplist("a", "b"); + + var i; + for (i = 0; i < 1000; ++i) { + cx.save({ a: i, b: i + 1 }); + } + + expected = [ { a: 1, b: 2 } ]; + actual = getQueryResults("FOR x IN SKIPLIST(" + cn + ", { a: [[ '==', 1 ]], b: [[ '>=', 2 ], [ '<=', 3 ]] }) RETURN x"); + assertEqual(expected, actual); + + expected = [ { a: 1, b: 2 } ]; + actual = getQueryResults("FOR x IN SKIPLIST(" + cn + ", { a: [[ '==', 1 ]], b: [[ '==', 2 ]] }) RETURN x"); + assertEqual(expected, actual); + + assertQueryError(errors.ERROR_ARANGO_NO_INDEX.code, "RETURN SKIPLIST(" + cn + ", { b: [[ '==', 2 ]], a: [[ '==', 1 ]] })"); + + expected = [ ]; + actual = getQueryResults("FOR x IN SKIPLIST(" + cn + ", { a: [[ '==', 2 ]], b: [[ '==', 1 ]] }, 1, 1) RETURN x"); + assertEqual(expected, actual); + actual = getQueryResults("FOR x IN SKIPLIST(" + cn + ", { a: [[ '==', 99 ]], b: [[ '==', 17 ]] }, 1, 1) RETURN x"); + assertEqual(expected, actual); + + assertQueryError(errors.ERROR_ARANGO_NO_INDEX.code, "RETURN SKIPLIST(" + cn + ", { a: [[ '==', 1 ]] })"); + assertQueryError(errors.ERROR_ARANGO_NO_INDEX.code, "RETURN SKIPLIST(" + cn + ", { b: [[ '==', 1 ]] })"); + assertQueryError(errors.ERROR_ARANGO_NO_INDEX.code, "RETURN SKIPLIST(" + cn + ", { c: [[ '==', 1 ]] })"); + + internal.db._drop(cn); + }, + + //////////////////////////////////////////////////////////////////////////////// /// @brief test min function //////////////////////////////////////////////////////////////////////////////// diff --git a/js/server/tests/ahuacatl-hash.js b/js/server/tests/ahuacatl-hash.js index b54143976f..babc8b13e8 100644 --- a/js/server/tests/ahuacatl-hash.js +++ b/js/server/tests/ahuacatl-hash.js @@ -30,7 +30,6 @@ var jsunity = require("jsunity"); var helper = require("org/arangodb/aql-helper"); var getQueryResults = helper.getQueryResults; var getQueryExplanation = helper.getQueryExplanation; -var errors = internal.errors; //////////////////////////////////////////////////////////////////////////////// /// @brief test suite diff --git a/js/server/tests/ahuacatl-skiplist.js b/js/server/tests/ahuacatl-skiplist.js index 018682226c..6a10e87168 100644 --- a/js/server/tests/ahuacatl-skiplist.js +++ b/js/server/tests/ahuacatl-skiplist.js @@ -36,7 +36,6 @@ var getQueryExplanation = helper.getQueryExplanation; //////////////////////////////////////////////////////////////////////////////// function ahuacatlSkiplistTestSuite () { - var errors = internal.errors; var skiplist; return { diff --git a/js/server/tests/compaction.js b/js/server/tests/compaction.js index a171828a30..c216214914 100644 --- a/js/server/tests/compaction.js +++ b/js/server/tests/compaction.js @@ -37,8 +37,6 @@ var internal = require("internal"); //////////////////////////////////////////////////////////////////////////////// function CompactionSuite () { - var ERRORS = require("internal").errors; - return { //////////////////////////////////////////////////////////////////////////////// diff --git a/js/server/tests/replication-data.js b/js/server/tests/replication-data.js index 4e06bdef15..2a671970cf 100644 --- a/js/server/tests/replication-data.js +++ b/js/server/tests/replication-data.js @@ -81,7 +81,6 @@ function ReplicationSuite () { var masterState = replication.logger.state(); assertTrue(masterState.state.running); - var lastTick = masterState.state.lastLogTick; replication.logger.stop(); masterState = replication.logger.state(); @@ -183,7 +182,7 @@ function ReplicationSuite () { }; try { - replication.applier.properties(); + replication.applier.properties(configuration); } catch (err) { require("internal").print(err); @@ -203,7 +202,7 @@ function ReplicationSuite () { }; try { - replication.applier.properties(); + replication.applier.properties(configuration); } catch (err) { assertEqual(errors.ERROR_HTTP_UNAUTHORIZED.code, err.errorNum); @@ -222,7 +221,7 @@ function ReplicationSuite () { }; try { - replication.applier.properties(); + replication.applier.properties(configuration); } catch (err) { assertEqual(errors.ERROR_HTTP_UNAUTHORIZED.code, err.errorNum); @@ -512,7 +511,7 @@ function ReplicationSuite () { testTransaction3 : function () { compare( function (state) { - var c = db._create(cn), i; + db._create(cn); db._executeTransaction({ collections: { @@ -546,7 +545,7 @@ function ReplicationSuite () { testTransaction4 : function () { compare( function (state) { - var c = db._create(cn), i; + db._create(cn); db._executeTransaction({ collections: { @@ -592,7 +591,7 @@ function ReplicationSuite () { testTransactionBig : function () { compare( function (state) { - var c = db._create(cn), i; + db._create(cn); db._executeTransaction({ collections: { diff --git a/js/server/tests/routing.js b/js/server/tests/routing.js index 52c607f27f..77c79e83f9 100644 --- a/js/server/tests/routing.js +++ b/js/server/tests/routing.js @@ -38,7 +38,6 @@ var jsunity = require("jsunity"); //////////////////////////////////////////////////////////////////////////////// function routingSuiteSingle () { - var errors = internal.errors; var cn = "_routing"; return { diff --git a/js/server/tests/shell-any.js b/js/server/tests/shell-any.js index ed54fdfd8c..44c976fd48 100644 --- a/js/server/tests/shell-any.js +++ b/js/server/tests/shell-any.js @@ -1,5 +1,5 @@ //////////////////////////////////////////////////////////////////////////////// -/// @brief test the collection interface +/// @brief test the random document selector /// /// @file /// @@ -28,7 +28,6 @@ var jsunity = require("jsunity"); var arangodb = require("org/arangodb"); -var internal = require("internal"); var db = arangodb.db; // ----------------------------------------------------------------------------- diff --git a/js/server/tests/shell-bitarray-index.js b/js/server/tests/shell-bitarray-index.js index 9ddcd22e07..628bcbee0f 100644 --- a/js/server/tests/shell-bitarray-index.js +++ b/js/server/tests/shell-bitarray-index.js @@ -35,7 +35,6 @@ var jsunity = require("jsunity"); var internal = require("internal"); -var console = require("console"); // ----------------------------------------------------------------------------- // --SECTION-- basic methods @@ -46,7 +45,6 @@ var console = require("console"); //////////////////////////////////////////////////////////////////////////////// function BitarrayIndexSuite() { - var ERRORS = internal.errors; var cn = "UnitTestsCollectionBitarray"; var collection = null; diff --git a/js/server/tests/shell-database.js b/js/server/tests/shell-database.js index a0a0dcbddb..ad9dbe4fde 100644 --- a/js/server/tests/shell-database.js +++ b/js/server/tests/shell-database.js @@ -27,8 +27,6 @@ var jsunity = require("jsunity"); var internal = require("internal"); -var arangodb = require("org/arangodb"); -var ERRORS = arangodb.errors; // ----------------------------------------------------------------------------- // --SECTION-- database methods diff --git a/js/server/tests/shell-foxx-base-middleware.js b/js/server/tests/shell-foxx-base-middleware.js index a28ae71a3d..019c4888a6 100644 --- a/js/server/tests/shell-foxx-base-middleware.js +++ b/js/server/tests/shell-foxx-base-middleware.js @@ -1,11 +1,9 @@ require("internal").flushModuleCache(); -var jsunity = require("jsunity"), - arangodb = require("org/arangodb"), - db = arangodb.db; +var jsunity = require("jsunity"); function BaseMiddlewareSpec () { - var BaseMiddleware, request, response, options, next; + var request, response, options, next; return { setUp: function () { diff --git a/js/server/tests/shell-foxx-preprocessor.js b/js/server/tests/shell-foxx-preprocessor.js index 812c001fa2..c3a0d7dfbd 100644 --- a/js/server/tests/shell-foxx-preprocessor.js +++ b/js/server/tests/shell-foxx-preprocessor.js @@ -51,7 +51,7 @@ function PreprocessSpec () { // Low level Spec Suite for the Transform prototype function PreprocessorSpec () { - var i, result, testFileWithSingleJSDoc, testFileWithJSDocAndMultiline, processedLineOne; + var i, testFileWithSingleJSDoc, testFileWithJSDocAndMultiline, processedLineOne; return { setUp: function () { diff --git a/js/server/tests/shell-foxx.js b/js/server/tests/shell-foxx.js index f41bcd2e2b..af9972371c 100644 --- a/js/server/tests/shell-foxx.js +++ b/js/server/tests/shell-foxx.js @@ -7,7 +7,6 @@ var jsunity = require("jsunity"), stub_and_mock = require("org/arangodb/stub_and_mock"), stub = stub_and_mock.stub, allow = stub_and_mock.allow, - expect = stub_and_mock.expect, mockConstructor = stub_and_mock.mockConstructor; fakeContext = { @@ -343,9 +342,7 @@ function DocumentationAndConstraintsSpec () { }, testAddBodyParam: function () { - var determinedName, - determinedType, - paramName = stub(), + var paramName = stub(), description = stub(), ModelPrototype = stub(), jsonSchema = { id: 'a', required: [], properties: {} }; @@ -366,9 +363,7 @@ function DocumentationAndConstraintsSpec () { }, testDefineBodyParamAddsJSONSchemaToModels: function () { - var determinedName, - determinedType, - paramName = stub(), + var paramName = stub(), description = stub(), ModelPrototype = stub(), jsonSchema = { id: 'a', required: [], properties: {} }; diff --git a/js/server/tests/shell-production.js b/js/server/tests/shell-production.js index 301318fa0c..fabb9d0166 100644 --- a/js/server/tests/shell-production.js +++ b/js/server/tests/shell-production.js @@ -25,7 +25,6 @@ /// @author Copyright 2013, triAGENS GmbH, Cologne, Germany //////////////////////////////////////////////////////////////////////////////// -var console = require("console"); var internal = require("internal"); var jsunity = require("jsunity"); diff --git a/js/server/tests/shell-skiplist-correctness.js b/js/server/tests/shell-skiplist-correctness.js index 4c098155f7..1c5809523b 100644 --- a/js/server/tests/shell-skiplist-correctness.js +++ b/js/server/tests/shell-skiplist-correctness.js @@ -30,8 +30,6 @@ var jsunity = require("jsunity"); var internal = require("internal"); -var console = require("console"); -var errors = internal.errors; // ----------------------------------------------------------------------------- // --SECTION-- basic methods @@ -42,7 +40,6 @@ var errors = internal.errors; //////////////////////////////////////////////////////////////////////////////// function SkipListCorrSuite() { - var ERRORS = internal.errors; var cn = "UnitTestsCollectionSkiplistCorr"; var coll = null; var helper = require("org/arangodb/aql-helper"); diff --git a/js/server/tests/shell-skiplist-index.js b/js/server/tests/shell-skiplist-index.js index f7faf228cf..88f13741fb 100644 --- a/js/server/tests/shell-skiplist-index.js +++ b/js/server/tests/shell-skiplist-index.js @@ -30,8 +30,6 @@ var jsunity = require("jsunity"); var internal = require("internal"); -var console = require("console"); -var errors = internal.errors; // ----------------------------------------------------------------------------- // --SECTION-- basic methods @@ -42,7 +40,6 @@ var errors = internal.errors; //////////////////////////////////////////////////////////////////////////////// function SkipListSuite() { - var ERRORS = internal.errors; var cn = "UnitTestsCollectionSkiplist"; var collection = null; diff --git a/js/server/tests/shell-skiplist-rm-performance.js b/js/server/tests/shell-skiplist-rm-performance.js index bdbc83e5e6..3f55a16d64 100644 --- a/js/server/tests/shell-skiplist-rm-performance.js +++ b/js/server/tests/shell-skiplist-rm-performance.js @@ -30,8 +30,6 @@ var jsunity = require("jsunity"); var internal = require("internal"); -var console = require("console"); -var errors = internal.errors; // ----------------------------------------------------------------------------- // --SECTION-- basic methods @@ -42,7 +40,6 @@ var errors = internal.errors; //////////////////////////////////////////////////////////////////////////////// function SkipListPerfSuite() { - var ERRORS = internal.errors; var cn = "UnitTestsCollectionSkiplistPerf"; var collection = null; diff --git a/js/server/tests/transactions.js b/js/server/tests/transactions.js index cfa1ab5427..e7681919ba 100644 --- a/js/server/tests/transactions.js +++ b/js/server/tests/transactions.js @@ -151,8 +151,6 @@ function transactionInvocationSuite () { //////////////////////////////////////////////////////////////////////////////// testReturnValues : function () { - var result; - var tests = [ { expected: 1, trx: { collections: { }, action: function () { return 1; } } }, { expected: undefined, trx: { collections: { }, action: function () { } } }, @@ -2850,8 +2848,6 @@ function transactionCountSuite () { write: [ cn1 ] }, action : function () { - var d1; - c1.save({ _key: "baz" }); assertEqual(3, c1.count()); @@ -2883,8 +2879,6 @@ function transactionCountSuite () { write: [ cn1 ] }, action : function () { - var d1; - c1.save({ _key: "baz" }); assertEqual(3, c1.count()); diff --git a/lib/HttpServer/HttpCommTask.h b/lib/HttpServer/HttpCommTask.h index f619345a3f..f75f26c650 100644 --- a/lib/HttpServer/HttpCommTask.h +++ b/lib/HttpServer/HttpCommTask.h @@ -635,6 +635,9 @@ namespace triagens { // the request contained an Origin header. We have to send back the // access-control-allow-origin header now LOG_TRACE("handling CORS response"); + + response->setHeader("access-control-expose-headers", strlen("access-control-expose-headers"), "etag, content-encoding, content-length, location, server, x-arango-errors, x-arango-async-id"); + // TODO: check whether anyone actually needs these headers in the browser: x-arango-replication-checkmore, x-arango-replication-lastincluded, x-arango-replication-lasttick, x-arango-replication-active"); // send back original value of "Origin" header response->setHeader("access-control-allow-origin", strlen("access-control-allow-origin"), this->_origin); diff --git a/lib/Rest/ConnectionInfo.h b/lib/Rest/ConnectionInfo.h index 6338b657ef..12e8559d1d 100644 --- a/lib/Rest/ConnectionInfo.h +++ b/lib/Rest/ConnectionInfo.h @@ -32,6 +32,7 @@ #include "Basics/Common.h" #include "Basics/StringUtils.h" +#include "Rest/Endpoint.h" namespace triagens { namespace rest { @@ -48,6 +49,7 @@ namespace triagens { serverAddress(), clientAddress(), endpoint(), + endpointType(Endpoint::DOMAIN_UNKNOWN), sslContext(0) { } @@ -57,6 +59,7 @@ namespace triagens { serverAddress(that.serverAddress), clientAddress(that.clientAddress), endpoint(that.endpoint), + endpointType(that.endpointType), sslContext(that.sslContext) { } @@ -67,6 +70,7 @@ namespace triagens { serverAddress = that.serverAddress; clientAddress = that.clientAddress; endpoint = that.endpoint; + endpointType = that.endpointType; sslContext = that.sslContext; } @@ -81,6 +85,7 @@ namespace triagens { string serverAddress; string clientAddress; string endpoint; + Endpoint::DomainType endpointType; void* sslContext; }; diff --git a/lib/Scheduler/ListenTask.cpp b/lib/Scheduler/ListenTask.cpp index faa30969a7..0772548858 100644 --- a/lib/Scheduler/ListenTask.cpp +++ b/lib/Scheduler/ListenTask.cpp @@ -234,6 +234,7 @@ bool ListenTask::handleEvent (EventToken token, EventType revents) { info.serverAddress = _endpoint->getHost(); info.serverPort = _endpoint->getPort(); info.endpoint = _endpoint->getSpecification(); + info.endpointType = _endpoint->getDomainType(); return handleConnected(connectionSocket, info); }