diff --git a/.ctags_exclude b/.ctags_exclude new file mode 100644 index 0000000000..da2a54ade9 --- /dev/null +++ b/.ctags_exclude @@ -0,0 +1,7 @@ +Installation +out +3rdParty +Documentation +js/node/node_modules +.git +.svn diff --git a/.gitignore b/.gitignore index 173eed27cf..4e38be737d 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ build core.* build.sh +*.vim .deps .dirstamp *.o @@ -27,6 +28,8 @@ build.sh Thumbs.db testresult.json +botschaft.txt +testsStarted build*/ Build64/ diff --git a/ISSUE_TEMPLATE.md b/ISSUE_TEMPLATE.md index 5f4116e06a..d79e33d2a4 100644 --- a/ISSUE_TEMPLATE.md +++ b/ISSUE_TEMPLATE.md @@ -44,6 +44,7 @@ Please provide a way to create the dataset to run the above query on; either by I'm using the web interface with this browser: running on this OS: - [ ] authentication is enabled? - [ ] using the cluster? +- [ ] _system database? These are the steps to reproduce: 1) open the browser on http://127.0.0.1:8529 diff --git a/arangod/CMakeLists.txt b/arangod/CMakeLists.txt index 535ccaf0b4..2f59512b01 100644 --- a/arangod/CMakeLists.txt +++ b/arangod/CMakeLists.txt @@ -184,18 +184,19 @@ add_executable(${BIN_ARANGOD} FulltextIndex/fulltext-list.cpp FulltextIndex/fulltext-query.cpp FulltextIndex/fulltext-result.cpp - GeoIndex/GeoIndex.cpp GeneralServer/AsyncJobManager.cpp - GeneralServer/HttpCommTask.cpp - GeneralServer/HttpServerJob.cpp GeneralServer/GeneralCommTask.cpp - GeneralServer/HttpCommTask.cpp - GeneralServer/HttpsCommTask.cpp GeneralServer/GeneralListenTask.cpp GeneralServer/GeneralServer.cpp + GeneralServer/GeneralServerFeature.cpp + GeneralServer/HttpCommTask.cpp + GeneralServer/HttpCommTask.cpp + GeneralServer/HttpServerJob.cpp + GeneralServer/HttpsCommTask.cpp + GeneralServer/PathHandler.cpp GeneralServer/RestHandler.cpp GeneralServer/RestHandlerFactory.cpp - GeneralServer/PathHandler.cpp + GeoIndex/GeoIndex.cpp Indexes/EdgeIndex.cpp Indexes/FulltextIndex.cpp Indexes/GeoIndex2.cpp @@ -250,7 +251,6 @@ add_executable(${BIN_ARANGOD} RestServer/InitDatabaseFeature.cpp RestServer/LockfileFeature.cpp RestServer/QueryRegistryFeature.cpp - RestServer/RestServerFeature.cpp RestServer/ScriptFeature.cpp RestServer/ServerFeature.cpp RestServer/ServerIdFeature.cpp diff --git a/arangod/Cluster/AgencyComm.cpp b/arangod/Cluster/AgencyComm.cpp index 809e1183f9..649b6c52f4 100644 --- a/arangod/Cluster/AgencyComm.cpp +++ b/arangod/Cluster/AgencyComm.cpp @@ -35,30 +35,31 @@ #include "Basics/json.h" #include "Cluster/ServerState.h" #include "Endpoint/Endpoint.h" +#include "GeneralServer/GeneralServerFeature.h" #include "Logger/Logger.h" #include "Random/RandomGenerator.h" #include "Rest/HttpRequest.h" #include "Rest/HttpResponse.h" -#include "RestServer/RestServerFeature.h" #include "SimpleHttpClient/GeneralClientConnection.h" #include "SimpleHttpClient/SimpleHttpClient.h" #include "SimpleHttpClient/SimpleHttpResult.h" - using namespace arangodb; using namespace arangodb::application_features; using namespace basics::StringUtils; -static void addEmptyVPackObject(std::string const& name, VPackBuilder& builder) { +static void addEmptyVPackObject(std::string const& name, + VPackBuilder& builder) { builder.add(VPackValue(name)); VPackObjectBuilder c(&builder); } - + ////////////////////////////////////////////////////////////////////////////// /// @brief constructs an operation ////////////////////////////////////////////////////////////////////////////// -AgencyOperation::AgencyOperation(std::string const& key, AgencySimpleOperationType opType) +AgencyOperation::AgencyOperation(std::string const& key, + AgencySimpleOperationType opType) : _key(AgencyComm::prefixPath() + key), _opType() { _opType.type = AgencyOperationType::SIMPLE; _opType.simple = opType; @@ -68,13 +69,14 @@ AgencyOperation::AgencyOperation(std::string const& key, AgencySimpleOperationTy /// @brief constructs an operation ////////////////////////////////////////////////////////////////////////////// -AgencyOperation::AgencyOperation(std::string const& key, AgencyValueOperationType opType, - VPackSlice value) +AgencyOperation::AgencyOperation(std::string const& key, + AgencyValueOperationType opType, + VPackSlice value) : _key(AgencyComm::prefixPath() + key), _opType(), _value(value) { _opType.type = AgencyOperationType::VALUE; _opType.value = opType; } - + ////////////////////////////////////////////////////////////////////////////// /// @brief adds the operation formatted as an attribute in a vpack object ////////////////////////////////////////////////////////////////////////////// @@ -85,8 +87,8 @@ void AgencyOperation::toVelocyPack(VPackBuilder& builder) const { VPackObjectBuilder valueOperation(&builder); builder.add("op", VPackValue(_opType.toString())); if (_opType.type == AgencyOperationType::VALUE) { - if (_opType.value == AgencyValueOperationType::OBSERVE - || _opType.value == AgencyValueOperationType::UNOBSERVE) { + if (_opType.value == AgencyValueOperationType::OBSERVE || + _opType.value == AgencyValueOperationType::UNOBSERVE) { builder.add("url", _value); } else { builder.add("new", _value); @@ -103,8 +105,7 @@ void AgencyOperation::toVelocyPack(VPackBuilder& builder) const { ////////////////////////////////////////////////////////////////////////////// AgencyPrecondition::AgencyPrecondition(std::string const& key, Type t, bool e) - : key(AgencyComm::prefixPath() + key), type(t), empty(e) { -} + : key(AgencyComm::prefixPath() + key), type(t), empty(e) {} ////////////////////////////////////////////////////////////////////////////// /// @brief constructs a precondition @@ -112,8 +113,7 @@ AgencyPrecondition::AgencyPrecondition(std::string const& key, Type t, bool e) AgencyPrecondition::AgencyPrecondition(std::string const& key, Type t, VPackSlice s) - : key(AgencyComm::prefixPath() + key), type(t), empty(false), value(s) { -} + : key(AgencyComm::prefixPath() + key), type(t), empty(false), value(s) {} ////////////////////////////////////////////////////////////////////////////// /// @brief adds the precondition formatted as an attribute in a vpack obj @@ -124,7 +124,7 @@ void AgencyPrecondition::toVelocyPack(VPackBuilder& builder) const { builder.add(VPackValue(key)); { VPackObjectBuilder preconditionDefinition(&builder); - switch(type) { + switch (type) { case AgencyPrecondition::EMPTY: builder.add("oldEmpty", VPackValue(empty)); break; @@ -157,13 +157,13 @@ void AgencyWriteTransaction::toVelocyPack(VPackBuilder& builder) const { VPackArrayBuilder guard(&builder); { VPackObjectBuilder guard2(&builder); - for (AgencyOperation const& operation: operations) { + for (AgencyOperation const& operation : operations) { operation.toVelocyPack(builder); } } if (preconditions.size() > 0) { VPackObjectBuilder guard3(&builder); - for (AgencyPrecondition const& precondition: preconditions) { + for (AgencyPrecondition const& precondition : preconditions) { precondition.toVelocyPack(builder); } } @@ -185,7 +185,7 @@ std::string AgencyReadTransaction::toJson() const { void AgencyReadTransaction::toVelocyPack(VPackBuilder& builder) const { VPackArrayBuilder guard2(&builder); - for (std::string const& key: keys) { + for (std::string const& key : keys) { builder.add(VPackValue(key)); } } @@ -287,8 +287,8 @@ std::string AgencyCommResult::errorMessage() const { return arangodb::basics::VelocyPackHelper::getStringValue(body, "message", ""); } catch (VPackException const& e) { - std::string message("VPackException parsing body ("+ _body + "): " - + e.what()); + std::string message("VPackException parsing body (" + _body + "): " + + e.what()); return std::string(message); } } @@ -326,9 +326,7 @@ void AgencyCommResult::clear() { /// get results of query as slice //////////////////////////////////////////////////////////////////////////////// -VPackSlice AgencyCommResult::slice() { - return _vpack->slice(); -} +VPackSlice AgencyCommResult::slice() { return _vpack->slice(); } //////////////////////////////////////////////////////////////////////////////// /// @brief the static global URL prefix @@ -415,7 +413,7 @@ bool AgencyComm::tryConnect() { // mop: not sure if a timeout makes sense here while (true) { - LOG_TOPIC(DEBUG, Logger::AGENCYCOMM) + LOG_TOPIC(DEBUG, Logger::AGENCYCOMM) << "Trying to find an active agency. Checking " << endpointsStr; std::list::iterator it = _globalEndpoints.begin(); @@ -463,7 +461,7 @@ bool AgencyComm::initialize() { /// @brief will try to initialize a new agency ////////////////////////////////////////////////////////////////////////////// -bool AgencyComm::tryInitializeStructure(std::string const& jwtSecret) { +bool AgencyComm::tryInitializeStructure(std::string const& jwtSecret) { VPackBuilder builder; try { VPackObjectBuilder b(&builder); @@ -544,9 +542,7 @@ bool AgencyComm::tryInitializeStructure(std::string const& jwtSecret) { builder.add("NumberOfCoordinators", VPackSlice::nullSlice()); builder.add("NumberOfDBServers", VPackSlice::nullSlice()); builder.add(VPackValue("CleanedServers")); - { - VPackArrayBuilder dd(&builder); - } + { VPackArrayBuilder dd(&builder); } builder.add("Lock", VPackValue("UNLOCKED")); addEmptyVPackObject("MapLocalToID", builder); addEmptyVPackObject("Failed", builder); @@ -565,7 +561,8 @@ bool AgencyComm::tryInitializeStructure(std::string const& jwtSecret) { builder.add("InitDone", VPackValue(true)); builder.add("Secret", VPackValue(encodeHex(jwtSecret))); } catch (std::exception const& e) { - LOG_TOPIC(ERR, Logger::STARTUP) << "Couldn't create initializing structure " << e.what(); + LOG_TOPIC(ERR, Logger::STARTUP) << "Couldn't create initializing structure " + << e.what(); return false; } catch (...) { LOG_TOPIC(ERR, Logger::STARTUP) << "Couldn't create initializing structure"; @@ -573,16 +570,17 @@ bool AgencyComm::tryInitializeStructure(std::string const& jwtSecret) { } try { - LOG_TOPIC(TRACE, Logger::STARTUP) - << "Initializing agency with " << builder.toJson(); + LOG_TOPIC(TRACE, Logger::STARTUP) << "Initializing agency with " + << builder.toJson(); - AgencyOperation initOperation("", AgencyValueOperationType::SET, builder.slice()); + AgencyOperation initOperation("", AgencyValueOperationType::SET, + builder.slice()); AgencyWriteTransaction initTransaction; initTransaction.operations.push_back(initOperation); - + auto result = sendTransactionWithFailover(initTransaction); - + return result.successful(); } catch (std::exception const& e) { LOG(FATAL) << "Fatal error initializing agency " << e.what(); @@ -604,14 +602,14 @@ bool AgencyComm::shouldInitializeStructure() { double timeout = _globalConnectionOptions._requestTimeout; // "InitDone" key should not previously exist auto result = casValue("InitDone", builder.slice(), false, 60.0, timeout); - + if (!result.successful()) { // somebody else has or is initializing the agency - LOG_TOPIC(TRACE, Logger::STARTUP) + LOG_TOPIC(TRACE, Logger::STARTUP) << "someone else is initializing the agency"; return false; } - + return true; } @@ -621,48 +619,49 @@ bool AgencyComm::shouldInitializeStructure() { bool AgencyComm::ensureStructureInitialized() { LOG_TOPIC(TRACE, Logger::STARTUP) << "Checking if agency is initialized"; - - RestServerFeature* restServer = - application_features::ApplicationServer::getFeature("RestServer"); + + GeneralServerFeature* restServer = + application_features::ApplicationServer::getFeature( + "GeneralServer"); while (true) { while (shouldInitializeStructure()) { - LOG_TOPIC(TRACE, Logger::STARTUP) + LOG_TOPIC(TRACE, Logger::STARTUP) << "Agency is fresh. Needs initial structure."; // mop: we initialized it .. great success if (tryInitializeStructure(restServer->jwtSecret())) { LOG_TOPIC(TRACE, Logger::STARTUP) << "Successfully initialized agency"; break; - } + } - LOG_TOPIC(WARN, Logger::STARTUP) + LOG_TOPIC(WARN, Logger::STARTUP) << "Initializing agency failed. We'll try again soon"; // We should really have exclusive access, here, this is strange! sleep(1); } - + AgencyCommResult result = getValues("InitDone"); - + if (result.successful()) { - VPackSlice value = result.slice()[0].get(std::vector( - {prefix(), "InitDone"})); + VPackSlice value = result.slice()[0].get( + std::vector({prefix(), "InitDone"})); if (value.isBoolean() && value.getBoolean()) { // expecting a value of "true" LOG_TOPIC(TRACE, Logger::STARTUP) << "Found an initialized agency"; break; } } - - LOG_TOPIC(TRACE, Logger::STARTUP) + + LOG_TOPIC(TRACE, Logger::STARTUP) << "Waiting for agency to get initialized"; sleep(1); - } // next attempt - + } // next attempt + AgencyCommResult secretResult = getValues("Secret"); - VPackSlice secretValue = secretResult.slice()[0].get(std::vector( - {prefix(), "Secret"})); - + VPackSlice secretValue = secretResult.slice()[0].get( + std::vector({prefix(), "Secret"})); + if (!secretValue.isString()) { LOG(ERR) << "Couldn't find secret in agency!"; return false; @@ -701,8 +700,8 @@ void AgencyComm::disconnect() { bool AgencyComm::addEndpoint(std::string const& endpointSpecification, bool toFront) { - LOG_TOPIC(TRACE, Logger::AGENCYCOMM) - << "adding global agency-endpoint '" << endpointSpecification << "'"; + LOG_TOPIC(TRACE, Logger::AGENCYCOMM) << "adding global agency-endpoint '" + << endpointSpecification << "'"; { WRITE_LOCKER(writeLocker, AgencyComm::_globalLock); @@ -757,7 +756,7 @@ bool AgencyComm::hasEndpoint(std::string const& endpointSpecification) { while (it != _globalEndpoints.end()) { AgencyEndpoint const* agencyEndpoint = (*it); - + if (agencyEndpoint->_endpoint->specification() == endpointSpecification) { return true; } @@ -871,7 +870,6 @@ std::string AgencyComm::getEndpointsString() { //////////////////////////////////////////////////////////////////////////////// bool AgencyComm::setPrefix(std::string const&) { - // agency prefix must not be changed _globalPrefix = "/arango/"; _globalPrefixStripped = "arango"; @@ -963,10 +961,9 @@ AgencyCommResult AgencyComm::sendServerState(double ttl) { //////////////////////////////////////////////////////////////////////////////// std::string AgencyComm::getVersion() { - AgencyCommResult result - = sendWithFailover(arangodb::GeneralRequest::RequestType::GET, - _globalConnectionOptions._requestTimeout, "version", - "", false); + AgencyCommResult result = sendWithFailover( + arangodb::GeneralRequest::RequestType::GET, + _globalConnectionOptions._requestTimeout, "version", "", false); if (result.successful()) { return result._body; @@ -981,11 +978,10 @@ std::string AgencyComm::getVersion() { AgencyCommResult AgencyComm::createDirectory(std::string const& key) { VPackBuilder builder; - { - VPackObjectBuilder dir(&builder); - } - - AgencyOperation operation(key, AgencyValueOperationType::SET, builder.slice()); + { VPackObjectBuilder dir(&builder); } + + AgencyOperation operation(key, AgencyValueOperationType::SET, + builder.slice()); AgencyWriteTransaction transaction(operation); return sendTransactionWithFailover(transaction); @@ -996,12 +992,12 @@ AgencyCommResult AgencyComm::createDirectory(std::string const& key) { //////////////////////////////////////////////////////////////////////////////// AgencyCommResult AgencyComm::setValue(std::string const& key, - std::string const& value, - double ttl) { + std::string const& value, double ttl) { VPackBuilder builder; builder.add(VPackValue(value)); - - AgencyOperation operation(key, AgencyValueOperationType::SET, builder.slice()); + + AgencyOperation operation(key, AgencyValueOperationType::SET, + builder.slice()); operation._ttl = static_cast(ttl); AgencyWriteTransaction transaction(operation); @@ -1015,7 +1011,6 @@ AgencyCommResult AgencyComm::setValue(std::string const& key, AgencyCommResult AgencyComm::setValue(std::string const& key, arangodb::velocypack::Slice const& slice, double ttl) { - AgencyOperation operation(key, AgencyValueOperationType::SET, slice); operation._ttl = static_cast(ttl); AgencyWriteTransaction transaction(operation); @@ -1046,10 +1041,8 @@ bool AgencyComm::exists(std::string const& key) { //////////////////////////////////////////////////////////////////////////////// AgencyCommResult AgencyComm::increment(std::string const& key) { - AgencyWriteTransaction transaction( - AgencyOperation(key, AgencySimpleOperationType::INCREMENT_OP) - ); + AgencyOperation(key, AgencySimpleOperationType::INCREMENT_OP)); return sendTransactionWithFailover(transaction); } @@ -1060,7 +1053,7 @@ AgencyCommResult AgencyComm::increment(std::string const& key) { AgencyCommResult AgencyComm::getValues(std::string const& key) { std::string url(buildUrl()); - + url += "/read"; VPackBuilder builder; { @@ -1071,17 +1064,15 @@ AgencyCommResult AgencyComm::getValues(std::string const& key) { } } - AgencyCommResult result - = sendWithFailover(arangodb::GeneralRequest::RequestType::POST, - _globalConnectionOptions._requestTimeout, url, - builder.toJson(), false); + AgencyCommResult result = sendWithFailover( + arangodb::GeneralRequest::RequestType::POST, + _globalConnectionOptions._requestTimeout, url, builder.toJson(), false); if (!result.successful()) { return result; } - - try { + try { result.setVPack(VPackParser::fromJson(result.body().c_str())); if (!result.slice().isArray()) { @@ -1093,16 +1084,16 @@ AgencyCommResult AgencyComm::getValues(std::string const& key) { result._statusCode = 500; return result; } - + result._body.clear(); result._statusCode = 200; - - } catch(std::exception &e) { - LOG_TOPIC(ERR, Logger::AGENCYCOMM) - << "Error transforming result. " << e.what(); + + } catch (std::exception& e) { + LOG_TOPIC(ERR, Logger::AGENCYCOMM) << "Error transforming result. " + << e.what(); result.clear(); - } catch(...) { - LOG_TOPIC(ERR, Logger::AGENCYCOMM) + } catch (...) { + LOG_TOPIC(ERR, Logger::AGENCYCOMM) << "Error transforming result. Out of memory"; result.clear(); } @@ -1118,8 +1109,7 @@ AgencyCommResult AgencyComm::removeValues(std::string const& key, bool recursive) { AgencyWriteTransaction transaction( AgencyOperation(key, AgencySimpleOperationType::DELETE_OP), - AgencyPrecondition(key, AgencyPrecondition::EMPTY, false) - ); + AgencyPrecondition(key, AgencyPrecondition::EMPTY, false)); return sendTransactionWithFailover(transaction); } @@ -1133,16 +1123,16 @@ AgencyCommResult AgencyComm::casValue(std::string const& key, arangodb::velocypack::Slice const& json, bool prevExist, double ttl, double timeout) { - VPackBuilder newBuilder; newBuilder.add(json); - AgencyOperation operation(key, AgencyValueOperationType::SET, newBuilder.slice()); + AgencyOperation operation(key, AgencyValueOperationType::SET, + newBuilder.slice()); AgencyPrecondition precondition(key, AgencyPrecondition::EMPTY, !prevExist); if (ttl >= 0.0) { operation._ttl = static_cast(ttl); } - + VPackBuilder preBuilder; precondition.toVelocyPack(preBuilder); @@ -1162,17 +1152,18 @@ AgencyCommResult AgencyComm::casValue(std::string const& key, double timeout) { VPackBuilder newBuilder; newBuilder.add(newJson); - + VPackBuilder oldBuilder; oldBuilder.add(oldJson); - - AgencyOperation operation(key, AgencyValueOperationType::SET, newBuilder.slice()); + + AgencyOperation operation(key, AgencyValueOperationType::SET, + newBuilder.slice()); AgencyPrecondition precondition(key, AgencyPrecondition::VALUE, oldBuilder.slice()); if (ttl >= 0.0) { operation._ttl = static_cast(ttl); } - + AgencyWriteTransaction transaction(operation, precondition); return sendTransactionWithFailover(transaction, timeout); } @@ -1181,13 +1172,15 @@ AgencyCommResult AgencyComm::casValue(std::string const& key, /// @brief registers a callback on a key //////////////////////////////////////////////////////////////////////////////// -bool AgencyComm::registerCallback(std::string const& key, std::string const& endpoint) { +bool AgencyComm::registerCallback(std::string const& key, + std::string const& endpoint) { VPackBuilder builder; builder.add(VPackValue(endpoint)); - - AgencyOperation operation(key, AgencyValueOperationType::OBSERVE, builder.slice()); + + AgencyOperation operation(key, AgencyValueOperationType::OBSERVE, + builder.slice()); AgencyWriteTransaction transaction(operation); - + auto result = sendTransactionWithFailover(transaction); return result.successful(); } @@ -1200,10 +1193,11 @@ bool AgencyComm::unregisterCallback(std::string const& key, std::string const& endpoint) { VPackBuilder builder; builder.add(VPackValue(endpoint)); - - AgencyOperation operation(key, AgencyValueOperationType::UNOBSERVE, builder.slice()); + + AgencyOperation operation(key, AgencyValueOperationType::UNOBSERVE, + builder.slice()); AgencyWriteTransaction transaction(operation); - + auto result = sendTransactionWithFailover(transaction); return result.successful(); } @@ -1285,11 +1279,11 @@ uint64_t AgencyComm::uniqid(uint64_t count, double timeout) { continue; } - VPackSlice oldSlice = result.slice()[0].get(std::vector( - {prefix(), "Sync", "LatestID"})); + VPackSlice oldSlice = result.slice()[0].get( + std::vector({prefix(), "Sync", "LatestID"})); if (!(oldSlice.isSmallInt() || oldSlice.isUInt())) { - LOG_TOPIC(WARN, Logger::AGENCYCOMM) + LOG_TOPIC(WARN, Logger::AGENCYCOMM) << "Sync/LatestID in agency is not an unsigned integer, fixing..."; try { VPackBuilder builder; @@ -1309,8 +1303,7 @@ uint64_t AgencyComm::uniqid(uint64_t count, double timeout) { oldValue = 0; try { oldValue = oldSlice.getUInt(); - } - catch (...) { + } catch (...) { } uint64_t const newValue = oldValue + count; @@ -1322,8 +1315,8 @@ uint64_t AgencyComm::uniqid(uint64_t count, double timeout) { continue; } - result = casValue("Sync/LatestID", oldSlice, newBuilder.slice(), - 0.0, timeout); + result = + casValue("Sync/LatestID", oldSlice, newBuilder.slice(), 0.0, timeout); if (result.successful()) { break; @@ -1527,14 +1520,13 @@ void AgencyComm::requeueEndpoint(AgencyEndpoint* agencyEndpoint, std::string AgencyComm::buildUrl() const { return AgencyComm::AGENCY_URL_PREFIX; } - + ////////////////////////////////////////////////////////////////////////////// /// @brief sends a write HTTP request to the agency, handling failover ////////////////////////////////////////////////////////////////////////////// AgencyCommResult AgencyComm::sendTransactionWithFailover( AgencyTransaction const& transaction, double timeout) { - std::string url(buildUrl()); url += transaction.isWriteTransaction() ? "/write" : "/read"; @@ -1553,12 +1545,12 @@ AgencyCommResult AgencyComm::sendTransactionWithFailover( if (!result.successful()) { return result; } - + try { result.setVPack(VPackParser::fromJson(result.body().c_str())); if (transaction.isWriteTransaction()) { - if (!result.slice().isObject() || + if (!result.slice().isObject() || !result.slice().get("results").isArray()) { result._statusCode = 500; return result; @@ -1579,19 +1571,19 @@ AgencyCommResult AgencyComm::sendTransactionWithFailover( return result; } } - + result._body.clear(); - - } catch(std::exception &e) { - LOG_TOPIC(ERR, Logger::AGENCYCOMM) - << "Error transforming result. " << e.what(); + + } catch (std::exception& e) { + LOG_TOPIC(ERR, Logger::AGENCYCOMM) << "Error transforming result. " + << e.what(); result.clear(); - } catch(...) { - LOG_TOPIC(ERR, Logger::AGENCYCOMM) + } catch (...) { + LOG_TOPIC(ERR, Logger::AGENCYCOMM) << "Error transforming result. Out of memory"; result.clear(); } - + return result; } @@ -1600,11 +1592,8 @@ AgencyCommResult AgencyComm::sendTransactionWithFailover( //////////////////////////////////////////////////////////////////////////////// AgencyCommResult AgencyComm::sendWithFailover( - arangodb::GeneralRequest::RequestType method, - double const timeout, - std::string const& url, - std::string const& body, bool isWatch) { - + arangodb::GeneralRequest::RequestType method, double const timeout, + std::string const& url, std::string const& body, bool isWatch) { size_t numEndpoints; { @@ -1633,7 +1622,8 @@ AgencyCommResult AgencyComm::sendWithFailover( TRI_ASSERT(agencyEndpoint != nullptr); try { - result = send(agencyEndpoint->_connection, method, timeout, realUrl, body); + result = + send(agencyEndpoint->_connection, method, timeout, realUrl, body); } catch (...) { result._connected = false; result._statusCode = 0; @@ -1645,8 +1635,8 @@ AgencyCommResult AgencyComm::sendWithFailover( break; } -// LOG(WARN) << result._statusCode; - + // LOG(WARN) << result._statusCode; + if (result._statusCode == (int)arangodb::GeneralResponse::ResponseCode::TEMPORARY_REDIRECT) { // sometimes the agency will return a 307 (temporary redirect) @@ -1686,8 +1676,8 @@ AgencyCommResult AgencyComm::sendWithFailover( if (!AgencyComm::hasEndpoint(endpoint)) { AgencyComm::addEndpoint(endpoint, true); - LOG_TOPIC(DEBUG, Logger::AGENCYCOMM) - << "adding agency-endpoint '" << endpoint << "'"; + LOG_TOPIC(DEBUG, Logger::AGENCYCOMM) << "adding agency-endpoint '" + << endpoint << "'"; // re-check the new endpoint if (AgencyComm::hasEndpoint(endpoint)) { @@ -1695,7 +1685,7 @@ AgencyCommResult AgencyComm::sendWithFailover( continue; } - LOG_TOPIC(ERR, Logger::AGENCYCOMM) + LOG_TOPIC(ERR, Logger::AGENCYCOMM) << "found redirection to unknown endpoint '" << endpoint << "'. Will not follow!"; @@ -1736,9 +1726,9 @@ AgencyCommResult AgencyComm::sendWithFailover( //////////////////////////////////////////////////////////////////////////////// AgencyCommResult AgencyComm::send( - arangodb::httpclient::GeneralClientConnection* connection, - arangodb::GeneralRequest::RequestType method, - double timeout, std::string const& url, std::string const& body) { + arangodb::httpclient::GeneralClientConnection* connection, + arangodb::GeneralRequest::RequestType method, double timeout, + std::string const& url, std::string const& body) { TRI_ASSERT(connection != nullptr); if (method == arangodb::GeneralRequest::RequestType::GET || @@ -1753,7 +1743,7 @@ AgencyCommResult AgencyComm::send( result._connected = false; result._statusCode = 0; - LOG_TOPIC(TRACE, Logger::AGENCYCOMM) + LOG_TOPIC(TRACE, Logger::AGENCYCOMM) << "sending " << arangodb::HttpRequest::translateMethod(method) << " request to agency at endpoint '" << connection->getEndpoint()->specification() << "', url '" << url @@ -1791,7 +1781,7 @@ AgencyCommResult AgencyComm::send( } result._connected = true; - + if (response->getHttpReturnCode() == (int)arangodb::GeneralResponse::ResponseCode::TEMPORARY_REDIRECT) { // temporary redirect. now save location header @@ -1799,8 +1789,8 @@ AgencyCommResult AgencyComm::send( bool found = false; result._location = response->getHeaderField(StaticStrings::Location, found); - LOG_TOPIC(TRACE, Logger::AGENCYCOMM) - << "redirecting to location: '" << result._location << "'"; + LOG_TOPIC(TRACE, Logger::AGENCYCOMM) << "redirecting to location: '" + << result._location << "'"; if (!found) { // a 307 without a location header does not make any sense @@ -1816,10 +1806,10 @@ AgencyCommResult AgencyComm::send( result._body = std::string(sb.c_str(), sb.length()); result._statusCode = response->getHttpReturnCode(); - LOG_TOPIC(TRACE, Logger::AGENCYCOMM) + LOG_TOPIC(TRACE, Logger::AGENCYCOMM) << "request to agency returned status code " << result._statusCode - << ", message: '" << result._message << "', body: '" - << result._body << "'"; + << ", message: '" << result._message << "', body: '" << result._body + << "'"; if (result.successful()) { return result; diff --git a/arangod/Cluster/HeartbeatThread.cpp b/arangod/Cluster/HeartbeatThread.cpp index 78e81bdbba..cbd6695695 100644 --- a/arangod/Cluster/HeartbeatThread.cpp +++ b/arangod/Cluster/HeartbeatThread.cpp @@ -39,9 +39,9 @@ #include "Dispatcher/Dispatcher.h" #include "Dispatcher/DispatcherFeature.h" #include "Dispatcher/Job.h" +#include "GeneralServer/GeneralServerFeature.h" #include "GeneralServer/RestHandlerFactory.h" #include "Logger/Logger.h" -#include "RestServer/RestServerFeature.h" #include "V8/v8-globals.h" #include "VocBase/AuthInfo.h" #include "VocBase/server.h" @@ -375,7 +375,7 @@ void HeartbeatThread::runCoordinator() { if (userVersion > 0 && userVersion != oldUserVersion) { oldUserVersion = userVersion; - RestServerFeature::AUTH_INFO.outdate(); + GeneralServerFeature::AUTH_INFO.outdate(); } } diff --git a/arangod/GeneralServer/GeneralCommTask.cpp b/arangod/GeneralServer/GeneralCommTask.cpp index 0bd2afdd27..16932ec9c3 100644 --- a/arangod/GeneralServer/GeneralCommTask.cpp +++ b/arangod/GeneralServer/GeneralCommTask.cpp @@ -29,10 +29,10 @@ #include "Basics/StaticStrings.h" #include "Basics/StringBuffer.h" #include "GeneralServer/GeneralServer.h" +#include "GeneralServer/GeneralServerFeature.h" #include "GeneralServer/RestHandler.h" #include "GeneralServer/RestHandlerFactory.h" #include "Logger/Logger.h" -#include "RestServer/RestServerFeature.h" #include "Scheduler/Scheduler.h" #include "Scheduler/SchedulerFeature.h" #include "VocBase/server.h" @@ -45,78 +45,41 @@ using namespace arangodb::rest; /// @brief static initializers //////////////////////////////////////////////////////////////////////////////// -size_t const GeneralCommTask::MaximalHeaderSize = 1 * 1024 * 1024; // 1 MB -size_t const GeneralCommTask::MaximalBodySize = 512 * 1024 * 1024; // 512 MB -size_t const GeneralCommTask::MaximalPipelineSize = - 512 * 1024 * 1024; // 512 MB -size_t const GeneralCommTask::RunCompactEvery = 500; - -//////////////////////////////////////////////////////////////////////////////// -/// @brief constructs a new task -//////////////////////////////////////////////////////////////////////////////// - GeneralCommTask::GeneralCommTask(GeneralServer* server, TRI_socket_t socket, ConnectionInfo&& info, double keepAliveTimeout) : Task("GeneralCommTask"), SocketTask(socket, keepAliveTimeout), - _connectionInfo(std::move(info)), _server(server), - _allowMethodOverride(server->allowMethodOverride()), + _request(nullptr), + _connectionInfo(std::move(info)), _protocol("unknown"), + _protocolVersion(GeneralRequest::ProtocolVersion::UNKNOWN), + _startThread(false), _writeBuffers(), _writeBuffersStats(), - _readPosition(0), - _bodyPosition(0), - _bodyLength(0), - _requestPending(false), - _closeRequested(false), - _readRequestBody(false), - _denyCredentials(true), - _acceptDeflate(false), - _newRequest(true), _isChunked(false), - _startThread(false), - _request(nullptr), - _httpVersion(GeneralRequest::ProtocolVersion::UNKNOWN), - _requestType(GeneralRequest::RequestType::ILLEGAL), - _fullUrl(), - _origin(), - _startPosition(0), - _sinceCompactification(0), - _originalBodyLength(0), - _setupDone(false) { + _requestPending(false) { LOG(TRACE) << "connection established, client " << TRI_get_fd_or_handle_of_socket(socket) << ", server ip " << _connectionInfo.serverAddress << ", server port " << _connectionInfo.serverPort << ", client ip " << _connectionInfo.clientAddress << ", client port " << _connectionInfo.clientPort; - - connectionStatisticsAgentSetHttp(); } -//////////////////////////////////////////////////////////////////////////////// -/// @brief destructs a task -//////////////////////////////////////////////////////////////////////////////// - GeneralCommTask::~GeneralCommTask() { LOG(TRACE) << "connection closed, client " << TRI_get_fd_or_handle_of_socket(_commSocket); // free write buffers and statistics - for (auto& i : _writeBuffers) { - delete i; - } - - for (auto& i : _writeBuffersStats) { - TRI_ReleaseRequestStatistics(i); - } + for (auto& i : _writeBuffers) delete i; + for (auto& i : _writeBuffersStats) TRI_ReleaseRequestStatistics(i); // free request delete _request; } -void GeneralCommTask::handleResponse(HttpResponse* response) { +void GeneralCommTask::handleResponse(GeneralResponse* response) { _requestPending = false; _isChunked = false; _startThread = false; @@ -130,7 +93,6 @@ void GeneralCommTask::handleResponse(HttpResponse* response) { void GeneralCommTask::handleSimpleError(GeneralResponse::ResponseCode code) { HttpResponse response(code); - resetState(true); addResponse(&response); } @@ -151,7 +113,6 @@ void GeneralCommTask::handleSimpleError( try { response.setPayload(_request, builder.slice(), true, VPackOptions::Defaults); - clearRequest(); handleResponse(&response); } catch (...) { @@ -160,973 +121,10 @@ void GeneralCommTask::handleSimpleError( } } -GeneralResponse::ResponseCode GeneralCommTask::authenticateRequest() { - auto context = (_request == nullptr) ? nullptr : _request->requestContext(); - - if (context == nullptr && _request != nullptr) { - bool res = RestServerFeature::HANDLER_FACTORY->setRequestContext(_request); - - if (!res) { - return GeneralResponse::ResponseCode::NOT_FOUND; - } - - context = _request->requestContext(); - } - - if (context == nullptr) { - return GeneralResponse::ResponseCode::SERVER_ERROR; - } - - return context->authenticate(); -} - -//////////////////////////////////////////////////////////////////////////////// -/// @brief reads data from the socket -//////////////////////////////////////////////////////////////////////////////// - -bool GeneralCommTask::processRead() { - if (_requestPending || _readBuffer->c_str() == nullptr) { - return false; - } - - bool handleRequest = false; - - // still trying to read the header fields - if (!_readRequestBody) { - char const* ptr = _readBuffer->c_str() + _readPosition; - char const* etr = _readBuffer->end(); - - if (ptr == etr) { - return false; - } - - // starting a new request - if (_newRequest) { - // acquire a new statistics entry for the request - RequestStatisticsAgent::acquire(); - -#if USE_DEV_TIMERS - if (RequestStatisticsAgent::_statistics != nullptr) { - RequestStatisticsAgent::_statistics->_id = (void*)this; - } -#endif - - _newRequest = false; - _startPosition = _readPosition; - _httpVersion = GeneralRequest::ProtocolVersion::UNKNOWN; - _requestType = GeneralRequest::RequestType::ILLEGAL; - _fullUrl = ""; - _denyCredentials = true; - _acceptDeflate = false; - - _sinceCompactification++; - } - - char const* end = etr - 3; - - // read buffer contents are way to small. we can exit here directly - if (ptr >= end) { - return false; - } - - // request started - requestStatisticsAgentSetReadStart(); - - // check for the end of the request - for (; ptr < end; ptr++) { - if (ptr[0] == '\r' && ptr[1] == '\n' && ptr[2] == '\r' && - ptr[3] == '\n') { - break; - } - } - - // check if header is too large - size_t headerLength = ptr - (_readBuffer->c_str() + _startPosition); - - if (headerLength > MaximalHeaderSize) { - LOG(WARN) << "maximal header size is " << MaximalHeaderSize - << ", request header size is " << headerLength; - - // header is too large - handleSimpleError( - GeneralResponse::ResponseCode::REQUEST_HEADER_FIELDS_TOO_LARGE); - return false; - } - - // header is complete - if (ptr < end) { - _readPosition = ptr - _readBuffer->c_str() + 4; - - LOG(TRACE) << "HTTP READ FOR " << (void*)this << ": " - << std::string(_readBuffer->c_str() + _startPosition, - _readPosition - _startPosition); - - // check that we know, how to serve this request and update the connection - // information, i. e. client and server addresses and ports and create a - // request context for that request - _request = new HttpRequest( - _connectionInfo, _readBuffer->c_str() + _startPosition, - _readPosition - _startPosition, _allowMethodOverride); - - if (_request == nullptr) { - LOG(ERR) << "cannot generate request"; - - // internal server error - handleSimpleError(GeneralResponse::ResponseCode::SERVER_ERROR); - return false; - } - - RestServerFeature::HANDLER_FACTORY->setRequestContext(_request); - _request->setClientTaskId(_taskId); - - // check HTTP protocol version - _httpVersion = _request->protocolVersion(); - - if (_httpVersion != GeneralRequest::ProtocolVersion::HTTP_1_0 && - _httpVersion != GeneralRequest::ProtocolVersion::HTTP_1_1) { - handleSimpleError( - GeneralResponse::ResponseCode::HTTP_VERSION_NOT_SUPPORTED); - return false; - } - - // check max URL length - _fullUrl = _request->fullUrl(); - - if (_fullUrl.size() > 16384) { - handleSimpleError(GeneralResponse::ResponseCode::REQUEST_URI_TOO_LONG); - return false; - } - - // update the connection information, i. e. client and server addresses - // and ports - _request->setProtocol(_protocol); - - LOG(TRACE) << "server port " << _connectionInfo.serverPort - << ", client port " << _connectionInfo.clientPort; - - // set body start to current position - _bodyPosition = _readPosition; - _bodyLength = 0; - - // keep track of the original value of the "origin" request header (if - // any), we need this value to handle CORS requests - _origin = _request->header(StaticStrings::Origin); - - if (!_origin.empty()) { - // check for Access-Control-Allow-Credentials header - bool found; - std::string const& allowCredentials = _request->header( - StaticStrings::AccessControlAllowCredentials, found); - - if (found) { - // default is to allow nothing - _denyCredentials = true; - - // if the request asks to allow credentials, we'll check against the - // configured whitelist of origins - std::vector const& accessControlAllowOrigins = - _server->trustedOrigins(); - - if (StringUtils::boolean(allowCredentials) && - !accessControlAllowOrigins.empty()) { - if (accessControlAllowOrigins[0] == "*") { - // special case: allow everything - _denyCredentials = false; - } else if (!_origin.empty()) { - // copy origin string - if (_origin[_origin.size() - 1] == '/') { - // strip trailing slash - auto result = std::find(accessControlAllowOrigins.begin(), - accessControlAllowOrigins.end(), - _origin.substr(0, _origin.size() - 1)); - _denyCredentials = (result == accessControlAllowOrigins.end()); - } else { - auto result = - std::find(accessControlAllowOrigins.begin(), - accessControlAllowOrigins.end(), _origin); - _denyCredentials = (result == accessControlAllowOrigins.end()); - } - } else { - TRI_ASSERT(_denyCredentials); - } - } - } - } - - // store the original request's type. we need it later when responding - // (original request object gets deleted before responding) - _requestType = _request->requestType(); - - requestStatisticsAgentSetRequestType(_requestType); - - // handle different HTTP methods - switch (_requestType) { - case GeneralRequest::RequestType::GET: - case GeneralRequest::RequestType::DELETE_REQ: - case GeneralRequest::RequestType::HEAD: - case GeneralRequest::RequestType::OPTIONS: - case GeneralRequest::RequestType::POST: - case GeneralRequest::RequestType::PUT: - case GeneralRequest::RequestType::PATCH: { - // technically, sending a body for an HTTP DELETE request is not - // forbidden, but it is not explicitly supported - bool const expectContentLength = - (_requestType == GeneralRequest::RequestType::POST || - _requestType == GeneralRequest::RequestType::PUT || - _requestType == GeneralRequest::RequestType::PATCH || - _requestType == GeneralRequest::RequestType::OPTIONS || - _requestType == GeneralRequest::RequestType::DELETE_REQ); - - if (!checkContentLength(expectContentLength)) { - return false; - } - - if (_bodyLength == 0) { - handleRequest = true; - } - - break; - } - - default: { - size_t l = _readPosition - _startPosition; - - if (6 < l) { - l = 6; - } - - LOG(WARN) << "got corrupted HTTP request '" - << std::string(_readBuffer->c_str() + _startPosition, l) - << "'"; - - // force a socket close, response will be ignored! - TRI_CLOSE_SOCKET(_commSocket); - TRI_invalidatesocket(&_commSocket); - - // bad request, method not allowed - handleSimpleError(GeneralResponse::ResponseCode::METHOD_NOT_ALLOWED); - return false; - } - } - - // ............................................................................. - // check if server is active - // ............................................................................. - - Scheduler const* scheduler = SchedulerFeature::SCHEDULER; - - if (scheduler != nullptr && !scheduler->isActive()) { - // server is inactive and will intentionally respond with HTTP 503 - LOG(TRACE) << "cannot serve request - server is inactive"; - - handleSimpleError(GeneralResponse::ResponseCode::SERVICE_UNAVAILABLE); - return false; - } - - // check for a 100-continue - if (_readRequestBody) { - bool found; - std::string const& expect = - _request->header(StaticStrings::Expect, found); - - if (found && StringUtils::trim(expect) == "100-continue") { - LOG(TRACE) << "received a 100-continue request"; - - auto buffer = std::make_unique(TRI_UNKNOWN_MEM_ZONE); - buffer->appendText( - TRI_CHAR_LENGTH_PAIR("HTTP/1.1 100 (Continue)\r\n\r\n")); - buffer->ensureNullTerminated(); - - _writeBuffers.push_back(buffer.get()); - buffer.release(); - - _writeBuffersStats.push_back(nullptr); - - fillWriteBuffer(); - } - } - } else { - size_t l = (_readBuffer->end() - _readBuffer->c_str()); - - if (_startPosition + 4 <= l) { - _readPosition = l - 4; - } - } - } - - // readRequestBody might have changed, so cannot use else - if (_readRequestBody) { - if (_readBuffer->length() - _bodyPosition < _bodyLength) { - setKeepAliveTimeout(_keepAliveTimeout); - - // let client send more - return false; - } - - // read "bodyLength" from read buffer and add this body to "httpRequest" - _request->setBody(_readBuffer->c_str() + _bodyPosition, _bodyLength); - - LOG(TRACE) << "" << std::string(_readBuffer->c_str() + _bodyPosition, - _bodyLength); - - // remove body from read buffer and reset read position - _readRequestBody = false; - handleRequest = true; - } - - // ............................................................................. - // request complete - // - // we have to delete request in here or pass it to a handler, which will - // delete - // it - // ............................................................................. - - if (!handleRequest) { - return false; - } - - requestStatisticsAgentSetReadEnd(); - requestStatisticsAgentAddReceivedBytes(_bodyPosition - _startPosition + - _bodyLength); - - bool const isOptionsRequest = - (_requestType == GeneralRequest::RequestType::OPTIONS); - resetState(false); - - // ............................................................................. - // keep-alive handling - // ............................................................................. - - std::string connectionType = - StringUtils::tolower(_request->header(StaticStrings::Connection)); - - if (connectionType == "close") { - // client has sent an explicit "Connection: Close" header. we should close - // the connection - LOG(DEBUG) << "connection close requested by client"; - _closeRequested = true; - } else if (_request->isHttp10() && connectionType != "keep-alive") { - // HTTP 1.0 request, and no "Connection: Keep-Alive" header sent - // we should close the connection - LOG(DEBUG) << "no keep-alive, connection close requested by client"; - _closeRequested = true; - } else if (_keepAliveTimeout <= 0.0) { - // if keepAliveTimeout was set to 0.0, we'll close even keep-alive - // connections immediately - LOG(DEBUG) << "keep-alive disabled by admin"; - _closeRequested = true; - } - - // we keep the connection open in all other cases (HTTP 1.1 or Keep-Alive - // header sent) - - // ............................................................................. - // authenticate - // ............................................................................. - - GeneralResponse::ResponseCode authResult = authenticateRequest(); - - // authenticated or an OPTIONS request. OPTIONS requests currently go - // unauthenticated - if (authResult == GeneralResponse::ResponseCode::OK || isOptionsRequest) { - // handle HTTP OPTIONS requests directly - if (isOptionsRequest) { - processCorsOptions(); - } else { - processRequest(); - } - } - - // not found - else if (authResult == GeneralResponse::ResponseCode::NOT_FOUND) { - handleSimpleError(authResult, TRI_ERROR_ARANGO_DATABASE_NOT_FOUND, - TRI_errno_string(TRI_ERROR_ARANGO_DATABASE_NOT_FOUND)); - } - - // forbidden - else if (authResult == GeneralResponse::ResponseCode::FORBIDDEN) { - handleSimpleError(authResult, TRI_ERROR_USER_CHANGE_PASSWORD, - "change password"); - } - - // not authenticated - else { - HttpResponse response(GeneralResponse::ResponseCode::UNAUTHORIZED); - std::string realm = "Bearer token_type=\"JWT\", realm=\"ArangoDB\""; - - response.setHeaderNC(StaticStrings::WwwAuthenticate, std::move(realm)); - - clearRequest(); - handleResponse(&response); - } - - return true; -} - -//////////////////////////////////////////////////////////////////////////////// -/// @brief sends more chunked data -//////////////////////////////////////////////////////////////////////////////// - -void GeneralCommTask::sendChunk(StringBuffer* buffer) { - if (_isChunked) { - TRI_ASSERT(buffer != nullptr); - - _writeBuffers.push_back(buffer); - _writeBuffersStats.push_back(nullptr); - - fillWriteBuffer(); - } else { - delete buffer; - } -} - -//////////////////////////////////////////////////////////////////////////////// -/// @brief chunking is finished -//////////////////////////////////////////////////////////////////////////////// - -void GeneralCommTask::finishedChunked() { - auto buffer = std::make_unique(TRI_UNKNOWN_MEM_ZONE, 6, true); - buffer->appendText(TRI_CHAR_LENGTH_PAIR("0\r\n\r\n")); - buffer->ensureNullTerminated(); - - _writeBuffers.push_back(buffer.get()); - buffer.release(); - _writeBuffersStats.push_back(nullptr); - - _isChunked = false; - _startThread = false; - _requestPending = false; - - fillWriteBuffer(); - processRead(); -} - -//////////////////////////////////////////////////////////////////////////////// -/// @brief task set up complete -//////////////////////////////////////////////////////////////////////////////// - -void GeneralCommTask::setupDone() { - _setupDone.store(true, std::memory_order_relaxed); -} - -//////////////////////////////////////////////////////////////////////////////// -/// @brief reads data from the socket -//////////////////////////////////////////////////////////////////////////////// - -void GeneralCommTask::addResponse(HttpResponse* response) { - // CORS response handling - if (!_origin.empty()) { - // the request contained an Origin header. We have to send back the - // access-control-allow-origin header now - LOG(TRACE) << "handling CORS response"; - - response->setHeaderNC(StaticStrings::AccessControlExposeHeaders, - StaticStrings::ExposedCorsHeaders); - - // send back original value of "Origin" header - response->setHeaderNC(StaticStrings::AccessControlAllowOrigin, _origin); - - // send back "Access-Control-Allow-Credentials" header - response->setHeaderNC(StaticStrings::AccessControlAllowCredentials, - (_denyCredentials ? "false" : "true")); - } - // CORS request handling EOF - - // set "connection" header - // keep-alive is the default - response->setConnectionType(_closeRequested - ? HttpResponse::CONNECTION_CLOSE - : HttpResponse::CONNECTION_KEEP_ALIVE); - - size_t const responseBodyLength = response->bodySize(); - - if (_requestType == GeneralRequest::RequestType::HEAD) { - // clear body if this is an HTTP HEAD request - // HEAD must not return a body - response->headResponse(responseBodyLength); - } - // else { - // // to enable automatic deflating of responses, activate this. - // // deflate takes a lot of CPU time so it should only be enabled for - // // dedicated purposes and not generally - // if (responseBodyLength > 16384 && _acceptDeflate) { - // response->deflate(); - // responseBodyLength = response->bodySize(); - // } - // } - - // reserve a buffer with some spare capacity - auto buffer = std::make_unique(TRI_UNKNOWN_MEM_ZONE, - responseBodyLength + 128, false); - - // write header - response->writeHeader(buffer.get()); - - // write body - if (_requestType != GeneralRequest::RequestType::HEAD) { - if (_isChunked) { - if (0 != responseBodyLength) { - buffer->appendHex(response->body().length()); - buffer->appendText(TRI_CHAR_LENGTH_PAIR("\r\n")); - buffer->appendText(response->body()); - buffer->appendText(TRI_CHAR_LENGTH_PAIR("\r\n")); - } - } else { - buffer->appendText(response->body()); - } - } - - buffer->ensureNullTerminated(); - - _writeBuffers.push_back(buffer.get()); - auto b = buffer.release(); - - if (!b->empty()) { - LOG_TOPIC(TRACE, Logger::REQUESTS) - << "\"http-request-response\",\"" << (void*)this << "\",\"" - << StringUtils::escapeUnicode(std::string(b->c_str(), b->length())) - << "\""; - } - - // clear body - response->body().clear(); - - double const totalTime = RequestStatisticsAgent::elapsedSinceReadStart(); - - _writeBuffersStats.push_back(RequestStatisticsAgent::steal()); - - LOG_TOPIC(INFO, Logger::REQUESTS) - << "\"http-request-end\",\"" << (void*)this << "\",\"" - << _connectionInfo.clientAddress << "\",\"" - << HttpRequest::translateMethod(_requestType) << "\",\"" - << HttpRequest::translateVersion(_httpVersion) << "\"," - << static_cast(response->responseCode()) << "," - << _originalBodyLength << "," << responseBodyLength << ",\"" << _fullUrl - << "\"," << Logger::FIXED(totalTime, 6); - - // start output - fillWriteBuffer(); -} - -//////////////////////////////////////////////////////////////////////////////// -/// check the content-length header of a request and fail it is broken -//////////////////////////////////////////////////////////////////////////////// - -bool GeneralCommTask::checkContentLength(bool expectContentLength) { - int64_t const bodyLength = _request->contentLength(); - - if (bodyLength < 0) { - // bad request, body length is < 0. this is a client error - handleSimpleError(GeneralResponse::ResponseCode::LENGTH_REQUIRED); - return false; - } - - if (!expectContentLength && bodyLength > 0) { - // content-length header was sent but the request method does not support - // that - // we'll warn but read the body anyway - LOG(WARN) << "received HTTP GET/HEAD request with content-length, this " - "should not happen"; - } - - if ((size_t)bodyLength > MaximalBodySize) { - LOG(WARN) << "maximal body size is " << MaximalBodySize - << ", request body size is " << bodyLength; - - // request entity too large - handleSimpleError(GeneralResponse::ResponseCode::REQUEST_ENTITY_TOO_LARGE); - return false; - } - - // set instance variable to content-length value - _bodyLength = (size_t)bodyLength; - _originalBodyLength = _bodyLength; - - if (_bodyLength > 0) { - // we'll read the body - _readRequestBody = true; - } - - // everything's fine - return true; -} - -//////////////////////////////////////////////////////////////////////////////// -/// @brief fills the write buffer -//////////////////////////////////////////////////////////////////////////////// - -void GeneralCommTask::fillWriteBuffer() { - if (!hasWriteBuffer() && !_writeBuffers.empty()) { - StringBuffer* buffer = _writeBuffers.front(); - _writeBuffers.pop_front(); - - TRI_ASSERT(buffer != nullptr); - - TRI_request_statistics_t* statistics = _writeBuffersStats.front(); - _writeBuffersStats.pop_front(); - - setWriteBuffer(buffer, statistics); - } -} - -//////////////////////////////////////////////////////////////////////////////// -/// @brief handles CORS options -//////////////////////////////////////////////////////////////////////////////// - -void GeneralCommTask::processCorsOptions() { - HttpResponse response(GeneralResponse::ResponseCode::OK); - - response.setHeaderNC(StaticStrings::Allow, StaticStrings::CorsMethods); - - if (!_origin.empty()) { - LOG(TRACE) << "got CORS preflight request"; - std::string const allowHeaders = StringUtils::trim( - _request->header(StaticStrings::AccessControlRequestHeaders)); - - // send back which HTTP methods are allowed for the resource - // we'll allow all - response.setHeaderNC(StaticStrings::AccessControlAllowMethods, - StaticStrings::CorsMethods); - - if (!allowHeaders.empty()) { - // allow all extra headers the client requested - // we don't verify them here. the worst that can happen is that the client - // sends some broken headers and then later cannot access the data on the - // server. that's a client problem. - response.setHeaderNC(StaticStrings::AccessControlAllowHeaders, - allowHeaders); - - LOG(TRACE) << "client requested validation of the following headers: " - << allowHeaders; - } - - // set caching time (hard-coded value) - response.setHeaderNC(StaticStrings::AccessControlMaxAge, - StaticStrings::N1800); - } - - clearRequest(); - handleResponse(&response); -} - -//////////////////////////////////////////////////////////////////////////////// -/// @brief processes a request -//////////////////////////////////////////////////////////////////////////////// - -void GeneralCommTask::processRequest() { - // check for deflate - bool found; - std::string const& acceptEncoding = - _request->header(StaticStrings::AcceptEncoding, found); - - if (found) { - if (acceptEncoding.find("deflate") != std::string::npos) { - _acceptDeflate = true; - } - } - - if (_request != nullptr) { - LOG_TOPIC(DEBUG, Logger::REQUESTS) - << "\"http-request-begin\",\"" << (void*)this << "\",\"" - << _connectionInfo.clientAddress << "\",\"" - << HttpRequest::translateMethod(_requestType) << "\",\"" - << HttpRequest::translateVersion(_httpVersion) << "\"," << _fullUrl - << "\""; - - std::string const& body = _request->body(); - - if (!body.empty()) { - LOG_TOPIC(DEBUG, Logger::REQUESTS) - << "\"http-request-body\",\"" << (void*)this << "\",\"" - << (StringUtils::escapeUnicode(body)) << "\""; - } - } - - // check for an HLC time stamp - std::string const& timeStamp = - _request->header(StaticStrings::HLCHeader, found); - if (found) { - uint64_t timeStampInt = - arangodb::basics::HybridLogicalClock::decodeTimeStampWithCheck( - timeStamp); - if (timeStampInt != 0) { - TRI_HybridLogicalClock(timeStampInt); - } - } - - // check for an async request - std::string const& asyncExecution = - _request->header(StaticStrings::Async, found); - - // create handler, this will take over the request and the response - std::unique_ptr response( - new HttpResponse(GeneralResponse::ResponseCode::SERVER_ERROR)); - - WorkItem::uptr handler( - RestServerFeature::HANDLER_FACTORY->createHandler(_request, - response.get())); - - if (handler == nullptr) { - LOG(TRACE) << "no handler is known, giving up"; - - clearRequest(); - - handleSimpleError(GeneralResponse::ResponseCode::NOT_FOUND); - return; - } - - response.release(); - - if (_request != nullptr) { - bool found; - std::string const& startThread = - _request->header(StaticStrings::StartThread, found); - - if (found) { - _startThread = StringUtils::boolean(startThread); - } - } - - handler->setTaskId(_taskId, _loop); - - // clear request object - _request = nullptr; - - // async execution - bool ok = false; - - if (found && (asyncExecution == "true" || asyncExecution == "store")) { - requestStatisticsAgentSetAsync(); - uint64_t jobId = 0; - - if (asyncExecution == "store") { - // persist the responses - ok = _server->handleRequestAsync(this, handler, &jobId); - } else { - // don't persist the responses - ok = _server->handleRequestAsync(this, handler, nullptr); - } - - if (ok) { - HttpResponse response(GeneralResponse::ResponseCode::ACCEPTED); - - if (jobId > 0) { - // return the job id we just created - response.setHeaderNC(StaticStrings::AsyncId, StringUtils::itoa(jobId)); - } - - handleResponse(&response); - - return; - } - } - - // synchronous request - else { - ok = _server->handleRequest(this, handler); - } - - if (!ok) { - handleSimpleError(GeneralResponse::ResponseCode::SERVER_ERROR); - } -} - -//////////////////////////////////////////////////////////////////////////////// -/// @brief clears the request object -//////////////////////////////////////////////////////////////////////////////// - -void GeneralCommTask::clearRequest() { - delete _request; - _request = nullptr; -} - -//////////////////////////////////////////////////////////////////////////////// -/// @brief resets the internal state -/// -/// this method can be called to clean up when the request handling aborts -/// prematurely -//////////////////////////////////////////////////////////////////////////////// - -void GeneralCommTask::resetState(bool close) { - if (close) { - clearRequest(); - - _requestPending = false; - _isChunked = false; - _closeRequested = true; - - _readPosition = 0; - _bodyPosition = 0; - _bodyLength = 0; - } else { - _requestPending = true; - - bool compact = false; - - if (_sinceCompactification > RunCompactEvery) { - compact = true; - } else if (_readBuffer->length() > MaximalPipelineSize) { - compact = true; - } - - if (compact) { - _readBuffer->erase_front(_bodyPosition + _bodyLength); - - _sinceCompactification = 0; - _readPosition = 0; - } else { - _readPosition = _bodyPosition + _bodyLength; - - if (_readPosition == _readBuffer->length()) { - _sinceCompactification = 0; - _readPosition = 0; - _readBuffer->reset(); - } - } - - _bodyPosition = 0; - _bodyLength = 0; - } - - _newRequest = true; - _readRequestBody = false; - _startThread = false; -} - -bool GeneralCommTask::setup(Scheduler* scheduler, EventLoop loop) { - bool ok = SocketTask::setup(scheduler, loop); - - if (!ok) { - return false; - } - - _scheduler = scheduler; - _loop = loop; - - setupDone(); - - return true; -} - -void GeneralCommTask::cleanup() { SocketTask::cleanup(); } - bool GeneralCommTask::handleEvent(EventToken token, EventType events) { bool result = SocketTask::handleEvent(token, events); - - if (_clientClosed) { - _scheduler->destroyTask(this); - } - + if (_clientClosed) _scheduler->destroyTask(this); return result; } -void GeneralCommTask::signalTask(TaskData* data) { - // data response - if (data->_type == TaskData::TASK_DATA_RESPONSE) { - data->RequestStatisticsAgent::transferTo(this); - - HttpResponse* response = dynamic_cast(data->_response.get()); - - if (response != nullptr) { - handleResponse(response); - processRead(); - } else { - handleSimpleError(GeneralResponse::ResponseCode::SERVER_ERROR); - } - } - - // data response - else if (data->_type == TaskData::TASK_DATA_BUFFER) { - data->RequestStatisticsAgent::transferTo(this); - - HttpResponse response(GeneralResponse::ResponseCode::OK); - - velocypack::Slice slice(data->_buffer->data()); - response.setPayload(_request, slice, true, VPackOptions::Defaults); - - handleResponse(&response); - processRead(); - } - - // data chunk - else if (data->_type == TaskData::TASK_DATA_CHUNK) { - size_t len = data->_data.size(); - - if (0 == len) { - finishedChunked(); - } else { - StringBuffer* buffer = new StringBuffer(TRI_UNKNOWN_MEM_ZONE, len); - - buffer->appendHex(len); - buffer->appendText(TRI_CHAR_LENGTH_PAIR("\r\n")); - buffer->appendText(data->_data.c_str(), len); - buffer->appendText(TRI_CHAR_LENGTH_PAIR("\r\n")); - - sendChunk(buffer); - } - } - - // do not know, what to do - give up - else { - _scheduler->destroyTask(this); - } -} - -bool GeneralCommTask::handleRead() { - bool res = true; - - if (!_setupDone.load(std::memory_order_relaxed)) { - return res; - } - - if (!_closeRequested) { - res = fillReadBuffer(); - - // process as much data as we got - while (processRead()) { - if (_closeRequested) { - break; - } - } - } else { - // if we don't close here, the scheduler thread may fall into a - // busy wait state, consuming 100% CPU! - _clientClosed = true; - } - - if (_clientClosed) { - res = false; - _server->handleCommunicationClosed(this); - } else if (!res) { - _clientClosed = true; - _server->handleCommunicationFailure(this); - } - - return res; -} - -void GeneralCommTask::completedWriteBuffer() { - _writeBuffer = nullptr; - _writeLength = 0; - - if (_writeBufferStatistics != nullptr) { - _writeBufferStatistics->_writeEnd = TRI_StatisticsTime(); - - TRI_ReleaseRequestStatistics(_writeBufferStatistics); - _writeBufferStatistics = nullptr; - } - - fillWriteBuffer(); - - if (!_clientClosed && _closeRequested && !hasWriteBuffer() && - _writeBuffers.empty() && !_isChunked) { - _clientClosed = true; - _server->handleCommunicationClosed(this); - } -} - -void GeneralCommTask::handleTimeout() { - _clientClosed = true; - _server->handleCommunicationClosed(this); -} +void GeneralCommTask::handleTimeout() { _clientClosed = true; } diff --git a/arangod/GeneralServer/GeneralCommTask.h b/arangod/GeneralServer/GeneralCommTask.h index 8a47c75f41..d997917d08 100644 --- a/arangod/GeneralServer/GeneralCommTask.h +++ b/arangod/GeneralServer/GeneralCommTask.h @@ -27,15 +27,16 @@ #include "Scheduler/SocketTask.h" +#include + #include "Basics/Mutex.h" #include "Basics/StringBuffer.h" #include "Basics/WorkItem.h" #include - namespace arangodb { -class HttpRequest; -class HttpResponse; +class GeneralRequest; +class GeneralResponse; namespace rest { class GeneralServer; @@ -44,172 +45,54 @@ class GeneralCommTask : public SocketTask, public RequestStatisticsAgent { GeneralCommTask(GeneralCommTask const&) = delete; GeneralCommTask const& operator=(GeneralCommTask const&) = delete; - public: - static size_t const MaximalHeaderSize; - static size_t const MaximalBodySize; - static size_t const MaximalPipelineSize; - static size_t const RunCompactEvery; - public: GeneralCommTask(GeneralServer*, TRI_socket_t, ConnectionInfo&&, double keepAliveTimeout); - protected: - ~GeneralCommTask(); - - public: // return whether or not the task desires to start a dispatcher thread - bool startThread() const { return _startThread; } + bool startThread() const { return _startThread; } // called by server + void handleResponse(GeneralResponse*); // called by server - // handles response - void handleResponse(HttpResponse*); - - // handles simple errors void handleSimpleError(GeneralResponse::ResponseCode); void handleSimpleError(GeneralResponse::ResponseCode, int code, std::string const& errorMessage); - // reads data from the socket - bool processRead(); + protected: + virtual ~GeneralCommTask(); - // sends more chunked data - void sendChunk(basics::StringBuffer*); + virtual void addResponse(GeneralResponse*) = 0; + virtual bool processRead() = 0; + virtual void processRequest() = 0; + virtual void resetState(bool) = 0; - // chunking is finished - void finishedChunked(); + virtual bool handleEvent(EventToken token, + EventType events) override; // called by TODO - // task set up complete - void setupDone(); - - private: - // returns the authentication realm - std::string authenticationRealm() const; - - // checks the authentication - GeneralResponse::ResponseCode authenticateRequest(); - - // reads data from the socket - void addResponse(HttpResponse*); - - // check the content-length header of a request and fail it is broken - bool checkContentLength(bool expectContentLength); - - // fills the write buffer - void fillWriteBuffer(); - - // handles CORS options - void processCorsOptions(); - - // processes a request - void processRequest(); + void cleanup() override final { SocketTask::cleanup(); } // clears the request object - void clearRequest(); - - // resets the internal state - // - // this method can be called to clean up when the request handling aborts - // prematurely - void resetState(bool close); - - protected: - bool setup(Scheduler* scheduler, EventLoop loop) override; - void cleanup() override; - bool handleEvent(EventToken token, EventType events) override; - void signalTask(TaskData*) override; - - protected: - bool handleRead() override; - void completedWriteBuffer() override; - void handleTimeout() override; - - protected: - // connection info - ConnectionInfo _connectionInfo; - - // the underlying server - GeneralServer* const _server; - - // allow method override - bool _allowMethodOverride; - - char const* _protocol; + void clearRequest() { + delete _request; + _request = nullptr; + } private: - // write buffers - std::deque _writeBuffers; - - // statistics buffers - std::deque _writeBuffersStats; - - // current read position - size_t _readPosition; - - // start of the body position - size_t _bodyPosition; - - // body length - size_t _bodyLength; - - // true if request is complete but not handled - bool _requestPending; - - // true if a close has been requested by the client - bool _closeRequested; - - // true if reading the request body - bool _readRequestBody; - - // whether or not to allow credentialed requests (only CORS) - bool _denyCredentials; - - // whether the client accepts deflate algorithm - bool _acceptDeflate; - - // new request started - bool _newRequest; - - // true if within a chunked response - bool _isChunked; - - ////////////////////////////////////////////////////////////////////////////// - /// @brief start a separate thread if the task is added to the dispatcher? - ////////////////////////////////////////////////////////////////////////////// + void handleTimeout() override final; + protected: + GeneralServer* const _server; + GeneralRequest* _request; // the request with possible incomplete body + ConnectionInfo _connectionInfo; + char const* _protocol; // protocal to use http, vpp + GeneralRequest::ProtocolVersion _protocolVersion; bool _startThread; - - // the request with possible incomplete body - HttpRequest* _request; - - // http version number used - GeneralRequest::ProtocolVersion _httpVersion; - - // type of request (GET, POST, ...) - GeneralRequest::RequestType _requestType; - - // value of requested URL - std::string _fullUrl; - - // value of the HTTP origin header the client sent (if any, CORS only) - std::string _origin; - - // start position of current request - size_t _startPosition; - - // number of requests since last compactification - size_t _sinceCompactification; - - // original body length - size_t _originalBodyLength; - - // task ready - std::atomic _setupDone; - - // authentication real - std::string const _authenticationRealm; - -}; // Commontask -} // rest -} // arango + std::deque _writeBuffers; + std::deque + _writeBuffersStats; // statistics buffers + bool _isChunked; // true if within a chunked response + bool _requestPending; // true if request is complete but not handled +}; +} +} #endif diff --git a/arangod/GeneralServer/GeneralListenTask.cpp b/arangod/GeneralServer/GeneralListenTask.cpp index f668d7beb2..e49530e2a6 100644 --- a/arangod/GeneralServer/GeneralListenTask.cpp +++ b/arangod/GeneralServer/GeneralListenTask.cpp @@ -25,6 +25,10 @@ #include "GeneralListenTask.h" #include "GeneralServer/GeneralServer.h" +#include "GeneralServer/GeneralServerFeature.h" +#include "Scheduler/Scheduler.h" +#include "Scheduler/SchedulerFeature.h" +#include "Ssl/SslServerFeature.h" using namespace arangodb; using namespace arangodb::rest; @@ -38,9 +42,47 @@ GeneralListenTask::GeneralListenTask(GeneralServer* server, Endpoint* endpoint, : Task("GeneralListenTask"), ListenTask(endpoint), _server(server), - _connectionType(connectionType) {} + _connectionType(connectionType) { + _keepAliveTimeout = GeneralServerFeature::keepAliveTimeout(); -bool GeneralListenTask::handleConnected(TRI_socket_t s, ConnectionInfo&& info) { - _server->handleConnected(s, std::move(info), _connectionType); + SslServerFeature* ssl = + application_features::ApplicationServer::getFeature( + "SslServer"); + + if (ssl != nullptr) { + _sslContext = ssl->sslContext(); + } + + _verificationMode = GeneralServerFeature::verificationMode(); + _verificationCallback = GeneralServerFeature::verificationCallback(); +} + +bool GeneralListenTask::handleConnected(TRI_socket_t socket, + ConnectionInfo&& info) { + GeneralCommTask* commTask = nullptr; + + switch (_connectionType) { + case ConnectionType::VPPS: + commTask = + new HttpCommTask(_server, socket, std::move(info), _keepAliveTimeout); + break; + case ConnectionType::VPP: + commTask = + new HttpCommTask(_server, socket, std::move(info), _keepAliveTimeout); + break; + case ConnectionType::HTTPS: + commTask = new HttpsCommTask(_server, socket, std::move(info), + _keepAliveTimeout, _sslContext, + _verificationMode, _verificationCallback); + break; + case ConnectionType::HTTP: + commTask = + new HttpCommTask(_server, socket, std::move(info), _keepAliveTimeout); + break; + default: + return false; + } + + SchedulerFeature::SCHEDULER->registerTask(commTask); return true; } diff --git a/arangod/GeneralServer/GeneralListenTask.h b/arangod/GeneralServer/GeneralListenTask.h index b60d4f0605..ba38274f84 100644 --- a/arangod/GeneralServer/GeneralListenTask.h +++ b/arangod/GeneralServer/GeneralListenTask.h @@ -26,6 +26,9 @@ #define ARANGOD_HTTP_SERVER_HTTP_LISTEN_TASK_H 1 #include "Scheduler/ListenTask.h" + +#include + #include "GeneralServer/GeneralDefinitions.h" namespace arangodb { @@ -34,19 +37,11 @@ class Endpoint; namespace rest { class GeneralServer; -//////////////////////////////////////////////////////////////////////////////// -/// @brief task used to establish connections -//////////////////////////////////////////////////////////////////////////////// - class GeneralListenTask : public ListenTask { GeneralListenTask(GeneralListenTask const&) = delete; GeneralListenTask& operator=(GeneralListenTask const&) = delete; public: - ////////////////////////////////////////////////////////////////////////////// - /// @brief listen to given port - ////////////////////////////////////////////////////////////////////////////// - GeneralListenTask(GeneralServer* server, Endpoint* endpoint, ConnectionType connectionType); @@ -54,12 +49,13 @@ class GeneralListenTask : public ListenTask { bool handleConnected(TRI_socket_t s, ConnectionInfo&& info) override; private: - ////////////////////////////////////////////////////////////////////////////// - /// @brief underlying general server - ////////////////////////////////////////////////////////////////////////////// - GeneralServer* _server; ConnectionType _connectionType; + double _keepAliveTimeout = 300.0; + SSL_CTX* _sslContext = nullptr; + int _verificationMode = SSL_VERIFY_NONE; + int (*_verificationCallback)(int, X509_STORE_CTX*) = nullptr +; }; } } diff --git a/arangod/GeneralServer/GeneralServer.cpp b/arangod/GeneralServer/GeneralServer.cpp index 23c6fa78c7..a4728b15a3 100644 --- a/arangod/GeneralServer/GeneralServer.cpp +++ b/arangod/GeneralServer/GeneralServer.cpp @@ -32,10 +32,10 @@ #include "GeneralServer/AsyncJobManager.h" #include "GeneralServer/GeneralCommTask.h" #include "GeneralServer/GeneralListenTask.h" +#include "GeneralServer/GeneralServerFeature.h" #include "GeneralServer/HttpServerJob.h" #include "GeneralServer/RestHandler.h" #include "Logger/Logger.h" -#include "RestServer/RestServerFeature.h" #include "Scheduler/ListenTask.h" #include "Scheduler/Scheduler.h" #include "Scheduler/SchedulerFeature.h" @@ -66,45 +66,19 @@ int GeneralServer::sendChunk(uint64_t taskId, std::string const& data) { //////////////////////////////////////////////////////////////////////////////// GeneralServer::GeneralServer( - double keepAliveTimeout, bool allowMethodOverride, - std::vector const& accessControlAllowOrigins, SSL_CTX* ctx) + bool allowMethodOverride, + std::vector const& accessControlAllowOrigins) : _listenTasks(), _endpointList(nullptr), - _commTasks(), - _keepAliveTimeout(keepAliveTimeout), _allowMethodOverride(allowMethodOverride), - _accessControlAllowOrigins(accessControlAllowOrigins), - _ctx(ctx), - _verificationMode(SSL_VERIFY_NONE), - _verificationCallback(nullptr), - _sslAllowed(ctx != nullptr) {} + _accessControlAllowOrigins(accessControlAllowOrigins) {} + //////////////////////////////////////////////////////////////////////////////// /// @brief destructs a general server //////////////////////////////////////////////////////////////////////////////// GeneralServer::~GeneralServer() { stopListening(); } -//////////////////////////////////////////////////////////////////////////////// -/// @brief generates a suitable communication task -//////////////////////////////////////////////////////////////////////////////// - -GeneralCommTask* GeneralServer::createCommTask(TRI_socket_t s, - ConnectionInfo&& info, - ConnectionType conntype) { - switch (conntype) { - case ConnectionType::VPPS: - return new HttpCommTask(this, s, std::move(info), _keepAliveTimeout); - case ConnectionType::VPP: - return new HttpCommTask(this, s, std::move(info), _keepAliveTimeout); - case ConnectionType::HTTPS: - // check _ctx and friends? REVIEW - return new HttpsCommTask(this, s, std::move(info), _keepAliveTimeout, - _ctx, _verificationMode, _verificationCallback); - default: - return new HttpCommTask(this, s, std::move(info), _keepAliveTimeout); - } -} - //////////////////////////////////////////////////////////////////////////////// /// @brief add the endpoint list //////////////////////////////////////////////////////////////////////////////// @@ -137,7 +111,7 @@ void GeneralServer::startListening() { } //////////////////////////////////////////////////////////////////////////////// -/// @brief stops listening +/// @brief removes all listen and comm tasks //////////////////////////////////////////////////////////////////////////////// void GeneralServer::stopListening() { @@ -148,69 +122,6 @@ void GeneralServer::stopListening() { _listenTasks.clear(); } -//////////////////////////////////////////////////////////////////////////////// -/// @brief removes all listen and comm tasks -//////////////////////////////////////////////////////////////////////////////// - -void GeneralServer::stop() { - while (true) { - GeneralCommTask* task = nullptr; - - { - MUTEX_LOCKER(mutexLocker, _commTasksLock); - - if (_commTasks.empty()) { - break; - } - - task = *_commTasks.begin(); - _commTasks.erase(task); - } - - SchedulerFeature::SCHEDULER->destroyTask(task); - } -} - -//////////////////////////////////////////////////////////////////////////////// -/// @brief handles connection request -//////////////////////////////////////////////////////////////////////////////// - -void GeneralServer::handleConnected(TRI_socket_t s, ConnectionInfo&& info, - ConnectionType connectionType) { - GeneralCommTask* task = createCommTask(s, std::move(info), connectionType); - - try { - MUTEX_LOCKER(mutexLocker, _commTasksLock); - _commTasks.emplace(task); - } catch (...) { - // destroy the task to prevent a leak - deleteTask(task); - throw; - } - - // registers the task and get the number of the scheduler thread - ssize_t n; - SchedulerFeature::SCHEDULER->registerTask(task, &n); -} - -//////////////////////////////////////////////////////////////////////////////// -/// @brief handles a connection close -//////////////////////////////////////////////////////////////////////////////// - -void GeneralServer::handleCommunicationClosed(GeneralCommTask* task) { - MUTEX_LOCKER(mutexLocker, _commTasksLock); - _commTasks.erase(task); -} - -//////////////////////////////////////////////////////////////////////////////// -/// @brief handles a connection failure -//////////////////////////////////////////////////////////////////////////////// - -void GeneralServer::handleCommunicationFailure(GeneralCommTask* task) { - MUTEX_LOCKER(mutexLocker, _commTasksLock); - _commTasks.erase(task); -} - //////////////////////////////////////////////////////////////////////////////// /// @brief create a job for asynchronous execution (using the dispatcher) //////////////////////////////////////////////////////////////////////////////// @@ -233,7 +144,7 @@ bool GeneralServer::handleRequestAsync(GeneralCommTask* task, // register the job with the job manager if (jobId != nullptr) { - RestServerFeature::JOB_MANAGER->initAsyncJob( + GeneralServerFeature::JOB_MANAGER->initAsyncJob( static_cast(job.get()), hdr); *jobId = job->jobId(); } @@ -296,20 +207,12 @@ bool GeneralServer::openEndpoint(Endpoint* endpoint) { if (endpoint->transport() == Endpoint::TransportType::HTTP) { if (endpoint->encryption() == Endpoint::EncryptionType::SSL) { - if (!_sslAllowed) { // we should not end up here - LOG(FATAL) << "no ssl context"; - FATAL_ERROR_EXIT(); - } connectionType = ConnectionType::HTTPS; } else { connectionType = ConnectionType::HTTP; } } else { if (endpoint->encryption() == Endpoint::EncryptionType::SSL) { - if (!_sslAllowed) { // we should not end up here - LOG(FATAL) << "no ssl context"; - FATAL_ERROR_EXIT(); - } connectionType = ConnectionType::VPPS; } else { connectionType = ConnectionType::VPP; diff --git a/arangod/GeneralServer/GeneralServer.h b/arangod/GeneralServer/GeneralServer.h index 6e907c76ca..13fe0784ca 100644 --- a/arangod/GeneralServer/GeneralServer.h +++ b/arangod/GeneralServer/GeneralServer.h @@ -26,14 +26,14 @@ #ifndef ARANGOD_HTTP_SERVER_HTTP_SERVER_H #define ARANGOD_HTTP_SERVER_HTTP_SERVER_H 1 -#include "GeneralServer/GeneralDefinitions.h" #include "Scheduler/TaskManager.h" + #include "Basics/Mutex.h" #include "Endpoint/ConnectionInfo.h" -#include "GeneralServer/RestHandler.h" +#include "GeneralServer/GeneralDefinitions.h" #include "GeneralServer/HttpCommTask.h" #include "GeneralServer/HttpsCommTask.h" -#include +#include "GeneralServer/RestHandler.h" namespace arangodb { class EndpointList; @@ -57,9 +57,8 @@ class GeneralServer : protected TaskManager { static int sendChunk(uint64_t, std::string const&); public: - GeneralServer(double keepAliveTimeout, bool allowMethodOverride, - std::vector const& accessControlAllowOrigins, - SSL_CTX* ctx = nullptr); + GeneralServer(bool allowMethodOverride, + std::vector const& accessControlAllowOrigins); virtual ~GeneralServer(); public: @@ -69,15 +68,6 @@ class GeneralServer : protected TaskManager { // check, if we allow a method override bool allowMethodOverride() { return _allowMethodOverride; } - // generates a suitable communication task - virtual GeneralCommTask* createCommTask( - TRI_socket_t, ConnectionInfo&&, ConnectionType = ConnectionType::HTTP); - - void setVerificationMode(int mode) { _verificationMode = mode; } - void setVerificationCallback(int (*func)(int, X509_STORE_CTX*)) { - _verificationCallback = func; - } - public: // list of trusted origin urls for CORS std::vector const& trustedOrigins() const { @@ -93,18 +83,6 @@ class GeneralServer : protected TaskManager { // stops listining void stopListening(); - // removes all listen and comm tasks - void stop(); - - // handles connection request - void handleConnected(TRI_socket_t s, ConnectionInfo&& info, ConnectionType); - - // handles a connection close - void handleCommunicationClosed(GeneralCommTask*); - - // handles a connection failure - void handleCommunicationFailure(GeneralCommTask*); - // creates a job for asynchronous execution bool handleRequestAsync(GeneralCommTask*, arangodb::WorkItem::uptr&, @@ -138,15 +116,6 @@ class GeneralServer : protected TaskManager { // defined ports and addresses const EndpointList* _endpointList; - // mutex for comm tasks - arangodb::Mutex _commTasksLock; - - // active comm tasks - std::unordered_set _commTasks; - - // keep-alive timeout - double _keepAliveTimeout; - // allow to override the method bool _allowMethodOverride; @@ -154,10 +123,6 @@ class GeneralServer : protected TaskManager { std::vector const _accessControlAllowOrigins; private: - SSL_CTX* _ctx; - int _verificationMode; - int (*_verificationCallback)(int, X509_STORE_CTX*); - bool _sslAllowed; }; } } diff --git a/arangod/RestServer/RestServerFeature.cpp b/arangod/GeneralServer/GeneralServerFeature.cpp similarity index 92% rename from arangod/RestServer/RestServerFeature.cpp rename to arangod/GeneralServer/GeneralServerFeature.cpp index db2b809a14..9558b1190a 100644 --- a/arangod/RestServer/RestServerFeature.cpp +++ b/arangod/GeneralServer/GeneralServerFeature.cpp @@ -20,7 +20,7 @@ /// @author Dr. Frank Celler //////////////////////////////////////////////////////////////////////////////// -#include "RestServerFeature.h" +#include "GeneralServerFeature.h" #include "Agency/AgencyFeature.h" #include "Agency/RestAgencyHandler.h" @@ -78,15 +78,14 @@ using namespace arangodb; using namespace arangodb::rest; using namespace arangodb::options; -rest::RestHandlerFactory* RestServerFeature::HANDLER_FACTORY = nullptr; -rest::AsyncJobManager* RestServerFeature::JOB_MANAGER = nullptr; -RestServerFeature* RestServerFeature::REST_SERVER = nullptr; -AuthInfo RestServerFeature::AUTH_INFO; +rest::RestHandlerFactory* GeneralServerFeature::HANDLER_FACTORY = nullptr; +rest::AsyncJobManager* GeneralServerFeature::JOB_MANAGER = nullptr; +GeneralServerFeature* GeneralServerFeature::GENERAL_SERVER = nullptr; +AuthInfo GeneralServerFeature::AUTH_INFO; -RestServerFeature::RestServerFeature( +GeneralServerFeature::GeneralServerFeature( application_features::ApplicationServer* server) - : ApplicationFeature(server, "RestServer"), - _keepAliveTimeout(300.0), + : ApplicationFeature(server, "GeneralServer"), _allowMethodOverride(false), _authentication(true), _authenticationUnixSockets(true), @@ -110,7 +109,7 @@ RestServerFeature::RestServerFeature( startsAfter("Upgrade"); } -void RestServerFeature::collectOptions( +void GeneralServerFeature::collectOptions( std::shared_ptr options) { options->addSection("server", "Server features"); @@ -179,7 +178,7 @@ void RestServerFeature::collectOptions( new VectorParameter(&_trustedProxies)); } -void RestServerFeature::validateOptions(std::shared_ptr) { +void GeneralServerFeature::validateOptions(std::shared_ptr) { if (!_accessControlAllowOrigins.empty()) { // trim trailing slash from all members for (auto& it : _accessControlAllowOrigins) { @@ -209,9 +208,9 @@ void RestServerFeature::validateOptions(std::shared_ptr) { } if (!_jwtSecret.empty()) { - if (_jwtSecret.length() > RestServerFeature::_maxSecretLength) { + if (_jwtSecret.length() > GeneralServerFeature::_maxSecretLength) { LOG(ERR) << "Given JWT secret too long. Max length is " - << RestServerFeature::_maxSecretLength; + << GeneralServerFeature::_maxSecretLength; FATAL_ERROR_EXIT(); } } @@ -255,32 +254,32 @@ static bool SetRequestContext(GeneralRequest* request, void* data) { } VocbaseContext* ctx = new arangodb::VocbaseContext( - request, vocbase, RestServerFeature::getJwtSecret()); + request, vocbase, GeneralServerFeature::getJwtSecret()); request->setRequestContext(ctx, true); // the "true" means the request is the owner of the context return true; } -void RestServerFeature::generateNewJwtSecret() { +void GeneralServerFeature::generateNewJwtSecret() { _jwtSecret = ""; uint16_t m = 254; - for (size_t i = 0; i < RestServerFeature::_maxSecretLength; i++) { + for (size_t i = 0; i < GeneralServerFeature::_maxSecretLength; i++) { _jwtSecret += (1 + RandomGenerator::interval(m)); } } -void RestServerFeature::prepare() { +void GeneralServerFeature::prepare() { if (_jwtSecret.empty()) { generateNewJwtSecret(); } RestHandlerFactory::setMaintenance(true); - REST_SERVER = this; + GENERAL_SERVER = this; } -void RestServerFeature::start() { +void GeneralServerFeature::start() { _jobManager.reset(new AsyncJobManager(ClusterCommRestCallback)); JOB_MANAGER = _jobManager.get(); @@ -312,30 +311,30 @@ void RestServerFeature::start() { // populate the authentication cache. otherwise no one can access the new // database - RestServerFeature::AUTH_INFO.outdate(); + GeneralServerFeature::AUTH_INFO.outdate(); } -void RestServerFeature::stop() { +void GeneralServerFeature::stop() { for (auto& server : _servers) { server->stopListening(); } for (auto& server : _servers) { - server->stop(); + server->stopListening(); } } -void RestServerFeature::unprepare() { +void GeneralServerFeature::unprepare() { for (auto& server : _servers) { delete server; } - REST_SERVER = nullptr; + GENERAL_SERVER = nullptr; JOB_MANAGER = nullptr; HANDLER_FACTORY = nullptr; } -void RestServerFeature::buildServers() { +void GeneralServerFeature::buildServers() { TRI_ASSERT(_jobManager != nullptr); EndpointFeature* endpoint = @@ -344,7 +343,6 @@ void RestServerFeature::buildServers() { auto const& endpointList = endpoint->endpointList(); // check if endpointList contains ssl featured server - SSL_CTX* sslContext = nullptr; if (endpointList.hasSsl()) { SslServerFeature* ssl = application_features::ApplicationServer::getFeature( @@ -355,18 +353,17 @@ void RestServerFeature::buildServers() { "please use the '--ssl.keyfile' option"; FATAL_ERROR_EXIT(); } - sslContext = ssl->sslContext(); } GeneralServer* server = - new GeneralServer(_keepAliveTimeout, _allowMethodOverride, - _accessControlAllowOrigins, sslContext); + new GeneralServer(_allowMethodOverride, + _accessControlAllowOrigins); server->setEndpointList(&endpointList); _servers.push_back(server); } -void RestServerFeature::defineHandlers() { +void GeneralServerFeature::defineHandlers() { TRI_ASSERT(_jobManager != nullptr); AgencyFeature* agency = diff --git a/arangod/RestServer/RestServerFeature.h b/arangod/GeneralServer/GeneralServerFeature.h similarity index 67% rename from arangod/RestServer/RestServerFeature.h rename to arangod/GeneralServer/GeneralServerFeature.h index 34b8ca18e1..9e3d936806 100644 --- a/arangod/RestServer/RestServerFeature.h +++ b/arangod/GeneralServer/GeneralServerFeature.h @@ -20,11 +20,13 @@ /// @author Dr. Frank Celler //////////////////////////////////////////////////////////////////////////////// -#ifndef APPLICATION_FEATURES_REST_SERVER_FEATURE_H -#define APPLICATION_FEATURES_REST_SERVER_FEATURE_H 1 +#ifndef APPLICATION_FEATURES_GENERAL_SERVER_FEATURE_H +#define APPLICATION_FEATURES_GENERAL_SERVER_FEATURE_H 1 #include "ApplicationFeatures/ApplicationFeature.h" +#include + #include "Actions/RestActionHandler.h" #include "VocBase/AuthInfo.h" @@ -37,42 +39,62 @@ class GeneralServer; class RestServerThread; -class RestServerFeature final +class GeneralServerFeature final : public application_features::ApplicationFeature { + public: + typedef int (*verification_callback_fptr)(int, X509_STORE_CTX*); + public: static rest::RestHandlerFactory* HANDLER_FACTORY; static rest::AsyncJobManager* JOB_MANAGER; static AuthInfo AUTH_INFO; public: + static double keepAliveTimeout() { + return GENERAL_SERVER != nullptr ? GENERAL_SERVER->_keepAliveTimeout + : 300.0; + }; + + static int verificationMode() { + return GENERAL_SERVER != nullptr ? GENERAL_SERVER->_verificationMode + : SSL_VERIFY_NONE; + }; + + static verification_callback_fptr verificationCallback() { + return GENERAL_SERVER != nullptr ? GENERAL_SERVER->_verificationCallback + : nullptr; + }; + static bool authenticationEnabled() { - return REST_SERVER != nullptr && REST_SERVER->authentication(); + return GENERAL_SERVER != nullptr && GENERAL_SERVER->authentication(); } static bool hasProxyCheck() { - return REST_SERVER != nullptr && REST_SERVER->proxyCheck(); + return GENERAL_SERVER != nullptr && GENERAL_SERVER->proxyCheck(); } static std::vector getTrustedProxies() { - if (REST_SERVER == nullptr) { + if (GENERAL_SERVER == nullptr) { return std::vector(); } - return REST_SERVER->trustedProxies(); + + return GENERAL_SERVER->trustedProxies(); } static std::string getJwtSecret() { - if (REST_SERVER == nullptr) { + if (GENERAL_SERVER == nullptr) { return std::string(); } - return REST_SERVER->jwtSecret(); + + return GENERAL_SERVER->jwtSecret(); } private: - static RestServerFeature* REST_SERVER; + static GeneralServerFeature* GENERAL_SERVER; static const size_t _maxSecretLength = 64; public: - explicit RestServerFeature(application_features::ApplicationServer*); + explicit GeneralServerFeature(application_features::ApplicationServer*); public: void collectOptions(std::shared_ptr) override final; @@ -82,8 +104,14 @@ class RestServerFeature final void stop() override final; void unprepare() override final; + public: + void setVerificationMode(int mode) { _verificationMode = mode; } + void setVerificationCallback(int (*func)(int, X509_STORE_CTX*)) { + _verificationCallback = func; + } + private: - double _keepAliveTimeout; + double _keepAliveTimeout = 300.0; bool _allowMethodOverride; bool _authentication; bool _authenticationUnixSockets; @@ -94,6 +122,8 @@ class RestServerFeature final std::vector _accessControlAllowOrigins; std::string _jwtSecret; + int _verificationMode; + verification_callback_fptr _verificationCallback; public: bool authentication() const { return _authentication; } diff --git a/arangod/GeneralServer/HttpCommTask.cpp b/arangod/GeneralServer/HttpCommTask.cpp index e69de29bb2..e93e7533b2 100644 --- a/arangod/GeneralServer/HttpCommTask.cpp +++ b/arangod/GeneralServer/HttpCommTask.cpp @@ -0,0 +1,975 @@ +//////////////////////////////////////////////////////////////////////////////// +/// DISCLAIMER +/// +/// Copyright 2014-2016 ArangoDB GmbH, Cologne, Germany +/// Copyright 2004-2014 triAGENS GmbH, Cologne, Germany +/// +/// Licensed under the Apache License, Version 2.0 (the "License"); +/// you may not use this file except in compliance with the License. +/// You may obtain a copy of the License at +/// +/// http://www.apache.org/licenses/LICENSE-2.0 +/// +/// Unless required by applicable law or agreed to in writing, software +/// distributed under the License is distributed on an "AS IS" BASIS, +/// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +/// See the License for the specific language governing permissions and +/// limitations under the License. +/// +/// Copyright holder is ArangoDB GmbH, Cologne, Germany +/// +/// @author Dr. Frank Celler +/// @author Achim Brandt +//////////////////////////////////////////////////////////////////////////////// + +#include "HttpCommTask.h" + +#include "Basics/HybridLogicalClock.h" +#include "GeneralServer/GeneralServer.h" +#include "GeneralServer/GeneralServerFeature.h" +#include "GeneralServer/RestHandler.h" +#include "GeneralServer/RestHandlerFactory.h" +#include "Scheduler/Scheduler.h" +#include "Scheduler/SchedulerFeature.h" +#include "VocBase/server.h" //clock + +//////////////////////////////////////////////////////////////////////////////// +/// @brief reads data from the socket +//////////////////////////////////////////////////////////////////////////////// + +using namespace arangodb; +using namespace arangodb::basics; +using namespace arangodb::rest; + +namespace arangodb { +class HttpRequest; +class HttpResponse; +namespace rest { +class GeneralServer; + +size_t const HttpCommTask::MaximalHeaderSize = 1 * 1024 * 1024; // 1 MB +size_t const HttpCommTask::MaximalBodySize = 512 * 1024 * 1024; // 512 MB +size_t const HttpCommTask::MaximalPipelineSize = 512 * 1024 * 1024; // 512 MB +size_t const HttpCommTask::RunCompactEvery = 500; + +HttpCommTask::HttpCommTask(GeneralServer* server, TRI_socket_t sock, + ConnectionInfo&& info, double timeout) + : Task("HttpCommTask"), + GeneralCommTask(server, sock, std::move(info), timeout), + _readPosition(0), + _startPosition(0), + _bodyPosition(0), + _bodyLength(0), + _closeRequested(false), + _readRequestBody(false), + _allowMethodOverride(server->allowMethodOverride()), + _denyCredentials(true), + _acceptDeflate(false), + _newRequest(true), + _requestType(GeneralRequest::RequestType::ILLEGAL), + _fullUrl(), + _origin(), + _sinceCompactification(0), + _originalBodyLength(0) + +{ + _protocol = "http"; + connectionStatisticsAgentSetHttp(); +} + +void HttpCommTask::addResponse(HttpResponse* response) { + // CORS response handling + if (!_origin.empty()) { + // the request contained an Origin header. We have to send back the + // access-control-allow-origin header now + LOG(TRACE) << "handling CORS response"; + + response->setHeaderNC(StaticStrings::AccessControlExposeHeaders, + StaticStrings::ExposedCorsHeaders); + + // send back original value of "Origin" header + response->setHeaderNC(StaticStrings::AccessControlAllowOrigin, _origin); + + // send back "Access-Control-Allow-Credentials" header + response->setHeaderNC(StaticStrings::AccessControlAllowCredentials, + (_denyCredentials ? "false" : "true")); + } + // CORS request handling EOF + + // set "connection" header + // keep-alive is the default + response->setConnectionType(_closeRequested + ? HttpResponse::CONNECTION_CLOSE + : HttpResponse::CONNECTION_KEEP_ALIVE); + + size_t const responseBodyLength = response->bodySize(); + + if (_requestType == GeneralRequest::RequestType::HEAD) { + // clear body if this is an HTTP HEAD request + // HEAD must not return a body + response->headResponse(responseBodyLength); + } + // else { + // // to enable automatic deflating of responses, activate this. + // // deflate takes a lot of CPU time so it should only be enabled for + // // dedicated purposes and not generally + // if (responseBodyLength > 16384 && _acceptDeflate) { + // response->deflate(); + // responseBodyLength = response->bodySize(); + // } + // } + + // reserve a buffer with some spare capacity + auto buffer = std::make_unique(TRI_UNKNOWN_MEM_ZONE, + responseBodyLength + 128, false); + + // write header + response->writeHeader(buffer.get()); + + // write body + if (_requestType != GeneralRequest::RequestType::HEAD) { + if (_isChunked) { + if (0 != responseBodyLength) { + buffer->appendHex(response->body().length()); + buffer->appendText(TRI_CHAR_LENGTH_PAIR("\r\n")); + buffer->appendText(response->body()); + buffer->appendText(TRI_CHAR_LENGTH_PAIR("\r\n")); + } + } else { + buffer->appendText(response->body()); + } + } + + buffer->ensureNullTerminated(); + + _writeBuffers.push_back(buffer.get()); + auto b = buffer.release(); + + if (!b->empty()) { + LOG_TOPIC(TRACE, Logger::REQUESTS) + << "\"http-request-response\",\"" << (void*)this << "\",\"" + << StringUtils::escapeUnicode(std::string(b->c_str(), b->length())) + << "\""; + } + + // clear body + response->body().clear(); + + double const totalTime = RequestStatisticsAgent::elapsedSinceReadStart(); + + _writeBuffersStats.push_back(RequestStatisticsAgent::steal()); + + LOG_TOPIC(INFO, Logger::REQUESTS) + << "\"http-request-end\",\"" << (void*)this << "\",\"" + << _connectionInfo.clientAddress << "\",\"" + << HttpRequest::translateMethod(_requestType) << "\",\"" + << HttpRequest::translateVersion(_protocolVersion) << "\"," + << static_cast(response->responseCode()) << "," + << _originalBodyLength << "," << responseBodyLength << ",\"" << _fullUrl + << "\"," << Logger::FIXED(totalTime, 6); + + // start output + fillWriteBuffer(); +} // addResponse + +//////////////////////////////////////////////////////////////////////////////// +/// @brief reads data from the socket +//////////////////////////////////////////////////////////////////////////////// + +bool HttpCommTask::processRead() { + if (_requestPending || _readBuffer->c_str() == nullptr) { + return false; + } + + bool handleRequest = false; + + // still trying to read the header fields + if (!_readRequestBody) { + char const* ptr = _readBuffer->c_str() + _readPosition; + char const* etr = _readBuffer->end(); + + if (ptr == etr) { + return false; + } + + // starting a new request + if (_newRequest) { + // acquire a new statistics entry for the request + RequestStatisticsAgent::acquire(); + +#if USE_DEV_TIMERS + if (RequestStatisticsAgent::_statistics != nullptr) { + RequestStatisticsAgent::_statistics->_id = (void*)this; + } +#endif + + _newRequest = false; + _startPosition = _readPosition; + _protocolVersion = GeneralRequest::ProtocolVersion::UNKNOWN; + _requestType = GeneralRequest::RequestType::ILLEGAL; + _fullUrl = ""; + _denyCredentials = true; + _acceptDeflate = false; + + _sinceCompactification++; + } + + char const* end = etr - 3; + + // read buffer contents are way to small. we can exit here directly + if (ptr >= end) { + return false; + } + + // request started + requestStatisticsAgentSetReadStart(); + + // check for the end of the request + for (; ptr < end; ptr++) { + if (ptr[0] == '\r' && ptr[1] == '\n' && ptr[2] == '\r' && + ptr[3] == '\n') { + break; + } + } + + // check if header is too large + size_t headerLength = ptr - (_readBuffer->c_str() + _startPosition); + + if (headerLength > MaximalHeaderSize) { + LOG(WARN) << "maximal header size is " << MaximalHeaderSize + << ", request header size is " << headerLength; + + // header is too large + handleSimpleError( + GeneralResponse::ResponseCode::REQUEST_HEADER_FIELDS_TOO_LARGE); + return false; + } + + // header is complete + if (ptr < end) { + _readPosition = ptr - _readBuffer->c_str() + 4; + + LOG(TRACE) << "HTTP READ FOR " << (void*)this << ": " + << std::string(_readBuffer->c_str() + _startPosition, + _readPosition - _startPosition); + + // check that we know, how to serve this request and update the connection + // information, i. e. client and server addresses and ports and create a + // request context for that request + _request = new HttpRequest( + _connectionInfo, _readBuffer->c_str() + _startPosition, + _readPosition - _startPosition, _allowMethodOverride); + + if (_request == nullptr) { + LOG(ERR) << "cannot generate request"; + + // internal server error + handleSimpleError(GeneralResponse::ResponseCode::SERVER_ERROR); + return false; + } + + GeneralServerFeature::HANDLER_FACTORY->setRequestContext(_request); + _request->setClientTaskId(_taskId); + + // check HTTP protocol version + _protocolVersion = _request->protocolVersion(); + + if (_protocolVersion != GeneralRequest::ProtocolVersion::HTTP_1_0 && + _protocolVersion != GeneralRequest::ProtocolVersion::HTTP_1_1) { + handleSimpleError( + GeneralResponse::ResponseCode::HTTP_VERSION_NOT_SUPPORTED); + return false; + } + + // check max URL length + _fullUrl = _request->fullUrl(); + + if (_fullUrl.size() > 16384) { + handleSimpleError(GeneralResponse::ResponseCode::REQUEST_URI_TOO_LONG); + return false; + } + + // update the connection information, i. e. client and server addresses + // and ports + _request->setProtocol(_protocol); + + LOG(TRACE) << "server port " << _connectionInfo.serverPort + << ", client port " << _connectionInfo.clientPort; + + // set body start to current position + _bodyPosition = _readPosition; + _bodyLength = 0; + + // keep track of the original value of the "origin" request header (if + // any), we need this value to handle CORS requests + _origin = _request->header(StaticStrings::Origin); + + if (!_origin.empty()) { + // check for Access-Control-Allow-Credentials header + bool found; + std::string const& allowCredentials = _request->header( + StaticStrings::AccessControlAllowCredentials, found); + + if (found) { + // default is to allow nothing + _denyCredentials = true; + + // if the request asks to allow credentials, we'll check against the + // configured whitelist of origins + std::vector const& accessControlAllowOrigins = + _server->trustedOrigins(); + + if (StringUtils::boolean(allowCredentials) && + !accessControlAllowOrigins.empty()) { + if (accessControlAllowOrigins[0] == "*") { + // special case: allow everything + _denyCredentials = false; + } else if (!_origin.empty()) { + // copy origin string + if (_origin[_origin.size() - 1] == '/') { + // strip trailing slash + auto result = std::find(accessControlAllowOrigins.begin(), + accessControlAllowOrigins.end(), + _origin.substr(0, _origin.size() - 1)); + _denyCredentials = (result == accessControlAllowOrigins.end()); + } else { + auto result = + std::find(accessControlAllowOrigins.begin(), + accessControlAllowOrigins.end(), _origin); + _denyCredentials = (result == accessControlAllowOrigins.end()); + } + } else { + TRI_ASSERT(_denyCredentials); + } + } + } + } + + // store the original request's type. we need it later when responding + // (original request object gets deleted before responding) + _requestType = _request->requestType(); + + requestStatisticsAgentSetRequestType(_requestType); + + // handle different HTTP methods + switch (_requestType) { + case GeneralRequest::RequestType::GET: + case GeneralRequest::RequestType::DELETE_REQ: + case GeneralRequest::RequestType::HEAD: + case GeneralRequest::RequestType::OPTIONS: + case GeneralRequest::RequestType::POST: + case GeneralRequest::RequestType::PUT: + case GeneralRequest::RequestType::PATCH: { + // technically, sending a body for an HTTP DELETE request is not + // forbidden, but it is not explicitly supported + bool const expectContentLength = + (_requestType == GeneralRequest::RequestType::POST || + _requestType == GeneralRequest::RequestType::PUT || + _requestType == GeneralRequest::RequestType::PATCH || + _requestType == GeneralRequest::RequestType::OPTIONS || + _requestType == GeneralRequest::RequestType::DELETE_REQ); + + if (!checkContentLength(expectContentLength)) { + return false; + } + + if (_bodyLength == 0) { + handleRequest = true; + } + + break; + } + + default: { + size_t l = _readPosition - _startPosition; + + if (6 < l) { + l = 6; + } + + LOG(WARN) << "got corrupted HTTP request '" + << std::string(_readBuffer->c_str() + _startPosition, l) + << "'"; + + // force a socket close, response will be ignored! + TRI_CLOSE_SOCKET(_commSocket); + TRI_invalidatesocket(&_commSocket); + + // bad request, method not allowed + handleSimpleError(GeneralResponse::ResponseCode::METHOD_NOT_ALLOWED); + return false; + } + } + + // ............................................................................. + // check if server is active + // ............................................................................. + + Scheduler const* scheduler = SchedulerFeature::SCHEDULER; + + if (scheduler != nullptr && !scheduler->isActive()) { + // server is inactive and will intentionally respond with HTTP 503 + LOG(TRACE) << "cannot serve request - server is inactive"; + + handleSimpleError(GeneralResponse::ResponseCode::SERVICE_UNAVAILABLE); + return false; + } + + // check for a 100-continue + if (_readRequestBody) { + bool found; + std::string const& expect = + _request->header(StaticStrings::Expect, found); + + if (found && StringUtils::trim(expect) == "100-continue") { + LOG(TRACE) << "received a 100-continue request"; + + auto buffer = std::make_unique(TRI_UNKNOWN_MEM_ZONE); + buffer->appendText( + TRI_CHAR_LENGTH_PAIR("HTTP/1.1 100 (Continue)\r\n\r\n")); + buffer->ensureNullTerminated(); + + _writeBuffers.push_back(buffer.get()); + buffer.release(); + + _writeBuffersStats.push_back(nullptr); + + fillWriteBuffer(); + } + } + } else { + size_t l = (_readBuffer->end() - _readBuffer->c_str()); + + if (_startPosition + 4 <= l) { + _readPosition = l - 4; + } + } + } + + // readRequestBody might have changed, so cannot use else + if (_readRequestBody) { + if (_readBuffer->length() - _bodyPosition < _bodyLength) { + setKeepAliveTimeout(_keepAliveTimeout); + + // let client send more + return false; + } + + // read "bodyLength" from read buffer and add this body to "httpRequest" + _requestAsHttp()->setBody(_readBuffer->c_str() + _bodyPosition, + _bodyLength); + + LOG(TRACE) << "" << std::string(_readBuffer->c_str() + _bodyPosition, + _bodyLength); + + // remove body from read buffer and reset read position + _readRequestBody = false; + handleRequest = true; + } + + // ............................................................................. + // request complete + // + // we have to delete request in here or pass it to a handler, which will + // delete + // it + // ............................................................................. + + if (!handleRequest) { + return false; + } + + requestStatisticsAgentSetReadEnd(); + requestStatisticsAgentAddReceivedBytes(_bodyPosition - _startPosition + + _bodyLength); + + bool const isOptionsRequest = + (_requestType == GeneralRequest::RequestType::OPTIONS); + resetState(false); + + // ............................................................................. + // keep-alive handling + // ............................................................................. + + std::string connectionType = + StringUtils::tolower(_request->header(StaticStrings::Connection)); + + if (connectionType == "close") { + // client has sent an explicit "Connection: Close" header. we should close + // the connection + LOG(DEBUG) << "connection close requested by client"; + _closeRequested = true; + } else if (_requestAsHttp()->isHttp10() && connectionType != "keep-alive") { + // HTTP 1.0 request, and no "Connection: Keep-Alive" header sent + // we should close the connection + LOG(DEBUG) << "no keep-alive, connection close requested by client"; + _closeRequested = true; + } else if (_keepAliveTimeout <= 0.0) { + // if keepAliveTimeout was set to 0.0, we'll close even keep-alive + // connections immediately + LOG(DEBUG) << "keep-alive disabled by admin"; + _closeRequested = true; + } + + // we keep the connection open in all other cases (HTTP 1.1 or Keep-Alive + // header sent) + + // ............................................................................. + // authenticate + // ............................................................................. + + GeneralResponse::ResponseCode authResult = authenticateRequest(); + + // authenticated or an OPTIONS request. OPTIONS requests currently go + // unauthenticated + if (authResult == GeneralResponse::ResponseCode::OK || isOptionsRequest) { + // handle HTTP OPTIONS requests directly + if (isOptionsRequest) { + processCorsOptions(); + } else { + processRequest(); + } + } + // not found + else if (authResult == GeneralResponse::ResponseCode::NOT_FOUND) { + handleSimpleError(authResult, TRI_ERROR_ARANGO_DATABASE_NOT_FOUND, + TRI_errno_string(TRI_ERROR_ARANGO_DATABASE_NOT_FOUND)); + } + // forbidden + else if (authResult == GeneralResponse::ResponseCode::FORBIDDEN) { + handleSimpleError(authResult, TRI_ERROR_USER_CHANGE_PASSWORD, + "change password"); + } + // not authenticated + else { + HttpResponse response(GeneralResponse::ResponseCode::UNAUTHORIZED); + std::string realm = "Bearer token_type=\"JWT\", realm=\"ArangoDB\""; + + response.setHeaderNC(StaticStrings::WwwAuthenticate, std::move(realm)); + + clearRequest(); + handleResponse(&response); + } + + return true; +} // processsRead + +//////////////////////////////////////////////////////////////////////////////// +/// @brief processes a request +//////////////////////////////////////////////////////////////////////////////// + +void HttpCommTask::processRequest() { + // check for deflate + bool found; + + auto httpRequest = _requestAsHttp(); + std::string const& acceptEncoding = + httpRequest->header(StaticStrings::AcceptEncoding, found); + + if (found) { + if (acceptEncoding.find("deflate") != std::string::npos) { + _acceptDeflate = true; + } + } + + if (httpRequest != nullptr) { + LOG_TOPIC(DEBUG, Logger::REQUESTS) + << "\"http-request-begin\",\"" << (void*)this << "\",\"" + << _connectionInfo.clientAddress << "\",\"" + << HttpRequest::translateMethod(_requestType) << "\",\"" + << HttpRequest::translateVersion(_protocolVersion) << "\"," << _fullUrl + << "\""; + + std::string const& body = httpRequest->body(); + + if (!body.empty()) { + LOG_TOPIC(DEBUG, Logger::REQUESTS) + << "\"http-request-body\",\"" << (void*)this << "\",\"" + << (StringUtils::escapeUnicode(body)) << "\""; + } + } + + // check for an HLC time stamp + std::string const& timeStamp = + _request->header(StaticStrings::HLCHeader, found); + if (found) { + uint64_t timeStampInt = + arangodb::basics::HybridLogicalClock::decodeTimeStampWithCheck( + timeStamp); + if (timeStampInt != 0) { + TRI_HybridLogicalClock(timeStampInt); + } + } + + // check for an async request + std::string const& asyncExecution = + _request->header(StaticStrings::Async, found); + + // create handler, this will take over the request and the response + std::unique_ptr response( + new HttpResponse(GeneralResponse::ResponseCode::SERVER_ERROR)); + + // execute response + WorkItem::uptr handler( + GeneralServerFeature::HANDLER_FACTORY->createHandler(_request, + response.get())); + + // ab hier generell + if (handler == nullptr) { + LOG(TRACE) << "no handler is known, giving up"; + + clearRequest(); + + handleSimpleError(GeneralResponse::ResponseCode::NOT_FOUND); + return; + } + + response.release(); + + if (_request != nullptr) { + bool found; + std::string const& startThread = + _request->header(StaticStrings::StartThread, found); + + if (found) { + _startThread = StringUtils::boolean(startThread); + } + } + + handler->setTaskId(_taskId, _loop); + + // clear request object + _request = nullptr; + + // async execution + bool ok = false; + + if (found && (asyncExecution == "true" || asyncExecution == "store")) { + requestStatisticsAgentSetAsync(); + uint64_t jobId = 0; + + if (asyncExecution == "store") { + // persist the responses + ok = _server->handleRequestAsync(this, handler, &jobId); + } else { + // don't persist the responses + ok = _server->handleRequestAsync(this, handler, nullptr); + } + + if (ok) { + HttpResponse response(GeneralResponse::ResponseCode::ACCEPTED); + + if (jobId > 0) { + // return the job id we just created + response.setHeaderNC(StaticStrings::AsyncId, StringUtils::itoa(jobId)); + } + + handleResponse(&response); + + return; + } + } + + // synchronous request + else { + ok = _server->handleRequest(this, handler); + } + + if (!ok) { + handleSimpleError(GeneralResponse::ResponseCode::SERVER_ERROR); + } +} // processRequest + +//////////////////////////////////////////////////////////////////////////////// +/// @brief chunking is finished +//////////////////////////////////////////////////////////////////////////////// + +void HttpCommTask::finishedChunked() { + auto buffer = std::make_unique(TRI_UNKNOWN_MEM_ZONE, 6, true); + buffer->appendText(TRI_CHAR_LENGTH_PAIR("0\r\n\r\n")); + buffer->ensureNullTerminated(); + + _writeBuffers.push_back(buffer.get()); + buffer.release(); + _writeBuffersStats.push_back(nullptr); + + _isChunked = false; + _startThread = false; + _requestPending = false; + + fillWriteBuffer(); + processRead(); +} + +//////////////////////////////////////////////////////////////////////////////// +/// check the content-length header of a request and fail it is broken +//////////////////////////////////////////////////////////////////////////////// + +bool HttpCommTask::checkContentLength(bool expectContentLength) { + int64_t const bodyLength = _request->contentLength(); + + if (bodyLength < 0) { + // bad request, body length is < 0. this is a client error + handleSimpleError(GeneralResponse::ResponseCode::LENGTH_REQUIRED); + return false; + } + + if (!expectContentLength && bodyLength > 0) { + // content-length header was sent but the request method does not support + // that + // we'll warn but read the body anyway + LOG(WARN) << "received HTTP GET/HEAD request with content-length, this " + "should not happen"; + } + + if ((size_t)bodyLength > MaximalBodySize) { + LOG(WARN) << "maximal body size is " << MaximalBodySize + << ", request body size is " << bodyLength; + + // request entity too large + handleSimpleError(GeneralResponse::ResponseCode::REQUEST_ENTITY_TOO_LARGE); + return false; + } + + // set instance variable to content-length value + _bodyLength = (size_t)bodyLength; + _originalBodyLength = _bodyLength; + + if (_bodyLength > 0) { + // we'll read the body + _readRequestBody = true; + } + + // everything's fine + return true; +} + +void HttpCommTask::fillWriteBuffer() { + if (!hasWriteBuffer() && !_writeBuffers.empty()) { + StringBuffer* buffer = _writeBuffers.front(); + _writeBuffers.pop_front(); + + TRI_ASSERT(buffer != nullptr); + + TRI_request_statistics_t* statistics = _writeBuffersStats.front(); + _writeBuffersStats.pop_front(); + + setWriteBuffer(buffer, statistics); + } +} + +void HttpCommTask::processCorsOptions() { + HttpResponse response(GeneralResponse::ResponseCode::OK); + + response.setHeaderNC(StaticStrings::Allow, StaticStrings::CorsMethods); + + if (!_origin.empty()) { + LOG(TRACE) << "got CORS preflight request"; + std::string const allowHeaders = StringUtils::trim( + _request->header(StaticStrings::AccessControlRequestHeaders)); + + // send back which HTTP methods are allowed for the resource + // we'll allow all + response.setHeaderNC(StaticStrings::AccessControlAllowMethods, + StaticStrings::CorsMethods); + + if (!allowHeaders.empty()) { + // allow all extra headers the client requested + // we don't verify them here. the worst that can happen is that the client + // sends some broken headers and then later cannot access the data on the + // server. that's a client problem. + response.setHeaderNC(StaticStrings::AccessControlAllowHeaders, + allowHeaders); + + LOG(TRACE) << "client requested validation of the following headers: " + << allowHeaders; + } + + // set caching time (hard-coded value) + response.setHeaderNC(StaticStrings::AccessControlMaxAge, + StaticStrings::N1800); + } + clearRequest(); + handleResponse(&response); +} + +void HttpCommTask::signalTask(TaskData* data) { + // data response + if (data->_type == TaskData::TASK_DATA_RESPONSE) { + data->RequestStatisticsAgent::transferTo(this); + + HttpResponse* response = dynamic_cast(data->_response.get()); + + if (response != nullptr) { + handleResponse(response); + processRead(); + } else { + handleSimpleError(GeneralResponse::ResponseCode::SERVER_ERROR); + } + } + + // data response + else if (data->_type == TaskData::TASK_DATA_BUFFER) { + data->RequestStatisticsAgent::transferTo(this); + HttpResponse response(GeneralResponse::ResponseCode::OK); + velocypack::Slice slice(data->_buffer->data()); + response.setPayload(_request, slice, true, VPackOptions::Defaults); + handleResponse(&response); + processRead(); + } + + // data chunk + else if (data->_type == TaskData::TASK_DATA_CHUNK) { + size_t len = data->_data.size(); + + if (0 == len) { + finishedChunked(); + } else { + StringBuffer* buffer = new StringBuffer(TRI_UNKNOWN_MEM_ZONE, len); + + buffer->appendHex(len); + buffer->appendText(TRI_CHAR_LENGTH_PAIR("\r\n")); + buffer->appendText(data->_data.c_str(), len); + buffer->appendText(TRI_CHAR_LENGTH_PAIR("\r\n")); + + sendChunk(buffer); + } + } + + // do not know, what to do - give up + else { + _scheduler->destroyTask(this); + } +} + +bool HttpCommTask::handleRead() { + bool res = true; + + if (!_closeRequested) { + res = fillReadBuffer(); + // process as much data as we got + while (processRead()) { + if (_closeRequested) { + break; + } + } + } else { + // if we don't close here, the scheduler thread may fall into a + // busy wait state, consuming 100% CPU! + _clientClosed = true; + } + + if (_clientClosed) { + res = false; + } else if (!res) { + _clientClosed = true; + } + + return res; +} + +void HttpCommTask::completedWriteBuffer() { + _writeBuffer = nullptr; + _writeLength = 0; + + if (_writeBufferStatistics != nullptr) { + _writeBufferStatistics->_writeEnd = TRI_StatisticsTime(); + TRI_ReleaseRequestStatistics(_writeBufferStatistics); + _writeBufferStatistics = nullptr; + } + + fillWriteBuffer(); + + if (!_clientClosed && _closeRequested && !hasWriteBuffer() && + _writeBuffers.empty() && !_isChunked) { + _clientClosed = true; + } +} + +void HttpCommTask::resetState(bool close) { + if (close) { + clearRequest(); + + _requestPending = false; + _isChunked = false; + _closeRequested = true; + + _readPosition = 0; + _bodyPosition = 0; + _bodyLength = 0; + } else { + _requestPending = true; + + bool compact = false; + + if (_sinceCompactification > RunCompactEvery) { + compact = true; + } else if (_readBuffer->length() > MaximalPipelineSize) { + compact = true; + } + + if (compact) { + _readBuffer->erase_front(_bodyPosition + _bodyLength); + + _sinceCompactification = 0; + _readPosition = 0; + } else { + _readPosition = _bodyPosition + _bodyLength; + + if (_readPosition == _readBuffer->length()) { + _sinceCompactification = 0; + _readPosition = 0; + _readBuffer->reset(); + } + } + + _bodyPosition = 0; + _bodyLength = 0; + } + + _newRequest = true; + _readRequestBody = false; + _startThread = false; +} + +GeneralResponse::ResponseCode HttpCommTask::authenticateRequest() { + auto context = (_request == nullptr) ? nullptr : _request->requestContext(); + + if (context == nullptr && _request != nullptr) { + bool res = GeneralServerFeature::HANDLER_FACTORY->setRequestContext(_request); + + if (!res) { + return GeneralResponse::ResponseCode::NOT_FOUND; + } + + context = _request->requestContext(); + } + + if (context == nullptr) { + return GeneralResponse::ResponseCode::SERVER_ERROR; + } + + return context->authenticate(); +} + +void HttpCommTask::sendChunk(StringBuffer* buffer) { + if (_isChunked) { + TRI_ASSERT(buffer != nullptr); + _writeBuffers.push_back(buffer); + _writeBuffersStats.push_back(nullptr); + fillWriteBuffer(); + } else { + delete buffer; + } +} + +// convert internal GeneralRequest to HttpRequest +HttpRequest* HttpCommTask::_requestAsHttp() { + HttpRequest* request = dynamic_cast(_request); + if (request == nullptr) { + // everything is borken FIXME + } + return request; +}; +} // rest +} // arangodb diff --git a/arangod/GeneralServer/HttpCommTask.h b/arangod/GeneralServer/HttpCommTask.h index e3e34d7e51..182af94921 100644 --- a/arangod/GeneralServer/HttpCommTask.h +++ b/arangod/GeneralServer/HttpCommTask.h @@ -7,12 +7,72 @@ namespace rest { class HttpCommTask : public GeneralCommTask { public: - HttpCommTask(GeneralServer* serv, TRI_socket_t sock, ConnectionInfo&& info, - double timeout) - : Task("HttpCommTask"), - GeneralCommTask(serv, sock, std::move(info), timeout) { - _protocol = "http"; - } + static size_t const MaximalHeaderSize; + static size_t const MaximalBodySize; + static size_t const MaximalPipelineSize; + static size_t const RunCompactEvery; + + public: + HttpCommTask(GeneralServer*, TRI_socket_t, ConnectionInfo&&, double timeout); + + bool processRead() override; + virtual void processRequest() override; + + void addResponse(GeneralResponse* response) override { + // convert from GeneralResponse to httpResponse ad dispatch request to class + // internal addResponse + HttpResponse* httpResponse = dynamic_cast(response); + if (httpResponse == nullptr) { + // everything is borken + } + addResponse(httpResponse); + }; + + protected: + void completedWriteBuffer() override final; + + private: + void signalTask(TaskData*) override final; + // resets the internal state + // this method can be called to clean up when the request handling aborts + // prematurely + virtual void resetState(bool close) override final; + + HttpRequest* _requestAsHttp(); + void addResponse(HttpResponse*); + void finishedChunked(); + // check the content-length header of a request and fail it is broken + bool checkContentLength(bool expectContentLength); + void fillWriteBuffer(); // fills the write buffer + void processCorsOptions(); // handles CORS options + std::string authenticationRealm() const; // returns the authentication realm + GeneralResponse::ResponseCode + authenticateRequest(); // checks the authentication + void sendChunk(basics::StringBuffer*); // sends more chunked data + bool handleRead() override final; + + private: + size_t _readPosition; // current read position + size_t _startPosition; // start position of current request + size_t _bodyPosition; // start of the body position + size_t _bodyLength; // body length + bool _closeRequested; // true if a close has been requested by the client + bool _readRequestBody; // true if reading the request body + bool _allowMethodOverride; // allow method override + bool _denyCredentials; // whether or not to allow credentialed requests (only + // CORS) + bool _acceptDeflate; // whether the client accepts deflate algorithm + bool _newRequest; // new request started + GeneralRequest::RequestType _requestType; // type of request (GET, POST, ...) + std::string _fullUrl; // value of requested URL + std::string _origin; // value of the HTTP origin header the client sent (if + // any, CORS only) + size_t + _sinceCompactification; // number of requests since last compactification + size_t _originalBodyLength; + + // authentication real + std::string const _authenticationRealm; }; } // rest } // arangodb diff --git a/arangod/GeneralServer/HttpServerJob.cpp b/arangod/GeneralServer/HttpServerJob.cpp index 4dcc1151f7..146aa4b886 100644 --- a/arangod/GeneralServer/HttpServerJob.cpp +++ b/arangod/GeneralServer/HttpServerJob.cpp @@ -29,9 +29,9 @@ #include "GeneralServer/AsyncJobManager.h" #include "GeneralServer/GeneralCommTask.h" #include "GeneralServer/GeneralServer.h" +#include "GeneralServer/GeneralServerFeature.h" #include "GeneralServer/RestHandler.h" #include "Logger/Logger.h" -#include "RestServer/RestServerFeature.h" #include "Scheduler/Scheduler.h" #include "Scheduler/SchedulerFeature.h" @@ -81,8 +81,8 @@ void HttpServerJob::work() { if (_isAsync) { _handler->RequestStatisticsAgent::release(); - RestServerFeature::JOB_MANAGER->finishAsyncJob(_jobId, - _handler->stealResponse()); + GeneralServerFeature::JOB_MANAGER->finishAsyncJob( + _jobId, _handler->stealResponse()); } else { auto data = std::make_unique(); diff --git a/arangod/GeneralServer/HttpsCommTask.cpp b/arangod/GeneralServer/HttpsCommTask.cpp index 1c55c2d42d..b14425d66a 100644 --- a/arangod/GeneralServer/HttpsCommTask.cpp +++ b/arangod/GeneralServer/HttpsCommTask.cpp @@ -20,6 +20,7 @@ /// /// @author Dr. Frank Celler /// @author Achim Brandt +// @author Jan Christoph Uhde //////////////////////////////////////////////////////////////////////////////// #include "HttpsCommTask.h" @@ -35,10 +36,6 @@ using namespace arangodb; using namespace arangodb::rest; -//////////////////////////////////////////////////////////////////////////////// -/// @brief constructs a new task with a given socket -//////////////////////////////////////////////////////////////////////////////// - HttpsCommTask::HttpsCommTask(GeneralServer* server, TRI_socket_t socket, ConnectionInfo&& info, double keepAliveTimeout, SSL_CTX* ctx, int verificationMode, @@ -56,10 +53,6 @@ HttpsCommTask::HttpsCommTask(GeneralServer* server, TRI_socket_t socket, _tmpReadBuffer = new char[READ_BLOCK_SIZE]; } -//////////////////////////////////////////////////////////////////////////////// -/// @brief destructs a task -//////////////////////////////////////////////////////////////////////////////// - HttpsCommTask::~HttpsCommTask() { shutdownSsl(true); @@ -118,7 +111,6 @@ bool HttpsCommTask::handleEvent(EventToken token, EventType revents) { // status is somehow invalid. we got here even though no accept was ever // successful _clientClosed = true; - _server->handleCommunicationFailure(this); _scheduler->destroyTask(this); } diff --git a/arangod/GeneralServer/HttpsCommTask.h b/arangod/GeneralServer/HttpsCommTask.h index f11d390999..925a88adf4 100644 --- a/arangod/GeneralServer/HttpsCommTask.h +++ b/arangod/GeneralServer/HttpsCommTask.h @@ -20,6 +20,7 @@ /// /// @author Dr. Frank Celler /// @author Achim Brandt +// @author Jan Christoph Uhde //////////////////////////////////////////////////////////////////////////////// #ifndef ARANGOD_HTTP_SERVER_HTTPS_COMM_TASK_H @@ -33,121 +34,44 @@ namespace arangodb { namespace rest { class GeneralServer; -//////////////////////////////////////////////////////////////////////////////// -/// @brief https communication -//////////////////////////////////////////////////////////////////////////////// - class HttpsCommTask : public HttpCommTask { HttpsCommTask(HttpsCommTask const&) = delete; HttpsCommTask const& operator=(HttpsCommTask const&) = delete; private: - ////////////////////////////////////////////////////////////////////////////// - /// @brief read block size - ////////////////////////////////////////////////////////////////////////////// - static size_t const READ_BLOCK_SIZE = 10000; public: - ////////////////////////////////////////////////////////////////////////////// - /// @brief constructs a new task with a given socket - ////////////////////////////////////////////////////////////////////////////// - HttpsCommTask(GeneralServer*, TRI_socket_t, ConnectionInfo&&, double keepAliveTimeout, SSL_CTX* ctx, int verificationMode, int (*verificationCallback)(int, X509_STORE_CTX*)); - ////////////////////////////////////////////////////////////////////////////// - /// @brief destructs a task - ////////////////////////////////////////////////////////////////////////////// - protected: ~HttpsCommTask(); protected: bool setup(Scheduler*, EventLoop) override; - bool handleEvent(EventToken, EventType) override; - bool fillReadBuffer() override; - bool handleWrite() override; private: - ////////////////////////////////////////////////////////////////////////////// - /// @brief accepts SSL connection - ////////////////////////////////////////////////////////////////////////////// - bool trySSLAccept(); - - ////////////////////////////////////////////////////////////////////////////// - /// @brief reads from SSL connection - ////////////////////////////////////////////////////////////////////////////// - bool trySSLRead(); - - ////////////////////////////////////////////////////////////////////////////// - /// @brief writes from SSL connection - ////////////////////////////////////////////////////////////////////////////// - bool trySSLWrite(); - - ////////////////////////////////////////////////////////////////////////////// - /// @brief shuts down the SSL connection - ////////////////////////////////////////////////////////////////////////////// - void shutdownSsl(bool initShutdown); private: - ////////////////////////////////////////////////////////////////////////////// - /// @brief accepted done - ////////////////////////////////////////////////////////////////////////////// - bool _accepted; - - ////////////////////////////////////////////////////////////////////////////// - /// @brief read blocked on write - ////////////////////////////////////////////////////////////////////////////// - bool _readBlockedOnWrite; - - ////////////////////////////////////////////////////////////////////////////// - /// @brief write blocked on read - ////////////////////////////////////////////////////////////////////////////// - bool _writeBlockedOnRead; - - ////////////////////////////////////////////////////////////////////////////// - /// @brief temporary buffer - ////////////////////////////////////////////////////////////////////////////// - char* _tmpReadBuffer; - - ////////////////////////////////////////////////////////////////////////////// - /// @brief ssl - ////////////////////////////////////////////////////////////////////////////// - SSL* _ssl; - - ////////////////////////////////////////////////////////////////////////////// - /// @brief context - ////////////////////////////////////////////////////////////////////////////// - SSL_CTX* _ctx; - - ////////////////////////////////////////////////////////////////////////////// - /// @brief verification mode - ////////////////////////////////////////////////////////////////////////////// - int _verificationMode; - - ////////////////////////////////////////////////////////////////////////////// - /// @brief verification callback - ////////////////////////////////////////////////////////////////////////////// - int (*_verificationCallback)(int, X509_STORE_CTX*); }; -} -} +} // rest +} // arango #endif diff --git a/arangod/GeneralServer/VppCommTask.cpp b/arangod/GeneralServer/VppCommTask.cpp new file mode 100644 index 0000000000..e69de29bb2 diff --git a/arangod/GeneralServer/VppCommTask.h b/arangod/GeneralServer/VppCommTask.h new file mode 100644 index 0000000000..e69de29bb2 diff --git a/arangod/GeneralServer/VppsCommTask.cpp b/arangod/GeneralServer/VppsCommTask.cpp new file mode 100644 index 0000000000..e69de29bb2 diff --git a/arangod/GeneralServer/VppsCommTask.h b/arangod/GeneralServer/VppsCommTask.h new file mode 100644 index 0000000000..e69de29bb2 diff --git a/arangod/RestHandler/RestAuthHandler.cpp b/arangod/RestHandler/RestAuthHandler.cpp index 60eb0587ac..e7067e84c1 100644 --- a/arangod/RestHandler/RestAuthHandler.cpp +++ b/arangod/RestHandler/RestAuthHandler.cpp @@ -27,9 +27,9 @@ #include #include "Basics/StringUtils.h" +#include "GeneralServer/GeneralServerFeature.h" #include "Logger/Logger.h" #include "Rest/HttpRequest.h" -#include "RestServer/RestServerFeature.h" #include "Ssl/SslInterface.h" #include "VocBase/AuthInfo.h" @@ -111,7 +111,7 @@ RestHandler::status RestAuthHandler::execute() { std::string const password = passwordSlice.copyString(); AuthResult auth = - RestServerFeature::AUTH_INFO.checkPassword(username, password); + GeneralServerFeature::AUTH_INFO.checkPassword(username, password); if (auth._authorized) { VPackBuilder resultBuilder; diff --git a/arangod/RestHandler/RestBatchHandler.cpp b/arangod/RestHandler/RestBatchHandler.cpp index b6c38eeaf6..0526a459f0 100644 --- a/arangod/RestHandler/RestBatchHandler.cpp +++ b/arangod/RestHandler/RestBatchHandler.cpp @@ -25,11 +25,11 @@ #include "Basics/StaticStrings.h" #include "Basics/StringUtils.h" -#include "Logger/Logger.h" #include "GeneralServer/GeneralServer.h" +#include "GeneralServer/GeneralServerFeature.h" #include "GeneralServer/RestHandlerFactory.h" +#include "Logger/Logger.h" #include "Rest/HttpRequest.h" -#include "RestServer/RestServerFeature.h" using namespace arangodb; using namespace arangodb::basics; @@ -176,7 +176,7 @@ RestHandler::status RestBatchHandler::execute() { { std::unique_ptr response( new HttpResponse(GeneralResponse::ResponseCode::SERVER_ERROR)); - handler = RestServerFeature::HANDLER_FACTORY->createHandler( + handler = GeneralServerFeature::HANDLER_FACTORY->createHandler( request, response.get()); if (handler == nullptr) { diff --git a/arangod/RestServer/BootstrapFeature.cpp b/arangod/RestServer/BootstrapFeature.cpp index bca28eb5d8..4ba7f7c902 100644 --- a/arangod/RestServer/BootstrapFeature.cpp +++ b/arangod/RestServer/BootstrapFeature.cpp @@ -52,7 +52,7 @@ BootstrapFeature::BootstrapFeature( startsAfter("Upgrade"); startsAfter("CheckVersion"); startsAfter("FoxxQueues"); - startsAfter("RestServer"); + startsAfter("GeneralServer"); } void BootstrapFeature::collectOptions(std::shared_ptr options) { diff --git a/arangod/RestServer/ConsoleFeature.cpp b/arangod/RestServer/ConsoleFeature.cpp index c2dc522a6b..e18854bc05 100644 --- a/arangod/RestServer/ConsoleFeature.cpp +++ b/arangod/RestServer/ConsoleFeature.cpp @@ -38,7 +38,7 @@ ConsoleFeature::ConsoleFeature(application_features::ApplicationServer* server) _operationMode(OperationMode::MODE_SERVER), _consoleThread(nullptr) { startsAfter("Server"); - startsAfter("RestServer"); + startsAfter("GeneralServer"); startsAfter("Bootstrap"); } diff --git a/arangod/RestServer/DatabaseFeature.cpp b/arangod/RestServer/DatabaseFeature.cpp index 19c6d2a2d4..856ec41161 100644 --- a/arangod/RestServer/DatabaseFeature.cpp +++ b/arangod/RestServer/DatabaseFeature.cpp @@ -31,13 +31,13 @@ #include "Basics/files.h" #include "Cluster/ServerState.h" #include "Cluster/v8-cluster.h" +#include "GeneralServer/GeneralServerFeature.h" #include "Logger/Logger.h" #include "ProgramOptions/ProgramOptions.h" #include "ProgramOptions/Section.h" #include "RestServer/DatabaseFeature.h" #include "RestServer/DatabasePathFeature.h" #include "RestServer/QueryRegistryFeature.h" -#include "RestServer/RestServerFeature.h" #include "StorageEngine/EngineSelectorFeature.h" #include "StorageEngine/StorageEngine.h" #include "Utils/CursorRepository.h" diff --git a/arangod/RestServer/ScriptFeature.cpp b/arangod/RestServer/ScriptFeature.cpp index 31192e9448..54b3037622 100644 --- a/arangod/RestServer/ScriptFeature.cpp +++ b/arangod/RestServer/ScriptFeature.cpp @@ -43,7 +43,7 @@ ScriptFeature::ScriptFeature(application_features::ApplicationServer* server, in _result(result) { startsAfter("Nonce"); startsAfter("Server"); - startsAfter("RestServer"); + startsAfter("GeneralServer"); } void ScriptFeature::collectOptions(std::shared_ptr options) { diff --git a/arangod/RestServer/ServerFeature.cpp b/arangod/RestServer/ServerFeature.cpp index 7f9ec1482d..0dd1debd90 100644 --- a/arangod/RestServer/ServerFeature.cpp +++ b/arangod/RestServer/ServerFeature.cpp @@ -84,7 +84,6 @@ void ServerFeature::collectOptions(std::shared_ptr options) { options->addOption("--javascript.script", "run scripts and exit", new VectorParameter(&_scripts)); - } void ServerFeature::validateOptions(std::shared_ptr) { @@ -119,19 +118,19 @@ void ServerFeature::validateOptions(std::shared_ptr) { if (!_restServer) { ApplicationServer::disableFeatures({"Daemon", "Dispatcher", "Endpoint", - "RestServer", "Scheduler", "SslServer", - "Supervisor"}); + "GeneralServer", "Scheduler", + "SslServer", "Supervisor"}); - DatabaseFeature* database = + DatabaseFeature* database = ApplicationServer::getFeature("Database"); database->disableReplicationApplier(); - StatisticsFeature* statistics = + StatisticsFeature* statistics = ApplicationServer::getFeature("Statistics"); statistics->disableStatistics(); } - V8DealerFeature* v8dealer = + V8DealerFeature* v8dealer = ApplicationServer::getFeature("V8Dealer"); if (_operationMode == OperationMode::MODE_SCRIPT || @@ -154,7 +153,7 @@ void ServerFeature::validateOptions(std::shared_ptr) { void ServerFeature::start() { if (_operationMode != OperationMode::MODE_CONSOLE && _restServer) { - auto scheduler = + auto scheduler = ApplicationServer::getFeature("Scheduler"); scheduler->buildControlCHandler(); @@ -166,9 +165,9 @@ void ServerFeature::start() { // flush all log output before we go on... this is sensible because any // of the following options may print or prompt, and pending log entries - // might overwrite that + // might overwrite that Logger::flush(); - + switch (_operationMode) { case OperationMode::MODE_UNITTESTS: case OperationMode::MODE_SCRIPT: @@ -200,18 +199,18 @@ void ServerFeature::waitForHeartbeat() { usleep(100 * 1000); } } - + std::string ServerFeature::operationModeString(OperationMode mode) { switch (mode) { - case OperationMode::MODE_CONSOLE: + case OperationMode::MODE_CONSOLE: return "console"; - case OperationMode::MODE_UNITTESTS: + case OperationMode::MODE_UNITTESTS: return "unittests"; - case OperationMode::MODE_SCRIPT: + case OperationMode::MODE_SCRIPT: return "script"; - case OperationMode::MODE_SERVER: + case OperationMode::MODE_SERVER: return "server"; - default: + default: return "unknown"; } } diff --git a/arangod/RestServer/UnitTestsFeature.cpp b/arangod/RestServer/UnitTestsFeature.cpp index 78fd599533..d831334494 100644 --- a/arangod/RestServer/UnitTestsFeature.cpp +++ b/arangod/RestServer/UnitTestsFeature.cpp @@ -43,7 +43,7 @@ UnitTestsFeature::UnitTestsFeature(application_features::ApplicationServer* serv _result(result) { startsAfter("Nonce"); startsAfter("Server"); - startsAfter("RestServer"); + startsAfter("GeneralServer"); startsAfter("Bootstrap"); } diff --git a/arangod/RestServer/VocbaseContext.cpp b/arangod/RestServer/VocbaseContext.cpp index 2eb2ff73c7..104d48ad27 100644 --- a/arangod/RestServer/VocbaseContext.cpp +++ b/arangod/RestServer/VocbaseContext.cpp @@ -32,8 +32,8 @@ #include "Basics/tri-strings.h" #include "Cluster/ServerState.h" #include "Endpoint/ConnectionInfo.h" +#include "GeneralServer/GeneralServerFeature.h" #include "Logger/Logger.h" -#include "RestServer/RestServerFeature.h" #include "Ssl/SslInterface.h" #include "VocBase/AuthInfo.h" #include "VocBase/server.h" @@ -83,7 +83,7 @@ bool VocbaseContext::useClusterAuthentication() const { GeneralResponse::ResponseCode VocbaseContext::authenticate() { TRI_ASSERT(_vocbase != nullptr); - auto restServer = application_features::ApplicationServer::getFeature("RestServer"); + auto restServer = application_features::ApplicationServer::getFeature("GeneralServer"); if (!restServer->authentication()) { // no authentication required at all @@ -115,7 +115,7 @@ GeneralResponse::ResponseCode VocbaseContext::authenticate() { if (!username.empty() || !dbname.empty()) { AuthLevel level = - RestServerFeature::AUTH_INFO.canUseDatabase(username, dbname); + GeneralServerFeature::AUTH_INFO.canUseDatabase(username, dbname); if (level != AuthLevel::RW) { result = GeneralResponse::ResponseCode::UNAUTHORIZED; @@ -130,7 +130,7 @@ GeneralResponse::ResponseCode VocbaseContext::authenticate() { GeneralResponse::ResponseCode VocbaseContext::authenticateRequest( bool* forceOpen) { - auto restServer = application_features::ApplicationServer::getFeature("RestServer"); + auto restServer = application_features::ApplicationServer::getFeature("GeneralServer"); #ifdef ARANGODB_HAVE_DOMAIN_SOCKETS // check if we need to run authentication for this type of // endpoint @@ -225,7 +225,7 @@ GeneralResponse::ResponseCode VocbaseContext::basicAuthentication( return GeneralResponse::ResponseCode::OK; } - AuthResult result = RestServerFeature::AUTH_INFO.checkAuthentication( + AuthResult result = GeneralServerFeature::AUTH_INFO.checkAuthentication( AuthInfo::AuthType::BASIC, auth); if (!result._authorized) { @@ -254,7 +254,7 @@ GeneralResponse::ResponseCode VocbaseContext::basicAuthentication( GeneralResponse::ResponseCode VocbaseContext::jwtAuthentication( std::string const& auth) { - AuthResult result = RestServerFeature::AUTH_INFO.checkAuthentication( + AuthResult result = GeneralServerFeature::AUTH_INFO.checkAuthentication( AuthInfo::AuthType::JWT, auth); if (!result._authorized) { diff --git a/arangod/RestServer/arangod.cpp b/arangod/RestServer/arangod.cpp index 865d8bf339..87aea6f3f9 100644 --- a/arangod/RestServer/arangod.cpp +++ b/arangod/RestServer/arangod.cpp @@ -45,6 +45,7 @@ #include "Basics/ArangoGlobalContext.h" #include "Cluster/ClusterFeature.h" #include "Dispatcher/DispatcherFeature.h" +#include "GeneralServer/GeneralServerFeature.h" #include "Logger/LoggerBufferFeature.h" #include "Logger/LoggerFeature.h" #include "ProgramOptions/ProgramOptions.h" @@ -61,7 +62,6 @@ #include "RestServer/InitDatabaseFeature.h" #include "RestServer/LockfileFeature.h" #include "RestServer/QueryRegistryFeature.h" -#include "RestServer/RestServerFeature.h" #include "RestServer/ScriptFeature.h" #include "RestServer/ServerFeature.h" #include "RestServer/ServerIdFeature.h" @@ -100,18 +100,21 @@ static int runServer(int argc, char** argv) { application_features::ApplicationServer server(options); std::vector nonServerFeatures = { - "Action", "Affinity", "Agency", - "Cluster", "Daemon", "Dispatcher", - "Endpoint", "FoxxQueues", "LoggerBufferFeature", - "RestServer", "Server", "Scheduler", - "SslServer", "Statistics", "Supervisor"}; + "Action", "Affinity", + "Agency", "Cluster", + "Daemon", "Dispatcher", + "Endpoint", "FoxxQueues", + "GeneralServer", "LoggerBufferFeature", + "Server", "Scheduler", + "SslServer", "Statistics", + "Supervisor"}; int ret = EXIT_FAILURE; - + #ifdef _WIN32 server.addFeature(new WindowsServiceFeature(&server)); #endif - + server.addFeature(new ActionFeature(&server)); server.addFeature(new AffinityFeature(&server)); server.addFeature(new AgencyFeature(&server)); @@ -128,6 +131,7 @@ static int runServer(int argc, char** argv) { server.addFeature(new FileDescriptorsFeature(&server)); server.addFeature(new FoxxQueuesFeature(&server)); server.addFeature(new FrontendFeature(&server)); + server.addFeature(new GeneralServerFeature(&server)); server.addFeature(new GreetingsFeature(&server, "arangod")); server.addFeature(new IndexPoolFeature(&server)); server.addFeature(new InitDatabaseFeature(&server, nonServerFeatures)); @@ -142,7 +146,6 @@ static int runServer(int argc, char** argv) { server.addFeature(new QueryRegistryFeature(&server)); server.addFeature(new RandomFeature(&server)); server.addFeature(new RecoveryFeature(&server)); - server.addFeature(new RestServerFeature(&server)); server.addFeature(new SchedulerFeature(&server)); server.addFeature(new ScriptFeature(&server, &ret)); server.addFeature(new ServerFeature(&server, &ret)); @@ -196,12 +199,13 @@ static int runServer(int argc, char** argv) { static int ARGC; static char** ARGV; -static void WINAPI ServiceMain (DWORD dwArgc, LPSTR *lpszArgv) { +static void WINAPI ServiceMain(DWORD dwArgc, LPSTR* lpszArgv) { if (!TRI_InitWindowsEventLog()) { return; } // register the service ctrl handler, lpszArgv[0] contains service name - ServiceStatus = RegisterServiceCtrlHandlerA(lpszArgv[0], (LPHANDLER_FUNCTION) ServiceCtrl); + ServiceStatus = + RegisterServiceCtrlHandlerA(lpszArgv[0], (LPHANDLER_FUNCTION)ServiceCtrl); // set start pending SetServiceStatus(SERVICE_START_PENDING, 0, 1, 10000); @@ -220,17 +224,16 @@ int main(int argc, char* argv[]) { if (argc > 1 && TRI_EqualString("--start-service", argv[1])) { ARGC = argc; ARGV = argv; - - SERVICE_TABLE_ENTRY ste[] = {{TEXT(""), (LPSERVICE_MAIN_FUNCTION)ServiceMain}, - {nullptr, nullptr}}; - + + SERVICE_TABLE_ENTRY ste[] = { + {TEXT(""), (LPSERVICE_MAIN_FUNCTION)ServiceMain}, {nullptr, nullptr}}; + if (!StartServiceCtrlDispatcher(ste)) { std::cerr << "FATAL: StartServiceCtrlDispatcher has failed with " << GetLastError() << std::endl; exit(EXIT_FAILURE); } - } - else + } else #endif return runServer(argc, argv); } diff --git a/arangod/Scheduler/SocketTask.cpp b/arangod/Scheduler/SocketTask.cpp index 76ac11e600..db17cdbf17 100644 --- a/arangod/Scheduler/SocketTask.cpp +++ b/arangod/Scheduler/SocketTask.cpp @@ -24,9 +24,9 @@ #include "SocketTask.h" -#include "Logger/Logger.h" #include "Basics/StringBuffer.h" #include "Basics/socket-utils.h" +#include "Logger/Logger.h" #include "Scheduler/Scheduler.h" #include @@ -122,17 +122,20 @@ bool SocketTask::fillReadBuffer() { return fillReadBuffer(); } - // condition is required like this because g++ 6 will complain about + // condition is required like this because g++ 6 will complain about // if (myerrno != EWOULDBLOCK && myerrno != EAGAIN) // having two identical branches (because EWOULDBLOCK == EAGAIN on Linux). - // however, posix states that there may be systems where EWOULDBLOCK != EAGAIN... + // however, posix states that there may be systems where EWOULDBLOCK != + // EAGAIN... if (myerrno != EWOULDBLOCK && (EWOULDBLOCK == EAGAIN || myerrno != EAGAIN)) { - LOG(DEBUG) << "read from socket failed with " << myerrno << ": " << strerror(myerrno); + LOG(DEBUG) << "read from socket failed with " << myerrno << ": " + << strerror(myerrno); return false; } - TRI_ASSERT(myerrno == EWOULDBLOCK || (EWOULDBLOCK != EAGAIN && myerrno == EAGAIN)); + TRI_ASSERT(myerrno == EWOULDBLOCK || + (EWOULDBLOCK != EAGAIN && myerrno == EAGAIN)); // from man(2) read: // The file descriptor fd refers to a socket and has been marked @@ -141,7 +144,8 @@ bool SocketTask::fillReadBuffer() { // either error to be returned for this case, and does not require these // constants to have the same value, // so a portable application should check for both possibilities. - LOG(TRACE) << "read would block with " << myerrno << ": " << strerror(myerrno); + LOG(TRACE) << "read would block with " << myerrno << ": " + << strerror(myerrno); return true; } @@ -172,13 +176,16 @@ bool SocketTask::handleWrite() { return handleWrite(); } - if (myerrno != EWOULDBLOCK && (EAGAIN == EWOULDBLOCK || myerrno != EAGAIN)) { - LOG(DEBUG) << "writing to socket failed with " << myerrno << ": " << strerror(myerrno); + if (myerrno != EWOULDBLOCK && + (EAGAIN == EWOULDBLOCK || myerrno != EAGAIN)) { + LOG(DEBUG) << "writing to socket failed with " << myerrno << ": " + << strerror(myerrno); return false; } - TRI_ASSERT(myerrno == EWOULDBLOCK || (EWOULDBLOCK != EAGAIN && myerrno == EAGAIN)); + TRI_ASSERT(myerrno == EWOULDBLOCK || + (EWOULDBLOCK != EAGAIN && myerrno == EAGAIN)); nr = 0; } @@ -269,7 +276,8 @@ bool SocketTask::setup(Scheduler* scheduler, EventLoop loop) { LOG(TRACE) << "attempting to convert socket handle to socket descriptor"; if (!TRI_isvalidsocket(_commSocket)) { - LOG(ERR) << "In SocketTask::setup could not convert socket handle to socket descriptor -- invalid socket handle"; + LOG(ERR) << "In SocketTask::setup could not convert socket handle to " + "socket descriptor -- invalid socket handle"; return false; } @@ -282,12 +290,15 @@ bool SocketTask::setup(Scheduler* scheduler, EventLoop loop) { int res = (int)_commSocket.fileHandle; if (res == -1) { - LOG(ERR) << "In SocketTask::setup could not convert socket handle to socket descriptor -- _open_osfhandle(...) failed"; + LOG(ERR) << "In SocketTask::setup could not convert socket handle to " + "socket descriptor -- _open_osfhandle(...) failed"; res = TRI_CLOSE_SOCKET(_commSocket); if (res != 0) { res = WSAGetLastError(); - LOG(ERR) << "In SocketTask::setup closesocket(...) failed with error code: " << res; + LOG(ERR) + << "In SocketTask::setup closesocket(...) failed with error code: " + << res; } TRI_invalidatesocket(&_commSocket); @@ -301,11 +312,6 @@ bool SocketTask::setup(Scheduler* scheduler, EventLoop loop) { _scheduler = scheduler; _loop = loop; - _readWatcher = _scheduler->installSocketEvent(loop, EVENT_SOCKET_READ, this, - _commSocket); - _writeWatcher = _scheduler->installSocketEvent(loop, EVENT_SOCKET_WRITE, this, - _commSocket); - // install timer for keep-alive timeout with some high default value _keepAliveWatcher = _scheduler->installTimerEvent(loop, this, 60.0); @@ -314,6 +320,11 @@ bool SocketTask::setup(Scheduler* scheduler, EventLoop loop) { _tid = Thread::currentThreadId(); + _writeWatcher = _scheduler->installSocketEvent(loop, EVENT_SOCKET_WRITE, this, + _commSocket); + + _readWatcher = _scheduler->installSocketEvent(loop, EVENT_SOCKET_READ, this, + _commSocket); return true; } diff --git a/arangod/V8Server/v8-vocbase.cpp b/arangod/V8Server/v8-vocbase.cpp index 098fb18746..280c0e132c 100644 --- a/arangod/V8Server/v8-vocbase.cpp +++ b/arangod/V8Server/v8-vocbase.cpp @@ -23,9 +23,9 @@ #include "v8-vocbaseprivate.h" -#include -#include #include +#include +#include #include #include @@ -51,10 +51,10 @@ #include "Cluster/ClusterInfo.h" #include "Cluster/ClusterMethods.h" #include "Cluster/ServerState.h" +#include "GeneralServer/GeneralServerFeature.h" #include "ReadCache/GlobalRevisionCache.h" #include "Rest/Version.h" #include "RestServer/ConsoleThread.h" -#include "RestServer/RestServerFeature.h" #include "RestServer/VocbaseContext.h" #include "Statistics/StatisticsFeature.h" #include "Utils/ExplicitTransaction.h" @@ -557,8 +557,7 @@ static void JS_WaitCollectorWal( std::string const name = TRI_ObjectToString(args[0]); - TRI_vocbase_col_t* col = - TRI_LookupCollectionByNameVocBase(vocbase, name); + TRI_vocbase_col_t* col = TRI_LookupCollectionByNameVocBase(vocbase, name); if (col == nullptr) { TRI_V8_THROW_EXCEPTION(TRI_ERROR_ARANGO_COLLECTION_NOT_FOUND); @@ -944,7 +943,7 @@ static void JS_ReloadAuth(v8::FunctionCallbackInfo const& args) { TRI_V8_THROW_EXCEPTION_USAGE("RELOAD_AUTH()"); } - RestServerFeature::AUTH_INFO.outdate(); + GeneralServerFeature::AUTH_INFO.outdate(); TRI_V8_RETURN_TRUE(); TRI_V8_TRY_CATCH_END @@ -1198,7 +1197,7 @@ static void JS_ExecuteAqlJson(v8::FunctionCallbackInfo const& args) { TRI_V8_THROW_EXCEPTION(res); } } - + TRI_GET_GLOBALS(); arangodb::aql::Query query(true, vocbase, queryBuilder, options, arangodb::aql::PART_MAIN); @@ -2636,31 +2635,34 @@ static void JS_GetTimers(v8::FunctionCallbackInfo const& args) { static void JS_TrustedProxies(v8::FunctionCallbackInfo const& args) { TRI_V8_TRY_CATCH_BEGIN(isolate); - - if (RestServerFeature::hasProxyCheck()) { + + if (GeneralServerFeature::hasProxyCheck()) { v8::Handle result = v8::Array::New(isolate); uint32_t i = 0; - for (auto const& proxyDef: RestServerFeature::getTrustedProxies()) { + for (auto const& proxyDef : GeneralServerFeature::getTrustedProxies()) { result->Set(i++, TRI_V8_STD_STRING(proxyDef)); } TRI_V8_RETURN(result); } else { TRI_V8_RETURN(v8::Null(isolate)); } - + TRI_V8_TRY_CATCH_END } -static void JS_AuthenticationEnabled(v8::FunctionCallbackInfo const& args) { - // mop: one could argue that this is a function because this might be changable on the fly - // at some time but the sad truth is server startup order :S v8 is initialized after RestServerFeature - // :weglaecheln: +static void JS_AuthenticationEnabled( + v8::FunctionCallbackInfo const& args) { + // mop: one could argue that this is a function because this might be + // changable on the fly at some time but the sad truth is server startup + // order + // v8 is initialized after GeneralServerFeature TRI_V8_TRY_CATCH_BEGIN(isolate); v8::HandleScope scope(isolate); - v8::Handle result = v8::Boolean::New(isolate, RestServerFeature::authenticationEnabled()); - + v8::Handle result = + v8::Boolean::New(isolate, GeneralServerFeature::authenticationEnabled()); + TRI_V8_RETURN(result); TRI_V8_TRY_CATCH_END } @@ -2857,7 +2859,7 @@ void TRI_InitV8VocBridge(v8::Isolate* isolate, v8::Handle context, TRI_AddGlobalFunctionVocbase( isolate, context, TRI_V8_ASCII_STRING("AQL_QUERY_CACHE_INVALIDATE"), JS_QueryCacheInvalidateAql, true); - + TRI_AddGlobalFunctionVocbase(isolate, context, TRI_V8_ASCII_STRING("OBJECT_HASH"), JS_ObjectHash, true); @@ -2885,9 +2887,8 @@ void TRI_InitV8VocBridge(v8::Isolate* isolate, v8::Handle context, TRI_V8_ASCII_STRING("PARSE_DATETIME"), JS_ParseDatetime); - TRI_AddGlobalFunctionVocbase(isolate, context, - TRI_V8_ASCII_STRING("ENDPOINTS"), - JS_Endpoints, true); + TRI_AddGlobalFunctionVocbase( + isolate, context, TRI_V8_ASCII_STRING("ENDPOINTS"), JS_Endpoints, true); TRI_AddGlobalFunctionVocbase(isolate, context, TRI_V8_ASCII_STRING("RELOAD_AUTH"), JS_ReloadAuth, true); @@ -2920,11 +2921,13 @@ void TRI_InitV8VocBridge(v8::Isolate* isolate, v8::Handle context, TRI_AddGlobalFunctionVocbase( isolate, context, TRI_V8_ASCII_STRING("GET_TIMERS"), JS_GetTimers, true); - TRI_AddGlobalFunctionVocbase( - isolate, context, TRI_V8_ASCII_STRING("AUTHENTICATION_ENABLED"), JS_AuthenticationEnabled, true); - - TRI_AddGlobalFunctionVocbase( - isolate, context, TRI_V8_ASCII_STRING("TRUSTED_PROXIES"), JS_TrustedProxies, true); + TRI_AddGlobalFunctionVocbase(isolate, context, + TRI_V8_ASCII_STRING("AUTHENTICATION_ENABLED"), + JS_AuthenticationEnabled, true); + + TRI_AddGlobalFunctionVocbase(isolate, context, + TRI_V8_ASCII_STRING("TRUSTED_PROXIES"), + JS_TrustedProxies, true); // ............................................................................. // create global variables // ............................................................................. @@ -2945,7 +2948,7 @@ void TRI_InitV8VocBridge(v8::Isolate* isolate, v8::Handle context, context->Global()->ForceSet(TRI_V8_ASCII_STRING("THREAD_NUMBER"), v8::Number::New(isolate, (double)threadNumber), v8::ReadOnly); - + // whether or not statistics are enabled context->Global()->ForceSet( TRI_V8_ASCII_STRING("ENABLE_STATISTICS"), diff --git a/arangod/VocBase/AuthInfo.cpp b/arangod/VocBase/AuthInfo.cpp index 333cf38c18..7eac11ee33 100644 --- a/arangod/VocBase/AuthInfo.cpp +++ b/arangod/VocBase/AuthInfo.cpp @@ -33,9 +33,9 @@ #include "Basics/VelocyPackHelper.h" #include "Basics/WriteLocker.h" #include "Basics/tri-strings.h" +#include "GeneralServer/GeneralServerFeature.h" #include "Logger/Logger.h" #include "RestServer/DatabaseFeature.h" -#include "RestServer/RestServerFeature.h" #include "Ssl/SslInterface.h" #include "Utils/SingleCollectionTransaction.h" #include "Utils/StandaloneTransactionContext.h" @@ -544,7 +544,7 @@ bool AuthInfo::validateJwtHMAC256Signature(std::string const& message, std::string const& signature) { std::string decodedSignature = StringUtils::decodeBase64U(signature); - std::string const& jwtSecret = RestServerFeature::getJwtSecret(); + std::string const& jwtSecret = GeneralServerFeature::getJwtSecret(); return verifyHMAC(jwtSecret.c_str(), jwtSecret.length(), message.c_str(), message.length(), decodedSignature.c_str(), decodedSignature.length(), diff --git a/arangod/VocBase/server.cpp b/arangod/VocBase/server.cpp index d2dfa190a6..e7cce11273 100644 --- a/arangod/VocBase/server.cpp +++ b/arangod/VocBase/server.cpp @@ -41,9 +41,9 @@ #include "Basics/memory-map.h" #include "Basics/tri-strings.h" #include "Cluster/ServerState.h" +#include "GeneralServer/GeneralServerFeature.h" #include "Logger/Logger.h" #include "Random/RandomGenerator.h" -#include "RestServer/RestServerFeature.h" #include "Utils/CursorRepository.h" #include "V8Server/V8DealerFeature.h" #include "VocBase/replication-applier.h" @@ -924,7 +924,8 @@ int TRI_GetUserDatabasesServer(TRI_server_t* server, char const* username, char const* dbName = p.second->_name; TRI_ASSERT(dbName != nullptr); - auto level = RestServerFeature::AUTH_INFO.canUseDatabase(username, dbName); + auto level = + GeneralServerFeature::AUTH_INFO.canUseDatabase(username, dbName); if (level == AuthLevel::NONE) { continue; diff --git a/js/apps/system/_admin/aardvark/APP/aardvark.js b/js/apps/system/_admin/aardvark/APP/aardvark.js index 39540f715f..37665297e8 100644 --- a/js/apps/system/_admin/aardvark/APP/aardvark.js +++ b/js/apps/system/_admin/aardvark/APP/aardvark.js @@ -385,12 +385,22 @@ authRouter.get('/graph/:name', function (req, res) { _.each(obj.edges, function (edge) { if (edge._to && edge._from) { - if (config.edgeLabel) { + if (config.edgeLabelByCollection === 'true') { + edgeLabel = edge._id.split('/')[0]; + } else if (config.edgeLabel) { // configure edge labels - edgeLabel = edge[config.edgeLabel]; - if (edgeLabel) { - edgeLabel = edgeLabel.toString(); + if (config.edgeLabel.indexOf('.') > -1) { + edgeLabel = getAttributeByKey(edge, config.edgeLabel); + if (nodeLabel === undefined || nodeLabel === '') { + edgeLabel = edgeLabel._id; + } + } else { + edgeLabel = edge[config.edgeLabel]; + } + + if (typeof edgeLabel !== 'string') { + edgeLabel = JSON.stringify(edgeLabel); } if (!edgeLabel) { @@ -437,7 +447,9 @@ authRouter.get('/graph/:name', function (req, res) { var nodeSize; var nodeObj; _.each(obj.vertices, function (node) { - if (config.nodeLabel) { + if (config.nodeLabelByCollection === 'true') { + nodeLabel = node._id.split('/')[0]; + } else if (config.nodeLabel) { if (config.nodeLabel.indexOf('.') > -1) { nodeLabel = getAttributeByKey(node, config.nodeLabel); if (nodeLabel === undefined || nodeLabel === '') { diff --git a/js/apps/system/_admin/aardvark/APP/frontend/build/app.min.js b/js/apps/system/_admin/aardvark/APP/frontend/build/app.min.js index 5bbfbd0254..d94d07f217 100644 --- a/js/apps/system/_admin/aardvark/APP/frontend/build/app.min.js +++ b/js/apps/system/_admin/aardvark/APP/frontend/build/app.min.js @@ -3,12 +3,12 @@ url:j+"/edges/"+a,data:JSON.stringify(b),success:c});$.ajax(d)},del:function(a,b type:"decission",id:"collections",group:"loadtype",text:"Select existing collections",isDefault:void 0===b.getGraphName(),interior:[{type:"list",id:"node_collection",text:"Vertex collection",objects:f,selected:b.getNodeCollection()},{type:"list",id:"edge_collection",text:"Edge collection",objects:g,selected:b.getEdgeCollection()}]},{type:"decission",id:"graphs",group:"loadtype",text:"Select existing graph",isDefault:void 0!==b.getGraphName(),interior:[{type:"list",id:"graph",objects:h,selected:b.getGraphName()}]},{type:"checkbox",text:"Start with random vertex",id:"random",selected:!0},{type:"checkbox",id:"undirected",selected:"any"===b.getDirection()}],function(){var a=$("#"+e+"node_collection").children("option").filter(":selected").text(),d=$("#"+e+"edge_collection").children("option").filter(":selected").text(),f=$("#"+e+"graph").children("option").filter(":selected").text(),g=!!$("#"+e+"undirected").prop("checked"),h=!!$("#"+e+"random").prop("checked"),i=$("input[type='radio'][name='loadtype']:checked").prop("id");return i===e+"collections"?b.changeToCollections(a,d,g):b.changeToGraph(f,g),h?void b.loadRandomNode(c):void(_.isFunction(c)&&c())})})})})},this.addControlChangePriority=function(){var c="control_adapter_priority",d=c+"_",e=(b.getPrioList(),"Group vertices");uiComponentsHelper.createButton(a,e,c,function(){modalDialogHelper.createModalChangeDialog(e,d,[{type:"extendable",id:"attribute",objects:b.getPrioList()}],function(){var a=$("input[id^="+d+"attribute_]"),c=[];a.each(function(a,b){var d=$(b).val();""!==d&&c.push(d)}),b.changeTo({prioList:c})})})},this.addAll=function(){this.addControlChangeCollections(),this.addControlChangePriority()}}function ContextMenu(a){"use strict";if(void 0===a)throw"An id has to be given.";var b,c,d="#"+a,e=function(a,d){var e,f;e=document.createElement("div"),e.className="context-menu-item",f=document.createElement("div"),f.className="context-menu-item-inner",f.appendChild(document.createTextNode(a)),f.onclick=function(){d(d3.select(c.target).data()[0])},e.appendChild(f),b.appendChild(e)},f=function(a){c=$.contextMenu.create(d,{shadow:!1}),a.each(function(){$(this).bind("contextmenu",function(a){return c.show(this,a),!1})})},g=function(){return b=document.getElementById(a),b&&b.parentElement.removeChild(b),b=document.createElement("div"),b.className="context-menu context-menu-theme-osx",b.id=a,document.body.appendChild(b),b};g(),this.addEntry=e,this.bindMenu=f}function EdgeShaperControls(a,b){"use strict";if(void 0===a)throw"A list element has to be given.";if(void 0===b)throw"The EdgeShaper has to be given.";var c=this;this.addControlOpticShapeNone=function(){var c="control_edge_none";uiComponentsHelper.createButton(a,"None",c,function(){b.changeTo({shape:{type:EdgeShaper.shapes.NONE}})})},this.addControlOpticShapeArrow=function(){var c="control_edge_arrow";uiComponentsHelper.createButton(a,"Arrow",c,function(){b.changeTo({shape:{type:EdgeShaper.shapes.ARROW}})})},this.addControlOpticLabel=function(){var c="control_edge_label",d=c+"_";uiComponentsHelper.createButton(a,"Configure Label",c,function(){modalDialogHelper.createModalDialog("Switch Label Attribute",d,[{type:"text",id:"key",text:"Edge label attribute",value:b.getLabel()}],function(){var a=$("#"+d+"key").attr("value");b.changeTo({label:a})})})},this.addControlOpticLabelList=function(){var d="control_edge_label",e=d+"_";uiComponentsHelper.createButton(a,"Configure Label",d,function(){modalDialogHelper.createModalDialog("Change Label Attribute",e,[{type:"extendable",id:"label",text:"Edge label attribute",objects:b.getLabel()}],function(){var a=$("input[id^="+e+"label_]"),d=[];a.each(function(a,b){var c=$(b).val();""!==c&&d.push(c)});var f={label:d};c.applyLocalStorage(f),b.changeTo(f)})})},this.applyLocalStorage=function(a){if("undefined"!==Storage)try{var b=JSON.parse(localStorage.getItem("graphSettings")),c=window.location.hash.split("/")[1],d=window.location.pathname.split("/")[2],e=c+d;_.each(a,function(a,c){void 0!==c&&(b[e].viewer.hasOwnProperty("edgeShaper")||(b[e].viewer.edgeShaper={}),b[e].viewer.edgeShaper[c]=a)}),localStorage.setItem("graphSettings",JSON.stringify(b))}catch(f){console.log(f)}},this.addControlOpticSingleColour=function(){var c="control_edge_singlecolour",d=c+"_";uiComponentsHelper.createButton(a,"Single Colour",c,function(){modalDialogHelper.createModalDialog("Switch to Colour",d,[{type:"text",id:"stroke"}],function(){var a=$("#"+d+"stroke").attr("value");b.changeTo({color:{type:"single",stroke:a}})})})},this.addControlOpticAttributeColour=function(){var c="control_edge_attributecolour",d=c+"_";uiComponentsHelper.createButton(a,"Colour by Attribute",c,function(){modalDialogHelper.createModalDialog("Display colour by attribute",d,[{type:"text",id:"key"}],function(){var a=$("#"+d+"key").attr("value");b.changeTo({color:{type:"attribute",key:a}})})})},this.addControlOpticGradientColour=function(){var c="control_edge_gradientcolour",d=c+"_";uiComponentsHelper.createButton(a,"Gradient Colour",c,function(){modalDialogHelper.createModalDialog("Change colours for gradient",d,[{type:"text",id:"source"},{type:"text",id:"target"}],function(){var a=$("#"+d+"source").attr("value"),c=$("#"+d+"target").attr("value");b.changeTo({color:{type:"gradient",source:a,target:c}})})})},this.addAllOptics=function(){c.addControlOpticShapeNone(),c.addControlOpticShapeArrow(),c.addControlOpticLabel(),c.addControlOpticSingleColour(),c.addControlOpticAttributeColour(),c.addControlOpticGradientColour()},this.addAllActions=function(){},this.addAll=function(){c.addAllOptics(),c.addAllActions()}}function EventDispatcherControls(a,b,c,d,e){"use strict";if(void 0===a)throw"A list element has to be given.";if(void 0===b)throw"The NodeShaper has to be given.";if(void 0===c)throw"The EdgeShaper has to be given.";if(void 0===d)throw"The Start callback has to be given.";var f=this,g={expand:{icon:"hand-pointer-o",title:"Expand a node."},add:{icon:"plus-square",title:"Add a node."},trash:{icon:"minus-square",title:"Remove a node/edge."},drag:{icon:"hand-rock-o",title:"Drag a node."},edge:{icon:"external-link-square",title:"Create an edge between two nodes."},edit:{icon:"pencil-square",title:"Edit attributes of a node."},view:{icon:"search",title:"View attributes of a node."}},h=new EventDispatcher(b,c,e),i=e.edgeEditor.adapter,j=!!i&&_.isFunction(i.useNodeCollection)&&_.isFunction(i.useEdgeCollection),k=function(b){a.appendChild(b)},l=function(a,b,c){var d=uiComponentsHelper.createIconButton(a,"control_event_"+b,c);k(d)},m=function(a){h.rebind("nodes",a)},n=function(a){h.rebind("edges",a)},o=function(a){h.rebind("svg",a)},p=function(a){var b=a||window.event,c={};return c.x=b.clientX,c.y=b.clientY,c.x+=document.body.scrollLeft,c.y+=document.body.scrollTop,c},q=function(a){var b,c,d,e=p(a),f=$("svg#graphViewerSVG").offset();return b=d3.select("svg#graphViewerSVG").node(),d=b.getBoundingClientRect(),$("svg#graphViewerSVG").height()<=d.height?{x:e.x-f.left,y:e.y-f.top}:(c=b.getBBox(),{x:e.x-(d.left-c.x),y:e.y-(d.top-c.y)})},r={nodes:{},edges:{},svg:{}},s=function(){var a="control_event_new_node",c=a+"_",e=function(a){var e=q(a);modalDialogHelper.createModalCreateDialog("Create New Node",c,{},function(a){h.events.CREATENODE(a,function(a){$("#"+c+"modal").modal("hide"),b.reshapeNodes(),d()},e.x,e.y)()})};r.nodes.newNode=e},t=function(){var a=function(a){modalDialogHelper.createModalViewDialog("View Node "+a._id,"control_event_node_view_",a._data,function(){modalDialogHelper.createModalEditDialog("Edit Node "+a._id,"control_event_node_edit_",a._data,function(b){h.events.PATCHNODE(a,b,function(){$("#control_event_node_edit_modal").modal("hide")})()})})},b=function(a){modalDialogHelper.createModalViewDialog("View Edge "+a._id,"control_event_edge_view_",a._data,function(){modalDialogHelper.createModalEditDialog("Edit Edge "+a._id,"control_event_edge_edit_",a._data,function(b){h.events.PATCHEDGE(a,b,function(){$("#control_event_edge_edit_modal").modal("hide")})()})})};r.nodes.view=a,r.edges.view=b},u=function(){var a=h.events.STARTCREATEEDGE(function(a,b){var d=q(b),e=c.addAnEdgeFollowingTheCursor(d.x,d.y);h.bind("svg","mousemove",function(a){var b=q(a);e(b.x,b.y)})}),b=h.events.FINISHCREATEEDGE(function(a){c.removeCursorFollowingEdge(),h.bind("svg","mousemove",function(){}),d()}),e=function(){h.events.CANCELCREATEEDGE(),c.removeCursorFollowingEdge(),h.bind("svg","mousemove",function(){})};r.nodes.startEdge=a,r.nodes.endEdge=b,r.svg.cancelEdge=e},v=function(){var a=function(a){arangoHelper.openDocEditor(a._id,"document")},b=function(a){arangoHelper.openDocEditor(a._id,"edge")};r.nodes.edit=a,r.edges.edit=b},w=function(){var a=function(a){modalDialogHelper.createModalDeleteDialog("Delete Node "+a._id,"control_event_node_delete_",a,function(a){h.events.DELETENODE(function(){$("#control_event_node_delete_modal").modal("hide"),b.reshapeNodes(),c.reshapeEdges(),d()})(a)})},e=function(a){modalDialogHelper.createModalDeleteDialog("Delete Edge "+a._id,"control_event_edge_delete_",a,function(a){h.events.DELETEEDGE(function(){$("#control_event_edge_delete_modal").modal("hide"),b.reshapeNodes(),c.reshapeEdges(),d()})(a)})};r.nodes.del=a,r.edges.del=e},x=function(){r.nodes.spot=h.events.EXPAND};s(),t(),u(),v(),w(),x(),this.dragRebinds=function(){return{nodes:{drag:h.events.DRAG}}},this.newNodeRebinds=function(){return{svg:{click:r.nodes.newNode}}},this.viewRebinds=function(){return{nodes:{click:r.nodes.view},edges:{click:r.edges.view}}},this.connectNodesRebinds=function(){return{nodes:{mousedown:r.nodes.startEdge,mouseup:r.nodes.endEdge},svg:{mouseup:r.svg.cancelEdge}}},this.editRebinds=function(){return{nodes:{click:r.nodes.edit},edges:{click:r.edges.edit}}},this.expandRebinds=function(){return{nodes:{click:r.nodes.spot}}},this.deleteRebinds=function(){return{nodes:{click:r.nodes.del},edges:{click:r.edges.del}}},this.rebindAll=function(a){m(a.nodes),n(a.edges),o(a.svg)},b.addMenuEntry("Edit",r.nodes.edit),b.addMenuEntry("Spot",r.nodes.spot),b.addMenuEntry("Trash",r.nodes.del),c.addMenuEntry("Edit",r.edges.edit),c.addMenuEntry("Trash",r.edges.del),this.addControlNewNode=function(){var a=g.add,b="select_node_collection",c=function(){j&&i.getNodeCollections().length>1&&modalDialogHelper.createModalDialog("Select Vertex Collection",b,[{type:"list",id:"vertex",objects:i.getNodeCollections(),text:"Select collection",selected:i.getSelectedNodeCollection()}],function(){var a=$("#"+b+"vertex").children("option").filter(":selected").text();i.useNodeCollection(a)},"Select"),f.rebindAll(f.newNodeRebinds())};l(a,"new_node",c)},this.addControlView=function(){var a=g.view,b=function(){f.rebindAll(f.viewRebinds())};l(a,"view",b)},this.addControlDrag=function(){var a=g.drag,b=function(){f.rebindAll(f.dragRebinds())};l(a,"drag",b)},this.addControlEdit=function(){var a=g.edit,b=function(){f.rebindAll(f.editRebinds())};l(a,"edit",b)},this.addControlExpand=function(){var a=g.expand,b=function(){f.rebindAll(f.expandRebinds())};l(a,"expand",b)},this.addControlDelete=function(){var a=g.trash,b=function(){f.rebindAll(f.deleteRebinds())};l(a,"delete",b)},this.addControlConnect=function(){var a=g.edge,b="select_edge_collection",c=function(){j&&i.getEdgeCollections().length>1&&modalDialogHelper.createModalDialog("Select Edge Collection",b,[{type:"list",id:"edge",objects:i.getEdgeCollections(),text:"Select collection",selected:i.getSelectedEdgeCollection()}],function(){var a=$("#"+b+"edge").children("option").filter(":selected").text();i.useEdgeCollection(a)},"Select"),f.rebindAll(f.connectNodesRebinds())};l(a,"connect",c)},this.addAll=function(){f.addControlExpand(),f.addControlDrag(),f.addControlEdit(),f.addControlConnect(),f.addControlNewNode(),f.addControlDelete()}}function GharialAdapterControls(a,b){"use strict";if(void 0===a)throw"A list element has to be given.";if(void 0===b)throw"The GharialAdapter has to be given.";this.addControlChangeGraph=function(c){var d="control_adapter_graph",e=d+"_";b.getGraphs(function(f){uiComponentsHelper.createButton(a,"Switch Graph",d,function(){modalDialogHelper.createModalDialog("Switch Graph",e,[{type:"list",id:"graph",objects:f,text:"Select graph",selected:b.getGraphName()},{type:"checkbox",text:"Start with random vertex",id:"random",selected:!0}],function(){var a=$("#"+e+"graph").children("option").filter(":selected").text(),d=!!$("#"+e+"undirected").prop("checked"),f=!!$("#"+e+"random").prop("checked");return b.changeToGraph(a,d),f?void b.loadRandomNode(c):void(_.isFunction(c)&&c())})})})},this.addControlChangePriority=function(){var c="control_adapter_priority",d=c+"_",e="Group vertices";uiComponentsHelper.createButton(a,e,c,function(){modalDialogHelper.createModalChangeDialog(e+" by attribute",d,[{type:"extendable",id:"attribute",objects:b.getPrioList()}],function(){var a=$("input[id^="+d+"attribute_]"),c=[];_.each(a,function(a){var b=$(a).val();""!==b&&c.push(b)}),b.changeTo({prioList:c})})})},this.addAll=function(){this.addControlChangeGraph(),this.addControlChangePriority()}}function GraphViewerPreview(a,b){"use strict";var c,d,e,f,g,h,i,j=function(){return d3.select(a).append("svg").attr("id","graphViewerSVG").attr("width",d).attr("height",e).attr("class","graph-viewer").attr("style","width:"+d+"px;height:"+e+";")},k=function(a){var b=0;return _.each(a,function(c,d){c===!1?delete a[d]:b++}),b>0},l=function(a,b){_.each(b,function(b,c){a[c]=a[c]||{},_.each(b,function(b,d){a[c][d]=b})})},m=function(a){if(a){var b={};a.drag&&l(b,i.dragRebinds()),a.create&&(l(b,i.newNodeRebinds()),l(b,i.connectNodesRebinds())),a.remove&&l(b,i.deleteRebinds()),a.expand&&l(b,i.expandRebinds()),a.edit&&l(b,i.editRebinds()),i.rebindAll(b)}},n=function(b){var c=document.createElement("div");i=new EventDispatcherControls(c,f.nodeShaper,f.edgeShaper,f.start,f.dispatcherConfig),c.id="toolbox",c.className="btn-group btn-group-vertical pull-left toolbox",a.appendChild(c),_.each(b,function(a,b){switch(b){case"expand":i.addControlExpand();break;case"create":i.addControlNewNode(),i.addControlConnect();break;case"drag":i.addControlDrag();break;case"edit":i.addControlEdit();break;case"remove":i.addControlDelete()}})},o=function(a){var b=document.createElement("div");i=new EventDispatcherControls(b,f.nodeShaper,f.edgeShaper,f.start,f.dispatcherConfig)},p=function(){b&&(b.nodeShaper&&(b.nodeShaper.label&&(b.nodeShaper.label="label"),b.nodeShaper.shape&&b.nodeShaper.shape.type===NodeShaper.shapes.IMAGE&&b.nodeShaper.shape.source&&(b.nodeShaper.shape.source="image")),b.edgeShaper&&b.edgeShaper.label&&(b.edgeShaper.label="label"))},q=function(){return p(),new GraphViewer(c,d,e,h,b)};d=a.getBoundingClientRect().width,e=a.getBoundingClientRect().height,h={type:"preview"},b=b||{},g=k(b.toolbox),g&&(d-=43),c=j(),f=q(),g?n(b.toolbox):o(),f.loadGraph("1"),m(b.actions)}function GraphViewerUI(a,b,c,d,e,f){"use strict";if(void 0===a)throw"A parent element has to be given.";if(!a.id)throw"The parent element needs an unique id.";if(void 0===b)throw"An adapter configuration has to be given";var g,h,i,j,k,l,m,n,o,p=c+20||a.getBoundingClientRect().width-81+20,q=d||a.getBoundingClientRect().height,r=document.createElement("ul"),s=document.createElement("div"),t=function(){g.adapter.NODES_TO_DISPLAYGraph too big. A random section is rendered.
'),$(".infoField .fa-info-circle").attr("title","You can display additional/other vertices by using the toolbar buttons.").tooltip())},u=function(){var a,b=document.createElement("div"),c=document.createElement("div"),d=document.createElement("div"),e=document.createElement("div"),f=document.createElement("button"),h=document.createElement("span"),i=document.createElement("input"),j=document.createElement("i"),k=document.createElement("span"),l=function(){$(s).css("cursor","progress")},n=function(){$(s).css("cursor","")},o=function(a){return n(),a&&a.errorCode&&404===a.errorCode?void arangoHelper.arangoError("Graph error","could not find a matching node."):void 0},p=function(){l(),""===a.value||void 0===a.value?g.loadGraph(i.value,o):g.loadGraphWithAttributeValue(a.value,i.value,o)};b.id="filterDropdown",b.className="headerDropdown smallDropdown",c.className="dropdownInner",d.className="queryline",a=document.createElement("input"),m=document.createElement("ul"),e.className="pull-left input-append searchByAttribute",a.id="attribute",a.type="text",a.placeholder="Attribute name",f.id="attribute_example_toggle",f.className="button-neutral gv_example_toggle",h.className="caret gv_caret",m.className="gv-dropdown-menu",i.id="value",i.className="searchInput gv_searchInput",i.type="text",i.placeholder="Attribute value",j.id="loadnode",j.className="fa fa-search",k.className="searchEqualsLabel",k.appendChild(document.createTextNode("==")),c.appendChild(d),d.appendChild(e),e.appendChild(a),e.appendChild(f),e.appendChild(m),f.appendChild(h),d.appendChild(k),d.appendChild(i),d.appendChild(j),j.onclick=p,$(i).keypress(function(a){return 13===a.keyCode||13===a.which?(p(),!1):void 0}),f.onclick=function(){$(m).slideToggle(200)};var q=document.createElement("p");return q.className="dropdown-title",q.innerHTML="Filter graph by attribute:",b.appendChild(q),b.appendChild(c),b},v=function(){var a,b=document.createElement("div"),c=document.createElement("div"),d=document.createElement("div"),e=document.createElement("div"),f=document.createElement("button"),h=document.createElement("span"),i=document.createElement("input"),j=document.createElement("i"),k=document.createElement("span"),l=function(){$(s).css("cursor","progress")},m=function(){$(s).css("cursor","")},o=function(a){return m(),a&&a.errorCode&&404===a.errorCode?void arangoHelper.arangoError("Graph error","could not find a matching node."):void 0},p=function(){l(),""!==a.value&&g.loadGraphWithAdditionalNode(a.value,i.value,o)};b.id="nodeDropdown",b.className="headerDropdown smallDropdown",c.className="dropdownInner",d.className="queryline",a=document.createElement("input"),n=document.createElement("ul"),e.className="pull-left input-append searchByAttribute",a.id="attribute",a.type="text",a.placeholder="Attribute name",f.id="attribute_example_toggle2",f.className="button-neutral gv_example_toggle",h.className="caret gv_caret",n.className="gv-dropdown-menu",i.id="value",i.className="searchInput gv_searchInput",i.type="text",i.placeholder="Attribute value",j.id="loadnode",j.className="fa fa-search",k.className="searchEqualsLabel",k.appendChild(document.createTextNode("==")),c.appendChild(d),d.appendChild(e),e.appendChild(a),e.appendChild(f),e.appendChild(n),f.appendChild(h),d.appendChild(k),d.appendChild(i),d.appendChild(j),C(n),j.onclick=p,$(i).keypress(function(a){return 13===a.keyCode||13===a.which?(p(),!1):void 0}),f.onclick=function(){$(n).slideToggle(200)};var q=document.createElement("p");return q.className="dropdown-title",q.innerHTML="Add specific node by attribute:",b.appendChild(q),b.appendChild(c),b},w=function(){var a,b,c,d,e,f,g,h;return a=document.createElement("div"),a.id="configureDropdown",a.className="headerDropdown",b=document.createElement("div"),b.className="dropdownInner",c=document.createElement("ul"),d=document.createElement("li"),d.className="nav-header",d.appendChild(document.createTextNode("Vertices")),g=document.createElement("ul"),h=document.createElement("li"),h.className="nav-header",h.appendChild(document.createTextNode("Edges")),e=document.createElement("ul"),f=document.createElement("li"),f.className="nav-header",f.appendChild(document.createTextNode("Connection")),c.appendChild(d),g.appendChild(h),e.appendChild(f),b.appendChild(c),b.appendChild(g),b.appendChild(e),a.appendChild(b),{configure:a,nodes:c,edges:g,col:e}},x=function(a,b,c,d){var e,f,g,h,i,j,k,l,m,n,o;return a.className="headerButtonBar",e=document.createElement("ul"),e.className="headerButtonList",a.appendChild(e),g=document.createElement("li"),g.className="enabled",h=document.createElement("a"),h.id=b,h.className="headerButton",i=document.createElement("span"),i.className="icon_arangodb_settings2",$(i).attr("title","Configure"),e.appendChild(g),g.appendChild(h),h.appendChild(i),j=document.createElement("li"),j.className="enabled",k=document.createElement("a"),k.id=d,k.className="headerButton",l=document.createElement("span"),l.className="fa fa-search-plus",$(l).attr("title","Show additional vertices"),e.appendChild(j),j.appendChild(k),k.appendChild(l),m=document.createElement("li"),m.className="enabled",n=document.createElement("a"),n.id=c,n.className="headerButton",o=document.createElement("span"),o.className="icon_arangodb_filter",$(o).attr("title","Filter"),e.appendChild(m),m.appendChild(n),n.appendChild(o),f=w(),f.filter=u(),f.node=v(),h.onclick=function(){$("#filterdropdown").removeClass("activated"),$("#nodedropdown").removeClass("activated"),$("#configuredropdown").toggleClass("activated"),$(f.configure).slideToggle(200),$(f.filter).hide(),$(f.node).hide()},k.onclick=function(){$("#filterdropdown").removeClass("activated"),$("#configuredropdown").removeClass("activated"),$("#nodedropdown").toggleClass("activated"),$(f.node).slideToggle(200),$(f.filter).hide(),$(f.configure).hide()},n.onclick=function(){$("#configuredropdown").removeClass("activated"),$("#nodedropdown").removeClass("activated"),$("#filterdropdown").toggleClass("activated"),$(f.filter).slideToggle(200),$(f.node).hide(),$(f.configure).hide()},f},y=function(){return d3.select("#"+a.id+" #background").append("svg").attr("id","graphViewerSVG").attr("width",p).attr("height",q).attr("class","graph-viewer").style("width",p+"px").style("height",q+"px")},z=function(){var a=document.createElement("div"),b=document.createElement("div"),c=document.createElement("button"),d=document.createElement("button"),e=document.createElement("button"),f=document.createElement("button");a.className="gv_zoom_widget",b.className="gv_zoom_buttons_bg",c.className="btn btn-icon btn-zoom btn-zoom-top gv-zoom-btn pan-top",d.className="btn btn-icon btn-zoom btn-zoom-left gv-zoom-btn pan-left",e.className="btn btn-icon btn-zoom btn-zoom-right gv-zoom-btn pan-right",f.className="btn btn-icon btn-zoom btn-zoom-bottom gv-zoom-btn pan-bottom",c.onclick=function(){g.zoomManager.triggerTranslation(0,-10)},d.onclick=function(){g.zoomManager.triggerTranslation(-10,0)},e.onclick=function(){g.zoomManager.triggerTranslation(10,0)},f.onclick=function(){g.zoomManager.triggerTranslation(0,10)},b.appendChild(c),b.appendChild(d),b.appendChild(e),b.appendChild(f),l=document.createElement("div"),l.id="gv_zoom_slider",l.className="gv_zoom_slider",s.appendChild(a),s.insertBefore(a,o[0][0]),a.appendChild(b),a.appendChild(l),$("#gv_zoom_slider").slider({orientation:"vertical",min:g.zoomManager.getMinimalZoomFactor(),max:1,value:1,step:.01,slide:function(a,b){g.zoomManager.triggerScale(b.value)}}),g.zoomManager.registerSlider($("#gv_zoom_slider"))},A=function(){var a=document.createElement("div"),b=new EventDispatcherControls(a,g.nodeShaper,g.edgeShaper,g.start,g.dispatcherConfig);a.id="toolbox",a.className="btn-group btn-group-vertical toolbox",s.insertBefore(a,o[0][0]),b.addAll(),$("#control_event_expand").click()},B=function(){var a='
  • ';$(".headerBar .headerButtonList").prepend(a)},C=function(a){var b;b=a?$(a):$(m),b.innerHTML="";var c=document.createElement("li"),d=document.createElement("img");$(c).append(d),d.className="gv-throbber",b.append(c),g.adapter.getAttributeExamples(function(a){$(b).html(""),_.each(a,function(a){var c=document.createElement("li"),d=document.createElement("a"),e=document.createElement("label");$(c).append(d),$(d).append(e),$(e).append(document.createTextNode(a)),e.className="gv_dropdown_label",b.append(c),c.onclick=function(){b.value=a,$(b).parent().find("input").val(a),$(b).slideToggle(200)}})})},D=function(){var a=document.createElement("div"),b=document.createElement("div"),c=(document.createElement("a"),x(b,"configuredropdown","filterdropdown","nodedropdown"));i=new NodeShaperControls(c.nodes,g.nodeShaper),j=new EdgeShaperControls(c.edges,g.edgeShaper),k=new GharialAdapterControls(c.col,g.adapter),r.id="menubar",a.className="headerBar",b.id="modifiers",r.appendChild(a),r.appendChild(c.configure),r.appendChild(c.filter),r.appendChild(c.node),a.appendChild(b),k.addControlChangeGraph(function(){C(),g.start(!0)}),k.addControlChangePriority(),i.addControlOpticLabelAndColourList(g.adapter),j.addControlOpticLabelList(),C()},E=function(){h=i.createColourMappingList(),h.className="gv-colour-list",s.insertBefore(h,o[0][0])};a.appendChild(r),a.appendChild(s),s.className="contentDiv gv-background ",s.id="background",e=e||{},e.zoom=!0,$("#subNavigationBar .breadcrumb").html("Graph: "+b.graphName),o=y(),"undefined"!==Storage&&(this.graphSettings={},this.loadLocalStorage=function(){var a=b.baseUrl.split("/")[2],c=b.graphName+a;if(null===localStorage.getItem("graphSettings")||"null"===localStorage.getItem("graphSettings")){var d={};d[c]={viewer:e,adapter:b},localStorage.setItem("graphSettings",JSON.stringify(d))}else try{var f=JSON.parse(localStorage.getItem("graphSettings"));this.graphSettings=f,void 0!==f[c].viewer&&(e=f[c].viewer),void 0!==f[c].adapter&&(b=f[c].adapter)}catch(g){console.log("Could not load graph settings, resetting graph settings."),this.graphSettings[c]={viewer:e,adapter:b},localStorage.setItem("graphSettings",JSON.stringify(this.graphSettings))}},this.loadLocalStorage(),this.writeLocalStorage=function(){}),g=new GraphViewer(o,p,q,b,e),A(),z(),D(),E(),t(),B(),$("#graphSize").on("change",function(){var a=$("#graphSize").find(":selected").val();g.loadGraphWithRandomStart(function(a){a&&a.errorCode&&arangoHelper.arangoError("Graph","Sorry your graph seems to be empty")},a)}),f&&("string"==typeof f?g.loadGraph(f):g.loadGraphWithRandomStart(function(a){a&&a.errorCode&&arangoHelper.arangoError("Graph","Sorry your graph seems to be empty")})),this.changeWidth=function(a){g.changeWidth(a);var b=a-55;o.attr("width",b).style("width",b+"px")}}function GraphViewerWidget(a,b){"use strict";var c,d,e,f,g,h,i,j,k=function(){return d3.select(d).append("svg").attr("id","graphViewerSVG").attr("width",e).attr("height",f).attr("class","graph-viewer").attr("style","width:"+e+"px;height:"+f+"px;")},l=function(a){var b=0;return _.each(a,function(c,d){c===!1?delete a[d]:b++}),b>0},m=function(a,b){_.each(b,function(b,c){a[c]=a[c]||{},_.each(b,function(b,d){a[c][d]=b})})},n=function(a){if(a){var b={};a.drag&&m(b,j.dragRebinds()),a.create&&(m(b,j.newNodeRebinds()),m(b,j.connectNodesRebinds())),a.remove&&m(b,j.deleteRebinds()),a.expand&&m(b,j.expandRebinds()),a.edit&&m(b,j.editRebinds()),j.rebindAll(b)}},o=function(a){var b=document.createElement("div");j=new EventDispatcherControls(b,g.nodeShaper,g.edgeShaper,g.start,g.dispatcherConfig),b.id="toolbox",b.className="btn-group btn-group-vertical pull-left toolbox",d.appendChild(b),_.each(a,function(a,b){switch(b){case"expand":j.addControlExpand();break;case"create":j.addControlNewNode(),j.addControlConnect();break;case"drag":j.addControlDrag();break;case"edit":j.addControlEdit();break;case"remove":j.addControlDelete()}})},p=function(a){var b=document.createElement("div");j=new EventDispatcherControls(b,g.nodeShaper,g.edgeShaper,g.start,g.dispatcherConfig)},q=function(){return new GraphViewer(c,e,f,i,a)};d=document.body,e=d.getBoundingClientRect().width,f=d.getBoundingClientRect().height,i={type:"foxx",route:"."},a=a||{},h=l(a.toolbox),h&&(e-=43),c=k(),g=q(),h?o(a.toolbox):p(),b&&g.loadGraph(b),n(a.actions)}function LayouterControls(a,b){"use strict";if(void 0===a)throw"A list element has to be given.";if(void 0===b)throw"The Layouter has to be given.";var c=this;this.addControlGravity=function(){var c="control_layout_gravity",d=c+"_";uiComponentsHelper.createButton(a,"Gravity",c,function(){modalDialogHelper.createModalDialog("Switch Gravity Strength",d,[{type:"text",id:"value"}],function(){var a=$("#"+d+"value").attr("value");b.changeTo({gravity:a})})})},this.addControlCharge=function(){var c="control_layout_charge",d=c+"_";uiComponentsHelper.createButton(a,"Charge",c,function(){modalDialogHelper.createModalDialog("Switch Charge Strength",d,[{type:"text",id:"value"}],function(){var a=$("#"+d+"value").attr("value");b.changeTo({charge:a})})})},this.addControlDistance=function(){var c="control_layout_distance",d=c+"_";uiComponentsHelper.createButton(a,"Distance",c,function(){modalDialogHelper.createModalDialog("Switch Distance Strength",d,[{type:"text",id:"value"}],function(){var a=$("#"+d+"value").attr("value");b.changeTo({distance:a})})})},this.addAll=function(){c.addControlDistance(),c.addControlGravity(),c.addControlCharge()}}function NodeShaperControls(a,b){"use strict";if(void 0===a)throw"A list element has to be given.";if(void 0===b)throw"The NodeShaper has to be given.";var c,d=this,e=function(a){for(;c.hasChildNodes();)c.removeChild(c.lastChild);var b=document.createElement("ul");c.appendChild(b),_.each(a,function(a,c){var d=document.createElement("ul"),e=a.list,f=a.front;d.style.backgroundColor=c,d.style.color=f,_.each(e,function(a){var b=document.createElement("li");b.appendChild(document.createTextNode(a)),d.appendChild(b)}),b.appendChild(d)})};this.addControlOpticShapeNone=function(){uiComponentsHelper.createButton(a,"None","control_node_none",function(){b.changeTo({shape:{type:NodeShaper.shapes.NONE}})})},this.applyLocalStorage=function(a){if("undefined"!==Storage)try{var b=JSON.parse(localStorage.getItem("graphSettings")),c=window.location.hash.split("/")[1],d=window.location.pathname.split("/")[2],e=c+d;_.each(a,function(a,c){void 0!==c&&(b[e].viewer.nodeShaper[c]=a)}),localStorage.setItem("graphSettings",JSON.stringify(b))}catch(f){console.log(f)}},this.addControlOpticShapeCircle=function(){var c="control_node_circle",d=c+"_";uiComponentsHelper.createButton(a,"Circle",c,function(){modalDialogHelper.createModalDialog("Switch to Circle",d,[{type:"text",id:"radius"}],function(){var a=$("#"+d+"radius").attr("value");b.changeTo({shape:{type:NodeShaper.shapes.CIRCLE,radius:a}})})})},this.addControlOpticShapeRect=function(){var c="control_node_rect",d=c+"_";uiComponentsHelper.createButton(a,"Rectangle",c,function(){modalDialogHelper.createModalDialog("Switch to Rectangle","control_node_rect_",[{type:"text",id:"width"},{type:"text",id:"height"}],function(){var a=$("#"+d+"width").attr("value"),c=$("#"+d+"height").attr("value");b.changeTo({shape:{type:NodeShaper.shapes.RECT,width:a,height:c}})})})},this.addControlOpticLabel=function(){var c="control_node_label",e=c+"_";uiComponentsHelper.createButton(a,"Configure Label",c,function(){modalDialogHelper.createModalChangeDialog("Change label attribute",e,[{type:"text",id:"key"}],function(){var a=$("#"+e+"key").attr("value"),c={label:a};d.applyLocalStorage(c),b.changeTo(c)})})},this.addControlOpticSingleColour=function(){var c="control_node_singlecolour",d=c+"_";uiComponentsHelper.createButton(a,"Single Colour",c,function(){modalDialogHelper.createModalDialog("Switch to Colour",d,[{type:"text",id:"fill"},{type:"text",id:"stroke"}],function(){var a=$("#"+d+"fill").attr("value"),c=$("#"+d+"stroke").attr("value");b.changeTo({color:{type:"single",fill:a,stroke:c}})})})},this.addControlOpticAttributeColour=function(){var c="control_node_attributecolour",d=c+"_";uiComponentsHelper.createButton(a,"Colour by Attribute",c,function(){modalDialogHelper.createModalDialog("Display colour by attribute",d,[{ type:"text",id:"key"}],function(){var a=$("#"+d+"key").attr("value");b.changeTo({color:{type:"attribute",key:a}})})})},this.addControlOpticExpandColour=function(){var c="control_node_expandcolour",d=c+"_";uiComponentsHelper.createButton(a,"Expansion Colour",c,function(){modalDialogHelper.createModalDialog("Display colours for expansion",d,[{type:"text",id:"expanded"},{type:"text",id:"collapsed"}],function(){var a=$("#"+d+"expanded").attr("value"),c=$("#"+d+"collapsed").attr("value");b.changeTo({color:{type:"expand",expanded:a,collapsed:c}})})})},this.addControlOpticLabelAndColour=function(e){var f="control_node_labelandcolour",g=f+"_";uiComponentsHelper.createButton(a,"Configure Label",f,function(){modalDialogHelper.createModalChangeDialog("Change label attribute",g,[{type:"text",id:"label-attribute",text:"Vertex label attribute",value:b.getLabel()||""},{type:"decission",id:"samecolour",group:"colour",text:"Use this attribute for coloring, too",isDefault:b.getLabel()===b.getColor()},{type:"decission",id:"othercolour",group:"colour",text:"Use different attribute for coloring",isDefault:b.getLabel()!==b.getColor(),interior:[{type:"text",id:"colour-attribute",text:"Color attribute",value:b.getColor()||""}]}],function(){var a=$("#"+g+"label-attribute").attr("value"),e=$("#"+g+"colour-attribute").attr("value"),f=$("input[type='radio'][name='colour']:checked").attr("id");f===g+"samecolour"&&(e=a);var h={label:a,color:{type:"attribute",key:e}};d.applyLocalStorage(h),b.changeTo(h),void 0===c&&(c=d.createColourMappingList())})})},this.addControlOpticLabelAndColourList=function(e){var f="control_node_labelandcolourlist",g=f+"_";uiComponentsHelper.createButton(a,"Configure Label",f,function(){modalDialogHelper.createModalChangeDialog("Change label attribute",g,[{type:"extendable",id:"label",text:"Vertex label attribute",objects:b.getLabel()},{type:"decission",id:"samecolour",group:"colour",text:"Use this attribute for coloring, too",isDefault:b.getLabel()===b.getColor()},{type:"decission",id:"othercolour",group:"colour",text:"Use different attribute for coloring",isDefault:b.getLabel()!==b.getColor(),interior:[{type:"extendable",id:"colour",text:"Color attribute",objects:b.getColor()||""}]}],function(){var a=$("input[id^="+g+"label_]"),e=$("input[id^="+g+"colour_]"),f=$("input[type='radio'][name='colour']:checked").attr("id"),h=[],i=[];a.each(function(a,b){var c=$(b).val();""!==c&&h.push(c)}),e.each(function(a,b){var c=$(b).val();""!==c&&i.push(c)}),f===g+"samecolour"&&(i=h);var j={label:h,color:{type:"attribute",key:i}};d.applyLocalStorage(j),b.changeTo(j),void 0===c&&(c=d.createColourMappingList())})})},this.addAllOptics=function(){d.addControlOpticShapeNone(),d.addControlOpticShapeCircle(),d.addControlOpticShapeRect(),d.addControlOpticLabel(),d.addControlOpticSingleColour(),d.addControlOpticAttributeColour(),d.addControlOpticExpandColour()},this.addAllActions=function(){},this.addAll=function(){d.addAllOptics(),d.addAllActions()},this.createColourMappingList=function(){return void 0!==c?c:(c=document.createElement("div"),c.id="node_colour_list",e(b.getColourMapping()),b.setColourMappingListener(e),c)}}function GraphViewer(a,b,c,d,e){"use strict";if($("html").attr("xmlns:xlink","http://www.w3.org/1999/xlink"),void 0===a||void 0===a.append)throw"SVG has to be given and has to be selected using d3.select";if(void 0===b||0>=b)throw"A width greater 0 has to be given";if(void 0===c||0>=c)throw"A height greater 0 has to be given";if(void 0===d||void 0===d.type)throw"An adapter configuration has to be given";var f,g,h,i,j,k,l,m,n=this,o=[],p=[],q=function(a){if(!a)return a={},a.nodes=p,a.links=o,a.width=b,a.height=c,void(i=new ForceLayouter(a));switch(a.type.toLowerCase()){case"force":a.nodes=p,a.links=o,a.width=b,a.height=c,i=new ForceLayouter(a);break;default:throw"Sorry unknown layout type."}},r=function(a){f.setNodeLimit(a,n.start)},s=function(d){d&&(j=new ZoomManager(b,c,a,k,g,h,{},r))},t=function(a){var b=a.edgeShaper||{},c=a.nodeShaper||{},d=c.idfunc||void 0,e=a.zoom||!1;b.shape=b.shape||{type:EdgeShaper.shapes.ARROW},q(a.layouter),m=k.append("g"),h=new EdgeShaper(m,b),l=k.append("g"),g=new NodeShaper(l,c,d),i.setCombinedUpdateFunction(g,h),s(e)};switch(d.type.toLowerCase()){case"arango":d.width=b,d.height=c,f=new ArangoAdapter(p,o,this,d),f.setChildLimit(10);break;case"gharial":d.width=b,d.height=c,f=new GharialAdapter(p,o,this,d),f.setChildLimit(10);break;case"foxx":d.width=b,d.height=c,f=new FoxxAdapter(p,o,d.route,this,d);break;case"json":f=new JSONAdapter(d.path,p,o,this,b,c);break;case"preview":d.width=b,d.height=c,f=new PreviewAdapter(p,o,this,d);break;default:throw"Sorry unknown adapter type."}k=a.append("g"),t(e||{}),this.start=function(a){i.stop(),a&&(""!==$(".infoField").text()?_.each(p,function(a){_.each(f.randomNodes,function(b){a._id===b._id&&(a._expanded=!0)})}):_.each(p,function(a){a._expanded=!0})),g.drawNodes(p),h.drawEdges(o),i.start()},this.loadGraph=function(a,b){f.loadInitialNode(a,function(a){return a.errorCode?void b(a):(a._expanded=!0,n.start(),void(_.isFunction(b)&&b()))})},this.loadGraphWithRandomStart=function(a,b){f.loadRandomNode(function(b){return b.errorCode&&404===b.errorCode?void a(b):(b._expanded=!0,n.start(!0),void(_.isFunction(a)&&a()))},b)},this.loadGraphWithAdditionalNode=function(a,b,c){f.loadAdditionalNodeByAttributeValue(a,b,function(a){return a.errorCode?void c(a):(a._expanded=!0,n.start(),void(_.isFunction(c)&&c()))})},this.loadGraphWithAttributeValue=function(a,b,c){f.randomNodes=[],f.definedNodes=[],f.loadInitialNodeByAttributeValue(a,b,function(a){return a.errorCode?void c(a):(a._expanded=!0,n.start(),void(_.isFunction(c)&&c()))})},this.cleanUp=function(){g.resetColourMap(),h.resetColourMap()},this.changeWidth=function(a){i.changeWidth(a),j.changeWidth(a),f.setWidth(a)},this.dispatcherConfig={expand:{edges:o,nodes:p,startCallback:n.start,adapter:f,reshapeNodes:g.reshapeNodes},drag:{layouter:i},nodeEditor:{nodes:p,adapter:f},edgeEditor:{edges:o,adapter:f}},this.adapter=f,this.nodeShaper=g,this.edgeShaper=h,this.layouter=i,this.zoomManager=j}EdgeShaper.shapes=Object.freeze({NONE:0,ARROW:1}),NodeShaper.shapes=Object.freeze({NONE:0,CIRCLE:1,RECT:2,IMAGE:3});var modalDialogHelper=modalDialogHelper||{};!function(){"use strict";var a,b=function(a){$(document).bind("keypress.key13",function(b){b.which&&13===b.which&&$(a).click()})},c=function(){$(document).unbind("keypress.key13")},d=function(a,b,c,d,e){var f,g,h=function(){e(f)},i=modalDialogHelper.modalDivTemplate(a,b,c,h),j=document.createElement("tr"),k=document.createElement("th"),l=document.createElement("th"),m=document.createElement("th"),n=document.createElement("button"),o=1;f=function(){var a={};return _.each($("#"+c+"table tr:not(#first_row)"),function(b){var c=$(".keyCell input",b).val(),d=$(".valueCell input",b).val();a[c]=d}),a},i.appendChild(j),j.id="first_row",j.appendChild(k),k.className="keyCell",j.appendChild(l),l.className="valueCell",j.appendChild(m),m.className="actionCell",m.appendChild(n),n.id=c+"new",n.className="graphViewer-icon-button gv-icon-small add",g=function(a,b){var d,e,f,g=/^_(id|rev|key|from|to)/,h=document.createElement("tr"),j=document.createElement("th"),k=document.createElement("th"),l=document.createElement("th");g.test(b)||(i.appendChild(h),h.appendChild(k),k.className="keyCell",e=document.createElement("input"),e.type="text",e.id=c+b+"_key",e.value=b,k.appendChild(e),h.appendChild(l),l.className="valueCell",f=document.createElement("input"),f.type="text",f.id=c+b+"_value","object"==typeof a?f.value=JSON.stringify(a):f.value=a,l.appendChild(f),h.appendChild(j),j.className="actionCell",d=document.createElement("button"),d.id=c+b+"_delete",d.className="graphViewer-icon-button gv-icon-small delete",j.appendChild(d),d.onclick=function(){i.removeChild(h)})},n.onclick=function(){g("","new_"+o),o++},_.each(d,g),$("#"+c+"modal").modal("show")},e=function(a,b,c,d,e){var f=modalDialogHelper.modalDivTemplate(a,b,c,e),g=document.createElement("tr"),h=document.createElement("th"),i=document.createElement("pre");f.appendChild(g),g.appendChild(h),h.appendChild(i),i.className="gv-object-view",i.innerHTML=JSON.stringify(d,null,2),$("#"+c+"modal").modal("show")},f=function(a,b){var c=document.createElement("input");return c.type="text",c.id=a,c.value=b,c},g=function(a,b){var c=document.createElement("input");return c.type="checkbox",c.id=a,c.checked=b,c},h=function(a,b,c){var d=document.createElement("select");return d.id=a,_.each(_.sortBy(b,function(a){return a.toLowerCase()}),function(a){var b=document.createElement("option");b.value=a,b.selected=a===c,b.appendChild(document.createTextNode(a)),d.appendChild(b)}),d},i=function(a){var b=$(".decission_"+a),c=$("input[type='radio'][name='"+a+"']:checked").attr("id");b.each(function(){$(this).attr("decider")===c?$(this).css("display",""):$(this).css("display","none")})},j=function(b,c,d,e,f,g,h,j){var k=document.createElement("input"),l=b+c,m=document.createElement("label"),n=document.createElement("tbody");k.id=l,k.type="radio",k.name=d,k.className="gv-radio-button",m.className="radio",h.appendChild(m),m.appendChild(k),m.appendChild(document.createTextNode(e)),j.appendChild(n),$(n).toggleClass("decission_"+d,!0),$(n).attr("decider",l),_.each(g,function(c){a(n,b,c)}),f?k.checked=!0:k.checked=!1,m.onclick=function(a){i(d),a.stopPropagation()},i(d)},k=function(a,b,c,d,e,f){var g,h=[],i=a+b,j=1,k=document.createElement("th"),l=document.createElement("button"),m=document.createElement("input"),n=function(a){j++;var c,d=document.createElement("tr"),g=document.createElement("th"),k=document.createElement("th"),l=document.createElement("th"),m=document.createElement("input"),n=document.createElement("button");m.type="text",m.id=i+"_"+j,m.value=a||"",c=0===h.length?$(f):$(h[h.length-1]),c.after(d),d.appendChild(g),g.className="collectionTh capitalize",g.appendChild(document.createTextNode(b+" "+j+":")),d.appendChild(k),k.className="collectionTh",k.appendChild(m),n.id=i+"_"+j+"_remove",n.className="graphViewer-icon-button gv-icon-small delete",n.onclick=function(){e.removeChild(d),h.splice(h.indexOf(d),1)},l.appendChild(n),d.appendChild(l),h.push(d)};for(m.type="text",m.id=i+"_1",d.appendChild(m),k.appendChild(l),f.appendChild(k),l.onclick=function(){n()},l.id=i+"_addLine",l.className="graphViewer-icon-button gv-icon-small add","string"==typeof c&&c.length>0&&(c=[c]),c.length>0&&(m.value=c[0]),g=1;g'+c+""),a.disabled||$("#subNavigationBar .bottom").children().last().bind("click",function(){window.App.navigate(a.route,{trigger:!0})})})},buildUserSubNav:function(a,b){var c={General:{route:"#user/"+encodeURIComponent(a)},Permissions:{route:"#user/"+encodeURIComponent(a)+"/permission"}};c[b].active=!0,this.buildSubNavBar(c)},buildGraphSubNav:function(a,b){var c={Content:{route:"#graph2/"+encodeURIComponent(a)},Settings:{route:"#graph2/"+encodeURIComponent(a)+"/settings"}};c[b].active=!0,this.buildSubNavBar(c)},buildNodeSubNav:function(a,b,c){var d={Dashboard:{route:"#node/"+encodeURIComponent(a)}};d[b].active=!0,d[c].disabled=!0,this.buildSubNavBar(d)},buildNodesSubNav:function(a,b){var c={Overview:{route:"#nodes"},Shards:{route:"#shards"}};c[a].active=!0,b&&(c[b].disabled=!0),this.buildSubNavBar(c)},scaleability:void 0,buildCollectionSubNav:function(a,b){var c="#collection/"+encodeURIComponent(a),d={Content:{route:c+"/documents/1"},Indices:{route:"#cIndices/"+encodeURIComponent(a)},Info:{route:"#cInfo/"+encodeURIComponent(a)},Settings:{route:"#cSettings/"+encodeURIComponent(a)}};d[b].active=!0,this.buildSubNavBar(d)},enableKeyboardHotkeys:function(a){var b=window.arangoHelper.hotkeysFunctions;a===!0&&($(document).on("keydown",null,"j",b.scrollDown),$(document).on("keydown",null,"k",b.scrollUp))},databaseAllowed:function(a){var b=function(b,c){b?arangoHelper.arangoError("",""):$.ajax({type:"GET",cache:!1,url:this.databaseUrl("/_api/database/",c),contentType:"application/json",processData:!1,success:function(){a(!1,!0)},error:function(){a(!0,!1)}})}.bind(this);this.currentDatabase(b)},arangoNotification:function(a,b,c){window.App.notificationList.add({title:a,content:b,info:c,type:"success"})},arangoError:function(a,b,c){window.App.notificationList.add({title:a,content:b,info:c,type:"error"})},arangoWarning:function(a,b,c){window.App.notificationList.add({title:a,content:b,info:c,type:"warning"})},arangoMessage:function(a,b,c){window.App.notificationList.add({title:a,content:b,info:c,type:"message"})},hideArangoNotifications:function(){$.noty.clearQueue(),$.noty.closeAll()},openDocEditor:function(a,b,c){var d=a.split("/"),e=this,f=new window.DocumentView({collection:window.App.arangoDocumentStore});f.breadcrumb=function(){},f.colid=d[0],f.docid=d[1],f.el=".arangoFrame .innerDiv",f.render(),f.setType(b),$(".arangoFrame .headerBar").remove(),$(".arangoFrame .outerDiv").prepend(''),$(".arangoFrame .outerDiv").click(function(){e.closeDocEditor()}),$(".arangoFrame .innerDiv").click(function(a){a.stopPropagation()}),$(".fa-times").click(function(){e.closeDocEditor()}),$(".arangoFrame").show(),f.customView=!0,f.customDeleteFunction=function(){window.modalView.hide(),$(".arangoFrame").hide()},$(".arangoFrame #deleteDocumentButton").click(function(){f.deleteDocumentModal()}),$(".arangoFrame #saveDocumentButton").click(function(){f.saveDocument()}),$(".arangoFrame #deleteDocumentButton").css("display","none")},closeDocEditor:function(){$(".arangoFrame .outerDiv .fa-times").remove(),$(".arangoFrame").hide()},addAardvarkJob:function(a,b){$.ajax({cache:!1,type:"POST",url:this.databaseUrl("/_admin/aardvark/job"),data:JSON.stringify(a),contentType:"application/json",processData:!1,success:function(a){b&&b(!1,a)},error:function(a){b&&b(!0,a)}})},deleteAardvarkJob:function(a,b){$.ajax({cache:!1,type:"DELETE",url:this.databaseUrl("/_admin/aardvark/job/"+encodeURIComponent(a)),contentType:"application/json",processData:!1,success:function(a){b&&b(!1,a)},error:function(a){b&&b(!0,a)}})},deleteAllAardvarkJobs:function(a){$.ajax({cache:!1,type:"DELETE",url:this.databaseUrl("/_admin/aardvark/job"),contentType:"application/json",processData:!1,success:function(b){a&&a(!1,b)},error:function(b){a&&a(!0,b)}})},getAardvarkJobs:function(a){$.ajax({cache:!1,type:"GET",url:this.databaseUrl("/_admin/aardvark/job"),contentType:"application/json",processData:!1,success:function(b){a&&a(!1,b)},error:function(b){a&&a(!0,b)}})},getPendingJobs:function(a){$.ajax({cache:!1,type:"GET",url:this.databaseUrl("/_api/job/pending"),contentType:"application/json",processData:!1,success:function(b){a(!1,b)},error:function(b){a(!0,b)}})},syncAndReturnUninishedAardvarkJobs:function(a,b){var c=function(c,d){if(c)b(!0);else{var e=function(c,e){if(c)arangoHelper.arangoError("","");else{var f=[];e.length>0?_.each(d,function(b){if(b.type===a||void 0===b.type){var c=!1;_.each(e,function(a){b.id===a&&(c=!0)}),c?f.push({collection:b.collection,id:b.id,type:b.type,desc:b.desc}):window.arangoHelper.deleteAardvarkJob(b.id)}}):d.length>0&&this.deleteAllAardvarkJobs(),b(!1,f)}}.bind(this);this.getPendingJobs(e)}}.bind(this);this.getAardvarkJobs(c)},getRandomToken:function(){return Math.round((new Date).getTime())},isSystemAttribute:function(a){var b=this.systemAttributes();return b[a]},isSystemCollection:function(a){return"_"===a.name.substr(0,1)},setDocumentStore:function(a){this.arangoDocumentStore=a},collectionApiType:function(a,b,c){if(b||void 0===this.CollectionTypes[a]){var d=function(b,c,d){b?arangoHelper.arangoError("Error","Could not detect collection type"):(this.CollectionTypes[a]=c.type,3===this.CollectionTypes[a]?d(!1,"edge"):d(!1,"document"))}.bind(this);this.arangoDocumentStore.getCollectionInfo(a,d,c)}else c(!1,this.CollectionTypes[a])},collectionType:function(a){if(!a||""===a.name)return"-";var b;return b=2===a.type?"document":3===a.type?"edge":"unknown",this.isSystemCollection(a)&&(b+=" (system)"),b},formatDT:function(a){var b=function(a){return 10>a?"0"+a:a};return a.getUTCFullYear()+"-"+b(a.getUTCMonth()+1)+"-"+b(a.getUTCDate())+" "+b(a.getUTCHours())+":"+b(a.getUTCMinutes())+":"+b(a.getUTCSeconds())},escapeHtml:function(a){return String(a).replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")},backendUrl:function(a){return frontendConfig.basePath+a},databaseUrl:function(a,b){if("/_db/"===a.substr(0,5))throw new Error("Calling databaseUrl with a databased url ("+a+") doesn't make any sense");return b||(b="_system",frontendConfig.db&&(b=frontendConfig.db)),this.backendUrl("/_db/"+encodeURIComponent(b)+a)},showAuthDialog:function(){var a=!0,b=localStorage.getItem("authenticationNotification");return"false"===b&&(a=!1),a},doNotShowAgain:function(){localStorage.setItem("authenticationNotification",!1)},renderEmpty:function(a){$("#content").html('")},download:function(a,b){$.ajax(a).success(function(a,c,d){if(b)return void b(a);var e=new Blob([JSON.stringify(a)],{type:d.getResponseHeader("Content-Type")||"application/octet-stream"}),f=window.URL.createObjectURL(e),g=document.createElement("a");document.body.appendChild(g),g.style="display: none",g.href=f,g.download=d.getResponseHeader("Content-Disposition").replace(/.* filename="([^")]*)"/,"$1"),g.click(),window.URL.revokeObjectURL(f),document.body.removeChild(g)})}}}(),function(){"use strict";if(!window.hasOwnProperty("TEST_BUILD")){var a=function(){var a={};return a.createTemplate=function(a){var b=$("#"+a.replace(".","\\.")).html();return{render:function(a){var c=_.template(b);return c=c(a)}}},a};window.templateEngine=new a}}(),function(){"use strict";window.dygraphConfig={defaultFrame:12e5,zeropad:function(a){return 10>a?"0"+a:a},xAxisFormat:function(a){if(-1===a)return"";var b=new Date(a);return this.zeropad(b.getHours())+":"+this.zeropad(b.getMinutes())+":"+this.zeropad(b.getSeconds())},mergeObjects:function(a,b,c){c||(c=[]);var d,e={};return c.forEach(function(c){var d=a[c],f=b[c];void 0===d&&(d={}),void 0===f&&(f={}),e[c]=_.extend(d,f)}),d=_.extend(a,b),Object.keys(e).forEach(function(a){d[a]=e[a]}),d},mapStatToFigure:{pageFaults:["times","majorPageFaultsPerSecond","minorPageFaultsPerSecond"],systemUserTime:["times","systemTimePerSecond","userTimePerSecond"],totalTime:["times","avgQueueTime","avgRequestTime","avgIoTime"],dataTransfer:["times","bytesSentPerSecond","bytesReceivedPerSecond"],requests:["times","getsPerSecond","putsPerSecond","postsPerSecond","deletesPerSecond","patchesPerSecond","headsPerSecond","optionsPerSecond","othersPerSecond"]},colors:["rgb(95, 194, 135)","rgb(238, 190, 77)","#81ccd8","#7ca530","#3c3c3c","#aa90bd","#e1811d","#c7d4b2","#d0b2d4"],figureDependedOptions:{clusterRequestsPerSecond:{showLabelsOnHighlight:!0,title:"",header:"Cluster Requests per Second",stackedGraph:!0,div:"lineGraphLegend",labelsKMG2:!1,axes:{y:{valueFormatter:function(a){return parseFloat(a.toPrecision(3))},axisLabelFormatter:function(a){return 0===a?0:parseFloat(a.toPrecision(3))}}}},pageFaults:{header:"Page Faults",visibility:[!0,!1],labels:["datetime","Major Page","Minor Page"],div:"pageFaultsChart",labelsKMG2:!1,axes:{y:{valueFormatter:function(a){return parseFloat(a.toPrecision(3))},axisLabelFormatter:function(a){return 0===a?0:parseFloat(a.toPrecision(3))}}}},systemUserTime:{div:"systemUserTimeChart",header:"System and User Time",labels:["datetime","System Time","User Time"],stackedGraph:!0,labelsKMG2:!1,axes:{y:{valueFormatter:function(a){return parseFloat(a.toPrecision(3))},axisLabelFormatter:function(a){return 0===a?0:parseFloat(a.toPrecision(3))}}}},totalTime:{div:"totalTimeChart",header:"Total Time",labels:["datetime","Queue","Computation","I/O"],labelsKMG2:!1,axes:{y:{valueFormatter:function(a){return parseFloat(a.toPrecision(3))},axisLabelFormatter:function(a){return 0===a?0:parseFloat(a.toPrecision(3))}}},stackedGraph:!0},dataTransfer:{header:"Data Transfer",labels:["datetime","Bytes sent","Bytes received"],stackedGraph:!0,div:"dataTransferChart"},requests:{header:"Requests",labels:["datetime","Reads","Writes"],stackedGraph:!0,div:"requestsChart",axes:{y:{valueFormatter:function(a){return parseFloat(a.toPrecision(3))},axisLabelFormatter:function(a){return 0===a?0:parseFloat(a.toPrecision(3))}}}}},getDashBoardFigures:function(a){var b=[],c=this;return Object.keys(this.figureDependedOptions).forEach(function(d){"clusterRequestsPerSecond"!==d&&(c.figureDependedOptions[d].div||a)&&b.push(d)}),b},getDefaultConfig:function(a){var b=this,c={digitsAfterDecimal:1,drawGapPoints:!0,fillGraph:!0,fillAlpha:.85,showLabelsOnHighlight:!1,strokeWidth:0,lineWidth:0,strokeBorderWidth:0,includeZero:!0,highlightCircleSize:2.5,labelsSeparateLines:!0,strokeBorderColor:"rgba(0,0,0,0)",interactionModel:{},maxNumberWidth:10,colors:[this.colors[0]],xAxisLabelWidth:"50",rightGap:15,showRangeSelector:!1,rangeSelectorHeight:50,rangeSelectorPlotStrokeColor:"#365300",rangeSelectorPlotFillColor:"",pixelsPerLabel:50,labelsKMG2:!0,dateWindow:[(new Date).getTime()-this.defaultFrame,(new Date).getTime()],axes:{x:{valueFormatter:function(a){return b.xAxisFormat(a)}},y:{ticker:Dygraph.numericLinearTicks}}};return this.figureDependedOptions[a]&&(c=this.mergeObjects(c,this.figureDependedOptions[a],["axes"]),c.div&&c.labels&&(c.colors=this.getColors(c.labels),c.labelsDiv=document.getElementById(c.div+"Legend"),c.legend="always",c.showLabelsOnHighlight=!0)),c},getDetailChartConfig:function(a){var b=_.extend(this.getDefaultConfig(a),{showRangeSelector:!0,interactionModel:null,showLabelsOnHighlight:!0,highlightCircleSize:2.5,legend:"always",labelsDiv:"div#detailLegend.dashboard-legend-inner"});return"pageFaults"===a&&(b.visibility=[!0,!0]),b.labels||(b.labels=["datetime",b.header],b.colors=this.getColors(b.labels)),b},getColors:function(a){var b;return b=this.colors.concat([]),b.slice(0,a.length-1)}}}(),function(){"use strict";window.arangoCollectionModel=Backbone.Model.extend({idAttribute:"name",urlRoot:arangoHelper.databaseUrl("/_api/collection"),defaults:{id:"",name:"",status:"",type:"",isSystem:!1,picture:"",locked:!1,desc:void 0},getProperties:function(a){$.ajax({type:"GET",cache:!1,url:arangoHelper.databaseUrl("/_api/collection/"+encodeURIComponent(this.get("id"))+"/properties"),contentType:"application/json",processData:!1,success:function(b){a(!1,b)},error:function(b){a(!0,b)}})},getFigures:function(a){$.ajax({type:"GET",cache:!1,url:arangoHelper.databaseUrl("/_api/collection/"+this.get("id")+"/figures"),contentType:"application/json",processData:!1,success:function(b){a(!1,b)},error:function(){a(!0)}})},getRevision:function(a,b){$.ajax({type:"GET",cache:!1,url:arangoHelper.databaseUrl("/_api/collection/"+this.get("id")+"/revision"),contentType:"application/json",processData:!1,success:function(c){a(!1,c,b)},error:function(){a(!0)}})},getIndex:function(a){$.ajax({type:"GET",cache:!1,url:arangoHelper.databaseUrl("/_api/index/?collection="+this.get("id")),contentType:"application/json",processData:!1,success:function(b){a(!1,b)},error:function(b){a(!0,b)}})},createIndex:function(a,b){var c=this;$.ajax({cache:!1,type:"POST",url:arangoHelper.databaseUrl("/_api/index?collection="+c.get("id")),headers:{"x-arango-async":"store"},data:JSON.stringify(a),contentType:"application/json",processData:!1,success:function(a,d,e){e.getResponseHeader("x-arango-async-id")?(window.arangoHelper.addAardvarkJob({id:e.getResponseHeader("x-arango-async-id"),type:"index",desc:"Creating Index",collection:c.get("id")}),b(!1,a)):b(!0,a)},error:function(a){b(!0,a)}})},deleteIndex:function(a,b){ var c=this;$.ajax({cache:!1,type:"DELETE",url:arangoHelper.databaseUrl("/_api/index/"+this.get("name")+"/"+encodeURIComponent(a)),headers:{"x-arango-async":"store"},success:function(a,d,e){e.getResponseHeader("x-arango-async-id")?(window.arangoHelper.addAardvarkJob({id:e.getResponseHeader("x-arango-async-id"),type:"index",desc:"Removing Index",collection:c.get("id")}),b(!1,a)):b(!0,a)},error:function(a){b(!0,a)}}),b()},truncateCollection:function(){$.ajax({cache:!1,type:"PUT",url:arangoHelper.databaseUrl("/_api/collection/"+this.get("id")+"/truncate"),success:function(){arangoHelper.arangoNotification("Collection truncated.")},error:function(){arangoHelper.arangoError("Collection error.")}})},loadCollection:function(a){$.ajax({cache:!1,type:"PUT",url:arangoHelper.databaseUrl("/_api/collection/"+this.get("id")+"/load"),success:function(){a(!1)},error:function(){a(!0)}}),a()},unloadCollection:function(a){$.ajax({cache:!1,type:"PUT",url:arangoHelper.databaseUrl("/_api/collection/"+this.get("id")+"/unload?flush=true"),success:function(){a(!1)},error:function(){a(!0)}}),a()},renameCollection:function(a,b){var c=this;$.ajax({cache:!1,type:"PUT",url:arangoHelper.databaseUrl("/_api/collection/"+this.get("id")+"/rename"),data:JSON.stringify({name:a}),contentType:"application/json",processData:!1,success:function(){c.set("name",a),b(!1)},error:function(a){b(!0,a)}})},changeCollection:function(a,b,c,d){var e=!1;"true"===a?a=!0:"false"===a&&(a=!1);var f={waitForSync:a,journalSize:parseInt(b,10),indexBuckets:parseInt(c,10)};return $.ajax({cache:!1,type:"PUT",url:arangoHelper.databaseUrl("/_api/collection/"+this.get("id")+"/properties"),data:JSON.stringify(f),contentType:"application/json",processData:!1,success:function(){d(!1)},error:function(a){d(!1,a)}}),e}})}(),window.DatabaseModel=Backbone.Model.extend({idAttribute:"name",initialize:function(){"use strict"},isNew:function(){"use strict";return!1},sync:function(a,b,c){"use strict";return"update"===a&&(a="create"),Backbone.sync(a,b,c)},url:arangoHelper.databaseUrl("/_api/database"),defaults:{}}),window.arangoDocumentModel=Backbone.Model.extend({initialize:function(){"use strict"},urlRoot:arangoHelper.databaseUrl("/_api/document"),defaults:{_id:"",_rev:"",_key:""},getSorted:function(){"use strict";var a=this,b=Object.keys(a.attributes).sort(function(a,b){var c=arangoHelper.isSystemAttribute(a),d=arangoHelper.isSystemAttribute(b);return c!==d?c?-1:1:b>a?-1:1}),c={};return _.each(b,function(b){c[b]=a.attributes[b]}),c}}),function(){"use strict";window.ArangoQuery=Backbone.Model.extend({urlRoot:arangoHelper.databaseUrl("/_api/user"),defaults:{name:"",type:"custom",value:""}})}(),window.Replication=Backbone.Model.extend({defaults:{state:{},server:{}},initialize:function(){}}),window.Statistics=Backbone.Model.extend({defaults:{},url:function(){"use strict";return"/_admin/statistics"}}),window.StatisticsDescription=Backbone.Model.extend({defaults:{figures:"",groups:""},url:function(){"use strict";return"/_admin/statistics-description"}}),window.Users=Backbone.Model.extend({defaults:{user:"",active:!1,extra:{}},idAttribute:"user",parse:function(a){return this.isNotNew=!0,a},isNew:function(){return!this.isNotNew},url:function(){return this.isNew()?arangoHelper.databaseUrl("/_api/user"):""!==this.get("user")?arangoHelper.databaseUrl("/_api/user/"+this.get("user")):arangoHelper.databaseUrl("/_api/user")},checkPassword:function(a,b){$.ajax({cache:!1,type:"POST",url:arangoHelper.databaseUrl("/_api/user/"+this.get("user")),data:JSON.stringify({passwd:a}),contentType:"application/json",processData:!1,success:function(a){b(!1,a)},error:function(a){b(!0,a)}})},setPassword:function(a){$.ajax({cache:!1,type:"PATCH",url:arangoHelper.databaseUrl("/_api/user/"+this.get("user")),data:JSON.stringify({passwd:a}),contentType:"application/json",processData:!1})},setExtras:function(a,b,c){$.ajax({cache:!1,type:"PATCH",url:arangoHelper.databaseUrl("/_api/user/"+this.get("user")),data:JSON.stringify({extra:{name:a,img:b}}),contentType:"application/json",processData:!1,success:function(){c(!1)},error:function(){c(!0)}})}}),function(){"use strict";window.ClusterCoordinator=Backbone.Model.extend({defaults:{name:"",status:"ok",address:"",protocol:""},idAttribute:"name",forList:function(){return{name:this.get("name"),status:this.get("status"),url:this.get("url")}}})}(),function(){"use strict";window.ClusterServer=Backbone.Model.extend({defaults:{name:"",address:"",role:"",status:"ok"},idAttribute:"name",forList:function(){return{name:this.get("name"),address:this.get("address"),status:this.get("status")}}})}(),function(){"use strict";window.Coordinator=Backbone.Model.extend({defaults:{address:"",protocol:"",name:"",status:""}})}(),function(){"use strict";window.CurrentDatabase=Backbone.Model.extend({url:arangoHelper.databaseUrl("/_api/database/current",frontendConfig.db),parse:function(a){return a.result}})}(),function(){"use strict";var a=function(a,b,c,d,e,f){var g={contentType:"application/json",processData:!1,type:c};b=b||function(){},f=_.extend({mount:a.encodedMount()},f);var h=_.reduce(f,function(a,b,c){return a+encodeURIComponent(c)+"="+encodeURIComponent(b)+"&"},"?");g.url=arangoHelper.databaseUrl("/_admin/aardvark/foxxes"+(d?"/"+d:"")+h.slice(0,h.length-1)),void 0!==e&&(g.data=JSON.stringify(e)),$.ajax(g).then(function(a){b(null,a)},function(a){window.xhr=a,b(_.extend(a.status?new Error(a.responseJSON?a.responseJSON.errorMessage:a.responseText):new Error("Network Error"),{statusCode:a.status}))})};window.Foxx=Backbone.Model.extend({idAttribute:"mount",defaults:{author:"Unknown Author",name:"",version:"Unknown Version",description:"No description",license:"Unknown License",contributors:[],scripts:{},config:{},deps:{},git:"",system:!1,development:!1},isNew:function(){return!1},encodedMount:function(){return encodeURIComponent(this.get("mount"))},destroy:function(b,c){a(this,c,"DELETE",void 0,void 0,b)},isBroken:function(){return!1},needsAttention:function(){return this.isBroken()||this.needsConfiguration()||this.hasUnconfiguredDependencies()},needsConfiguration:function(){return _.any(this.get("config"),function(a){return void 0===a.current&&a.required!==!1})},hasUnconfiguredDependencies:function(){return _.any(this.get("deps"),function(a){return void 0===a.current&&a.definition.required!==!1})},getConfiguration:function(b){a(this,function(a,c){a||this.set("config",c),"function"==typeof b&&b(a,c)}.bind(this),"GET","config")},setConfiguration:function(b,c){a(this,c,"PATCH","config",b)},getDependencies:function(b){a(this,function(a,c){a||this.set("deps",c),"function"==typeof b&&b(a,c)}.bind(this),"GET","deps")},setDependencies:function(b,c){a(this,c,"PATCH","deps",b)},toggleDevelopment:function(b,c){a(this,function(a,d){a||this.set("development",b),"function"==typeof c&&c(a,d)}.bind(this),"PATCH","devel",b)},runScript:function(b,c,d){a(this,d,"POST","scripts/"+b,c)},runTests:function(b,c){a(this,function(a,b){"function"==typeof c&&c(a?a.responseJSON:a,b)},"POST","tests",b)},isSystem:function(){return this.get("system")},isDevelopment:function(){return this.get("development")},download:function(){a(this,function(a,b){return a?void console.error(a.responseJSON):void(window.location.href=arangoHelper.databaseUrl("/_admin/aardvark/foxxes/download/zip?mount="+this.encodedMount()+"&nonce="+b.nonce))}.bind(this),"POST","download/nonce")},fetchThumbnail:function(a){var b=new XMLHttpRequest;b.responseType="blob",b.onload=function(){this.thumbnailUrl=URL.createObjectURL(b.response),a()}.bind(this),b.onerror=a,b.open("GET","foxxes/thumbnail?mount="+this.encodedMount()),window.arangoHelper.getCurrentJwt()&&b.setRequestHeader("Authorization","bearer "+window.arangoHelper.getCurrentJwt()),b.send()}})}(),function(){"use strict";window.Graph=Backbone.Model.extend({idAttribute:"_key",urlRoot:arangoHelper.databaseUrl("/_api/gharial"),isNew:function(){return!this.get("_id")},parse:function(a){return a.graph||a},addEdgeDefinition:function(a){$.ajax({async:!1,type:"POST",url:this.urlRoot+"/"+this.get("_key")+"/edge",data:JSON.stringify(a)})},deleteEdgeDefinition:function(a){$.ajax({async:!1,type:"DELETE",url:this.urlRoot+"/"+this.get("_key")+"/edge/"+a})},modifyEdgeDefinition:function(a){$.ajax({async:!1,type:"PUT",url:this.urlRoot+"/"+this.get("_key")+"/edge/"+a.collection,data:JSON.stringify(a)})},addVertexCollection:function(a){$.ajax({async:!1,type:"POST",url:this.urlRoot+"/"+this.get("_key")+"/vertex",data:JSON.stringify({collection:a})})},deleteVertexCollection:function(a){$.ajax({async:!1,type:"DELETE",url:this.urlRoot+"/"+this.get("_key")+"/vertex/"+a})},defaults:{name:"",edgeDefinitions:[],orphanCollections:[]}})}(),function(){"use strict";window.newArangoLog=Backbone.Model.extend({defaults:{lid:"",level:"",timestamp:"",text:"",totalAmount:""},getLogStatus:function(){switch(this.get("level")){case 1:return"Error";case 2:return"Warning";case 3:return"Info";case 4:return"Debug";default:return"Unknown"}}})}(),function(){"use strict";window.Notification=Backbone.Model.extend({defaults:{title:"",date:0,content:"",priority:"",tags:"",seen:!1}})}(),function(){"use strict";window.queryManagementModel=Backbone.Model.extend({defaults:{id:"",query:"",started:"",runTime:""}})}(),window.UserConfig=Backbone.Model.extend({defaults:{graphs:"",queries:[]},model:window.UserConfigModel,parse:function(a){return a.result},url:function(){return window.App.currentUser?this.username=window.App.currentUser:this.username="root",arangoHelper.databaseUrl("/_api/user/"+encodeURIComponent(this.username)+"/config")},setItem:function(a,b,c){var d=this;$.ajax({type:"PUT",cache:!1,url:arangoHelper.databaseUrl("/_api/user/"+encodeURIComponent(this.username)+"/config/"+encodeURIComponent(a)),contentType:"application/json",processData:!1,data:JSON.stringify({value:b}),async:!0,success:function(){d.set(a,b),c&&c()},error:function(){arangoHelper.arangoError("User configuration","Could not update user configuration for key: "+a)}})},getItem:function(a,b){$.ajax({type:"GET",cache:!1,url:arangoHelper.databaseUrl("/_api/user/"+encodeURIComponent(this.username)+"/config/"+encodeURIComponent(a)),contentType:"application/json",processData:!1,async:!0,success:function(a){b(a)},error:function(){arangoHelper.arangoError("User configuration","Could not fetch user configuration for key: "+a)}})}}),function(){"use strict";window.workMonitorModel=Backbone.Model.extend({defaults:{name:"",number:"",status:"",type:""}})}(),function(){"use strict";window.AutomaticRetryCollection=Backbone.Collection.extend({_retryCount:0,checkRetries:function(){var a=this;return this.updateUrl(),this._retryCount>10?(window.setTimeout(function(){a._retryCount=0},1e4),window.App.clusterUnreachable(),!1):!0},successFullTry:function(){this._retryCount=0},failureTry:function(a,b,c){401===c.status?window.App.requestAuth():(window.App.clusterPlan.rotateCoordinator(),this._retryCount++,a())}})}(),function(){"use strict";window.PaginatedCollection=Backbone.Collection.extend({page:0,pagesize:10,totalAmount:0,getPage:function(){return this.page+1},setPage:function(a){return a>=this.getLastPageNumber()?void(this.page=this.getLastPageNumber()-1):1>a?void(this.page=0):void(this.page=a-1)},getLastPageNumber:function(){return Math.max(Math.ceil(this.totalAmount/this.pagesize),1)},getOffset:function(){return this.page*this.pagesize},getPageSize:function(){return this.pagesize},setPageSize:function(a){if("all"===a)this.pagesize="all";else try{a=parseInt(a,10),this.pagesize=a}catch(b){}},setToFirst:function(){this.page=0},setToLast:function(){this.setPage(this.getLastPageNumber())},setToPrev:function(){this.setPage(this.getPage()-1)},setToNext:function(){this.setPage(this.getPage()+1)},setTotal:function(a){this.totalAmount=a},getTotal:function(){return this.totalAmount},setTotalMinusOne:function(){this.totalAmount--}})}(),window.ClusterStatisticsCollection=Backbone.Collection.extend({model:window.Statistics,url:"/_admin/statistics",updateUrl:function(){this.url=window.App.getNewRoute(this.host)+this.url},initialize:function(a,b){this.host=b.host,window.App.registerForUpdate(this)}}),function(){"use strict";window.ArangoCollections=Backbone.Collection.extend({url:arangoHelper.databaseUrl("/_api/collection"),model:arangoCollectionModel,searchOptions:{searchPhrase:null,includeSystem:!1,includeDocument:!0,includeEdge:!0,includeLoaded:!0,includeUnloaded:!0,sortBy:"name",sortOrder:1},translateStatus:function(a){switch(a){case 0:return"corrupted";case 1:return"new born collection";case 2:return"unloaded";case 3:return"loaded";case 4:return"unloading";case 5:return"deleted";case 6:return"loading";default:return}},translateTypePicture:function(a){var b="";switch(a){case"document":b+="fa-file-text-o";break;case"edge":b+="fa-share-alt";break;case"unknown":b+="fa-question";break;default:b+="fa-cogs"}return b},parse:function(a){var b=this;return _.each(a.result,function(a){a.isSystem=arangoHelper.isSystemCollection(a),a.type=arangoHelper.collectionType(a),a.status=b.translateStatus(a.status),a.picture=b.translateTypePicture(a.type)}),a.result},getPosition:function(a){var b,c=this.getFiltered(this.searchOptions),d=null,e=null;for(b=0;b0&&(d=c[b-1]),b0){var e,f=d.get("name").toLowerCase();for(e=0;ed?-1:1):0}),b},newCollection:function(a,b){var c={};c.name=a.collName,c.waitForSync=a.wfs,a.journalSize>0&&(c.journalSize=a.journalSize),c.isSystem=a.isSystem,c.type=parseInt(a.collType,10),a.shards&&(c.numberOfShards=a.shards,c.shardKeys=a.keys),a.replicationFactor&&(c.replicationFactor=JSON.parse(a.replicationFactor)),$.ajax({cache:!1,type:"POST",url:arangoHelper.databaseUrl("/_api/collection"),data:JSON.stringify(c),contentType:"application/json",processData:!1,success:function(a){b(!1,a)},error:function(a){b(!0,a)}})}})}(),function(){"use strict";window.ArangoDatabase=Backbone.Collection.extend({model:window.DatabaseModel,sortOptions:{desc:!1},url:arangoHelper.databaseUrl("/_api/database"),comparator:function(a,b){var c=a.get("name").toLowerCase(),d=b.get("name").toLowerCase();return this.sortOptions.desc===!0?d>c?1:c>d?-1:0:c>d?1:d>c?-1:0},parse:function(a){return a?_.map(a.result,function(a){return{name:a}}):void 0},initialize:function(){var a=this;this.fetch().done(function(){a.sort()})},setSortingDesc:function(a){this.sortOptions.desc=a},getDatabases:function(){var a=this;return this.fetch().done(function(){a.sort()}),this.models},getDatabasesForUser:function(a){$.ajax({type:"GET",cache:!1,url:this.url+"/user",contentType:"application/json",processData:!1,success:function(b){a(!1,b.result.sort())},error:function(){a(!0,[])}})},createDatabaseURL:function(a,b,c){var d=window.location,e=window.location.hash;b=b?"SSL"===b||"https:"===b?"https:":"http:":d.protocol,c=c||d.port;var f=b+"//"+window.location.hostname+":"+c+"/_db/"+encodeURIComponent(a)+"/_admin/aardvark/standalone.html";if(e){var g=e.split("/")[0];0===g.indexOf("#collection")&&(g="#collections"),0===g.indexOf("#service")&&(g="#services"),f+=g}return f},getCurrentDatabase:function(a){$.ajax({type:"GET",cache:!1,url:this.url+"/current",contentType:"application/json",processData:!1,success:function(b){200===b.code?a(!1,b.result.name):a(!1,b)},error:function(b){a(!0,b)}})},hasSystemAccess:function(a){var b=function(b,c){b?arangoHelper.arangoError("DB","Could not fetch databases"):a(!1,_.includes(c,"_system"))};this.getDatabasesForUser(b)}})}(),window.ArangoDocument=Backbone.Collection.extend({url:"/_api/document/",model:arangoDocumentModel,collectionInfo:{},deleteEdge:function(a,b,c){this.deleteDocument(a,b,c)},deleteDocument:function(a,b,c){$.ajax({cache:!1,type:"DELETE",contentType:"application/json",url:arangoHelper.databaseUrl("/_api/document/"+encodeURIComponent(a)+"/"+encodeURIComponent(b)),success:function(){c(!1)},error:function(){c(!0)}})},addDocument:function(a,b){var c=this;c.createTypeDocument(a,b)},createTypeEdge:function(a,b,c,d,e){var f;f=d?JSON.stringify({_key:d,_from:b,_to:c}):JSON.stringify({_from:b,_to:c}),$.ajax({cache:!1,type:"POST",url:arangoHelper.databaseUrl("/_api/document?collection="+encodeURIComponent(a)),data:f,contentType:"application/json",processData:!1,success:function(a){e(!1,a)},error:function(a){e(!0,a)}})},createTypeDocument:function(a,b,c,d){var e;e=b?JSON.stringify({_key:b}):JSON.stringify({});var f=arangoHelper.databaseUrl("/_api/document?collection="+encodeURIComponent(a));d&&(f+="?returnNew=true"),$.ajax({cache:!1,type:"POST",url:f,data:e,contentType:"application/json",processData:!1,success:function(a){d?c(!1,a):c(!1,a._id)},error:function(a){c(!0,a._id,a.responseJSON)}})},getCollectionInfo:function(a,b,c){var d=this;$.ajax({cache:!1,type:"GET",url:arangoHelper.databaseUrl("/_api/collection/"+a+"?"+arangoHelper.getRandomToken()),contentType:"application/json",processData:!1,success:function(a){d.collectionInfo=a,b(!1,a,c)},error:function(a){b(!0,a,c)}})},getEdge:function(a,b,c){this.getDocument(a,b,c)},getDocument:function(a,b,c){var d=this;this.clearDocument(),$.ajax({cache:!1,type:"GET",url:arangoHelper.databaseUrl("/_api/document/"+encodeURIComponent(a)+"/"+encodeURIComponent(b)),contentType:"application/json",processData:!1,success:function(a){d.add(a),c(!1,a,"document")},error:function(a){d.add(!0,a)}})},saveEdge:function(a,b,c,d,e,f){var g;try{g=JSON.parse(e),g._to=d,g._from=c}catch(h){arangoHelper.arangoError("Edge","Could not parsed document.")}$.ajax({cache:!1,type:"PUT",url:arangoHelper.databaseUrl("/_api/document/"+encodeURIComponent(a)+"/"+encodeURIComponent(b))+"#replaceEdge",data:JSON.stringify(g),contentType:"application/json",processData:!1,success:function(a){f(!1,a)},error:function(a){f(!0,a)}})},saveDocument:function(a,b,c,d){$.ajax({cache:!1,type:"PUT",url:arangoHelper.databaseUrl("/_api/document/"+encodeURIComponent(a)+"/"+encodeURIComponent(b)),data:c,contentType:"application/json",processData:!1,success:function(a){d(!1,a)},error:function(a){d(!0,a)}})},updateLocalDocument:function(a){this.clearDocument(),this.add(a)},clearDocument:function(){this.reset()}}),function(){"use strict";window.ArangoDocuments=window.PaginatedCollection.extend({collectionID:1,filters:[],checkCursorTimer:void 0,MAX_SORT:12e3,lastQuery:{},sortAttribute:"",url:arangoHelper.databaseUrl("/_api/documents"),model:window.arangoDocumentModel,loadTotal:function(a){var b=this;$.ajax({cache:!1,type:"GET",url:arangoHelper.databaseUrl("/_api/collection/"+this.collectionID+"/count"),contentType:"application/json",processData:!1,success:function(c){b.setTotal(c.count),a(!1)},error:function(){a(!0)}})},setCollection:function(a){var b=function(a){a&&arangoHelper.arangoError("Documents","Could not fetch documents count")};this.resetFilter(),this.collectionID=a,this.setPage(1),this.loadTotal(b)},setSort:function(a){this.sortAttribute=a},getSort:function(){return this.sortAttribute},addFilter:function(a,b,c){this.filters.push({attr:a,op:b,val:c})},setFiltersForQuery:function(a){if(0===this.filters.length)return"";var b=" FILTER",c="",d=_.map(this.filters,function(b,d){return"LIKE"===b.op?(c=" "+b.op+"(x.`"+b.attr+"`, @param",c+=d,c+=")"):(c="IN"===b.op||"NOT IN"===b.op?" ":" x.`",c+=b.attr,c+="IN"===b.op||"NOT IN"===b.op?" ":"` ",c+=b.op,c+="IN"===b.op||"NOT IN"===b.op?" x.@param":" @param",c+=d),a["param"+d]=b.val,c});return b+d.join(" &&")},setPagesize:function(a){this.setPageSize(a)},resetFilter:function(){this.filters=[]},moveDocument:function(a,b,c,d){var e,f,g,h,i={"@collection":b,filterid:a};e="FOR x IN @@collection",e+=" FILTER x._key == @filterid",e+=" INSERT x IN ",e+=c,f="FOR x in @@collection",f+=" FILTER x._key == @filterid",f+=" REMOVE x IN @@collection",g={query:e,bindVars:i},h={query:f,bindVars:i},window.progressView.show(),$.ajax({cache:!1,type:"POST",url:arangoHelper.databaseUrl("/_api/cursor"),data:JSON.stringify(g),contentType:"application/json",success:function(){$.ajax({cache:!1,type:"POST",url:arangoHelper.databaseUrl("/_api/cursor"),data:JSON.stringify(h),contentType:"application/json",success:function(){d&&d(),window.progressView.hide()},error:function(){window.progressView.hide(),arangoHelper.arangoError("Document error","Documents inserted, but could not be removed.")}})},error:function(){window.progressView.hide(),arangoHelper.arangoError("Document error","Could not move selected documents.")}})},getDocuments:function(a){var b,c,d,e,f=this;c={"@collection":this.collectionID,offset:this.getOffset(),count:this.getPageSize()},b='FOR x IN @@collection LET att = APPEND(SLICE(ATTRIBUTES(x), 0, 25), "_key", true)',b+=this.setFiltersForQuery(c),this.getTotal()0&&(a+=" SORT x."+this.getSort()),a+=" RETURN x",b={query:a,bindVars:c}},uploadDocuments:function(a,b){$.ajax({type:"POST",url:arangoHelper.databaseUrl("/_api/import?type=auto&collection="+encodeURIComponent(this.collectionID)+"&createCollection=false"),data:a,processData:!1,contentType:"json",dataType:"json",complete:function(a){if(4===a.readyState&&201===a.status)b(!1);else try{var c=JSON.parse(a.responseText);if(c.errors>0){var d="At least one error occurred during upload";b(!1,d)}}catch(e){console.log(e)}}})}})}(),function(){"use strict";window.ArangoLogs=window.PaginatedCollection.extend({upto:!1,loglevel:0,totalPages:0,parse:function(a){var b=[];return _.each(a.lid,function(c,d){b.push({level:a.level[d],lid:c,text:a.text[d],timestamp:a.timestamp[d],totalAmount:a.totalAmount})}),this.totalAmount=a.totalAmount,this.totalPages=Math.ceil(this.totalAmount/this.pagesize),b},initialize:function(a){a.upto===!0&&(this.upto=!0),this.loglevel=a.loglevel},model:window.newArangoLog,url:function(){var a,b,c,d=this.totalAmount-(this.page+1)*this.pagesize;return 0>d&&this.page===this.totalPages-1?(d=0,c=this.totalAmount%this.pagesize):c=this.pagesize,0===this.totalAmount&&(c=1),a=this.upto?"upto":"level",b="/_admin/log?"+a+"="+this.loglevel+"&size="+c+"&offset="+d,arangoHelper.databaseUrl(b)}})}(),function(){"use strict";window.ArangoQueries=Backbone.Collection.extend({initialize:function(a,b){var c=this;$.ajax("whoAmI?_="+Date.now(),{async:!0}).done(function(a){this.activeUser===!1||null===this.activeUser?c.activeUser="root":c.activeUser=a.user})},url:arangoHelper.databaseUrl("/_api/user/"),model:ArangoQuery,activeUser:null,parse:function(a){var b,c=this;return this.activeUser!==!1&&null!==this.activeUser||(this.activeUser="root"),_.each(a.result,function(a){if(a.user===c.activeUser)try{a.extra.queries&&(b=a.extra.queries)}catch(d){}}),b},saveCollectionQueries:function(a){if(this.activeUser===!1||null===this.activeUser)return!1;this.activeUser!==!1&&null!==this.activeUser||(this.activeUser="root");var b=[];this.each(function(a){b.push({value:a.attributes.value,parameter:a.attributes.parameter,name:a.attributes.name})}),$.ajax({cache:!1,type:"PATCH",url:arangoHelper.databaseUrl("/_api/user/"+encodeURIComponent(this.activeUser)),data:JSON.stringify({extra:{queries:b}}),contentType:"application/json",processData:!1,success:function(b){a(!1,b)},error:function(){a(!0)}})},saveImportQueries:function(a,b){return 0===this.activeUser?!1:(window.progressView.show("Fetching documents..."),void $.ajax({cache:!1,type:"POST",url:"query/upload/"+encodeURIComponent(this.activeUser),data:a,contentType:"application/json",processData:!1,success:function(){window.progressView.hide(),arangoHelper.arangoNotification("Queries successfully imported."),b()},error:function(){window.progressView.hide(),arangoHelper.arangoError("Query error","queries could not be imported")}}))}})}(),window.ArangoReplication=Backbone.Collection.extend({model:window.Replication,url:"../api/user",getLogState:function(a){$.ajax({type:"GET",cache:!1,url:arangoHelper.databaseUrl("/_api/replication/logger-state"),contentType:"application/json",processData:!1,success:function(b){a(!1,b)},error:function(b){a(!0,b)}})},getApplyState:function(a){$.ajax({type:"GET",cache:!1,url:arangoHelper.databaseUrl("/_api/replication/applier-state"),contentType:"application/json",processData:!1,success:function(b){a(!1,b)},error:function(b){a(!0,b)}})}}),window.StatisticsCollection=Backbone.Collection.extend({model:window.Statistics,url:"/_admin/statistics"}),window.StatisticsDescriptionCollection=Backbone.Collection.extend({model:window.StatisticsDescription,url:"/_admin/statistics-description",parse:function(a){return a}}),window.ArangoUsers=Backbone.Collection.extend({model:window.Users,activeUser:null,activeUserSettings:{query:{},shell:{},testing:!0},sortOptions:{desc:!1},fetch:function(a){return window.App.currentUser&&"_system"!==window.App.currentDB.get("name")&&(this.url=frontendConfig.basePath+"/_api/user/"+encodeURIComponent(window.App.currentUser)),Backbone.Collection.prototype.fetch.call(this,a)},url:frontendConfig.basePath+"/_api/user",comparator:function(a,b){var c=a.get("user").toLowerCase(),d=b.get("user").toLowerCase();return this.sortOptions.desc===!0?d>c?1:c>d?-1:0:c>d?1:d>c?-1:0},login:function(a,b,c){var d=this;$.ajax({url:arangoHelper.databaseUrl("/_open/auth"),method:"POST",data:JSON.stringify({username:a,password:b}),dataType:"json"}).success(function(a){arangoHelper.setCurrentJwt(a.jwt);var b=a.jwt.split(".");if(!b[1])throw new Error("Invalid JWT");if(!window.atob)throw new Error("base64 support missing in browser");var e=JSON.parse(atob(b[1]));d.activeUser=e.preferred_username,c(!1,d.activeUser)}).error(function(){arangoHelper.setCurrentJwt(null),d.activeUser=null,c(!0,null)})},setSortingDesc:function(a){this.sortOptions.desc=a},logout:function(){arangoHelper.setCurrentJwt(null),this.activeUser=null,this.reset(),window.App.navigate(""),window.location.reload()},setUserSettings:function(a,b){this.activeUserSettings.identifier=b},loadUserSettings:function(a){var b=this;$.ajax({type:"GET",cache:!1,url:arangoHelper.databaseUrl("/_api/user/"+encodeURIComponent(b.activeUser)),contentType:"application/json",processData:!1,success:function(c){b.activeUserSettings=c.extra,a(!1,c)},error:function(b){a(!0,b)}})},saveUserSettings:function(a){var b=this;$.ajax({cache:!1,type:"PUT",url:frontendConfig.basePath+"/_api/user/"+encodeURIComponent(b.activeUser),data:JSON.stringify({extra:b.activeUserSettings}),contentType:"application/json",processData:!1,success:function(b){a(!1,b)},error:function(b){a(!0,b)}})},parse:function(a){var b=[];return a.result?_.each(a.result,function(a){b.push(a)}):b.push({user:a.user,active:a.active,extra:a.extra,changePassword:a.changePassword}),b},whoAmI:function(a){return this.activeUser?void a(!1,this.activeUser):void $.ajax("whoAmI?_="+Date.now()).success(function(b){a(!1,b.user)}).error(function(){a(!0,null)})}}),function(){"use strict";window.ClusterCoordinators=window.AutomaticRetryCollection.extend({model:window.ClusterCoordinator,url:arangoHelper.databaseUrl("/_admin/aardvark/cluster/Coordinators"),updateUrl:function(){this.url=window.App.getNewRoute("Coordinators")},initialize:function(){},statusClass:function(a){switch(a){case"ok":return"success";case"warning":return"warning";case"critical":return"danger";case"missing":return"inactive";default:return"danger"}},getStatuses:function(a,b){if(this.checkRetries()){var c=this;this.fetch({beforeSend:window.App.addAuth.bind(window.App),error:c.failureTry.bind(c,c.getStatuses.bind(c,a,b))}).done(function(){c.successFullTry(),c.forEach(function(b){a(c.statusClass(b.get("status")),b.get("address"))}),b()})}},byAddress:function(a,b){if(this.checkRetries()){var c=this;this.fetch({beforeSend:window.App.addAuth.bind(window.App),error:c.failureTry.bind(c,c.byAddress.bind(c,a,b))}).done(function(){c.successFullTry(),a=a||{},c.forEach(function(b){var c=b.get("address");c=c.split(":")[0],a[c]=a[c]||{},a[c].coords=a[c].coords||[],a[c].coords.push(b)}),b(a)})}},checkConnection:function(a){var b=this;this.checkRetries()&&this.fetch({beforeSend:window.App.addAuth.bind(window.App),error:b.failureTry.bind(b,b.checkConnection.bind(b,a))}).done(function(){b.successFullTry(),a()})}})}(),function(){"use strict";window.ClusterServers=window.AutomaticRetryCollection.extend({model:window.ClusterServer,host:"",url:arangoHelper.databaseUrl("/_admin/aardvark/cluster/DBServers"),updateUrl:function(){this.url=window.App.getNewRoute(this.host)+this.url},initialize:function(a,b){this.host=b.host},statusClass:function(a){switch(a){case"ok":return"success";case"warning":return"warning";case"critical":return"danger";case"missing":return"inactive";default:return"danger"}},getStatuses:function(a){if(this.checkRetries()){var b=this,c=function(){b.successFullTry(),b._retryCount=0,b.forEach(function(c){a(b.statusClass(c.get("status")),c.get("address"))})};this.fetch({beforeSend:window.App.addAuth.bind(window.App),error:b.failureTry.bind(b,b.getStatuses.bind(b,a))}).done(c)}},byAddress:function(a,b){if(this.checkRetries()){var c=this;this.fetch({beforeSend:window.App.addAuth.bind(window.App),error:c.failureTry.bind(c,c.byAddress.bind(c,a,b))}).done(function(){c.successFullTry(),a=a||{},c.forEach(function(b){var c=b.get("address");c=c.split(":")[0],a[c]=a[c]||{},a[c].dbs=a[c].dbs||[],a[c].dbs.push(b)}),b(a)}).error(function(a){console.log("error"),console.log(a)})}},getList:function(){throw new Error("Do not use")},getOverview:function(){throw new Error("Do not use DbServer.getOverview")}})}(),function(){"use strict";window.CoordinatorCollection=Backbone.Collection.extend({model:window.Coordinator,url:arangoHelper.databaseUrl("/_admin/aardvark/cluster/Coordinators") -})}(),function(){"use strict";window.FoxxCollection=Backbone.Collection.extend({model:window.Foxx,sortOptions:{desc:!1},url:arangoHelper.databaseUrl("/_admin/aardvark/foxxes"),comparator:function(a,b){var c,d;return this.sortOptions.desc===!0?(c=a.get("mount"),d=b.get("mount"),d>c?1:c>d?-1:0):(c=a.get("mount"),d=b.get("mount"),c>d?1:d>c?-1:0)},setSortingDesc:function(a){this.sortOptions.desc=a},installFromGithub:function(a,b,c,d){var e=arangoHelper.databaseUrl("/_admin/aardvark/foxxes/git?mount="+encodeURIComponent(b));void 0!==d&&(e+=d?"&replace=true":"&upgrade=true"),$.ajax({cache:!1,type:"PUT",url:e,data:JSON.stringify(a),contentType:"application/json",processData:!1,success:function(a){c(a)},error:function(a){c(a)}})},installFromStore:function(a,b,c,d){var e=arangoHelper.databaseUrl("/_admin/aardvark/foxxes/store?mount="+encodeURIComponent(b));void 0!==d&&(e+=d?"&replace=true":"&upgrade=true"),$.ajax({cache:!1,type:"PUT",url:e,data:JSON.stringify(a),contentType:"application/json",processData:!1,success:function(a){c(a)},error:function(a){c(a)}})},installFromZip:function(a,b,c,d){var e=arangoHelper.databaseUrl("/_admin/aardvark/foxxes/zip?mount="+encodeURIComponent(b));void 0!==d&&(e+=d?"&replace=true":"&upgrade=true"),$.ajax({cache:!1,type:"PUT",url:e,data:JSON.stringify({zipFile:a}),contentType:"application/json",processData:!1,success:function(a){c(a)},error:function(a){c(a)}})},generate:function(a,b,c,d){var e=arangoHelper.databaseUrl("/_admin/aardvark/foxxes/generate?mount="+encodeURIComponent(b));void 0!==d&&(e+=d?"&replace=true":"&upgrade=true"),$.ajax({cache:!1,type:"PUT",url:e,data:JSON.stringify(a),contentType:"application/json",processData:!1,success:function(a){c(a)},error:function(a){c(a)}})}})}(),function(){"use strict";window.GraphCollection=Backbone.Collection.extend({model:window.Graph,sortOptions:{desc:!1},url:arangoHelper.databaseUrl("/_api/gharial"),dropAndDeleteGraph:function(a,b){$.ajax({type:"DELETE",url:arangoHelper.databaseUrl("/_api/gharial/")+encodeURIComponent(a)+"?dropCollections=true",contentType:"application/json",processData:!0,success:function(){b(!0)},error:function(){b(!1)}})},comparator:function(a,b){var c=a.get("_key")||"",d=b.get("_key")||"";return c=c.toLowerCase(),d=d.toLowerCase(),this.sortOptions.desc===!0?d>c?1:c>d?-1:0:c>d?1:d>c?-1:0},setSortingDesc:function(a){this.sortOptions.desc=a},parse:function(a){return a.error?void 0:a.graphs}})}(),function(){"use strict";window.NotificationCollection=Backbone.Collection.extend({model:window.Notification,url:""})}(),function(){"use strict";window.QueryManagementActive=Backbone.Collection.extend({model:window.queryManagementModel,url:function(){return frontendConfig.basePath+"/_api/query/current"},killRunningQuery:function(a,b){$.ajax({url:frontendConfig.basePath+"/_api/query/"+encodeURIComponent(a),type:"DELETE",success:function(a){b()}})}})}(),function(){"use strict";window.QueryManagementSlow=Backbone.Collection.extend({model:window.queryManagementModel,url:"/_api/query/slow",deleteSlowQueryHistory:function(a){var b=this;$.ajax({url:b.url,type:"DELETE",success:function(b){a()}})}})}(),function(){"use strict";window.WorkMonitorCollection=Backbone.Collection.extend({model:window.workMonitorModel,url:"/_admin/work-monitor",parse:function(a){return a.work}})}(),function(){"use strict";window.PaginationView=Backbone.View.extend({collection:null,paginationDiv:"",idPrefix:"",rerender:function(){},jumpTo:function(a){this.collection.setPage(a),this.rerender()},firstPage:function(){this.jumpTo(1)},lastPage:function(){this.jumpTo(this.collection.getLastPageNumber())},firstDocuments:function(){this.jumpTo(1)},lastDocuments:function(){this.jumpTo(this.collection.getLastPageNumber())},prevDocuments:function(){this.jumpTo(this.collection.getPage()-1)},nextDocuments:function(){this.jumpTo(this.collection.getPage()+1)},renderPagination:function(){$(this.paginationDiv).html("");var a=this,b=this.collection.getPage(),c=this.collection.getLastPageNumber(),d=$(this.paginationDiv),e={page:b,lastPage:c,click:function(b){var c=window.location.hash.split("/");"documents"===c[2]?(e.page=b,window.location.hash=c[0]+"/"+c[1]+"/"+c[2]+"/"+b):(a.jumpTo(b),e.page=b)}};d.html(""),d.pagination(e),$(this.paginationDiv).prepend('
    '),$(this.paginationDiv).append('
    ')}})}(),function(){"use strict";window.ApplicationDetailView=Backbone.View.extend({el:"#content",divs:["#readme","#swagger","#app-info","#sideinformation","#information","#settings"],navs:["#service-info","#service-api","#service-readme","#service-settings"],template:templateEngine.createTemplate("applicationDetailView.ejs"),events:{"click .open":"openApp","click .delete":"deleteApp","click #app-deps":"showDepsDialog","click #app-switch-mode":"toggleDevelopment","click #app-scripts [data-script]":"runScript","click #app-tests":"runTests","click #app-replace":"replaceApp","click #download-app":"downloadApp","click .subMenuEntries li":"changeSubview","click #jsonLink":"toggleSwagger","mouseenter #app-scripts":"showDropdown","mouseleave #app-scripts":"hideDropdown"},resize:function(a){a?$(".innerContent").css("height","auto"):($(".innerContent").height($(".centralRow").height()-150),$("#swagger iframe").height($(".centralRow").height()-150),$("#swagger #swaggerJsonContent").height($(".centralRow").height()-150))},toggleSwagger:function(){var a=function(a){$("#jsonLink").html("JSON"),this.jsonEditor.setValue(JSON.stringify(a,null," "),1),$("#swaggerJsonContent").show(),$("#swagger iframe").hide()}.bind(this);if("Swagger"===$("#jsonLink").html()){var b=arangoHelper.databaseUrl("/_admin/aardvark/foxxes/docs/swagger.json?mount="+encodeURIComponent(this.model.get("mount")));arangoHelper.download(b,a)}else $("#swaggerJsonContent").hide(),$("#swagger iframe").show(),$("#jsonLink").html("Swagger")},changeSubview:function(a){_.each(this.navs,function(a){$(a).removeClass("active")}),$(a.currentTarget).addClass("active"),_.each(this.divs,function(a){$(".headerButtonBar").hide(),$(a).hide()}),"service-readme"===a.currentTarget.id?(this.resize(!0),$("#readme").show()):"service-api"===a.currentTarget.id?(this.resize(),$("#swagger").show()):"service-info"===a.currentTarget.id?(this.resize(!0),this.render(),$("#information").show(),$("#sideinformation").show()):"service-settings"===a.currentTarget.id&&(this.resize(!0),this.showConfigDialog(),$(".headerButtonBar").show(),$("#settings").show())},downloadApp:function(){this.model.isSystem()||this.model.download()},replaceApp:function(){var a=this.model.get("mount");window.foxxInstallView.upgrade(a,function(){window.App.applicationDetail(encodeURIComponent(a))}),$(".createModalDialog .arangoHeader").html("Replace Service"),$("#infoTab").click()},updateConfig:function(){this.model.getConfiguration(function(){$("#app-warning")[this.model.needsAttention()?"show":"hide"](),$("#app-warning-config")[this.model.needsConfiguration()?"show":"hide"](),this.model.needsConfiguration()?$("#app-config").addClass("error"):$("#app-config").removeClass("error")}.bind(this))},updateDeps:function(){this.model.getDependencies(function(){$("#app-warning")[this.model.needsAttention()?"show":"hide"](),$("#app-warning-deps")[this.model.hasUnconfiguredDependencies()?"show":"hide"](),this.model.hasUnconfiguredDependencies()?$("#app-deps").addClass("error"):$("#app-deps").removeClass("error")}.bind(this))},toggleDevelopment:function(){this.model.toggleDevelopment(!this.model.isDevelopment(),function(){this.model.isDevelopment()?($(".app-switch-mode").text("Set Production"),$("#app-development-indicator").css("display","inline"),$("#app-development-path").css("display","inline")):($(".app-switch-mode").text("Set Development"),$("#app-development-indicator").css("display","none"),$("#app-development-path").css("display","none"))}.bind(this))},runScript:function(a){a.preventDefault();var b=$(a.currentTarget).attr("data-script"),c=[window.modalView.createBlobEntry("app_script_arguments","Script arguments","",null,"optional",!1,[{rule:function(a){return a&&JSON.parse(a)},msg:"Must be well-formed JSON or empty"}])],d=[window.modalView.createSuccessButton("Run script",function(){var a=$("#app_script_arguments").val();a=a&&JSON.parse(a),window.modalView.hide(),this.model.runScript(b,a,function(a,c){var d;d=a?"

    The script failed with an error"+(a.statusCode?" (HTTP "+a.statusCode+")":"")+":

    "+a.message+"
    ":c?"

    Script results:

    "+JSON.stringify(c,null,2)+"
    ":"

    The script ran successfully.

    ",window.modalView.show("modalTable.ejs",'Result of script "'+b+'"',void 0,void 0,void 0,d)})}.bind(this))];window.modalView.show("modalTable.ejs",'Run script "'+b+'" on "'+this.model.get("mount")+'"',d,c)},showSwagger:function(a){a.preventDefault(),this.render("swagger")},showReadme:function(a){a.preventDefault(),this.render("readme")},runTests:function(a){a.preventDefault();var b="

    WARNING: Running tests may result in destructive side-effects including data loss. Please make sure not to run tests on a production database.

    ";this.model.isDevelopment()&&(b+="

    WARNING: This app is running in development mode. If any of the tests access the app's HTTP API they may become non-deterministic.

    ");var c=[window.modalView.createSuccessButton("Run tests",function(){window.modalView.hide(),this.model.runTests({reporter:"suite"},function(a,b){window.modalView.show("modalTestResults.ejs","Test results",void 0,void 0,void 0,a||b)})}.bind(this))];window.modalView.show("modalTable.ejs",'Run tests for app "'+this.model.get("mount")+'"',c,void 0,void 0,b)},render:function(a){return this.resize(),this.model.fetchThumbnail(function(){var b=function(b,c){var d=this;b?arangoHelper.arangoError("DB","Could not get current database"):($(this.el).html(this.template.render({app:this.model,baseUrl:arangoHelper.databaseUrl("",c),mode:a})),d.jsonEditor=ace.edit("swaggerJsonEditor"),d.jsonEditor.setReadOnly(!0),d.jsonEditor.getSession().setMode("ace/mode/json"),$.ajax({url:this.appUrl(c),headers:{accept:"text/html,*/*;q=0.9"}}).success(function(){$(".open",this.el).prop("disabled",!1)}.bind(this)),this.updateConfig(),this.updateDeps(),"swagger"===a&&$.get("./foxxes/docs/swagger.json?mount="+encodeURIComponent(this.model.get("mount")),function(a){Object.keys(a.paths).length<1&&(d.render("readme"),$("#app-show-swagger").attr("disabled","true"))})),this.breadcrumb()}.bind(this);arangoHelper.currentDatabase(b),_.isEmpty(this.model.get("config"))&&$("#service-settings").attr("disabled",!0)}.bind(this)),$(this.el)},breadcrumb:function(){var a="Service: "+this.model.get("name")+'',b='

    Contributors:';this.model.get("contributors")&&this.model.get("contributors").length>0?_.each(this.model.get("contributors"),function(a){b+=''+a.name+""}):b+="No contributors",b+="

    ",$(".information").append(b),this.model.get("author")&&$(".information").append('

    Author:'+this.model.get("author")+"

    "),this.model.get("mount")&&$(".information").append('

    Mount:'+this.model.get("mount")+"

    "),this.model.get("development")&&this.model.get("path")&&$(".information").append('

    Path:'+this.model.get("path")+"

    "),$("#subNavigationBar .breadcrumb").html(a)},openApp:function(){var a=function(a,b){a?arangoHelper.arangoError("DB","Could not get current database"):window.open(this.appUrl(b),this.model.get("title")).focus()}.bind(this);arangoHelper.currentDatabase(a)},deleteApp:function(){var a=[window.modalView.createDeleteButton("Delete",function(){var a={teardown:$("#app_delete_run_teardown").is(":checked")};this.model.destroy(a,function(a,b){a||b.error!==!1||(window.modalView.hide(),window.App.navigate("services",{trigger:!0}))})}.bind(this))],b=[window.modalView.createCheckboxEntry("app_delete_run_teardown","Run teardown?",!0,"Should this app's teardown script be executed before removing the app?",!0)];window.modalView.show("modalTable.ejs",'Delete Foxx App mounted at "'+this.model.get("mount")+'"',a,b,void 0,"

    Are you sure? There is no way back...

    ",!0)},appUrl:function(a){return arangoHelper.databaseUrl(this.model.get("mount"),a)},applyConfig:function(){var a={};_.each(this.model.get("config"),function(b,c){var d=$("#app_config_"+c),e=d.val();if("boolean"===b.type||"bool"===b.type)return void(a[c]=d.is(":checked"));if(""===e&&b.hasOwnProperty("default"))return a[c]=b["default"],void("json"===b.type&&(a[c]=JSON.stringify(b["default"])));if("number"===b.type)a[c]=parseFloat(e);else if("integer"===b.type||"int"===b.type)a[c]=parseInt(e,10);else{if("json"!==b.type)return void(a[c]=window.arangoHelper.escapeHtml(e));a[c]=e&&JSON.stringify(JSON.parse(e))}}),this.model.setConfiguration(a,function(){this.updateConfig(),arangoHelper.arangoNotification(this.model.get("name"),"Settings applied.")}.bind(this))},showConfigDialog:function(){if(_.isEmpty(this.model.get("config")))return void $("#settings .buttons").html($("#hidden_buttons").html());var a=_.map(this.model.get("config"),function(a,b){var c=void 0===a["default"]?"":String(a["default"]),d=void 0===a.current?"":String(a.current),e="createTextEntry",f=!1,g=[];return"boolean"===a.type||"bool"===a.type?(e="createCheckboxEntry",a["default"]=a["default"]||!1,c=a["default"]||!1,d=a.current||!1):"json"===a.type?(e="createBlobEntry",c=void 0===a["default"]?"":JSON.stringify(a["default"]),d=void 0===a.current?"":a.current,g.push({rule:function(a){return a&&JSON.parse(a)},msg:"Must be well-formed JSON or empty."})):"integer"===a.type||"int"===a.type?g.push({rule:Joi.number().integer().optional().allow(""),msg:"Has to be an integer."}):"number"===a.type?g.push({rule:Joi.number().optional().allow(""),msg:"Has to be a number."}):("password"===a.type&&(e="createPasswordEntry"),g.push({rule:Joi.string().optional().allow(""),msg:"Has to be a string."})),void 0===a["default"]&&a.required!==!1&&(f=!0,g.unshift({rule:Joi.any().required(),msg:"This field is required."})),window.modalView[e]("app_config_"+b,b,d,a.description,c,f,g)}),b=[window.modalView.createSuccessButton("Apply",this.applyConfig.bind(this))];window.modalView.show("modalTable.ejs","Configuration",b,a,null,null,null,null,null,"settings"),$(".modal-footer").prepend($("#hidden_buttons").html())},applyDeps:function(){var a={};_.each(this.model.get("deps"),function(b,c){var d=$("#app_deps_"+c);a[c]=window.arangoHelper.escapeHtml(d.val())}),this.model.setDependencies(a,function(){window.modalView.hide(),this.updateDeps()}.bind(this))},showDepsDialog:function(){if(!_.isEmpty(this.model.get("deps"))){var a=_.map(this.model.get("deps"),function(a,b){var c=void 0===a.current?"":String(a.current),d="",e=a.definition.name;"*"!==a.definition.version&&(e+="@"+a.definition.version);var f=[{rule:Joi.string().optional().allow(""),msg:"Has to be a string."}];return a.definition.required&&f.push({rule:Joi.string().required(),msg:"This value is required."}),window.modalView.createTextEntry("app_deps_"+b,a.title,c,e,d,a.definition.required,f)}),b=[window.modalView.createSuccessButton("Apply",this.applyDeps.bind(this))];window.modalView.show("modalTable.ejs","Dependencies",b,a)}},showDropdown:function(){_.isEmpty(this.model.get("scripts"))||$("#scripts_dropdown").show(200)},hideDropdown:function(){$("#scripts_dropdown").hide()}})}(),function(){"use strict";window.ApplicationsView=Backbone.View.extend({el:"#content",template:templateEngine.createTemplate("applicationsView.ejs"),events:{"click #addApp":"createInstallModal","click #foxxToggle":"slideToggle","click #checkDevel":"toggleDevel","click #checkProduction":"toggleProduction","click #checkSystem":"toggleSystem"},fixCheckboxes:function(){this._showDevel?$("#checkDevel").attr("checked","checked"):$("#checkDevel").removeAttr("checked"),this._showSystem?$("#checkSystem").attr("checked","checked"):$("#checkSystem").removeAttr("checked"),this._showProd?$("#checkProduction").attr("checked","checked"):$("#checkProduction").removeAttr("checked"),$("#checkDevel").next().removeClass("fa fa-check-square-o fa-square-o").addClass("fa"),$("#checkSystem").next().removeClass("fa fa-check-square-o fa-square-o").addClass("fa"),$("#checkProduction").next().removeClass("fa fa-check-square-o fa-square-o").addClass("fa"),arangoHelper.setCheckboxStatus("#foxxDropdown")},toggleDevel:function(){var a=this;this._showDevel=!this._showDevel,_.each(this._installedSubViews,function(b){b.toggle("devel",a._showDevel)}),this.fixCheckboxes()},toggleProduction:function(){var a=this;this._showProd=!this._showProd,_.each(this._installedSubViews,function(b){b.toggle("production",a._showProd)}),this.fixCheckboxes()},toggleSystem:function(){this._showSystem=!this._showSystem;var a=this;_.each(this._installedSubViews,function(b){b.toggle("system",a._showSystem)}),this.fixCheckboxes()},reload:function(){var a=this;_.each(this._installedSubViews,function(a){a.undelegateEvents()}),this.collection.fetch({success:function(){a.createSubViews(),a.render()}})},createSubViews:function(){var a=this;this._installedSubViews={},a.collection.each(function(b){var c=new window.FoxxActiveView({model:b,appsView:a});a._installedSubViews[b.get("mount")]=c})},initialize:function(){this._installedSubViews={},this._showDevel=!0,this._showProd=!0,this._showSystem=!1},slideToggle:function(){$("#foxxToggle").toggleClass("activated"),$("#foxxDropdownOut").slideToggle(200)},createInstallModal:function(a){a.preventDefault(),window.foxxInstallView.install(this.reload.bind(this))},render:function(){this.collection.sort(),$(this.el).html(this.template.render({})),_.each(this._installedSubViews,function(a){$("#installedList").append(a.render())}),this.delegateEvents(),$("#checkDevel").attr("checked",this._showDevel),$("#checkProduction").attr("checked",this._showProd),$("#checkSystem").attr("checked",this._showSystem),arangoHelper.setCheckboxStatus("#foxxDropdown");var a=this;return _.each(this._installedSubViews,function(b){b.toggle("devel",a._showDevel),b.toggle("system",a._showSystem)}),arangoHelper.fixTooltips("icon_arangodb","left"),this}})}(),function(){"use strict";window.ClusterView=Backbone.View.extend({el:"#content",template:templateEngine.createTemplate("clusterView.ejs"),events:{},statsEnabled:!1,historyInit:!1,initDone:!1,interval:5e3,maxValues:100,knownServers:[],chartData:{},charts:{},nvcharts:[],startHistory:{},startHistoryAccumulated:{},initialize:function(a){var b=this;window.App.isCluster&&(this.dbServers=a.dbServers,this.coordinators=a.coordinators,this.updateServerTime(),window.setInterval(function(){if("#cluster"===window.location.hash||""===window.location.hash||"#"===window.location.hash){var a=function(a){b.rerenderValues(a),b.rerenderGraphs(a)};b.getCoordStatHistory(a)}},this.interval))},render:function(){this.$el.html(this.template.render({})),this.initDone||(void 0!==this.coordinators.first()?this.getServerStatistics():this.waitForCoordinators(),this.initDone=!0),this.initGraphs()},waitForCoordinators:function(){var a=this;window.setTimeout(function(){a.coordinators?a.getServerStatistics():a.waitForCoordinators()},500)},updateServerTime:function(){this.serverTime=(new Date).getTime()},getServerStatistics:function(){var a=this;this.data=void 0;var b=this.coordinators.first();this.statCollectCoord=new window.ClusterStatisticsCollection([],{host:b.get("address")}),this.statCollectDBS=new window.ClusterStatisticsCollection([],{host:b.get("address")});var c=[];_.each(this.dbServers,function(a){a.each(function(a){c.push(a)})}),_.each(c,function(c){if("ok"===c.get("status")){-1===a.knownServers.indexOf(c.id)&&a.knownServers.push(c.id);var d=new window.Statistics({name:c.id});d.url=b.get("protocol")+"://"+b.get("address")+"/_admin/clusterStatistics?DBserver="+c.get("name"),a.statCollectDBS.add(d)}}),this.coordinators.forEach(function(b){if("ok"===b.get("status")){-1===a.knownServers.indexOf(b.id)&&a.knownServers.push(b.id);var c=new window.Statistics({name:b.id});c.url=b.get("protocol")+"://"+b.get("address")+"/_admin/statistics",a.statCollectCoord.add(c)}});var d=function(b){a.rerenderValues(b),a.rerenderGraphs(b)};a.getCoordStatHistory(d),a.renderNodes()},rerenderValues:function(a){var b=this;b.renderNodes(),this.renderValue("#clusterConnections",Math.round(a.clientConnectionsCurrent)),this.renderValue("#clusterConnectionsAvg",Math.round(a.clientConnections15M));var c=a.physicalMemory,d=a.residentSizeCurrent;this.renderValue("#clusterRam",[d,c])},renderValue:function(a,b,c,d){if("number"==typeof b)$(a).html(b);else if($.isArray(b)){var e=b[0],f=b[1],g=1/(f/e)*100;g>90?c=!0:g>70&&90>g&&(d=!0),$(a).html(g.toFixed(1)+" %")}else"string"==typeof b&&$(a).html(b);c?($(a).addClass("negative"),$(a).removeClass("warning"),$(a).removeClass("positive")):d?($(a).addClass("warning"),$(a).removeClass("positive"),$(a).removeClass("negative")):($(a).addClass("positive"),$(a).removeClass("negative"),$(a).removeClass("warning"))},renderNodes:function(){var a=this,b=function(a){var b=0,c=0,d=0,e=0;_.each(a,function(a){"Coordinator"===a.Role?(b++,"GOOD"!==a.Status&&c++):"DBServer"===a.Role&&(d++,"GOOD"!==a.Status&&e++)}),c>0?this.renderValue("#clusterCoordinators",b-c+"/"+b,!0):this.renderValue("#clusterCoordinators",b),e>0?this.renderValue("#clusterDBServers",d-e+"/"+d,!0):this.renderValue("#clusterDBServers",d)}.bind(this);$.ajax({type:"GET",cache:!1,url:arangoHelper.databaseUrl("/_admin/cluster/health"),contentType:"application/json",processData:!1,async:!0,success:function(a){b(a.Health)},error:function(){a.renderValue("#clusterCoordinators","N/A",!0),a.renderValue("#clusterDBServers","N/A",!0)}})},initValues:function(){var a=["#clusterNodes","#clusterRam","#clusterConnections","#clusterConnectionsAvg"];_.each(a,function(a){$(a).html('')})},graphData:{data:{sent:[],received:[]},http:[],average:[]},checkArraySizes:function(){var a=this;_.each(a.chartsOptions,function(b,c){_.each(b.options,function(b,d){b.values.length>a.maxValues-1&&a.chartsOptions[c].options[d].values.shift()})})},formatDataForGraph:function(a){var b=this;b.historyInit?(b.checkArraySizes(),b.chartsOptions[0].options[0].values.push({x:a.times[a.times.length-1],y:a.bytesSentPerSecond[a.bytesSentPerSecond.length-1]}),b.chartsOptions[0].options[1].values.push({x:a.times[a.times.length-1],y:a.bytesReceivedPerSecond[a.bytesReceivedPerSecond.length-1]}),b.chartsOptions[1].options[0].values.push({x:a.times[a.times.length-1],y:b.calcTotalHttp(a.http,a.bytesSentPerSecond.length-1)}),b.chartsOptions[2].options[0].values.push({x:a.times[a.times.length-1],y:a.avgRequestTime[a.bytesSentPerSecond.length-1]/b.coordinators.length})):(_.each(a.times,function(c,d){b.chartsOptions[0].options[0].values.push({x:c,y:a.bytesSentPerSecond[d]}),b.chartsOptions[0].options[1].values.push({x:c,y:a.bytesReceivedPerSecond[d]}),b.chartsOptions[1].options[0].values.push({x:c,y:b.calcTotalHttp(a.http,d)}),b.chartsOptions[2].options[0].values.push({x:c,y:a.avgRequestTime[d]/b.coordinators.length})}),b.historyInit=!0)},chartsOptions:[{id:"#clusterData",type:"bytes",count:2,options:[{area:!0,values:[],key:"Bytes out",color:"rgb(23,190,207)",strokeWidth:2,fillOpacity:.1},{area:!0,values:[],key:"Bytes in",color:"rgb(188, 189, 34)",strokeWidth:2,fillOpacity:.1}]},{id:"#clusterHttp",type:"bytes",options:[{area:!0,values:[],key:"Bytes",color:"rgb(0, 166, 90)",fillOpacity:.1}]},{id:"#clusterAverage",data:[],type:"seconds",options:[{area:!0,values:[],key:"Seconds",color:"rgb(243, 156, 18)",fillOpacity:.1}]}],initGraphs:function(){var a=this,b="No data...";_.each(a.chartsOptions,function(c){nv.addGraph(function(){a.charts[c.id]=nv.models.stackedAreaChart().options({useInteractiveGuideline:!0,showControls:!1,noData:b,duration:0}),a.charts[c.id].xAxis.axisLabel("").tickFormat(function(a){var b=new Date(1e3*a);return(b.getHours()<10?"0":"")+b.getHours()+":"+(b.getMinutes()<10?"0":"")+b.getMinutes()+":"+(b.getSeconds()<10?"0":"")+b.getSeconds()}).staggerLabels(!1),a.charts[c.id].yAxis.axisLabel("").tickFormat(function(a){var b;return"bytes"===c.type?null===a?"N/A":(b=parseFloat(d3.format(".2f")(a)),prettyBytes(b)):"seconds"===c.type?null===a?"N/A":b=parseFloat(d3.format(".3f")(a)):void 0});var d,e=a.returnGraphOptions(c.id);return e.length>0?_.each(e,function(a,b){c.options[b].values=a}):c.options[0].values=[],d=c.options,a.chartData[c.id]=d3.select(c.id).append("svg").datum(d).transition().duration(300).call(a.charts[c.id]).each("start",function(){window.setTimeout(function(){d3.selectAll(c.id+" *").each(function(){this.__transition__&&(this.__transition__.duration=0)})},0)}),nv.utils.windowResize(a.charts[c.id].update),a.nvcharts.push(a.charts[c.id]),a.charts[c.id]})})},returnGraphOptions:function(a){var b=[];return b="#clusterData"===a?[this.chartsOptions[0].options[0].values,this.chartsOptions[0].options[1].values]:"#clusterHttp"===a?[this.chartsOptions[1].options[0].values]:"#clusterAverage"===a?[this.chartsOptions[2].options[0].values]:[]},rerenderGraphs:function(a){if(this.statsEnabled){var b,c,d=this;this.formatDataForGraph(a),_.each(d.chartsOptions,function(a){c=d.returnGraphOptions(a.id),c.length>0?_.each(c,function(b,c){a.options[c].values=b}):a.options[0].values=[],b=a.options,b[0].values.length>0&&d.historyInit&&d.charts[a.id]&&d.charts[a.id].update()})}},calcTotalHttp:function(a,b){var c=0;return _.each(a,function(a){c+=a[b]}),c},getCoordStatHistory:function(a){$.ajax({url:"statistics/coordshort",json:!0}).success(function(b){this.statsEnabled=b.enabled,a(b.data)}.bind(this))}})}(),function(){"use strict";window.CollectionListItemView=Backbone.View.extend({tagName:"div",className:"tile pure-u-1-1 pure-u-sm-1-2 pure-u-md-1-3 pure-u-lg-1-4 pure-u-xl-1-6",template:templateEngine.createTemplate("collectionsItemView.ejs"),initialize:function(a){this.collectionsView=a.collectionsView},events:{"click .iconSet.icon_arangodb_settings2":"createEditPropertiesModal","click .pull-left":"noop","click .icon_arangodb_settings2":"editProperties","click .spanInfo":"showProperties",click:"selectCollection"},render:function(){return this.model.get("locked")?($(this.el).addClass("locked"),$(this.el).addClass(this.model.get("lockType"))):$(this.el).removeClass("locked"),"loading"!==this.model.get("status")&&"unloading"!==this.model.get("status")||$(this.el).addClass("locked"),$(this.el).html(this.template.render({model:this.model})),$(this.el).attr("id","collection_"+this.model.get("name")),this},editProperties:function(a){return this.model.get("locked")?0:(a.stopPropagation(),void this.createEditPropertiesModal())},showProperties:function(a){return this.model.get("locked")?0:(a.stopPropagation(),void this.createInfoModal())},selectCollection:function(a){return $(a.target).hasClass("disabled")?0:this.model.get("locked")?0:"loading"===this.model.get("status")?0:void("unloaded"===this.model.get("status")?this.loadCollection():window.App.navigate("collection/"+encodeURIComponent(this.model.get("name"))+"/documents/1",{trigger:!0}))},noop:function(a){a.stopPropagation()},unloadCollection:function(){var a=function(a){a?arangoHelper.arangoError("Collection error",this.model.get("name")+" could not be unloaded."):void 0===a?(this.model.set("status","unloading"),this.render()):"#collections"===window.location.hash?(this.model.set("status","unloaded"),this.render()):arangoHelper.arangoNotification("Collection "+this.model.get("name")+" unloaded.")}.bind(this);this.model.unloadCollection(a),window.modalView.hide()},loadCollection:function(){var a=function(a){a?arangoHelper.arangoError("Collection error",this.model.get("name")+" could not be loaded."):void 0===a?(this.model.set("status","loading"),this.render()):"#collections"===window.location.hash?(this.model.set("status","loaded"),this.render()):arangoHelper.arangoNotification("Collection "+this.model.get("name")+" loaded.")}.bind(this);this.model.loadCollection(a),window.modalView.hide()},truncateCollection:function(){this.model.truncateCollection(),window.modalView.hide()},deleteCollection:function(){this.model.destroy({error:function(){arangoHelper.arangoError("Could not delete collection.")},success:function(){window.modalView.hide()}}),this.collectionsView.render()},saveModifiedCollection:function(){var a=function(a,b){if(a)arangoHelper.arangoError("Error","Could not get coordinator info");else{var c;c=b?this.model.get("name"):$("#change-collection-name").val();var d=this.model.get("status");if("loaded"===d){var e;try{e=JSON.parse(1024*$("#change-collection-size").val()*1024)}catch(f){return arangoHelper.arangoError("Please enter a valid number"),0}var g;try{if(g=JSON.parse($("#change-index-buckets").val()),1>g||parseInt(g,10)!==Math.pow(2,Math.log2(g)))throw new Error("invalid indexBuckets value")}catch(f){return arangoHelper.arangoError("Please enter a valid number of index buckets"),0}var h=function(a){a?arangoHelper.arangoError("Collection error: "+a.responseText):(this.collectionsView.render(),window.modalView.hide())}.bind(this),i=function(a){if(a)arangoHelper.arangoError("Collection error: "+a.responseText);else{var b=$("#change-collection-sync").val();this.model.changeCollection(b,e,g,h)}}.bind(this);frontendConfig.isCluster===!1?this.model.renameCollection(c,i):i()}else if("unloaded"===d)if(this.model.get("name")!==c){var j=function(a,b){a?arangoHelper.arangoError("Collection error: "+b.responseText):(this.collectionsView.render(),window.modalView.hide())}.bind(this);frontendConfig.isCluster===!1?this.model.renameCollection(c,j):j()}else window.modalView.hide()}}.bind(this);window.isCoordinator(a)},createEditPropertiesModal:function(){var a=function(a,b){if(a)arangoHelper.arangoError("Error","Could not get coordinator info");else{var c=!1;"loaded"===this.model.get("status")&&(c=!0);var d=[],e=[];b||e.push(window.modalView.createTextEntry("change-collection-name","Name",this.model.get("name"),!1,"",!0,[{rule:Joi.string().regex(/^[a-zA-Z]/),msg:"Collection name must always start with a letter."},{rule:Joi.string().regex(/^[a-zA-Z0-9\-_]*$/),msg:'Only Symbols "_" and "-" are allowed.'},{rule:Joi.string().required(),msg:"No collection name given."}]));var f=function(){e.push(window.modalView.createReadOnlyEntry("change-collection-id","ID",this.model.get("id"),"")),e.push(window.modalView.createReadOnlyEntry("change-collection-type","Type",this.model.get("type"),"")),e.push(window.modalView.createReadOnlyEntry("change-collection-status","Status",this.model.get("status"),"")),d.push(window.modalView.createDeleteButton("Delete",this.deleteCollection.bind(this))),d.push(window.modalView.createDeleteButton("Truncate",this.truncateCollection.bind(this))),c?d.push(window.modalView.createNotificationButton("Unload",this.unloadCollection.bind(this))):d.push(window.modalView.createNotificationButton("Load",this.loadCollection.bind(this))),d.push(window.modalView.createSuccessButton("Save",this.saveModifiedCollection.bind(this)));var a=["General","Indices"],b=["modalTable.ejs","indicesView.ejs"];window.modalView.show(b,"Modify Collection",d,e,null,null,this.events,null,a),"loaded"===this.model.get("status")?this.getIndex():$($("#infoTab").children()[1]).remove()}.bind(this);if(c){var g=function(a,b){if(a)arangoHelper.arangoError("Collection","Could not fetch properties");else{var c=b.journalSize/1048576,d=b.indexBuckets,g=b.waitForSync;e.push(window.modalView.createTextEntry("change-collection-size","Journal size",c,"The maximal size of a journal or datafile (in MB). Must be at least 1.","",!0,[{rule:Joi.string().allow("").optional().regex(/^[0-9]*$/),msg:"Must be a number." -}])),e.push(window.modalView.createTextEntry("change-index-buckets","Index buckets",d,"The number of index buckets for this collection. Must be at least 1 and a power of 2.","",!0,[{rule:Joi.string().allow("").optional().regex(/^[1-9][0-9]*$/),msg:"Must be a number greater than 1 and a power of 2."}])),e.push(window.modalView.createSelectEntry("change-collection-sync","Wait for sync",g,"Synchronize to disk before returning from a create or update of a document.",[{value:!1,label:"No"},{value:!0,label:"Yes"}]))}f()};this.model.getProperties(g)}else f()}}.bind(this);window.isCoordinator(a)},bindIndexEvents:function(){this.unbindIndexEvents();var a=this;$("#indexEditView #addIndex").bind("click",function(){a.toggleNewIndexView(),$("#cancelIndex").unbind("click"),$("#cancelIndex").bind("click",function(){a.toggleNewIndexView()}),$("#createIndex").unbind("click"),$("#createIndex").bind("click",function(){a.createIndex()})}),$("#newIndexType").bind("change",function(){a.selectIndexType()}),$(".deleteIndex").bind("click",function(b){a.prepDeleteIndex(b)}),$("#infoTab a").bind("click",function(a){if($("#indexDeleteModal").remove(),"Indices"!==$(a.currentTarget).html()||$(a.currentTarget).parent().hasClass("active")||($("#newIndexView").hide(),$("#indexEditView").show(),$("#modal-dialog .modal-footer .button-danger").hide(),$("#modal-dialog .modal-footer .button-success").hide(),$("#modal-dialog .modal-footer .button-notification").hide()),"General"===$(a.currentTarget).html()&&!$(a.currentTarget).parent().hasClass("active")){$("#modal-dialog .modal-footer .button-danger").show(),$("#modal-dialog .modal-footer .button-success").show(),$("#modal-dialog .modal-footer .button-notification").show();var b=$(".index-button-bar2")[0];$("#cancelIndex").is(":visible")&&($("#cancelIndex").detach().appendTo(b),$("#createIndex").detach().appendTo(b))}})},unbindIndexEvents:function(){$("#indexEditView #addIndex").unbind("click"),$("#newIndexType").unbind("change"),$("#infoTab a").unbind("click"),$(".deleteIndex").unbind("click")},createInfoModal:function(){var a=function(a,b,c){if(a)arangoHelper.arangoError("Figures","Could not get revision.");else{var d=[],e={figures:c,revision:b,model:this.model};window.modalView.show("modalCollectionInfo.ejs","Collection: "+this.model.get("name"),d,e)}}.bind(this),b=function(b,c){if(b)arangoHelper.arangoError("Figures","Could not get figures.");else{var d=c;this.model.getRevision(a,d)}}.bind(this);this.model.getFigures(b)},resetIndexForms:function(){$("#indexHeader input").val("").prop("checked",!1),$("#newIndexType").val("Geo").prop("selected",!0),this.selectIndexType()},createIndex:function(){var a,b,c,d=this,e=$("#newIndexType").val(),f={};switch(e){case"Geo":a=$("#newGeoFields").val();var g=d.checkboxToValue("#newGeoJson"),h=d.checkboxToValue("#newGeoConstraint"),i=d.checkboxToValue("#newGeoIgnoreNull");f={type:"geo",fields:d.stringToArray(a),geoJson:g,constraint:h,ignoreNull:i};break;case"Hash":a=$("#newHashFields").val(),b=d.checkboxToValue("#newHashUnique"),c=d.checkboxToValue("#newHashSparse"),f={type:"hash",fields:d.stringToArray(a),unique:b,sparse:c};break;case"Fulltext":a=$("#newFulltextFields").val();var j=parseInt($("#newFulltextMinLength").val(),10)||0;f={type:"fulltext",fields:d.stringToArray(a),minLength:j};break;case"Skiplist":a=$("#newSkiplistFields").val(),b=d.checkboxToValue("#newSkiplistUnique"),c=d.checkboxToValue("#newSkiplistSparse"),f={type:"skiplist",fields:d.stringToArray(a),unique:b,sparse:c}}var k=function(a,b){if(a)if(b){var c=JSON.parse(b.responseText);arangoHelper.arangoError("Document error",c.errorMessage)}else arangoHelper.arangoError("Document error","Could not create index.");d.refreshCollectionsView()};window.modalView.hide(),d.model.createIndex(f,k)},lastTarget:null,prepDeleteIndex:function(a){var b=this;this.lastTarget=a,this.lastId=$(this.lastTarget.currentTarget).parent().parent().first().children().first().text(),$("#modal-dialog .modal-footer").after(''),$("#indexConfirmDelete").unbind("click"),$("#indexConfirmDelete").bind("click",function(){$("#indexDeleteModal").remove(),b.deleteIndex()}),$("#indexAbortDelete").unbind("click"),$("#indexAbortDelete").bind("click",function(){$("#indexDeleteModal").remove()})},refreshCollectionsView:function(){window.App.arangoCollectionsStore.fetch({success:function(){window.App.collectionsView.render()}})},deleteIndex:function(){var a=function(a){a?(arangoHelper.arangoError("Could not delete index"),$("tr th:contains('"+this.lastId+"')").parent().children().last().html(''),this.model.set("locked",!1),this.refreshCollectionsView()):a||void 0===a||($("tr th:contains('"+this.lastId+"')").parent().remove(),this.model.set("locked",!1),this.refreshCollectionsView()),this.refreshCollectionsView()}.bind(this);this.model.set("locked",!0),this.model.deleteIndex(this.lastId,a),$("tr th:contains('"+this.lastId+"')").parent().children().last().html('')},selectIndexType:function(){$(".newIndexClass").hide();var a=$("#newIndexType").val();$("#newIndexType"+a).show()},getIndex:function(){var a=function(a,b){a?window.arangoHelper.arangoError("Index",b.errorMessage):this.renderIndex(b)}.bind(this);this.model.getIndex(a)},renderIndex:function(a){this.index=a;var b="collectionInfoTh modal-text";if(this.index){var c="",d="";_.each(this.index.indexes,function(a){d="primary"===a.type||"edge"===a.type?'':'',void 0!==a.fields&&(c=a.fields.join(", "));var e=a.id.indexOf("/"),f=a.id.substr(e+1,a.id.length),g=a.hasOwnProperty("selectivityEstimate")?(100*a.selectivityEstimate).toFixed(2)+"%":"n/a",h=a.hasOwnProperty("sparse")?a.sparse:"n/a";$("#collectionEditIndexTable").append(""+f+""+a.type+""+a.unique+""+h+""+g+""+c+""+d+"")})}this.bindIndexEvents()},toggleNewIndexView:function(){var a=$(".index-button-bar2")[0];$("#indexEditView").is(":visible")?($("#indexEditView").hide(),$("#newIndexView").show(),$("#cancelIndex").detach().appendTo("#modal-dialog .modal-footer"),$("#createIndex").detach().appendTo("#modal-dialog .modal-footer")):($("#indexEditView").show(),$("#newIndexView").hide(),$("#cancelIndex").detach().appendTo(a),$("#createIndex").detach().appendTo(a)),arangoHelper.fixTooltips(".icon_arangodb, .arangoicon","right"),this.resetIndexForms()},stringToArray:function(a){var b=[];return a.split(",").forEach(function(a){a=a.replace(/(^\s+|\s+$)/g,""),""!==a&&b.push(a)}),b},checkboxToValue:function(a){return $(a).prop("checked")}})}(),function(){"use strict";window.CollectionsView=Backbone.View.extend({el:"#content",el2:"#collectionsThumbnailsIn",searchTimeout:null,refreshRate:1e4,template:templateEngine.createTemplate("collectionsView.ejs"),refetchCollections:function(){var a=this;this.collection.fetch({cache:!1,success:function(){a.checkLockedCollections()}})},checkLockedCollections:function(){var a=function(a,b){var c=this;a?console.log("Could not check locked collections"):(this.collection.each(function(a){a.set("locked",!1)}),_.each(b,function(a){var b=c.collection.findWhere({id:a.collection});b.set("locked",!0),b.set("lockType",a.type),b.set("desc",a.desc)}),this.collection.each(function(a){a.get("locked")||($("#collection_"+a.get("name")).find(".corneredBadge").removeClass("loaded unloaded"),$("#collection_"+a.get("name")+" .corneredBadge").text(a.get("status")),$("#collection_"+a.get("name")+" .corneredBadge").addClass(a.get("status"))),a.get("locked")||"loading"===a.get("status")?($("#collection_"+a.get("name")).addClass("locked"),a.get("locked")?($("#collection_"+a.get("name")).find(".corneredBadge").removeClass("loaded unloaded"),$("#collection_"+a.get("name")).find(".corneredBadge").addClass("inProgress"),$("#collection_"+a.get("name")+" .corneredBadge").text(a.get("desc"))):$("#collection_"+a.get("name")+" .corneredBadge").text(a.get("status"))):($("#collection_"+a.get("name")).removeClass("locked"),$("#collection_"+a.get("name")+" .corneredBadge").text(a.get("status")),$("#collection_"+a.get("name")+" .corneredBadge").hasClass("inProgress")&&($("#collection_"+a.get("name")+" .corneredBadge").text(a.get("status")),$("#collection_"+a.get("name")+" .corneredBadge").removeClass("inProgress"),$("#collection_"+a.get("name")+" .corneredBadge").addClass("loaded")),"unloaded"===a.get("status")&&$("#collection_"+a.get("name")+" .icon_arangodb_info").addClass("disabled"))}))}.bind(this);window.arangoHelper.syncAndReturnUninishedAardvarkJobs("index",a)},initialize:function(){var a=this;window.setInterval(function(){"#collections"===window.location.hash&&window.VISIBLE&&a.refetchCollections()},a.refreshRate)},render:function(){this.checkLockedCollections();var a=!1;$("#collectionsDropdown").is(":visible")&&(a=!0),$(this.el).html(this.template.render({})),this.setFilterValues(),a===!0&&$("#collectionsDropdown2").show();var b=this.collection.searchOptions;this.collection.getFiltered(b).forEach(function(a){$("#collectionsThumbnailsIn",this.el).append(new window.CollectionListItemView({model:a,collectionsView:this}).render().el)},this),"none"===$("#collectionsDropdown2").css("display")?$("#collectionsToggle").removeClass("activated"):$("#collectionsToggle").addClass("activated");var c;arangoHelper.setCheckboxStatus("#collectionsDropdown");try{c=b.searchPhrase.length}catch(d){}return $("#searchInput").val(b.searchPhrase),$("#searchInput").focus(),$("#searchInput")[0].setSelectionRange(c,c),arangoHelper.fixTooltips(".icon_arangodb, .arangoicon","left"),this},events:{"click #createCollection":"createCollection","keydown #searchInput":"restrictToSearchPhraseKey","change #searchInput":"restrictToSearchPhrase","click #searchSubmit":"restrictToSearchPhrase","click .checkSystemCollections":"checkSystem","click #checkLoaded":"checkLoaded","click #checkUnloaded":"checkUnloaded","click #checkDocument":"checkDocument","click #checkEdge":"checkEdge","click #sortName":"sortName","click #sortType":"sortType","click #sortOrder":"sortOrder","click #collectionsToggle":"toggleView","click .css-label":"checkBoxes"},updateCollectionsView:function(){var a=this;this.collection.fetch({cache:!1,success:function(){a.render()}})},toggleView:function(){$("#collectionsToggle").toggleClass("activated"),$("#collectionsDropdown2").slideToggle(200)},checkBoxes:function(a){var b=a.currentTarget.id;$("#"+b).click()},checkSystem:function(){var a=this.collection.searchOptions,b=a.includeSystem;a.includeSystem=$(".checkSystemCollections").is(":checked")===!0,b!==a.includeSystem&&this.render()},checkEdge:function(){var a=this.collection.searchOptions,b=a.includeEdge;a.includeEdge=$("#checkEdge").is(":checked")===!0,b!==a.includeEdge&&this.render()},checkDocument:function(){var a=this.collection.searchOptions,b=a.includeDocument;a.includeDocument=$("#checkDocument").is(":checked")===!0,b!==a.includeDocument&&this.render()},checkLoaded:function(){var a=this.collection.searchOptions,b=a.includeLoaded;a.includeLoaded=$("#checkLoaded").is(":checked")===!0,b!==a.includeLoaded&&this.render()},checkUnloaded:function(){var a=this.collection.searchOptions,b=a.includeUnloaded;a.includeUnloaded=$("#checkUnloaded").is(":checked")===!0,b!==a.includeUnloaded&&this.render()},sortName:function(){var a=this.collection.searchOptions,b=a.sortBy;a.sortBy=$("#sortName").is(":checked")===!0?"name":"type",b!==a.sortBy&&this.render()},sortType:function(){var a=this.collection.searchOptions,b=a.sortBy;a.sortBy=$("#sortType").is(":checked")===!0?"type":"name",b!==a.sortBy&&this.render()},sortOrder:function(){var a=this.collection.searchOptions,b=a.sortOrder;a.sortOrder=$("#sortOrder").is(":checked")===!0?-1:1,b!==a.sortOrder&&this.render()},setFilterValues:function(){var a=this.collection.searchOptions;$("#checkLoaded").attr("checked",a.includeLoaded),$("#checkUnloaded").attr("checked",a.includeUnloaded),$(".checkSystemCollections").attr("checked",a.includeSystem),$("#checkEdge").attr("checked",a.includeEdge),$("#checkDocument").attr("checked",a.includeDocument),$("#sortName").attr("checked","type"!==a.sortBy),$("#sortType").attr("checked","type"===a.sortBy),$("#sortOrder").attr("checked",1!==a.sortOrder)},search:function(){var a=this.collection.searchOptions,b=$("#searchInput").val();b!==a.searchPhrase&&(a.searchPhrase=b,this.render())},resetSearch:function(){this.searchTimeout&&(clearTimeout(this.searchTimeout),this.searchTimeout=null);var a=this.collection.searchOptions;a.searchPhrase=null},restrictToSearchPhraseKey:function(){var a=this;this.resetSearch(),a.searchTimeout=setTimeout(function(){a.search()},200)},restrictToSearchPhrase:function(){this.resetSearch(),this.search()},createCollection:function(a){a.preventDefault(),this.createNewCollectionModal()},submitCreateCollection:function(){var a=function(a,b){if(a)arangoHelper.arangoError("DB","Could not check coordinator state");else{var c=$("#new-collection-name").val(),d=$("#new-collection-size").val(),e=$("#new-replication-factor").val(),f=$("#new-collection-type").val(),g=$("#new-collection-sync").val(),h=1,i=[];if(""===e&&(e=1),b){if(h=$("#new-collection-shards").val(),""===h&&(h=1),h=parseInt(h,10),1>h)return arangoHelper.arangoError("Number of shards has to be an integer value greater or equal 1"),0;i=_.pluck($("#new-collection-shardBy").select2("data"),"text"),0===i.length&&i.push("_key")}if("_"===c.substr(0,1))return arangoHelper.arangoError('No "_" allowed as first character!'),0;var j=!1,k="true"===g;if(d>0)try{d=1024*JSON.parse(d)*1024}catch(l){return arangoHelper.arangoError("Please enter a valid number"),0}if(""===c)return arangoHelper.arangoError("No collection name entered!"),0;var m=function(a,b){if(a)try{b=JSON.parse(b.responseText),arangoHelper.arangoError("Error",b.errorMessage)}catch(c){}else this.updateCollectionsView();window.modalView.hide()}.bind(this);this.collection.newCollection({collName:c,wfs:k,isSystem:j,collSize:d,replicationFactor:e,collType:f,shards:h,shardBy:i},m)}}.bind(this);window.isCoordinator(a)},createNewCollectionModal:function(){var a=function(a,b){if(a)arangoHelper.arangoError("DB","Could not check coordinator state");else{var c=[],d=[],e={},f=[];d.push(window.modalView.createTextEntry("new-collection-name","Name","",!1,"",!0,[{rule:Joi.string().regex(/^[a-zA-Z]/),msg:"Collection name must always start with a letter."},{rule:Joi.string().regex(/^[a-zA-Z0-9\-_]*$/),msg:'Only symbols, "_" and "-" are allowed.'},{rule:Joi.string().required(),msg:"No collection name given."}])),d.push(window.modalView.createSelectEntry("new-collection-type","Type","","The type of the collection to create.",[{value:2,label:"Document"},{value:3,label:"Edge"}])),b&&(d.push(window.modalView.createTextEntry("new-collection-shards","Shards","","The number of shards to create. You cannot change this afterwards. Recommended: DBServers squared","",!0)),d.push(window.modalView.createSelect2Entry("new-collection-shardBy","shardBy","","The keys used to distribute documents on shards. Type the key and press return to add it.","_key",!1))),c.push(window.modalView.createSuccessButton("Save",this.submitCreateCollection.bind(this))),f.push(window.modalView.createTextEntry("new-collection-size","Journal size","","The maximal size of a journal or datafile (in MB). Must be at least 1.","",!1,[{rule:Joi.string().allow("").optional().regex(/^[0-9]*$/),msg:"Must be a number."}])),window.App.isCluster&&f.push(window.modalView.createTextEntry("new-replication-factor","Replication factor","","Numeric value. Must be at least 1. Description: TODO","",!1,[{rule:Joi.string().allow("").optional().regex(/^[0-9]*$/),msg:"Must be a number."}])),f.push(window.modalView.createSelectEntry("new-collection-sync","Wait for sync","","Synchronize to disk before returning from a create or update of a document.",[{value:!1,label:"No"},{value:!0,label:"Yes"}])),e.header="Advanced",e.content=f,window.modalView.show("modalTable.ejs","New Collection",c,d,e),$("#s2id_new-collection-shardBy .select2-search-field input").on("focusout",function(a){$(".select2-drop").is(":visible")&&($("#select2-search-field input").is(":focus")||window.setTimeout(function(){$(a.currentTarget).parent().parent().parent().select2("close")},200))})}}.bind(this);window.isCoordinator(a)}})}(),function(){"use strict";function a(a,b){return void 0!==a&&null!==a||(a=0),a.toFixed(b)}window.DashboardView=Backbone.View.extend({el:"#content",interval:1e4,defaultTimeFrame:12e5,defaultDetailFrame:1728e5,history:{},graphs:{},events:{"click .subViewNavbar .subMenuEntry":"toggleViews"},tendencies:{asyncPerSecondCurrent:["asyncPerSecondCurrent","asyncPerSecondPercentChange"],syncPerSecondCurrent:["syncPerSecondCurrent","syncPerSecondPercentChange"],clientConnectionsCurrent:["clientConnectionsCurrent","clientConnectionsPercentChange"],clientConnectionsAverage:["clientConnections15M","clientConnections15MPercentChange"],numberOfThreadsCurrent:["numberOfThreadsCurrent","numberOfThreadsPercentChange"],numberOfThreadsAverage:["numberOfThreads15M","numberOfThreads15MPercentChange"],virtualSizeCurrent:["virtualSizeCurrent","virtualSizePercentChange"],virtualSizeAverage:["virtualSize15M","virtualSize15MPercentChange"]},barCharts:{totalTimeDistribution:["queueTimeDistributionPercent","requestTimeDistributionPercent"],dataTransferDistribution:["bytesSentDistributionPercent","bytesReceivedDistributionPercent"]},barChartsElementNames:{queueTimeDistributionPercent:"Queue",requestTimeDistributionPercent:"Computation",bytesSentDistributionPercent:"Bytes sent",bytesReceivedDistributionPercent:"Bytes received"},getDetailFigure:function(a){var b=$(a.currentTarget).attr("id").replace(/ChartButton/g,"");return b},showDetail:function(a){var b,c=this,d=this.getDetailFigure(a);b=this.dygraphConfig.getDetailChartConfig(d),this.getHistoryStatistics(d),this.detailGraphFigure=d,window.modalView.hideFooter=!0,window.modalView.hide(),window.modalView.show("modalGraph.ejs",b.header,void 0,void 0,void 0,void 0,this.events),window.modalView.hideFooter=!1,$("#modal-dialog").on("hidden",function(){c.hidden()}),$("#modal-dialog").toggleClass("modal-chart-detail",!0),b.height=.7*$(window).height(),b.width=$(".modal-inner-detail").width(),b.labelsDiv=$(b.labelsDiv)[0],this.detailGraph=new Dygraph(document.getElementById("lineChartDetail"),this.history[this.server][d],b)},hidden:function(){this.detailGraph.destroy(),delete this.detailGraph,delete this.detailGraphFigure},getCurrentSize:function(a){"#"!==a.substr(0,1)&&(a="#"+a);var b,c;return $(a).attr("style",""),b=$(a).height(),c=$(a).width(),{height:b,width:c}},prepareDygraphs:function(){var a,b=this;this.dygraphConfig.getDashBoardFigures().forEach(function(c){a=b.dygraphConfig.getDefaultConfig(c);var d=b.getCurrentSize(a.div);a.height=d.height,a.width=d.width,b.graphs[c]=new Dygraph(document.getElementById(a.div),b.history[b.server][c]||[],a)})},initialize:function(a){this.options=a,this.dygraphConfig=a.dygraphConfig,this.d3NotInitialized=!0,this.events["click .dashboard-sub-bar-menu-sign"]=this.showDetail.bind(this),this.events["mousedown .dygraph-rangesel-zoomhandle"]=this.stopUpdating.bind(this),this.events["mouseup .dygraph-rangesel-zoomhandle"]=this.startUpdating.bind(this),this.serverInfo=a.serverToShow,this.serverInfo?this.server=this.serverInfo.target:this.server="-local-",this.history[this.server]={}},toggleViews:function(a){var b=a.currentTarget.id.split("-")[0],c=this,d=["replication","requests","system"];_.each(d,function(a){b!==a?$("#"+a).hide():($("#"+a).show(),c.resize(),$(window).resize())}),$(".subMenuEntries").children().removeClass("active"),$("#"+b+"-statistics").addClass("active"),window.setTimeout(function(){c.resize(),$(window).resize()},200)},updateCharts:function(){var a=this;return this.detailGraph?void this.updateLineChart(this.detailGraphFigure,!0):(this.prepareD3Charts(this.isUpdating),this.prepareResidentSize(this.isUpdating),this.updateTendencies(),void Object.keys(this.graphs).forEach(function(b){a.updateLineChart(b,!1)}))},updateTendencies:function(){var a=this,b=this.tendencies,c="";Object.keys(b).forEach(function(b){var d="",e=0;a.history.hasOwnProperty(a.server)&&a.history[a.server].hasOwnProperty(b)&&(e=a.history[a.server][b][1]),0>e?c="#d05448":(c="#77DB99",d="+"),a.history.hasOwnProperty(a.server)&&a.history[a.server].hasOwnProperty(b)?$("#"+b).html(a.history[a.server][b][0]+'
    '+d+e+"%"):$("#"+b).html('

    data not ready yet

    ')})},updateDateWindow:function(a,b){var c,d,e=(new Date).getTime();return b&&a.dateWindow_?(c=a.dateWindow_[0],d=e-a.dateWindow_[1]-5*this.interval>0?a.dateWindow_[1]:e,[c,d]):[e-this.defaultTimeFrame,e]},updateLineChart:function(a,b){var c=b?this.detailGraph:this.graphs[a],d={file:this.history[this.server][a],dateWindow:this.updateDateWindow(c,b)},e=0,f=[];_.each(d.file,function(a){var b=a[0].getSeconds()-a[0].getSeconds()%10;d.file[e][0].setSeconds(b),f.push(d.file[e][0]),e++});for(var g=new Date(Math.max.apply(null,f)),h=new Date(Math.min.apply(null,f)),i=new Date(h.getTime()),j=[],k=[];g>i;)i=new Date(i.setSeconds(i.getSeconds()+10)),k.push(i);_.each(k,function(a){var b=!1;_.each(d.file,function(c){Math.floor(a.getTime()/1e3)===Math.floor(c[0].getTime()/1e3)&&(b=!0)}),b===!1&&a1)){var f=0,g=0;9===c.length&&(f+=c[1],f+=c[6],f+=c[7],f+=c[8],g+=c[2],g+=c[3],g+=c[4],g+=c[5],c=[c[0],f,g]),d.history[d.server][e].unshift(c)}})},cutOffHistory:function(a,b){for(var c=this,d=c.history[c.server][a];0!==d.length&&!(d[d.length-1][0]>=b);)d.pop()},cutOffDygraphHistory:function(a){var b=this,c=new Date(a);this.dygraphConfig.getDashBoardFigures(!0).forEach(function(a){b.dygraphConfig.mapStatToFigure[a]&&b.history[b.server][a]&&b.cutOffHistory(a,c)})},mergeHistory:function(b){var c,d=this;for(c=0;c=0;--c)d.values.push({label:this.getLabel(b[a[0]].cuts,c),value:b[a[0]].values[c]}),e.values.push({label:this.getLabel(b[a[1]].cuts,c),value:b[a[1]].values[c]});return[d,e]},getLabel:function(a,b){return a[b]?0===b?"0 - "+a[b]:a[b-1]+" - "+a[b]:">"+a[b-1]},renderReplicationStatistics:function(a){$("#repl-numbers table tr:nth-child(1) > td:nth-child(2)").html(a.state.totalEvents),$("#repl-numbers table tr:nth-child(2) > td:nth-child(2)").html(a.state.totalRequests),$("#repl-numbers table tr:nth-child(3) > td:nth-child(2)").html(a.state.totalFailedConnects),a.state.lastAppliedContinuousTick?$("#repl-ticks table tr:nth-child(1) > td:nth-child(2)").html(a.state.lastAppliedContinuousTick):$("#repl-ticks table tr:nth-child(1) > td:nth-child(2)").html("no data available").addClass("no-data"),a.state.lastProcessedContinuousTick?$("#repl-ticks table tr:nth-child(2) > td:nth-child(2)").html(a.state.lastProcessedContinuousTick):$("#repl-ticks table tr:nth-child(2) > td:nth-child(2)").html("no data available").addClass("no-data"),a.state.lastAvailableContinuousTick?$("#repl-ticks table tr:nth-child(3) > td:nth-child(2)").html(a.state.lastAvailableContinuousTick):$("#repl-ticks table tr:nth-child(3) > td:nth-child(2)").html("no data available").addClass("no-data"),$("#repl-progress table tr:nth-child(1) > td:nth-child(2)").html(a.state.progress.message),$("#repl-progress table tr:nth-child(2) > td:nth-child(2)").html(a.state.progress.time),$("#repl-progress table tr:nth-child(3) > td:nth-child(2)").html(a.state.progress.failedConnects)},getReplicationStatistics:function(){var a=this;$.ajax(arangoHelper.databaseUrl("/_api/replication/applier-state"),{async:!0}).done(function(b){if(b.hasOwnProperty("state")){var c;c=b.state.running?"active":"inactive",c=''+c+"",$("#replication-chart .dashboard-sub-bar").html("Replication "+c),a.renderReplicationStatistics(b)}})},getStatistics:function(a,b){var c=this,d=arangoHelper.databaseUrl("/_admin/aardvark/statistics/short","_system"),e="?start=";e+=c.nextStart?c.nextStart:((new Date).getTime()-c.defaultTimeFrame)/1e3,"-local-"!==c.server&&(e+="&type=short&DBserver="+c.serverInfo.target,c.history.hasOwnProperty(c.server)||(c.history[c.server]={})),$.ajax(d+e,{async:!0,xhrFields:{withCredentials:!0},crossDomain:!0}).done(function(d){d.times.length>0&&(c.isUpdating=!0,c.mergeHistory(d)),c.isUpdating!==!1&&(a&&a(d.enabled,b),c.updateCharts())}).error(function(a){console.log("stat fetch req error:"+a)}),this.getReplicationStatistics()},getHistoryStatistics:function(a){var b=this,c="statistics/long",d="?filter="+this.dygraphConfig.mapStatToFigure[a].join();"-local-"!==b.server&&(c=b.server.endpoint+arangoHelper.databaseUrl("/_admin/aardvark/statistics/cluster"),d+="&type=long&DBserver="+b.server.target,b.history.hasOwnProperty(b.server)||(b.history[b.server]={}));var e=window.location.href.split("/"),f=e[0]+"//"+e[2]+"/"+e[3]+"/_system/"+e[5]+"/"+e[6]+"/";$.ajax(f+c+d,{async:!0}).done(function(c){var d;for(b.history[b.server][a]=[],d=0;d data not ready yet

    '),$("#totalTimeDistribution").prepend('

    data not ready yet

    '),$(".dashboard-bar-chart-title").append('

    data not ready yet

    '))},removeEmptyDataLabels:function(){$(".dataNotReadyYet").remove()},prepareResidentSize:function(b){var c=this,d=this.getCurrentSize("#residentSizeChartContainer"),e=c.history[c.server].residentSizeCurrent/1024/1024,f="";f=1025>e?a(e,2)+" MB":a(e/1024,2)+" GB";var g=a(100*c.history[c.server].residentSizePercent,2),h=[a(c.history[c.server].physicalMemory/1024/1024/1024,0)+" GB"];return void 0===c.history[c.server].residentSizeChart?void this.addEmptyDataLabels():(this.removeEmptyDataLabels(),void nv.addGraph(function(){var a=nv.models.multiBarHorizontalChart().x(function(a){return a.label}).y(function(a){return a.value}).width(d.width).height(d.height).margin({top:($("residentSizeChartContainer").outerHeight()-$("residentSizeChartContainer").height())/2,right:1,bottom:($("residentSizeChartContainer").outerHeight()-$("residentSizeChartContainer").height())/2,left:1}).showValues(!1).showYAxis(!1).showXAxis(!1).showLegend(!1).showControls(!1).stacked(!0);return a.yAxis.tickFormat(function(a){return a+"%"}).showMaxMin(!1),a.xAxis.showMaxMin(!1),d3.select("#residentSizeChart svg").datum(c.history[c.server].residentSizeChart).call(a),d3.select("#residentSizeChart svg").select(".nv-zeroLine").remove(),b&&(d3.select("#residentSizeChart svg").select("#total").remove(),d3.select("#residentSizeChart svg").select("#percentage").remove()),d3.select(".dashboard-bar-chart-title .percentage").html(f+" ("+g+" %)"),d3.select(".dashboard-bar-chart-title .absolut").html(h[0]),nv.utils.windowResize(a.update),a},function(){d3.selectAll("#residentSizeChart .nv-bar").on("click",function(){})}))},prepareD3Charts:function(b){var c=this,d={totalTimeDistribution:["queueTimeDistributionPercent","requestTimeDistributionPercent"],dataTransferDistribution:["bytesSentDistributionPercent","bytesReceivedDistributionPercent"]};this.d3NotInitialized&&(b=!1,this.d3NotInitialized=!1),_.each(Object.keys(d),function(b){var d=c.getCurrentSize("#"+b+"Container .dashboard-interior-chart"),e="#"+b+"Container svg";return void 0===c.history[c.server].residentSizeChart?void c.addEmptyDataLabels():(c.removeEmptyDataLabels(),void nv.addGraph(function(){var f=[0,.25,.5,.75,1],g=75,h=23,i=6;d.width<219?(f=[0,.5,1],g=72,h=21,i=5):d.width<299?(f=[0,.3334,.6667,1],g=77):d.width<379?g=87:d.width<459?g=95:d.width<539?g=100:d.width<619&&(g=105);var j=nv.models.multiBarHorizontalChart().x(function(a){return a.label}).y(function(a){return a.value}).width(d.width).height(d.height).margin({top:5,right:20,bottom:h,left:g}).showValues(!1).showYAxis(!0).showXAxis(!0).showLegend(!1).showControls(!1).forceY([0,1]);return j.yAxis.showMaxMin(!1),d3.select(".nv-y.nv-axis").selectAll("text").attr("transform","translate (0, "+i+")"),j.yAxis.tickValues(f).tickFormat(function(b){return a(100*b*100/100,0)+"%"}),d3.select(e).datum(c.history[c.server][b]).call(j),nv.utils.windowResize(j.update),j},function(){d3.selectAll(e+" .nv-bar").on("click",function(){})}))})},stopUpdating:function(){this.isUpdating=!1},startUpdating:function(){var a=this;a.timer||(a.timer=window.setInterval(function(){window.App.isCluster?window.location.hash.indexOf(a.serverInfo.target)>-1&&a.getStatistics():a.getStatistics()},a.interval))},resize:function(){if(this.isUpdating){var a,b=this;_.each(this.graphs,function(c){a=b.getCurrentSize(c.maindiv_.id),c.resize(a.width,a.height)}),this.detailGraph&&(a=this.getCurrentSize(this.detailGraph.maindiv_.id),this.detailGraph.resize(a.width,a.height)),this.prepareD3Charts(!0),this.prepareResidentSize(!0)}},template:templateEngine.createTemplate("dashboardView.ejs"),render:function(a){var b=function(a,b){return b||$(this.el).html(this.template.render()),a&&"_system"===frontendConfig.db?(this.prepareDygraphs(),this.isUpdating&&(this.prepareD3Charts(), -this.prepareResidentSize(),this.updateTendencies(),$(window).trigger("resize")),this.startUpdating(),void $(window).resize()):($(this.el).html(""),void(this.server?$(this.el).append('
    Server statistics ('+this.server+") are disabled.
    "):$(this.el).append('
    Server statistics are disabled.
    ')))}.bind(this),c=function(){$(this.el).html(""),$(".contentDiv").remove(),$(".headerBar").remove(),$(".dashboard-headerbar").remove(),$(".dashboard-row").remove(),$(this.el).append('
    You do not have permission to view this page.
    '),$(this.el).append("
    You can switch to '_system' to see the dashboard.
    ")}.bind(this);if("_system"!==frontendConfig.db)return void c();var d=function(d,e){d||(e?this.getStatistics(b,a):c())}.bind(this);void 0===window.App.currentDB.get("name")?window.setTimeout(function(){return"_system"!==window.App.currentDB.get("name")?void c():void this.options.database.hasSystemAccess(d)}.bind(this),300):this.options.database.hasSystemAccess(d)}})}(),function(){"use strict";window.DatabaseView=Backbone.View.extend({users:null,el:"#content",template:templateEngine.createTemplate("databaseView.ejs"),dropdownVisible:!1,currentDB:"",events:{"click #createDatabase":"createDatabase","click #submitCreateDatabase":"submitCreateDatabase","click .editDatabase":"editDatabase","click #userManagementView .icon":"editDatabase","click #selectDatabase":"updateDatabase","click #submitDeleteDatabase":"submitDeleteDatabase","click .contentRowInactive a":"changeDatabase","keyup #databaseSearchInput":"search","click #databaseSearchSubmit":"search","click #databaseToggle":"toggleSettingsDropdown","click .css-label":"checkBoxes","click #dbSortDesc":"sorting"},sorting:function(){$("#dbSortDesc").is(":checked")?this.collection.setSortingDesc(!0):this.collection.setSortingDesc(!1),$("#databaseDropdown").is(":visible")?this.dropdownVisible=!0:this.dropdownVisible=!1,this.render()},initialize:function(){this.collection.fetch({async:!0,cache:!1})},checkBoxes:function(a){var b=a.currentTarget.id;$("#"+b).click()},render:function(){var a=function(a,b){a?arangoHelper.arangoError("DB","Could not get current db properties"):(this.currentDB=b,this.collection.sort(),$(this.el).html(this.template.render({collection:this.collection,searchString:"",currentDB:this.currentDB})),this.dropdownVisible===!0&&($("#dbSortDesc").attr("checked",this.collection.sortOptions.desc),$("#databaseToggle").toggleClass("activated"),$("#databaseDropdown2").show()),arangoHelper.setCheckboxStatus("#databaseDropdown"),this.replaceSVGs())}.bind(this);return this.collection.getCurrentDatabase(a),this},toggleSettingsDropdown:function(){$("#dbSortDesc").attr("checked",this.collection.sortOptions.desc),$("#databaseToggle").toggleClass("activated"),$("#databaseDropdown2").slideToggle(200)},selectedDatabase:function(){return $("#selectDatabases").val()},handleError:function(a,b,c){return 409===a?void arangoHelper.arangoError("DB","Database "+c+" already exists."):400===a?void arangoHelper.arangoError("DB","Invalid Parameters"):403===a?void arangoHelper.arangoError("DB","Insufficent rights. Execute this from _system database"):void 0},validateDatabaseInfo:function(a,b){return""===b?(arangoHelper.arangoError("DB","You have to define an owner for the new database"),!1):""===a?(arangoHelper.arangoError("DB","You have to define a name for the new database"),!1):0===a.indexOf("_")?(arangoHelper.arangoError("DB ","Databasename should not start with _"),!1):a.match(/^[a-zA-Z][a-zA-Z0-9_\-]*$/)?!0:(arangoHelper.arangoError("DB","Databasename may only contain numbers, letters, _ and -"),!1)},createDatabase:function(a){a.preventDefault(),this.createAddDatabaseModal()},switchDatabase:function(a){if(!$(a.target).parent().hasClass("iconSet")){var b=$(a.currentTarget).find("h5").text();if(""!==b){var c=this.collection.createDatabaseURL(b);window.location.replace(c)}}},submitCreateDatabase:function(){var a=this,b=$("#newDatabaseName").val(),c=$("#newUser").val(),d={name:b};this.collection.create(d,{error:function(c,d){a.handleError(d.status,d.statusText,b)},success:function(d){"root"!==c&&$.ajax({type:"PUT",url:arangoHelper.databaseUrl("/_api/user/"+encodeURIComponent(c)+"/database/"+encodeURIComponent(b)),contentType:"application/json",data:JSON.stringify({grant:"rw"})}),$.ajax({type:"PUT",url:arangoHelper.databaseUrl("/_api/user/root/database/"+encodeURIComponent(b)),contentType:"application/json",data:JSON.stringify({grant:"rw"})}),"#databases"===window.location.hash&&a.updateDatabases(),arangoHelper.arangoNotification("Database "+d.get("name")+" created.")}}),arangoHelper.arangoNotification("Database creation in progress."),window.modalView.hide()},submitDeleteDatabase:function(a){var b=this.collection.where({name:a});b[0].destroy({wait:!0,url:arangoHelper.databaseUrl("/_api/database/"+a)}),this.updateDatabases(),window.App.naviView.dbSelectionView.render($("#dbSelect")),window.modalView.hide()},changeDatabase:function(a){var b=$(a.currentTarget).attr("id"),c=this.collection.createDatabaseURL(b);window.location.replace(c)},updateDatabases:function(){var a=this;this.collection.fetch({cache:!1,success:function(){a.render(),window.App.handleSelectDatabase()}})},editDatabase:function(a){var b=this.evaluateDatabaseName($(a.currentTarget).attr("id"),"_edit-database"),c=!0;b===this.currentDB&&(c=!1),this.createEditDatabaseModal(b,c)},search:function(){var a,b,c,d;a=$("#databaseSearchInput"),b=$("#databaseSearchInput").val(),d=this.collection.filter(function(a){return-1!==a.get("name").indexOf(b)}),$(this.el).html(this.template.render({collection:d,searchString:b,currentDB:this.currentDB})),this.replaceSVGs(),a=$("#databaseSearchInput"),c=a.val().length,a.focus(),a[0].setSelectionRange(c,c)},replaceSVGs:function(){$(".svgToReplace").each(function(){var a=$(this),b=a.attr("id"),c=a.attr("src");$.get(c,function(c){var d=$(c).find("svg");d.attr("id",b).attr("class","tile-icon-svg").removeAttr("xmlns:a"),a.replaceWith(d)},"xml")})},evaluateDatabaseName:function(a,b){var c=a.lastIndexOf(b);return a.substring(0,c)},createEditDatabaseModal:function(a,b){var c=[],d=[];d.push(window.modalView.createReadOnlyEntry("id_name","Name",a,"")),b?c.push(window.modalView.createDeleteButton("Delete",this.submitDeleteDatabase.bind(this,a))):c.push(window.modalView.createDisabledButton("Delete")),window.modalView.show("modalTable.ejs","Delete database",c,d)},createAddDatabaseModal:function(){var a=[],b=[];b.push(window.modalView.createTextEntry("newDatabaseName","Name","",!1,"Database Name",!0,[{rule:Joi.string().regex(/^[a-zA-Z]/),msg:"Database name must start with a letter."},{rule:Joi.string().regex(/^[a-zA-Z0-9\-_]*$/),msg:'Only Symbols "_" and "-" are allowed.'},{rule:Joi.string().required(),msg:"No database name given."}]));var c=[];window.App.userCollection.each(function(a){c.push({value:a.get("user"),label:a.get("user")})}),b.push(window.modalView.createSelectEntry("newUser","Username",null!==this.users?this.users.whoAmI():"root","Please define the owner of this database. This will be the only user having initial access to this database if authentication is turned on. Please note that if you specify a username different to your account you will not be able to access the database with your account after having creating it. Specifying a username is mandatory even with authentication turned off. If there is a failure you will be informed.",c)),a.push(window.modalView.createSuccessButton("Create",this.submitCreateDatabase.bind(this))),window.modalView.show("modalTable.ejs","Create Database",a,b),$("#useDefaultPassword").change(function(){"true"===$("#useDefaultPassword").val()?$("#row_newPassword").hide():$("#row_newPassword").show()}),$("#row_newPassword").hide()}})}(),function(){"use strict";window.DBSelectionView=Backbone.View.extend({template:templateEngine.createTemplate("dbSelectionView.ejs"),events:{"click .dbSelectionLink":"changeDatabase"},initialize:function(a){this.current=a.current},changeDatabase:function(a){var b=$(a.currentTarget).closest(".dbSelectionLink.tab").attr("id"),c=this.collection.createDatabaseURL(b);window.location.replace(c)},render:function(a){var b=function(b,c){b?arangoHelper.arangoError("DB","Could not fetch databases"):(this.$el=a,this.$el.html(this.template.render({list:c,current:this.current.get("name")})),this.delegateEvents())}.bind(this);return this.collection.getDatabasesForUser(b),this.el}})}(),function(){"use strict";window.DocumentsView=window.PaginationView.extend({filters:{0:!0},filterId:0,paginationDiv:"#documentsToolbarF",idPrefix:"documents",addDocumentSwitch:!0,activeFilter:!1,lastCollectionName:void 0,restoredFilters:[],editMode:!1,allowUpload:!1,el:"#content",table:"#documentsTableID",template:templateEngine.createTemplate("documentsView.ejs"),collectionContext:{prev:null,next:null},editButtons:["#deleteSelected","#moveSelected"],initialize:function(a){this.documentStore=a.documentStore,this.collectionsStore=a.collectionsStore,this.tableView=new window.TableView({el:this.table,collection:this.collection}),this.tableView.setRowClick(this.clicked.bind(this)),this.tableView.setRemoveClick(this.remove.bind(this))},resize:function(){$("#docPureTable").height($(".centralRow").height()-210),$("#docPureTable .pure-table-body").css("max-height",$("#docPureTable").height()-47)},setCollectionId:function(a,b){this.collection.setCollection(a),this.collection.setPage(b),this.page=b;var c=function(b,c){b?arangoHelper.arangoError("Error","Could not get collection properties."):(this.type=c,this.collection.getDocuments(this.getDocsCallback.bind(this)),this.collectionModel=this.collectionsStore.get(a))}.bind(this);arangoHelper.collectionApiType(a,null,c)},getDocsCallback:function(a){$("#documents_last").css("visibility","hidden"),$("#documents_first").css("visibility","hidden"),a?(window.progressView.hide(),arangoHelper.arangoError("Document error","Could not fetch requested documents.")):a&&void 0===a||(window.progressView.hide(),this.drawTable(),this.renderPaginationElements())},events:{"click #collectionPrev":"prevCollection","click #collectionNext":"nextCollection","click #filterCollection":"filterCollection","click #markDocuments":"editDocuments","click #importCollection":"importCollection","click #exportCollection":"exportCollection","click #filterSend":"sendFilter","click #addFilterItem":"addFilterItem","click .removeFilterItem":"removeFilterItem","click #deleteSelected":"deleteSelectedDocs","click #moveSelected":"moveSelectedDocs","click #addDocumentButton":"addDocumentModal","click #documents_first":"firstDocuments","click #documents_last":"lastDocuments","click #documents_prev":"prevDocuments","click #documents_next":"nextDocuments","click #confirmDeleteBtn":"confirmDelete","click .key":"nop",keyup:"returnPressedHandler","keydown .queryline input":"filterValueKeydown","click #importModal":"showImportModal","click #resetView":"resetView","click #confirmDocImport":"startUpload","click #exportDocuments":"startDownload","change #documentSize":"setPagesize","change #docsSort":"setSorting"},showSpinner:function(){$("#uploadIndicator").show()},hideSpinner:function(){$("#uploadIndicator").hide()},showImportModal:function(){$("#docImportModal").modal("show")},hideImportModal:function(){$("#docImportModal").modal("hide")},setPagesize:function(){var a=$("#documentSize").find(":selected").val();this.collection.setPagesize(a),this.collection.getDocuments(this.getDocsCallback.bind(this))},setSorting:function(){var a=$("#docsSort").val();""!==a&&void 0!==a&&null!==a||(a="_key"),this.collection.setSort(a)},returnPressedHandler:function(a){13===a.keyCode&&$(a.target).is($("#docsSort"))&&this.collection.getDocuments(this.getDocsCallback.bind(this)),13===a.keyCode&&$("#confirmDeleteBtn").attr("disabled")===!1&&this.confirmDelete()},nop:function(a){a.stopPropagation()},resetView:function(){var a=function(a){a&&arangoHelper.arangoError("Document","Could not fetch documents count")};$("input").val(""),$("select").val("=="),this.removeAllFilterItems(),$("#documentSize").val(this.collection.getPageSize()),$("#documents_last").css("visibility","visible"),$("#documents_first").css("visibility","visible"),this.addDocumentSwitch=!0,this.collection.resetFilter(),this.collection.loadTotal(a),this.restoredFilters=[],this.allowUpload=!1,this.files=void 0,this.file=void 0,$("#confirmDocImport").attr("disabled",!0),this.markFilterToggle(),this.collection.getDocuments(this.getDocsCallback.bind(this))},startDownload:function(){var a=this.collection.buildDownloadDocumentQuery();""!==a||void 0!==a||null!==a?window.open(encodeURI("query/result/download/"+btoa(JSON.stringify(a)))):arangoHelper.arangoError("Document error","could not download documents")},startUpload:function(){var a=function(a,b){a?(arangoHelper.arangoError("Upload",b),this.hideSpinner()):(this.hideSpinner(),this.hideImportModal(),this.resetView())}.bind(this);this.allowUpload===!0&&(this.showSpinner(),this.collection.uploadDocuments(this.file,a))},uploadSetup:function(){var a=this;$("#importDocuments").change(function(b){a.files=b.target.files||b.dataTransfer.files,a.file=a.files[0],$("#confirmDocImport").attr("disabled",!1),a.allowUpload=!0})},buildCollectionLink:function(a){return"collection/"+encodeURIComponent(a.get("name"))+"/documents/1"},markFilterToggle:function(){this.restoredFilters.length>0?$("#filterCollection").addClass("activated"):$("#filterCollection").removeClass("activated")},editDocuments:function(){$("#importCollection").removeClass("activated"),$("#exportCollection").removeClass("activated"),this.markFilterToggle(),$("#markDocuments").toggleClass("activated"),this.changeEditMode(),$("#filterHeader").hide(),$("#importHeader").hide(),$("#editHeader").slideToggle(200),$("#exportHeader").hide()},filterCollection:function(){$("#importCollection").removeClass("activated"),$("#exportCollection").removeClass("activated"),$("#markDocuments").removeClass("activated"),this.changeEditMode(!1),this.markFilterToggle(),this.activeFilter=!0,$("#importHeader").hide(),$("#editHeader").hide(),$("#exportHeader").hide(),$("#filterHeader").slideToggle(200);var a;for(a in this.filters)if(this.filters.hasOwnProperty(a))return void $("#attribute_name"+a).focus()},exportCollection:function(){$("#importCollection").removeClass("activated"),$("#filterHeader").removeClass("activated"),$("#markDocuments").removeClass("activated"),this.changeEditMode(!1),$("#exportCollection").toggleClass("activated"),this.markFilterToggle(),$("#exportHeader").slideToggle(200),$("#importHeader").hide(),$("#filterHeader").hide(),$("#editHeader").hide()},importCollection:function(){this.markFilterToggle(),$("#markDocuments").removeClass("activated"),this.changeEditMode(!1),$("#importCollection").toggleClass("activated"),$("#exportCollection").removeClass("activated"),$("#importHeader").slideToggle(200),$("#filterHeader").hide(),$("#editHeader").hide(),$("#exportHeader").hide()},changeEditMode:function(a){a===!1||this.editMode===!0?($("#docPureTable .pure-table-body .pure-table-row").css("cursor","default"),$(".deleteButton").fadeIn(),$(".addButton").fadeIn(),$(".selected-row").removeClass("selected-row"),this.editMode=!1,this.tableView.setRowClick(this.clicked.bind(this))):($("#docPureTable .pure-table-body .pure-table-row").css("cursor","copy"),$(".deleteButton").fadeOut(),$(".addButton").fadeOut(),$(".selectedCount").text(0),this.editMode=!0,this.tableView.setRowClick(this.editModeClick.bind(this)))},getFilterContent:function(){var a,b,c=[];for(a in this.filters)if(this.filters.hasOwnProperty(a)){b=$("#attribute_value"+a).val();try{b=JSON.parse(b)}catch(d){b=String(b)}""!==$("#attribute_name"+a).val()&&c.push({attribute:$("#attribute_name"+a).val(),operator:$("#operator"+a).val(),value:b})}return c},sendFilter:function(){this.restoredFilters=this.getFilterContent();var a=this;this.collection.resetFilter(),this.addDocumentSwitch=!1,_.each(this.restoredFilters,function(b){void 0!==b.operator&&a.collection.addFilter(b.attribute,b.operator,b.value)}),this.collection.setToFirst(),this.collection.getDocuments(this.getDocsCallback.bind(this)),this.markFilterToggle()},restoreFilter:function(){var a=this,b=0;this.filterId=0,$("#docsSort").val(this.collection.getSort()),_.each(this.restoredFilters,function(c){0!==b&&a.addFilterItem(),void 0!==c.operator&&($("#attribute_name"+b).val(c.attribute),$("#operator"+b).val(c.operator),$("#attribute_value"+b).val(c.value)),b++,a.collection.addFilter(c.attribute,c.operator,c.value)})},addFilterItem:function(){var a=++this.filterId;$("#filterHeader").append('
    '),this.filters[a]=!0},filterValueKeydown:function(a){13===a.keyCode&&this.sendFilter()},removeFilterItem:function(a){var b=a.currentTarget,c=b.id.replace(/^removeFilter/,"");delete this.filters[c],delete this.restoredFilters[c],$(b.parentElement).remove()},removeAllFilterItems:function(){var a,b=$("#filterHeader").children().length;for(a=1;b>=a;a++)$("#removeFilter"+a).parent().remove();this.filters={0:!0},this.filterId=0},addDocumentModal:function(){var a=window.location.hash.split("/")[1],b=[],c=[],d=function(a,d){a?arangoHelper.arangoError("Error","Could not fetch collection type"):"edge"===d?(c.push(window.modalView.createTextEntry("new-edge-from-attr","_from","","document _id: document handle of the linked vertex (incoming relation)",void 0,!1,[{rule:Joi.string().required(),msg:"No _from attribute given."}])),c.push(window.modalView.createTextEntry("new-edge-to","_to","","document _id: document handle of the linked vertex (outgoing relation)",void 0,!1,[{rule:Joi.string().required(),msg:"No _to attribute given."}])),c.push(window.modalView.createTextEntry("new-edge-key-attr","_key",void 0,"the edges unique key(optional attribute, leave empty for autogenerated key","is optional: leave empty for autogenerated key",!1,[{rule:Joi.string().allow("").optional(),msg:""}])),b.push(window.modalView.createSuccessButton("Create",this.addEdge.bind(this))),window.modalView.show("modalTable.ejs","Create edge",b,c)):(c.push(window.modalView.createTextEntry("new-document-key-attr","_key",void 0,"the documents unique key(optional attribute, leave empty for autogenerated key","is optional: leave empty for autogenerated key",!1,[{rule:Joi.string().allow("").optional(),msg:""}])),b.push(window.modalView.createSuccessButton("Create",this.addDocument.bind(this))),window.modalView.show("modalTable.ejs","Create document",b,c))}.bind(this);arangoHelper.collectionApiType(a,!0,d)},addEdge:function(){var a,b=window.location.hash.split("/")[1],c=$(".modal-body #new-edge-from-attr").last().val(),d=$(".modal-body #new-edge-to").last().val(),e=$(".modal-body #new-edge-key-attr").last().val(),f=function(b,c){if(b)arangoHelper.arangoError("Error","Could not create edge");else{window.modalView.hide(),c=c._id.split("/");try{a="collection/"+c[0]+"/"+c[1],decodeURI(a)}catch(d){a="collection/"+c[0]+"/"+encodeURIComponent(c[1])}window.location.hash=a}};""!==e||void 0!==e?this.documentStore.createTypeEdge(b,c,d,e,f):this.documentStore.createTypeEdge(b,c,d,null,f)},addDocument:function(){var a,b=window.location.hash.split("/")[1],c=$(".modal-body #new-document-key-attr").last().val(),d=function(b,c){if(b)arangoHelper.arangoError("Error","Could not create document");else{window.modalView.hide(),c=c.split("/");try{a="collection/"+c[0]+"/"+c[1],decodeURI(a)}catch(d){a="collection/"+c[0]+"/"+encodeURIComponent(c[1])}window.location.hash=a}};""!==c||void 0!==c?this.documentStore.createTypeDocument(b,c,d):this.documentStore.createTypeDocument(b,null,d)},moveSelectedDocs:function(){var a=[],b=[],c=this.getSelectedDocs();0!==c.length&&(b.push(window.modalView.createTextEntry("move-documents-to","Move to","",!1,"collection-name",!0,[{rule:Joi.string().regex(/^[a-zA-Z]/),msg:"Collection name must always start with a letter."},{rule:Joi.string().regex(/^[a-zA-Z0-9\-_]*$/),msg:'Only Symbols "_" and "-" are allowed.'},{rule:Joi.string().required(),msg:"No collection name given."}])),a.push(window.modalView.createSuccessButton("Move",this.confirmMoveSelectedDocs.bind(this))),window.modalView.show("modalTable.ejs","Move documents",a,b))},confirmMoveSelectedDocs:function(){var a=this.getSelectedDocs(),b=this,c=$(".modal-body").last().find("#move-documents-to").val(),d=function(){this.collection.getDocuments(this.getDocsCallback.bind(this)),$("#markDocuments").click(),window.modalView.hide()}.bind(this);_.each(a,function(a){b.collection.moveDocument(a,b.collection.collectionID,c,d)})},deleteSelectedDocs:function(){var a=[],b=[],c=this.getSelectedDocs();0!==c.length&&(b.push(window.modalView.createReadOnlyEntry(void 0,c.length+" documents selected","Do you want to delete all selected documents?",void 0,void 0,!1,void 0)),a.push(window.modalView.createDeleteButton("Delete",this.confirmDeleteSelectedDocs.bind(this))),window.modalView.show("modalTable.ejs","Delete documents",a,b))},confirmDeleteSelectedDocs:function(){var a=this.getSelectedDocs(),b=[],c=this;_.each(a,function(a){if("document"===c.type){var d=function(a){a?(b.push(!1),arangoHelper.arangoError("Document error","Could not delete document.")):(b.push(!0),c.collection.setTotalMinusOne(),c.collection.getDocuments(this.getDocsCallback.bind(this)),$("#markDocuments").click(),window.modalView.hide())}.bind(c);c.documentStore.deleteDocument(c.collection.collectionID,a,d)}else if("edge"===c.type){var e=function(a){a?(b.push(!1),arangoHelper.arangoError("Edge error","Could not delete edge")):(c.collection.setTotalMinusOne(),b.push(!0),c.collection.getDocuments(this.getDocsCallback.bind(this)),$("#markDocuments").click(),window.modalView.hide())}.bind(c);c.documentStore.deleteEdge(c.collection.collectionID,a,e)}})},getSelectedDocs:function(){var a=[];return _.each($("#docPureTable .pure-table-body .pure-table-row"),function(b){$(b).hasClass("selected-row")&&a.push($($(b).children()[1]).find(".key").text())}),a},remove:function(a){this.docid=$(a.currentTarget).parent().parent().prev().find(".key").text(),$("#confirmDeleteBtn").attr("disabled",!1),$("#docDeleteModal").modal("show")},confirmDelete:function(){$("#confirmDeleteBtn").attr("disabled",!0);var a=window.location.hash.split("/"),b=a[3];"source"!==b&&this.reallyDelete()},reallyDelete:function(){if("document"===this.type){var a=function(a){a?arangoHelper.arangoError("Error","Could not delete document"):(this.collection.setTotalMinusOne(),this.collection.getDocuments(this.getDocsCallback.bind(this)),$("#docDeleteModal").modal("hide"))}.bind(this);this.documentStore.deleteDocument(this.collection.collectionID,this.docid,a)}else if("edge"===this.type){var b=function(a){a?arangoHelper.arangoError("Edge error","Could not delete edge"):(this.collection.setTotalMinusOne(),this.collection.getDocuments(this.getDocsCallback.bind(this)),$("#docDeleteModal").modal("hide"))}.bind(this);this.documentStore.deleteEdge(this.collection.collectionID,this.docid,b)}},editModeClick:function(a){var b=$(a.currentTarget);b.hasClass("selected-row")?b.removeClass("selected-row"):b.addClass("selected-row");var c=this.getSelectedDocs();$(".selectedCount").text(c.length),_.each(this.editButtons,function(a){c.length>0?($(a).prop("disabled",!1),$(a).removeClass("button-neutral"),$(a).removeClass("disabled"),"#moveSelected"===a?$(a).addClass("button-success"):$(a).addClass("button-danger")):($(a).prop("disabled",!0),$(a).addClass("disabled"),$(a).addClass("button-neutral"),"#moveSelected"===a?$(a).removeClass("button-success"):$(a).removeClass("button-danger"))})},clicked:function(a){var b,c=a.currentTarget,d=$(c).attr("id").substr(4);try{b="collection/"+this.collection.collectionID+"/"+d,decodeURI(d)}catch(e){b="collection/"+this.collection.collectionID+"/"+encodeURIComponent(d)}window.location.hash=b},drawTable:function(){this.tableView.setElement($("#docPureTable")).render(),arangoHelper.fixTooltips(".icon_arangodb, .arangoicon","top"),$(".prettify").snippet("javascript",{style:"nedit",menu:!1,startText:!1,transparent:!0,showNum:!1}),this.resize()},checkCollectionState:function(){this.lastCollectionName===this.collectionName?this.activeFilter&&(this.filterCollection(),this.restoreFilter()):void 0!==this.lastCollectionName&&(this.collection.resetFilter(),this.collection.setSort(""),this.restoredFilters=[],this.activeFilter=!1)},render:function(){return $(this.el).html(this.template.render({})),2===this.type?this.type="document":3===this.type&&(this.type="edge"),this.tableView.setElement($(this.table)).drawLoading(),this.collectionContext=this.collectionsStore.getPosition(this.collection.collectionID),this.collectionName=window.location.hash.split("/")[1],this.breadcrumb(),window.arangoHelper.buildCollectionSubNav(this.collectionName,"Content"),this.checkCollectionState(),this.lastCollectionName=this.collectionName,this.uploadSetup(),$("[data-toggle=tooltip]").tooltip(),$(".upload-info").tooltip(),arangoHelper.fixTooltips(".icon_arangodb, .arangoicon","top"),this.renderPaginationElements(),this.selectActivePagesize(),this.markFilterToggle(),this.resize(),this},rerender:function(){this.collection.getDocuments(this.getDocsCallback.bind(this)),this.resize()},selectActivePagesize:function(){$("#documentSize").val(this.collection.getPageSize())},renderPaginationElements:function(){this.renderPagination();var a=$("#totalDocuments");0===a.length&&($("#documentsToolbarFL").append(''),a=$("#totalDocuments")),"document"===this.type&&a.html(numeral(this.collection.getTotal()).format("0,0")+" doc(s)"),"edge"===this.type&&a.html(numeral(this.collection.getTotal()).format("0,0")+" edge(s)")},breadcrumb:function(){$("#subNavigationBar .breadcrumb").html("Collection: "+this.collectionName)}})}(),function(){"use strict";var a=function(a){var b=a.split("/");return"collection/"+encodeURIComponent(b[0])+"/"+encodeURIComponent(b[1])};window.DocumentView=Backbone.View.extend({el:"#content",colid:0,docid:0,customView:!1,defaultMode:"tree",template:templateEngine.createTemplate("documentView.ejs"),events:{"click #saveDocumentButton":"saveDocument","click #deleteDocumentButton":"deleteDocumentModal","click #confirmDeleteDocument":"deleteDocument","click #document-from":"navigateToDocument","click #document-to":"navigateToDocument","keydown #documentEditor .ace_editor":"keyPress","keyup .jsoneditor .search input":"checkSearchBox","click .jsoneditor .modes":"storeMode","click #addDocument":"addDocument"},checkSearchBox:function(a){""===$(a.currentTarget).val()&&this.editor.expandAll()},addDocument:function(){window.App.documentsView.addDocumentModal()},storeMode:function(){var a=this;$(".type-modes").on("click",function(b){a.defaultMode=$(b.currentTarget).text().toLowerCase()})},keyPress:function(a){a.ctrlKey&&13===a.keyCode?(a.preventDefault(),this.saveDocument()):a.metaKey&&13===a.keyCode&&(a.preventDefault(),this.saveDocument())},editor:0,setType:function(a){a=2===a?"document":"edge";var b=function(a,b){if(a)arangoHelper.arangoError("Error","Could not fetch data.");else{var c=b+": ";this.type=b,this.fillInfo(c),this.fillEditor()}}.bind(this);"edge"===a?this.collection.getEdge(this.colid,this.docid,b):"document"===a&&this.collection.getDocument(this.colid,this.docid,b)},deleteDocumentModal:function(){var a=[],b=[];b.push(window.modalView.createReadOnlyEntry("doc-delete-button","Confirm delete, document id is",this.type._id,void 0,void 0,!1,/[<>&'"]/)),a.push(window.modalView.createDeleteButton("Delete",this.deleteDocument.bind(this))),window.modalView.show("modalTable.ejs","Delete Document",a,b)},deleteDocument:function(){var a=function(){if(this.customView)this.customDeleteFunction();else{var a="collection/"+encodeURIComponent(this.colid)+"/documents/1";window.modalView.hide(),window.App.navigate(a,{trigger:!0})}}.bind(this);if(this.type._from&&this.type._to){var b=function(b){b?arangoHelper.arangoError("Edge error","Could not delete edge"):a()};this.collection.deleteEdge(this.colid,this.docid,b)}else{var c=function(b){b?arangoHelper.arangoError("Error","Could not delete document"):a()};this.collection.deleteDocument(this.colid,this.docid,c)}},navigateToDocument:function(a){var b=$(a.target).attr("documentLink");b&&window.App.navigate(b,{trigger:!0})},fillInfo:function(){var b=this.collection.first(),c=b.get("_id"),d=b.get("_key"),e=b.get("_rev"),f=b.get("_from"),g=b.get("_to");if($("#document-type").css("margin-left","10px"),$("#document-type").text("_id:"),$("#document-id").css("margin-left","0"),$("#document-id").text(c),$("#document-key").text(d),$("#document-rev").text(e),f&&g){var h=a(f),i=a(g);$("#document-from").text(f),$("#document-from").attr("documentLink",h),$("#document-to").text(g),$("#document-to").attr("documentLink",i)}else $(".edge-info-container").hide()},fillEditor:function(){var a=this.removeReadonlyKeys(this.collection.first().attributes);$(".disabledBread").last().text(this.collection.first().get("_key")),this.editor.set(a),$(".ace_content").attr("font-size","11pt")},jsonContentChanged:function(){this.enableSaveButton()},resize:function(){$("#documentEditor").height($(".centralRow").height()-300)},render:function(){$(this.el).html(this.template.render({})),$("#documentEditor").height($(".centralRow").height()-300),this.disableSaveButton(),this.breadcrumb();var a=this,b=document.getElementById("documentEditor"),c={change:function(){a.jsonContentChanged()},search:!0,mode:"tree",modes:["tree","code"],iconlib:"fontawesome4"};return this.editor=new JSONEditor(b,c),this.editor.setMode(this.defaultMode),this},removeReadonlyKeys:function(a){return _.omit(a,["_key","_id","_from","_to","_rev"])},saveDocument:function(){if(void 0===$("#saveDocumentButton").attr("disabled"))if("_"===this.collection.first().attributes._id.substr(0,1)){var a=[],b=[];b.push(window.modalView.createReadOnlyEntry("doc-save-system-button","Caution","You are modifying a system collection. Really continue?",void 0,void 0,!1,/[<>&'"]/)),a.push(window.modalView.createSuccessButton("Save",this.confirmSaveDocument.bind(this))),window.modalView.show("modalTable.ejs","Modify System Collection",a,b)}else this.confirmSaveDocument()},confirmSaveDocument:function(){window.modalView.hide();var a;try{a=this.editor.get()}catch(b){return this.errorConfirmation(b),void this.disableSaveButton()}if(a=JSON.stringify(a),this.type._from&&this.type._to){var c=function(a){a?arangoHelper.arangoError("Error","Could not save edge."):(this.successConfirmation(),this.disableSaveButton())}.bind(this);this.collection.saveEdge(this.colid,this.docid,this.type._from,this.type._to,a,c)}else{var d=function(a){a?arangoHelper.arangoError("Error","Could not save document."):(this.successConfirmation(),this.disableSaveButton())}.bind(this);this.collection.saveDocument(this.colid,this.docid,a,d)}},successConfirmation:function(){arangoHelper.arangoNotification("Document saved.")},errorConfirmation:function(a){arangoHelper.arangoError("Document editor: ",a)},enableSaveButton:function(){$("#saveDocumentButton").prop("disabled",!1),$("#saveDocumentButton").addClass("button-success"),$("#saveDocumentButton").removeClass("button-close")},disableSaveButton:function(){$("#saveDocumentButton").prop("disabled",!0),$("#saveDocumentButton").addClass("button-close"),$("#saveDocumentButton").removeClass("button-success")},breadcrumb:function(){var a=window.location.hash.split("/"); -$("#subNavigationBar .breadcrumb").html('Collection: '+a[1]+'Document: '+a[2])},escaped:function(a){return a.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}})}(),function(){"use strict";window.FooterView=Backbone.View.extend({el:"#footerBar",system:{},isOffline:!0,isOfflineCounter:0,firstLogin:!0,timer:15e3,lap:0,timerFunction:null,events:{"click .footer-center p":"showShortcutModal"},initialize:function(){var a=this;window.setInterval(function(){a.getVersion()},a.timer),a.getVersion(),window.VISIBLE=!0,document.addEventListener("visibilitychange",function(){window.VISIBLE=!window.VISIBLE}),$("#offlinePlaceholder button").on("click",function(){a.getVersion()}),window.setTimeout(function(){window.frontendConfig.isCluster===!0&&($(".health-state").css("cursor","pointer"),$(".health-state").on("click",function(){window.App.navigate("#nodes",{trigger:!0})}))},1e3)},template:templateEngine.createTemplate("footerView.ejs"),showServerStatus:function(a){window.App.isCluster?this.renderClusterState(a):a===!0?($("#healthStatus").removeClass("negative"),$("#healthStatus").addClass("positive"),$(".health-state").html("GOOD"),$(".health-icon").html(''),$("#offlinePlaceholder").hide()):($("#healthStatus").removeClass("positive"),$("#healthStatus").addClass("negative"),$(".health-state").html("UNKNOWN"),$(".health-icon").html(''),$("#offlinePlaceholder").show(),this.reconnectAnimation(0))},reconnectAnimation:function(a){var b=this;0===a&&(b.lap=a,$("#offlineSeconds").text(b.timer/1e3),clearTimeout(b.timerFunction)),b.lap0?($("#healthStatus").removeClass("positive"),$("#healthStatus").addClass("negative"),1===c?$(".health-state").html(c+" NODE ERROR"):$(".health-state").html(c+" NODES ERROR"),$(".health-icon").html('')):($("#healthStatus").removeClass("negative"),$("#healthStatus").addClass("positive"),$(".health-state").html("NODES OK"),$(".health-icon").html(''))};$.ajax({type:"GET",cache:!1,url:arangoHelper.databaseUrl("/_admin/cluster/health"),contentType:"application/json",processData:!1,async:!0,success:function(a){b(a)}})}else $("#healthStatus").removeClass("positive"),$("#healthStatus").addClass("negative"),$(".health-state").html(window.location.host+" OFFLINE"),$(".health-icon").html(''),$("#offlinePlaceholder").show(),this.reconnectAnimation(0)},showShortcutModal:function(){window.arangoHelper.hotkeysFunctions.showHotkeysModal()},getVersion:function(){var a=this;$.ajax({type:"GET",cache:!1,url:arangoHelper.databaseUrl("/_api/version"),contentType:"application/json",processData:!1,async:!0,success:function(b){a.showServerStatus(!0),a.isOffline===!0&&(a.isOffline=!1,a.isOfflineCounter=0,a.firstLogin?a.firstLogin=!1:window.setTimeout(function(){a.showServerStatus(!0)},1e3),a.system.name=b.server,a.system.version=b.version,a.render())},error:function(b){401===b.status?(a.showServerStatus(!0),window.App.navigate("login",{trigger:!0})):(a.isOffline=!0,a.isOfflineCounter++,a.isOfflineCounter>=1&&a.showServerStatus(!1))}}),a.system.hasOwnProperty("database")||$.ajax({type:"GET",cache:!1,url:arangoHelper.databaseUrl("/_api/database/current"),contentType:"application/json",processData:!1,async:!0,success:function(b){var c=b.result.name;a.system.database=c;var d=window.setInterval(function(){var b=$("#databaseNavi");b&&(window.clearTimeout(d),d=null,a.render())},50)}})},renderVersion:function(){this.system.hasOwnProperty("database")&&this.system.hasOwnProperty("name")&&$(this.el).html(this.template.render({name:this.system.name,version:this.system.version,database:this.system.database}))},render:function(){return this.system.version||this.getVersion(),$(this.el).html(this.template.render({name:this.system.name,version:this.system.version})),this}})}(),function(){"use strict";window.FoxxActiveView=Backbone.View.extend({tagName:"div",className:"tile pure-u-1-1 pure-u-sm-1-2 pure-u-md-1-3 pure-u-lg-1-4 pure-u-xl-1-6",template:templateEngine.createTemplate("foxxActiveView.ejs"),_show:!0,events:{click:"openAppDetailView"},openAppDetailView:function(){window.App.navigate("service/"+encodeURIComponent(this.model.get("mount")),{trigger:!0})},toggle:function(a,b){switch(a){case"devel":this.model.isDevelopment()&&(this._show=b);break;case"production":this.model.isDevelopment()||this.model.isSystem()||(this._show=b);break;case"system":this.model.isSystem()&&(this._show=b)}this._show?$(this.el).show():$(this.el).hide()},render:function(){return this.model.fetchThumbnail(function(){$(this.el).html(this.template.render({model:this.model}));var a=function(){this.model.needsConfiguration()&&($(this.el).find(".warning-icons").length>0?$(this.el).find(".warning-icons").append(''):$(this.el).find("img").after(''))}.bind(this),b=function(){this.model.hasUnconfiguredDependencies()&&($(this.el).find(".warning-icons").length>0?$(this.el).find(".warning-icons").append(''):$(this.el).find("img").after(''))}.bind(this);this.model.getConfiguration(a),this.model.getDependencies(b)}.bind(this)),$(this.el)}})}(),function(){"use strict";var a={ERROR_SERVICE_DOWNLOAD_FAILED:{code:1752,message:"service download failed"}},b=templateEngine.createTemplate("applicationListView.ejs"),c=function(a){this.collection=a.collection},d=function(b){var c=this;if(b.error===!1)this.collection.fetch({success:function(){window.modalView.hide(),c.reload(),console.log(b),arangoHelper.arangoNotification("Services","Service "+b.name+" installed.")}});else{var d=b;switch(b.hasOwnProperty("responseJSON")&&(d=b.responseJSON),d.errorNum){case a.ERROR_SERVICE_DOWNLOAD_FAILED.code:arangoHelper.arangoError("Services","Unable to download application from the given repository.");break;default:arangoHelper.arangoError("Services",d.errorNum+". "+d.errorMessage)}}},e=function(){window.modalView.modalBindValidation({id:"new-app-mount",validateInput:function(){return[{rule:Joi.string().regex(/^(\/(APP[^\/]+|(?!APP)[a-zA-Z0-9_\-%]+))+$/i),msg:"May not contain /APP"},{rule:Joi.string().regex(/^(\/[a-zA-Z0-9_\-%]+)+$/),msg:"Can only contain [a-zA-Z0-9_-%]"},{rule:Joi.string().regex(/^\/([^_]|_open\/)/),msg:"Mountpoints with _ are reserved for internal use"},{rule:Joi.string().regex(/[^\/]$/),msg:"May not end with /"},{rule:Joi.string().regex(/^\//),msg:"Has to start with /"},{rule:Joi.string().required().min(2),msg:"Has to be non-empty"}]}})},f=function(){window.modalView.modalBindValidation({id:"repository",validateInput:function(){return[{rule:Joi.string().required().regex(/^[a-zA-Z0-9_\-]+\/[a-zA-Z0-9_\-]+$/),msg:"No valid Github account and repository."}]}})},g=function(){window.modalView.modalBindValidation({id:"new-app-author",validateInput:function(){return[{rule:Joi.string().required().min(1),msg:"Has to be non empty."}]}}),window.modalView.modalBindValidation({id:"new-app-name",validateInput:function(){return[{rule:Joi.string().required().regex(/^[a-zA-Z\-_][a-zA-Z0-9\-_]*$/),msg:"Can only contain a to z, A to Z, 0-9, '-' and '_'."}]}}),window.modalView.modalBindValidation({id:"new-app-description",validateInput:function(){return[{rule:Joi.string().required().min(1),msg:"Has to be non empty."}]}}),window.modalView.modalBindValidation({id:"new-app-license",validateInput:function(){return[{rule:Joi.string().required().regex(/^[a-zA-Z0-9 \.,;\-]+$/),msg:"Has to be non empty."}]}}),window.modalView.modalTestAll()},h=function(a){window.modalView.clearValidators();var b=$("#modalButton1");switch(this._upgrade||e(),a){case"newApp":b.html("Generate"),b.prop("disabled",!1),g();break;case"appstore":b.html("Install"),b.prop("disabled",!0);break;case"github":f(),b.html("Install"),b.prop("disabled",!1);break;case"zip":b.html("Install"),b.prop("disabled",!1)}b.prop("disabled")||window.modalView.modalTestAll()||b.prop("disabled",!0)},i=function(a){var b=$(a.currentTarget).attr("href").substr(1);h.call(this,b)},j=function(a){if(h.call(this,"appstore"),window.modalView.modalTestAll()){var b,c;this._upgrade?(b=this.mount,c=$("#new-app-teardown").prop("checked")):b=window.arangoHelper.escapeHtml($("#new-app-mount").val());var e=$(a.currentTarget).attr("appId"),f=$(a.currentTarget).attr("appVersion");void 0!==c?this.collection.installFromStore({name:e,version:f},b,d.bind(this),c):this.collection.installFromStore({name:e,version:f},b,d.bind(this)),window.modalView.hide(),arangoHelper.arangoNotification("Services","Installing "+e+".")}},k=function(a,b){if(void 0===b?b=this._uploadData:this._uploadData=b,b&&window.modalView.modalTestAll()){var c,e;this._upgrade?(c=this.mount,e=$("#new-app-teardown").prop("checked")):c=window.arangoHelper.escapeHtml($("#new-app-mount").val()),void 0!==e?this.collection.installFromZip(b.filename,c,d.bind(this),e):this.collection.installFromZip(b.filename,c,d.bind(this))}},l=function(){if(window.modalView.modalTestAll()){var a,b,c,e;this._upgrade?(c=this.mount,e=$("#new-app-teardown").prop("checked")):c=window.arangoHelper.escapeHtml($("#new-app-mount").val()),a=window.arangoHelper.escapeHtml($("#repository").val()),b=window.arangoHelper.escapeHtml($("#tag").val()),""===b&&(b="master");var f={url:window.arangoHelper.escapeHtml($("#repository").val()),version:window.arangoHelper.escapeHtml($("#tag").val())};try{Joi.assert(a,Joi.string().regex(/^[a-zA-Z0-9_\-]+\/[a-zA-Z0-9_\-]+$/))}catch(g){return}void 0!==e?this.collection.installFromGithub(f,c,d.bind(this),e):this.collection.installFromGithub(f,c,d.bind(this))}},m=function(){if(window.modalView.modalTestAll()){var a,b;this._upgrade?(a=this.mount,b=$("#new-app-teardown").prop("checked")):a=window.arangoHelper.escapeHtml($("#new-app-mount").val());var c={name:window.arangoHelper.escapeHtml($("#new-app-name").val()),documentCollections:_.map($("#new-app-document-collections").select2("data"),function(a){return window.arangoHelper.escapeHtml(a.text)}),edgeCollections:_.map($("#new-app-edge-collections").select2("data"),function(a){return window.arangoHelper.escapeHtml(a.text)}),author:window.arangoHelper.escapeHtml($("#new-app-author").val()),license:window.arangoHelper.escapeHtml($("#new-app-license").val()),description:window.arangoHelper.escapeHtml($("#new-app-description").val())};void 0!==b?this.collection.generate(c,a,d.bind(this),b):this.collection.generate(c,a,d.bind(this))}},n=function(){var a=$(".modal-body .tab-pane.active").attr("id");switch(a){case"newApp":m.apply(this);break;case"github":l.apply(this);break;case"zip":k.apply(this)}},o=function(a,c){var d=[],e={"click #infoTab a":i.bind(a),"click .install-app":j.bind(a)};d.push(window.modalView.createSuccessButton("Generate",n.bind(a))),window.modalView.show("modalApplicationMount.ejs","Install Service",d,c,void 0,void 0,e),$("#new-app-document-collections").select2({tags:[],showSearchBox:!1,minimumResultsForSearch:-1,width:"336px"}),$("#new-app-edge-collections").select2({tags:[],showSearchBox:!1,minimumResultsForSearch:-1,width:"336px"});var f=function(){var a=$("#modalButton1");a.prop("disabled")||window.modalView.modalTestAll()?a.prop("disabled",!1):a.prop("disabled",!0)};$(".select2-search-field input").focusout(function(){f(),window.setTimeout(function(){$(".select2-drop").is(":visible")&&($("#select2-search-field input").is(":focus")||($("#s2id_new-app-document-collections").select2("close"),$("#s2id_new-app-edge-collections").select2("close"),f()))},200)}),$(".select2-search-field input").focusin(function(){if($(".select2-drop").is(":visible")){var a=$("#modalButton1");a.prop("disabled",!0)}}),$("#upload-foxx-zip").uploadFile({url:arangoHelper.databaseUrl("/_api/upload?multipart=true"),allowedTypes:"zip",multiple:!1,onSuccess:k.bind(a)}),$.get("foxxes/fishbowl",function(a){var c=$("#appstore-content");c.html(""),_.each(_.sortBy(a,"name"),function(a){c.append(b.render(a))})}).fail(function(){var a=$("#appstore-content");a.append("Store is not available. ArangoDB is not able to connect to github.com")})};c.prototype.install=function(a){this.reload=a,this._upgrade=!1,this._uploadData=void 0,delete this.mount,o(this,!1),window.modalView.clearValidators(),e(),g()},c.prototype.upgrade=function(a,b){this.reload=b,this._upgrade=!0,this._uploadData=void 0,this.mount=a,o(this,!0),window.modalView.clearValidators(),g()},window.FoxxInstallView=c}(),function(){"use strict";window.GraphManagementView=Backbone.View.extend({el:"#content",template:templateEngine.createTemplate("graphManagementView.ejs"),edgeDefintionTemplate:templateEngine.createTemplate("edgeDefinitionTable.ejs"),eCollList:[],removedECollList:[],dropdownVisible:!1,initialize:function(a){this.options=a},events:{"click #deleteGraph":"deleteGraph","click .icon_arangodb_settings2.editGraph":"editGraph","click #createGraph":"addNewGraph","keyup #graphManagementSearchInput":"search","click #graphManagementSearchSubmit":"search","click .tile-graph":"redirectToGraphViewer","click #gv2":"redirectToGraphViewer2","click #graphManagementToggle":"toggleGraphDropdown","click .css-label":"checkBoxes","change #graphSortDesc":"sorting"},toggleTab:function(a){var b=a.currentTarget.id;b=b.replace("tab-",""),$("#tab-content-create-graph .tab-pane").removeClass("active"),$("#tab-content-create-graph #"+b).addClass("active"),"exampleGraphs"===b?$("#modal-dialog .modal-footer .button-success").css("display","none"):$("#modal-dialog .modal-footer .button-success").css("display","initial")},redirectToGraphViewer:function(a){var b=$(a.currentTarget).attr("id");b=b.substr(0,b.length-5),window.location=window.location+"/"+encodeURIComponent(b)},redirectToGraphViewer2:function(a){a.preventDefault();var b=$(a.currentTarget).parent().parent().attr("id");b=b.substr(0,b.length-5),console.log(b),window.App.navigate("graph2/"+encodeURIComponent(b),{trigger:!0})},loadGraphViewer:function(a,b){var c=function(b){if(b)arangoHelper.arangoError("","");else{var c=this.collection.get(a).get("edgeDefinitions");if(!c||0===c.length)return;var d={type:"gharial",graphName:a,baseUrl:arangoHelper.databaseUrl("/")},e=$("#content").width()-75;$("#content").html("");var f=arangoHelper.calculateCenterDivHeight();this.ui=new GraphViewerUI($("#content")[0],d,e,$(".centralRow").height()-135,{nodeShaper:{label:"_key",color:{type:"attribute",key:"_key"}}},!0),$(".contentDiv").height(f)}}.bind(this);b?this.collection.fetch({cache:!1,success:function(){c()}}):c()},handleResize:function(a){this.width&&this.width===a||(this.width=a,this.ui&&this.ui.changeWidth(a))},addNewGraph:function(a){a.preventDefault(),this.createEditGraphModal()},deleteGraph:function(){var a=this,b=$("#editGraphName")[0].value;if($("#dropGraphCollections").is(":checked")){var c=function(c){c?(a.collection.remove(a.collection.get(b)),a.updateGraphManagementView(),window.modalView.hide()):(window.modalView.hide(),arangoHelper.arangoError("Graph","Could not delete Graph."))};this.collection.dropAndDeleteGraph(b,c)}else this.collection.get(b).destroy({success:function(){a.updateGraphManagementView(),window.modalView.hide()},error:function(a,b){var c=JSON.parse(b.responseText),d=c.errorMessage;arangoHelper.arangoError(d),window.modalView.hide()}})},checkBoxes:function(a){var b=a.currentTarget.id;$("#"+b).click()},toggleGraphDropdown:function(){$("#graphSortDesc").attr("checked",this.collection.sortOptions.desc),$("#graphManagementToggle").toggleClass("activated"),$("#graphManagementDropdown2").slideToggle(200)},sorting:function(){$("#graphSortDesc").is(":checked")?this.collection.setSortingDesc(!0):this.collection.setSortingDesc(!1),$("#graphManagementDropdown").is(":visible")?this.dropdownVisible=!0:this.dropdownVisible=!1,this.render()},createExampleGraphs:function(a){var b=$(a.currentTarget).attr("graph-id"),c=this;$.ajax({type:"POST",url:arangoHelper.databaseUrl("/_admin/aardvark/graph-examples/create/"+encodeURIComponent(b)),success:function(){window.modalView.hide(),c.updateGraphManagementView(),arangoHelper.arangoNotification("Example Graphs","Graph: "+b+" created.")},error:function(a){if(window.modalView.hide(),a.responseText)try{var c=JSON.parse(a.responseText);arangoHelper.arangoError("Example Graphs",c.errorMessage)}catch(d){arangoHelper.arangoError("Example Graphs","Could not create example graph: "+b)}else arangoHelper.arangoError("Example Graphs","Could not create example graph: "+b)}})},render:function(a,b){var c=this;return this.collection.fetch({cache:!1,success:function(){c.collection.sort(),$(c.el).html(c.template.render({graphs:c.collection,searchString:""})),c.dropdownVisible===!0&&($("#graphManagementDropdown2").show(),$("#graphSortDesc").attr("checked",c.collection.sortOptions.desc),$("#graphManagementToggle").toggleClass("activated"),$("#graphManagementDropdown").show()),c.events["click .tableRow"]=c.showHideDefinition.bind(c),c.events['change tr[id*="newEdgeDefinitions"]']=c.setFromAndTo.bind(c),c.events["click .graphViewer-icon-button"]=c.addRemoveDefinition.bind(c),c.events["click #graphTab a"]=c.toggleTab.bind(c),c.events["click .createExampleGraphs"]=c.createExampleGraphs.bind(c),c.events["focusout .select2-search-field input"]=function(a){$(".select2-drop").is(":visible")&&($("#select2-search-field input").is(":focus")||window.setTimeout(function(){$(a.currentTarget).parent().parent().parent().select2("close")},200))},arangoHelper.setCheckboxStatus("#graphManagementDropdown")}}),a&&this.loadGraphViewer(a,b),this},setFromAndTo:function(a){a.stopPropagation();var b,c=this.calculateEdgeDefinitionMap();if(a.added){if(-1===this.eCollList.indexOf(a.added.id)&&-1!==this.removedECollList.indexOf(a.added.id))return b=a.currentTarget.id.split("row_newEdgeDefinitions")[1],$('input[id*="newEdgeDefinitions'+b+'"]').select2("val",null),void $('input[id*="newEdgeDefinitions'+b+'"]').attr("placeholder","The collection "+a.added.id+" is already used.");this.removedECollList.push(a.added.id),this.eCollList.splice(this.eCollList.indexOf(a.added.id),1)}else this.eCollList.push(a.removed.id),this.removedECollList.splice(this.removedECollList.indexOf(a.removed.id),1);c[a.val]?(b=a.currentTarget.id.split("row_newEdgeDefinitions")[1],$("#s2id_fromCollections"+b).select2("val",c[a.val].from),$("#fromCollections"+b).attr("disabled",!0),$("#s2id_toCollections"+b).select2("val",c[a.val].to),$("#toCollections"+b).attr("disabled",!0)):(b=a.currentTarget.id.split("row_newEdgeDefinitions")[1],$("#s2id_fromCollections"+b).select2("val",null),$("#fromCollections"+b).attr("disabled",!1),$("#s2id_toCollections"+b).select2("val",null),$("#toCollections"+b).attr("disabled",!1))},editGraph:function(a){a.stopPropagation(),this.collection.fetch({cache:!1}),this.graphToEdit=this.evaluateGraphName($(a.currentTarget).attr("id"),"_settings");var b=this.collection.findWhere({_key:this.graphToEdit});this.createEditGraphModal(b)},saveEditedGraph:function(){var a,b,c,d,e,f=$("#editGraphName")[0].value,g=_.pluck($("#newVertexCollections").select2("data"),"text"),h=[],i={};if(e=$("[id^=s2id_newEdgeDefinitions]").toArray(),e.forEach(function(e){if(d=$(e).attr("id"),d=d.replace("s2id_newEdgeDefinitions",""),a=_.pluck($("#s2id_newEdgeDefinitions"+d).select2("data"),"text")[0],a&&""!==a&&(b=_.pluck($("#s2id_fromCollections"+d).select2("data"),"text"),c=_.pluck($("#s2id_toCollections"+d).select2("data"),"text"),0!==b.length&&0!==c.length)){var f={collection:a,from:b,to:c};h.push(f),i[a]=f}}),0===h.length)return $("#s2id_newEdgeDefinitions0 .select2-choices").css("border-color","red"),$("#s2id_newEdgeDefinitions0").parent().parent().next().find(".select2-choices").css("border-color","red"),void $("#s2id_newEdgeDefinitions0").parent().parent().next().next().find(".select2-choices").css("border-color","red");var j=this.collection.findWhere({_key:f}),k=j.get("edgeDefinitions"),l=j.get("orphanCollections"),m=[];l.forEach(function(a){-1===g.indexOf(a)&&j.deleteVertexCollection(a)}),g.forEach(function(a){-1===l.indexOf(a)&&j.addVertexCollection(a)});var n=[],o=[],p=[];k.forEach(function(a){var b=a.collection;m.push(b);var c=i[b];void 0===c?p.push(b):JSON.stringify(c)!==JSON.stringify(a)&&o.push(b)}),h.forEach(function(a){var b=a.collection;-1===m.indexOf(b)&&n.push(b)}),n.forEach(function(a){j.addEdgeDefinition(i[a])}),o.forEach(function(a){j.modifyEdgeDefinition(i[a])}),p.forEach(function(a){j.deleteEdgeDefinition(a)}),this.updateGraphManagementView(),window.modalView.hide()},evaluateGraphName:function(a,b){var c=a.lastIndexOf(b);return a.substring(0,c)},search:function(){var a,b,c,d;a=$("#graphManagementSearchInput"),b=$("#graphManagementSearchInput").val(),d=this.collection.filter(function(a){return-1!==a.get("_key").indexOf(b)}),$(this.el).html(this.template.render({graphs:d,searchString:b})),a=$("#graphManagementSearchInput"),c=a.val().length,a.focus(),a[0].setSelectionRange(c,c)},updateGraphManagementView:function(){var a=this;this.collection.fetch({cache:!1,success:function(){a.render()}})},createNewGraph:function(){var a,b,c,d,e,f=$("#createNewGraphName").val(),g=_.pluck($("#newVertexCollections").select2("data"),"text"),h=[],i=this;return f?this.collection.findWhere({_key:f})?(arangoHelper.arangoError("The graph '"+f+"' already exists."),0):(e=$("[id^=s2id_newEdgeDefinitions]").toArray(),e.forEach(function(e){d=$(e).attr("id"),d=d.replace("s2id_newEdgeDefinitions",""),a=_.pluck($("#s2id_newEdgeDefinitions"+d).select2("data"),"text")[0],a&&""!==a&&(b=_.pluck($("#s2id_fromCollections"+d).select2("data"),"text"),c=_.pluck($("#s2id_toCollections"+d).select2("data"),"text"),1!==b&&1!==c&&h.push({collection:a,from:b,to:c}))}),0===h.length?($("#s2id_newEdgeDefinitions0 .select2-choices").css("border-color","red"),$("#s2id_newEdgeDefinitions0").parent().parent().next().find(".select2-choices").css("border-color","red"),void $("#s2id_newEdgeDefinitions0").parent().parent().next().next().find(".select2-choices").css("border-color","red")):void this.collection.create({name:f,edgeDefinitions:h,orphanCollections:g},{success:function(){i.updateGraphManagementView(),window.modalView.hide()},error:function(a,b){var c=JSON.parse(b.responseText),d=c.errorMessage;d=d.replace("<",""),d=d.replace(">",""),arangoHelper.arangoError(d)}})):(arangoHelper.arangoError("A name for the graph has to be provided."),0)},createEditGraphModal:function(a){var b,c=[],d=[],e=[],f=this.options.collectionCollection.models,g=this,h="",i=[{collection:"",from:"",to:""}],j="",k=function(a,b){return a=a.toLowerCase(),b=b.toLowerCase(),b>a?-1:a>b?1:0};if(this.eCollList=[],this.removedECollList=[],f.forEach(function(a){a.get("isSystem")||("edge"===a.get("type")?g.eCollList.push(a.id):d.push(a.id))}),window.modalView.enableHotKeys=!1,this.counter=0,a?(b="Edit Graph",h=a.get("_key"),i=a.get("edgeDefinitions"),i&&0!==i.length||(i=[{collection:"",from:"",to:""}]),j=a.get("orphanCollections"),e.push(window.modalView.createReadOnlyEntry("editGraphName","Name",h,"The name to identify the graph. Has to be unique")),c.push(window.modalView.createDeleteButton("Delete",this.deleteGraph.bind(this))),c.push(window.modalView.createSuccessButton("Save",this.saveEditedGraph.bind(this)))):(b="Create Graph",e.push(window.modalView.createTextEntry("createNewGraphName","Name","","The name to identify the graph. Has to be unique.","graphName",!0)),c.push(window.modalView.createSuccessButton("Create",this.createNewGraph.bind(this)))),i.forEach(function(a){0===g.counter?(a.collection&&(g.removedECollList.push(a.collection),g.eCollList.splice(g.eCollList.indexOf(a.collection),1)),e.push(window.modalView.createSelect2Entry("newEdgeDefinitions"+g.counter,"Edge definitions",a.collection,"An edge definition defines a relation of the graph","Edge definitions",!0,!1,!0,1,g.eCollList.sort(k)))):e.push(window.modalView.createSelect2Entry("newEdgeDefinitions"+g.counter,"Edge definitions",a.collection,"An edge definition defines a relation of the graph","Edge definitions",!1,!0,!1,1,g.eCollList.sort(k))),e.push(window.modalView.createSelect2Entry("fromCollections"+g.counter,"fromCollections",a.from,"The collections that contain the start vertices of the relation.","fromCollections",!0,!1,!1,10,d.sort(k))),e.push(window.modalView.createSelect2Entry("toCollections"+g.counter,"toCollections",a.to,"The collections that contain the end vertices of the relation.","toCollections",!0,!1,!1,10,d.sort(k))),g.counter++}),e.push(window.modalView.createSelect2Entry("newVertexCollections","Vertex collections",j,"Collections that are part of a graph but not used in an edge definition","Vertex Collections",!1,!1,!1,10,d.sort(k))),window.modalView.show("modalGraphTable.ejs",b,c,e,void 0,void 0,this.events),a){$(".modal-body table").css("border-collapse","separate");var l;for($(".modal-body .spacer").remove(),l=0;l<=this.counter;l++)$("#row_fromCollections"+l).show(),$("#row_toCollections"+l).show(),$("#row_newEdgeDefinitions"+l).addClass("first"),$("#row_fromCollections"+l).addClass("middle"),$("#row_toCollections"+l).addClass("last"),$("#row_toCollections"+l).after('');$("#graphTab").hide(),$("#modal-dialog .modal-delete-confirmation").append('
    ')}},showHideDefinition:function(a){},addRemoveDefinition:function(a){var b=[],c=this.options.collectionCollection.models;c.forEach(function(a){a.get("isSystem")||b.push(a.id)}),a.stopPropagation();var d,e=$(a.currentTarget).attr("id");if(-1===e.indexOf("addAfter_newEdgeDefinitions"))-1!==e.indexOf("remove_newEdgeDefinitions")&&(d=e.split("remove_newEdgeDefinitions")[1],$("#row_newEdgeDefinitions"+d).remove(),$("#row_fromCollections"+d).remove(),$("#row_toCollections"+d).remove(),$("#spacer"+d).remove());else{this.counter++,$("#row_newVertexCollections").before(this.edgeDefintionTemplate.render({number:this.counter})),$("#newEdgeDefinitions"+this.counter).select2({tags:this.eCollList,showSearchBox:!1,minimumResultsForSearch:-1,width:"336px",maximumSelectionSize:1}),$("#fromCollections"+this.counter).select2({tags:b,showSearchBox:!1,minimumResultsForSearch:-1,width:"336px",maximumSelectionSize:10}),$("#toCollections"+this.counter).select2({tags:b,showSearchBox:!1,minimumResultsForSearch:-1,width:"336px",maximumSelectionSize:10}),window.modalView.undelegateEvents(),window.modalView.delegateEvents(this.events);var f;for($(".modal-body .spacer").remove(),f=0;f<=this.counter;f++)$("#row_fromCollections"+f).show(),$("#row_toCollections"+f).show(),$("#row_newEdgeDefinitions"+f).addClass("first"),$("#row_fromCollections"+f).addClass("middle"),$("#row_toCollections"+f).addClass("last"),$("#row_toCollections"+f).after('')}},calculateEdgeDefinitionMap:function(){var a={};return this.collection.models.forEach(function(b){b.get("edgeDefinitions").forEach(function(b){a[b.collection]={from:b.from,to:b.to}})}),a}})}(),function(){"use strict";window.GraphSettingsView=Backbone.View.extend({el:"#graphSettingsContent",remove:function(){return this.$el.empty().off(),this.stopListening(),this},general:{graph:{type:"divider",name:"Graph"},nodeStart:{type:"string",name:"Starting node",desc:"A valid node id. If empty, a random node will be chosen.",value:2},layout:{type:"select",name:"Layout algorithm",desc:"Different graph displaying algorithms. No overlap is very fast, force is slower and fruchtermann is the slowest. The calculation time strongly depends on your nodes and edges counts.",noverlap:{name:"No overlap",val:"noverlap"},force:{name:"Force",val:"force"},fruchtermann:{name:"Fruchtermann",val:"fruchtermann"}},renderer:{type:"select",name:"Renderer",desc:"Canvas enables editing, WebGL is only for displaying a graph but much faster.",canvas:{name:"Canvas",val:"canvas"},webgl:{name:"WebGL",val:"webgl"}},depth:{desc:"Search depth, starting from your start node.",type:"number",name:"Search depth",value:2}},specific:{nodes:{type:"divider",name:"Nodes"},nodeLabel:{type:"string",name:"Label",desc:"Node label. Please choose a valid and available node attribute.","default":"_key"},nodeLabelThreshold:{type:"range",name:"Label threshold",desc:"The minimum size a node must have on screen to see its label displayed. This does not affect hovering behavior.","default":"_key"},nodeColor:{type:"color",name:"Color",desc:"Default node color. RGB or HEX value.","default":"#2ecc71"},nodeColorAttribute:{type:"string",name:"Colorize attr",desc:"If an attribute is given, nodes will then be colorized by the attribute. This setting ignores default node color if set."},nodeColorByCollection:{type:"select",name:"Colorize by coll?",no:{name:"No",val:"false"},yes:{name:"Yes",val:"true"},desc:"Should nodes be colorized by their collection? If enabled, node color and node color attribute will be ignored."},nodeSize:{type:"string",name:"Sizing attribute",desc:"Default node size. Numeric value > 0."},edges:{type:"divider",name:"Edges"},edgeLabel:{type:"string",name:"Label",desc:"Default edge label."},edgeLabelThreshold:{type:"range",name:"Label threshold",desc:"The minimum size an edge must have on screen to see its label displayed. This does not affect hovering behavior.","default":"_key"},edgeColor:{type:"color",name:"Color",desc:"Default edge color. RGB or HEX value.","default":"#cccccc"},edgeColorAttribute:{type:"string",name:"Colorize attr",desc:"If an attribute is given, edges will then be colorized by the attribute. This setting ignores default edge color if set."},edgeColorByCollection:{type:"select",name:"Colorize by coll?",no:{name:"No",val:"false"},yes:{name:"Yes",val:"true"},desc:"Should edges be colorized by their collection? If enabled, edge color and edge color attribute will be ignored."},edgeEditable:{type:"select",name:"Editable",no:{name:"No",val:"false"},yes:{name:"Yes",val:"true"},desc:"Should edges be editable?"},edgeType:{type:"select",name:"Type",desc:"The type of the edge",line:{name:"Line",val:"line"},curve:{name:"Curve",val:"curve"},dotted:{name:"Dotted",val:"dotted"},dashed:{name:"Dashed",val:"dashed"},tapered:{name:"Tapered",val:"tapered"}}},template:templateEngine.createTemplate("graphSettingsView.ejs"),initialize:function(a){this.name=a.name,this.userConfig=a.userConfig,this.saveCallback=a.saveCallback},events:{"click #saveGraphSettings":"saveGraphSettings","click #restoreGraphSettings":"setDefaults","keyup #graphSettingsView input":"checkEnterKey","keyup #graphSettingsView select":"checkEnterKey",'change input[type="range"]':"saveGraphSettings",'change input[type="color"]':"checkColor","change select":"saveGraphSettings","focus #graphSettingsView input":"lastFocus","focus #graphSettingsView select":"lastFocus"},lastFocus:function(a){this.lastFocussed=a.currentTarget.id},checkEnterKey:function(a){13===a.keyCode&&this.saveGraphSettings()},getGraphSettings:function(a){var b=this,c=window.App.currentDB.toJSON().name+"_"+this.name;this.userConfig.fetch({success:function(d){b.graphConfig=d.toJSON().graphs[c],a&&b.continueRender()}})},checkColor:function(){this.saveGraphSettings(null,!0)},saveGraphSettings:function(a,b,c,d){var e=this,f=window.App.currentDB.toJSON().name+"_"+this.name,g={};d?g[f]=d:g[f]={layout:$("#g_layout").val(),renderer:$("#g_renderer").val(), -depth:$("#g_depth").val(),nodeColor:$("#g_nodeColor").val(),nodeColorAttribute:$("#g_nodeColorAttribute").val(),nodeColorByCollection:$("#g_nodeColorByCollection").val(),nodeLabelThreshold:$("#g_nodeLabelThreshold").val(),edgeColor:$("#g_edgeColor").val(),edgeColorAttribute:$("#g_edgeColorAttribute").val(),edgeColorByCollection:$("#g_edgeColorByCollection").val(),edgeLabelThreshold:$("#g_edgeLabelThreshold").val(),nodeLabel:$("#g_nodeLabel").val(),edgeLabel:$("#g_edgeLabel").val(),edgeType:$("#g_edgeType").val(),nodeSize:$("#g_nodeSize").val(),edgeEditable:$("#g_edgeEditable").val(),nodeStart:$("#g_nodeStart").val()},c&&(g[f].nodeStart=c);var h=function(){window.App.graphViewer2?""!==b&&void 0!==b?window.App.graphViewer2.updateColors():window.App.graphViewer2.render(e.lastFocussed):arangoHelper.arangoNotification("Graph "+this.name,"Configuration saved.")}.bind(this);this.userConfig.setItem("graphs",g,h)},setDefaults:function(){var a={layout:"force",renderer:"canvas",depth:"2",nodeColor:"#2ecc71",nodeColorAttribute:"",nodeColorByCollection:"false",nodeLabelThreshold:10,edgeColor:"#cccccc",edgeColorAttribute:"",edgeColorByCollection:"false",edgeLabelThreshold:10,nodeLabel:"_key",edgeLabel:"",edgeType:"line",nodeSize:"",edgeEditable:"false",nodeStart:""};this.saveGraphSettings(null,null,null,a),this.render(),window.App.graphViewer2.render(this.lastFocussed)},toggle:function(){$(this.el).is(":visible")?this.hide():this.show()},show:function(){$(this.el).show("slide",{direction:"right"},250)},hide:function(){$(this.el).hide("slide",{direction:"right"},250)},render:function(){this.getGraphSettings(!0)},continueRender:function(){$(this.el).html(this.template.render({general:this.general,specific:this.specific})),arangoHelper.fixTooltips(".gv-tooltips","top"),this.graphConfig?_.each(this.graphConfig,function(a,b){$("#g_"+b).val(a)}):this.setDefaults()}})}(),function(){"use strict";window.GraphViewer2=Backbone.View.extend({el:"#content",remove:function(){return this.$el.empty().off(),this.stopListening(),this},template:templateEngine.createTemplate("graphViewer2.ejs"),initialize:function(a){var b=this;a.id&&(this.setElement(a.id),this.graphData=a.data,this.aqlMode=!0),this.name=a.name,this.userConfig=a.userConfig,this.documentStore=a.documentStore,this.initSigma(),void 0!==this.name&&this.collection.fetch({cache:!1,success:function(c){b.model=b.collection.findWhere({_key:a.name}).toJSON()}})},colors:{hotaru:["#364C4A","#497C7F","#92C5C0","#858168","#CCBCA5"],random1:["#292F36","#4ECDC4","#F7FFF7","#DD6363","#FFE66D"]},aqlMode:!1,events:{"click #downloadPNG":"downloadSVG","click #reloadGraph":"reloadGraph","click #settingsMenu":"toggleSettings","click #noGraphToggle":"toggleSettings","click #toggleForce":"toggleLayout","click #selectNodes":"toggleLasso"},cursorX:0,cursorY:0,layouting:!1,model:null,viewStates:{captureMode:!1},graphConfig:null,graphSettings:null,initSigma:function(){try{sigma.classes.graph.addMethod("neighbors",function(a){var b,c={},d=this.allNeighborsIndex[a]||{};for(b in d)c[b]=this.nodesIndex[b];return c}),sigma.classes.graph.addMethod("getNodeEdges",function(a){var b=this.edges(),c=[];return _.each(b,function(b){b.source!==a&&b.target!==a||c.push(b.id)}),c})}catch(a){}},downloadSVG:function(){var a=this;this.currentGraph.toSVG({download:!0,filename:a.name+".svg",size:1e3})},resize:function(){$("#graph-container").width($(".centralContent").width()),$("#graph-container").height($(".centralRow").height()-150)},toggleSettings:function(){this.graphSettingsView.toggle()},render:function(a){this.$el.html(this.template.render({})),$("#subNavigationBar .breadcrumb").html("Graph: "+this.name),this.resize(),this.fetchGraph(a)},renderAQL:function(a){this.$el.html(this.template.render({})),this.$el.find(".headerBar").remove();var b=$(".centralRow").height()-250;this.$el.find("#graph-container").css("height",b),this.graphData.modified=this.parseData(this.graphData.original,this.graphData.graphInfo),this.renderGraph(this.graphData.modified)},parseData:function(a,b){var c={},d={},e={nodes:[],edges:[],settings:{}};return"object"===b?(_.each(a,function(a){a.edges&&a.vertices&&(_.each(a.edges,function(a){d[a._id]={id:a._id,source:a._from,label:a._key,color:"#cccccc",target:a._to}}),_.each(a.vertices,function(a){c[a._id]={id:a._id,label:a._key,size:.3,color:"#2ecc71",x:Math.random(),y:Math.random()}}))}),_.each(c,function(a){e.nodes.push(a)}),_.each(d,function(a){e.edges.push(a)})):"array"===b&&(_.each(a,function(a){c[a._from]=null,c[a._to]=null,e.edges.push({id:a._id,source:a._from,label:a._key,color:"#cccccc",target:a._to})}),_.each(c,function(a,b){e.nodes.push({id:b,label:b,size:.3,color:"#2ecc71",x:Math.random(),y:Math.random()})})),e},rerender:function(){this.fetchGraph()},fetchGraph:function(a){var b=this;$(this.el).append('
    Fetching graph data. Please wait ...


    If it`s taking too much time to draw the graph, please go to:
    '+window.location.href+"/settings
    and adjust your settings.It is possible that the graph is too big to be handled by the browser.
    ");var c=function(){var c={};this.graphConfig&&(c=_.clone(this.graphConfig),delete c.layout,delete c.edgeType,delete c.renderer),this.setupSigma(),$.ajax({type:"GET",url:arangoHelper.databaseUrl("/_admin/aardvark/graph/"+encodeURIComponent(this.name)),contentType:"application/json",data:c,success:function(c){$("#calcText").html("Calculating layout. Please wait ... "),b.renderGraph(c,a)},error:function(a){try{arangoHelper.arangoError("Graph",a.responseJSON.exception);var c=a.responseJSON.exception.search("1205");if(-1!==c){var d='Starting point: '+b.graphConfig.nodeStart+" is invalid";$("#calculatingGraph").html('
    Stopped.

    '+d+'. Please choose a different start node.
    ')}else $("#calculatingGraph").html("Failed to fetch graph information.")}catch(e){}}})}.bind(this);this.getGraphSettings(c)},setupSigma:function(){if(this.graphConfig&&this.graphConfig.edgeLabel){sigma.utils.pkg("sigma.settings");var a={defaultEdgeLabelColor:"#000",defaultEdgeLabelActiveColor:"#000",defaultEdgeLabelSize:10,edgeLabelSize:"fixed",edgeLabelSizePowRatio:1,edgeLabelThreshold:1};sigma.settings=sigma.utils.extend(sigma.settings||{},a),sigma.settings.drawEdgeLabels=!0}},contextState:{createEdge:!1,_from:!1,_to:!1,fromX:!1,fromY:!1},clearOldContextMenu:function(a){var b=this;$("#nodeContextMenu").remove();var c='
    ';$("#graph-container").append(c),a&&_.each(this.contextState,function(a,c){b.contextState[c]=!1});var d=document.getElementsByClassName("sigma-mouse")[0];d.removeEventListener("mousemove",b.drawLine.bind(this),!1)},trackCursorPosition:function(a){this.cursorX=a.x,this.cursorY=a.y},deleteNode:function(){var a=this,b=$("#delete-node-attr-id").text(),c=b.split("/")[0],d=b.split("/")[1];if("yes"===$("#delete-node-edges-attr").val())$.ajax({cache:!1,type:"DELETE",contentType:"application/json",url:arangoHelper.databaseUrl("/_api/gharial/"+encodeURIComponent(a.name)+"/vertex/"+encodeURIComponent(b.split("/")[0])+"/"+encodeURIComponent(b.split("/")[1])),success:function(c){a.currentGraph.graph.dropNode(b),a.currentGraph.refresh()},error:function(){arangoHelper.arangoError("Graph","Could not delete node.")}});else{var e=function(c){c?arangoHelper.arangoError("Graph","Could not delete node."):(a.currentGraph.graph.dropNode(b),a.currentGraph.refresh())};this.documentStore.deleteDocument(c,d,e)}window.modalView.hide()},deleteNodeModal:function(a){var b=[],c=[];c.push(window.modalView.createReadOnlyEntry("delete-node-attr-id","Really delete node",a)),c.push(window.modalView.createSelectEntry("delete-node-edges-attr","Also delete edges?",void 0,void 0,[{value:"yes",label:"Yes"},{value:"no",label:"No"}])),b.push(window.modalView.createDeleteButton("Delete",this.deleteNode.bind(this))),window.modalView.show("modalTable.ejs","Delete node",b,c)},addNode:function(){var a=this,b=$(".modal-body #new-node-collection-attr").val(),c=$(".modal-body #new-node-key-attr").last().val(),d=function(b,c,d){b?arangoHelper.arangoError("Could not create node",d.errorMessage):(a.currentGraph.graph.addNode({id:c,label:c.split("/")[1]||"",size:a.graphConfig.nodeSize||Math.random(),color:a.graphConfig.nodeColor||"#2ecc71",x:a.cursorX,y:a.cursorY}),window.modalView.hide(),a.currentGraph.refresh())};""!==c||void 0!==c?this.documentStore.createTypeDocument(b,c,d):this.documentStore.createTypeDocument(b,null,d)},deleteEdgeModal:function(a){var b=[],c=[];c.push(window.modalView.createReadOnlyEntry("delete-edge-attr-id","Really delete edge",a)),b.push(window.modalView.createDeleteButton("Delete",this.deleteEdge.bind(this))),window.modalView.show("modalTable.ejs","Delete edge",b,c)},deleteEdge:function(){var a=this,b=$("#delete-edge-attr-id").text(),c=b.split("/")[0],d=b.split("/")[1],e=function(c){c?arangoHelper.arangoError("Graph","Could not delete edge."):(a.currentGraph.graph.dropEdge(b),a.currentGraph.refresh())};this.documentStore.deleteDocument(c,d,e),window.modalView.hide()},addNodeModal:function(){if(0!==this.graphSettings.vertexCollections){var a=[],b=[],c=[];_.each(this.graphSettings.vertexCollections,function(a){c.push({label:a.name,value:a.id})}),b.push(window.modalView.createTextEntry("new-node-key-attr","_key",void 0,"The nodes unique key(optional attribute, leave empty for autogenerated key","is optional: leave empty for autogenerated key",!1,[{rule:Joi.string().allow("").optional(),msg:""}])),b.push(window.modalView.createSelectEntry("new-node-collection-attr","Collection",void 0,"Please select the destination for the new node.",c)),a.push(window.modalView.createSuccessButton("Create",this.addNode.bind(this))),window.modalView.show("modalTable.ejs","Create node",a,b)}else arangoHelper.arangoError("Graph","No valid vertex collections found.")},addEdge:function(){var a,b=this,c=b.contextState._from,d=b.contextState._to;a=""===$(".modal-body #new-edge-collection-attr").val()?$(".modal-body #new-edge-collection-attr").text():$(".modal-body #new-edge-collection-attr").val();var e=$(".modal-body #new-edge-key-attr").last().val(),f=function(a,e){a?arangoHelper.arangoError("Graph","Could not create edge."):(b.graphConfig.edgeEditable?b.currentGraph.graph.addEdge({source:c,size:1,target:d,id:e._id,color:b.graphConfig.edgeColor}):b.currentGraph.graph.addEdge({source:c,target:d,id:e._id,color:b.graphConfig.edgeColor}),b.currentGraph.refresh()),b.clearOldContextMenu(!0),window.modalView.hide()};""!==e||void 0!==e?this.documentStore.createTypeEdge(a,c,d,e,f):this.documentStore.createTypeEdge(a,c,d,null,f)},addEdgeModal:function(a){if(0!==a){var b=[],c=[];if(c.push(window.modalView.createTextEntry("new-edge-key-attr","_key",void 0,"The edges unique key(optional attribute, leave empty for autogenerated key","is optional: leave empty for autogenerated key",!1,[{rule:Joi.string().allow("").optional(),msg:""}])),a.length>1){var d=[];_.each(a,function(a){d.push({label:a,value:a})}),c.push(window.modalView.createSelectEntry("new-edge-collection-attr","Edge collection",void 0,"Please select the destination for the new edge.",d))}else c.push(window.modalView.createReadOnlyEntry("new-edge-collection-attr","Edge collection",a[0],"The edges collection to be used."));b.push(window.modalView.createSuccessButton("Create",this.addEdge.bind(this))),window.modalView.show("modalTable.ejs","Create edge",b,c)}else arangoHelper.arangoError("Graph","No valid edge definitions found.")},updateColors:function(){var a=window.App.currentDB.toJSON().name+"_"+this.name,b=this;this.userConfig.fetch({success:function(c){b.graphConfig=c.toJSON().graphs[a],b.currentGraph.graph.nodes().forEach(function(a){a.color=b.graphConfig.nodeColor}),b.currentGraph.graph.edges().forEach(function(a){a.color=b.graphConfig.edgeColor}),b.currentGraph.refresh()}})},createContextMenu:function(a){var b=this,c=b.cursorX-50,d=b.cursorY-50;this.clearOldContextMenu();var e=function(a){var c=wheelnav,d=new c("nodeContextMenu");d.maxPercent=1,d.wheelRadius=50,d.clockwise=!1,d.colors=b.colors.hotaru,d.multiSelect=!0,d.clickModeRotate=!1,d.slicePathFunction=slicePath().DonutSlice,b.viewStates.captureMode?d.createWheel([icon.plus,icon.trash]):d.createWheel([icon.plus,""]),d.navItems[0].selected=!1,d.navItems[0].hovered=!1,d.navItems[0].navigateFunction=function(a){b.clearOldContextMenu(),b.addNodeModal()},b.viewStates.captureMode&&(d.navItems[1].navigateFunction=function(a){b.clearOldContextMenu()}),d.navItems[0].selected=!1,d.navItems[0].hovered=!1};$("#nodeContextMenu").css("position","fixed"),$("#nodeContextMenu").css("left",c),$("#nodeContextMenu").css("top",d),$("#nodeContextMenu").width(100),$("#nodeContextMenu").height(100),e(a)},createEdgeContextMenu:function(a,b){var c=this,d=this.cursorX-165,e=this.cursorY-120;this.clearOldContextMenu();var f=function(a,b){var d=["#364C4A","#497C7F","#92C5C0","#858168","#CCBCA5"],e=wheelnav,f=new e("nodeContextMenu");f.maxPercent=1,f.wheelRadius=50,f.clockwise=!1,f.colors=d,f.multiSelect=!0,f.clickModeRotate=!1,f.slicePathFunction=slicePath().DonutSlice,f.createWheel([icon.edit,icon.trash]),f.navItems[0].selected=!1,f.navItems[0].hovered=!1,f.navItems[0].navigateFunction=function(a){c.clearOldContextMenu(),c.editEdge(b)},f.navItems[1].navigateFunction=function(a){c.clearOldContextMenu(),c.deleteEdgeModal(b)},f.navItems[0].selected=!1,f.navItems[0].hovered=!1};$("#nodeContextMenu").css("left",d+115),$("#nodeContextMenu").css("top",e+72),$("#nodeContextMenu").width(100),$("#nodeContextMenu").height(100),f(b,a)},createNodeContextMenu:function(a,b){var c,d,e=this;_.each(b.data.node,function(a,b){"renderer"===b.substr(0,8)&&"x"===b.charAt(b.length-1)&&(c=a),"renderer"===b.substr(0,8)&&"y"===b.charAt(b.length-1)&&(d=a)}),this.clearOldContextMenu();var f=function(a,b){var f=["#364C4A","#497C7F","#92C5C0","#858168","#CCBCA5"],g=wheelnav,h=new g("nodeContextMenu");h.maxPercent=1,h.wheelRadius=50,h.clockwise=!1,h.colors=f,h.multiSelect=!0,h.clickModeRotate=!1,h.slicePathFunction=slicePath().DonutSlice,h.createWheel([icon.edit,icon.trash,icon.play,icon.connect]),h.navItems[0].selected=!1,h.navItems[0].hovered=!1,h.navItems[0].navigateFunction=function(a){e.clearOldContextMenu(),e.editNode(b)},h.navItems[1].navigateFunction=function(a){e.clearOldContextMenu(),e.deleteNodeModal(b)},h.navItems[2].navigateFunction=function(a){e.clearOldContextMenu(),e.setStartNode(b)},h.navItems[3].navigateFunction=function(a){e.contextState.createEdge=!0,e.contextState._from=b,e.contextState.fromX=c,e.contextState.fromY=d;var f=document.getElementsByClassName("sigma-mouse")[0];f.addEventListener("mousemove",e.drawLine.bind(this),!1),e.clearOldContextMenu()},h.navItems[0].selected=!1,h.navItems[0].hovered=!1};$("#nodeContextMenu").css("left",c+115),$("#nodeContextMenu").css("top",d+72),$("#nodeContextMenu").width(100),$("#nodeContextMenu").height(100),f(b,a)},clearMouseCanvas:function(){var a=document.getElementsByClassName("sigma-mouse")[0],b=a.getContext("2d");b.clearRect(0,0,$(a).width(),$(a).height())},drawLine:function(a){var b=window.App.graphViewer2.contextState;if(b.createEdge){var c=b.fromX,d=b.fromY,e=a.offsetX,f=a.offsetY,g=document.getElementsByClassName("sigma-mouse")[0],h=g.getContext("2d");h.clearRect(0,0,$(g).width(),$(g).height()),h.beginPath(),h.moveTo(c,d),h.lineTo(e,f),h.stroke()}},getGraphSettings:function(a){var b=this,c=frontendConfig.db+"_"+this.name;this.userConfig.fetch({success:function(d){b.graphConfig=d.toJSON().graphs[c],b.graphSettingsView&&b.graphSettingsView.remove(),b.graphSettingsView=new window.GraphSettingsView({name:b.name,userConfig:b.userConfig,saveCallback:b.render}),b.graphSettingsView.render(),a&&a(b.graphConfig)}})},setStartNode:function(a){this.graphConfig.nodeStart=a,this.graphSettingsView.saveGraphSettings(null,a)},editNode:function(a){var b=function(){};arangoHelper.openDocEditor(a,"doc",b)},editEdge:function(a){var b=function(){};arangoHelper.openDocEditor(a,"edge",b)},reloadGraph:function(){Backbone.history.loadUrl(Backbone.history.fragment)},getEdgeDefinitionCollections:function(a,b){var c=[];return _.each(this.model.edgeDefinitions,function(d){_.each(d.from,function(e){e===a&&_.each(d.to,function(a){a===b&&c.push(d.collection)})})}),c},initializeGraph:function(a,b){var c=this;a.refresh(),this.Sigma.plugins.Lasso=sigma.plugins.lasso;var d=new this.Sigma.plugins.Lasso(a,a.renderers[0],{strokeStyle:"black",lineWidth:1,fillWhileDrawing:!0,fillStyle:"rgba(41, 41, 41, 0.2)",cursor:"crosshair"});return d.bind("selectedNodes",function(b){var d=b.data;console.log("nodes",d),a.graph.nodes().forEach(function(a){a.color=c.graphConfig.nodeColor?c.graphConfig.nodeColor:"rgb(46, 204, 113)"}),d.forEach(function(a){a.color="red"}),a.refresh()}),d},renderGraph:function(a,b){var c=this;if(this.graphSettings=a.settings,0===a.edges.length){var d='No edges found for starting point: '+c.graphSettings.startVertex._id+"";return void $("#calculatingGraph").html('
    Stopped.

    '+d+'. Please choose a different start node or try to reload the graph.
    ')}var e="position: absolute; left: 25px; bottom: 45px;";this.aqlMode&&(e="position: absolute; left: 30px; margin-top: -37px;"),$(this.el).append('
    '+a.nodes.length+' nodes'+a.edges.length+" edges
    "),this.Sigma=sigma;var f="force",g="canvas";this.graphConfig&&(this.graphConfig.layout&&(f=this.graphConfig.layout),this.graphConfig.renderer&&(g=this.graphConfig.renderer,"canvas"===g&&(c.isEditable=!0)));var h={doubleClickEnabled:!1,minNodeSize:3.5,minEdgeSize:1,maxEdgeSize:4,enableEdgeHovering:!0,edgeHoverColor:"#000",defaultEdgeHoverColor:"#000",defaultEdgeType:"line",edgeHoverSizeRatio:2,edgeHoverExtremities:!0,autoRescale:!0,mouseEnabled:!0,touchEnabled:!0,nodesPowRatio:1,edgesPowRatio:1};"canvas"===g&&(h.autoCurveSortByDirection=!0),a.nodes.length>500&&(h.labelThreshold=15,h.hideEdgesOnMove=!0),this.graphConfig&&(this.graphConfig.edgeType&&(h.defaultEdgeType=this.graphConfig.edgeType),this.graphConfig.nodeLabelThreshold&&(h.labelThreshold=this.graphConfig.nodeLabelThreshold),this.graphConfig.edgeLabelThreshold&&(h.edgeLabelThreshold=this.graphConfig.edgeLabelThreshold)),"webgl"===g&&(h.enableEdgeHovering=!1);var i=new this.Sigma({graph:a,container:"graph-container",renderer:{container:document.getElementById("graph-container"),type:g},settings:h});if(this.currentGraph=i,this.aqlMode||sigma.plugins.fullScreen({container:"graph-container",btnId:"graph-fullscreen-btn"}),"noverlap"===f){var j=i.configNoverlap({nodeMargin:.1,scaleNodes:1.05,gridSize:75,easing:"quadraticInOut",duration:1e4});j.bind("start stop interpolate",function(a){"start"===a.type,"interpolate"===a.type})}else if("fruchtermann"===f){var k=sigma.layouts.fruchtermanReingold.configure(i,{iterations:500,easing:"quadraticInOut",duration:800});k.bind("start stop interpolate",function(a){})}if(i.graph.nodes().forEach(function(a){a.originalColor=a.color}),i.graph.edges().forEach(function(a){a.originalColor=a.color}),"canvas"===g&&(sigma.canvas.edges.autoCurve(i),i.refresh(),c.aqlMode||i.bind("rightClickStage",function(a){c.createContextMenu(a),c.clearMouseCanvas()}),i.bind("overNode",function(a){if($(".nodeInfoDiv").remove(),c.contextState.createEdge===!1){var b=function(a,b){if(!a){var d={},e=0,f=!1;_.each(b,function(a,b){15>e?"string"==typeof a&&(a.length>10?d[b]=a.substr(0,15)+" ...":d[b]=a):f=!0,e++});var g='
    '+JSON.stringify(d,null,2);f?(g=g.substr(0,g.length-2),g+=" \n\n  ... \n\n } 
    "):g+="",$(c.el).append(g)}};c.documentStore.getDocument(a.data.node.id.split("/")[0],a.data.node.id.split("/")[1],b)}}),i.bind("outNode",function(a){c.contextState.createEdge===!1&&$(".nodeInfoDiv").remove()}),i.bind("clickNode",function(a){if(c.contextState.createEdge===!0){c.contextState._to=a.data.node.id;var b=c.contextState._from.split("/")[0],d=c.contextState._to.split("/")[0],e=c.getEdgeDefinitionCollections(b,d);c.addEdgeModal(e,c.contextState._from,c.contextState._to)}}),this.aqlMode||i.bind("rightClickNode",function(a){var b=a.data.node.id;c.createNodeContextMenu(b,a)}),this.graphConfig.edgeEditable&&i.bind("rightClickEdge",function(a){var b=a.data.edge.id;c.createEdgeContextMenu(b,a)}),i.bind("doubleClickNode",function(a){var b=a.data.node.id,c=i.graph.neighbors(b);c[b]=a.data.node,i.graph.nodes().forEach(function(a){c[a.id]?a.color=a.originalColor:a.color="#eee"}),i.graph.edges().forEach(function(a){c[a.source]&&c[a.target]?a.color="rgb(64, 74, 83)":a.color="#eee"}),i.refresh()}),i.bind("doubleClickStage",function(){i.graph.nodes().forEach(function(a){a.color=a.originalColor}),i.graph.edges().forEach(function(a){a.color=a.originalColor}),i.refresh()}),i.bind("clickStage",function(){c.clearOldContextMenu(!0),c.clearMouseCanvas()})),"noverlap"===f)i.startNoverlap(),sigma.plugins.dragNodes(i,i.renderers[0]);else if("force"===f){var l="color: rgb(64, 74, 83); cursor: pointer; position: absolute; right: 30px; bottom: 40px;";c.aqlMode&&(l="color: rgb(64, 74, 83); cursor: pointer; position: absolute; right: 30px; margin-top: -30px;"),$(this.el).append('
    '),c.startLayout();var m=3e3;a.nodes.length>2500?m=5e3:a.nodes.length<50&&(m=500),window.setTimeout(function(){c.stopLayout()},m)}else"fruchtermann"===f?(sigma.layouts.fruchtermanReingold.start(i),sigma.plugins.dragNodes(i,i.renderers[0])):sigma.plugins.dragNodes(i,i.renderers[0]);var n=document.getElementsByClassName("sigma-mouse")[0];n.addEventListener("mousemove",c.trackCursorPosition.bind(this),!1),b&&$("#"+b).focus();var o=function(){c.graphLasso=c.initializeGraph(i,a),c.graphLasso.activate(),c.graphLasso.deactivate()};this.graphConfig?"canvas"===this.graphConfig.renderer?o():$("#selectNodes").parent().hide():"canvas"===g?o():$("#selectNodes").parent().hide(),c.graphLasso&&(window.App.listenerFunctions.graphViewer=this.keyUpFunction.bind(this)),$("#calculatingGraph").remove()},keyUpFunction:function(a){var b=this;switch(a.keyCode){case 76:a.altKey&&b.toggleLasso()}},toggleLayout:function(){this.layouting?this.stopLayout():this.startLayout()},toggleLasso:function(){this.graphLasso.isActive?($("#selectNodes").removeClass("activated"),this.graphLasso.deactivate()):($("#selectNodes").addClass("activated"),this.graphLasso.activate())},startLayout:function(){$("#toggleForce .fa").removeClass("fa-play").addClass("fa-pause"),this.layouting=!0,this.currentGraph.startForceAtlas2({worker:!0,barnesHutOptimize:!1}),sigma.plugins.dragNodes(this.currentGraph,this.currentGraph.renderers[0])},stopLayout:function(){$("#toggleForce .fa").removeClass("fa-pause").addClass("fa-play"),this.layouting=!1,this.currentGraph.stopForceAtlas2(),sigma.plugins.dragNodes(this.currentGraph,this.currentGraph.renderers[0])}})}(),function(){"use strict";window.HelpUsView=Backbone.View.extend({el:"#content",template:templateEngine.createTemplate("helpUsView.ejs"),render:function(){this.$el.html(this.template.render({}))}})}(),function(){"use strict";window.IndicesView=Backbone.View.extend({el:"#content",initialize:function(a){this.collectionName=a.collectionName,this.model=this.collection},template:templateEngine.createTemplate("indicesView.ejs"),events:{},render:function(){$(this.el).html(this.template.render({model:this.model})),this.breadcrumb(),window.arangoHelper.buildCollectionSubNav(this.collectionName,"Indices"),this.getIndex()},breadcrumb:function(){$("#subNavigationBar .breadcrumb").html("Collection: "+this.collectionName)},getIndex:function(){var a=function(a,b){a?window.arangoHelper.arangoError("Index",b.errorMessage):this.renderIndex(b)}.bind(this);this.model.getIndex(a)},createIndex:function(){var a,b,c,d=this,e=$("#newIndexType").val(),f={};switch(e){case"Geo":a=$("#newGeoFields").val();var g=d.checkboxToValue("#newGeoJson");f={type:"geo",fields:d.stringToArray(a),geoJson:g};break;case"Persistent":a=$("#newPersistentFields").val(),b=d.checkboxToValue("#newPersistentUnique"),c=d.checkboxToValue("#newPersistentSparse"),f={type:"persistent",fields:d.stringToArray(a),unique:b,sparse:c};break;case"Hash":a=$("#newHashFields").val(),b=d.checkboxToValue("#newHashUnique"),c=d.checkboxToValue("#newHashSparse"),f={type:"hash",fields:d.stringToArray(a),unique:b,sparse:c};break;case"Fulltext":a=$("#newFulltextFields").val();var h=parseInt($("#newFulltextMinLength").val(),10)||0;f={type:"fulltext",fields:d.stringToArray(a),minLength:h};break;case"Skiplist":a=$("#newSkiplistFields").val(),b=d.checkboxToValue("#newSkiplistUnique"),c=d.checkboxToValue("#newSkiplistSparse"),f={type:"skiplist",fields:d.stringToArray(a),unique:b,sparse:c}}var i=function(a,b){if(a)if(b){var c=JSON.parse(b.responseText);arangoHelper.arangoError("Document error",c.errorMessage)}else arangoHelper.arangoError("Document error","Could not create index.");d.toggleNewIndexView(),d.render()};this.model.createIndex(f,i)},bindIndexEvents:function(){this.unbindIndexEvents();var a=this;$("#indexEditView #addIndex").bind("click",function(){a.toggleNewIndexView(),$("#cancelIndex").unbind("click"),$("#cancelIndex").bind("click",function(){a.toggleNewIndexView(),a.render()}),$("#createIndex").unbind("click"),$("#createIndex").bind("click",function(){a.createIndex()})}),$("#newIndexType").bind("change",function(){a.selectIndexType()}),$(".deleteIndex").bind("click",function(b){a.prepDeleteIndex(b)}),$("#infoTab a").bind("click",function(a){if($("#indexDeleteModal").remove(),"Indices"!==$(a.currentTarget).html()||$(a.currentTarget).parent().hasClass("active")||($("#newIndexView").hide(),$("#indexEditView").show(),$("#indexHeaderContent #modal-dialog .modal-footer .button-danger").hide(),$("#indexHeaderContent #modal-dialog .modal-footer .button-success").hide(),$("#indexHeaderContent #modal-dialog .modal-footer .button-notification").hide()),"General"===$(a.currentTarget).html()&&!$(a.currentTarget).parent().hasClass("active")){$("#indexHeaderContent #modal-dialog .modal-footer .button-danger").show(),$("#indexHeaderContent #modal-dialog .modal-footer .button-success").show(),$("#indexHeaderContent #modal-dialog .modal-footer .button-notification").show();var b=$(".index-button-bar2")[0];$("#cancelIndex").is(":visible")&&($("#cancelIndex").detach().appendTo(b),$("#createIndex").detach().appendTo(b))}})},prepDeleteIndex:function(a){var b=this;this.lastTarget=a,this.lastId=$(this.lastTarget.currentTarget).parent().parent().first().children().first().text(),$("#content #modal-dialog .modal-footer").after(''),$("#indexHeaderContent #indexConfirmDelete").unbind("click"),$("#indexHeaderContent #indexConfirmDelete").bind("click",function(){$("#indexHeaderContent #indexDeleteModal").remove(),b.deleteIndex()}),$("#indexHeaderContent #indexAbortDelete").unbind("click"),$("#indexHeaderContent #indexAbortDelete").bind("click",function(){$("#indexHeaderContent #indexDeleteModal").remove()})},unbindIndexEvents:function(){$("#indexHeaderContent #indexEditView #addIndex").unbind("click"),$("#indexHeaderContent #newIndexType").unbind("change"),$("#indexHeaderContent #infoTab a").unbind("click"),$("#indexHeaderContent .deleteIndex").unbind("click")},deleteIndex:function(){var a=function(a){a?(arangoHelper.arangoError("Could not delete index"),$("tr th:contains('"+this.lastId+"')").parent().children().last().html(''),this.model.set("locked",!1)):a||void 0===a||($("tr th:contains('"+this.lastId+"')").parent().remove(),this.model.set("locked",!1))}.bind(this);this.model.set("locked",!0),this.model.deleteIndex(this.lastId,a),$("tr th:contains('"+this.lastId+"')").parent().children().last().html('')},renderIndex:function(a){this.index=a;var b="collectionInfoTh modal-text";if(this.index){var c="",d="";_.each(this.index.indexes,function(a){d="primary"===a.type||"edge"===a.type?'':'',void 0!==a.fields&&(c=a.fields.join(", "));var e=a.id.indexOf("/"),f=a.id.substr(e+1,a.id.length),g=a.hasOwnProperty("selectivityEstimate")?(100*a.selectivityEstimate).toFixed(2)+"%":"n/a",h=a.hasOwnProperty("sparse")?a.sparse:"n/a";$("#collectionEditIndexTable").append(""+f+""+a.type+""+a.unique+""+h+""+g+""+c+""+d+"")})}this.bindIndexEvents()},selectIndexType:function(){$(".newIndexClass").hide();var a=$("#newIndexType").val();$("#newIndexType"+a).show()},resetIndexForms:function(){$("#indexHeader input").val("").prop("checked",!1),$("#newIndexType").val("Geo").prop("selected",!0),this.selectIndexType()},toggleNewIndexView:function(){var a=$(".index-button-bar2")[0];$("#indexEditView").is(":visible")?($("#indexEditView").hide(),$("#newIndexView").show(),$("#cancelIndex").detach().appendTo("#indexHeaderContent #modal-dialog .modal-footer"),$("#createIndex").detach().appendTo("#indexHeaderContent #modal-dialog .modal-footer")):($("#indexEditView").show(),$("#newIndexView").hide(),$("#cancelIndex").detach().appendTo(a),$("#createIndex").detach().appendTo(a)),arangoHelper.fixTooltips(".icon_arangodb, .arangoicon","right"),this.resetIndexForms()},stringToArray:function(a){var b=[];return a.split(",").forEach(function(a){a=a.replace(/(^\s+|\s+$)/g,""),""!==a&&b.push(a)}),b},checkboxToValue:function(a){return $(a).prop("checked")}})}(),function(){"use strict";window.InfoView=Backbone.View.extend({el:"#content",initialize:function(a){this.collectionName=a.collectionName,this.model=this.collection},events:{},render:function(){this.breadcrumb(),window.arangoHelper.buildCollectionSubNav(this.collectionName,"Info"),this.renderInfoView()},breadcrumb:function(){$("#subNavigationBar .breadcrumb").html("Collection: "+this.collectionName)},renderInfoView:function(){if(this.model.get("locked"))return 0;var a=function(a,b,c){if(a)arangoHelper.arangoError("Figures","Could not get revision.");else{var d=[],e={figures:c,revision:b,model:this.model};window.modalView.show("modalCollectionInfo.ejs","Collection: "+this.model.get("name"),d,e,null,null,null,null,null,"content")}}.bind(this),b=function(b,c){if(b)arangoHelper.arangoError("Figures","Could not get figures.");else{var d=c;this.model.getRevision(a,d)}}.bind(this);this.model.getFigures(b)}})}(),function(){"use strict";window.LoginView=Backbone.View.extend({el:"#content",el2:".header",el3:".footer",loggedIn:!1,loginCounter:0,events:{"keyPress #loginForm input":"keyPress", -"click #submitLogin":"validate","submit #dbForm":"goTo","click #logout":"logout","change #loginDatabase":"renderDBS"},template:templateEngine.createTemplate("loginView.ejs"),render:function(a){var b=this;if($(this.el).html(this.template.render({})),$(this.el2).hide(),$(this.el3).hide(),frontendConfig.authenticationEnabled&&a!==!0)window.setTimeout(function(){$("#loginUsername").focus()},300);else{var c=arangoHelper.databaseUrl("/_api/database/user");frontendConfig.authenticationEnabled===!1&&($("#logout").hide(),$(".login-window #databases").css("height","90px")),$("#loginForm").hide(),$(".login-window #databases").show(),$.ajax(c).success(function(a){$("#loginDatabase").html(""),_.each(a.result,function(a){$("#loginDatabase").append("")}),b.renderDBS()}).error(function(){console.log("could not fetch user db data")})}return $(".bodyWrapper").show(),this},clear:function(){$("#loginForm input").removeClass("form-error"),$(".wrong-credentials").hide()},keyPress:function(a){a.ctrlKey&&13===a.keyCode?(a.preventDefault(),this.validate()):a.metaKey&&13===a.keyCode&&(a.preventDefault(),this.validate())},validate:function(a){a.preventDefault(),this.clear();var b=$("#loginUsername").val(),c=$("#loginPassword").val();b&&this.collection.login(b,c,this.loginCallback.bind(this,b,c))},loginCallback:function(a,b,c){var d=this;if(c){if(0===d.loginCounter)return d.loginCounter++,void d.collection.login(a,b,this.loginCallback.bind(this,a));d.loginCounter=0,$(".wrong-credentials").show(),$("#loginDatabase").html(""),$("#loginDatabase").append("")}else{var e=arangoHelper.databaseUrl("/_api/user/"+encodeURIComponent(a)+"/database","_system");frontendConfig.authenticationEnabled===!1&&(e=arangoHelper.databaseUrl("/_api/database/user")),$(".wrong-credentials").hide(),d.loggedIn=!0,$.ajax(e).success(function(a){_.each(a.result,function(b,c){"rw"!==b&&delete a.result[c]}),$("#loginForm").hide(),$(".login-window #databases").show(),$("#loginDatabase").html(""),_.each(a.result,function(a,b){$("#loginDatabase").append("")}),d.renderDBS()}).error(function(){$(".wrong-credentials").show()})}},renderDBS:function(){if(0===$("#loginDatabase").children().length)$("#dbForm").remove(),$(".login-window #databases").prepend('
    You do not have permission to a database.
    ');else{var a=$("#loginDatabase").val();$("#goToDatabase").html("Select DB: "+a),window.setTimeout(function(){$("#goToDatabase").focus()},300)}},logout:function(){this.collection.logout()},goTo:function(a){a.preventDefault();var b=$("#loginUsername").val(),c=$("#loginDatabase").val();window.App.dbSet=c;var d=function(a){a&&arangoHelper.arangoError("User","Could not fetch user settings")},e=window.location.protocol+"//"+window.location.host+frontendConfig.basePath+"/_db/"+c+"/_admin/aardvark/index.html";window.location.href=e,$(this.el2).show(),$(this.el3).show(),$(".bodyWrapper").show(),$(".navbar").show(),$("#currentUser").text(b),this.collection.loadUserSettings(d)}})}(),function(){"use strict";window.LogsView=window.PaginationView.extend({el:"#content",id:"#logContent",paginationDiv:"#logPaginationDiv",idPrefix:"logTable",fetchedAmount:!1,initialize:function(a){this.options=a,this.convertModelToJSON()},currentLoglevel:"logall",events:{"click #arangoLogTabbar button":"setActiveLoglevel","click #logTable_first":"firstPage","click #logTable_last":"lastPage"},template:templateEngine.createTemplate("logsView.ejs"),tabbar:templateEngine.createTemplate("arangoTabbar.ejs"),table:templateEngine.createTemplate("arangoTable.ejs"),tabbarElements:{id:"arangoLogTabbar",titles:[["All","logall"],["Info","loginfo"],["Error","logerror"],["Warning","logwarning"],["Debug","logdebug"]]},tableDescription:{id:"arangoLogTable",titles:["Loglevel","Date","Message"],rows:[]},convertedRows:null,setActiveLoglevel:function(a){$(".arangodb-tabbar").removeClass("arango-active-tab"),this.currentLoglevel!==a.currentTarget.id&&(this.currentLoglevel=a.currentTarget.id,this.convertModelToJSON())},initTotalAmount:function(){var a=this;this.collection=this.options[this.currentLoglevel],this.collection.fetch({data:$.param({test:!0}),success:function(){a.convertModelToJSON()}}),this.fetchedAmount=!0},invertArray:function(a){var b,c=[],d=0;for(b=a.length-1;b>=0;b--)c[d]=a[b],d++;return c},convertModelToJSON:function(){if(!this.fetchedAmount)return void this.initTotalAmount();var a,b=this,c=[];this.collection=this.options[this.currentLoglevel],this.collection.fetch({success:function(){b.collection.each(function(b){a=new Date(1e3*b.get("timestamp")),c.push([b.getLogStatus(),arangoHelper.formatDT(a),b.get("text")])}),b.tableDescription.rows=b.invertArray(c),b.render()}})},render:function(){return $(this.el).html(this.template.render({})),$(this.id).html(this.tabbar.render({content:this.tabbarElements})),$(this.id).append(this.table.render({content:this.tableDescription})),$("#"+this.currentLoglevel).addClass("arango-active-tab"),$("#logContent").append('
    '),this.renderPagination(),this},rerender:function(){this.convertModelToJSON()}})}(),function(){"use strict";var a=function(a,b,c,d){return{type:a,title:b,callback:c,confirm:d}},b=function(a,b,c,d,e,f,g,h,i,j,k){var l={type:a,label:b};return void 0!==c&&(l.value=c),void 0!==d&&(l.info=d),void 0!==e&&(l.placeholder=e),void 0!==f&&(l.mandatory=f),void 0!==h&&(l.addDelete=h),void 0!==i&&(l.addAdd=i),void 0!==j&&(l.maxEntrySize=j),void 0!==k&&(l.tags=k),g&&(l.validateInput=function(){return g}),l};window.ModalView=Backbone.View.extend({_validators:[],_validateWatchers:[],baseTemplate:templateEngine.createTemplate("modalBase.ejs"),tableTemplate:templateEngine.createTemplate("modalTable.ejs"),el:"#modalPlaceholder",contentEl:"#modalContent",hideFooter:!1,confirm:{list:"#modal-delete-confirmation",yes:"#modal-confirm-delete",no:"#modal-abort-delete"},enabledHotkey:!1,enableHotKeys:!0,buttons:{SUCCESS:"success",NOTIFICATION:"notification",DELETE:"danger",NEUTRAL:"neutral",CLOSE:"close"},tables:{READONLY:"readonly",TEXT:"text",BLOB:"blob",PASSWORD:"password",SELECT:"select",SELECT2:"select2",CHECKBOX:"checkbox"},initialize:function(){Object.freeze(this.buttons),Object.freeze(this.tables)},createModalHotkeys:function(){$(this.el).unbind("keydown"),$(this.el).unbind("return"),$(this.el).bind("keydown","return",function(){$(".createModalDialog .modal-footer .button-success").click()}),$(".modal-body input").unbind("keydown"),$(".modal-body input").unbind("return"),$(".modal-body input",$(this.el)).bind("keydown","return",function(){$(".createModalDialog .modal-footer .button-success").click()}),$(".modal-body select").unbind("keydown"),$(".modal-body select").unbind("return"),$(".modal-body select",$(this.el)).bind("keydown","return",function(){$(".createModalDialog .modal-footer .button-success").click()})},createInitModalHotkeys:function(){var a=this;$(this.el).bind("keydown","left",function(){a.navigateThroughButtons("left")}),$(this.el).bind("keydown","right",function(){a.navigateThroughButtons("right")})},navigateThroughButtons:function(a){var b=$(".createModalDialog .modal-footer button").is(":focus");b===!1?"left"===a?$(".createModalDialog .modal-footer button").first().focus():"right"===a&&$(".createModalDialog .modal-footer button").last().focus():b===!0&&("left"===a?$(":focus").prev().focus():"right"===a&&$(":focus").next().focus())},createCloseButton:function(b,c){var d=this;return a(this.buttons.CLOSE,b,function(){d.hide(),c&&c()})},createSuccessButton:function(b,c){return a(this.buttons.SUCCESS,b,c)},createNotificationButton:function(b,c){return a(this.buttons.NOTIFICATION,b,c)},createDeleteButton:function(b,c,d){return a(this.buttons.DELETE,b,c,d)},createNeutralButton:function(b,c){return a(this.buttons.NEUTRAL,b,c)},createDisabledButton:function(b){var c=a(this.buttons.NEUTRAL,b);return c.disabled=!0,c},createReadOnlyEntry:function(a,c,d,e,f,g){var h=b(this.tables.READONLY,c,d,e,void 0,void 0,void 0,f,g);return h.id=a,h},createTextEntry:function(a,c,d,e,f,g,h){var i=b(this.tables.TEXT,c,d,e,f,g,h);return i.id=a,i},createBlobEntry:function(a,c,d,e,f,g,h){var i=b(this.tables.BLOB,c,d,e,f,g,h);return i.id=a,i},createSelect2Entry:function(a,c,d,e,f,g,h,i,j,k){var l=b(this.tables.SELECT2,c,d,e,f,g,void 0,h,i,j,k);return l.id=a,l},createPasswordEntry:function(a,c,d,e,f,g,h){var i=b(this.tables.PASSWORD,c,d,e,f,g,h);return i.id=a,i},createCheckboxEntry:function(a,c,d,e,f){var g=b(this.tables.CHECKBOX,c,d,e);return g.id=a,f&&(g.checked=f),g},createSelectEntry:function(a,c,d,e,f){var g=b(this.tables.SELECT,c,null,e);return g.id=a,d&&(g.selected=d),g.options=f,g},createOptionEntry:function(a,b){return{label:a,value:b||a}},show:function(a,b,c,d,e,f,g,h,i,j){var k,l,m=this,n=!1;c=c||[],h=Boolean(h),this.clearValidators(),c.length>0?(c.forEach(function(a){a.type===m.buttons.CLOSE&&(n=!0),a.type===m.buttons.DELETE&&(l=l||a.confirm)}),n||(k=c.pop(),c.push(m.createCloseButton("Cancel")),c.push(k))):c.push(m.createCloseButton("Close")),j?($("#"+j).html(this.baseTemplate.render({title:b,buttons:c,hideFooter:this.hideFooter,confirm:l,tabBar:i})),$("#"+j+" #modal-dialog").removeClass("fade hide modal"),$("#"+j+" .modal-header").remove(),$("#"+j+" .modal-tabbar").remove(),$("#"+j+" .modal-tabbar").remove(),$("#"+j+" .button-close").remove(),0===$("#"+j+" .modal-footer").children().length&&$("#"+j+" .modal-footer").remove()):$(this.el).html(this.baseTemplate.render({title:b,buttons:c,hideFooter:this.hideFooter,confirm:l,tabBar:i})),_.each(c,function(a,b){if(!a.disabled&&a.callback){if(a.type===m.buttons.DELETE&&!h){var c="#modalButton"+b;return j&&(c="#"+j+" #modalButton"+b),void $(c).bind("click",function(){j?($("#"+j+" "+m.confirm.yes).unbind("click"),$("#"+j+" "+m.confirm.yes).bind("click",a.callback),$("#"+j+" "+m.confirm.list).css("display","block")):($(m.confirm.yes).unbind("click"),$(m.confirm.yes).bind("click",a.callback),$(m.confirm.list).css("display","block"))})}j?$("#"+j+" #modalButton"+b).bind("click",a.callback):$("#modalButton"+b).bind("click",a.callback)}}),j?$("#"+j+" "+this.confirm.no).bind("click",function(){$("#"+j+" "+m.confirm.list).css("display","none")}):$(this.confirm.no).bind("click",function(){$(m.confirm.list).css("display","none")});var o;if("string"==typeof a)o=templateEngine.createTemplate(a),j?$("#"+j+" .createModalDialog .modal-body").html(o.render({content:d,advancedContent:e,info:f})):$("#modalPlaceholder .createModalDialog .modal-body").html(o.render({content:d,advancedContent:e,info:f}));else{var p=0;_.each(a,function(a){o=templateEngine.createTemplate(a),$(".createModalDialog .modal-body .tab-content #"+i[p]).html(o.render({content:d,advancedContent:e,info:f})),p++})}$(".createModalDialog .modalTooltips").tooltip({position:{my:"left top",at:"right+55 top-1"}});var q=d||[];e&&e.content&&(q=q.concat(e.content)),_.each(q,function(a){m.modalBindValidation(a),a.type===m.tables.SELECT2&&$("#"+a.id).select2({tags:a.tags||[],showSearchBox:!1,minimumResultsForSearch:-1,width:"336px",maximumSelectionSize:a.maxEntrySize||8})}),g&&(this.events=g,this.delegateEvents()),$("#accordion2")&&($("#accordion2 .accordion-toggle").bind("click",function(){$("#collapseOne").is(":visible")?($("#collapseOne").hide(),setTimeout(function(){$(".accordion-toggle").addClass("collapsed")},100)):($("#collapseOne").show(),setTimeout(function(){$(".accordion-toggle").removeClass("collapsed")},100))}),$("#collapseOne").hide(),setTimeout(function(){$(".accordion-toggle").addClass("collapsed")},100)),j||$("#modal-dialog").modal("show"),this.enabledHotkey===!1&&(this.createInitModalHotkeys(),this.enabledHotkey=!0),this.enableHotKeys&&this.createModalHotkeys();var r;r=j?$("#"+j+" #modal-dialog").find("input"):$("#modal-dialog").find("input"),r&&setTimeout(function(){r=j?$("#"+j+" #modal-dialog"):$("#modal-dialog"),r.length>0&&(r=r.find("input"),r.length>0&&$(r[0]).focus())},400)},modalBindValidation:function(a){var b=this;if(a.hasOwnProperty("id")&&a.hasOwnProperty("validateInput")){var c=function(){var b=$("#"+a.id),c=a.validateInput(b),d=!1;return _.each(c,function(a){var c=b.val();if(a.rule||(a={rule:a}),"function"==typeof a.rule)try{a.rule(c)}catch(e){d=a.msg||e.message}else{var f=Joi.validate(c,a.rule);f.error&&(d=a.msg||f.error.message)}return d?!1:void 0}),d?d:void 0},d=$("#"+a.id);d.on("keyup focusout",function(){var a=c(),e=d.next()[0];a?(d.addClass("invalid-input"),e?$(e).text(a):d.after('

    '+a+"

    "),$(".createModalDialog .modal-footer .button-success").prop("disabled",!0).addClass("disabled")):(d.removeClass("invalid-input"),e&&$(e).remove(),b.modalTestAll())}),this._validators.push(c),this._validateWatchers.push(d)}},modalTestAll:function(){var a=_.map(this._validators,function(a){return a()}),b=_.any(a);return b?$(".createModalDialog .modal-footer .button-success").prop("disabled",!0).addClass("disabled"):$(".createModalDialog .modal-footer .button-success").prop("disabled",!1).removeClass("disabled"),!b},clearValidators:function(){this._validators=[],_.each(this._validateWatchers,function(a){a.unbind("keyup focusout")}),this._validateWatchers=[]},hide:function(){this.clearValidators(),$("#modal-dialog").modal("hide")}})}(),function(){"use strict";window.NavigationView=Backbone.View.extend({el:"#navigationBar",subEl:"#subNavigationBar",events:{"change #arangoCollectionSelect":"navigateBySelect","click .tab":"navigateByTab","click li":"switchTab","click .arangodbLogo":"selectMenuItem","mouseenter .dropdown > *":"showDropdown","click .shortcut-icons p":"showShortcutModal","mouseleave .dropdown":"hideDropdown"},renderFirst:!0,activeSubMenu:void 0,changeDB:function(){window.location.hash="#login"},initialize:function(a){var b=this;this.userCollection=a.userCollection,this.currentDB=a.currentDB,this.dbSelectionView=new window.DBSelectionView({collection:a.database,current:this.currentDB}),this.userBarView=new window.UserBarView({userCollection:this.userCollection}),this.notificationView=new window.NotificationView({collection:a.notificationCollection}),this.statisticBarView=new window.StatisticBarView({currentDB:this.currentDB}),this.isCluster=a.isCluster,this.handleKeyboardHotkeys(),Backbone.history.on("all",function(){b.selectMenuItem()})},showShortcutModal:function(){arangoHelper.hotkeysFunctions.showHotkeysModal()},handleSelectDatabase:function(){this.dbSelectionView.render($("#dbSelect"))},template:templateEngine.createTemplate("navigationView.ejs"),templateSub:templateEngine.createTemplate("subNavigationView.ejs"),render:function(){var a=this;$(this.el).html(this.template.render({currentDB:this.currentDB,isCluster:this.isCluster})),"_system"!==this.currentDB.get("name")&&$("#dashboard").parent().remove(),$(this.subEl).html(this.templateSub.render({currentDB:this.currentDB.toJSON()})),this.dbSelectionView.render($("#dbSelect"));var b=function(a){a||this.userBarView.render()}.bind(this);return this.userCollection.whoAmI(b),this.renderFirst&&(this.renderFirst=!1,this.selectMenuItem(),$(".arangodbLogo").on("click",function(){a.selectMenuItem()}),$("#dbStatus").on("click",function(){a.changeDB()})),this},navigateBySelect:function(){var a=$("#arangoCollectionSelect").find("option:selected").val();window.App.navigate(a,{trigger:!0})},handleKeyboardHotkeys:function(){arangoHelper.enableKeyboardHotkeys(!0)},navigateByTab:function(a){var b=a.target||a.srcElement,c=b.id,d=!1;$(b).hasClass("fa")||(""===c&&(c=$(b).attr("class")),"links"===c?(d=!0,$("#link_dropdown").slideToggle(1),a.preventDefault()):"tools"===c?(d=!0,$("#tools_dropdown").slideToggle(1),a.preventDefault()):"dbselection"===c&&(d=!0,$("#dbs_dropdown").slideToggle(1),a.preventDefault()),d||(window.App.navigate(c,{trigger:!0}),a.preventDefault()))},handleSelectNavigation:function(){var a=this;$("#arangoCollectionSelect").change(function(){a.navigateBySelect()})},subViewConfig:{documents:"collections",collection:"collections"},subMenuConfig:{cluster:[{name:"Dashboard",view:void 0,active:!0},{name:"Logs",view:void 0,disabled:!0}],collections:[{name:"",view:void 0,active:!1}],queries:[{name:"Editor",route:"query",active:!0},{name:"Running Queries",route:"queryManagement",params:{active:!0},active:void 0},{name:"Slow Query History",route:"queryManagement",params:{active:!1},active:void 0}]},renderSubMenu:function(a){var b=this;if(void 0===a&&(a=window.isCluster?"cluster":"dashboard"),this.subMenuConfig[a]){$(this.subEl+" .bottom").html("");var c="";_.each(this.subMenuConfig[a],function(a){c=a.active?"active":"",a.disabled&&(c="disabled"),$(b.subEl+" .bottom").append('"),a.disabled||$(b.subEl+" .bottom").children().last().bind("click",function(c){b.activeSubMenu=a,b.renderSubView(a,c)})})}},renderSubView:function(a,b){window.App[a.route]&&(window.App[a.route].resetState&&window.App[a.route].resetState(),window.App[a.route]()),$(this.subEl+" .bottom").children().removeClass("active"),$(b.currentTarget).addClass("active")},switchTab:function(a){var b=$(a.currentTarget).children().first().attr("id");b&&this.selectMenuItem(b+"-menu")},selectMenuItem:function(a,b){void 0===a&&(a=window.location.hash.split("/")[0],a=a.substr(1,a.length-1)),""===a?a=window.App.isCluster?"cluster":"dashboard":"cNodes"!==a&&"dNodes"!==a||(a="nodes");try{this.renderSubMenu(a.split("-")[0])}catch(c){this.renderSubMenu(a)}$(".navlist li").removeClass("active"),"string"==typeof a&&(b?$("."+this.subViewConfig[a]+"-menu").addClass("active"):a&&($("."+a).addClass("active"),$("."+a+"-menu").addClass("active"))),arangoHelper.hideArangoNotifications()},showSubDropdown:function(a){$(a.currentTarget).find(".subBarDropdown").toggle()},showDropdown:function(a){var b=a.target||a.srcElement,c=b.id;"links"===c||"link_dropdown"===c||"links"===a.currentTarget.id?$("#link_dropdown").fadeIn(1):"tools"===c||"tools_dropdown"===c||"tools"===a.currentTarget.id?$("#tools_dropdown").fadeIn(1):"dbselection"!==c&&"dbs_dropdown"!==c&&"dbselection"!==a.currentTarget.id||$("#dbs_dropdown").fadeIn(1)},hideDropdown:function(a){var b=a.target||a.srcElement;b=$(b).parent(),$("#link_dropdown").fadeOut(1),$("#tools_dropdown").fadeOut(1),$("#dbs_dropdown").fadeOut(1)}})}(),function(){"use strict";window.NodesView=Backbone.View.extend({el:"#content",template:templateEngine.createTemplate("nodesView.ejs"),interval:5e3,knownServers:[],events:{"click #nodesContent .pure-table-body .pure-table-row":"navigateToNode"},initialize:function(a){var b=this;clearInterval(this.intervalFunction),window.App.isCluster&&(this.dbServers=a.dbServers,this.coordinators=a.coordinators,this.updateServerTime(),this.toRender=a.toRender,this.intervalFunction=window.setInterval(function(){"#cNodes"!==window.location.hash&&"#dNodes"!==window.location.hash&&"#nodes"!==window.location.hash||b.checkNodesState()},this.interval))},checkNodesState:function(){var a=function(a){_.each(a,function(a,b){_.each($(".pure-table-row"),function(c){$(c).attr("node")===b&&("GOOD"===a.Status?($(c).removeClass("noHover"),$(c).find(".state").html('')):($(c).addClass("noHover"),$(c).find(".state").html('')))})})};$.ajax({type:"GET",cache:!1,url:arangoHelper.databaseUrl("/_admin/cluster/health"),contentType:"application/json",processData:!1,async:!0,success:function(b){a(b.Health)}})},navigateToNode:function(a){if("#dNodes"!==window.location.hash&&!$(a.currentTarget).hasClass("noHover")){var b=$(a.currentTarget).attr("node");window.App.navigate("#node/"+encodeURIComponent(b),{trigger:!0})}},render:function(){var a=function(){this.continueRender()}.bind(this);this.initDoneCoords?a():this.waitForCoordinators(a)},continueRender:function(){var a;a="coordinator"===this.toRender?this.coordinators.toJSON():this.dbServers.toJSON(),this.$el.html(this.template.render({coords:a,type:this.toRender})),window.arangoHelper.buildNodesSubNav(this.toRender),this.checkNodesState()},waitForCoordinators:function(a){var b=this;window.setTimeout(function(){0===b.coordinators.length?b.waitForCoordinators(a):(this.initDoneCoords=!0,a())},200)},updateServerTime:function(){this.serverTime=(new Date).getTime()}})}(),function(){"use strict";window.NodesView2=Backbone.View.extend({el:"#content",template:templateEngine.createTemplate("nodesView2.ejs"),interval:1e4,knownServers:[],events:{"click #nodesContent .coords-nodes .pure-table-row":"navigateToNode","click #addCoord":"addCoord","click #removeCoord":"removeCoord","click #addDBs":"addDBs","click #removeDBs":"removeDBs"},initialize:function(){var a=this;clearInterval(this.intervalFunction),window.App.isCluster&&(this.updateServerTime(),this.intervalFunction=window.setInterval(function(){"#nodes"===window.location.hash&&a.render(!1)},this.interval))},navigateToNode:function(a){if(!$(a.currentTarget).hasClass("noHover")){var b=$(a.currentTarget).attr("node").slice(0,-5);window.App.navigate("#node/"+encodeURIComponent(b),{trigger:!0})}},render:function(a){var b=this,c=function(a){$.ajax({type:"GET",url:arangoHelper.databaseUrl("/_admin/cluster/numberOfServers"),contentType:"application/json",success:function(c){b.continueRender(a,c)}})};$.ajax({type:"GET",cache:!1,url:arangoHelper.databaseUrl("/_admin/cluster/health"),contentType:"application/json",processData:!1,async:!0,success:function(a){c(a.Health)},error:function(){arangoHelper.arangoError("Cluster","Could not fetch cluster information")}}),a!==!1&&arangoHelper.buildNodesSubNav("Overview")},continueRender:function(a,b){var c={},d={},e=!1;_.each(a,function(a,b){"Coordinator"===a.Role?c[b]=a:"DBServer"===a.Role&&(d[b]=a)}),null!==b.numberOfDBServers&&null!==b.numberOfCoordinators&&(e=!0);var f=function(a){this.$el.html(this.template.render({coords:c,dbs:d,scaling:e,scaleProperties:a,plannedDBs:b.numberOfDBServers,plannedCoords:b.numberOfCoordinators})),e||($(".title").css("position","relative"),$(".title").css("top","-4px"),$(".sectionHeader .information").css("margin-top","-3px"))}.bind(this);this.renderCounts(e,f)},updatePlanned:function(a){a.numberOfCoordinators&&($("#plannedCoords").val(a.numberOfCoordinators),this.renderCounts(!0)),a.numberOfDBServers&&($("#plannedDBs").val(a.numberOfDBServers),this.renderCounts(!0))},setCoordSize:function(a){var b=this,c={numberOfCoordinators:a};$.ajax({type:"PUT",url:arangoHelper.databaseUrl("/_admin/cluster/numberOfServers"),contentType:"application/json",data:JSON.stringify(c),success:function(){b.updatePlanned(c)},error:function(){arangoHelper.arangoError("Scale","Could not set coordinator size.")}})},setDBsSize:function(a){var b=this,c={numberOfDBServers:a};$.ajax({type:"PUT",url:arangoHelper.databaseUrl("/_admin/cluster/numberOfServers"),contentType:"application/json",data:JSON.stringify(c),success:function(){b.updatePlanned(c)},error:function(){arangoHelper.arangoError("Scale","Could not set coordinator size.")}})},renderCounts:function(a,b){var c=function(b,c,d,e){var f=''+c+'';d&&a===!0&&(f=f+''+d+''),e&&(f=f+''+e+''),$(b).html(f),a||($(".title").css("position","relative"),$(".title").css("top","-4px"))},d=function(a){var d=0,e=0,f=0,g=0,h=0,i=0;_.each(a,function(a){"Coordinator"===a.Role?"GOOD"===a.Status?e++:d++:"DBServer"===a.Role&&("GOOD"===a.Status?g++:h++)}),$.ajax({type:"GET",cache:!1,url:arangoHelper.databaseUrl("/_admin/cluster/numberOfServers"),contentType:"application/json",processData:!1,success:function(a){f=Math.abs(e+d-a.numberOfCoordinators),i=Math.abs(g+h-a.numberOfDBServers),b?b({coordsPending:f,coordsOk:e,coordsErrors:d,dbsPending:i,dbsOk:g,dbsErrors:h}):(c("#infoDBs",g,i,h),c("#infoCoords",e,f,d))}})};$.ajax({type:"GET",cache:!1,url:arangoHelper.databaseUrl("/_admin/cluster/health"),contentType:"application/json",processData:!1,success:function(a){d(a.Health)}})},addCoord:function(){this.setCoordSize(this.readNumberFromID("#plannedCoords",!0))},removeCoord:function(){this.setCoordSize(this.readNumberFromID("#plannedCoords",!1,!0))},addDBs:function(){this.setDBsSize(this.readNumberFromID("#plannedDBs",!0))},removeDBs:function(){this.setDBsSize(this.readNumberFromID("#plannedDBs",!1,!0))},readNumberFromID:function(a,b,c){var d=$(a).val(),e=!1;try{e=JSON.parse(d)}catch(f){}return b&&e++,c&&1!==e&&e--,e},updateServerTime:function(){this.serverTime=(new Date).getTime()}})}(),function(){"use strict";window.NodeView=Backbone.View.extend({el:"#content",template:templateEngine.createTemplate("nodeView.ejs"),interval:5e3,dashboards:[],events:{},initialize:function(a){window.App.isCluster&&(this.coordinators=a.coordinators,this.dbServers=a.dbServers,this.coordname=a.coordname,this.updateServerTime())},breadcrumb:function(a){$("#subNavigationBar .breadcrumb").html("Node: "+a)},render:function(){this.$el.html(this.template.render({coords:[]}));var a=function(){this.continueRender(),this.breadcrumb(this.coordname),$(window).trigger("resize")}.bind(this);this.initCoordDone||this.waitForCoordinators(),this.initDBDone?(this.coordname=window.location.hash.split("/")[1],this.coordinator=this.coordinators.findWhere({name:this.coordname}),a()):this.waitForDBServers(a)},continueRender:function(){var a=this;this.dashboards[this.coordinator.get("name")]=new window.DashboardView({dygraphConfig:window.dygraphConfig,database:window.App.arangoDatabase,serverToShow:{raw:this.coordinator.get("address"),isDBServer:!1,endpoint:this.coordinator.get("protocol")+"://"+this.coordinator.get("address"),target:this.coordinator.get("name")}}),this.dashboards[this.coordinator.get("name")].render(),window.setTimeout(function(){a.dashboards[a.coordinator.get("name")].resize()},500)},waitForCoordinators:function(a){var b=this;window.setTimeout(function(){0===b.coordinators.length?b.waitForCoordinators(a):(b.coordinator=b.coordinators.findWhere({name:b.coordname}),b.initCoordDone=!0,a&&a())},200)},waitForDBServers:function(a){var b=this;window.setTimeout(function(){0===b.dbServers[0].length?b.waitForDBServers(a):(b.initDBDone=!0,b.dbServer=b.dbServers[0],b.dbServer.each(function(a){"DBServer001"===a.get("name")&&(b.dbServer=a)}),a())},200)},updateServerTime:function(){this.serverTime=(new Date).getTime()}})}(),function(){"use strict";window.NotificationView=Backbone.View.extend({events:{"click .navlogo #stat_hd":"toggleNotification","click .notificationItem .fa":"removeNotification","click #removeAllNotifications":"removeAllNotifications"},initialize:function(){this.collection.bind("add",this.renderNotifications.bind(this)),this.collection.bind("remove",this.renderNotifications.bind(this)),this.collection.bind("reset",this.renderNotifications.bind(this)),window.setTimeout(function(){frontendConfig.authenticationEnabled===!1&&frontendConfig.isCluster===!1&&arangoHelper.showAuthDialog()===!0&&window.arangoHelper.arangoWarning("Warning","Authentication is disabled. Do not use this setup in production mode.")},2e3)},notificationItem:templateEngine.createTemplate("notificationItem.ejs"),el:"#notificationBar",template:templateEngine.createTemplate("notificationView.ejs"),toggleNotification:function(){var a=this.collection.length;0!==a&&$("#notification_menu").toggle()},removeAllNotifications:function(){$.noty.clearQueue(),$.noty.closeAll(),this.collection.reset(),$("#notification_menu").hide()},removeNotification:function(a){var b=a.target.id;this.collection.get(b).destroy()},renderNotifications:function(a,b,c){if(c&&c.add){var d,e=this.collection.at(this.collection.length-1),f=e.get("title"),g=3e3,h=["click"];if(e.get("content")&&(f=f+": "+e.get("content")),"error"===e.get("type")?(g=!1,h=["button"],d=[{addClass:"button-danger",text:"Close",onClick:function(a){a.close()}}]):"warning"===e.get("type")&&(g=15e3,d=[{addClass:"button-warning",text:"Close",onClick:function(a){a.close()}},{addClass:"button-danger",text:"Don't show again.",onClick:function(a){a.close(),window.arangoHelper.doNotShowAgain()}}]),$.noty.clearQueue(),$.noty.closeAll(),noty({theme:"relax",text:f,template:'
    ',maxVisible:1,closeWith:["click"],type:e.get("type"),layout:"bottom",timeout:g,buttons:d,animation:{open:{height:"show"},close:{height:"hide"},easing:"swing",speed:200,closeWith:h}}),"success"===e.get("type"))return void e.destroy()}$("#stat_hd_counter").text(this.collection.length),0===this.collection.length?($("#stat_hd").removeClass("fullNotification"),$("#notification_menu").hide()):$("#stat_hd").addClass("fullNotification"),$(".innerDropdownInnerUL").html(this.notificationItem.render({notifications:this.collection})),$(".notificationInfoIcon").tooltip({position:{my:"left top",at:"right+55 top-1"}})},render:function(){return $(this.el).html(this.template.render({notifications:this.collection})),this.renderNotifications(),this.delegateEvents(),this.el}})}(),function(){"use strict";window.ProgressView=Backbone.View.extend({template:templateEngine.createTemplate("progressBase.ejs"),el:"#progressPlaceholder",el2:"#progressPlaceholderIcon",toShow:!1,lastDelay:0,action:function(){},events:{"click .progress-action button":"performAction"},performAction:function(){"function"==typeof this.action&&this.action(),window.progressView.hide()},initialize:function(){},showWithDelay:function(a,b,c,d){var e=this;e.toShow=!0,e.lastDelay=a,setTimeout(function(){e.toShow===!0&&e.show(b,c,d)},e.lastDelay)},show:function(a,b,c){$(this.el).html(this.template.render({})),$(".progress-text").text(a),c?$(".progress-action").html('"):$(".progress-action").html(''),b?this.action=b:this.action=this.hide(),$(this.el).show()},hide:function(){var a=this;a.toShow=!1,$(this.el).hide(),this.action=function(){}}})}(),function(){"use strict";window.QueryManagementView=Backbone.View.extend({el:"#content",id:"#queryManagementContent",templateActive:templateEngine.createTemplate("queryManagementViewActive.ejs"),templateSlow:templateEngine.createTemplate("queryManagementViewSlow.ejs"),table:templateEngine.createTemplate("arangoTable.ejs"),active:!0,shouldRender:!0,timer:0,refreshRate:2e3,initialize:function(){var a=this;this.activeCollection=new window.QueryManagementActive,this.slowCollection=new window.QueryManagementSlow,this.convertModelToJSON(!0),window.setInterval(function(){"#queries"===window.location.hash&&window.VISIBLE&&a.shouldRender&&"queryManagement"===arangoHelper.getCurrentSub().route&&(a.active?$("#arangoQueryManagementTable").is(":visible")&&a.convertModelToJSON(!0):$("#arangoQueryManagementTable").is(":visible")&&a.convertModelToJSON(!1))},a.refreshRate)},events:{"click #deleteSlowQueryHistory":"deleteSlowQueryHistoryModal","click #arangoQueryManagementTable .fa-minus-circle":"deleteRunningQueryModal"},tableDescription:{id:"arangoQueryManagementTable",titles:["ID","Query String","Runtime","Started",""],rows:[],unescaped:[!1,!1,!1,!1,!0]},deleteRunningQueryModal:function(a){this.killQueryId=$(a.currentTarget).attr("data-id");var b=[],c=[];c.push(window.modalView.createReadOnlyEntry(void 0,"Running Query","Do you want to kill the running query?",void 0,void 0,!1,void 0)),b.push(window.modalView.createDeleteButton("Kill",this.killRunningQuery.bind(this))),window.modalView.show("modalTable.ejs","Kill Running Query",b,c),$(".modal-delete-confirmation strong").html("Really kill?")},killRunningQuery:function(){this.collection.killRunningQuery(this.killQueryId,this.killRunningQueryCallback.bind(this)),window.modalView.hide()},killRunningQueryCallback:function(){this.convertModelToJSON(!0),this.renderActive()},deleteSlowQueryHistoryModal:function(){var a=[],b=[];b.push(window.modalView.createReadOnlyEntry(void 0,"Slow Query Log","Do you want to delete the slow query log entries?",void 0,void 0,!1,void 0)), -a.push(window.modalView.createDeleteButton("Delete",this.deleteSlowQueryHistory.bind(this))),window.modalView.show("modalTable.ejs","Delete Slow Query Log",a,b)},deleteSlowQueryHistory:function(){this.collection.deleteSlowQueryHistory(this.slowQueryCallback.bind(this)),window.modalView.hide()},slowQueryCallback:function(){this.convertModelToJSON(!1),this.renderSlow()},render:function(){var a=arangoHelper.getCurrentSub();a.params.active?(this.active=!0,this.convertModelToJSON(!0)):(this.active=!1,this.convertModelToJSON(!1))},addEvents:function(){var a=this;$("#queryManagementContent tbody").on("mousedown",function(){clearTimeout(a.timer),a.shouldRender=!1}),$("#queryManagementContent tbody").on("mouseup",function(){a.timer=window.setTimeout(function(){a.shouldRender=!0},3e3)})},renderActive:function(){this.$el.html(this.templateActive.render({})),$(this.id).append(this.table.render({content:this.tableDescription})),$("#activequeries").addClass("arango-active-tab"),this.addEvents()},renderSlow:function(){this.$el.html(this.templateSlow.render({})),$(this.id).append(this.table.render({content:this.tableDescription})),$("#slowqueries").addClass("arango-active-tab"),this.addEvents()},convertModelToJSON:function(a){var b=this,c=[];a===!0?this.collection=this.activeCollection:this.collection=this.slowCollection,this.collection.fetch({success:function(){b.collection.each(function(b){var d="";a&&(d=''),c.push([b.get("id"),b.get("query"),b.get("runTime").toFixed(2)+" s",b.get("started"),d])});var d="No running queries.";a||(d="No slow queries."),0===c.length&&c.push([d,"","","",""]),b.tableDescription.rows=c,a?b.renderActive():b.renderSlow()}})}})}(),function(){"use strict";window.QueryView=Backbone.View.extend({el:"#content",bindParamId:"#bindParamEditor",myQueriesId:"#queryTable",template:templateEngine.createTemplate("queryView.ejs"),table:templateEngine.createTemplate("arangoTable.ejs"),outputDiv:"#outputEditors",outputTemplate:templateEngine.createTemplate("queryViewOutput.ejs"),outputCounter:0,allowUpload:!1,customQueries:[],queries:[],state:{lastQuery:{query:void 0,bindParam:void 0}},graphs:[],settings:{aqlWidth:void 0},currentQuery:{},initDone:!1,bindParamRegExp:/@(@?\w+\d*)/,bindParamTableObj:{},bindParamTableDesc:{id:"arangoBindParamTable",titles:["Key","Value"],rows:[]},myQueriesTableDesc:{id:"arangoMyQueriesTable",titles:["Name","Actions"],rows:[]},execPending:!1,aqlEditor:null,queryPreview:null,initialize:function(){this.refreshAQL()},allowParamToggle:!0,events:{"click #executeQuery":"executeQuery","click #explainQuery":"explainQuery","click #clearQuery":"clearQuery","click .outputEditorWrapper #downloadQueryResult":"downloadQueryResult","click .outputEditorWrapper .switchAce span":"switchAce","click .outputEditorWrapper .fa-close":"closeResult","click #toggleQueries1":"toggleQueries","click #toggleQueries2":"toggleQueries","click #saveCurrentQuery":"addAQL","click #exportQuery":"exportCustomQueries","click #importQuery":"openImportDialog","click #removeResults":"removeResults","click #querySpotlight":"showSpotlight","click #deleteQuery":"selectAndDeleteQueryFromTable","click #explQuery":"selectAndExplainQueryFromTable","keydown #arangoBindParamTable input":"updateBindParams","change #arangoBindParamTable input":"updateBindParams","click #arangoMyQueriesTable tbody tr":"showQueryPreview","dblclick #arangoMyQueriesTable tbody tr":"selectQueryFromTable","click #arangoMyQueriesTable #copyQuery":"selectQueryFromTable","click #closeQueryModal":"closeExportDialog","click #confirmQueryImport":"importCustomQueries","click #switchTypes":"toggleBindParams","click #arangoMyQueriesTable #runQuery":"selectAndRunQueryFromTable"},clearQuery:function(){this.aqlEditor.setValue("",1)},toggleBindParams:function(){this.allowParamToggle?($("#bindParamEditor").toggle(),$("#bindParamAceEditor").toggle(),"JSON"===$("#switchTypes").text()?($("#switchTypes").text("Table"),this.updateQueryTable(),this.bindParamAceEditor.setValue(JSON.stringify(this.bindParamTableObj,null," "),1),this.deselect(this.bindParamAceEditor)):($("#switchTypes").text("JSON"),this.renderBindParamTable())):arangoHelper.arangoError("Bind parameter","Could not parse bind parameter"),this.resize()},openExportDialog:function(){$("#queryImportDialog").modal("show")},closeExportDialog:function(){$("#queryImportDialog").modal("hide")},initQueryImport:function(){var a=this;a.allowUpload=!1,$("#importQueries").change(function(b){a.files=b.target.files||b.dataTransfer.files,a.file=a.files[0],a.allowUpload=!0,$("#confirmQueryImport").removeClass("disabled")})},importCustomQueries:function(){var a=this;if(this.allowUpload===!0){var b=function(){this.collection.fetch({success:function(){a.updateLocalQueries(),a.updateQueryTable(),a.resize(),a.allowUpload=!1,$("#confirmQueryImport").addClass("disabled"),$("#queryImportDialog").modal("hide")},error:function(a){arangoHelper.arangoError("Custom Queries",a.responseText)}})}.bind(this);a.collection.saveImportQueries(a.file,b.bind(this))}},removeResults:function(){$(".outputEditorWrapper").hide("fast",function(){$(".outputEditorWrapper").remove()}),$("#removeResults").hide()},getCustomQueryParameterByName:function(a){return this.collection.findWhere({name:a}).get("parameter")},getCustomQueryValueByName:function(a){var b;return a&&(b=this.collection.findWhere({name:a})),b?b=b.get("value"):_.each(this.queries,function(c){c.name===a&&(b=c.value)}),b},openImportDialog:function(){$("#queryImportDialog").modal("show")},closeImportDialog:function(){$("#queryImportDialog").modal("hide")},exportCustomQueries:function(){var a;$.ajax("whoAmI?_="+Date.now()).success(function(b){a=b.user,null!==a&&a!==!1||(a="root");var c="query/download/"+encodeURIComponent(a);arangoHelper.download(c)})},toggleQueries:function(a){a&&"toggleQueries1"===a.currentTarget.id?(this.updateQueryTable(),$("#bindParamAceEditor").hide(),$("#bindParamEditor").show(),$("#switchTypes").text("JSON"),$(".aqlEditorWrapper").first().width(.33*$(window).width()),this.queryPreview.setValue("No query selected.",1),this.deselect(this.queryPreview)):void 0===this.settings.aqlWidth?$(".aqlEditorWrapper").first().width(.33*$(window).width()):$(".aqlEditorWrapper").first().width(this.settings.aqlWidth),this.resize();var b=["aqlEditor","queryTable","previewWrapper","querySpotlight","bindParamEditor","toggleQueries1","toggleQueries2","saveCurrentQuery","querySize","executeQuery","switchTypes","explainQuery","importQuery","exportQuery"];_.each(b,function(a){$("#"+a).toggle()}),this.resize()},showQueryPreview:function(a){$("#arangoMyQueriesTable tr").removeClass("selected"),$(a.currentTarget).addClass("selected");var b=this.getQueryNameFromTable(a);this.queryPreview.setValue(this.getCustomQueryValueByName(b),1),this.deselect(this.queryPreview)},getQueryNameFromTable:function(a){var b;return $(a.currentTarget).is("tr")?b=$(a.currentTarget).children().first().text():$(a.currentTarget).is("span")&&(b=$(a.currentTarget).parent().parent().prev().text()),b},deleteQueryModal:function(a){var b=[],c=[];c.push(window.modalView.createReadOnlyEntry(void 0,a,"Do you want to delete the query?",void 0,void 0,!1,void 0)),b.push(window.modalView.createDeleteButton("Delete",this.deleteAQL.bind(this,a))),window.modalView.show("modalTable.ejs","Delete Query",b,c)},selectAndDeleteQueryFromTable:function(a){var b=this.getQueryNameFromTable(a);this.deleteQueryModal(b)},selectAndExplainQueryFromTable:function(a){this.selectQueryFromTable(a,!1),this.explainQuery()},selectAndRunQueryFromTable:function(a){this.selectQueryFromTable(a,!1),this.executeQuery()},selectQueryFromTable:function(a,b){var c=this.getQueryNameFromTable(a),d=this;void 0===b&&this.toggleQueries(),this.state.lastQuery.query=this.aqlEditor.getValue(),this.state.lastQuery.bindParam=this.bindParamTableObj,this.aqlEditor.setValue(this.getCustomQueryValueByName(c),1),this.fillBindParamTable(this.getCustomQueryParameterByName(c)),this.updateBindParams(),$("#lastQuery").remove(),$("#queryContent .arangoToolbarTop .pull-left").append('Previous Query'),$("#lastQuery").hide().fadeIn(500).on("click",function(){d.aqlEditor.setValue(d.state.lastQuery.query,1),d.fillBindParamTable(d.state.lastQuery.bindParam),d.updateBindParams(),$("#lastQuery").fadeOut(500,function(){$(this).remove()})})},deleteAQL:function(a){var b=function(a){a?arangoHelper.arangoError("Query","Could not delete query."):(this.updateLocalQueries(),this.updateQueryTable(),this.resize(),window.modalView.hide())}.bind(this),c=this.collection.findWhere({name:a});this.collection.remove(c),this.collection.saveCollectionQueries(b)},switchAce:function(a){var b=$(a.currentTarget).attr("counter"),c=a.currentTarget;if(!$(c).hasClass("disabled")){_.each($(c).parent().children(),function(a){$(a).removeClass("active")});var d=$(c).attr("val");$(c).addClass("active"),$(c).text(d.charAt(0).toUpperCase()+d.slice(1)),"JSON"===d?($("#outputEditor"+b).show(),$("#sentWrapper"+b).hide(),$("#outputGraph"+b).hide(),$("#outputTable"+b).hide()):"AQL"===d?($("#sentWrapper"+b).show(),$("#outputEditor"+b).hide(),$("#outputGraph"+b).hide(),$("#outputTable"+b).hide()):"Table"===d?($("#outputTable"+b).show(),$("#outputGraph"+b).hide(),$("#outputEditor"+b).hide(),$("#sentWrapper"+b).hide()):"Graph"===d&&($("#outputGraph"+b).show(),$("#outputTable"+b).hide(),$("#outputEditor"+b).hide(),$("#sentWrapper"+b).hide()),this.deselect(ace.edit("outputEditor"+b)),this.deselect(ace.edit("sentQueryEditor"+b)),this.deselect(ace.edit("sentBindParamEditor"+b))}},downloadQueryResult:function(a){var b=$(a.currentTarget).attr("counter"),c=ace.edit("sentQueryEditor"+b),d=c.getValue();if(""!==d||void 0!==d||null!==d){var e;e=0===Object.keys(this.bindParamTableObj).length?"query/result/download/"+encodeURIComponent(btoa(JSON.stringify({query:d}))):"query/result/download/"+encodeURIComponent(btoa(JSON.stringify({query:d,bindVars:this.bindParamTableObj}))),arangoHelper.download(e)}else arangoHelper.arangoError("Query error","could not query result.")},explainQuery:function(){if(!this.verifyQueryAndParams()){this.$(this.outputDiv).prepend(this.outputTemplate.render({counter:this.outputCounter,type:"Explain"}));var a=this.outputCounter,b=ace.edit("outputEditor"+a),c=ace.edit("sentQueryEditor"+a),d=ace.edit("sentBindParamEditor"+a);c.getSession().setMode("ace/mode/aql"),c.setOption("vScrollBarAlwaysVisible",!0),c.setReadOnly(!0),this.setEditorAutoHeight(c),b.setReadOnly(!0),b.getSession().setMode("ace/mode/json"),b.setOption("vScrollBarAlwaysVisible",!0),this.setEditorAutoHeight(b),d.setValue(JSON.stringify(this.bindParamTableObj),1),d.setOption("vScrollBarAlwaysVisible",!0),d.getSession().setMode("ace/mode/json"),d.setReadOnly(!0),this.setEditorAutoHeight(d),this.fillExplain(b,c,a),this.outputCounter++}},fillExplain:function(a,b,c){b.setValue(this.aqlEditor.getValue(),1);var d=this,e=this.readQueryData();if($("#outputEditorWrapper"+c+" .queryExecutionTime").text(""),this.execPending=!1,e){var f=function(){$("#outputEditorWrapper"+c+" #spinner").remove(),$("#outputEditor"+c).css("opacity","1"),$("#outputEditorWrapper"+c+" .fa-close").show(),$("#outputEditorWrapper"+c+" .switchAce").show()};$.ajax({type:"POST",url:arangoHelper.databaseUrl("/_admin/aardvark/query/explain/"),data:e,contentType:"application/json",processData:!1,success:function(b){b.msg.includes("errorMessage")?(d.removeOutputEditor(c),arangoHelper.arangoError("Explain",b.msg)):(a.setValue(b.msg,1),d.deselect(a),$.noty.clearQueue(),$.noty.closeAll(),d.handleResult(c)),f()},error:function(a){try{var b=JSON.parse(a.responseText);arangoHelper.arangoError("Explain",b.errorMessage)}catch(e){arangoHelper.arangoError("Explain","ERROR")}d.handleResult(c),d.removeOutputEditor(c),f()}})}},removeOutputEditor:function(a){$("#outputEditorWrapper"+a).hide(),$("#outputEditorWrapper"+a).remove(),0===$(".outputEditorWrapper").length&&$("#removeResults").hide()},getCachedQueryAfterRender:function(){var a=this.getCachedQuery(),b=this;if(null!==a&&void 0!==a&&""!==a&&(this.aqlEditor.setValue(a.query,1),this.aqlEditor.getSession().setUndoManager(new ace.UndoManager),""!==a.parameter||void 0!==a))try{b.bindParamTableObj=JSON.parse(a.parameter);var c;_.each($("#arangoBindParamTable input"),function(a){c=$(a).attr("name"),$(a).val(b.bindParamTableObj[c])}),b.setCachedQuery(b.aqlEditor.getValue(),JSON.stringify(b.bindParamTableObj))}catch(d){}},getCachedQuery:function(){if("undefined"!==Storage){var a=localStorage.getItem("cachedQuery");if(void 0!==a){var b=JSON.parse(a);this.currentQuery=b;try{this.bindParamTableObj=JSON.parse(b.parameter)}catch(c){}return b}}},setCachedQuery:function(a,b){if("undefined"!==Storage){var c={query:a,parameter:b};this.currentQuery=c,localStorage.setItem("cachedQuery",JSON.stringify(c))}},closeResult:function(a){var b=$("#"+$(a.currentTarget).attr("element")).parent();$(b).hide("fast",function(){$(b).remove(),0===$(".outputEditorWrapper").length&&$("#removeResults").hide()})},fillSelectBoxes:function(){var a=1e3,b=$("#querySize");b.empty(),[100,250,500,1e3,2500,5e3,1e4,"all"].forEach(function(c){b.append('")})},render:function(){this.$el.html(this.template.render({})),this.afterRender(),this.initDone||(this.settings.aqlWidth=$(".aqlEditorWrapper").width()),this.initDone=!0,this.renderBindParamTable(!0)},afterRender:function(){var a=this;this.initAce(),this.initTables(),this.fillSelectBoxes(),this.makeResizeable(),this.initQueryImport(),this.getCachedQueryAfterRender(),$(".inputEditorWrapper").height($(window).height()/10*5+25),window.setTimeout(function(){a.resize()},10),a.deselect(a.aqlEditor)},showSpotlight:function(a){var b,c;if(void 0!==a&&"click"!==a.type||(a="aql"),"aql"===a)b=function(a){this.aqlEditor.insert(a),$("#aqlEditor .ace_text-input").focus()}.bind(this),c=function(){$("#aqlEditor .ace_text-input").focus()};else{var d=$(":focus");b=function(a){var b=$(d).val();$(d).val(b+a),$(d).focus()},c=function(){$(d).focus()}}window.spotlightView.show(b,c,a)},resize:function(){this.resizeFunction()},resizeFunction:function(){$("#toggleQueries1").is(":visible")?(this.aqlEditor.resize(),$("#arangoBindParamTable thead").css("width",$("#bindParamEditor").width()),$("#arangoBindParamTable thead th").css("width",$("#bindParamEditor").width()/2),$("#arangoBindParamTable tr").css("width",$("#bindParamEditor").width()),$("#arangoBindParamTable tbody").css("height",$("#aqlEditor").height()-35),$("#arangoBindParamTable tbody").css("width",$("#bindParamEditor").width()),$("#arangoBindParamTable tbody tr").css("width",$("#bindParamEditor").width()),$("#arangoBindParamTable tbody td").css("width",$("#bindParamEditor").width()/2)):(this.queryPreview.resize(),$("#arangoMyQueriesTable thead").css("width",$("#queryTable").width()),$("#arangoMyQueriesTable thead th").css("width",$("#queryTable").width()/2),$("#arangoMyQueriesTable tr").css("width",$("#queryTable").width()),$("#arangoMyQueriesTable tbody").css("height",$("#queryTable").height()-35),$("#arangoMyQueriesTable tbody").css("width",$("#queryTable").width()),$("#arangoMyQueriesTable tbody td").css("width",$("#queryTable").width()/2))},makeResizeable:function(){var a=this;$(".aqlEditorWrapper").resizable({resize:function(){a.resizeFunction(),a.settings.aqlWidth=$(".aqlEditorWrapper").width()},handles:"e"}),$(".inputEditorWrapper").resizable({resize:function(){a.resizeFunction()},handles:"s"}),this.resizeFunction()},initTables:function(){this.$(this.bindParamId).html(this.table.render({content:this.bindParamTableDesc})),this.$(this.myQueriesId).html(this.table.render({content:this.myQueriesTableDesc}))},checkType:function(a){var b="stringtype";try{a=JSON.parse(a),b=a instanceof Array?"arraytype":typeof a+"type"}catch(c){}return b},updateBindParams:function(a){var b,c=this;if(a){b=$(a.currentTarget).attr("name"),this.bindParamTableObj[b]=arangoHelper.parseInput(a.currentTarget);var d=["arraytype","objecttype","booleantype","numbertype","stringtype"];_.each(d,function(b){$(a.currentTarget).removeClass(b)}),$(a.currentTarget).addClass(c.checkType($(a.currentTarget).val()))}else _.each($("#arangoBindParamTable input"),function(a){b=$(a).attr("name"),c.bindParamTableObj[b]=arangoHelper.parseInput(a)});this.setCachedQuery(this.aqlEditor.getValue(),JSON.stringify(this.bindParamTableObj)),a&&((a.ctrlKey||a.metaKey)&&13===a.keyCode&&(a.preventDefault(),this.executeQuery()),(a.ctrlKey||a.metaKey)&&32===a.keyCode&&(a.preventDefault(),this.showSpotlight("bind")))},parseQuery:function(a){var b=0,c=1,d=2,e=3,f=4,g=5,h=6,i=7;a+=" ";var j,k,l,m=this,n=b,o=a.length,p=[];for(k=0;o>k;++k)switch(l=a.charAt(k),n){case b:"@"===l?(n=h,j=k):"'"===l?n=c:'"'===l?n=d:"`"===l?n=e:"´"===l?n=i:"/"===l&&o>k+1&&("/"===a.charAt(k+1)?(n=f,++k):"*"===a.charAt(k+1)&&(n=g,++k));break;case f:"\r"!==l&&"\n"!==l||(n=b);break;case g:"*"===l&&o>=k+1&&"/"===a.charAt(k+1)&&(n=b,++k);break;case c:"\\"===l?++k:"'"===l&&(n=b);break;case d:"\\"===l?++k:'"'===l&&(n=b);break;case e:"`"===l&&(n=b);break;case i:"´"===l&&(n=b);break;case h:/^[@a-zA-Z0-9_]+$/.test(l)||(p.push(a.substring(j,k)),n=b,j=void 0)}var q;return _.each(p,function(a,b){q=a.match(m.bindParamRegExp),q&&(p[b]=q[1])}),{query:a,bindParams:p}},checkForNewBindParams:function(){var a=this,b=this.parseQuery(this.aqlEditor.getValue()).bindParams,c={};_.each(b,function(b){a.bindParamTableObj[b]?c[b]=a.bindParamTableObj[b]:c[b]=""}),Object.keys(b).forEach(function(b){Object.keys(a.bindParamTableObj).forEach(function(d){b===d&&(c[b]=a.bindParamTableObj[d])})}),a.bindParamTableObj=c},renderBindParamTable:function(a){$("#arangoBindParamTable tbody").html(""),a&&this.getCachedQuery();var b=0;_.each(this.bindParamTableObj,function(a,c){$("#arangoBindParamTable tbody").append(""+c+"'),b++,_.each($("#arangoBindParamTable input"),function(b){$(b).attr("name")===c&&(a instanceof Array?$(b).val(JSON.stringify(a)).addClass("arraytype"):"object"==typeof a?$(b).val(JSON.stringify(a)).addClass(typeof a+"type"):$(b).val(a).addClass(typeof a+"type"))})}),0===b&&$("#arangoBindParamTable tbody").append('No bind parameters defined.')},fillBindParamTable:function(a){_.each(a,function(a,b){_.each($("#arangoBindParamTable input"),function(c){$(c).attr("name")===b&&$(c).val(a)})})},initAce:function(){var a=this;this.aqlEditor=ace.edit("aqlEditor"),this.aqlEditor.getSession().setMode("ace/mode/aql"),this.aqlEditor.setFontSize("10pt"),this.aqlEditor.setShowPrintMargin(!1),this.bindParamAceEditor=ace.edit("bindParamAceEditor"),this.bindParamAceEditor.getSession().setMode("ace/mode/json"),this.bindParamAceEditor.setFontSize("10pt"),this.bindParamAceEditor.setShowPrintMargin(!1),this.bindParamAceEditor.getSession().on("change",function(){try{a.bindParamTableObj=JSON.parse(a.bindParamAceEditor.getValue()),a.allowParamToggle=!0,a.setCachedQuery(a.aqlEditor.getValue(),JSON.stringify(a.bindParamTableObj))}catch(b){""===a.bindParamAceEditor.getValue()?(_.each(a.bindParamTableObj,function(b,c){a.bindParamTableObj[c]=""}),a.allowParamToggle=!0):a.allowParamToggle=!1}}),this.aqlEditor.getSession().on("change",function(){a.checkForNewBindParams(),a.renderBindParamTable(),a.initDone&&a.setCachedQuery(a.aqlEditor.getValue(),JSON.stringify(a.bindParamTableObj)),a.bindParamAceEditor.setValue(JSON.stringify(a.bindParamTableObj,null," "),1),$("#aqlEditor .ace_text-input").focus(),a.resize()}),this.aqlEditor.commands.addCommand({name:"togglecomment",bindKey:{win:"Ctrl-Shift-C",linux:"Ctrl-Shift-C",mac:"Command-Shift-C"},exec:function(a){a.toggleCommentLines()},multiSelectAction:"forEach"}),this.aqlEditor.commands.addCommand({name:"executeQuery",bindKey:{win:"Ctrl-Return",mac:"Command-Return",linux:"Ctrl-Return"},exec:function(){a.executeQuery()}}),this.aqlEditor.commands.addCommand({name:"saveQuery",bindKey:{win:"Ctrl-Shift-S",mac:"Command-Shift-S",linux:"Ctrl-Shift-S"},exec:function(){a.addAQL()}}),this.aqlEditor.commands.addCommand({name:"explainQuery",bindKey:{win:"Ctrl-Shift-Return",mac:"Command-Shift-Return",linux:"Ctrl-Shift-Return"},exec:function(){a.explainQuery()}}),this.aqlEditor.commands.addCommand({name:"togglecomment",bindKey:{win:"Ctrl-Shift-C",linux:"Ctrl-Shift-C",mac:"Command-Shift-C"},exec:function(a){a.toggleCommentLines()},multiSelectAction:"forEach"}),this.aqlEditor.commands.addCommand({name:"showSpotlight",bindKey:{win:"Ctrl-Space",mac:"Ctrl-Space",linux:"Ctrl-Space"},exec:function(){a.showSpotlight()}}),this.queryPreview=ace.edit("queryPreview"),this.queryPreview.getSession().setMode("ace/mode/aql"),this.queryPreview.setReadOnly(!0),this.queryPreview.setFontSize("13px"),$("#aqlEditor .ace_text-input").focus()},updateQueryTable:function(){function a(a,b){var c;return c=a.nameb.name?1:0}var b=this;this.updateLocalQueries(),this.myQueriesTableDesc.rows=this.customQueries,_.each(this.myQueriesTableDesc.rows,function(a){a.secondRow='
    ',a.hasOwnProperty("parameter")&&delete a.parameter,delete a.value}),this.myQueriesTableDesc.rows.sort(a),_.each(this.queries,function(a){a.hasOwnProperty("parameter")&&delete a.parameter,b.myQueriesTableDesc.rows.push({name:a.name,thirdRow:''})}),this.myQueriesTableDesc.unescaped=[!1,!0,!0],this.$(this.myQueriesId).html(this.table.render({content:this.myQueriesTableDesc}))},listenKey:function(a){13===a.keyCode&&"Update"===$("#modalButton1").html()&&this.saveAQL(),this.checkSaveName()},addAQL:function(){this.refreshAQL(!0),this.createCustomQueryModal(),setTimeout(function(){$("#new-query-name").focus()},500)},createCustomQueryModal:function(){var a=[],b=[];b.push(window.modalView.createTextEntry("new-query-name","Name","",void 0,void 0,!1,[{rule:Joi.string().required(),msg:"No query name given."}])),a.push(window.modalView.createSuccessButton("Save",this.saveAQL.bind(this))),window.modalView.show("modalTable.ejs","Save Query",a,b,void 0,void 0,{"keyup #new-query-name":this.listenKey.bind(this)})},checkSaveName:function(){var a=$("#new-query-name").val();if("Insert Query"===a)return void $("#new-query-name").val("");var b=this.customQueries.some(function(b){return b.name===a});b?($("#modalButton1").removeClass("button-success"),$("#modalButton1").addClass("button-warning"),$("#modalButton1").text("Update")):($("#modalButton1").removeClass("button-warning"),$("#modalButton1").addClass("button-success"),$("#modalButton1").text("Save"))},saveAQL:function(a){a&&a.stopPropagation(),this.refreshAQL();var b=$("#new-query-name").val(),c=this.bindParamTableObj;if(!$("#new-query-name").hasClass("invalid-input")&&""!==b.trim()){var d=this.aqlEditor.getValue(),e=!1;if(_.each(this.customQueries,function(a){return a.name===b?(a.value=d,void(e=!0)):void 0}),e===!0)this.collection.findWhere({name:b}).set("value",d);else{if(""!==c&&void 0!==c||(c="{}"),"string"==typeof c)try{c=JSON.parse(c)}catch(f){arangoHelper.arangoError("Query","Could not parse bind parameter")}this.collection.add({name:b,parameter:c,value:d})}var g=function(a){if(a)arangoHelper.arangoError("Query","Could not save query");else{var b=this;this.collection.fetch({success:function(){b.updateLocalQueries()}})}}.bind(this);this.collection.saveCollectionQueries(g),window.modalView.hide()}},verifyQueryAndParams:function(){var a=!1;0===this.aqlEditor.getValue().length&&(arangoHelper.arangoError("Query","Your query is empty"),a=!0);var b=[];return _.each(this.bindParamTableObj,function(c,d){""===c&&(a=!0,b.push(d))}),b.length>0&&arangoHelper.arangoError("Bind Parameter",JSON.stringify(b)+" not defined."),a},executeQuery:function(){if(!this.verifyQueryAndParams()){this.$(this.outputDiv).prepend(this.outputTemplate.render({counter:this.outputCounter,type:"Query"})),$("#outputEditorWrapper"+this.outputCounter).hide(),$("#outputEditorWrapper"+this.outputCounter).show("fast");var a=this.outputCounter,b=ace.edit("outputEditor"+a),c=ace.edit("sentQueryEditor"+a),d=ace.edit("sentBindParamEditor"+a);c.getSession().setMode("ace/mode/aql"),c.setOption("vScrollBarAlwaysVisible",!0),c.setFontSize("13px"),c.setReadOnly(!0),this.setEditorAutoHeight(c),b.setFontSize("13px"),b.getSession().setMode("ace/mode/json"),b.setReadOnly(!0),b.setOption("vScrollBarAlwaysVisible",!0),b.setShowPrintMargin(!1),this.setEditorAutoHeight(b),d.setValue(JSON.stringify(this.bindParamTableObj),1),d.setOption("vScrollBarAlwaysVisible",!0),d.getSession().setMode("ace/mode/json"),d.setReadOnly(!0),this.setEditorAutoHeight(d),this.fillResult(b,c,a),this.outputCounter++}},readQueryData:function(){var a=$("#querySize"),b={query:this.aqlEditor.getValue(),id:"currentFrontendQuery"};return"all"===a.val()?b.batchSize=1e6:b.batchSize=parseInt(a.val(),10),Object.keys(this.bindParamTableObj).length>0&&(b.bindVars=this.bindParamTableObj),JSON.stringify(b)},fillResult:function(a,b,c){var d=this,e=this.readQueryData();e&&(b.setValue(d.aqlEditor.getValue(),1),$.ajax({type:"POST",url:arangoHelper.databaseUrl("/_api/cursor"),headers:{"x-arango-async":"store"},data:e,contentType:"application/json",processData:!1,success:function(b,e,f){f.getResponseHeader("x-arango-async-id")&&d.queryCallbackFunction(f.getResponseHeader("x-arango-async-id"),a,c),$.noty.clearQueue(),$.noty.closeAll(),d.handleResult(c)},error:function(a){try{var b=JSON.parse(a.responseText);arangoHelper.arangoError("["+b.errorNum+"]",b.errorMessage)}catch(e){arangoHelper.arangoError("Query error","ERROR")}d.handleResult(c)}}))},handleResult:function(){var a=this;window.progressView.hide(),$("#removeResults").show(),window.setTimeout(function(){a.aqlEditor.focus()},300),$(".centralRow").animate({scrollTop:$("#queryContent").height()},"fast")},setEditorAutoHeight:function(a){var b=$(".centralRow").height(),c=(b-250)/17;a.setOptions({maxLines:c,minLines:10})},deselect:function(a){var b=a.getSelection(),c=b.lead.row,d=b.lead.column;b.setSelectionRange({start:{row:c,column:d},end:{row:c,column:d}}),a.focus()},queryCallbackFunction:function(a,b,c){var d=this,e=function(a,b){$.ajax({url:arangoHelper.databaseUrl("/_api/job/"+encodeURIComponent(a)+"/cancel"),type:"PUT",success:function(){window.clearTimeout(d.checkQueryTimer),$("#outputEditorWrapper"+b).remove(),arangoHelper.arangoNotification("Query","Query canceled.")}})};$("#outputEditorWrapper"+c+" #cancelCurrentQuery").bind("click",function(){e(a,c)}),$("#outputEditorWrapper"+c+" #copy2aqlEditor").bind("click",function(){$("#toggleQueries1").is(":visible")||d.toggleQueries();var a=ace.edit("sentQueryEditor"+c).getValue(),b=JSON.parse(ace.edit("sentBindParamEditor"+c).getValue());d.aqlEditor.setValue(a,1),d.deselect(d.aqlEditor),Object.keys(b).length>0&&(d.bindParamTableObj=b,d.setCachedQuery(d.aqlEditor.getValue(),JSON.stringify(d.bindParamTableObj)),$("#bindParamEditor").is(":visible")?d.renderBindParamTable():(d.bindParamAceEditor.setValue(JSON.stringify(b),1),d.deselect(d.bindParamAceEditor))),$(".centralRow").animate({scrollTop:0},"fast"),d.resize()}),this.execPending=!1;var f=function(a){var c="";a.extra&&a.extra.warnings&&a.extra.warnings.length>0&&(c+="Warnings:\r\n\r\n",a.extra.warnings.forEach(function(a){c+="["+a.code+"], '"+a.message+"'\r\n"})),""!==c&&(c+="\r\nResult:\r\n\r\n"),b.setValue(c+JSON.stringify(a.result,void 0,2),1),b.getSession().setScrollTop(0)},g=function(a){f(a),window.progressView.hide();var e=d.analyseQuery(a.result);if(console.log("Using "+e.defaultType+" as data format."),"table"===e.defaultType){$("#outputEditorWrapper"+c+" .arangoToolbarTop").after('
    '),$("#outputTable"+c).show(),d.renderOutputTable(e,c);var g=$(".centralRow").height()-250;$(".outputEditorWrapper .tableWrapper").css("max-height",g),$("#outputEditor"+c).hide()}else"graph"===e.defaultType&&($("#outputEditorWrapper"+c+" .arangoToolbarTop").after('
    '),$("#outputGraph"+c).show(),d.renderOutputGraph(e,c),$("#outputEditor"+c).hide());$("#"+e.defaultType+"-switch").addClass("active").css("display","inline");var h=function(a,b,d){d||(d=""),$("#outputEditorWrapper"+c+" .arangoToolbarTop .pull-left").append(''+a+"")};$("#outputEditorWrapper"+c+" .pull-left #spinner").remove();var i="-";a&&a.extra&&a.extra.stats&&(i=a.extra.stats.executionTime.toFixed(3)+" s"),h(a.result.length+" elements","fa-calculator"),h(i,"fa-clock-o"),a.extra&&a.extra.stats&&(a.extra.stats.writesExecuted>0||a.extra.stats.writesIgnored>0)&&(h(a.extra.stats.writesExecuted+" writes","fa-check-circle positive"),0===a.extra.stats.writesIgnored?h(a.extra.stats.writesIgnored+" writes ignored","fa-check-circle positive","additional"):h(a.extra.stats.writesIgnored+" writes ignored","fa-exclamation-circle warning","additional")),$("#outputEditorWrapper"+c+" .switchAce").show(),$("#outputEditorWrapper"+c+" .fa-close").show(),$("#outputEditor"+c).css("opacity","1"),$("#outputEditorWrapper"+c+" #downloadQueryResult").show(),$("#outputEditorWrapper"+c+" #copy2aqlEditor").show(),$("#outputEditorWrapper"+c+" #cancelCurrentQuery").remove(),d.setEditorAutoHeight(b),d.deselect(b),a.id&&$.ajax({url:"/_api/cursor/"+encodeURIComponent(a.id),type:"DELETE"})},h=function(){$.ajax({type:"PUT",url:arangoHelper.databaseUrl("/_api/job/"+encodeURIComponent(a)),contentType:"application/json",processData:!1,success:function(a,b,c){201===c.status?g(a):204===c.status&&(d.checkQueryTimer=window.setTimeout(function(){h()},500))},error:function(a){var b;try{if("Gone"===a.statusText)return arangoHelper.arangoNotification("Query","Query execution aborted."),void d.removeOutputEditor(c);b=JSON.parse(a.responseText),arangoHelper.arangoError("Query",b.errorMessage),b.errorMessage&&(null!==b.errorMessage.match(/\d+:\d+/g)?d.markPositionError(b.errorMessage.match(/'.*'/g)[0],b.errorMessage.match(/\d+:\d+/g)[0]):d.markPositionError(b.errorMessage.match(/\(\w+\)/g)[0]),d.removeOutputEditor(c))}catch(e){if(d.removeOutputEditor(c),409===b.code)return;400!==b.code&&404!==b.code&&arangoHelper.arangoNotification("Query","Successfully aborted.")}window.progressView.hide()}})};h()},analyseQuery:function(a){var b={defaultType:null,original:a,modified:null},c=!1;if(a[0])if(a[0].vertices&&a[0].edges){var d=0,e=0;_.each(a,function(a){a.edges&&(e+=a.edges.length,_.each(a.edges,function(a){a._from&&a._to&&d++}))});var f=d/e*100;f>=95&&(c=!0,b.defaultType="graph",b.graphInfo="object")}else{var g=0,h=a.length;_.each(a,function(a){a._from&&a._to&&g++});var i=g/h*100;i>=95&&(c=!0,b.defaultType="graph",b.graphInfo="array")}if(!c){var j,k=0,l=!0,m={};if(a.length<=1&&(l=!1),l){_.each(a,function(a){j=_.keys(a).length,j>k&&(k=j),_.each(a,function(a,b){m[b]?m[b]=m[b]+1:m[b]=1})});var n;_.each(m,function(b,c){n=b/a.length*100,l!==!1&&95>=n&&(l=!1)})}l&&(c=!0,b.defaultType="table")}return c||(b.defaultType="json"),b},markPositionError:function(a,b){var c;b&&(c=b.split(":")[0],a=a.substr(1,a.length-2));var d=this.aqlEditor.find(a);!d&&b&&(this.aqlEditor.selection.moveCursorToPosition({row:c,column:0}),this.aqlEditor.selection.selectLine()),window.setTimeout(function(){$(".ace_start").first().css("background","rgba(255, 129, 129, 0.7)")},100)},refreshAQL:function(){var a=this,b=function(b){b?arangoHelper.arangoError("Query","Could not reload Queries"):(a.updateLocalQueries(),a.updateQueryTable())},c=function(){a.getSystemQueries(b)};this.getAQL(c)},getSystemQueries:function(a){var b=this; -$.ajax({type:"GET",cache:!1,url:"js/arango/aqltemplates.json",contentType:"application/json",processData:!1,success:function(c){a&&a(!1),b.queries=c},error:function(){a&&a(!0),arangoHelper.arangoNotification("Query","Error while loading system templates")}})},updateLocalQueries:function(){var a=this;this.customQueries=[],this.collection.each(function(b){a.customQueries.push({name:b.get("name"),value:b.get("value"),parameter:b.get("parameter")})})},renderOutputTable:function(a,b){var c={id:"outputTableData"+b,titles:[],rows:[]},d=!0,e=[];_.each(a.original,function(a){d===!0&&(c.titles=Object.keys(a),d=!1),_.each(a,function(a){"object"==typeof a&&(a=JSON.stringify(a)),e.push(a)}),c.rows.push(e),e=[]}),$("#outputTable"+b).append(this.table.render({content:c}))},renderOutputGraph:function(a,b){this.graphViewer2=new window.GraphViewer2({name:void 0,documentStore:window.App.arangoDocumentStore,collection:new window.GraphCollection,userConfig:window.App.userConfig,id:"#outputGraph"+b,data:a}),this.graphViewer2.renderAQL()},getAQL:function(a){var b=this;this.collection.fetch({success:function(){var c=localStorage.getItem("customQueries");if(c){var d=JSON.parse(c);_.each(d,function(a){b.collection.add({value:a.value,name:a.name})});var e=function(a){a?arangoHelper.arangoError("Custom Queries","Could not import old local storage queries"):localStorage.removeItem("customQueries")};b.collection.saveCollectionQueries(e)}b.updateLocalQueries(),a&&a()}})}})}(),function(){"use strict";window.ScaleView=Backbone.View.extend({el:"#content",template:templateEngine.createTemplate("scaleView.ejs"),interval:1e4,knownServers:[],events:{"click #addCoord":"addCoord","click #removeCoord":"removeCoord","click #addDBs":"addDBs","click #removeDBs":"removeDBs"},setCoordSize:function(a){var b=this,c={numberOfCoordinators:a};$.ajax({type:"PUT",url:arangoHelper.databaseUrl("/_admin/cluster/numberOfServers"),contentType:"application/json",data:JSON.stringify(c),success:function(){b.updateTable(c)},error:function(){arangoHelper.arangoError("Scale","Could not set coordinator size.")}})},setDBsSize:function(a){var b=this,c={numberOfDBServers:a};$.ajax({type:"PUT",url:arangoHelper.databaseUrl("/_admin/cluster/numberOfServers"),contentType:"application/json",data:JSON.stringify(c),success:function(){b.updateTable(c)},error:function(){arangoHelper.arangoError("Scale","Could not set coordinator size.")}})},addCoord:function(){this.setCoordSize(this.readNumberFromID("#plannedCoords",!0))},removeCoord:function(){this.setCoordSize(this.readNumberFromID("#plannedCoords",!1,!0))},addDBs:function(){this.setDBsSize(this.readNumberFromID("#plannedDBs",!0))},removeDBs:function(){this.setDBsSize(this.readNumberFromID("#plannedDBs",!1,!0))},readNumberFromID:function(a,b,c){var d=$(a).html(),e=!1;try{e=JSON.parse(d)}catch(f){}return b&&e++,c&&1!==e&&e--,e},initialize:function(a){var b=this;clearInterval(this.intervalFunction),window.App.isCluster&&(this.dbServers=a.dbServers,this.coordinators=a.coordinators,this.updateServerTime(),this.intervalFunction=window.setInterval(function(){"#sNodes"===window.location.hash&&b.coordinators.fetch({success:function(){b.dbServers.fetch({success:function(){b.continueRender(!0)}})}})},this.interval))},render:function(){var a=this,b=function(){var b=function(){a.continueRender()};this.waitForDBServers(b)}.bind(this);this.initDoneCoords?b():this.waitForCoordinators(b),window.arangoHelper.buildNodesSubNav("scale")},continueRender:function(a){var b,c,d=this;b=this.coordinators.toJSON(),c=this.dbServers.toJSON(),this.$el.html(this.template.render({runningCoords:b.length,runningDBs:c.length,plannedCoords:void 0,plannedDBs:void 0,initialized:a})),$.ajax({type:"GET",cache:!1,url:arangoHelper.databaseUrl("/_admin/cluster/numberOfServers"),contentType:"application/json",processData:!1,success:function(a){d.updateTable(a)}})},updateTable:function(a){var b='scaling in progress ',c='no scaling process active';a.numberOfCoordinators&&($("#plannedCoords").html(a.numberOfCoordinators),this.coordinators.toJSON().length===a.numberOfCoordinators?$("#statusCoords").html(c):$("#statusCoords").html(b)),a.numberOfDBServers&&($("#plannedDBs").html(a.numberOfDBServers),this.dbServers.toJSON().length===a.numberOfDBServers?$("#statusDBs").html(c):$("#statusDBs").html(b))},waitForDBServers:function(a){var b=this;0===this.dbServers.length?window.setInterval(function(){b.waitForDBServers(a)},300):a()},waitForCoordinators:function(a){var b=this;window.setTimeout(function(){0===b.coordinators.length?b.waitForCoordinators(a):(b.initDoneCoords=!0,a())},200)},updateServerTime:function(){this.serverTime=(new Date).getTime()}})}(),function(){"use strict";window.SettingsView=Backbone.View.extend({el:"#content",initialize:function(a){this.collectionName=a.collectionName,this.model=this.collection},events:{},render:function(){this.breadcrumb(),window.arangoHelper.buildCollectionSubNav(this.collectionName,"Settings"),this.renderSettings()},breadcrumb:function(){$("#subNavigationBar .breadcrumb").html("Collection: "+this.collectionName)},unloadCollection:function(){var a=function(a){a?arangoHelper.arangoError("Collection error",this.model.get("name")+" could not be unloaded."):void 0===a?(this.model.set("status","unloading"),this.render()):"#collections"===window.location.hash?(this.model.set("status","unloaded"),this.render()):arangoHelper.arangoNotification("Collection "+this.model.get("name")+" unloaded.")}.bind(this);this.model.unloadCollection(a),window.modalView.hide()},loadCollection:function(){var a=function(a){a?arangoHelper.arangoError("Collection error",this.model.get("name")+" could not be loaded."):void 0===a?(this.model.set("status","loading"),this.render()):"#collections"===window.location.hash?(this.model.set("status","loaded"),this.render()):arangoHelper.arangoNotification("Collection "+this.model.get("name")+" loaded.")}.bind(this);this.model.loadCollection(a),window.modalView.hide()},truncateCollection:function(){this.model.truncateCollection(),window.modalView.hide()},deleteCollection:function(){this.model.destroy({error:function(){arangoHelper.arangoError("Could not delete collection.")},success:function(){window.App.navigate("#collections",{trigger:!0})}})},saveModifiedCollection:function(){var a=function(a,b){if(a)arangoHelper.arangoError("Error","Could not get coordinator info");else{var c;c=b?this.model.get("name"):$("#change-collection-name").val();var d=this.model.get("status");if("loaded"===d){var e;try{e=JSON.parse(1024*$("#change-collection-size").val()*1024)}catch(f){return arangoHelper.arangoError("Please enter a valid number"),0}var g;try{if(g=JSON.parse($("#change-index-buckets").val()),1>g||parseInt(g,10)!==Math.pow(2,Math.log2(g)))throw new Error("invalid indexBuckets value")}catch(f){return arangoHelper.arangoError("Please enter a valid number of index buckets"),0}var h=function(a){a?arangoHelper.arangoError("Collection error: "+a.responseText):(arangoHelper.arangoNotification("Collection: Successfully changed."),window.App.navigate("#cSettings/"+c,{trigger:!0}))},i=function(a){if(a)arangoHelper.arangoError("Collection error: "+a.responseText);else{var b=$("#change-collection-sync").val();this.model.changeCollection(b,e,g,h)}}.bind(this);frontendConfig.isCluster===!1?this.model.renameCollection(c,i):i()}else if("unloaded"===d)if(this.model.get("name")!==c){var j=function(a,b){a?arangoHelper.arangoError("Collection"+b.responseText):(arangoHelper.arangoNotification("CollectionSuccessfully changed."),window.App.navigate("#cSettings/"+c,{trigger:!0}))};frontendConfig.isCluster===!1?this.model.renameCollection(c,j):j()}else window.modalView.hide()}}.bind(this);window.isCoordinator(a)},renderSettings:function(){var a=function(a,b){if(a)arangoHelper.arangoError("Error","Could not get coordinator info");else{var c=!1;"loaded"===this.model.get("status")&&(c=!0);var d=[],e=[];b||e.push(window.modalView.createTextEntry("change-collection-name","Name",this.model.get("name"),!1,"",!0,[{rule:Joi.string().regex(/^[a-zA-Z]/),msg:"Collection name must always start with a letter."},{rule:Joi.string().regex(/^[a-zA-Z0-9\-_]*$/),msg:'Only Symbols "_" and "-" are allowed.'},{rule:Joi.string().required(),msg:"No collection name given."}]));var f=function(){e.push(window.modalView.createReadOnlyEntry("change-collection-id","ID",this.model.get("id"),"")),e.push(window.modalView.createReadOnlyEntry("change-collection-type","Type",this.model.get("type"),"")),e.push(window.modalView.createReadOnlyEntry("change-collection-status","Status",this.model.get("status"),"")),d.push(window.modalView.createDeleteButton("Delete",this.deleteCollection.bind(this))),d.push(window.modalView.createDeleteButton("Truncate",this.truncateCollection.bind(this))),c?d.push(window.modalView.createNotificationButton("Unload",this.unloadCollection.bind(this))):d.push(window.modalView.createNotificationButton("Load",this.loadCollection.bind(this))),d.push(window.modalView.createSuccessButton("Save",this.saveModifiedCollection.bind(this)));var a=["General","Indices"],b=["modalTable.ejs","indicesView.ejs"];window.modalView.show(b,"Modify Collection",d,e,null,null,this.events,null,a,"content"),$($("#infoTab").children()[1]).remove()}.bind(this);if(c){var g=function(a,b){if(a)arangoHelper.arangoError("Collection","Could not fetch properties");else{var c=b.journalSize/1048576,d=b.indexBuckets,g=b.waitForSync;e.push(window.modalView.createTextEntry("change-collection-size","Journal size",c,"The maximal size of a journal or datafile (in MB). Must be at least 1.","",!0,[{rule:Joi.string().allow("").optional().regex(/^[0-9]*$/),msg:"Must be a number."}])),e.push(window.modalView.createTextEntry("change-index-buckets","Index buckets",d,"The number of index buckets for this collection. Must be at least 1 and a power of 2.","",!0,[{rule:Joi.string().allow("").optional().regex(/^[1-9][0-9]*$/),msg:"Must be a number greater than 1 and a power of 2."}])),e.push(window.modalView.createSelectEntry("change-collection-sync","Wait for sync",g,"Synchronize to disk before returning from a create or update of a document.",[{value:!1,label:"No"},{value:!0,label:"Yes"}]))}f()};this.model.getProperties(g)}else f()}}.bind(this);window.isCoordinator(a)}})}(),function(){"use strict";window.ShardsView=Backbone.View.extend({el:"#content",template:templateEngine.createTemplate("shardsView.ejs"),interval:1e4,knownServers:[],events:{"click #shardsContent .shardLeader span":"moveShard","click #shardsContent .shardFollowers span":"moveShardFollowers","click #rebalanceShards":"rebalanceShards"},initialize:function(a){var b=this;b.dbServers=a.dbServers,clearInterval(this.intervalFunction),window.App.isCluster&&(this.updateServerTime(),this.intervalFunction=window.setInterval(function(){"#shards"===window.location.hash&&b.render(!1)},this.interval))},render:function(a){var b=this;$.ajax({type:"GET",cache:!1,url:arangoHelper.databaseUrl("/_admin/cluster/shardDistribution"),contentType:"application/json",processData:!1,async:!0,success:function(a){var c,d=!1;b.shardDistribution=a.results,_.each(a.results,function(a,b){c=b.substring(0,1),"_"!==c&&"error"!==b&&"code"!==b&&(d=!0)}),d?b.continueRender(a.results):arangoHelper.renderEmpty("No collections and no shards available")},error:function(a){0!==a.readyState&&arangoHelper.arangoError("Cluster","Could not fetch sharding information.")}}),a!==!1&&arangoHelper.buildNodesSubNav("Shards")},moveShardFollowers:function(a){var b=$(a.currentTarget).html();this.moveShard(a,b)},moveShard:function(a,b){var c,d,e,f,g=this,h=window.App.currentDB.get("name");d=$(a.currentTarget).parent().parent().attr("collection"),e=$(a.currentTarget).parent().parent().attr("shard"),b?(f=$(a.currentTarget).parent().parent().attr("leader"),c=b):c=$(a.currentTarget).parent().parent().attr("leader");var i=[],j=[],k={},l=[];return g.dbServers[0].each(function(a){a.get("name")!==c&&(k[a.get("name")]={value:a.get("name"),label:a.get("name")})}),_.each(g.shardDistribution[d].Plan[e].followers,function(a){delete k[a]}),b&&delete k[f],_.each(k,function(a){l.push(a)}),l=l.reverse(),0===l.length?void arangoHelper.arangoMessage("Shards","No database server for moving the shard is available."):(j.push(window.modalView.createSelectEntry("toDBServer","Destination",void 0,"Please select the target databse server. The selected database server will be the new leader of the shard.",l)),i.push(window.modalView.createSuccessButton("Move",this.confirmMoveShards.bind(this,h,d,e,c))),void window.modalView.show("modalTable.ejs","Move shard: "+e,i,j))},confirmMoveShards:function(a,b,c,d){var e=this,f=$("#toDBServer").val(),g={database:a,collection:b,shard:c,fromServer:d,toServer:f};$.ajax({type:"POST",cache:!1,url:arangoHelper.databaseUrl("/_admin/cluster/moveShard"),contentType:"application/json",processData:!1,data:JSON.stringify(g),async:!0,success:function(a){a===!0&&(window.setTimeout(function(){e.render(!1)},1500),arangoHelper.arangoNotification("Shard "+c+" will be moved to "+f+"."))},error:function(){arangoHelper.arangoNotification("Shard "+c+" could not be moved to "+f+".")}}),window.modalView.hide()},rebalanceShards:function(){var a=this;$.ajax({type:"POST",cache:!1,url:arangoHelper.databaseUrl("/_admin/cluster/rebalanceShards"),contentType:"application/json",processData:!1,data:JSON.stringify({}),async:!0,success:function(b){b===!0&&(window.setTimeout(function(){a.render(!1)},1500),arangoHelper.arangoNotification("Started rebalance process."))},error:function(){arangoHelper.arangoNotification("Could not start rebalance process.")}}),window.modalView.hide()},continueRender:function(a){delete a.code,delete a.error,this.$el.html(this.template.render({collections:a}))},updateServerTime:function(){this.serverTime=(new Date).getTime()}})}(),function(){"use strict";window.ShowClusterView=Backbone.View.extend({detailEl:"#modalPlaceholder",el:"#content",defaultFrame:12e5,template:templateEngine.createTemplate("showCluster.ejs"),modal:templateEngine.createTemplate("waitModal.ejs"),detailTemplate:templateEngine.createTemplate("detailView.ejs"),events:{"change #selectDB":"updateCollections","change #selectCol":"updateShards","click .dbserver.success":"dashboard","click .coordinator.success":"dashboard"},replaceSVGs:function(){$(".svgToReplace").each(function(){var a=$(this),b=a.attr("id"),c=a.attr("src");$.get(c,function(c){var d=$(c).find("svg");d.attr("id",b).attr("class","icon").removeAttr("xmlns:a"),a.replaceWith(d)},"xml")})},updateServerTime:function(){this.serverTime=(new Date).getTime()},setShowAll:function(){this.graphShowAll=!0},resetShowAll:function(){this.graphShowAll=!1,this.renderLineChart()},initialize:function(a){this.options=a,this.interval=1e4,this.isUpdating=!1,this.timer=null,this.knownServers=[],this.graph=void 0,this.graphShowAll=!1,this.updateServerTime(),this.dygraphConfig=this.options.dygraphConfig,this.dbservers=new window.ClusterServers([],{interval:this.interval}),this.coordinators=new window.ClusterCoordinators([],{interval:this.interval}),this.documentStore=new window.ArangoDocuments,this.statisticsDescription=new window.StatisticsDescription,this.statisticsDescription.fetch({async:!1}),this.dbs=new window.ClusterDatabases([],{interval:this.interval}),this.cols=new window.ClusterCollections,this.shards=new window.ClusterShards,this.startUpdating()},listByAddress:function(a){var b={},c=this;this.dbservers.byAddress(b,function(b){c.coordinators.byAddress(b,a)})},updateCollections:function(){var a=this,b=$("#selectCol"),c=$("#selectDB").find(":selected").attr("id");if(c){var d=b.find(":selected").attr("id");b.html(""),this.cols.getList(c,function(c){_.each(_.pluck(c,"name"),function(a){b.append('")});var e=$("#"+d,b);1===e.length&&e.prop("selected",!0),a.updateShards()})}},updateShards:function(){var a=$("#selectDB").find(":selected").attr("id"),b=$("#selectCol").find(":selected").attr("id");this.shards.getList(a,b,function(a){$(".shardCounter").html("0"),_.each(a,function(a){$("#"+a.server+"Shards").html(a.shards.length)})})},updateServerStatus:function(a){var b=this,c=function(a,b,c){var d,e,f=c;f=f.replace(/\./g,"-"),f=f.replace(/\:/g,"_"),e=$("#id"+f),e.length<1||(d=e.attr("class").split(/\s+/)[1],e.attr("class",a+" "+d+" "+b),"coordinator"===a&&("success"===b?$(".button-gui",e.closest(".tile")).toggleClass("button-gui-disabled",!1):$(".button-gui",e.closest(".tile")).toggleClass("button-gui-disabled",!0)))};this.coordinators.getStatuses(c.bind(this,"coordinator"),function(){b.dbservers.getStatuses(c.bind(b,"dbserver")),a()})},updateDBDetailList:function(){var a=this,b=$("#selectDB"),c=b.find(":selected").attr("id");b.html(""),this.dbs.getList(function(d){_.each(_.pluck(d,"name"),function(a){b.append('")});var e=$("#"+c,b);1===e.length&&e.prop("selected",!0),a.updateCollections()})},rerender:function(){var a=this;this.updateServerStatus(function(){a.getServerStatistics(function(){a.updateServerTime(),a.data=a.generatePieData(),a.renderPieChart(a.data),a.renderLineChart(),a.updateDBDetailList()})})},render:function(){this.knownServers=[],delete this.hist;var a=this;this.listByAddress(function(b){1===Object.keys(b).length?a.type="testPlan":a.type="other",a.updateDBDetailList(),a.dbs.getList(function(c){$(a.el).html(a.template.render({dbs:_.pluck(c,"name"),byAddress:b,type:a.type})),$(a.el).append(a.modal.render({})),a.replaceSVGs(),a.getServerStatistics(function(){a.data=a.generatePieData(),a.renderPieChart(a.data),a.renderLineChart(),a.updateDBDetailList(),a.startUpdating()})})})},generatePieData:function(){var a=[],b=this;return this.data.forEach(function(c){a.push({key:c.get("name"),value:c.get("system").virtualSize,time:b.serverTime})}),a},addStatisticsItem:function(a,b,c,d){var e=this;e.hasOwnProperty("hist")||(e.hist={}),e.hist.hasOwnProperty(a)||(e.hist[a]=[]);var f=e.hist[a],g=f.length;if(0===g)f.push({time:b,snap:d,requests:c,requestsPerSecond:0});else{var h=f[g-1].time,i=f[g-1].requests;if(c>i){var j=b-h,k=0;j>0&&(k=(c-i)/j),f.push({time:b,snap:d,requests:c,requestsPerSecond:k})}}},getServerStatistics:function(a){var b=this,c=Math.round(b.serverTime/1e3);this.data=void 0;var d=new window.ClusterStatisticsCollection,e=this.coordinators.first();this.dbservers.forEach(function(a){if("ok"===a.get("status")){-1===b.knownServers.indexOf(a.id)&&b.knownServers.push(a.id);var c=new window.Statistics({name:a.id});c.url=e.get("protocol")+"://"+e.get("address")+"/_admin/clusterStatistics?DBserver="+a.get("name"),d.add(c)}}),this.coordinators.forEach(function(a){if("ok"===a.get("status")){-1===b.knownServers.indexOf(a.id)&&b.knownServers.push(a.id);var c=new window.Statistics({name:a.id});c.url=a.get("protocol")+"://"+a.get("address")+"/_admin/statistics",d.add(c)}});var f=d.size();this.data=[];var g=function(d){f--;var e=d.get("time"),g=d.get("name"),h=d.get("http").requestsTotal;b.addStatisticsItem(g,e,h,c),b.data.push(d),0===f&&a()},h=function(){f--,0===f&&a()};d.fetch(g,h)},renderPieChart:function(a){var b=$("#clusterGraphs svg").width(),c=$("#clusterGraphs svg").height(),d=Math.min(b,c)/2,e=this.dygraphConfig.colors,f=d3.svg.arc().outerRadius(d-20).innerRadius(0),g=d3.layout.pie().sort(function(a){return a.value}).value(function(a){return a.value});d3.select("#clusterGraphs").select("svg").remove();var h=d3.select("#clusterGraphs").append("svg").attr("class","clusterChart").append("g").attr("transform","translate("+b/2+","+(c/2-10)+")"),i=d3.svg.arc().outerRadius(d-2).innerRadius(d-2),j=h.selectAll(".arc").data(g(a)).enter().append("g").attr("class","slice");j.append("path").attr("d",f).style("fill",function(a,b){return e[b%e.length]}).style("stroke",function(a,b){return e[b%e.length]}),j.append("text").attr("transform",function(a){return"translate("+f.centroid(a)+")"}).style("text-anchor","middle").text(function(a){var b=a.data.value/1024/1024/1024;return b.toFixed(2)}),j.append("text").attr("transform",function(a){return"translate("+i.centroid(a)+")"}).style("text-anchor","middle").text(function(a){return a.data.key})},renderLineChart:function(){var a,b,c,d,e,f,g=this,h=1200,i=[],j=[],k=Math.round((new Date).getTime()/1e3)-h,l=g.knownServers,m=function(){return null};for(c=0;cf||(j.hasOwnProperty(f)?a=j[f]:(e=new Date(1e3*f),a=j[f]=[e].concat(l.map(m))),a[c+1]=b[d].requestsPerSecond);i=[],Object.keys(j).sort().forEach(function(a){i.push(j[a])});var n=this.dygraphConfig.getDefaultConfig("clusterRequestsPerSecond");n.labelsDiv=$("#lineGraphLegend")[0],n.labels=["datetime"].concat(l),g.graph=new Dygraph(document.getElementById("lineGraph"),i,n)},stopUpdating:function(){window.clearTimeout(this.timer),delete this.graph,this.isUpdating=!1},startUpdating:function(){if(!this.isUpdating){this.isUpdating=!0;var a=this;this.timer=window.setInterval(function(){a.rerender()},this.interval)}},dashboard:function(a){this.stopUpdating();var b,c,d=$(a.currentTarget),e={},f=d.attr("id");f=f.replace(/\-/g,"."),f=f.replace(/\_/g,":"),f=f.substr(2),e.raw=f,e.isDBServer=d.hasClass("dbserver"),e.isDBServer?(b=this.dbservers.findWhere({address:e.raw}),c=this.coordinators.findWhere({status:"ok"}),e.endpoint=c.get("protocol")+"://"+c.get("address")):(b=this.coordinators.findWhere({address:e.raw}),e.endpoint=b.get("protocol")+"://"+b.get("address")),e.target=encodeURIComponent(b.get("name")),window.App.serverToShow=e,window.App.dashboard()},getCurrentSize:function(a){"#"!==a.substr(0,1)&&(a="#"+a);var b,c;return $(a).attr("style",""),b=$(a).height(),c=$(a).width(),{height:b,width:c}},resize:function(){var a;this.graph&&(a=this.getCurrentSize(this.graph.maindiv_.id),this.graph.resize(a.width,a.height))}})}(),function(){"use strict";window.SpotlightView=Backbone.View.extend({template:templateEngine.createTemplate("spotlightView.ejs"),el:"#spotlightPlaceholder",displayLimit:8,typeahead:null,callbackSuccess:null,callbackCancel:null,collections:{system:[],doc:[],edge:[]},events:{"focusout #spotlight .tt-input":"hide","keyup #spotlight .typeahead":"listenKey"},aqlKeywordsArray:[],aqlBuiltinFunctionsArray:[],aqlKeywords:"for|return|filter|sort|limit|let|collect|asc|desc|in|into|insert|update|remove|replace|upsert|options|with|and|or|not|distinct|graph|outbound|inbound|any|all|none|aggregate|like|count|shortest_path",hide:function(){this.typeahead=$("#spotlight .typeahead").typeahead("destroy"),$(this.el).hide()},listenKey:function(a){if(27===a.keyCode)this.callbackSuccess&&this.callbackCancel(),this.hide();else if(13===a.keyCode&&this.callbackSuccess){var b=$(this.typeahead).val();this.callbackSuccess(b),this.hide()}},substringMatcher:function(a){return function(b,c){var d,e;d=[],e=new RegExp(b,"i"),_.each(a,function(a){e.test(a)&&d.push(a)}),c(d)}},updateDatasets:function(){var a=this;this.collections={system:[],doc:[],edge:[]},window.App.arangoCollectionsStore.each(function(b){b.get("isSystem")?a.collections.system.push(b.get("name")):"document"===b.get("type")?a.collections.doc.push(b.get("name")):a.collections.edge.push(b.get("name"))})},stringToArray:function(){var a=this;_.each(this.aqlKeywords.split("|"),function(b){a.aqlKeywordsArray.push(b.toUpperCase())}),a.aqlKeywordsArray.push(!0),a.aqlKeywordsArray.push(!1),a.aqlKeywordsArray.push(null)},fetchKeywords:function(a){var b=this;$.ajax({type:"GET",cache:!1,url:arangoHelper.databaseUrl("/_api/aql-builtin"),contentType:"application/json",success:function(c){b.stringToArray(),b.updateDatasets(),_.each(c.functions,function(a){b.aqlBuiltinFunctionsArray.push(a.name)}),a&&a()},error:function(){a&&a(),arangoHelper.arangoError("AQL","Could not fetch AQL function definition.")}})},show:function(a,b,c){var d=this;this.callbackSuccess=a,this.callbackCancel=b;var e=function(){var a=function(a,b,c){var d='

    '+a+"

    ";return b&&(d+=''),c&&(d+=''+c.toUpperCase()+""),d+="
    "};$(this.el).html(this.template.render({})),$(this.el).show(),"aql"===c?this.typeahead=$("#spotlight .typeahead").typeahead({hint:!0,highlight:!0,minLength:1},{name:"Functions",source:d.substringMatcher(d.aqlBuiltinFunctionsArray),limit:d.displayLimit,templates:{header:a("Functions","fa-code","aql")}},{name:"Keywords",source:d.substringMatcher(d.aqlKeywordsArray),limit:d.displayLimit,templates:{header:a("Keywords","fa-code","aql")}},{name:"Documents",source:d.substringMatcher(d.collections.doc),limit:d.displayLimit,templates:{header:a("Documents","fa-file-text-o","Collection")}},{name:"Edges",source:d.substringMatcher(d.collections.edge),limit:d.displayLimit,templates:{header:a("Edges","fa-share-alt","Collection")}},{name:"System",limit:d.displayLimit,source:d.substringMatcher(d.collections.system),templates:{header:a("System","fa-cogs","Collection")}}):this.typeahead=$("#spotlight .typeahead").typeahead({hint:!0,highlight:!0,minLength:1},{name:"Documents",source:d.substringMatcher(d.collections.doc),limit:d.displayLimit,templates:{header:a("Documents","fa-file-text-o","Collection")}},{name:"Edges",source:d.substringMatcher(d.collections.edge),limit:d.displayLimit,templates:{header:a("Edges","fa-share-alt","Collection")}},{name:"System",limit:d.displayLimit,source:d.substringMatcher(d.collections.system),templates:{header:a("System","fa-cogs","Collection")}}),$("#spotlight .typeahead").focus()}.bind(this);0===d.aqlBuiltinFunctionsArray.length?this.fetchKeywords(e):e()}})}(),function(){"use strict";window.StatisticBarView=Backbone.View.extend({el:"#statisticBar",events:{"change #arangoCollectionSelect":"navigateBySelect","click .tab":"navigateByTab"},template:templateEngine.createTemplate("statisticBarView.ejs"),initialize:function(a){this.currentDB=a.currentDB},replaceSVG:function(a){var b=a.attr("id"),c=a.attr("class"),d=a.attr("src");$.get(d,function(d){var e=$(d).find("svg");void 0===b&&(e=e.attr("id",b)),void 0===c&&(e=e.attr("class",c+" replaced-svg")),e=e.removeAttr("xmlns:a"),a.replaceWith(e)},"xml")},render:function(){var a=this;return $(this.el).html(this.template.render({isSystem:this.currentDB.get("isSystem")})),$("img.svg").each(function(){a.replaceSVG($(this))}),this},navigateBySelect:function(){var a=$("#arangoCollectionSelect").find("option:selected").val();window.App.navigate(a,{trigger:!0})},navigateByTab:function(a){var b=a.target||a.srcElement,c=b.id;return"links"===c?($("#link_dropdown").slideToggle(200),void a.preventDefault()):"tools"===c?($("#tools_dropdown").slideToggle(200),void a.preventDefault()):(window.App.navigate(c,{trigger:!0}),void a.preventDefault())},handleSelectNavigation:function(){$("#arangoCollectionSelect").change(function(){var a=$(this).find("option:selected").val();window.App.navigate(a,{trigger:!0})})},selectMenuItem:function(a){$(".navlist li").removeClass("active"),a&&$("."+a).addClass("active")}})}(),function(){"use strict";window.SupportView=Backbone.View.extend({el:"#content",template:templateEngine.createTemplate("supportView.ejs"),events:{"click .subViewNavbar .subMenuEntry":"toggleViews"},render:function(){this.$el.html(this.template.render({}))},resize:function(a){a?$(".innerContent").css("height","auto"):$(".innerContent").height($(".centralRow").height()-170)},renderSwagger:function(){var a=window.location.pathname.split("/"),b=window.location.protocol+"//"+window.location.hostname+":"+window.location.port+"/"+a[1]+"/"+a[2]+"/_admin/aardvark/api/index.html";$("#swagger").html(""),$("#swagger").append('')},toggleViews:function(a){var b=this,c=a.currentTarget.id.split("-")[0],d=["community","documentation","swagger"];_.each(d,function(a){c!==a?$("#"+a).hide():("swagger"===c?(b.renderSwagger(),$("#swagger iframe").css("height","100%"),$("#swagger iframe").css("width","100%"),$("#swagger iframe").css("margin-top","-13px"),b.resize()):b.resize(!0),$("#"+a).show())}),$(".subMenuEntries").children().removeClass("active"),$("#"+c+"-support").addClass("active")}})}(),function(){"use strict";window.TableView=Backbone.View.extend({template:templateEngine.createTemplate("tableView.ejs"),loading:templateEngine.createTemplate("loadingTableView.ejs"),initialize:function(a){this.rowClickCallback=a.rowClick},events:{"click .pure-table-body .pure-table-row":"rowClick","click .deleteButton":"removeClick"},rowClick:function(a){this.hasOwnProperty("rowClickCallback")&&this.rowClickCallback(a)},removeClick:function(a){this.hasOwnProperty("removeClickCallback")&&(this.removeClickCallback(a),a.stopPropagation())},setRowClick:function(a){this.rowClickCallback=a},setRemoveClick:function(a){this.removeClickCallback=a},render:function(){$(this.el).html(this.template.render({docs:this.collection}))},drawLoading:function(){$(this.el).html(this.loading.render({}))}})}(),function(){"use strict";window.UserBarView=Backbone.View.extend({events:{"change #userBarSelect":"navigateBySelect","click .tab":"navigateByTab","mouseenter .dropdown":"showDropdown","mouseleave .dropdown":"hideDropdown","click #userLogoutIcon":"userLogout","click #userLogout":"userLogout"},initialize:function(a){this.userCollection=a.userCollection,this.userCollection.fetch({cache:!1,async:!0}),this.userCollection.bind("change:extra",this.render.bind(this))},template:templateEngine.createTemplate("userBarView.ejs"),navigateBySelect:function(){var a=$("#arangoCollectionSelect").find("option:selected").val();window.App.navigate(a,{trigger:!0})},navigateByTab:function(a){var b=a.target||a.srcElement;b=$(b).closest("a");var c=b.attr("id");return"user"===c?($("#user_dropdown").slideToggle(200),void a.preventDefault()):(window.App.navigate(c,{trigger:!0}),void a.preventDefault())},toggleUserMenu:function(){$("#userBar .subBarDropdown").toggle()},showDropdown:function(){$("#user_dropdown").fadeIn(1)},hideDropdown:function(){$("#user_dropdown").fadeOut(1)},render:function(){if(frontendConfig.authenticationEnabled!==!1){var a=this,b=function(a,b){if(a)arangoHelper.arangoErro("User","Could not fetch user.");else{var c=null,d=null,e=!1,f=null;if(b!==!1)return f=this.userCollection.findWhere({user:b}),f.set({loggedIn:!0}),d=f.get("extra").name,c=f.get("extra").img,e=f.get("active"),c=c?"https://s.gravatar.com/avatar/"+c+"?s=80":"img/default_user.png",d||(d=""),this.$el=$("#userBar"),this.$el.html(this.template.render({img:c,name:d,username:b,active:e})),this.delegateEvents(),this.$el}}.bind(this);$("#userBar").on("click",function(){a.toggleUserMenu()}),this.userCollection.whoAmI(b)}},userLogout:function(){var a=function(a){a?arangoHelper.arangoError("User","Logout error"):this.userCollection.logout()}.bind(this);this.userCollection.whoAmI(a)}})}(),function(){"use strict";window.UserManagementView=Backbone.View.extend({el:"#content",el2:"#userManagementThumbnailsIn",template:templateEngine.createTemplate("userManagementView.ejs"),events:{"click #createUser":"createUser","click #submitCreateUser":"submitCreateUser","click #userManagementThumbnailsIn .tile":"editUser","click #submitEditUser":"submitEditUser","click #userManagementToggle":"toggleView","keyup #userManagementSearchInput":"search","click #userManagementSearchSubmit":"search","click #callEditUserPassword":"editUserPassword","click #submitEditUserPassword":"submitEditUserPassword","click #submitEditCurrentUserProfile":"submitEditCurrentUserProfile","click .css-label":"checkBoxes","change #userSortDesc":"sorting"},dropdownVisible:!1,initialize:function(){var a=this,b=function(a,b){frontendConfig.authenticationEnabled===!0&&(a||null===b?arangoHelper.arangoError("User","Could not fetch user data"):this.currentUser=this.collection.findWhere({user:b}))}.bind(this);this.collection.fetch({cache:!1,success:function(){a.collection.whoAmI(b)}})},checkBoxes:function(a){var b=a.currentTarget.id;$("#"+b).click()},sorting:function(){$("#userSortDesc").is(":checked")?this.collection.setSortingDesc(!0):this.collection.setSortingDesc(!1), -$("#userManagementDropdown").is(":visible")?this.dropdownVisible=!0:this.dropdownVisible=!1,this.render()},render:function(a){var b=!1;$("#userManagementDropdown").is(":visible")&&(b=!0);var c=function(){this.collection.sort(),$(this.el).html(this.template.render({collection:this.collection,searchString:""})),b===!0&&($("#userManagementDropdown2").show(),$("#userSortDesc").attr("checked",this.collection.sortOptions.desc),$("#userManagementToggle").toggleClass("activated"),$("#userManagementDropdown").show()),a&&this.editCurrentUser(),arangoHelper.setCheckboxStatus("#userManagementDropdown")}.bind(this);return this.collection.fetch({cache:!1,success:function(){c()}}),this},search:function(){var a,b,c,d;a=$("#userManagementSearchInput"),b=$("#userManagementSearchInput").val(),d=this.collection.filter(function(a){return-1!==a.get("user").indexOf(b)}),$(this.el).html(this.template.render({collection:d,searchString:b})),a=$("#userManagementSearchInput"),c=a.val().length,a.focus(),a[0].setSelectionRange(c,c)},createUser:function(a){a.preventDefault(),this.createCreateUserModal()},submitCreateUser:function(){var a=this,b=$("#newUsername").val(),c=$("#newName").val(),d=$("#newPassword").val(),e=$("#newStatus").is(":checked");if(this.validateUserInfo(c,b,d,e)){var f={user:b,passwd:d,active:e,extra:{name:c}};this.collection.create(f,{wait:!0,error:function(a,b){arangoHelper.parseError("User",b,a)},success:function(){a.updateUserManagement(),window.modalView.hide()}})}},validateUserInfo:function(a,b,c,d){return""===b?(arangoHelper.arangoError("You have to define an username"),$("#newUsername").closest("th").css("backgroundColor","red"),!1):!0},updateUserManagement:function(){var a=this;this.collection.fetch({cache:!1,success:function(){a.render()}})},editUser:function(a){if("createUser"!==$(a.currentTarget).find("a").attr("id")){$(a.currentTarget).hasClass("tile")&&(a.currentTarget=$(a.currentTarget).find("img")),this.collection.fetch({cache:!1});var b=this.evaluateUserName($(a.currentTarget).attr("id"),"_edit-user");""===b&&(b=$(a.currentTarget).attr("id")),window.App.navigate("user/"+encodeURIComponent(b),{trigger:!0})}},toggleView:function(){$("#userSortDesc").attr("checked",this.collection.sortOptions.desc),$("#userManagementToggle").toggleClass("activated"),$("#userManagementDropdown2").slideToggle(200)},createCreateUserModal:function(){var a=[],b=[];b.push(window.modalView.createTextEntry("newUsername","Username","",!1,"Username",!0,[{rule:Joi.string().regex(/^[a-zA-Z0-9\-_]*$/),msg:'Only symbols, "_" and "-" are allowed.'},{rule:Joi.string().required(),msg:"No username given."}])),b.push(window.modalView.createTextEntry("newName","Name","",!1,"Name",!1)),b.push(window.modalView.createPasswordEntry("newPassword","Password","",!1,"",!1)),b.push(window.modalView.createCheckboxEntry("newStatus","Active","active",!1,!0)),a.push(window.modalView.createSuccessButton("Create",this.submitCreateUser.bind(this))),window.modalView.show("modalTable.ejs","Create New User",a,b)},evaluateUserName:function(a,b){if(a){var c=a.lastIndexOf(b);return a.substring(0,c)}},updateUserProfile:function(){var a=this;this.collection.fetch({cache:!1,success:function(){a.render()}})}})}(),function(){"use strict";window.UserPermissionView=Backbone.View.extend({el:"#content",template:templateEngine.createTemplate("userPermissionView.ejs"),initialize:function(a){this.username=a.username},events:{'click #userPermissionView [type="checkbox"]':"setPermission"},render:function(){var a=this;this.collection.fetch({success:function(){a.continueRender()}})},setPermission:function(a){var b=$(a.currentTarget).is(":checked"),c=$(a.currentTarget).attr("name");b?this.grantPermission(this.currentUser.get("user"),c):this.revokePermission(this.currentUser.get("user"),c)},grantPermission:function(a,b){$.ajax({type:"PUT",url:arangoHelper.databaseUrl("/_api/user/"+encodeURIComponent(a)+"/database/"+encodeURIComponent(b)),contentType:"application/json",data:JSON.stringify({grant:"rw"})})},revokePermission:function(a,b){$.ajax({type:"PUT",url:arangoHelper.databaseUrl("/_api/user/"+encodeURIComponent(a)+"/database/"+encodeURIComponent(b)),contentType:"application/json"})},continueRender:function(){var a=this;this.currentUser=this.collection.findWhere({user:this.username}),this.breadcrumb(),arangoHelper.buildUserSubNav(this.currentUser.get("user"),"Permissions");var b=arangoHelper.databaseUrl("/_api/user/"+encodeURIComponent(a.currentUser.get("user"))+"/database");"_system"===frontendConfig.db&&(b=arangoHelper.databaseUrl("/_api/user/root/database")),$.ajax({type:"GET",url:b,contentType:"application/json",success:function(b){var c=b.result;$.ajax({type:"GET",url:arangoHelper.databaseUrl("/_api/user/"+encodeURIComponent(a.currentUser.get("user"))+"/database"),contentType:"application/json",success:function(b){var d=b.result;if(c._system){var e=[];_.each(c,function(a,b){e.push(b)}),c=e}a.finishRender(c,d)}})}})},finishRender:function(a,b){_.each(b,function(a,c){"rw"!==a&&delete b[c]}),$(this.el).html(this.template.render({allDBs:a,permissions:b}))},breadcrumb:function(){$("#subNavigationBar .breadcrumb").html("User: "+this.currentUser.get("user"))}})}(),function(){"use strict";window.UserView=Backbone.View.extend({el:"#content",initialize:function(a){this.username=a.username},render:function(){var a=this;this.collection.fetch({success:function(){a.continueRender()}})},editCurrentUser:function(){this.createEditCurrentUserModal(this.currentUser.get("user"),this.currentUser.get("extra").name,this.currentUser.get("extra").img)},continueRender:function(){this.breadcrumb(),this.currentUser=this.collection.findWhere({user:this.username}),arangoHelper.buildUserSubNav(this.currentUser.get("user"),"General"),this.currentUser.get("loggedIn")?this.editCurrentUser():this.createEditUserModal(this.currentUser.get("user"),this.currentUser.get("extra").name,this.currentUser.get("active"))},createEditUserPasswordModal:function(){var a=[],b=[];b.push(window.modalView.createPasswordEntry("newCurrentPassword","New Password","",!1,"new password",!1)),b.push(window.modalView.createPasswordEntry("confirmCurrentPassword","Confirm New Password","",!1,"confirm new password",!1)),a.push(window.modalView.createSuccessButton("Save",this.submitEditUserPassword.bind(this))),window.modalView.show("modalTable.ejs","Edit User Password",a,b)},createEditCurrentUserModal:function(a,b,c){var d=[],e=[];e.push(window.modalView.createReadOnlyEntry("id_username","Username",a)),e.push(window.modalView.createTextEntry("editCurrentName","Name",b,!1,"Name",!1)),e.push(window.modalView.createTextEntry("editCurrentUserProfileImg","Gravatar account (Mail)",c,"Mailaddress or its md5 representation of your gravatar account.The address will be converted into a md5 string. Only the md5 string will be stored, not the mailaddress.","myAccount(at)gravatar.com")),d.push(window.modalView.createNotificationButton("Change Password",this.editUserPassword.bind(this))),d.push(window.modalView.createSuccessButton("Save",this.submitEditCurrentUserProfile.bind(this))),window.modalView.show("modalTable.ejs","Edit User Profile",d,e,null,null,this.events,null,null,"content")},parseImgString:function(a){return-1===a.indexOf("@")?a:CryptoJS.MD5(a).toString()},createEditUserModal:function(a,b,c){var d,e;e=[{type:window.modalView.tables.READONLY,label:"Username",value:_.escape(a)},{type:window.modalView.tables.TEXT,label:"Name",value:b,id:"editName",placeholder:"Name"},{type:window.modalView.tables.CHECKBOX,label:"Active",value:"active",checked:c,id:"editStatus"}],d=[{title:"Delete",type:window.modalView.buttons.DELETE,callback:this.submitDeleteUser.bind(this,a)},{title:"Change Password",type:window.modalView.buttons.NOTIFICATION,callback:this.createEditUserPasswordModal.bind(this,a)},{title:"Save",type:window.modalView.buttons.SUCCESS,callback:this.submitEditUser.bind(this,a)}],window.modalView.show("modalTable.ejs","Edit User",d,e,null,null,this.events,null,null,"content")},validateStatus:function(a){return""!==a},submitDeleteUser:function(a){var b=this.collection.findWhere({user:a});b.destroy({wait:!0}),window.App.navigate("#users",{trigger:!0})},submitEditCurrentUserProfile:function(){var a=$("#editCurrentName").val(),b=$("#editCurrentUserProfileImg").val();b=this.parseImgString(b);var c=function(a){a?arangoHelper.arangoError("User","Could not edit user settings"):(arangoHelper.arangoNotification("User","Changes confirmed."),this.updateUserProfile())}.bind(this);this.currentUser.setExtras(a,b,c),window.modalView.hide()},submitEditUserPassword:function(){var a=$("#newCurrentPassword").val(),b=$("#confirmCurrentPassword").val();$("#newCurrentPassword").val(""),$("#confirmCurrentPassword").val(""),$("#newCurrentPassword").closest("th").css("backgroundColor","white"),$("#confirmCurrentPassword").closest("th").css("backgroundColor","white");var c=!1;a!==b&&(arangoHelper.arangoError("User","New passwords do not match."),c=!0),c||(this.currentUser.setPassword(a),arangoHelper.arangoNotification("User","Password changed."),window.modalView.hide())},validateUsername:function(a){return""===a?(arangoHelper.arangoError("You have to define an username"),$("#newUsername").closest("th").css("backgroundColor","red"),!1):a.match(/^[a-zA-Z][a-zA-Z0-9_\-]*$/)?!0:(arangoHelper.arangoError("Wrong Username","Username may only contain numbers, letters, _ and -"),!1)},editUserPassword:function(){window.modalView.hide(),this.createEditUserPasswordModal()},validateName:function(a){return""===a?!0:a.match(/^[a-zA-Z][a-zA-Z0-9_\-\ ]*$/)?!0:(arangoHelper.arangoError("Wrong Username","Username may only contain numbers, letters, _ and -"),!1)},submitEditUser:function(a){var b=$("#editName").val(),c=$("#editStatus").is(":checked");if(!this.validateStatus(c))return void $("#editStatus").closest("th").css("backgroundColor","red");if(!this.validateName(b))return void $("#editName").closest("th").css("backgroundColor","red");var d=this.collection.findWhere({user:a});d.save({extra:{name:b},active:c},{type:"PATCH",success:function(){arangoHelper.arangoNotification("User",d.get("user")+" updated.")},error:function(){arangoHelper.arangoError("User","Could not update "+d.get("user")+".")}})},breadcrumb:function(){$("#subNavigationBar .breadcrumb").html("User: "+this.username)}})}(),function(){"use strict";window.WorkMonitorView=Backbone.View.extend({el:"#content",id:"#workMonitorContent",template:templateEngine.createTemplate("workMonitorView.ejs"),table:templateEngine.createTemplate("arangoTable.ejs"),initialize:function(){},events:{},tableDescription:{id:"workMonitorTable",titles:["Type","Database","Task ID","Started","Url","User","Description","Method"],rows:[],unescaped:[!1,!1,!1,!1,!1,!1,!1,!1]},render:function(){var a=this;this.$el.html(this.template.render({})),this.collection.fetch({success:function(){a.parseTableData(),$(a.id).append(a.table.render({content:a.tableDescription}))}})},parseTableData:function(){var a=this;this.collection.each(function(b){if("AQL query"===b.get("type")){var c=b.get("parent");if(c)try{a.tableDescription.rows.push([b.get("type"),"(p) "+c.database,"(p) "+c.taskId,"(p) "+c.startTime,"(p) "+c.url,"(p) "+c.user,b.get("description"),"(p) "+c.method])}catch(d){console.log("some parse error")}}else"thread"!==b.get("type")&&a.tableDescription.rows.push([b.get("type"),b.get("database"),b.get("taskId"),b.get("startTime"),b.get("url"),b.get("user"),b.get("description"),b.get("method")])})}})}(),function(){"use strict";window.Router=Backbone.Router.extend({toUpdate:[],dbServers:[],isCluster:void 0,routes:{"":"cluster",dashboard:"dashboard",collections:"collections","new":"newCollection",login:"login","collection/:colid/documents/:pageid":"documents","cIndices/:colname":"cIndices","cSettings/:colname":"cSettings","cInfo/:colname":"cInfo","collection/:colid/:docid":"document",shell:"shell",queries:"query",workMonitor:"workMonitor",databases:"databases",settings:"databases",services:"applications","service/:mount":"applicationDetail",graphs:"graphManagement","graphs/:name":"showGraph",users:"userManagement","user/:name":"userView","user/:name/permission":"userPermissionView",userProfile:"userProfile",cluster:"cluster",nodes:"nodes",shards:"shards","node/:name":"node",logs:"logs",helpus:"helpUs","graph2/:name":"graph2","graph2/:name/settings":"graph2settings",support:"support"},execute:function(a,b){$("#subNavigationBar .breadcrumb").html(""),$("#subNavigationBar .bottom").html(""),$("#loadingScreen").hide(),$("#content").show(),a&&a.apply(this,b),this.graphViewer2&&this.graphViewer2.graphSettingsView&&this.graphViewer2.graphSettingsView.hide()},listenerFunctions:{},listener:function(a){_.each(window.App.listenerFunctions,function(b,c){b(a)})},checkUser:function(){var a=this;if("#login"!==window.location.hash){var b=function(){this.initOnce(),$(".bodyWrapper").show(),$(".navbar").show()}.bind(this),c=function(c,d){frontendConfig.authenticationEnabled?(a.currentUser=d,c||null===d?"#login"!==window.location.hash&&this.navigate("login",{trigger:!0}):b()):b()}.bind(this);frontendConfig.authenticationEnabled?this.userCollection.whoAmI(c):(this.initOnce(),$(".bodyWrapper").show(),$(".navbar").show())}},waitForInit:function(a,b,c){this.initFinished?(b||a(!0),b&&!c&&a(b,!0),b&&c&&a(b,c,!0)):setTimeout(function(){b||a(!1),b&&!c&&a(b,!1),b&&c&&a(b,c,!1)},350)},initFinished:!1,initialize:function(){frontendConfig.isCluster===!0&&(this.isCluster=!0),document.addEventListener("keyup",this.listener,!1),window.modalView=new window.ModalView,this.foxxList=new window.FoxxCollection,window.foxxInstallView=new window.FoxxInstallView({collection:this.foxxList}),window.progressView=new window.ProgressView;var a=this;this.userCollection=new window.ArangoUsers,this.initOnce=function(){this.initOnce=function(){};var b=function(b,c){a=this,c===!0&&a.coordinatorCollection.fetch({success:function(){a.fetchDBS()}}),b&&console.log(b)}.bind(this);window.isCoordinator(b),frontendConfig.isCluster===!1&&(this.initFinished=!0),this.arangoDatabase=new window.ArangoDatabase,this.currentDB=new window.CurrentDatabase,this.arangoCollectionsStore=new window.ArangoCollections,this.arangoDocumentStore=new window.ArangoDocument,this.coordinatorCollection=new window.ClusterCoordinators,arangoHelper.setDocumentStore(this.arangoDocumentStore),this.arangoCollectionsStore.fetch({cache:!1}),window.spotlightView=new window.SpotlightView({collection:this.arangoCollectionsStore}),this.footerView=new window.FooterView({collection:a.coordinatorCollection}),this.notificationList=new window.NotificationCollection,this.currentDB.fetch({cache:!1,success:function(){a.naviView=new window.NavigationView({database:a.arangoDatabase,currentDB:a.currentDB,notificationCollection:a.notificationList,userCollection:a.userCollection,isCluster:a.isCluster}),a.naviView.render()}}),this.queryCollection=new window.ArangoQueries,this.footerView.render(),window.checkVersion(),this.userConfig=new window.UserConfig,this.userConfig.fetch(),this.documentsView=new window.DocumentsView({collection:new window.ArangoDocuments,documentStore:this.arangoDocumentStore,collectionsStore:this.arangoCollectionsStore})}.bind(this),$(window).resize(function(){a.handleResize()}),$(window).scroll(function(){})},handleScroll:function(){$(window).scrollTop()>50?($(".navbar > .secondary").css("top",$(window).scrollTop()),$(".navbar > .secondary").css("position","absolute"),$(".navbar > .secondary").css("z-index","10"),$(".navbar > .secondary").css("width",$(window).width())):($(".navbar > .secondary").css("top","0"),$(".navbar > .secondary").css("position","relative"),$(".navbar > .secondary").css("width",""))},cluster:function(a){return this.checkUser(),a?this.isCluster===!1||void 0===this.isCluster?void("_system"===this.currentDB.get("name")?(this.routes[""]="dashboard",this.navigate("#dashboard",{trigger:!0})):(this.routes[""]="collections",this.navigate("#collections",{trigger:!0}))):(this.clusterView||(this.clusterView=new window.ClusterView({coordinators:this.coordinatorCollection,dbServers:this.dbServers})),void this.clusterView.render()):void this.waitForInit(this.cluster.bind(this))},node:function(a,b){return this.checkUser(),b&&void 0!==this.isCluster?this.isCluster===!1?(this.routes[""]="dashboard",void this.navigate("#dashboard",{trigger:!0})):(this.nodeView||(this.nodeView=new window.NodeView({coordname:a,coordinators:this.coordinatorCollection,dbServers:this.dbServers})),void this.nodeView.render()):void this.waitForInit(this.node.bind(this),a)},shards:function(a){return this.checkUser(),a&&void 0!==this.isCluster?this.isCluster===!1?(this.routes[""]="dashboard",void this.navigate("#dashboard",{trigger:!0})):(this.shardsView||(this.shardsView=new window.ShardsView({dbServers:this.dbServers})),void this.shardsView.render()):void this.waitForInit(this.shards.bind(this))},nodes:function(a){return this.checkUser(),a&&void 0!==this.isCluster?this.isCluster===!1?(this.routes[""]="dashboard",void this.navigate("#dashboard",{trigger:!0})):(this.nodesView=new window.NodesView2({}),void this.nodesView.render()):void this.waitForInit(this.nodes.bind(this))},cNodes:function(a){return this.checkUser(),a&&void 0!==this.isCluster?this.isCluster===!1?(this.routes[""]="dashboard",void this.navigate("#dashboard",{trigger:!0})):(this.nodesView=new window.NodesView({coordinators:this.coordinatorCollection,dbServers:this.dbServers[0],toRender:"coordinator"}),void this.nodesView.render()):void this.waitForInit(this.cNodes.bind(this))},dNodes:function(a){return this.checkUser(),a&&void 0!==this.isCluster?this.isCluster===!1?(this.routes[""]="dashboard",void this.navigate("#dashboard",{trigger:!0})):0===this.dbServers.length?void this.navigate("#cNodes",{trigger:!0}):(this.nodesView=new window.NodesView({coordinators:this.coordinatorCollection,dbServers:this.dbServers[0],toRender:"dbserver"}),void this.nodesView.render()):void this.waitForInit(this.dNodes.bind(this))},sNodes:function(a){return this.checkUser(),a&&void 0!==this.isCluster?this.isCluster===!1?(this.routes[""]="dashboard",void this.navigate("#dashboard",{trigger:!0})):(this.scaleView=new window.ScaleView({coordinators:this.coordinatorCollection,dbServers:this.dbServers[0]}),void this.scaleView.render()):void this.waitForInit(this.sNodes.bind(this))},addAuth:function(a){var b=this.clusterPlan.get("user");if(!b)return a.abort(),void(this.isCheckingUser||this.requestAuth());var c=b.name,d=b.passwd,e=c.concat(":",d);a.setRequestHeader("Authorization","Basic "+btoa(e))},logs:function(a,b){if(this.checkUser(),!b)return void this.waitForInit(this.logs.bind(this),a);if(!this.logsView){var c=new window.ArangoLogs({upto:!0,loglevel:4}),d=new window.ArangoLogs({loglevel:4}),e=new window.ArangoLogs({loglevel:3}),f=new window.ArangoLogs({loglevel:2}),g=new window.ArangoLogs({loglevel:1});this.logsView=new window.LogsView({logall:c,logdebug:d,loginfo:e,logwarning:f,logerror:g})}this.logsView.render()},applicationDetail:function(a,b){if(this.checkUser(),!b)return void this.waitForInit(this.applicationDetail.bind(this),a);var c=function(){this.hasOwnProperty("applicationDetailView")||(this.applicationDetailView=new window.ApplicationDetailView({model:this.foxxList.get(decodeURIComponent(a))})),this.applicationDetailView.model=this.foxxList.get(decodeURIComponent(a)),this.applicationDetailView.render("swagger")}.bind(this);0===this.foxxList.length?this.foxxList.fetch({cache:!1,success:function(){c()}}):c()},login:function(){var a=function(a,b){this.loginView||(this.loginView=new window.LoginView({collection:this.userCollection})),a||null===b?this.loginView.render():this.loginView.render(!0)}.bind(this);this.userCollection.whoAmI(a)},collections:function(a){if(this.checkUser(),!a)return void this.waitForInit(this.collections.bind(this));var b=this;this.collectionsView||(this.collectionsView=new window.CollectionsView({collection:this.arangoCollectionsStore})),this.arangoCollectionsStore.fetch({cache:!1,success:function(){b.collectionsView.render()}})},cIndices:function(a,b){var c=this;return this.checkUser(),b?void this.arangoCollectionsStore.fetch({cache:!1,success:function(){c.indicesView=new window.IndicesView({collectionName:a,collection:c.arangoCollectionsStore.findWhere({name:a})}),c.indicesView.render()}}):void this.waitForInit(this.cIndices.bind(this),a)},cSettings:function(a,b){var c=this;return this.checkUser(),b?void this.arangoCollectionsStore.fetch({cache:!1,success:function(){c.settingsView=new window.SettingsView({collectionName:a,collection:c.arangoCollectionsStore.findWhere({name:a})}),c.settingsView.render()}}):void this.waitForInit(this.cSettings.bind(this),a)},cInfo:function(a,b){var c=this;return this.checkUser(),b?void this.arangoCollectionsStore.fetch({cache:!1,success:function(){c.infoView=new window.InfoView({collectionName:a,collection:c.arangoCollectionsStore.findWhere({name:a})}),c.infoView.render()}}):void this.waitForInit(this.cInfo.bind(this),a)},documents:function(a,b,c){return this.checkUser(),c?(this.documentsView||(this.documentsView=new window.DocumentsView({collection:new window.ArangoDocuments,documentStore:this.arangoDocumentStore,collectionsStore:this.arangoCollectionsStore})),this.documentsView.setCollectionId(a,b),void this.documentsView.render()):void this.waitForInit(this.documents.bind(this),a,b)},document:function(a,b,c){if(this.checkUser(),!c)return void this.waitForInit(this.document.bind(this),a,b);this.documentView||(this.documentView=new window.DocumentView({collection:this.arangoDocumentStore})),this.documentView.colid=a;var d=window.location.hash.split("/")[2],e=(d.split("%").length-1)%3;decodeURI(d)!==d&&0!==e&&(d=decodeURIComponent(d)),this.documentView.docid=d,this.documentView.render();var f=function(a,b){a?console.log("Error","Could not fetch collection type"):this.documentView.setType(b)}.bind(this);arangoHelper.collectionApiType(a,null,f)},query:function(a){return this.checkUser(),a?(this.queryView||(this.queryView=new window.QueryView({collection:this.queryCollection})),void this.queryView.render()):void this.waitForInit(this.query.bind(this))},graph2:function(a,b){return this.checkUser(),b?(this.graphViewer2&&(this.graphViewer2.graphSettingsView&&this.graphViewer2.graphSettingsView.remove(),this.graphViewer2.remove()),this.graphViewer2=new window.GraphViewer2({name:a,documentStore:this.arangoDocumentStore,collection:new window.GraphCollection,userConfig:this.userConfig}),void this.graphViewer2.render()):void this.waitForInit(this.graph2.bind(this),a)},graph2settings:function(a,b){return this.checkUser(),b?(this.graphSettingsView&&this.graphSettingsView.remove(),this.graphSettingsView=new window.GraphSettingsView({name:a,userConfig:this.userConfig}),void this.graphSettingsView.render()):void this.waitForInit(this.graph2settings.bind(this),a)},helpUs:function(a){return this.checkUser(),a?(this.testView||(this.helpUsView=new window.HelpUsView({})),void this.helpUsView.render()):void this.waitForInit(this.helpUs.bind(this))},support:function(a){return this.checkUser(),a?(this.testView||(this.supportView=new window.SupportView({})),void this.supportView.render()):void this.waitForInit(this.support.bind(this))},workMonitor:function(a){return this.checkUser(),a?(this.workMonitorCollection||(this.workMonitorCollection=new window.WorkMonitorCollection),this.workMonitorView||(this.workMonitorView=new window.WorkMonitorView({collection:this.workMonitorCollection})),void this.workMonitorView.render()):void this.waitForInit(this.workMonitor.bind(this))},queryManagement:function(a){return this.checkUser(),a?(this.queryManagementView||(this.queryManagementView=new window.QueryManagementView({collection:void 0})),void this.queryManagementView.render()):void this.waitForInit(this.queryManagement.bind(this))},databases:function(a){if(this.checkUser(),!a)return void this.waitForInit(this.databases.bind(this));var b=function(a){a?(arangoHelper.arangoError("DB","Could not get list of allowed databases"),this.navigate("#",{trigger:!0}),$("#databaseNavi").css("display","none"),$("#databaseNaviSelect").css("display","none")):(this.databaseView||(this.databaseView=new window.DatabaseView({users:this.userCollection,collection:this.arangoDatabase})),this.databaseView.render())}.bind(this);arangoHelper.databaseAllowed(b)},dashboard:function(a){return this.checkUser(),a?(void 0===this.dashboardView&&(this.dashboardView=new window.DashboardView({dygraphConfig:window.dygraphConfig,database:this.arangoDatabase})),void this.dashboardView.render()):void this.waitForInit(this.dashboard.bind(this))},graphManagement:function(a){return this.checkUser(),a?(this.graphManagementView||(this.graphManagementView=new window.GraphManagementView({collection:new window.GraphCollection,collectionCollection:this.arangoCollectionsStore})),void this.graphManagementView.render()):void this.waitForInit(this.graphManagement.bind(this))},showGraph:function(a,b){return this.checkUser(),b?void(this.graphManagementView?this.graphManagementView.loadGraphViewer(a):(this.graphManagementView=new window.GraphManagementView({collection:new window.GraphCollection,collectionCollection:this.arangoCollectionsStore}),this.graphManagementView.render(a,!0))):void this.waitForInit(this.showGraph.bind(this),a)},applications:function(a){return this.checkUser(),a?(void 0===this.applicationsView&&(this.applicationsView=new window.ApplicationsView({collection:this.foxxList})),void this.applicationsView.reload()):void this.waitForInit(this.applications.bind(this))},handleSelectDatabase:function(a){return this.checkUser(),a?void this.naviView.handleSelectDatabase():void this.waitForInit(this.handleSelectDatabase.bind(this))},handleResize:function(){this.dashboardView&&this.dashboardView.resize(),this.graphManagementView&&this.graphManagementView.handleResize($("#content").width()),this.queryView&&this.queryView.resize(),this.graphViewer2&&this.graphViewer2.resize(),this.documentsView&&this.documentsView.resize(),this.documentView&&this.documentView.resize()},userPermissionView:function(a,b){if(this.checkUser(),b||null===b)this.userPermissionView=new window.UserPermissionView({collection:this.userCollection,databases:this.arangoDatabase,username:a}),this.userPermissionView.render();else if(b===!1)return void this.waitForInit(this.userPermissionView.bind(this),a)},userView:function(a,b){this.checkUser(),b||null===b?(this.userView=new window.UserView({collection:this.userCollection,username:a}),this.userView.render()):b===!1&&this.waitForInit(this.userView.bind(this),a)},userManagement:function(a){return this.checkUser(),a?(this.userManagementView||(this.userManagementView=new window.UserManagementView({collection:this.userCollection})),void this.userManagementView.render()):void this.waitForInit(this.userManagement.bind(this))},userProfile:function(a){return this.checkUser(),a?(this.userManagementView||(this.userManagementView=new window.UserManagementView({collection:this.userCollection})),void this.userManagementView.render(!0)):void this.waitForInit(this.userProfile.bind(this))},fetchDBS:function(a){var b=this,c=!1;this.coordinatorCollection.each(function(a){b.dbServers.push(new window.ClusterServers([],{host:a.get("address")}))}),this.initFinished=!0,_.each(this.dbServers,function(b){b.fetch({success:function(){c===!1&&a&&(a(),c=!0)}})})},getNewRoute:function(a){return"http://"+a},registerForUpdate:function(a){this.toUpdate.push(a),a.updateUrl()}})}(),function(){"use strict";var a=function(a,b){var c=[];c.push(window.modalView.createSuccessButton("Download Page",function(){window.open("https://www.arangodb.com/download","_blank"),window.modalView.hide()}));var d=[],e=window.modalView.createReadOnlyEntry.bind(window.modalView);d.push(e("current","Current",a.toString())),b.major&&d.push(e("major","Major",b.major.version)),b.minor&&d.push(e("minor","Minor",b.minor.version)),b.bugfix&&d.push(e("bugfix","Bugfix",b.bugfix.version)),window.modalView.show("modalTable.ejs","New Version Available",c,d)};window.checkVersion=function(){$.ajax({type:"GET",cache:!1,url:arangoHelper.databaseUrl("/_api/version"),contentType:"application/json",processData:!1,async:!0,success:function(b){var c=window.versionHelper.fromString(b.version);$(".navbar #currentVersion").text(" "+b.version.substr(0,3)),window.parseVersions=function(b){return _.isEmpty(b)?void $("#currentVersion").addClass("up-to-date"):($("#currentVersion").addClass("out-of-date"),void $("#currentVersion").click(function(){a(c,b)}))},$.ajax({type:"GET",async:!0,crossDomain:!0,timeout:3e3,dataType:"jsonp",url:"https://www.arangodb.com/repositories/versions.php?jsonp=parseVersions&version="+encodeURIComponent(c.toString())})}})}}(),function(){"use strict";window.hasOwnProperty("TEST_BUILD")||($(document).ajaxSend(function(a,b,c){var d=window.arangoHelper.getCurrentJwt();d&&b.setRequestHeader("Authorization","bearer "+d)}),$(document).ready(function(){window.App=new window.Router,Backbone.history.start(),window.App.handleResize()}),$(document).click(function(a){a.stopPropagation(),$(a.target).hasClass("subBarDropdown")||$(a.target).hasClass("dropdown-header")||$(a.target).hasClass("dropdown-footer")||$(a.target).hasClass("toggle")||$("#userInfo").is(":visible")&&$(".subBarDropdown").hide()}))}(); \ No newline at end of file +})}(),function(){"use strict";window.FoxxCollection=Backbone.Collection.extend({model:window.Foxx,sortOptions:{desc:!1},url:arangoHelper.databaseUrl("/_admin/aardvark/foxxes"),comparator:function(a,b){var c,d;return this.sortOptions.desc===!0?(c=a.get("mount"),d=b.get("mount"),d>c?1:c>d?-1:0):(c=a.get("mount"),d=b.get("mount"),c>d?1:d>c?-1:0)},setSortingDesc:function(a){this.sortOptions.desc=a},installFromGithub:function(a,b,c,d){var e=arangoHelper.databaseUrl("/_admin/aardvark/foxxes/git?mount="+encodeURIComponent(b));void 0!==d&&(e+=d?"&replace=true":"&upgrade=true"),$.ajax({cache:!1,type:"PUT",url:e,data:JSON.stringify(a),contentType:"application/json",processData:!1,success:function(a){c(a)},error:function(a){c(a)}})},installFromStore:function(a,b,c,d){var e=arangoHelper.databaseUrl("/_admin/aardvark/foxxes/store?mount="+encodeURIComponent(b));void 0!==d&&(e+=d?"&replace=true":"&upgrade=true"),$.ajax({cache:!1,type:"PUT",url:e,data:JSON.stringify(a),contentType:"application/json",processData:!1,success:function(a){c(a)},error:function(a){c(a)}})},installFromZip:function(a,b,c,d){var e=arangoHelper.databaseUrl("/_admin/aardvark/foxxes/zip?mount="+encodeURIComponent(b));void 0!==d&&(e+=d?"&replace=true":"&upgrade=true"),$.ajax({cache:!1,type:"PUT",url:e,data:JSON.stringify({zipFile:a}),contentType:"application/json",processData:!1,success:function(a){c(a)},error:function(a){c(a)}})},generate:function(a,b,c,d){var e=arangoHelper.databaseUrl("/_admin/aardvark/foxxes/generate?mount="+encodeURIComponent(b));void 0!==d&&(e+=d?"&replace=true":"&upgrade=true"),$.ajax({cache:!1,type:"PUT",url:e,data:JSON.stringify(a),contentType:"application/json",processData:!1,success:function(a){c(a)},error:function(a){c(a)}})}})}(),function(){"use strict";window.GraphCollection=Backbone.Collection.extend({model:window.Graph,sortOptions:{desc:!1},url:arangoHelper.databaseUrl("/_api/gharial"),dropAndDeleteGraph:function(a,b){$.ajax({type:"DELETE",url:arangoHelper.databaseUrl("/_api/gharial/")+encodeURIComponent(a)+"?dropCollections=true",contentType:"application/json",processData:!0,success:function(){b(!0)},error:function(){b(!1)}})},comparator:function(a,b){var c=a.get("_key")||"",d=b.get("_key")||"";return c=c.toLowerCase(),d=d.toLowerCase(),this.sortOptions.desc===!0?d>c?1:c>d?-1:0:c>d?1:d>c?-1:0},setSortingDesc:function(a){this.sortOptions.desc=a},parse:function(a){return a.error?void 0:a.graphs}})}(),function(){"use strict";window.NotificationCollection=Backbone.Collection.extend({model:window.Notification,url:""})}(),function(){"use strict";window.QueryManagementActive=Backbone.Collection.extend({model:window.queryManagementModel,url:function(){var a=frontendConfig.basePath+"/_api/query/current";return"_system"!==window.frontendConfig.db&&(a=arangoHelper.databaseUrl("/_api/query/current")),a},killRunningQuery:function(a,b){var c=frontendConfig.basePath+"/_api/query/"+encodeURIComponent(a);"_system"!==window.frontendConfig.db&&(c=arangoHelper.databaseUrl("/_api/query/"+encodeURIComponent(a))),$.ajax({url:c,type:"DELETE",success:function(a){b()}})}})}(),function(){"use strict";window.QueryManagementSlow=Backbone.Collection.extend({model:window.queryManagementModel,url:function(){var a=frontendConfig.basePath+"/_api/query/slow";return"_system"!==window.frontendConfig.db&&(a=arangoHelper.databaseUrl("/_api/query/slow")),a},deleteSlowQueryHistory:function(a){var b=frontendConfig.basePath+"/_api/query/slow";"_system"!==window.frontendConfig.db&&(b=arangoHelper.databaseUrl("/_api/query/slow")),$.ajax({url:b,type:"DELETE",success:function(b){a()}})}})}(),function(){"use strict";window.WorkMonitorCollection=Backbone.Collection.extend({model:window.workMonitorModel,url:"/_admin/work-monitor",parse:function(a){return a.work}})}(),function(){"use strict";window.PaginationView=Backbone.View.extend({collection:null,paginationDiv:"",idPrefix:"",rerender:function(){},jumpTo:function(a){this.collection.setPage(a),this.rerender()},firstPage:function(){this.jumpTo(1)},lastPage:function(){this.jumpTo(this.collection.getLastPageNumber())},firstDocuments:function(){this.jumpTo(1)},lastDocuments:function(){this.jumpTo(this.collection.getLastPageNumber())},prevDocuments:function(){this.jumpTo(this.collection.getPage()-1)},nextDocuments:function(){this.jumpTo(this.collection.getPage()+1)},renderPagination:function(){$(this.paginationDiv).html("");var a=this,b=this.collection.getPage(),c=this.collection.getLastPageNumber(),d=$(this.paginationDiv),e={page:b,lastPage:c,click:function(b){var c=window.location.hash.split("/");"documents"===c[2]?(e.page=b,window.location.hash=c[0]+"/"+c[1]+"/"+c[2]+"/"+b):(a.jumpTo(b),e.page=b)}};d.html(""),d.pagination(e),$(this.paginationDiv).prepend('
    '),$(this.paginationDiv).append('
    ')}})}(),function(){"use strict";window.ApplicationDetailView=Backbone.View.extend({el:"#content",divs:["#readme","#swagger","#app-info","#sideinformation","#information","#settings"],navs:["#service-info","#service-api","#service-readme","#service-settings"],template:templateEngine.createTemplate("applicationDetailView.ejs"),events:{"click .open":"openApp","click .delete":"deleteApp","click #app-deps":"showDepsDialog","click #app-switch-mode":"toggleDevelopment","click #app-scripts [data-script]":"runScript","click #app-tests":"runTests","click #app-replace":"replaceApp","click #download-app":"downloadApp","click .subMenuEntries li":"changeSubview","click #jsonLink":"toggleSwagger","mouseenter #app-scripts":"showDropdown","mouseleave #app-scripts":"hideDropdown"},resize:function(a){a?$(".innerContent").css("height","auto"):($(".innerContent").height($(".centralRow").height()-150),$("#swagger iframe").height($(".centralRow").height()-150),$("#swagger #swaggerJsonContent").height($(".centralRow").height()-150))},toggleSwagger:function(){var a=function(a){$("#jsonLink").html("JSON"),this.jsonEditor.setValue(JSON.stringify(a,null," "),1),$("#swaggerJsonContent").show(),$("#swagger iframe").hide()}.bind(this);if("Swagger"===$("#jsonLink").html()){var b=arangoHelper.databaseUrl("/_admin/aardvark/foxxes/docs/swagger.json?mount="+encodeURIComponent(this.model.get("mount")));arangoHelper.download(b,a)}else $("#swaggerJsonContent").hide(),$("#swagger iframe").show(),$("#jsonLink").html("Swagger")},changeSubview:function(a){_.each(this.navs,function(a){$(a).removeClass("active")}),$(a.currentTarget).addClass("active"),_.each(this.divs,function(a){$(".headerButtonBar").hide(),$(a).hide()}),"service-readme"===a.currentTarget.id?(this.resize(!0),$("#readme").show()):"service-api"===a.currentTarget.id?(this.resize(),$("#swagger").show()):"service-info"===a.currentTarget.id?(this.resize(!0),this.render(),$("#information").show(),$("#sideinformation").show()):"service-settings"===a.currentTarget.id&&(this.resize(!0),this.showConfigDialog(),$(".headerButtonBar").show(),$("#settings").show())},downloadApp:function(){this.model.isSystem()||this.model.download()},replaceApp:function(){var a=this.model.get("mount");window.foxxInstallView.upgrade(a,function(){window.App.applicationDetail(encodeURIComponent(a))}),$(".createModalDialog .arangoHeader").html("Replace Service"),$("#infoTab").click()},updateConfig:function(){this.model.getConfiguration(function(){$("#app-warning")[this.model.needsAttention()?"show":"hide"](),$("#app-warning-config")[this.model.needsConfiguration()?"show":"hide"](),this.model.needsConfiguration()?$("#app-config").addClass("error"):$("#app-config").removeClass("error")}.bind(this))},updateDeps:function(){this.model.getDependencies(function(){$("#app-warning")[this.model.needsAttention()?"show":"hide"](),$("#app-warning-deps")[this.model.hasUnconfiguredDependencies()?"show":"hide"](),this.model.hasUnconfiguredDependencies()?$("#app-deps").addClass("error"):$("#app-deps").removeClass("error")}.bind(this))},toggleDevelopment:function(){this.model.toggleDevelopment(!this.model.isDevelopment(),function(){this.model.isDevelopment()?($(".app-switch-mode").text("Set Production"),$("#app-development-indicator").css("display","inline"),$("#app-development-path").css("display","inline")):($(".app-switch-mode").text("Set Development"),$("#app-development-indicator").css("display","none"),$("#app-development-path").css("display","none"))}.bind(this))},runScript:function(a){a.preventDefault();var b=$(a.currentTarget).attr("data-script"),c=[window.modalView.createBlobEntry("app_script_arguments","Script arguments","",null,"optional",!1,[{rule:function(a){return a&&JSON.parse(a)},msg:"Must be well-formed JSON or empty"}])],d=[window.modalView.createSuccessButton("Run script",function(){var a=$("#app_script_arguments").val();a=a&&JSON.parse(a),window.modalView.hide(),this.model.runScript(b,a,function(a,c){var d;d=a?"

    The script failed with an error"+(a.statusCode?" (HTTP "+a.statusCode+")":"")+":

    "+a.message+"
    ":c?"

    Script results:

    "+JSON.stringify(c,null,2)+"
    ":"

    The script ran successfully.

    ",window.modalView.show("modalTable.ejs",'Result of script "'+b+'"',void 0,void 0,void 0,d)})}.bind(this))];window.modalView.show("modalTable.ejs",'Run script "'+b+'" on "'+this.model.get("mount")+'"',d,c)},showSwagger:function(a){a.preventDefault(),this.render("swagger")},showReadme:function(a){a.preventDefault(),this.render("readme")},runTests:function(a){a.preventDefault();var b="

    WARNING: Running tests may result in destructive side-effects including data loss. Please make sure not to run tests on a production database.

    ";this.model.isDevelopment()&&(b+="

    WARNING: This app is running in development mode. If any of the tests access the app's HTTP API they may become non-deterministic.

    ");var c=[window.modalView.createSuccessButton("Run tests",function(){window.modalView.hide(),this.model.runTests({reporter:"suite"},function(a,b){window.modalView.show("modalTestResults.ejs","Test results",void 0,void 0,void 0,a||b)})}.bind(this))];window.modalView.show("modalTable.ejs",'Run tests for app "'+this.model.get("mount")+'"',c,void 0,void 0,b)},render:function(a){return this.resize(),this.model.fetchThumbnail(function(){var b=function(b,c){var d=this;b?arangoHelper.arangoError("DB","Could not get current database"):($(this.el).html(this.template.render({app:this.model,baseUrl:arangoHelper.databaseUrl("",c),mode:a})),d.jsonEditor=ace.edit("swaggerJsonEditor"),d.jsonEditor.setReadOnly(!0),d.jsonEditor.getSession().setMode("ace/mode/json"),$.ajax({url:this.appUrl(c),headers:{accept:"text/html,*/*;q=0.9"}}).success(function(){$(".open",this.el).prop("disabled",!1)}.bind(this)),this.updateConfig(),this.updateDeps(),"swagger"===a&&$.get("./foxxes/docs/swagger.json?mount="+encodeURIComponent(this.model.get("mount")),function(a){Object.keys(a.paths).length<1&&(d.render("readme"),$("#app-show-swagger").attr("disabled","true"))})),this.breadcrumb()}.bind(this);arangoHelper.currentDatabase(b),_.isEmpty(this.model.get("config"))&&$("#service-settings").attr("disabled",!0)}.bind(this)),$(this.el)},breadcrumb:function(){var a="Service: "+this.model.get("name")+'',b='

    Contributors:';this.model.get("contributors")&&this.model.get("contributors").length>0?_.each(this.model.get("contributors"),function(a){b+=''+a.name+""}):b+="No contributors",b+="

    ",$(".information").append(b),this.model.get("author")&&$(".information").append('

    Author:'+this.model.get("author")+"

    "),this.model.get("mount")&&$(".information").append('

    Mount:'+this.model.get("mount")+"

    "),this.model.get("development")&&this.model.get("path")&&$(".information").append('

    Path:'+this.model.get("path")+"

    "),$("#subNavigationBar .breadcrumb").html(a)},openApp:function(){var a=function(a,b){a?arangoHelper.arangoError("DB","Could not get current database"):window.open(this.appUrl(b),this.model.get("title")).focus()}.bind(this);arangoHelper.currentDatabase(a)},deleteApp:function(){var a=[window.modalView.createDeleteButton("Delete",function(){var a={teardown:$("#app_delete_run_teardown").is(":checked")};this.model.destroy(a,function(a,b){a||b.error!==!1||(window.modalView.hide(),window.App.navigate("services",{trigger:!0}))})}.bind(this))],b=[window.modalView.createCheckboxEntry("app_delete_run_teardown","Run teardown?",!0,"Should this app's teardown script be executed before removing the app?",!0)];window.modalView.show("modalTable.ejs",'Delete Foxx App mounted at "'+this.model.get("mount")+'"',a,b,void 0,"

    Are you sure? There is no way back...

    ",!0)},appUrl:function(a){return arangoHelper.databaseUrl(this.model.get("mount"),a)},applyConfig:function(){var a={};_.each(this.model.get("config"),function(b,c){var d=$("#app_config_"+c),e=d.val();if("boolean"===b.type||"bool"===b.type)return void(a[c]=d.is(":checked"));if(""===e&&b.hasOwnProperty("default"))return a[c]=b["default"],void("json"===b.type&&(a[c]=JSON.stringify(b["default"])));if("number"===b.type)a[c]=parseFloat(e);else if("integer"===b.type||"int"===b.type)a[c]=parseInt(e,10);else{if("json"!==b.type)return void(a[c]=window.arangoHelper.escapeHtml(e));a[c]=e&&JSON.stringify(JSON.parse(e))}}),this.model.setConfiguration(a,function(){this.updateConfig(),arangoHelper.arangoNotification(this.model.get("name"),"Settings applied.")}.bind(this))},showConfigDialog:function(){if(_.isEmpty(this.model.get("config")))return void $("#settings .buttons").html($("#hidden_buttons").html());var a=_.map(this.model.get("config"),function(a,b){var c=void 0===a["default"]?"":String(a["default"]),d=void 0===a.current?"":String(a.current),e="createTextEntry",f=!1,g=[];return"boolean"===a.type||"bool"===a.type?(e="createCheckboxEntry",a["default"]=a["default"]||!1,c=a["default"]||!1,d=a.current||!1):"json"===a.type?(e="createBlobEntry",c=void 0===a["default"]?"":JSON.stringify(a["default"]),d=void 0===a.current?"":a.current,g.push({rule:function(a){return a&&JSON.parse(a)},msg:"Must be well-formed JSON or empty."})):"integer"===a.type||"int"===a.type?g.push({rule:Joi.number().integer().optional().allow(""),msg:"Has to be an integer."}):"number"===a.type?g.push({rule:Joi.number().optional().allow(""),msg:"Has to be a number."}):("password"===a.type&&(e="createPasswordEntry"),g.push({rule:Joi.string().optional().allow(""),msg:"Has to be a string."})),void 0===a["default"]&&a.required!==!1&&(f=!0,g.unshift({rule:Joi.any().required(),msg:"This field is required."})),window.modalView[e]("app_config_"+b,b,d,a.description,c,f,g)}),b=[window.modalView.createSuccessButton("Apply",this.applyConfig.bind(this))];window.modalView.show("modalTable.ejs","Configuration",b,a,null,null,null,null,null,"settings"),$(".modal-footer").prepend($("#hidden_buttons").html())},applyDeps:function(){var a={};_.each(this.model.get("deps"),function(b,c){var d=$("#app_deps_"+c);a[c]=window.arangoHelper.escapeHtml(d.val())}),this.model.setDependencies(a,function(){window.modalView.hide(),this.updateDeps()}.bind(this))},showDepsDialog:function(){if(!_.isEmpty(this.model.get("deps"))){var a=_.map(this.model.get("deps"),function(a,b){var c=void 0===a.current?"":String(a.current),d="",e=a.definition.name;"*"!==a.definition.version&&(e+="@"+a.definition.version);var f=[{rule:Joi.string().optional().allow(""),msg:"Has to be a string."}];return a.definition.required&&f.push({rule:Joi.string().required(),msg:"This value is required."}),window.modalView.createTextEntry("app_deps_"+b,a.title,c,e,d,a.definition.required,f)}),b=[window.modalView.createSuccessButton("Apply",this.applyDeps.bind(this))];window.modalView.show("modalTable.ejs","Dependencies",b,a)}},showDropdown:function(){_.isEmpty(this.model.get("scripts"))||$("#scripts_dropdown").show(200)},hideDropdown:function(){$("#scripts_dropdown").hide()}})}(),function(){"use strict";window.ApplicationsView=Backbone.View.extend({el:"#content",template:templateEngine.createTemplate("applicationsView.ejs"),events:{"click #addApp":"createInstallModal","click #foxxToggle":"slideToggle","click #checkDevel":"toggleDevel","click #checkProduction":"toggleProduction","click #checkSystem":"toggleSystem"},fixCheckboxes:function(){this._showDevel?$("#checkDevel").attr("checked","checked"):$("#checkDevel").removeAttr("checked"),this._showSystem?$("#checkSystem").attr("checked","checked"):$("#checkSystem").removeAttr("checked"),this._showProd?$("#checkProduction").attr("checked","checked"):$("#checkProduction").removeAttr("checked"),$("#checkDevel").next().removeClass("fa fa-check-square-o fa-square-o").addClass("fa"),$("#checkSystem").next().removeClass("fa fa-check-square-o fa-square-o").addClass("fa"),$("#checkProduction").next().removeClass("fa fa-check-square-o fa-square-o").addClass("fa"),arangoHelper.setCheckboxStatus("#foxxDropdown")},toggleDevel:function(){var a=this;this._showDevel=!this._showDevel,_.each(this._installedSubViews,function(b){b.toggle("devel",a._showDevel)}),this.fixCheckboxes()},toggleProduction:function(){var a=this;this._showProd=!this._showProd,_.each(this._installedSubViews,function(b){b.toggle("production",a._showProd)}),this.fixCheckboxes()},toggleSystem:function(){this._showSystem=!this._showSystem;var a=this;_.each(this._installedSubViews,function(b){b.toggle("system",a._showSystem)}),this.fixCheckboxes()},reload:function(){var a=this;_.each(this._installedSubViews,function(a){a.undelegateEvents()}),this.collection.fetch({success:function(){a.createSubViews(),a.render()}})},createSubViews:function(){var a=this;this._installedSubViews={},a.collection.each(function(b){var c=new window.FoxxActiveView({model:b,appsView:a});a._installedSubViews[b.get("mount")]=c})},initialize:function(){this._installedSubViews={},this._showDevel=!0,this._showProd=!0,this._showSystem=!1},slideToggle:function(){$("#foxxToggle").toggleClass("activated"),$("#foxxDropdownOut").slideToggle(200)},createInstallModal:function(a){a.preventDefault(),window.foxxInstallView.install(this.reload.bind(this))},render:function(){this.collection.sort(),$(this.el).html(this.template.render({})),_.each(this._installedSubViews,function(a){$("#installedList").append(a.render())}),this.delegateEvents(),$("#checkDevel").attr("checked",this._showDevel),$("#checkProduction").attr("checked",this._showProd),$("#checkSystem").attr("checked",this._showSystem),arangoHelper.setCheckboxStatus("#foxxDropdown");var a=this;return _.each(this._installedSubViews,function(b){b.toggle("devel",a._showDevel),b.toggle("system",a._showSystem)}),arangoHelper.fixTooltips("icon_arangodb","left"),this}})}(),function(){"use strict";window.ClusterView=Backbone.View.extend({el:"#content",template:templateEngine.createTemplate("clusterView.ejs"),events:{},statsEnabled:!1,historyInit:!1,initDone:!1,interval:5e3,maxValues:100,knownServers:[],chartData:{},charts:{},nvcharts:[],startHistory:{},startHistoryAccumulated:{},initialize:function(a){var b=this;window.App.isCluster&&(this.dbServers=a.dbServers,this.coordinators=a.coordinators,this.updateServerTime(),window.setInterval(function(){if("#cluster"===window.location.hash||""===window.location.hash||"#"===window.location.hash){var a=function(a){b.rerenderValues(a),b.rerenderGraphs(a)};b.getCoordStatHistory(a)}},this.interval))},render:function(){this.$el.html(this.template.render({})),this.initDone||(void 0!==this.coordinators.first()?this.getServerStatistics():this.waitForCoordinators(),this.initDone=!0),this.initGraphs()},waitForCoordinators:function(){var a=this;window.setTimeout(function(){a.coordinators?a.getServerStatistics():a.waitForCoordinators()},500)},updateServerTime:function(){this.serverTime=(new Date).getTime()},getServerStatistics:function(){var a=this;this.data=void 0;var b=this.coordinators.first();this.statCollectCoord=new window.ClusterStatisticsCollection([],{host:b.get("address")}),this.statCollectDBS=new window.ClusterStatisticsCollection([],{host:b.get("address")});var c=[];_.each(this.dbServers,function(a){a.each(function(a){c.push(a)})}),_.each(c,function(c){if("ok"===c.get("status")){-1===a.knownServers.indexOf(c.id)&&a.knownServers.push(c.id);var d=new window.Statistics({name:c.id});d.url=b.get("protocol")+"://"+b.get("address")+"/_admin/clusterStatistics?DBserver="+c.get("name"),a.statCollectDBS.add(d)}}),this.coordinators.forEach(function(b){if("ok"===b.get("status")){-1===a.knownServers.indexOf(b.id)&&a.knownServers.push(b.id);var c=new window.Statistics({name:b.id});c.url=b.get("protocol")+"://"+b.get("address")+"/_admin/statistics",a.statCollectCoord.add(c)}});var d=function(b){a.rerenderValues(b),a.rerenderGraphs(b)};a.getCoordStatHistory(d),a.renderNodes()},rerenderValues:function(a){var b=this;b.renderNodes(),this.renderValue("#clusterConnections",Math.round(a.clientConnectionsCurrent)),this.renderValue("#clusterConnectionsAvg",Math.round(a.clientConnections15M));var c=a.physicalMemory,d=a.residentSizeCurrent;this.renderValue("#clusterRam",[d,c])},renderValue:function(a,b,c,d){if("number"==typeof b)$(a).html(b);else if($.isArray(b)){var e=b[0],f=b[1],g=1/(f/e)*100;g>90?c=!0:g>70&&90>g&&(d=!0),$(a).html(g.toFixed(1)+" %")}else"string"==typeof b&&$(a).html(b);c?($(a).addClass("negative"),$(a).removeClass("warning"),$(a).removeClass("positive")):d?($(a).addClass("warning"),$(a).removeClass("positive"),$(a).removeClass("negative")):($(a).addClass("positive"),$(a).removeClass("negative"),$(a).removeClass("warning"))},renderNodes:function(){var a=this,b=function(a){var b=0,c=0,d=0,e=0;_.each(a,function(a){"Coordinator"===a.Role?(b++,"GOOD"!==a.Status&&c++):"DBServer"===a.Role&&(d++,"GOOD"!==a.Status&&e++)}),c>0?this.renderValue("#clusterCoordinators",b-c+"/"+b,!0):this.renderValue("#clusterCoordinators",b),e>0?this.renderValue("#clusterDBServers",d-e+"/"+d,!0):this.renderValue("#clusterDBServers",d)}.bind(this);$.ajax({type:"GET",cache:!1,url:arangoHelper.databaseUrl("/_admin/cluster/health"),contentType:"application/json",processData:!1,async:!0,success:function(a){b(a.Health)},error:function(){a.renderValue("#clusterCoordinators","N/A",!0),a.renderValue("#clusterDBServers","N/A",!0)}})},initValues:function(){var a=["#clusterNodes","#clusterRam","#clusterConnections","#clusterConnectionsAvg"];_.each(a,function(a){$(a).html('')})},graphData:{data:{sent:[],received:[]},http:[],average:[]},checkArraySizes:function(){var a=this;_.each(a.chartsOptions,function(b,c){_.each(b.options,function(b,d){b.values.length>a.maxValues-1&&a.chartsOptions[c].options[d].values.shift()})})},formatDataForGraph:function(a){var b=this;b.historyInit?(b.checkArraySizes(),b.chartsOptions[0].options[0].values.push({x:a.times[a.times.length-1],y:a.bytesSentPerSecond[a.bytesSentPerSecond.length-1]}),b.chartsOptions[0].options[1].values.push({x:a.times[a.times.length-1],y:a.bytesReceivedPerSecond[a.bytesReceivedPerSecond.length-1]}),b.chartsOptions[1].options[0].values.push({x:a.times[a.times.length-1],y:b.calcTotalHttp(a.http,a.bytesSentPerSecond.length-1)}),b.chartsOptions[2].options[0].values.push({x:a.times[a.times.length-1],y:a.avgRequestTime[a.bytesSentPerSecond.length-1]/b.coordinators.length})):(_.each(a.times,function(c,d){b.chartsOptions[0].options[0].values.push({x:c,y:a.bytesSentPerSecond[d]}),b.chartsOptions[0].options[1].values.push({x:c,y:a.bytesReceivedPerSecond[d]}),b.chartsOptions[1].options[0].values.push({x:c,y:b.calcTotalHttp(a.http,d)}),b.chartsOptions[2].options[0].values.push({x:c,y:a.avgRequestTime[d]/b.coordinators.length})}),b.historyInit=!0)},chartsOptions:[{id:"#clusterData",type:"bytes",count:2,options:[{area:!0,values:[],key:"Bytes out",color:"rgb(23,190,207)",strokeWidth:2,fillOpacity:.1},{area:!0,values:[],key:"Bytes in",color:"rgb(188, 189, 34)",strokeWidth:2,fillOpacity:.1}]},{id:"#clusterHttp",type:"bytes",options:[{area:!0,values:[],key:"Bytes",color:"rgb(0, 166, 90)",fillOpacity:.1}]},{id:"#clusterAverage",data:[],type:"seconds",options:[{area:!0,values:[],key:"Seconds",color:"rgb(243, 156, 18)",fillOpacity:.1}]}],initGraphs:function(){var a=this,b="No data...";_.each(a.chartsOptions,function(c){nv.addGraph(function(){a.charts[c.id]=nv.models.stackedAreaChart().options({useInteractiveGuideline:!0,showControls:!1,noData:b,duration:0}),a.charts[c.id].xAxis.axisLabel("").tickFormat(function(a){var b=new Date(1e3*a);return(b.getHours()<10?"0":"")+b.getHours()+":"+(b.getMinutes()<10?"0":"")+b.getMinutes()+":"+(b.getSeconds()<10?"0":"")+b.getSeconds()}).staggerLabels(!1),a.charts[c.id].yAxis.axisLabel("").tickFormat(function(a){var b;return"bytes"===c.type?null===a?"N/A":(b=parseFloat(d3.format(".2f")(a)),prettyBytes(b)):"seconds"===c.type?null===a?"N/A":b=parseFloat(d3.format(".3f")(a)):void 0});var d,e=a.returnGraphOptions(c.id);return e.length>0?_.each(e,function(a,b){c.options[b].values=a}):c.options[0].values=[],d=c.options,a.chartData[c.id]=d3.select(c.id).append("svg").datum(d).transition().duration(300).call(a.charts[c.id]).each("start",function(){window.setTimeout(function(){d3.selectAll(c.id+" *").each(function(){this.__transition__&&(this.__transition__.duration=0)})},0)}),nv.utils.windowResize(a.charts[c.id].update),a.nvcharts.push(a.charts[c.id]),a.charts[c.id]})})},returnGraphOptions:function(a){var b=[];return b="#clusterData"===a?[this.chartsOptions[0].options[0].values,this.chartsOptions[0].options[1].values]:"#clusterHttp"===a?[this.chartsOptions[1].options[0].values]:"#clusterAverage"===a?[this.chartsOptions[2].options[0].values]:[]},rerenderGraphs:function(a){if(this.statsEnabled){var b,c,d=this;this.formatDataForGraph(a),_.each(d.chartsOptions,function(a){c=d.returnGraphOptions(a.id),c.length>0?_.each(c,function(b,c){a.options[c].values=b}):a.options[0].values=[],b=a.options,b[0].values.length>0&&d.historyInit&&d.charts[a.id]&&d.charts[a.id].update()})}},calcTotalHttp:function(a,b){var c=0;return _.each(a,function(a){c+=a[b]}),c},getCoordStatHistory:function(a){$.ajax({url:"statistics/coordshort",json:!0}).success(function(b){this.statsEnabled=b.enabled,a(b.data)}.bind(this))}})}(),function(){"use strict";window.CollectionListItemView=Backbone.View.extend({tagName:"div",className:"tile pure-u-1-1 pure-u-sm-1-2 pure-u-md-1-3 pure-u-lg-1-4 pure-u-xl-1-6",template:templateEngine.createTemplate("collectionsItemView.ejs"),initialize:function(a){this.collectionsView=a.collectionsView},events:{"click .iconSet.icon_arangodb_settings2":"createEditPropertiesModal","click .pull-left":"noop","click .icon_arangodb_settings2":"editProperties","click .spanInfo":"showProperties",click:"selectCollection"},render:function(){return this.model.get("locked")?($(this.el).addClass("locked"),$(this.el).addClass(this.model.get("lockType"))):$(this.el).removeClass("locked"),"loading"!==this.model.get("status")&&"unloading"!==this.model.get("status")||$(this.el).addClass("locked"),$(this.el).html(this.template.render({model:this.model})),$(this.el).attr("id","collection_"+this.model.get("name")),this},editProperties:function(a){return this.model.get("locked")?0:(a.stopPropagation(),void this.createEditPropertiesModal())},showProperties:function(a){return this.model.get("locked")?0:(a.stopPropagation(),void this.createInfoModal())},selectCollection:function(a){return $(a.target).hasClass("disabled")?0:this.model.get("locked")?0:"loading"===this.model.get("status")?0:void("unloaded"===this.model.get("status")?this.loadCollection():window.App.navigate("collection/"+encodeURIComponent(this.model.get("name"))+"/documents/1",{trigger:!0}))},noop:function(a){a.stopPropagation()},unloadCollection:function(){var a=function(a){a?arangoHelper.arangoError("Collection error",this.model.get("name")+" could not be unloaded."):void 0===a?(this.model.set("status","unloading"),this.render()):"#collections"===window.location.hash?(this.model.set("status","unloaded"),this.render()):arangoHelper.arangoNotification("Collection "+this.model.get("name")+" unloaded.")}.bind(this);this.model.unloadCollection(a),window.modalView.hide()},loadCollection:function(){var a=function(a){a?arangoHelper.arangoError("Collection error",this.model.get("name")+" could not be loaded."):void 0===a?(this.model.set("status","loading"),this.render()):"#collections"===window.location.hash?(this.model.set("status","loaded"),this.render()):arangoHelper.arangoNotification("Collection "+this.model.get("name")+" loaded.")}.bind(this);this.model.loadCollection(a),window.modalView.hide()},truncateCollection:function(){this.model.truncateCollection(),window.modalView.hide()},deleteCollection:function(){this.model.destroy({error:function(){arangoHelper.arangoError("Could not delete collection.")},success:function(){window.modalView.hide()}}),this.collectionsView.render()},saveModifiedCollection:function(){var a=function(a,b){if(a)arangoHelper.arangoError("Error","Could not get coordinator info");else{var c;c=b?this.model.get("name"):$("#change-collection-name").val();var d=this.model.get("status");if("loaded"===d){var e;try{e=JSON.parse(1024*$("#change-collection-size").val()*1024)}catch(f){return arangoHelper.arangoError("Please enter a valid number"),0}var g;try{if(g=JSON.parse($("#change-index-buckets").val()),1>g||parseInt(g,10)!==Math.pow(2,Math.log2(g)))throw new Error("invalid indexBuckets value")}catch(f){return arangoHelper.arangoError("Please enter a valid number of index buckets"),0}var h=function(a){a?arangoHelper.arangoError("Collection error: "+a.responseText):(this.collectionsView.render(),window.modalView.hide())}.bind(this),i=function(a){if(a)arangoHelper.arangoError("Collection error: "+a.responseText);else{var b=$("#change-collection-sync").val();this.model.changeCollection(b,e,g,h)}}.bind(this);frontendConfig.isCluster===!1?this.model.renameCollection(c,i):i()}else if("unloaded"===d)if(this.model.get("name")!==c){var j=function(a,b){a?arangoHelper.arangoError("Collection error: "+b.responseText):(this.collectionsView.render(),window.modalView.hide())}.bind(this);frontendConfig.isCluster===!1?this.model.renameCollection(c,j):j()}else window.modalView.hide()}}.bind(this);window.isCoordinator(a)},createEditPropertiesModal:function(){var a=function(a,b){if(a)arangoHelper.arangoError("Error","Could not get coordinator info");else{var c=!1;"loaded"===this.model.get("status")&&(c=!0);var d=[],e=[];b||e.push(window.modalView.createTextEntry("change-collection-name","Name",this.model.get("name"),!1,"",!0,[{rule:Joi.string().regex(/^[a-zA-Z]/),msg:"Collection name must always start with a letter."},{rule:Joi.string().regex(/^[a-zA-Z0-9\-_]*$/),msg:'Only Symbols "_" and "-" are allowed.'},{rule:Joi.string().required(),msg:"No collection name given."}]));var f=function(){e.push(window.modalView.createReadOnlyEntry("change-collection-id","ID",this.model.get("id"),"")),e.push(window.modalView.createReadOnlyEntry("change-collection-type","Type",this.model.get("type"),"")),e.push(window.modalView.createReadOnlyEntry("change-collection-status","Status",this.model.get("status"),"")),d.push(window.modalView.createDeleteButton("Delete",this.deleteCollection.bind(this))),d.push(window.modalView.createDeleteButton("Truncate",this.truncateCollection.bind(this))),c?d.push(window.modalView.createNotificationButton("Unload",this.unloadCollection.bind(this))):d.push(window.modalView.createNotificationButton("Load",this.loadCollection.bind(this))),d.push(window.modalView.createSuccessButton("Save",this.saveModifiedCollection.bind(this)));var a=["General","Indices"],b=["modalTable.ejs","indicesView.ejs"];window.modalView.show(b,"Modify Collection",d,e,null,null,this.events,null,a),"loaded"===this.model.get("status")?this.getIndex():$($("#infoTab").children()[1]).remove(); +}.bind(this);if(c){var g=function(a,b){if(a)arangoHelper.arangoError("Collection","Could not fetch properties");else{var c=b.journalSize/1048576,d=b.indexBuckets,g=b.waitForSync;e.push(window.modalView.createTextEntry("change-collection-size","Journal size",c,"The maximal size of a journal or datafile (in MB). Must be at least 1.","",!0,[{rule:Joi.string().allow("").optional().regex(/^[0-9]*$/),msg:"Must be a number."}])),e.push(window.modalView.createTextEntry("change-index-buckets","Index buckets",d,"The number of index buckets for this collection. Must be at least 1 and a power of 2.","",!0,[{rule:Joi.string().allow("").optional().regex(/^[1-9][0-9]*$/),msg:"Must be a number greater than 1 and a power of 2."}])),e.push(window.modalView.createSelectEntry("change-collection-sync","Wait for sync",g,"Synchronize to disk before returning from a create or update of a document.",[{value:!1,label:"No"},{value:!0,label:"Yes"}]))}f()};this.model.getProperties(g)}else f()}}.bind(this);window.isCoordinator(a)},bindIndexEvents:function(){this.unbindIndexEvents();var a=this;$("#indexEditView #addIndex").bind("click",function(){a.toggleNewIndexView(),$("#cancelIndex").unbind("click"),$("#cancelIndex").bind("click",function(){a.toggleNewIndexView()}),$("#createIndex").unbind("click"),$("#createIndex").bind("click",function(){a.createIndex()})}),$("#newIndexType").bind("change",function(){a.selectIndexType()}),$(".deleteIndex").bind("click",function(b){a.prepDeleteIndex(b)}),$("#infoTab a").bind("click",function(a){if($("#indexDeleteModal").remove(),"Indices"!==$(a.currentTarget).html()||$(a.currentTarget).parent().hasClass("active")||($("#newIndexView").hide(),$("#indexEditView").show(),$("#modal-dialog .modal-footer .button-danger").hide(),$("#modal-dialog .modal-footer .button-success").hide(),$("#modal-dialog .modal-footer .button-notification").hide()),"General"===$(a.currentTarget).html()&&!$(a.currentTarget).parent().hasClass("active")){$("#modal-dialog .modal-footer .button-danger").show(),$("#modal-dialog .modal-footer .button-success").show(),$("#modal-dialog .modal-footer .button-notification").show();var b=$(".index-button-bar2")[0];$("#cancelIndex").is(":visible")&&($("#cancelIndex").detach().appendTo(b),$("#createIndex").detach().appendTo(b))}})},unbindIndexEvents:function(){$("#indexEditView #addIndex").unbind("click"),$("#newIndexType").unbind("change"),$("#infoTab a").unbind("click"),$(".deleteIndex").unbind("click")},createInfoModal:function(){var a=function(a,b,c){if(a)arangoHelper.arangoError("Figures","Could not get revision.");else{var d=[],e={figures:c,revision:b,model:this.model};window.modalView.show("modalCollectionInfo.ejs","Collection: "+this.model.get("name"),d,e)}}.bind(this),b=function(b,c){if(b)arangoHelper.arangoError("Figures","Could not get figures.");else{var d=c;this.model.getRevision(a,d)}}.bind(this);this.model.getFigures(b)},resetIndexForms:function(){$("#indexHeader input").val("").prop("checked",!1),$("#newIndexType").val("Geo").prop("selected",!0),this.selectIndexType()},createIndex:function(){var a,b,c,d=this,e=$("#newIndexType").val(),f={};switch(e){case"Geo":a=$("#newGeoFields").val();var g=d.checkboxToValue("#newGeoJson"),h=d.checkboxToValue("#newGeoConstraint"),i=d.checkboxToValue("#newGeoIgnoreNull");f={type:"geo",fields:d.stringToArray(a),geoJson:g,constraint:h,ignoreNull:i};break;case"Hash":a=$("#newHashFields").val(),b=d.checkboxToValue("#newHashUnique"),c=d.checkboxToValue("#newHashSparse"),f={type:"hash",fields:d.stringToArray(a),unique:b,sparse:c};break;case"Fulltext":a=$("#newFulltextFields").val();var j=parseInt($("#newFulltextMinLength").val(),10)||0;f={type:"fulltext",fields:d.stringToArray(a),minLength:j};break;case"Skiplist":a=$("#newSkiplistFields").val(),b=d.checkboxToValue("#newSkiplistUnique"),c=d.checkboxToValue("#newSkiplistSparse"),f={type:"skiplist",fields:d.stringToArray(a),unique:b,sparse:c}}var k=function(a,b){if(a)if(b){var c=JSON.parse(b.responseText);arangoHelper.arangoError("Document error",c.errorMessage)}else arangoHelper.arangoError("Document error","Could not create index.");d.refreshCollectionsView()};window.modalView.hide(),d.model.createIndex(f,k)},lastTarget:null,prepDeleteIndex:function(a){var b=this;this.lastTarget=a,this.lastId=$(this.lastTarget.currentTarget).parent().parent().first().children().first().text(),$("#modal-dialog .modal-footer").after(''),$("#indexConfirmDelete").unbind("click"),$("#indexConfirmDelete").bind("click",function(){$("#indexDeleteModal").remove(),b.deleteIndex()}),$("#indexAbortDelete").unbind("click"),$("#indexAbortDelete").bind("click",function(){$("#indexDeleteModal").remove()})},refreshCollectionsView:function(){window.App.arangoCollectionsStore.fetch({success:function(){window.App.collectionsView.render()}})},deleteIndex:function(){var a=function(a){a?(arangoHelper.arangoError("Could not delete index"),$("tr th:contains('"+this.lastId+"')").parent().children().last().html(''),this.model.set("locked",!1),this.refreshCollectionsView()):a||void 0===a||($("tr th:contains('"+this.lastId+"')").parent().remove(),this.model.set("locked",!1),this.refreshCollectionsView()),this.refreshCollectionsView()}.bind(this);this.model.set("locked",!0),this.model.deleteIndex(this.lastId,a),$("tr th:contains('"+this.lastId+"')").parent().children().last().html('')},selectIndexType:function(){$(".newIndexClass").hide();var a=$("#newIndexType").val();$("#newIndexType"+a).show()},getIndex:function(){var a=function(a,b){a?window.arangoHelper.arangoError("Index",b.errorMessage):this.renderIndex(b)}.bind(this);this.model.getIndex(a)},renderIndex:function(a){this.index=a;var b="collectionInfoTh modal-text";if(this.index){var c="",d="";_.each(this.index.indexes,function(a){d="primary"===a.type||"edge"===a.type?'':'',void 0!==a.fields&&(c=a.fields.join(", "));var e=a.id.indexOf("/"),f=a.id.substr(e+1,a.id.length),g=a.hasOwnProperty("selectivityEstimate")?(100*a.selectivityEstimate).toFixed(2)+"%":"n/a",h=a.hasOwnProperty("sparse")?a.sparse:"n/a";$("#collectionEditIndexTable").append(""+f+""+a.type+""+a.unique+""+h+""+g+""+c+""+d+"")})}this.bindIndexEvents()},toggleNewIndexView:function(){var a=$(".index-button-bar2")[0];$("#indexEditView").is(":visible")?($("#indexEditView").hide(),$("#newIndexView").show(),$("#cancelIndex").detach().appendTo("#modal-dialog .modal-footer"),$("#createIndex").detach().appendTo("#modal-dialog .modal-footer")):($("#indexEditView").show(),$("#newIndexView").hide(),$("#cancelIndex").detach().appendTo(a),$("#createIndex").detach().appendTo(a)),arangoHelper.fixTooltips(".icon_arangodb, .arangoicon","right"),this.resetIndexForms()},stringToArray:function(a){var b=[];return a.split(",").forEach(function(a){a=a.replace(/(^\s+|\s+$)/g,""),""!==a&&b.push(a)}),b},checkboxToValue:function(a){return $(a).prop("checked")}})}(),function(){"use strict";window.CollectionsView=Backbone.View.extend({el:"#content",el2:"#collectionsThumbnailsIn",searchTimeout:null,refreshRate:1e4,template:templateEngine.createTemplate("collectionsView.ejs"),refetchCollections:function(){var a=this;this.collection.fetch({cache:!1,success:function(){a.checkLockedCollections()}})},checkLockedCollections:function(){var a=function(a,b){var c=this;a?console.log("Could not check locked collections"):(this.collection.each(function(a){a.set("locked",!1)}),_.each(b,function(a){var b=c.collection.findWhere({id:a.collection});b.set("locked",!0),b.set("lockType",a.type),b.set("desc",a.desc)}),this.collection.each(function(a){a.get("locked")||($("#collection_"+a.get("name")).find(".corneredBadge").removeClass("loaded unloaded"),$("#collection_"+a.get("name")+" .corneredBadge").text(a.get("status")),$("#collection_"+a.get("name")+" .corneredBadge").addClass(a.get("status"))),a.get("locked")||"loading"===a.get("status")?($("#collection_"+a.get("name")).addClass("locked"),a.get("locked")?($("#collection_"+a.get("name")).find(".corneredBadge").removeClass("loaded unloaded"),$("#collection_"+a.get("name")).find(".corneredBadge").addClass("inProgress"),$("#collection_"+a.get("name")+" .corneredBadge").text(a.get("desc"))):$("#collection_"+a.get("name")+" .corneredBadge").text(a.get("status"))):($("#collection_"+a.get("name")).removeClass("locked"),$("#collection_"+a.get("name")+" .corneredBadge").text(a.get("status")),$("#collection_"+a.get("name")+" .corneredBadge").hasClass("inProgress")&&($("#collection_"+a.get("name")+" .corneredBadge").text(a.get("status")),$("#collection_"+a.get("name")+" .corneredBadge").removeClass("inProgress"),$("#collection_"+a.get("name")+" .corneredBadge").addClass("loaded")),"unloaded"===a.get("status")&&$("#collection_"+a.get("name")+" .icon_arangodb_info").addClass("disabled"))}))}.bind(this);window.arangoHelper.syncAndReturnUninishedAardvarkJobs("index",a)},initialize:function(){var a=this;window.setInterval(function(){"#collections"===window.location.hash&&window.VISIBLE&&a.refetchCollections()},a.refreshRate)},render:function(){this.checkLockedCollections();var a=!1;$("#collectionsDropdown").is(":visible")&&(a=!0),$(this.el).html(this.template.render({})),this.setFilterValues(),a===!0&&$("#collectionsDropdown2").show();var b=this.collection.searchOptions;this.collection.getFiltered(b).forEach(function(a){$("#collectionsThumbnailsIn",this.el).append(new window.CollectionListItemView({model:a,collectionsView:this}).render().el)},this),"none"===$("#collectionsDropdown2").css("display")?$("#collectionsToggle").removeClass("activated"):$("#collectionsToggle").addClass("activated");var c;arangoHelper.setCheckboxStatus("#collectionsDropdown");try{c=b.searchPhrase.length}catch(d){}return $("#searchInput").val(b.searchPhrase),$("#searchInput").focus(),$("#searchInput")[0].setSelectionRange(c,c),arangoHelper.fixTooltips(".icon_arangodb, .arangoicon","left"),this},events:{"click #createCollection":"createCollection","keydown #searchInput":"restrictToSearchPhraseKey","change #searchInput":"restrictToSearchPhrase","click #searchSubmit":"restrictToSearchPhrase","click .checkSystemCollections":"checkSystem","click #checkLoaded":"checkLoaded","click #checkUnloaded":"checkUnloaded","click #checkDocument":"checkDocument","click #checkEdge":"checkEdge","click #sortName":"sortName","click #sortType":"sortType","click #sortOrder":"sortOrder","click #collectionsToggle":"toggleView","click .css-label":"checkBoxes"},updateCollectionsView:function(){var a=this;this.collection.fetch({cache:!1,success:function(){a.render()}})},toggleView:function(){$("#collectionsToggle").toggleClass("activated"),$("#collectionsDropdown2").slideToggle(200)},checkBoxes:function(a){var b=a.currentTarget.id;$("#"+b).click()},checkSystem:function(){var a=this.collection.searchOptions,b=a.includeSystem;a.includeSystem=$(".checkSystemCollections").is(":checked")===!0,b!==a.includeSystem&&this.render()},checkEdge:function(){var a=this.collection.searchOptions,b=a.includeEdge;a.includeEdge=$("#checkEdge").is(":checked")===!0,b!==a.includeEdge&&this.render()},checkDocument:function(){var a=this.collection.searchOptions,b=a.includeDocument;a.includeDocument=$("#checkDocument").is(":checked")===!0,b!==a.includeDocument&&this.render()},checkLoaded:function(){var a=this.collection.searchOptions,b=a.includeLoaded;a.includeLoaded=$("#checkLoaded").is(":checked")===!0,b!==a.includeLoaded&&this.render()},checkUnloaded:function(){var a=this.collection.searchOptions,b=a.includeUnloaded;a.includeUnloaded=$("#checkUnloaded").is(":checked")===!0,b!==a.includeUnloaded&&this.render()},sortName:function(){var a=this.collection.searchOptions,b=a.sortBy;a.sortBy=$("#sortName").is(":checked")===!0?"name":"type",b!==a.sortBy&&this.render()},sortType:function(){var a=this.collection.searchOptions,b=a.sortBy;a.sortBy=$("#sortType").is(":checked")===!0?"type":"name",b!==a.sortBy&&this.render()},sortOrder:function(){var a=this.collection.searchOptions,b=a.sortOrder;a.sortOrder=$("#sortOrder").is(":checked")===!0?-1:1,b!==a.sortOrder&&this.render()},setFilterValues:function(){var a=this.collection.searchOptions;$("#checkLoaded").attr("checked",a.includeLoaded),$("#checkUnloaded").attr("checked",a.includeUnloaded),$(".checkSystemCollections").attr("checked",a.includeSystem),$("#checkEdge").attr("checked",a.includeEdge),$("#checkDocument").attr("checked",a.includeDocument),$("#sortName").attr("checked","type"!==a.sortBy),$("#sortType").attr("checked","type"===a.sortBy),$("#sortOrder").attr("checked",1!==a.sortOrder)},search:function(){var a=this.collection.searchOptions,b=$("#searchInput").val();b!==a.searchPhrase&&(a.searchPhrase=b,this.render())},resetSearch:function(){this.searchTimeout&&(clearTimeout(this.searchTimeout),this.searchTimeout=null);var a=this.collection.searchOptions;a.searchPhrase=null},restrictToSearchPhraseKey:function(){var a=this;this.resetSearch(),a.searchTimeout=setTimeout(function(){a.search()},200)},restrictToSearchPhrase:function(){this.resetSearch(),this.search()},createCollection:function(a){a.preventDefault(),this.createNewCollectionModal()},submitCreateCollection:function(){var a=function(a,b){if(a)arangoHelper.arangoError("DB","Could not check coordinator state");else{var c=$("#new-collection-name").val(),d=$("#new-collection-size").val(),e=$("#new-replication-factor").val(),f=$("#new-collection-type").val(),g=$("#new-collection-sync").val(),h=1,i=[];if(""===e&&(e=1),b){if(h=$("#new-collection-shards").val(),""===h&&(h=1),h=parseInt(h,10),1>h)return arangoHelper.arangoError("Number of shards has to be an integer value greater or equal 1"),0;i=_.pluck($("#new-collection-shardBy").select2("data"),"text"),0===i.length&&i.push("_key")}if("_"===c.substr(0,1))return arangoHelper.arangoError('No "_" allowed as first character!'),0;var j=!1,k="true"===g;if(d>0)try{d=1024*JSON.parse(d)*1024}catch(l){return arangoHelper.arangoError("Please enter a valid number"),0}if(""===c)return arangoHelper.arangoError("No collection name entered!"),0;var m=function(a,b){if(a)try{b=JSON.parse(b.responseText),arangoHelper.arangoError("Error",b.errorMessage)}catch(c){}else this.updateCollectionsView();window.modalView.hide()}.bind(this);this.collection.newCollection({collName:c,wfs:k,isSystem:j,collSize:d,replicationFactor:e,collType:f,shards:h,shardBy:i},m)}}.bind(this);window.isCoordinator(a)},createNewCollectionModal:function(){var a=function(a,b){if(a)arangoHelper.arangoError("DB","Could not check coordinator state");else{var c=[],d=[],e={},f=[];d.push(window.modalView.createTextEntry("new-collection-name","Name","",!1,"",!0,[{rule:Joi.string().regex(/^[a-zA-Z]/),msg:"Collection name must always start with a letter."},{rule:Joi.string().regex(/^[a-zA-Z0-9\-_]*$/),msg:'Only symbols, "_" and "-" are allowed.'},{rule:Joi.string().required(),msg:"No collection name given."}])),d.push(window.modalView.createSelectEntry("new-collection-type","Type","","The type of the collection to create.",[{value:2,label:"Document"},{value:3,label:"Edge"}])),b&&(d.push(window.modalView.createTextEntry("new-collection-shards","Shards","","The number of shards to create. You cannot change this afterwards. Recommended: DBServers squared","",!0)),d.push(window.modalView.createSelect2Entry("new-collection-shardBy","shardBy","","The keys used to distribute documents on shards. Type the key and press return to add it.","_key",!1))),c.push(window.modalView.createSuccessButton("Save",this.submitCreateCollection.bind(this))),f.push(window.modalView.createTextEntry("new-collection-size","Journal size","","The maximal size of a journal or datafile (in MB). Must be at least 1.","",!1,[{rule:Joi.string().allow("").optional().regex(/^[0-9]*$/),msg:"Must be a number."}])),window.App.isCluster&&f.push(window.modalView.createTextEntry("new-replication-factor","Replication factor","","Numeric value. Must be at least 1. Description: TODO","",!1,[{rule:Joi.string().allow("").optional().regex(/^[0-9]*$/),msg:"Must be a number."}])),f.push(window.modalView.createSelectEntry("new-collection-sync","Wait for sync","","Synchronize to disk before returning from a create or update of a document.",[{value:!1,label:"No"},{value:!0,label:"Yes"}])),e.header="Advanced",e.content=f,window.modalView.show("modalTable.ejs","New Collection",c,d,e),$("#s2id_new-collection-shardBy .select2-search-field input").on("focusout",function(a){$(".select2-drop").is(":visible")&&($("#select2-search-field input").is(":focus")||window.setTimeout(function(){$(a.currentTarget).parent().parent().parent().select2("close")},200))})}}.bind(this);window.isCoordinator(a)}})}(),function(){"use strict";function a(a,b){return void 0!==a&&null!==a||(a=0),a.toFixed(b)}window.DashboardView=Backbone.View.extend({el:"#content",interval:1e4,defaultTimeFrame:12e5,defaultDetailFrame:1728e5,history:{},graphs:{},events:{"click .subViewNavbar .subMenuEntry":"toggleViews"},tendencies:{asyncPerSecondCurrent:["asyncPerSecondCurrent","asyncPerSecondPercentChange"],syncPerSecondCurrent:["syncPerSecondCurrent","syncPerSecondPercentChange"],clientConnectionsCurrent:["clientConnectionsCurrent","clientConnectionsPercentChange"],clientConnectionsAverage:["clientConnections15M","clientConnections15MPercentChange"],numberOfThreadsCurrent:["numberOfThreadsCurrent","numberOfThreadsPercentChange"],numberOfThreadsAverage:["numberOfThreads15M","numberOfThreads15MPercentChange"],virtualSizeCurrent:["virtualSizeCurrent","virtualSizePercentChange"],virtualSizeAverage:["virtualSize15M","virtualSize15MPercentChange"]},barCharts:{totalTimeDistribution:["queueTimeDistributionPercent","requestTimeDistributionPercent"],dataTransferDistribution:["bytesSentDistributionPercent","bytesReceivedDistributionPercent"]},barChartsElementNames:{queueTimeDistributionPercent:"Queue",requestTimeDistributionPercent:"Computation",bytesSentDistributionPercent:"Bytes sent",bytesReceivedDistributionPercent:"Bytes received"},getDetailFigure:function(a){var b=$(a.currentTarget).attr("id").replace(/ChartButton/g,"");return b},showDetail:function(a){var b,c=this,d=this.getDetailFigure(a);b=this.dygraphConfig.getDetailChartConfig(d),this.getHistoryStatistics(d),this.detailGraphFigure=d,window.modalView.hideFooter=!0,window.modalView.hide(),window.modalView.show("modalGraph.ejs",b.header,void 0,void 0,void 0,void 0,this.events),window.modalView.hideFooter=!1,$("#modal-dialog").on("hidden",function(){c.hidden()}),$("#modal-dialog").toggleClass("modal-chart-detail",!0),b.height=.7*$(window).height(),b.width=$(".modal-inner-detail").width(),b.labelsDiv=$(b.labelsDiv)[0],this.detailGraph=new Dygraph(document.getElementById("lineChartDetail"),this.history[this.server][d],b)},hidden:function(){this.detailGraph.destroy(),delete this.detailGraph,delete this.detailGraphFigure},getCurrentSize:function(a){"#"!==a.substr(0,1)&&(a="#"+a);var b,c;return $(a).attr("style",""),b=$(a).height(),c=$(a).width(),{height:b,width:c}},prepareDygraphs:function(){var a,b=this;this.dygraphConfig.getDashBoardFigures().forEach(function(c){a=b.dygraphConfig.getDefaultConfig(c);var d=b.getCurrentSize(a.div);a.height=d.height,a.width=d.width,b.graphs[c]=new Dygraph(document.getElementById(a.div),b.history[b.server][c]||[],a)})},initialize:function(a){this.options=a,this.dygraphConfig=a.dygraphConfig,this.d3NotInitialized=!0,this.events["click .dashboard-sub-bar-menu-sign"]=this.showDetail.bind(this),this.events["mousedown .dygraph-rangesel-zoomhandle"]=this.stopUpdating.bind(this),this.events["mouseup .dygraph-rangesel-zoomhandle"]=this.startUpdating.bind(this),this.serverInfo=a.serverToShow,this.serverInfo?this.server=this.serverInfo.target:this.server="-local-",this.history[this.server]={}},toggleViews:function(a){var b=a.currentTarget.id.split("-")[0],c=this,d=["replication","requests","system"];_.each(d,function(a){b!==a?$("#"+a).hide():($("#"+a).show(),c.resize(),$(window).resize())}),$(".subMenuEntries").children().removeClass("active"),$("#"+b+"-statistics").addClass("active"),window.setTimeout(function(){c.resize(),$(window).resize()},200)},updateCharts:function(){var a=this;return this.detailGraph?void this.updateLineChart(this.detailGraphFigure,!0):(this.prepareD3Charts(this.isUpdating),this.prepareResidentSize(this.isUpdating),this.updateTendencies(),void Object.keys(this.graphs).forEach(function(b){a.updateLineChart(b,!1)}))},updateTendencies:function(){var a=this,b=this.tendencies,c="";Object.keys(b).forEach(function(b){var d="",e=0;a.history.hasOwnProperty(a.server)&&a.history[a.server].hasOwnProperty(b)&&(e=a.history[a.server][b][1]),0>e?c="#d05448":(c="#77DB99",d="+"),a.history.hasOwnProperty(a.server)&&a.history[a.server].hasOwnProperty(b)?$("#"+b).html(a.history[a.server][b][0]+'
    '+d+e+"%"):$("#"+b).html('

    data not ready yet

    ')})},updateDateWindow:function(a,b){var c,d,e=(new Date).getTime();return b&&a.dateWindow_?(c=a.dateWindow_[0],d=e-a.dateWindow_[1]-5*this.interval>0?a.dateWindow_[1]:e,[c,d]):[e-this.defaultTimeFrame,e]},updateLineChart:function(a,b){var c=b?this.detailGraph:this.graphs[a],d={file:this.history[this.server][a],dateWindow:this.updateDateWindow(c,b)},e=0,f=[];_.each(d.file,function(a){var b=a[0].getSeconds()-a[0].getSeconds()%10;d.file[e][0].setSeconds(b),f.push(d.file[e][0]),e++});for(var g=new Date(Math.max.apply(null,f)),h=new Date(Math.min.apply(null,f)),i=new Date(h.getTime()),j=[],k=[];g>i;)i=new Date(i.setSeconds(i.getSeconds()+10)),k.push(i);_.each(k,function(a){var b=!1;_.each(d.file,function(c){Math.floor(a.getTime()/1e3)===Math.floor(c[0].getTime()/1e3)&&(b=!0)}),b===!1&&a1)){var f=0,g=0;9===c.length&&(f+=c[1],f+=c[6],f+=c[7],f+=c[8],g+=c[2],g+=c[3],g+=c[4],g+=c[5],c=[c[0],f,g]),d.history[d.server][e].unshift(c)}})},cutOffHistory:function(a,b){for(var c=this,d=c.history[c.server][a];0!==d.length&&!(d[d.length-1][0]>=b);)d.pop()},cutOffDygraphHistory:function(a){var b=this,c=new Date(a);this.dygraphConfig.getDashBoardFigures(!0).forEach(function(a){b.dygraphConfig.mapStatToFigure[a]&&b.history[b.server][a]&&b.cutOffHistory(a,c)})},mergeHistory:function(b){var c,d=this;for(c=0;c=0;--c)d.values.push({label:this.getLabel(b[a[0]].cuts,c),value:b[a[0]].values[c]}),e.values.push({label:this.getLabel(b[a[1]].cuts,c),value:b[a[1]].values[c]});return[d,e]},getLabel:function(a,b){return a[b]?0===b?"0 - "+a[b]:a[b-1]+" - "+a[b]:">"+a[b-1]},renderReplicationStatistics:function(a){$("#repl-numbers table tr:nth-child(1) > td:nth-child(2)").html(a.state.totalEvents),$("#repl-numbers table tr:nth-child(2) > td:nth-child(2)").html(a.state.totalRequests),$("#repl-numbers table tr:nth-child(3) > td:nth-child(2)").html(a.state.totalFailedConnects),a.state.lastAppliedContinuousTick?$("#repl-ticks table tr:nth-child(1) > td:nth-child(2)").html(a.state.lastAppliedContinuousTick):$("#repl-ticks table tr:nth-child(1) > td:nth-child(2)").html("no data available").addClass("no-data"),a.state.lastProcessedContinuousTick?$("#repl-ticks table tr:nth-child(2) > td:nth-child(2)").html(a.state.lastProcessedContinuousTick):$("#repl-ticks table tr:nth-child(2) > td:nth-child(2)").html("no data available").addClass("no-data"),a.state.lastAvailableContinuousTick?$("#repl-ticks table tr:nth-child(3) > td:nth-child(2)").html(a.state.lastAvailableContinuousTick):$("#repl-ticks table tr:nth-child(3) > td:nth-child(2)").html("no data available").addClass("no-data"),$("#repl-progress table tr:nth-child(1) > td:nth-child(2)").html(a.state.progress.message),$("#repl-progress table tr:nth-child(2) > td:nth-child(2)").html(a.state.progress.time),$("#repl-progress table tr:nth-child(3) > td:nth-child(2)").html(a.state.progress.failedConnects)},getReplicationStatistics:function(){var a=this;$.ajax(arangoHelper.databaseUrl("/_api/replication/applier-state"),{async:!0}).done(function(b){if(b.hasOwnProperty("state")){var c;c=b.state.running?"active":"inactive",c=''+c+"",$("#replication-chart .dashboard-sub-bar").html("Replication "+c),a.renderReplicationStatistics(b)}})},getStatistics:function(a,b){var c=this,d=arangoHelper.databaseUrl("/_admin/aardvark/statistics/short","_system"),e="?start=";e+=c.nextStart?c.nextStart:((new Date).getTime()-c.defaultTimeFrame)/1e3,"-local-"!==c.server&&(e+="&type=short&DBserver="+c.serverInfo.target,c.history.hasOwnProperty(c.server)||(c.history[c.server]={})),$.ajax(d+e,{async:!0,xhrFields:{withCredentials:!0},crossDomain:!0}).done(function(d){d.times.length>0&&(c.isUpdating=!0,c.mergeHistory(d)),c.isUpdating!==!1&&(a&&a(d.enabled,b),c.updateCharts())}).error(function(a){console.log("stat fetch req error:"+a)}),this.getReplicationStatistics()},getHistoryStatistics:function(a){var b=this,c="statistics/long",d="?filter="+this.dygraphConfig.mapStatToFigure[a].join();"-local-"!==b.server&&(c=b.server.endpoint+arangoHelper.databaseUrl("/_admin/aardvark/statistics/cluster"),d+="&type=long&DBserver="+b.server.target,b.history.hasOwnProperty(b.server)||(b.history[b.server]={}));var e=window.location.href.split("/"),f=e[0]+"//"+e[2]+"/"+e[3]+"/_system/"+e[5]+"/"+e[6]+"/";$.ajax(f+c+d,{async:!0}).done(function(c){var d;for(b.history[b.server][a]=[],d=0;d data not ready yet

    '),$("#totalTimeDistribution").prepend('

    data not ready yet

    '),$(".dashboard-bar-chart-title").append('

    data not ready yet

    '))},removeEmptyDataLabels:function(){$(".dataNotReadyYet").remove()},prepareResidentSize:function(b){var c=this,d=this.getCurrentSize("#residentSizeChartContainer"),e=c.history[c.server].residentSizeCurrent/1024/1024,f="";f=1025>e?a(e,2)+" MB":a(e/1024,2)+" GB";var g=a(100*c.history[c.server].residentSizePercent,2),h=[a(c.history[c.server].physicalMemory/1024/1024/1024,0)+" GB"];return void 0===c.history[c.server].residentSizeChart?void this.addEmptyDataLabels():(this.removeEmptyDataLabels(),void nv.addGraph(function(){var a=nv.models.multiBarHorizontalChart().x(function(a){return a.label}).y(function(a){return a.value}).width(d.width).height(d.height).margin({top:($("residentSizeChartContainer").outerHeight()-$("residentSizeChartContainer").height())/2,right:1,bottom:($("residentSizeChartContainer").outerHeight()-$("residentSizeChartContainer").height())/2,left:1}).showValues(!1).showYAxis(!1).showXAxis(!1).showLegend(!1).showControls(!1).stacked(!0);return a.yAxis.tickFormat(function(a){return a+"%"}).showMaxMin(!1),a.xAxis.showMaxMin(!1),d3.select("#residentSizeChart svg").datum(c.history[c.server].residentSizeChart).call(a),d3.select("#residentSizeChart svg").select(".nv-zeroLine").remove(),b&&(d3.select("#residentSizeChart svg").select("#total").remove(),d3.select("#residentSizeChart svg").select("#percentage").remove()),d3.select(".dashboard-bar-chart-title .percentage").html(f+" ("+g+" %)"),d3.select(".dashboard-bar-chart-title .absolut").html(h[0]),nv.utils.windowResize(a.update),a},function(){d3.selectAll("#residentSizeChart .nv-bar").on("click",function(){})}))},prepareD3Charts:function(b){var c=this,d={totalTimeDistribution:["queueTimeDistributionPercent","requestTimeDistributionPercent"],dataTransferDistribution:["bytesSentDistributionPercent","bytesReceivedDistributionPercent"]};this.d3NotInitialized&&(b=!1,this.d3NotInitialized=!1),_.each(Object.keys(d),function(b){var d=c.getCurrentSize("#"+b+"Container .dashboard-interior-chart"),e="#"+b+"Container svg";return void 0===c.history[c.server].residentSizeChart?void c.addEmptyDataLabels():(c.removeEmptyDataLabels(),void nv.addGraph(function(){var f=[0,.25,.5,.75,1],g=75,h=23,i=6;d.width<219?(f=[0,.5,1],g=72,h=21,i=5):d.width<299?(f=[0,.3334,.6667,1],g=77):d.width<379?g=87:d.width<459?g=95:d.width<539?g=100:d.width<619&&(g=105);var j=nv.models.multiBarHorizontalChart().x(function(a){return a.label}).y(function(a){return a.value}).width(d.width).height(d.height).margin({top:5,right:20,bottom:h,left:g}).showValues(!1).showYAxis(!0).showXAxis(!0).showLegend(!1).showControls(!1).forceY([0,1]);return j.yAxis.showMaxMin(!1),d3.select(".nv-y.nv-axis").selectAll("text").attr("transform","translate (0, "+i+")"),j.yAxis.tickValues(f).tickFormat(function(b){return a(100*b*100/100,0)+"%"}),d3.select(e).datum(c.history[c.server][b]).call(j),nv.utils.windowResize(j.update),j},function(){d3.selectAll(e+" .nv-bar").on("click",function(){})}))})},stopUpdating:function(){this.isUpdating=!1},startUpdating:function(){var a=this;a.timer||(a.timer=window.setInterval(function(){window.App.isCluster?window.location.hash.indexOf(a.serverInfo.target)>-1&&a.getStatistics():a.getStatistics()},a.interval))},resize:function(){if(this.isUpdating){var a,b=this;_.each(this.graphs,function(c){a=b.getCurrentSize(c.maindiv_.id),c.resize(a.width,a.height); +}),this.detailGraph&&(a=this.getCurrentSize(this.detailGraph.maindiv_.id),this.detailGraph.resize(a.width,a.height)),this.prepareD3Charts(!0),this.prepareResidentSize(!0)}},template:templateEngine.createTemplate("dashboardView.ejs"),render:function(a){var b=function(a,b){return b||$(this.el).html(this.template.render()),a&&"_system"===frontendConfig.db?(this.prepareDygraphs(),this.isUpdating&&(this.prepareD3Charts(),this.prepareResidentSize(),this.updateTendencies(),$(window).trigger("resize")),this.startUpdating(),void $(window).resize()):($(this.el).html(""),void(this.server?$(this.el).append('
    Server statistics ('+this.server+") are disabled.
    "):$(this.el).append('
    Server statistics are disabled.
    ')))}.bind(this),c=function(){$(this.el).html(""),$(".contentDiv").remove(),$(".headerBar").remove(),$(".dashboard-headerbar").remove(),$(".dashboard-row").remove(),$(this.el).append('
    You do not have permission to view this page.
    '),$(this.el).append("
    You can switch to '_system' to see the dashboard.
    ")}.bind(this);if("_system"!==frontendConfig.db)return void c();var d=function(d,e){d||(e?this.getStatistics(b,a):c())}.bind(this);void 0===window.App.currentDB.get("name")?window.setTimeout(function(){return"_system"!==window.App.currentDB.get("name")?void c():void this.options.database.hasSystemAccess(d)}.bind(this),300):this.options.database.hasSystemAccess(d)}})}(),function(){"use strict";window.DatabaseView=Backbone.View.extend({users:null,el:"#content",template:templateEngine.createTemplate("databaseView.ejs"),dropdownVisible:!1,currentDB:"",events:{"click #createDatabase":"createDatabase","click #submitCreateDatabase":"submitCreateDatabase","click .editDatabase":"editDatabase","click #userManagementView .icon":"editDatabase","click #selectDatabase":"updateDatabase","click #submitDeleteDatabase":"submitDeleteDatabase","click .contentRowInactive a":"changeDatabase","keyup #databaseSearchInput":"search","click #databaseSearchSubmit":"search","click #databaseToggle":"toggleSettingsDropdown","click .css-label":"checkBoxes","click #dbSortDesc":"sorting"},sorting:function(){$("#dbSortDesc").is(":checked")?this.collection.setSortingDesc(!0):this.collection.setSortingDesc(!1),$("#databaseDropdown").is(":visible")?this.dropdownVisible=!0:this.dropdownVisible=!1,this.render()},initialize:function(){this.collection.fetch({async:!0,cache:!1})},checkBoxes:function(a){var b=a.currentTarget.id;$("#"+b).click()},render:function(){var a=function(a,b){a?arangoHelper.arangoError("DB","Could not get current db properties"):(this.currentDB=b,this.collection.sort(),$(this.el).html(this.template.render({collection:this.collection,searchString:"",currentDB:this.currentDB})),this.dropdownVisible===!0&&($("#dbSortDesc").attr("checked",this.collection.sortOptions.desc),$("#databaseToggle").toggleClass("activated"),$("#databaseDropdown2").show()),arangoHelper.setCheckboxStatus("#databaseDropdown"),this.replaceSVGs())}.bind(this);return this.collection.getCurrentDatabase(a),this},toggleSettingsDropdown:function(){$("#dbSortDesc").attr("checked",this.collection.sortOptions.desc),$("#databaseToggle").toggleClass("activated"),$("#databaseDropdown2").slideToggle(200)},selectedDatabase:function(){return $("#selectDatabases").val()},handleError:function(a,b,c){return 409===a?void arangoHelper.arangoError("DB","Database "+c+" already exists."):400===a?void arangoHelper.arangoError("DB","Invalid Parameters"):403===a?void arangoHelper.arangoError("DB","Insufficent rights. Execute this from _system database"):void 0},validateDatabaseInfo:function(a,b){return""===b?(arangoHelper.arangoError("DB","You have to define an owner for the new database"),!1):""===a?(arangoHelper.arangoError("DB","You have to define a name for the new database"),!1):0===a.indexOf("_")?(arangoHelper.arangoError("DB ","Databasename should not start with _"),!1):a.match(/^[a-zA-Z][a-zA-Z0-9_\-]*$/)?!0:(arangoHelper.arangoError("DB","Databasename may only contain numbers, letters, _ and -"),!1)},createDatabase:function(a){a.preventDefault(),this.createAddDatabaseModal()},switchDatabase:function(a){if(!$(a.target).parent().hasClass("iconSet")){var b=$(a.currentTarget).find("h5").text();if(""!==b){var c=this.collection.createDatabaseURL(b);window.location.replace(c)}}},submitCreateDatabase:function(){var a=this,b=$("#newDatabaseName").val(),c=$("#newUser").val(),d={name:b};this.collection.create(d,{error:function(c,d){a.handleError(d.status,d.statusText,b)},success:function(d){"root"!==c&&$.ajax({type:"PUT",url:arangoHelper.databaseUrl("/_api/user/"+encodeURIComponent(c)+"/database/"+encodeURIComponent(b)),contentType:"application/json",data:JSON.stringify({grant:"rw"})}),$.ajax({type:"PUT",url:arangoHelper.databaseUrl("/_api/user/root/database/"+encodeURIComponent(b)),contentType:"application/json",data:JSON.stringify({grant:"rw"})}),"#databases"===window.location.hash&&a.updateDatabases(),arangoHelper.arangoNotification("Database "+d.get("name")+" created.")}}),arangoHelper.arangoNotification("Database creation in progress."),window.modalView.hide()},submitDeleteDatabase:function(a){var b=this.collection.where({name:a});b[0].destroy({wait:!0,url:arangoHelper.databaseUrl("/_api/database/"+a)}),this.updateDatabases(),window.App.naviView.dbSelectionView.render($("#dbSelect")),window.modalView.hide()},changeDatabase:function(a){var b=$(a.currentTarget).attr("id"),c=this.collection.createDatabaseURL(b);window.location.replace(c)},updateDatabases:function(){var a=this;this.collection.fetch({cache:!1,success:function(){a.render(),window.App.handleSelectDatabase()}})},editDatabase:function(a){var b=this.evaluateDatabaseName($(a.currentTarget).attr("id"),"_edit-database"),c=!0;b===this.currentDB&&(c=!1),this.createEditDatabaseModal(b,c)},search:function(){var a,b,c,d;a=$("#databaseSearchInput"),b=$("#databaseSearchInput").val(),d=this.collection.filter(function(a){return-1!==a.get("name").indexOf(b)}),$(this.el).html(this.template.render({collection:d,searchString:b,currentDB:this.currentDB})),this.replaceSVGs(),a=$("#databaseSearchInput"),c=a.val().length,a.focus(),a[0].setSelectionRange(c,c)},replaceSVGs:function(){$(".svgToReplace").each(function(){var a=$(this),b=a.attr("id"),c=a.attr("src");$.get(c,function(c){var d=$(c).find("svg");d.attr("id",b).attr("class","tile-icon-svg").removeAttr("xmlns:a"),a.replaceWith(d)},"xml")})},evaluateDatabaseName:function(a,b){var c=a.lastIndexOf(b);return a.substring(0,c)},createEditDatabaseModal:function(a,b){var c=[],d=[];d.push(window.modalView.createReadOnlyEntry("id_name","Name",a,"")),b?c.push(window.modalView.createDeleteButton("Delete",this.submitDeleteDatabase.bind(this,a))):c.push(window.modalView.createDisabledButton("Delete")),window.modalView.show("modalTable.ejs","Delete database",c,d)},createAddDatabaseModal:function(){var a=[],b=[];b.push(window.modalView.createTextEntry("newDatabaseName","Name","",!1,"Database Name",!0,[{rule:Joi.string().regex(/^[a-zA-Z]/),msg:"Database name must start with a letter."},{rule:Joi.string().regex(/^[a-zA-Z0-9\-_]*$/),msg:'Only Symbols "_" and "-" are allowed.'},{rule:Joi.string().required(),msg:"No database name given."}]));var c=[];window.App.userCollection.each(function(a){c.push({value:a.get("user"),label:a.get("user")})}),b.push(window.modalView.createSelectEntry("newUser","Username",null!==this.users?this.users.whoAmI():"root","Please define the owner of this database. This will be the only user having initial access to this database if authentication is turned on. Please note that if you specify a username different to your account you will not be able to access the database with your account after having creating it. Specifying a username is mandatory even with authentication turned off. If there is a failure you will be informed.",c)),a.push(window.modalView.createSuccessButton("Create",this.submitCreateDatabase.bind(this))),window.modalView.show("modalTable.ejs","Create Database",a,b),$("#useDefaultPassword").change(function(){"true"===$("#useDefaultPassword").val()?$("#row_newPassword").hide():$("#row_newPassword").show()}),$("#row_newPassword").hide()}})}(),function(){"use strict";window.DBSelectionView=Backbone.View.extend({template:templateEngine.createTemplate("dbSelectionView.ejs"),events:{"click .dbSelectionLink":"changeDatabase"},initialize:function(a){this.current=a.current},changeDatabase:function(a){var b=$(a.currentTarget).closest(".dbSelectionLink.tab").attr("id"),c=this.collection.createDatabaseURL(b);window.location.replace(c)},render:function(a){var b=function(b,c){b?arangoHelper.arangoError("DB","Could not fetch databases"):(this.$el=a,this.$el.html(this.template.render({list:c,current:this.current.get("name")})),this.delegateEvents())}.bind(this);return this.collection.getDatabasesForUser(b),this.el}})}(),function(){"use strict";window.DocumentsView=window.PaginationView.extend({filters:{0:!0},filterId:0,paginationDiv:"#documentsToolbarF",idPrefix:"documents",addDocumentSwitch:!0,activeFilter:!1,lastCollectionName:void 0,restoredFilters:[],editMode:!1,allowUpload:!1,el:"#content",table:"#documentsTableID",template:templateEngine.createTemplate("documentsView.ejs"),collectionContext:{prev:null,next:null},editButtons:["#deleteSelected","#moveSelected"],initialize:function(a){this.documentStore=a.documentStore,this.collectionsStore=a.collectionsStore,this.tableView=new window.TableView({el:this.table,collection:this.collection}),this.tableView.setRowClick(this.clicked.bind(this)),this.tableView.setRemoveClick(this.remove.bind(this))},resize:function(){$("#docPureTable").height($(".centralRow").height()-210),$("#docPureTable .pure-table-body").css("max-height",$("#docPureTable").height()-47)},setCollectionId:function(a,b){this.collection.setCollection(a),this.collection.setPage(b),this.page=b;var c=function(b,c){b?arangoHelper.arangoError("Error","Could not get collection properties."):(this.type=c,this.collection.getDocuments(this.getDocsCallback.bind(this)),this.collectionModel=this.collectionsStore.get(a))}.bind(this);arangoHelper.collectionApiType(a,null,c)},getDocsCallback:function(a){$("#documents_last").css("visibility","hidden"),$("#documents_first").css("visibility","hidden"),a?(window.progressView.hide(),arangoHelper.arangoError("Document error","Could not fetch requested documents.")):a&&void 0===a||(window.progressView.hide(),this.drawTable(),this.renderPaginationElements())},events:{"click #collectionPrev":"prevCollection","click #collectionNext":"nextCollection","click #filterCollection":"filterCollection","click #markDocuments":"editDocuments","click #importCollection":"importCollection","click #exportCollection":"exportCollection","click #filterSend":"sendFilter","click #addFilterItem":"addFilterItem","click .removeFilterItem":"removeFilterItem","click #deleteSelected":"deleteSelectedDocs","click #moveSelected":"moveSelectedDocs","click #addDocumentButton":"addDocumentModal","click #documents_first":"firstDocuments","click #documents_last":"lastDocuments","click #documents_prev":"prevDocuments","click #documents_next":"nextDocuments","click #confirmDeleteBtn":"confirmDelete","click .key":"nop",keyup:"returnPressedHandler","keydown .queryline input":"filterValueKeydown","click #importModal":"showImportModal","click #resetView":"resetView","click #confirmDocImport":"startUpload","click #exportDocuments":"startDownload","change #documentSize":"setPagesize","change #docsSort":"setSorting"},showSpinner:function(){$("#uploadIndicator").show()},hideSpinner:function(){$("#uploadIndicator").hide()},showImportModal:function(){$("#docImportModal").modal("show")},hideImportModal:function(){$("#docImportModal").modal("hide")},setPagesize:function(){var a=$("#documentSize").find(":selected").val();this.collection.setPagesize(a),this.collection.getDocuments(this.getDocsCallback.bind(this))},setSorting:function(){var a=$("#docsSort").val();""!==a&&void 0!==a&&null!==a||(a="_key"),this.collection.setSort(a)},returnPressedHandler:function(a){13===a.keyCode&&$(a.target).is($("#docsSort"))&&this.collection.getDocuments(this.getDocsCallback.bind(this)),13===a.keyCode&&$("#confirmDeleteBtn").attr("disabled")===!1&&this.confirmDelete()},nop:function(a){a.stopPropagation()},resetView:function(){var a=function(a){a&&arangoHelper.arangoError("Document","Could not fetch documents count")};$("input").val(""),$("select").val("=="),this.removeAllFilterItems(),$("#documentSize").val(this.collection.getPageSize()),$("#documents_last").css("visibility","visible"),$("#documents_first").css("visibility","visible"),this.addDocumentSwitch=!0,this.collection.resetFilter(),this.collection.loadTotal(a),this.restoredFilters=[],this.allowUpload=!1,this.files=void 0,this.file=void 0,$("#confirmDocImport").attr("disabled",!0),this.markFilterToggle(),this.collection.getDocuments(this.getDocsCallback.bind(this))},startDownload:function(){var a=this.collection.buildDownloadDocumentQuery();""!==a||void 0!==a||null!==a?window.open(encodeURI("query/result/download/"+btoa(JSON.stringify(a)))):arangoHelper.arangoError("Document error","could not download documents")},startUpload:function(){var a=function(a,b){a?(arangoHelper.arangoError("Upload",b),this.hideSpinner()):(this.hideSpinner(),this.hideImportModal(),this.resetView())}.bind(this);this.allowUpload===!0&&(this.showSpinner(),this.collection.uploadDocuments(this.file,a))},uploadSetup:function(){var a=this;$("#importDocuments").change(function(b){a.files=b.target.files||b.dataTransfer.files,a.file=a.files[0],$("#confirmDocImport").attr("disabled",!1),a.allowUpload=!0})},buildCollectionLink:function(a){return"collection/"+encodeURIComponent(a.get("name"))+"/documents/1"},markFilterToggle:function(){this.restoredFilters.length>0?$("#filterCollection").addClass("activated"):$("#filterCollection").removeClass("activated")},editDocuments:function(){$("#importCollection").removeClass("activated"),$("#exportCollection").removeClass("activated"),this.markFilterToggle(),$("#markDocuments").toggleClass("activated"),this.changeEditMode(),$("#filterHeader").hide(),$("#importHeader").hide(),$("#editHeader").slideToggle(200),$("#exportHeader").hide()},filterCollection:function(){$("#importCollection").removeClass("activated"),$("#exportCollection").removeClass("activated"),$("#markDocuments").removeClass("activated"),this.changeEditMode(!1),this.markFilterToggle(),this.activeFilter=!0,$("#importHeader").hide(),$("#editHeader").hide(),$("#exportHeader").hide(),$("#filterHeader").slideToggle(200);var a;for(a in this.filters)if(this.filters.hasOwnProperty(a))return void $("#attribute_name"+a).focus()},exportCollection:function(){$("#importCollection").removeClass("activated"),$("#filterHeader").removeClass("activated"),$("#markDocuments").removeClass("activated"),this.changeEditMode(!1),$("#exportCollection").toggleClass("activated"),this.markFilterToggle(),$("#exportHeader").slideToggle(200),$("#importHeader").hide(),$("#filterHeader").hide(),$("#editHeader").hide()},importCollection:function(){this.markFilterToggle(),$("#markDocuments").removeClass("activated"),this.changeEditMode(!1),$("#importCollection").toggleClass("activated"),$("#exportCollection").removeClass("activated"),$("#importHeader").slideToggle(200),$("#filterHeader").hide(),$("#editHeader").hide(),$("#exportHeader").hide()},changeEditMode:function(a){a===!1||this.editMode===!0?($("#docPureTable .pure-table-body .pure-table-row").css("cursor","default"),$(".deleteButton").fadeIn(),$(".addButton").fadeIn(),$(".selected-row").removeClass("selected-row"),this.editMode=!1,this.tableView.setRowClick(this.clicked.bind(this))):($("#docPureTable .pure-table-body .pure-table-row").css("cursor","copy"),$(".deleteButton").fadeOut(),$(".addButton").fadeOut(),$(".selectedCount").text(0),this.editMode=!0,this.tableView.setRowClick(this.editModeClick.bind(this)))},getFilterContent:function(){var a,b,c=[];for(a in this.filters)if(this.filters.hasOwnProperty(a)){b=$("#attribute_value"+a).val();try{b=JSON.parse(b)}catch(d){b=String(b)}""!==$("#attribute_name"+a).val()&&c.push({attribute:$("#attribute_name"+a).val(),operator:$("#operator"+a).val(),value:b})}return c},sendFilter:function(){this.restoredFilters=this.getFilterContent();var a=this;this.collection.resetFilter(),this.addDocumentSwitch=!1,_.each(this.restoredFilters,function(b){void 0!==b.operator&&a.collection.addFilter(b.attribute,b.operator,b.value)}),this.collection.setToFirst(),this.collection.getDocuments(this.getDocsCallback.bind(this)),this.markFilterToggle()},restoreFilter:function(){var a=this,b=0;this.filterId=0,$("#docsSort").val(this.collection.getSort()),_.each(this.restoredFilters,function(c){0!==b&&a.addFilterItem(),void 0!==c.operator&&($("#attribute_name"+b).val(c.attribute),$("#operator"+b).val(c.operator),$("#attribute_value"+b).val(c.value)),b++,a.collection.addFilter(c.attribute,c.operator,c.value)})},addFilterItem:function(){var a=++this.filterId;$("#filterHeader").append('
    '),this.filters[a]=!0,this.checkFilterState()},filterValueKeydown:function(a){13===a.keyCode&&this.sendFilter()},checkFilterState:function(){var a=$("#filterHeader .queryline").length;if(1===a)$("#filterHeader .removeFilterItem").remove();else if(0===$("#filterHeader .queryline").first().find(".removeFilterItem").length){var b=$("#filterHeader .queryline").first().children().first().attr("id"),c=b.substr(14,b.length);$("#filterHeader .queryline").first().find(".add-filter-item").after(' ')}0===$("#filterHeader .queryline").first().find(".add-filter-item").length&&$("#filterHeader .queryline").first().find(".filterValue").after('')},removeFilterItem:function(a){var b=a.currentTarget,c=b.id.replace(/^removeFilter/,"");delete this.filters[c],delete this.restoredFilters[c],$(b.parentElement).remove(),this.checkFilterState()},removeAllFilterItems:function(){var a,b=$("#filterHeader").children().length;for(a=1;b>=a;a++)$("#removeFilter"+a).parent().remove();this.filters={0:!0},this.filterId=0},addDocumentModal:function(){var a=window.location.hash.split("/")[1],b=[],c=[],d=function(a,d){a?arangoHelper.arangoError("Error","Could not fetch collection type"):"edge"===d?(c.push(window.modalView.createTextEntry("new-edge-from-attr","_from","","document _id: document handle of the linked vertex (incoming relation)",void 0,!1,[{rule:Joi.string().required(),msg:"No _from attribute given."}])),c.push(window.modalView.createTextEntry("new-edge-to","_to","","document _id: document handle of the linked vertex (outgoing relation)",void 0,!1,[{rule:Joi.string().required(),msg:"No _to attribute given."}])),c.push(window.modalView.createTextEntry("new-edge-key-attr","_key",void 0,"the edges unique key(optional attribute, leave empty for autogenerated key","is optional: leave empty for autogenerated key",!1,[{rule:Joi.string().allow("").optional(),msg:""}])),b.push(window.modalView.createSuccessButton("Create",this.addEdge.bind(this))),window.modalView.show("modalTable.ejs","Create edge",b,c)):(c.push(window.modalView.createTextEntry("new-document-key-attr","_key",void 0,"the documents unique key(optional attribute, leave empty for autogenerated key","is optional: leave empty for autogenerated key",!1,[{rule:Joi.string().allow("").optional(),msg:""}])),b.push(window.modalView.createSuccessButton("Create",this.addDocument.bind(this))),window.modalView.show("modalTable.ejs","Create document",b,c))}.bind(this);arangoHelper.collectionApiType(a,!0,d)},addEdge:function(){var a,b=window.location.hash.split("/")[1],c=$(".modal-body #new-edge-from-attr").last().val(),d=$(".modal-body #new-edge-to").last().val(),e=$(".modal-body #new-edge-key-attr").last().val(),f=function(b,c){if(b)arangoHelper.arangoError("Error","Could not create edge");else{window.modalView.hide(),c=c._id.split("/");try{a="collection/"+c[0]+"/"+c[1],decodeURI(a)}catch(d){a="collection/"+c[0]+"/"+encodeURIComponent(c[1])}window.location.hash=a}};""!==e||void 0!==e?this.documentStore.createTypeEdge(b,c,d,e,f):this.documentStore.createTypeEdge(b,c,d,null,f)},addDocument:function(){var a,b=window.location.hash.split("/")[1],c=$(".modal-body #new-document-key-attr").last().val(),d=function(b,c){if(b)arangoHelper.arangoError("Error","Could not create document");else{window.modalView.hide(),c=c.split("/");try{a="collection/"+c[0]+"/"+c[1],decodeURI(a)}catch(d){a="collection/"+c[0]+"/"+encodeURIComponent(c[1])}window.location.hash=a}};""!==c||void 0!==c?this.documentStore.createTypeDocument(b,c,d):this.documentStore.createTypeDocument(b,null,d)},moveSelectedDocs:function(){var a=[],b=[],c=this.getSelectedDocs();0!==c.length&&(b.push(window.modalView.createTextEntry("move-documents-to","Move to","",!1,"collection-name",!0,[{rule:Joi.string().regex(/^[a-zA-Z]/),msg:"Collection name must always start with a letter."},{rule:Joi.string().regex(/^[a-zA-Z0-9\-_]*$/),msg:'Only Symbols "_" and "-" are allowed.'},{rule:Joi.string().required(),msg:"No collection name given."}])),a.push(window.modalView.createSuccessButton("Move",this.confirmMoveSelectedDocs.bind(this))),window.modalView.show("modalTable.ejs","Move documents",a,b))},confirmMoveSelectedDocs:function(){var a=this.getSelectedDocs(),b=this,c=$(".modal-body").last().find("#move-documents-to").val(),d=function(){this.collection.getDocuments(this.getDocsCallback.bind(this)),$("#markDocuments").click(),window.modalView.hide()}.bind(this);_.each(a,function(a){b.collection.moveDocument(a,b.collection.collectionID,c,d)})},deleteSelectedDocs:function(){var a=[],b=[],c=this.getSelectedDocs();0!==c.length&&(b.push(window.modalView.createReadOnlyEntry(void 0,c.length+" documents selected","Do you want to delete all selected documents?",void 0,void 0,!1,void 0)),a.push(window.modalView.createDeleteButton("Delete",this.confirmDeleteSelectedDocs.bind(this))),window.modalView.show("modalTable.ejs","Delete documents",a,b))},confirmDeleteSelectedDocs:function(){var a=this.getSelectedDocs(),b=[],c=this;_.each(a,function(a){if("document"===c.type){var d=function(a){a?(b.push(!1),arangoHelper.arangoError("Document error","Could not delete document.")):(b.push(!0),c.collection.setTotalMinusOne(),c.collection.getDocuments(this.getDocsCallback.bind(this)),$("#markDocuments").click(),window.modalView.hide())}.bind(c);c.documentStore.deleteDocument(c.collection.collectionID,a,d)}else if("edge"===c.type){var e=function(a){a?(b.push(!1),arangoHelper.arangoError("Edge error","Could not delete edge")):(c.collection.setTotalMinusOne(),b.push(!0),c.collection.getDocuments(this.getDocsCallback.bind(this)),$("#markDocuments").click(),window.modalView.hide())}.bind(c);c.documentStore.deleteEdge(c.collection.collectionID,a,e)}})},getSelectedDocs:function(){var a=[];return _.each($("#docPureTable .pure-table-body .pure-table-row"),function(b){$(b).hasClass("selected-row")&&a.push($($(b).children()[1]).find(".key").text())}),a},remove:function(a){this.docid=$(a.currentTarget).parent().parent().prev().find(".key").text(),$("#confirmDeleteBtn").attr("disabled",!1),$("#docDeleteModal").modal("show")},confirmDelete:function(){$("#confirmDeleteBtn").attr("disabled",!0);var a=window.location.hash.split("/"),b=a[3];"source"!==b&&this.reallyDelete()},reallyDelete:function(){if("document"===this.type){var a=function(a){a?arangoHelper.arangoError("Error","Could not delete document"):(this.collection.setTotalMinusOne(),this.collection.getDocuments(this.getDocsCallback.bind(this)),$("#docDeleteModal").modal("hide"))}.bind(this);this.documentStore.deleteDocument(this.collection.collectionID,this.docid,a)}else if("edge"===this.type){var b=function(a){a?arangoHelper.arangoError("Edge error","Could not delete edge"):(this.collection.setTotalMinusOne(),this.collection.getDocuments(this.getDocsCallback.bind(this)),$("#docDeleteModal").modal("hide"))}.bind(this);this.documentStore.deleteEdge(this.collection.collectionID,this.docid,b)}},editModeClick:function(a){var b=$(a.currentTarget);b.hasClass("selected-row")?b.removeClass("selected-row"):b.addClass("selected-row");var c=this.getSelectedDocs();$(".selectedCount").text(c.length),_.each(this.editButtons,function(a){c.length>0?($(a).prop("disabled",!1),$(a).removeClass("button-neutral"),$(a).removeClass("disabled"),"#moveSelected"===a?$(a).addClass("button-success"):$(a).addClass("button-danger")):($(a).prop("disabled",!0),$(a).addClass("disabled"),$(a).addClass("button-neutral"),"#moveSelected"===a?$(a).removeClass("button-success"):$(a).removeClass("button-danger"))})},clicked:function(a){var b,c=a.currentTarget,d=$(c).attr("id").substr(4);try{b="collection/"+this.collection.collectionID+"/"+d,decodeURI(d)}catch(e){b="collection/"+this.collection.collectionID+"/"+encodeURIComponent(d)}window.location.hash=b},drawTable:function(){this.tableView.setElement($("#docPureTable")).render(),arangoHelper.fixTooltips(".icon_arangodb, .arangoicon","top"),$(".prettify").snippet("javascript",{style:"nedit",menu:!1,startText:!1,transparent:!0,showNum:!1}),this.resize()},checkCollectionState:function(){this.lastCollectionName===this.collectionName?this.activeFilter&&(this.filterCollection(),this.restoreFilter()):void 0!==this.lastCollectionName&&(this.collection.resetFilter(),this.collection.setSort(""),this.restoredFilters=[],this.activeFilter=!1)},render:function(){return $(this.el).html(this.template.render({})),2===this.type?this.type="document":3===this.type&&(this.type="edge"),this.tableView.setElement($(this.table)).drawLoading(),this.collectionContext=this.collectionsStore.getPosition(this.collection.collectionID),this.collectionName=window.location.hash.split("/")[1],this.breadcrumb(),window.arangoHelper.buildCollectionSubNav(this.collectionName,"Content"),this.checkCollectionState(),this.lastCollectionName=this.collectionName,this.uploadSetup(),$("[data-toggle=tooltip]").tooltip(),$(".upload-info").tooltip(),arangoHelper.fixTooltips(".icon_arangodb, .arangoicon","top"),this.renderPaginationElements(),this.selectActivePagesize(),this.markFilterToggle(),this.resize(),this},rerender:function(){this.collection.getDocuments(this.getDocsCallback.bind(this)),this.resize()},selectActivePagesize:function(){$("#documentSize").val(this.collection.getPageSize())},renderPaginationElements:function(){this.renderPagination();var a=$("#totalDocuments");0===a.length&&($("#documentsToolbarFL").append(''),a=$("#totalDocuments")),"document"===this.type&&a.html(numeral(this.collection.getTotal()).format("0,0")+" doc(s)"),"edge"===this.type&&a.html(numeral(this.collection.getTotal()).format("0,0")+" edge(s)")},breadcrumb:function(){$("#subNavigationBar .breadcrumb").html("Collection: "+this.collectionName)}})}(),function(){"use strict";var a=function(a){var b=a.split("/");return"collection/"+encodeURIComponent(b[0])+"/"+encodeURIComponent(b[1])};window.DocumentView=Backbone.View.extend({el:"#content",colid:0,docid:0,customView:!1,defaultMode:"tree",template:templateEngine.createTemplate("documentView.ejs"),events:{"click #saveDocumentButton":"saveDocument","click #deleteDocumentButton":"deleteDocumentModal","click #confirmDeleteDocument":"deleteDocument","click #document-from":"navigateToDocument","click #document-to":"navigateToDocument","keydown #documentEditor .ace_editor":"keyPress","keyup .jsoneditor .search input":"checkSearchBox","click .jsoneditor .modes":"storeMode","click #addDocument":"addDocument"},checkSearchBox:function(a){""===$(a.currentTarget).val()&&this.editor.expandAll()},addDocument:function(){window.App.documentsView.addDocumentModal()},storeMode:function(){var a=this;$(".type-modes").on("click",function(b){a.defaultMode=$(b.currentTarget).text().toLowerCase()})},keyPress:function(a){a.ctrlKey&&13===a.keyCode?(a.preventDefault(),this.saveDocument()):a.metaKey&&13===a.keyCode&&(a.preventDefault(),this.saveDocument())},editor:0,setType:function(a){a=2===a?"document":"edge";var b=function(a,b){if(a)arangoHelper.arangoError("Error","Could not fetch data.");else{var c=b+": ";this.type=b,this.fillInfo(c),this.fillEditor()}}.bind(this);"edge"===a?this.collection.getEdge(this.colid,this.docid,b):"document"===a&&this.collection.getDocument(this.colid,this.docid,b)},deleteDocumentModal:function(){var a=[],b=[];b.push(window.modalView.createReadOnlyEntry("doc-delete-button","Confirm delete, document id is",this.type._id,void 0,void 0,!1,/[<>&'"]/)),a.push(window.modalView.createDeleteButton("Delete",this.deleteDocument.bind(this))),window.modalView.show("modalTable.ejs","Delete Document",a,b)},deleteDocument:function(){var a=function(){if(this.customView)this.customDeleteFunction();else{var a="collection/"+encodeURIComponent(this.colid)+"/documents/1";window.modalView.hide(),window.App.navigate(a,{trigger:!0})}}.bind(this);if(this.type._from&&this.type._to){var b=function(b){b?arangoHelper.arangoError("Edge error","Could not delete edge"):a()};this.collection.deleteEdge(this.colid,this.docid,b)}else{var c=function(b){b?arangoHelper.arangoError("Error","Could not delete document"):a()};this.collection.deleteDocument(this.colid,this.docid,c)}},navigateToDocument:function(a){var b=$(a.target).attr("documentLink");b&&window.App.navigate(b,{trigger:!0})},fillInfo:function(){var b=this.collection.first(),c=b.get("_id"),d=b.get("_key"),e=b.get("_rev"),f=b.get("_from"),g=b.get("_to");if($("#document-type").css("margin-left","10px"),$("#document-type").text("_id:"),$("#document-id").css("margin-left","0"),$("#document-id").text(c),$("#document-key").text(d),$("#document-rev").text(e),f&&g){var h=a(f),i=a(g);$("#document-from").text(f),$("#document-from").attr("documentLink",h),$("#document-to").text(g),$("#document-to").attr("documentLink",i)}else $(".edge-info-container").hide()},fillEditor:function(){var a=this.removeReadonlyKeys(this.collection.first().attributes);$(".disabledBread").last().text(this.collection.first().get("_key")),this.editor.set(a),$(".ace_content").attr("font-size","11pt")},jsonContentChanged:function(){this.enableSaveButton()},resize:function(){$("#documentEditor").height($(".centralRow").height()-300)},render:function(){$(this.el).html(this.template.render({})),$("#documentEditor").height($(".centralRow").height()-300),this.disableSaveButton(),this.breadcrumb();var a=this,b=document.getElementById("documentEditor"),c={change:function(){a.jsonContentChanged()},search:!0,mode:"tree",modes:["tree","code"],iconlib:"fontawesome4"};return this.editor=new JSONEditor(b,c),this.editor.setMode(this.defaultMode),this},removeReadonlyKeys:function(a){return _.omit(a,["_key","_id","_from","_to","_rev"])},saveDocument:function(){if(void 0===$("#saveDocumentButton").attr("disabled"))if("_"===this.collection.first().attributes._id.substr(0,1)){var a=[],b=[];b.push(window.modalView.createReadOnlyEntry("doc-save-system-button","Caution","You are modifying a system collection. Really continue?",void 0,void 0,!1,/[<>&'"]/)),a.push(window.modalView.createSuccessButton("Save",this.confirmSaveDocument.bind(this))),window.modalView.show("modalTable.ejs","Modify System Collection",a,b)}else this.confirmSaveDocument()},confirmSaveDocument:function(){window.modalView.hide(); +var a;try{a=this.editor.get()}catch(b){return this.errorConfirmation(b),void this.disableSaveButton()}if(a=JSON.stringify(a),this.type._from&&this.type._to){var c=function(a){a?arangoHelper.arangoError("Error","Could not save edge."):(this.successConfirmation(),this.disableSaveButton())}.bind(this);this.collection.saveEdge(this.colid,this.docid,this.type._from,this.type._to,a,c)}else{var d=function(a){a?arangoHelper.arangoError("Error","Could not save document."):(this.successConfirmation(),this.disableSaveButton())}.bind(this);this.collection.saveDocument(this.colid,this.docid,a,d)}},successConfirmation:function(){arangoHelper.arangoNotification("Document saved.")},errorConfirmation:function(a){arangoHelper.arangoError("Document editor: ",a)},enableSaveButton:function(){$("#saveDocumentButton").prop("disabled",!1),$("#saveDocumentButton").addClass("button-success"),$("#saveDocumentButton").removeClass("button-close")},disableSaveButton:function(){$("#saveDocumentButton").prop("disabled",!0),$("#saveDocumentButton").addClass("button-close"),$("#saveDocumentButton").removeClass("button-success")},breadcrumb:function(){var a=window.location.hash.split("/");$("#subNavigationBar .breadcrumb").html('Collection: '+a[1]+'Document: '+a[2])},escaped:function(a){return a.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}})}(),function(){"use strict";window.FooterView=Backbone.View.extend({el:"#footerBar",system:{},isOffline:!0,isOfflineCounter:0,firstLogin:!0,timer:15e3,lap:0,timerFunction:null,events:{"click .footer-center p":"showShortcutModal"},initialize:function(){var a=this;window.setInterval(function(){a.getVersion()},a.timer),a.getVersion(),window.VISIBLE=!0,document.addEventListener("visibilitychange",function(){window.VISIBLE=!window.VISIBLE}),$("#offlinePlaceholder button").on("click",function(){a.getVersion()}),window.setTimeout(function(){window.frontendConfig.isCluster===!0&&($(".health-state").css("cursor","pointer"),$(".health-state").on("click",function(){window.App.navigate("#nodes",{trigger:!0})}))},1e3)},template:templateEngine.createTemplate("footerView.ejs"),showServerStatus:function(a){window.App.isCluster?this.renderClusterState(a):a===!0?($("#healthStatus").removeClass("negative"),$("#healthStatus").addClass("positive"),$(".health-state").html("GOOD"),$(".health-icon").html(''),$("#offlinePlaceholder").hide()):($("#healthStatus").removeClass("positive"),$("#healthStatus").addClass("negative"),$(".health-state").html("UNKNOWN"),$(".health-icon").html(''),$("#offlinePlaceholder").show(),this.reconnectAnimation(0))},reconnectAnimation:function(a){var b=this;0===a&&(b.lap=a,$("#offlineSeconds").text(b.timer/1e3),clearTimeout(b.timerFunction)),b.lap0?($("#healthStatus").removeClass("positive"),$("#healthStatus").addClass("negative"),1===c?$(".health-state").html(c+" NODE ERROR"):$(".health-state").html(c+" NODES ERROR"),$(".health-icon").html('')):($("#healthStatus").removeClass("negative"),$("#healthStatus").addClass("positive"),$(".health-state").html("NODES OK"),$(".health-icon").html(''))};$.ajax({type:"GET",cache:!1,url:arangoHelper.databaseUrl("/_admin/cluster/health"),contentType:"application/json",processData:!1,async:!0,success:function(a){b(a)}})}else $("#healthStatus").removeClass("positive"),$("#healthStatus").addClass("negative"),$(".health-state").html(window.location.host+" OFFLINE"),$(".health-icon").html(''),$("#offlinePlaceholder").show(),this.reconnectAnimation(0)},showShortcutModal:function(){window.arangoHelper.hotkeysFunctions.showHotkeysModal()},getVersion:function(){var a=this;$.ajax({type:"GET",cache:!1,url:arangoHelper.databaseUrl("/_api/version"),contentType:"application/json",processData:!1,async:!0,success:function(b){a.showServerStatus(!0),a.isOffline===!0&&(a.isOffline=!1,a.isOfflineCounter=0,a.firstLogin?a.firstLogin=!1:window.setTimeout(function(){a.showServerStatus(!0)},1e3),a.system.name=b.server,a.system.version=b.version,a.render())},error:function(b){401===b.status?(a.showServerStatus(!0),window.App.navigate("login",{trigger:!0})):(a.isOffline=!0,a.isOfflineCounter++,a.isOfflineCounter>=1&&a.showServerStatus(!1))}}),a.system.hasOwnProperty("database")||$.ajax({type:"GET",cache:!1,url:arangoHelper.databaseUrl("/_api/database/current"),contentType:"application/json",processData:!1,async:!0,success:function(b){var c=b.result.name;a.system.database=c;var d=window.setInterval(function(){var b=$("#databaseNavi");b&&(window.clearTimeout(d),d=null,a.render())},50)}})},renderVersion:function(){this.system.hasOwnProperty("database")&&this.system.hasOwnProperty("name")&&$(this.el).html(this.template.render({name:this.system.name,version:this.system.version,database:this.system.database}))},render:function(){return this.system.version||this.getVersion(),$(this.el).html(this.template.render({name:this.system.name,version:this.system.version})),this}})}(),function(){"use strict";window.FoxxActiveView=Backbone.View.extend({tagName:"div",className:"tile pure-u-1-1 pure-u-sm-1-2 pure-u-md-1-3 pure-u-lg-1-4 pure-u-xl-1-6",template:templateEngine.createTemplate("foxxActiveView.ejs"),_show:!0,events:{click:"openAppDetailView"},openAppDetailView:function(){window.App.navigate("service/"+encodeURIComponent(this.model.get("mount")),{trigger:!0})},toggle:function(a,b){switch(a){case"devel":this.model.isDevelopment()&&(this._show=b);break;case"production":this.model.isDevelopment()||this.model.isSystem()||(this._show=b);break;case"system":this.model.isSystem()&&(this._show=b)}this._show?$(this.el).show():$(this.el).hide()},render:function(){return this.model.fetchThumbnail(function(){$(this.el).html(this.template.render({model:this.model}));var a=function(){this.model.needsConfiguration()&&($(this.el).find(".warning-icons").length>0?$(this.el).find(".warning-icons").append(''):$(this.el).find("img").after(''))}.bind(this),b=function(){this.model.hasUnconfiguredDependencies()&&($(this.el).find(".warning-icons").length>0?$(this.el).find(".warning-icons").append(''):$(this.el).find("img").after(''))}.bind(this);this.model.getConfiguration(a),this.model.getDependencies(b)}.bind(this)),$(this.el)}})}(),function(){"use strict";var a={ERROR_SERVICE_DOWNLOAD_FAILED:{code:1752,message:"service download failed"}},b=templateEngine.createTemplate("applicationListView.ejs"),c=function(a){this.collection=a.collection},d=function(b){var c=this;if(b.error===!1)this.collection.fetch({success:function(){window.modalView.hide(),c.reload(),console.log(b),arangoHelper.arangoNotification("Services","Service "+b.name+" installed.")}});else{var d=b;switch(b.hasOwnProperty("responseJSON")&&(d=b.responseJSON),d.errorNum){case a.ERROR_SERVICE_DOWNLOAD_FAILED.code:arangoHelper.arangoError("Services","Unable to download application from the given repository.");break;default:arangoHelper.arangoError("Services",d.errorNum+". "+d.errorMessage)}}},e=function(){window.modalView.modalBindValidation({id:"new-app-mount",validateInput:function(){return[{rule:Joi.string().regex(/^(\/(APP[^\/]+|(?!APP)[a-zA-Z0-9_\-%]+))+$/i),msg:"May not contain /APP"},{rule:Joi.string().regex(/^(\/[a-zA-Z0-9_\-%]+)+$/),msg:"Can only contain [a-zA-Z0-9_-%]"},{rule:Joi.string().regex(/^\/([^_]|_open\/)/),msg:"Mountpoints with _ are reserved for internal use"},{rule:Joi.string().regex(/[^\/]$/),msg:"May not end with /"},{rule:Joi.string().regex(/^\//),msg:"Has to start with /"},{rule:Joi.string().required().min(2),msg:"Has to be non-empty"}]}})},f=function(){window.modalView.modalBindValidation({id:"repository",validateInput:function(){return[{rule:Joi.string().required().regex(/^[a-zA-Z0-9_\-]+\/[a-zA-Z0-9_\-]+$/),msg:"No valid Github account and repository."}]}})},g=function(){window.modalView.modalBindValidation({id:"new-app-author",validateInput:function(){return[{rule:Joi.string().required().min(1),msg:"Has to be non empty."}]}}),window.modalView.modalBindValidation({id:"new-app-name",validateInput:function(){return[{rule:Joi.string().required().regex(/^[a-zA-Z\-_][a-zA-Z0-9\-_]*$/),msg:"Can only contain a to z, A to Z, 0-9, '-' and '_'."}]}}),window.modalView.modalBindValidation({id:"new-app-description",validateInput:function(){return[{rule:Joi.string().required().min(1),msg:"Has to be non empty."}]}}),window.modalView.modalBindValidation({id:"new-app-license",validateInput:function(){return[{rule:Joi.string().required().regex(/^[a-zA-Z0-9 \.,;\-]+$/),msg:"Has to be non empty."}]}}),window.modalView.modalTestAll()},h=function(a){window.modalView.clearValidators();var b=$("#modalButton1");switch(this._upgrade||e(),a){case"newApp":b.html("Generate"),b.prop("disabled",!1),g();break;case"appstore":b.html("Install"),b.prop("disabled",!0);break;case"github":f(),b.html("Install"),b.prop("disabled",!1);break;case"zip":b.html("Install"),b.prop("disabled",!1)}b.prop("disabled")||window.modalView.modalTestAll()||b.prop("disabled",!0)},i=function(a){var b=$(a.currentTarget).attr("href").substr(1);h.call(this,b)},j=function(a){if(h.call(this,"appstore"),window.modalView.modalTestAll()){var b,c;this._upgrade?(b=this.mount,c=$("#new-app-teardown").prop("checked")):b=window.arangoHelper.escapeHtml($("#new-app-mount").val());var e=$(a.currentTarget).attr("appId"),f=$(a.currentTarget).attr("appVersion");void 0!==c?this.collection.installFromStore({name:e,version:f},b,d.bind(this),c):this.collection.installFromStore({name:e,version:f},b,d.bind(this)),window.modalView.hide(),arangoHelper.arangoNotification("Services","Installing "+e+".")}},k=function(a,b){if(void 0===b?b=this._uploadData:this._uploadData=b,b&&window.modalView.modalTestAll()){var c,e;this._upgrade?(c=this.mount,e=$("#new-app-teardown").prop("checked")):c=window.arangoHelper.escapeHtml($("#new-app-mount").val()),void 0!==e?this.collection.installFromZip(b.filename,c,d.bind(this),e):this.collection.installFromZip(b.filename,c,d.bind(this))}},l=function(){if(window.modalView.modalTestAll()){var a,b,c,e;this._upgrade?(c=this.mount,e=$("#new-app-teardown").prop("checked")):c=window.arangoHelper.escapeHtml($("#new-app-mount").val()),a=window.arangoHelper.escapeHtml($("#repository").val()),b=window.arangoHelper.escapeHtml($("#tag").val()),""===b&&(b="master");var f={url:window.arangoHelper.escapeHtml($("#repository").val()),version:window.arangoHelper.escapeHtml($("#tag").val())};try{Joi.assert(a,Joi.string().regex(/^[a-zA-Z0-9_\-]+\/[a-zA-Z0-9_\-]+$/))}catch(g){return}void 0!==e?this.collection.installFromGithub(f,c,d.bind(this),e):this.collection.installFromGithub(f,c,d.bind(this))}},m=function(){if(window.modalView.modalTestAll()){var a,b;this._upgrade?(a=this.mount,b=$("#new-app-teardown").prop("checked")):a=window.arangoHelper.escapeHtml($("#new-app-mount").val());var c={name:window.arangoHelper.escapeHtml($("#new-app-name").val()),documentCollections:_.map($("#new-app-document-collections").select2("data"),function(a){return window.arangoHelper.escapeHtml(a.text)}),edgeCollections:_.map($("#new-app-edge-collections").select2("data"),function(a){return window.arangoHelper.escapeHtml(a.text)}),author:window.arangoHelper.escapeHtml($("#new-app-author").val()),license:window.arangoHelper.escapeHtml($("#new-app-license").val()),description:window.arangoHelper.escapeHtml($("#new-app-description").val())};void 0!==b?this.collection.generate(c,a,d.bind(this),b):this.collection.generate(c,a,d.bind(this))}},n=function(){var a=$(".modal-body .tab-pane.active").attr("id");switch(a){case"newApp":m.apply(this);break;case"github":l.apply(this);break;case"zip":k.apply(this)}},o=function(a,c){var d=[],e={"click #infoTab a":i.bind(a),"click .install-app":j.bind(a)};d.push(window.modalView.createSuccessButton("Generate",n.bind(a))),window.modalView.show("modalApplicationMount.ejs","Install Service",d,c,void 0,void 0,e),$("#new-app-document-collections").select2({tags:[],showSearchBox:!1,minimumResultsForSearch:-1,width:"336px"}),$("#new-app-edge-collections").select2({tags:[],showSearchBox:!1,minimumResultsForSearch:-1,width:"336px"});var f=function(){var a=$("#modalButton1");a.prop("disabled")||window.modalView.modalTestAll()?a.prop("disabled",!1):a.prop("disabled",!0)};$(".select2-search-field input").focusout(function(){f(),window.setTimeout(function(){$(".select2-drop").is(":visible")&&($("#select2-search-field input").is(":focus")||($("#s2id_new-app-document-collections").select2("close"),$("#s2id_new-app-edge-collections").select2("close"),f()))},200)}),$(".select2-search-field input").focusin(function(){if($(".select2-drop").is(":visible")){var a=$("#modalButton1");a.prop("disabled",!0)}}),$("#upload-foxx-zip").uploadFile({url:arangoHelper.databaseUrl("/_api/upload?multipart=true"),allowedTypes:"zip",multiple:!1,onSuccess:k.bind(a)}),$.get("foxxes/fishbowl",function(a){var c=$("#appstore-content");c.html(""),_.each(_.sortBy(a,"name"),function(a){c.append(b.render(a))})}).fail(function(){var a=$("#appstore-content");a.append("Store is not available. ArangoDB is not able to connect to github.com")})};c.prototype.install=function(a){this.reload=a,this._upgrade=!1,this._uploadData=void 0,delete this.mount,o(this,!1),window.modalView.clearValidators(),e(),g()},c.prototype.upgrade=function(a,b){this.reload=b,this._upgrade=!0,this._uploadData=void 0,this.mount=a,o(this,!0),window.modalView.clearValidators(),g()},window.FoxxInstallView=c}(),function(){"use strict";window.GraphManagementView=Backbone.View.extend({el:"#content",template:templateEngine.createTemplate("graphManagementView.ejs"),edgeDefintionTemplate:templateEngine.createTemplate("edgeDefinitionTable.ejs"),eCollList:[],removedECollList:[],dropdownVisible:!1,initialize:function(a){this.options=a},events:{"click #deleteGraph":"deleteGraph","click .icon_arangodb_settings2.editGraph":"editGraph","click #createGraph":"addNewGraph","keyup #graphManagementSearchInput":"search","click #graphManagementSearchSubmit":"search","click .tile-graph":"redirectToGraphViewer","click #gv2":"redirectToGraphViewer2","click #graphManagementToggle":"toggleGraphDropdown","click .css-label":"checkBoxes","change #graphSortDesc":"sorting"},toggleTab:function(a){var b=a.currentTarget.id;b=b.replace("tab-",""),$("#tab-content-create-graph .tab-pane").removeClass("active"),$("#tab-content-create-graph #"+b).addClass("active"),"exampleGraphs"===b?$("#modal-dialog .modal-footer .button-success").css("display","none"):$("#modal-dialog .modal-footer .button-success").css("display","initial")},redirectToGraphViewer:function(a){var b=$(a.currentTarget).attr("id");b=b.substr(0,b.length-5),window.location=window.location+"/"+encodeURIComponent(b)},redirectToGraphViewer2:function(a){a.preventDefault();var b=$(a.currentTarget).parent().parent().attr("id");b=b.substr(0,b.length-5),console.log(b),window.App.navigate("graph2/"+encodeURIComponent(b),{trigger:!0})},loadGraphViewer:function(a,b){var c=function(b){if(b)arangoHelper.arangoError("","");else{var c=this.collection.get(a).get("edgeDefinitions");if(!c||0===c.length)return;var d={type:"gharial",graphName:a,baseUrl:arangoHelper.databaseUrl("/")},e=$("#content").width()-75;$("#content").html("");var f=arangoHelper.calculateCenterDivHeight();this.ui=new GraphViewerUI($("#content")[0],d,e,$(".centralRow").height()-135,{nodeShaper:{label:"_key",color:{type:"attribute",key:"_key"}}},!0),$(".contentDiv").height(f)}}.bind(this);b?this.collection.fetch({cache:!1,success:function(){c()}}):c()},handleResize:function(a){this.width&&this.width===a||(this.width=a,this.ui&&this.ui.changeWidth(a))},addNewGraph:function(a){a.preventDefault(),this.createEditGraphModal()},deleteGraph:function(){var a=this,b=$("#editGraphName")[0].value;if($("#dropGraphCollections").is(":checked")){var c=function(c){c?(a.collection.remove(a.collection.get(b)),a.updateGraphManagementView(),window.modalView.hide()):(window.modalView.hide(),arangoHelper.arangoError("Graph","Could not delete Graph."))};this.collection.dropAndDeleteGraph(b,c)}else this.collection.get(b).destroy({success:function(){a.updateGraphManagementView(),window.modalView.hide()},error:function(a,b){var c=JSON.parse(b.responseText),d=c.errorMessage;arangoHelper.arangoError(d),window.modalView.hide()}})},checkBoxes:function(a){var b=a.currentTarget.id;$("#"+b).click()},toggleGraphDropdown:function(){$("#graphSortDesc").attr("checked",this.collection.sortOptions.desc),$("#graphManagementToggle").toggleClass("activated"),$("#graphManagementDropdown2").slideToggle(200)},sorting:function(){$("#graphSortDesc").is(":checked")?this.collection.setSortingDesc(!0):this.collection.setSortingDesc(!1),$("#graphManagementDropdown").is(":visible")?this.dropdownVisible=!0:this.dropdownVisible=!1,this.render()},createExampleGraphs:function(a){var b=$(a.currentTarget).attr("graph-id"),c=this;$.ajax({type:"POST",url:arangoHelper.databaseUrl("/_admin/aardvark/graph-examples/create/"+encodeURIComponent(b)),success:function(){window.modalView.hide(),c.updateGraphManagementView(),arangoHelper.arangoNotification("Example Graphs","Graph: "+b+" created.")},error:function(a){if(window.modalView.hide(),a.responseText)try{var c=JSON.parse(a.responseText);arangoHelper.arangoError("Example Graphs",c.errorMessage)}catch(d){arangoHelper.arangoError("Example Graphs","Could not create example graph: "+b)}else arangoHelper.arangoError("Example Graphs","Could not create example graph: "+b)}})},render:function(a,b){var c=this;return this.collection.fetch({cache:!1,success:function(){c.collection.sort(),$(c.el).html(c.template.render({graphs:c.collection,searchString:""})),c.dropdownVisible===!0&&($("#graphManagementDropdown2").show(),$("#graphSortDesc").attr("checked",c.collection.sortOptions.desc),$("#graphManagementToggle").toggleClass("activated"),$("#graphManagementDropdown").show()),c.events["click .tableRow"]=c.showHideDefinition.bind(c),c.events['change tr[id*="newEdgeDefinitions"]']=c.setFromAndTo.bind(c),c.events["click .graphViewer-icon-button"]=c.addRemoveDefinition.bind(c),c.events["click #graphTab a"]=c.toggleTab.bind(c),c.events["click .createExampleGraphs"]=c.createExampleGraphs.bind(c),c.events["focusout .select2-search-field input"]=function(a){$(".select2-drop").is(":visible")&&($("#select2-search-field input").is(":focus")||window.setTimeout(function(){$(a.currentTarget).parent().parent().parent().select2("close")},200))},arangoHelper.setCheckboxStatus("#graphManagementDropdown")}}),a&&this.loadGraphViewer(a,b),this},setFromAndTo:function(a){a.stopPropagation();var b,c=this.calculateEdgeDefinitionMap();if(a.added){if(-1===this.eCollList.indexOf(a.added.id)&&-1!==this.removedECollList.indexOf(a.added.id))return b=a.currentTarget.id.split("row_newEdgeDefinitions")[1],$('input[id*="newEdgeDefinitions'+b+'"]').select2("val",null),void $('input[id*="newEdgeDefinitions'+b+'"]').attr("placeholder","The collection "+a.added.id+" is already used.");this.removedECollList.push(a.added.id),this.eCollList.splice(this.eCollList.indexOf(a.added.id),1)}else this.eCollList.push(a.removed.id),this.removedECollList.splice(this.removedECollList.indexOf(a.removed.id),1);c[a.val]?(b=a.currentTarget.id.split("row_newEdgeDefinitions")[1],$("#s2id_fromCollections"+b).select2("val",c[a.val].from),$("#fromCollections"+b).attr("disabled",!0),$("#s2id_toCollections"+b).select2("val",c[a.val].to),$("#toCollections"+b).attr("disabled",!0)):(b=a.currentTarget.id.split("row_newEdgeDefinitions")[1],$("#s2id_fromCollections"+b).select2("val",null),$("#fromCollections"+b).attr("disabled",!1),$("#s2id_toCollections"+b).select2("val",null),$("#toCollections"+b).attr("disabled",!1))},editGraph:function(a){a.stopPropagation(),this.collection.fetch({cache:!1}),this.graphToEdit=this.evaluateGraphName($(a.currentTarget).attr("id"),"_settings");var b=this.collection.findWhere({_key:this.graphToEdit});this.createEditGraphModal(b)},saveEditedGraph:function(){var a,b,c,d,e,f=$("#editGraphName")[0].value,g=_.pluck($("#newVertexCollections").select2("data"),"text"),h=[],i={};if(e=$("[id^=s2id_newEdgeDefinitions]").toArray(),e.forEach(function(e){if(d=$(e).attr("id"),d=d.replace("s2id_newEdgeDefinitions",""),a=_.pluck($("#s2id_newEdgeDefinitions"+d).select2("data"),"text")[0],a&&""!==a&&(b=_.pluck($("#s2id_fromCollections"+d).select2("data"),"text"),c=_.pluck($("#s2id_toCollections"+d).select2("data"),"text"),0!==b.length&&0!==c.length)){var f={collection:a,from:b,to:c};h.push(f),i[a]=f}}),0===h.length)return $("#s2id_newEdgeDefinitions0 .select2-choices").css("border-color","red"),$("#s2id_newEdgeDefinitions0").parent().parent().next().find(".select2-choices").css("border-color","red"),void $("#s2id_newEdgeDefinitions0").parent().parent().next().next().find(".select2-choices").css("border-color","red");var j=this.collection.findWhere({_key:f}),k=j.get("edgeDefinitions"),l=j.get("orphanCollections"),m=[];l.forEach(function(a){-1===g.indexOf(a)&&j.deleteVertexCollection(a)}),g.forEach(function(a){-1===l.indexOf(a)&&j.addVertexCollection(a)});var n=[],o=[],p=[];k.forEach(function(a){var b=a.collection;m.push(b);var c=i[b];void 0===c?p.push(b):JSON.stringify(c)!==JSON.stringify(a)&&o.push(b)}),h.forEach(function(a){var b=a.collection;-1===m.indexOf(b)&&n.push(b)}),n.forEach(function(a){j.addEdgeDefinition(i[a])}),o.forEach(function(a){j.modifyEdgeDefinition(i[a])}),p.forEach(function(a){j.deleteEdgeDefinition(a)}),this.updateGraphManagementView(),window.modalView.hide()},evaluateGraphName:function(a,b){var c=a.lastIndexOf(b);return a.substring(0,c)},search:function(){var a,b,c,d;a=$("#graphManagementSearchInput"),b=$("#graphManagementSearchInput").val(),d=this.collection.filter(function(a){return-1!==a.get("_key").indexOf(b)}),$(this.el).html(this.template.render({graphs:d,searchString:b})),a=$("#graphManagementSearchInput"),c=a.val().length,a.focus(),a[0].setSelectionRange(c,c)},updateGraphManagementView:function(){var a=this;this.collection.fetch({cache:!1,success:function(){a.render()}})},createNewGraph:function(){var a,b,c,d,e,f=$("#createNewGraphName").val(),g=_.pluck($("#newVertexCollections").select2("data"),"text"),h=[],i=this;return f?this.collection.findWhere({_key:f})?(arangoHelper.arangoError("The graph '"+f+"' already exists."),0):(e=$("[id^=s2id_newEdgeDefinitions]").toArray(),e.forEach(function(e){d=$(e).attr("id"),d=d.replace("s2id_newEdgeDefinitions",""),a=_.pluck($("#s2id_newEdgeDefinitions"+d).select2("data"),"text")[0],a&&""!==a&&(b=_.pluck($("#s2id_fromCollections"+d).select2("data"),"text"),c=_.pluck($("#s2id_toCollections"+d).select2("data"),"text"),1!==b&&1!==c&&h.push({collection:a,from:b,to:c}))}),0===h.length?($("#s2id_newEdgeDefinitions0 .select2-choices").css("border-color","red"),$("#s2id_newEdgeDefinitions0").parent().parent().next().find(".select2-choices").css("border-color","red"),void $("#s2id_newEdgeDefinitions0").parent().parent().next().next().find(".select2-choices").css("border-color","red")):void this.collection.create({name:f,edgeDefinitions:h,orphanCollections:g},{success:function(){i.updateGraphManagementView(),window.modalView.hide()},error:function(a,b){var c=JSON.parse(b.responseText),d=c.errorMessage;d=d.replace("<",""),d=d.replace(">",""),arangoHelper.arangoError(d)}})):(arangoHelper.arangoError("A name for the graph has to be provided."),0)},createEditGraphModal:function(a){var b,c=[],d=[],e=[],f=this.options.collectionCollection.models,g=this,h="",i=[{collection:"",from:"",to:""}],j="",k=function(a,b){return a=a.toLowerCase(),b=b.toLowerCase(),b>a?-1:a>b?1:0};if(this.eCollList=[],this.removedECollList=[],f.forEach(function(a){a.get("isSystem")||("edge"===a.get("type")?g.eCollList.push(a.id):d.push(a.id))}),window.modalView.enableHotKeys=!1,this.counter=0,a?(b="Edit Graph",h=a.get("_key"),i=a.get("edgeDefinitions"),i&&0!==i.length||(i=[{collection:"",from:"",to:""}]),j=a.get("orphanCollections"),e.push(window.modalView.createReadOnlyEntry("editGraphName","Name",h,"The name to identify the graph. Has to be unique")),c.push(window.modalView.createDeleteButton("Delete",this.deleteGraph.bind(this))),c.push(window.modalView.createSuccessButton("Save",this.saveEditedGraph.bind(this)))):(b="Create Graph",e.push(window.modalView.createTextEntry("createNewGraphName","Name","","The name to identify the graph. Has to be unique.","graphName",!0)),c.push(window.modalView.createSuccessButton("Create",this.createNewGraph.bind(this)))),i.forEach(function(a){0===g.counter?(a.collection&&(g.removedECollList.push(a.collection),g.eCollList.splice(g.eCollList.indexOf(a.collection),1)),e.push(window.modalView.createSelect2Entry("newEdgeDefinitions"+g.counter,"Edge definitions",a.collection,"An edge definition defines a relation of the graph","Edge definitions",!0,!1,!0,1,g.eCollList.sort(k)))):e.push(window.modalView.createSelect2Entry("newEdgeDefinitions"+g.counter,"Edge definitions",a.collection,"An edge definition defines a relation of the graph","Edge definitions",!1,!0,!1,1,g.eCollList.sort(k))),e.push(window.modalView.createSelect2Entry("fromCollections"+g.counter,"fromCollections",a.from,"The collections that contain the start vertices of the relation.","fromCollections",!0,!1,!1,10,d.sort(k))),e.push(window.modalView.createSelect2Entry("toCollections"+g.counter,"toCollections",a.to,"The collections that contain the end vertices of the relation.","toCollections",!0,!1,!1,10,d.sort(k))),g.counter++}),e.push(window.modalView.createSelect2Entry("newVertexCollections","Vertex collections",j,"Collections that are part of a graph but not used in an edge definition","Vertex Collections",!1,!1,!1,10,d.sort(k))),window.modalView.show("modalGraphTable.ejs",b,c,e,void 0,void 0,this.events),a){$(".modal-body table").css("border-collapse","separate");var l;for($(".modal-body .spacer").remove(),l=0;l<=this.counter;l++)$("#row_fromCollections"+l).show(),$("#row_toCollections"+l).show(),$("#row_newEdgeDefinitions"+l).addClass("first"),$("#row_fromCollections"+l).addClass("middle"),$("#row_toCollections"+l).addClass("last"),$("#row_toCollections"+l).after('');$("#graphTab").hide(),$("#modal-dialog .modal-delete-confirmation").append('
    ')}},showHideDefinition:function(a){},addRemoveDefinition:function(a){var b=[],c=this.options.collectionCollection.models;c.forEach(function(a){a.get("isSystem")||b.push(a.id)}),a.stopPropagation();var d,e=$(a.currentTarget).attr("id");if(-1===e.indexOf("addAfter_newEdgeDefinitions"))-1!==e.indexOf("remove_newEdgeDefinitions")&&(d=e.split("remove_newEdgeDefinitions")[1],$("#row_newEdgeDefinitions"+d).remove(),$("#row_fromCollections"+d).remove(),$("#row_toCollections"+d).remove(),$("#spacer"+d).remove());else{this.counter++,$("#row_newVertexCollections").before(this.edgeDefintionTemplate.render({number:this.counter})),$("#newEdgeDefinitions"+this.counter).select2({tags:this.eCollList,showSearchBox:!1,minimumResultsForSearch:-1,width:"336px",maximumSelectionSize:1}),$("#fromCollections"+this.counter).select2({tags:b,showSearchBox:!1,minimumResultsForSearch:-1,width:"336px",maximumSelectionSize:10}),$("#toCollections"+this.counter).select2({tags:b,showSearchBox:!1,minimumResultsForSearch:-1,width:"336px",maximumSelectionSize:10}),window.modalView.undelegateEvents(),window.modalView.delegateEvents(this.events);var f;for($(".modal-body .spacer").remove(),f=0;f<=this.counter;f++)$("#row_fromCollections"+f).show(),$("#row_toCollections"+f).show(),$("#row_newEdgeDefinitions"+f).addClass("first"),$("#row_fromCollections"+f).addClass("middle"),$("#row_toCollections"+f).addClass("last"),$("#row_toCollections"+f).after('')}},calculateEdgeDefinitionMap:function(){var a={};return this.collection.models.forEach(function(b){b.get("edgeDefinitions").forEach(function(b){a[b.collection]={from:b.from,to:b.to}})}),a}})}(),function(){"use strict";window.GraphSettingsView=Backbone.View.extend({el:"#graphSettingsContent",remove:function(){return this.$el.empty().off(),this.stopListening(),this},general:{graph:{type:"divider",name:"Graph"},nodeStart:{type:"string",name:"Starting node",desc:"A valid node id. If empty, a random node will be chosen.",value:2},layout:{type:"select",name:"Layout algorithm",desc:"Different graph displaying algorithms. No overlap is very fast, force is slower and fruchtermann is the slowest. The calculation time strongly depends on your nodes and edges counts.",noverlap:{name:"No overlap",val:"noverlap"},force:{name:"Force",val:"force"},fruchtermann:{name:"Fruchtermann",val:"fruchtermann"}},renderer:{type:"select",name:"Renderer",desc:"Canvas enables editing, WebGL is only for displaying a graph but much faster.",canvas:{name:"Canvas",val:"canvas"},webgl:{name:"WebGL",val:"webgl"}},depth:{desc:"Search depth, starting from your start node.",type:"number",name:"Search depth",value:2}},specific:{nodes:{type:"divider",name:"Nodes"},nodeLabel:{type:"string",name:"Label",desc:"Node label. Please choose a valid and available node attribute.","default":"_key"},nodeLabelByCollection:{type:"select",name:"Label by coll?",desc:"Set label text by collection. If activated node label attribute will be ignored.",no:{name:"No",val:"false"},yes:{name:"Yes",val:"true"}},nodeLabelThreshold:{type:"range",name:"Label threshold",desc:"The minimum size a node must have on screen to see its label displayed. This does not affect hovering behavior.","default":"_key"},nodeColor:{type:"color",name:"Color",desc:"Default node color. RGB or HEX value.","default":"#2ecc71"},nodeColorAttribute:{type:"string",name:"Colorize attr",desc:"If an attribute is given, nodes will then be colorized by the attribute. This setting ignores default node color if set."},nodeColorByCollection:{type:"select",name:"Colorize by coll?",no:{name:"No",val:"false"},yes:{name:"Yes",val:"true"},desc:"Should nodes be colorized by their collection? If enabled, node color and node color attribute will be ignored."},nodeSize:{type:"string",name:"Sizing attribute",desc:"Default node size. Numeric value > 0."},edges:{type:"divider",name:"Edges"},edgeLabel:{type:"string",name:"Label",desc:"Default edge label."},edgeLabelByCollection:{type:"select",name:"Label by coll?",desc:"Set label text by collection. If activated edge label attribute will be ignored.",no:{name:"No",val:"false"},yes:{name:"Yes",val:"true"}},edgeLabelThreshold:{type:"range",name:"Label threshold",desc:"The minimum size an edge must have on screen to see its label displayed. This does not affect hovering behavior.","default":"_key"},edgeColor:{type:"color",name:"Color",desc:"Default edge color. RGB or HEX value.","default":"#cccccc"},edgeColorAttribute:{type:"string",name:"Colorize attr",desc:"If an attribute is given, edges will then be colorized by the attribute. This setting ignores default edge color if set."},edgeColorByCollection:{type:"select",name:"Colorize by coll?",no:{name:"No",val:"false"},yes:{name:"Yes",val:"true"},desc:"Should edges be colorized by their collection? If enabled, edge color and edge color attribute will be ignored." +},edgeEditable:{type:"select",name:"Editable",no:{name:"No",val:"false"},yes:{name:"Yes",val:"true"},desc:"Should edges be editable?"},edgeType:{type:"select",name:"Type",desc:"The type of the edge",line:{name:"Line",val:"line"},arrow:{name:"Arrow",val:"arrow"},curve:{name:"Curve",val:"curve"},dotted:{name:"Dotted",val:"dotted"},dashed:{name:"Dashed",val:"dashed"},tapered:{name:"Tapered",val:"tapered"}}},template:templateEngine.createTemplate("graphSettingsView.ejs"),initialize:function(a){this.name=a.name,this.userConfig=a.userConfig,this.saveCallback=a.saveCallback},events:{"click #saveGraphSettings":"saveGraphSettings","click #restoreGraphSettings":"setDefaults","keyup #graphSettingsView input":"checkEnterKey","keyup #graphSettingsView select":"checkEnterKey",'change input[type="range"]':"saveGraphSettings",'change input[type="color"]':"checkColor","change select":"saveGraphSettings","focus #graphSettingsView input":"lastFocus","focus #graphSettingsView select":"lastFocus"},lastFocus:function(a){this.lastFocussed=a.currentTarget.id},checkEnterKey:function(a){13===a.keyCode&&this.saveGraphSettings()},getGraphSettings:function(a){var b=this,c=window.App.currentDB.toJSON().name+"_"+this.name;this.userConfig.fetch({success:function(d){b.graphConfig=d.toJSON().graphs[c],a&&b.continueRender()}})},checkColor:function(){this.saveGraphSettings(null,!0)},saveGraphSettings:function(a,b,c,d){var e=this,f=window.App.currentDB.toJSON().name+"_"+this.name,g={};if(d)g[f]=d;else{var h,i={};$("#graphSettingsView select").each(function(a,b){h=b.id,i[h.substr(2,b.id.length)]=$(b).val()}),$("#graphSettingsView input").each(function(a,b){h=b.id,i[h.substr(2,b.id.length)]=$(b).val()}),g[f]=i}c&&(g[f].nodeStart=c);var j=function(){window.App.graphViewer2?""!==b&&void 0!==b?window.App.graphViewer2.updateColors():window.App.graphViewer2.render(e.lastFocussed):arangoHelper.arangoNotification("Graph "+this.name,"Configuration saved.")}.bind(this);this.userConfig.setItem("graphs",g,j)},setDefaults:function(){var a={layout:"force",renderer:"canvas",depth:"2",nodeColor:"#2ecc71",nodeColorAttribute:"",nodeColorByCollection:"false",nodeLabelThreshold:10,edgeColor:"#cccccc",edgeColorAttribute:"",edgeColorByCollection:"false",edgeLabelThreshold:10,nodeLabel:"_key",edgeLabel:"",edgeType:"line",nodeSize:"",edgeEditable:"false",nodeLabelByCollection:"false",edgeLabelByCollection:"false",nodeStart:""};this.saveGraphSettings(null,null,null,a),this.render(),window.App.graphViewer2.render(this.lastFocussed)},toggle:function(){$(this.el).is(":visible")?this.hide():this.show()},show:function(){$(this.el).show("slide",{direction:"right"},250)},hide:function(){$(this.el).hide("slide",{direction:"right"},250)},render:function(){this.getGraphSettings(!0)},continueRender:function(){$(this.el).html(this.template.render({general:this.general,specific:this.specific})),arangoHelper.fixTooltips(".gv-tooltips","top"),this.graphConfig?(_.each(this.graphConfig,function(a,b){$("#g_"+b).val(a)}),$("#g_nodeLabelThreshold_label").text(this.graphConfig.nodeLabelThreshold),$("#g_edgeLabelThreshold_label").text(this.graphConfig.edgeLabelThreshold)):this.setDefaults()}})}(),function(){"use strict";window.GraphViewer2=Backbone.View.extend({el:"#content",remove:function(){return this.$el.empty().off(),this.stopListening(),this},template:templateEngine.createTemplate("graphViewer2.ejs"),initialize:function(a){var b=this;a.id&&(this.setElement(a.id),this.graphData=a.data,this.aqlMode=!0),this.name=a.name,this.userConfig=a.userConfig,this.documentStore=a.documentStore,this.initSigma(),void 0!==this.name&&this.collection.fetch({cache:!1,success:function(c){b.model=b.collection.findWhere({_key:a.name}).toJSON()}})},colors:{hotaru:["#364C4A","#497C7F","#92C5C0","#858168","#CCBCA5"],random1:["#292F36","#4ECDC4","#F7FFF7","#DD6363","#FFE66D"]},aqlMode:!1,events:{"click #downloadPNG":"downloadSVG","click #reloadGraph":"reloadGraph","click #settingsMenu":"toggleSettings","click #noGraphToggle":"toggleSettings","click #toggleForce":"toggleLayout","click #selectNodes":"toggleLasso"},cursorX:0,cursorY:0,layouting:!1,model:null,viewStates:{captureMode:!1},graphConfig:null,graphSettings:null,initSigma:function(){try{sigma.classes.graph.addMethod("neighbors",function(a){var b,c={},d=this.allNeighborsIndex[a]||{};for(b in d)c[b]=this.nodesIndex[b];return c}),sigma.classes.graph.addMethod("getNodeEdges",function(a){var b=this.edges(),c=[];return _.each(b,function(b){b.source!==a&&b.target!==a||c.push(b.id)}),c})}catch(a){}},downloadSVG:function(){var a=this;this.currentGraph.toSVG({download:!0,filename:a.name+".svg",size:1e3})},resize:function(){$("#graph-container").width($(".centralContent").width()),$("#graph-container").height($(".centralRow").height()-150)},toggleSettings:function(){this.graphSettingsView.toggle()},render:function(a){this.$el.html(this.template.render({})),$("#subNavigationBar .breadcrumb").html("Graph: "+this.name),this.resize(),this.fetchGraph(a)},renderAQL:function(a){this.$el.html(this.template.render({})),this.$el.find(".headerBar").remove();var b=$(".centralRow").height()-250;this.$el.find("#graph-container").css("height",b),this.graphData.modified=this.parseData(this.graphData.original,this.graphData.graphInfo),this.renderGraph(this.graphData.modified)},parseData:function(a,b){var c={},d={},e={nodes:[],edges:[],settings:{}};return"object"===b?(_.each(a,function(a){a.edges&&a.vertices&&(_.each(a.edges,function(a){d[a._id]={id:a._id,source:a._from,label:a._key,color:"#cccccc",target:a._to}}),_.each(a.vertices,function(a){c[a._id]={id:a._id,label:a._key,size:.3,color:"#2ecc71",x:Math.random(),y:Math.random()}}))}),_.each(c,function(a){e.nodes.push(a)}),_.each(d,function(a){e.edges.push(a)})):"array"===b&&(_.each(a,function(a){c[a._from]=null,c[a._to]=null,e.edges.push({id:a._id,source:a._from,label:a._key,color:"#cccccc",target:a._to})}),_.each(c,function(a,b){e.nodes.push({id:b,label:b,size:.3,color:"#2ecc71",x:Math.random(),y:Math.random()})})),e},rerender:function(){this.fetchGraph()},fetchGraph:function(a){var b=this;$(this.el).append('
    Fetching graph data. Please wait ...


    If it`s taking too much time to draw the graph, please go to:
    '+window.location.href+"/settings
    and adjust your settings.It is possible that the graph is too big to be handled by the browser.
    ");var c=function(){var c={};this.graphConfig&&(c=_.clone(this.graphConfig),delete c.layout,delete c.edgeType,delete c.renderer),this.setupSigma(),$.ajax({type:"GET",url:arangoHelper.databaseUrl("/_admin/aardvark/graph/"+encodeURIComponent(this.name)),contentType:"application/json",data:c,success:function(c){$("#calcText").html("Calculating layout. Please wait ... "),b.renderGraph(c,a)},error:function(a){try{arangoHelper.arangoError("Graph",a.responseJSON.exception);var c=a.responseJSON.exception.search("1205");if(-1!==c){var d='Starting point: '+b.graphConfig.nodeStart+" is invalid";$("#calculatingGraph").html('
    Stopped.

    '+d+'. Please choose a different start node.
    ')}else $("#calculatingGraph").html("Failed to fetch graph information.")}catch(e){}}})}.bind(this);this.getGraphSettings(c)},setupSigma:function(){if(this.graphConfig&&this.graphConfig.edgeLabel){sigma.utils.pkg("sigma.settings");var a={defaultEdgeLabelColor:"#000",defaultEdgeLabelActiveColor:"#000",defaultEdgeLabelSize:10,edgeLabelSize:"fixed",edgeLabelSizePowRatio:1,edgeLabelThreshold:1};sigma.settings=sigma.utils.extend(sigma.settings||{},a),sigma.settings.drawEdgeLabels=!0}},contextState:{createEdge:!1,_from:!1,_to:!1,fromX:!1,fromY:!1},clearOldContextMenu:function(a){var b=this;$("#nodeContextMenu").remove();var c='
    ';$("#graph-container").append(c),a&&_.each(this.contextState,function(a,c){b.contextState[c]=!1});var d=document.getElementsByClassName("sigma-mouse")[0];d.removeEventListener("mousemove",b.drawLine.bind(this),!1)},trackCursorPosition:function(a){this.cursorX=a.x,this.cursorY=a.y},deleteNode:function(){var a=this,b=$("#delete-node-attr-id").text(),c=b.split("/")[0],d=b.split("/")[1];if("yes"===$("#delete-node-edges-attr").val())$.ajax({cache:!1,type:"DELETE",contentType:"application/json",url:arangoHelper.databaseUrl("/_api/gharial/"+encodeURIComponent(a.name)+"/vertex/"+encodeURIComponent(b.split("/")[0])+"/"+encodeURIComponent(b.split("/")[1])),success:function(c){a.currentGraph.graph.dropNode(b),a.currentGraph.refresh()},error:function(){arangoHelper.arangoError("Graph","Could not delete node.")}});else{var e=function(c){c?arangoHelper.arangoError("Graph","Could not delete node."):(a.currentGraph.graph.dropNode(b),a.currentGraph.refresh())};this.documentStore.deleteDocument(c,d,e)}window.modalView.hide()},deleteNodeModal:function(a){var b=[],c=[];c.push(window.modalView.createReadOnlyEntry("delete-node-attr-id","Really delete node",a)),c.push(window.modalView.createSelectEntry("delete-node-edges-attr","Also delete edges?",void 0,void 0,[{value:"yes",label:"Yes"},{value:"no",label:"No"}])),b.push(window.modalView.createDeleteButton("Delete",this.deleteNode.bind(this))),window.modalView.show("modalTable.ejs","Delete node",b,c)},addNode:function(){var a=this,b=$(".modal-body #new-node-collection-attr").val(),c=$(".modal-body #new-node-key-attr").last().val(),d=function(b,c,d){b?arangoHelper.arangoError("Could not create node",d.errorMessage):(a.currentGraph.graph.addNode({id:c,label:c.split("/")[1]||"",size:a.graphConfig.nodeSize||Math.random(),color:a.graphConfig.nodeColor||"#2ecc71",x:a.cursorX,y:a.cursorY}),window.modalView.hide(),a.currentGraph.refresh())};""!==c||void 0!==c?this.documentStore.createTypeDocument(b,c,d):this.documentStore.createTypeDocument(b,null,d)},deleteEdgeModal:function(a){var b=[],c=[];c.push(window.modalView.createReadOnlyEntry("delete-edge-attr-id","Really delete edge",a)),b.push(window.modalView.createDeleteButton("Delete",this.deleteEdge.bind(this))),window.modalView.show("modalTable.ejs","Delete edge",b,c)},deleteEdge:function(){var a=this,b=$("#delete-edge-attr-id").text(),c=b.split("/")[0],d=b.split("/")[1],e=function(c){c?arangoHelper.arangoError("Graph","Could not delete edge."):(a.currentGraph.graph.dropEdge(b),a.currentGraph.refresh())};this.documentStore.deleteDocument(c,d,e),window.modalView.hide()},addNodeModal:function(){if(0!==this.graphSettings.vertexCollections){var a=[],b=[],c=[];_.each(this.graphSettings.vertexCollections,function(a){c.push({label:a.name,value:a.id})}),b.push(window.modalView.createTextEntry("new-node-key-attr","_key",void 0,"The nodes unique key(optional attribute, leave empty for autogenerated key","is optional: leave empty for autogenerated key",!1,[{rule:Joi.string().allow("").optional(),msg:""}])),b.push(window.modalView.createSelectEntry("new-node-collection-attr","Collection",void 0,"Please select the destination for the new node.",c)),a.push(window.modalView.createSuccessButton("Create",this.addNode.bind(this))),window.modalView.show("modalTable.ejs","Create node",a,b)}else arangoHelper.arangoError("Graph","No valid vertex collections found.")},addEdge:function(){var a,b=this,c=b.contextState._from,d=b.contextState._to;a=""===$(".modal-body #new-edge-collection-attr").val()?$(".modal-body #new-edge-collection-attr").text():$(".modal-body #new-edge-collection-attr").val();var e=$(".modal-body #new-edge-key-attr").last().val(),f=function(a,e){a?arangoHelper.arangoError("Graph","Could not create edge."):(b.graphConfig.edgeEditable?b.currentGraph.graph.addEdge({source:c,size:1,target:d,id:e._id,color:b.graphConfig.edgeColor}):b.currentGraph.graph.addEdge({source:c,target:d,id:e._id,color:b.graphConfig.edgeColor}),this.graphConfig&&"curve"===this.graphConfig.edgeType&&sigma.canvas.edges.autoCurve(b.currentGraph),b.currentGraph.refresh()),b.clearOldContextMenu(!0),window.modalView.hide()};""!==e||void 0!==e?this.documentStore.createTypeEdge(a,c,d,e,f):this.documentStore.createTypeEdge(a,c,d,null,f)},addEdgeModal:function(a){if(0!==a){var b=[],c=[];if(c.push(window.modalView.createTextEntry("new-edge-key-attr","_key",void 0,"The edges unique key(optional attribute, leave empty for autogenerated key","is optional: leave empty for autogenerated key",!1,[{rule:Joi.string().allow("").optional(),msg:""}])),a.length>1){var d=[];_.each(a,function(a){d.push({label:a,value:a})}),c.push(window.modalView.createSelectEntry("new-edge-collection-attr","Edge collection",void 0,"Please select the destination for the new edge.",d))}else c.push(window.modalView.createReadOnlyEntry("new-edge-collection-attr","Edge collection",a[0],"The edges collection to be used."));b.push(window.modalView.createSuccessButton("Create",this.addEdge.bind(this))),window.modalView.show("modalTable.ejs","Create edge",b,c)}else arangoHelper.arangoError("Graph","No valid edge definitions found.")},updateColors:function(){var a=window.App.currentDB.toJSON().name+"_"+this.name,b=this;this.userConfig.fetch({success:function(c){b.graphConfig=c.toJSON().graphs[a],b.currentGraph.graph.nodes().forEach(function(a){a.color=b.graphConfig.nodeColor}),b.currentGraph.graph.edges().forEach(function(a){a.color=b.graphConfig.edgeColor}),b.currentGraph.refresh()}})},createContextMenu:function(a){var b=this,c=b.cursorX-50,d=b.cursorY-50;this.clearOldContextMenu();var e=function(a){var c=wheelnav,d=new c("nodeContextMenu");d.maxPercent=1,d.wheelRadius=50,d.clockwise=!1,d.colors=b.colors.hotaru,d.multiSelect=!0,d.clickModeRotate=!1,d.slicePathFunction=slicePath().DonutSlice,b.viewStates.captureMode?d.createWheel([icon.plus,icon.trash]):d.createWheel([icon.plus,""]),d.navItems[0].selected=!1,d.navItems[0].hovered=!1,d.navItems[0].navigateFunction=function(a){b.clearOldContextMenu(),b.addNodeModal()},b.viewStates.captureMode&&(d.navItems[1].navigateFunction=function(a){b.clearOldContextMenu()}),d.navItems[0].selected=!1,d.navItems[0].hovered=!1};$("#nodeContextMenu").css("position","fixed"),$("#nodeContextMenu").css("left",c),$("#nodeContextMenu").css("top",d),$("#nodeContextMenu").width(100),$("#nodeContextMenu").height(100),e(a)},createEdgeContextMenu:function(a,b){var c=this,d=this.cursorX-165,e=this.cursorY-120;this.clearOldContextMenu();var f=function(a,b){var d=["#364C4A","#497C7F","#92C5C0","#858168","#CCBCA5"],e=wheelnav,f=new e("nodeContextMenu");f.maxPercent=1,f.wheelRadius=50,f.clockwise=!1,f.colors=d,f.multiSelect=!0,f.clickModeRotate=!1,f.slicePathFunction=slicePath().DonutSlice,f.createWheel([icon.edit,icon.trash]),f.navItems[0].selected=!1,f.navItems[0].hovered=!1,f.navItems[0].navigateFunction=function(a){c.clearOldContextMenu(),c.editEdge(b)},f.navItems[1].navigateFunction=function(a){c.clearOldContextMenu(),c.deleteEdgeModal(b)},f.navItems[0].selected=!1,f.navItems[0].hovered=!1};$("#nodeContextMenu").css("left",d+115),$("#nodeContextMenu").css("top",e+72),$("#nodeContextMenu").width(100),$("#nodeContextMenu").height(100),f(b,a)},createNodeContextMenu:function(a,b){var c,d,e=this;_.each(b.data.node,function(a,b){"renderer"===b.substr(0,8)&&"x"===b.charAt(b.length-1)&&(c=a),"renderer"===b.substr(0,8)&&"y"===b.charAt(b.length-1)&&(d=a)}),this.clearOldContextMenu();var f=function(a,b){var f=["#364C4A","#497C7F","#92C5C0","#858168","#CCBCA5"],g=wheelnav,h=new g("nodeContextMenu");h.maxPercent=1,h.wheelRadius=50,h.clockwise=!1,h.colors=f,h.multiSelect=!0,h.clickModeRotate=!1,h.slicePathFunction=slicePath().DonutSlice,h.createWheel([icon.edit,icon.trash,icon.play,icon.connect]),h.navItems[0].selected=!1,h.navItems[0].hovered=!1,h.navItems[0].navigateFunction=function(a){e.clearOldContextMenu(),e.editNode(b)},h.navItems[1].navigateFunction=function(a){e.clearOldContextMenu(),e.deleteNodeModal(b)},h.navItems[2].navigateFunction=function(a){e.clearOldContextMenu(),e.setStartNode(b)},h.navItems[3].navigateFunction=function(a){e.contextState.createEdge=!0,e.contextState._from=b,e.contextState.fromX=c,e.contextState.fromY=d;var f=document.getElementsByClassName("sigma-mouse")[0];f.addEventListener("mousemove",e.drawLine.bind(this),!1),e.clearOldContextMenu()},h.navItems[0].selected=!1,h.navItems[0].hovered=!1};$("#nodeContextMenu").css("left",c+115),$("#nodeContextMenu").css("top",d+72),$("#nodeContextMenu").width(100),$("#nodeContextMenu").height(100),f(b,a)},clearMouseCanvas:function(){var a=document.getElementsByClassName("sigma-mouse")[0],b=a.getContext("2d");b.clearRect(0,0,$(a).width(),$(a).height())},drawLine:function(a){var b=window.App.graphViewer2.contextState;if(b.createEdge){var c=b.fromX,d=b.fromY,e=a.offsetX,f=a.offsetY,g=document.getElementsByClassName("sigma-mouse")[0],h=g.getContext("2d");h.clearRect(0,0,$(g).width(),$(g).height()),h.beginPath(),h.moveTo(c,d),h.lineTo(e,f),h.stroke()}},getGraphSettings:function(a){var b=this,c=frontendConfig.db+"_"+this.name;this.userConfig.fetch({success:function(d){b.graphConfig=d.toJSON().graphs[c],b.graphSettingsView&&b.graphSettingsView.remove(),b.graphSettingsView=new window.GraphSettingsView({name:b.name,userConfig:b.userConfig,saveCallback:b.render}),b.graphSettingsView.render(),a&&a(b.graphConfig)}})},setStartNode:function(a){this.graphConfig.nodeStart=a,this.graphSettingsView.saveGraphSettings(null,a)},editNode:function(a){var b=function(){};arangoHelper.openDocEditor(a,"doc",b)},editEdge:function(a){var b=function(){};arangoHelper.openDocEditor(a,"edge",b)},reloadGraph:function(){Backbone.history.loadUrl(Backbone.history.fragment)},getEdgeDefinitionCollections:function(a,b){var c=[];return _.each(this.model.edgeDefinitions,function(d){_.each(d.from,function(e){e===a&&_.each(d.to,function(a){a===b&&c.push(d.collection)})})}),c},initializeGraph:function(a,b){var c=this;a.refresh(),this.Sigma.plugins.Lasso=sigma.plugins.lasso;var d=new this.Sigma.plugins.Lasso(a,a.renderers[0],{strokeStyle:"black",lineWidth:1,fillWhileDrawing:!0,fillStyle:"rgba(41, 41, 41, 0.2)",cursor:"crosshair"});return d.bind("selectedNodes",function(b){var d=b.data;a.graph.nodes().forEach(function(a){a.color=c.graphConfig.nodeColor?c.graphConfig.nodeColor:"rgb(46, 204, 113)"}),d.forEach(function(a){a.color="red"}),a.refresh()}),d},renderGraph:function(a,b){var c=this;if(this.graphSettings=a.settings,0===a.edges.length){var d='No edges found for starting point: '+c.graphSettings.startVertex._id+"";return void $("#calculatingGraph").html('
    Stopped.

    '+d+'. Please choose a different start node or try to reload the graph.
    ')}var e="position: absolute; left: 25px; bottom: 45px;";this.aqlMode&&(e="position: absolute; left: 30px; margin-top: -37px;"),$(this.el).append('
    '+a.nodes.length+' nodes'+a.edges.length+" edges
    "),this.Sigma=sigma;var f="force",g="canvas";this.graphConfig&&(this.graphConfig.layout&&(f=this.graphConfig.layout),this.graphConfig.renderer&&(g=this.graphConfig.renderer,"canvas"===g&&(c.isEditable=!0)));var h={doubleClickEnabled:!1,minNodeSize:3.5,minEdgeSize:1,maxEdgeSize:4,enableEdgeHovering:!0,edgeHoverColor:"#000",defaultEdgeHoverColor:"#000",defaultEdgeType:"line",edgeHoverSizeRatio:2,edgeHoverExtremities:!0,autoRescale:!0,mouseEnabled:!0,touchEnabled:!0,nodesPowRatio:1,font:"Roboto",edgesPowRatio:1};"canvas"===g&&(h.autoCurveSortByDirection=!0),a.nodes.length>500&&(h.labelThreshold=15,h.hideEdgesOnMove=!0),this.graphConfig&&(this.graphConfig.edgeType&&(h.defaultEdgeType=this.graphConfig.edgeType,"arrow"===this.graphConfig.edgeType&&(h.minArrowSize=7)),this.graphConfig.nodeLabelThreshold&&(h.labelThreshold=this.graphConfig.nodeLabelThreshold),this.graphConfig.edgeLabelThreshold&&(h.edgeLabelThreshold=this.graphConfig.edgeLabelThreshold)),"webgl"===g&&(h.enableEdgeHovering=!1);var i=new this.Sigma({graph:a,container:"graph-container",renderer:{container:document.getElementById("graph-container"),type:g},settings:h});if(this.currentGraph=i,this.aqlMode||sigma.plugins.fullScreen({container:"graph-container",btnId:"graph-fullscreen-btn"}),"noverlap"===f){var j=i.configNoverlap({nodeMargin:.1,scaleNodes:1.05,gridSize:75,easing:"quadraticInOut",duration:1e4});j.bind("start stop interpolate",function(a){"start"===a.type,"interpolate"===a.type})}else if("fruchtermann"===f){var k=sigma.layouts.fruchtermanReingold.configure(i,{iterations:500,easing:"quadraticInOut",duration:800});k.bind("start stop interpolate",function(a){})}if(i.graph.nodes().forEach(function(a){a.originalColor=a.color}),i.graph.edges().forEach(function(a){a.originalColor=a.color}),"canvas"===g&&(this.graphConfig&&"curve"===this.graphConfig.edgeType&&sigma.canvas.edges.autoCurve(i),i.refresh(),c.aqlMode||i.bind("rightClickStage",function(a){c.createContextMenu(a),c.clearMouseCanvas()}),i.bind("overNode",function(a){if($(".nodeInfoDiv").remove(),c.contextState.createEdge===!1){var b=function(a,b){if(!a){var d={},e=0,f=!1;_.each(b,function(a,b){15>e?"string"==typeof a&&(a.length>10?d[b]=a.substr(0,15)+" ...":d[b]=a):f=!0,e++});var g='
    '+JSON.stringify(d,null,2);f?(g=g.substr(0,g.length-2),g+=" \n\n  ... \n\n } 
    "):g+="",$(c.el).append(g)}};c.documentStore.getDocument(a.data.node.id.split("/")[0],a.data.node.id.split("/")[1],b)}}),i.bind("outNode",function(a){c.contextState.createEdge===!1&&$(".nodeInfoDiv").remove()}),i.bind("clickNode",function(a){if(c.contextState.createEdge===!0){c.contextState._to=a.data.node.id;var b=c.contextState._from.split("/")[0],d=c.contextState._to.split("/")[0],e=c.getEdgeDefinitionCollections(b,d);c.addEdgeModal(e,c.contextState._from,c.contextState._to)}}),this.aqlMode||i.bind("rightClickNode",function(a){var b=a.data.node.id;c.createNodeContextMenu(b,a)}),this.graphConfig&&this.graphConfig.edgeEditable&&i.bind("rightClickEdge",function(a){var b=a.data.edge.id;c.createEdgeContextMenu(b,a)}),i.bind("doubleClickNode",function(a){var b=a.data.node.id,c=i.graph.neighbors(b);c[b]=a.data.node,i.graph.nodes().forEach(function(a){c[a.id]?a.color=a.originalColor:a.color="#eee"}),i.graph.edges().forEach(function(a){c[a.source]&&c[a.target]?a.color="rgb(64, 74, 83)":a.color="#eee"}),i.refresh()}),i.bind("doubleClickStage",function(){i.graph.nodes().forEach(function(a){a.color=a.originalColor}),i.graph.edges().forEach(function(a){a.color=a.originalColor}),i.refresh()}),i.bind("clickStage",function(){c.clearOldContextMenu(!0),c.clearMouseCanvas()})),"noverlap"===f)i.startNoverlap(),sigma.plugins.dragNodes(i,i.renderers[0]);else if("force"===f){var l="color: rgb(64, 74, 83); cursor: pointer; position: absolute; right: 30px; bottom: 40px;";c.aqlMode&&(l="color: rgb(64, 74, 83); cursor: pointer; position: absolute; right: 30px; margin-top: -30px;"),$(this.el).append('
    '),c.startLayout();var m=3e3;a.nodes.length>2500?m=5e3:a.nodes.length<50&&(m=500),window.setTimeout(function(){c.stopLayout()},m)}else"fruchtermann"===f?(sigma.layouts.fruchtermanReingold.start(i),sigma.plugins.dragNodes(i,i.renderers[0])):sigma.plugins.dragNodes(i,i.renderers[0]);var n=document.getElementsByClassName("sigma-mouse")[0];n.addEventListener("mousemove",c.trackCursorPosition.bind(this),!1),b&&$("#"+b).focus();var o=function(){c.graphLasso=c.initializeGraph(i,a),c.graphLasso.activate(),c.graphLasso.deactivate()};this.graphConfig?"canvas"===this.graphConfig.renderer?o():$("#selectNodes").parent().hide():"canvas"===g?o():$("#selectNodes").parent().hide(),c.graphLasso&&(window.App.listenerFunctions.graphViewer=this.keyUpFunction.bind(this)),$("#calculatingGraph").remove()},keyUpFunction:function(a){var b=this;switch(a.keyCode){case 76:a.altKey&&b.toggleLasso()}},toggleLayout:function(){this.layouting?this.stopLayout():this.startLayout()},toggleLasso:function(){this.graphLasso.isActive?($("#selectNodes").removeClass("activated"),this.graphLasso.deactivate()):($("#selectNodes").addClass("activated"),this.graphLasso.activate())},startLayout:function(){$("#toggleForce .fa").removeClass("fa-play").addClass("fa-pause"),this.layouting=!0,this.currentGraph.startForceAtlas2({worker:!0,barnesHutOptimize:!1}),sigma.plugins.dragNodes(this.currentGraph,this.currentGraph.renderers[0])},stopLayout:function(){$("#toggleForce .fa").removeClass("fa-pause").addClass("fa-play"),this.layouting=!1,this.currentGraph.stopForceAtlas2(),sigma.plugins.dragNodes(this.currentGraph,this.currentGraph.renderers[0])}})}(),function(){"use strict";window.HelpUsView=Backbone.View.extend({el:"#content",template:templateEngine.createTemplate("helpUsView.ejs"),render:function(){this.$el.html(this.template.render({}))}})}(),function(){"use strict";window.IndicesView=Backbone.View.extend({el:"#content",initialize:function(a){this.collectionName=a.collectionName,this.model=this.collection},template:templateEngine.createTemplate("indicesView.ejs"),events:{},render:function(){$(this.el).html(this.template.render({model:this.model})),this.breadcrumb(),window.arangoHelper.buildCollectionSubNav(this.collectionName,"Indices"),this.getIndex()},breadcrumb:function(){$("#subNavigationBar .breadcrumb").html("Collection: "+this.collectionName)},getIndex:function(){var a=function(a,b){a?window.arangoHelper.arangoError("Index",b.errorMessage):this.renderIndex(b)}.bind(this);this.model.getIndex(a)},createIndex:function(){var a,b,c,d=this,e=$("#newIndexType").val(),f={};switch(e){case"Geo":a=$("#newGeoFields").val();var g=d.checkboxToValue("#newGeoJson");f={type:"geo",fields:d.stringToArray(a),geoJson:g};break;case"Persistent":a=$("#newPersistentFields").val(),b=d.checkboxToValue("#newPersistentUnique"),c=d.checkboxToValue("#newPersistentSparse"),f={type:"persistent",fields:d.stringToArray(a),unique:b,sparse:c};break;case"Hash":a=$("#newHashFields").val(),b=d.checkboxToValue("#newHashUnique"),c=d.checkboxToValue("#newHashSparse"),f={type:"hash",fields:d.stringToArray(a),unique:b,sparse:c};break;case"Fulltext":a=$("#newFulltextFields").val();var h=parseInt($("#newFulltextMinLength").val(),10)||0;f={type:"fulltext",fields:d.stringToArray(a),minLength:h};break;case"Skiplist":a=$("#newSkiplistFields").val(),b=d.checkboxToValue("#newSkiplistUnique"),c=d.checkboxToValue("#newSkiplistSparse"),f={type:"skiplist",fields:d.stringToArray(a),unique:b,sparse:c}}var i=function(a,b){if(a)if(b){var c=JSON.parse(b.responseText);arangoHelper.arangoError("Document error",c.errorMessage)}else arangoHelper.arangoError("Document error","Could not create index.");d.toggleNewIndexView(),d.render()};this.model.createIndex(f,i)},bindIndexEvents:function(){this.unbindIndexEvents();var a=this;$("#indexEditView #addIndex").bind("click",function(){a.toggleNewIndexView(),$("#cancelIndex").unbind("click"),$("#cancelIndex").bind("click",function(){a.toggleNewIndexView(),a.render()}),$("#createIndex").unbind("click"),$("#createIndex").bind("click",function(){a.createIndex()})}),$("#newIndexType").bind("change",function(){a.selectIndexType()}),$(".deleteIndex").bind("click",function(b){a.prepDeleteIndex(b)}),$("#infoTab a").bind("click",function(a){if($("#indexDeleteModal").remove(),"Indices"!==$(a.currentTarget).html()||$(a.currentTarget).parent().hasClass("active")||($("#newIndexView").hide(),$("#indexEditView").show(),$("#indexHeaderContent #modal-dialog .modal-footer .button-danger").hide(),$("#indexHeaderContent #modal-dialog .modal-footer .button-success").hide(),$("#indexHeaderContent #modal-dialog .modal-footer .button-notification").hide()),"General"===$(a.currentTarget).html()&&!$(a.currentTarget).parent().hasClass("active")){$("#indexHeaderContent #modal-dialog .modal-footer .button-danger").show(),$("#indexHeaderContent #modal-dialog .modal-footer .button-success").show(),$("#indexHeaderContent #modal-dialog .modal-footer .button-notification").show();var b=$(".index-button-bar2")[0];$("#cancelIndex").is(":visible")&&($("#cancelIndex").detach().appendTo(b),$("#createIndex").detach().appendTo(b))}})},prepDeleteIndex:function(a){var b=this;this.lastTarget=a,this.lastId=$(this.lastTarget.currentTarget).parent().parent().first().children().first().text(),$("#content #modal-dialog .modal-footer").after(''),$("#indexHeaderContent #indexConfirmDelete").unbind("click"),$("#indexHeaderContent #indexConfirmDelete").bind("click",function(){$("#indexHeaderContent #indexDeleteModal").remove(),b.deleteIndex()}),$("#indexHeaderContent #indexAbortDelete").unbind("click"),$("#indexHeaderContent #indexAbortDelete").bind("click",function(){$("#indexHeaderContent #indexDeleteModal").remove()})},unbindIndexEvents:function(){$("#indexHeaderContent #indexEditView #addIndex").unbind("click"),$("#indexHeaderContent #newIndexType").unbind("change"),$("#indexHeaderContent #infoTab a").unbind("click"),$("#indexHeaderContent .deleteIndex").unbind("click")},deleteIndex:function(){var a=function(a){a?(arangoHelper.arangoError("Could not delete index"),$("tr th:contains('"+this.lastId+"')").parent().children().last().html(''),this.model.set("locked",!1)):a||void 0===a||($("tr th:contains('"+this.lastId+"')").parent().remove(),this.model.set("locked",!1))}.bind(this);this.model.set("locked",!0),this.model.deleteIndex(this.lastId,a),$("tr th:contains('"+this.lastId+"')").parent().children().last().html('')},renderIndex:function(a){this.index=a;var b="collectionInfoTh modal-text";if(this.index){var c="",d="";_.each(this.index.indexes,function(a){d="primary"===a.type||"edge"===a.type?'':'',void 0!==a.fields&&(c=a.fields.join(", "));var e=a.id.indexOf("/"),f=a.id.substr(e+1,a.id.length),g=a.hasOwnProperty("selectivityEstimate")?(100*a.selectivityEstimate).toFixed(2)+"%":"n/a",h=a.hasOwnProperty("sparse")?a.sparse:"n/a";$("#collectionEditIndexTable").append(""+f+""+a.type+""+a.unique+""+h+""+g+""+c+""+d+"")})}this.bindIndexEvents()},selectIndexType:function(){$(".newIndexClass").hide();var a=$("#newIndexType").val();$("#newIndexType"+a).show()},resetIndexForms:function(){$("#indexHeader input").val("").prop("checked",!1),$("#newIndexType").val("Geo").prop("selected",!0),this.selectIndexType()},toggleNewIndexView:function(){var a=$(".index-button-bar2")[0];$("#indexEditView").is(":visible")?($("#indexEditView").hide(),$("#newIndexView").show(),$("#cancelIndex").detach().appendTo("#indexHeaderContent #modal-dialog .modal-footer"),$("#createIndex").detach().appendTo("#indexHeaderContent #modal-dialog .modal-footer")):($("#indexEditView").show(), +$("#newIndexView").hide(),$("#cancelIndex").detach().appendTo(a),$("#createIndex").detach().appendTo(a)),arangoHelper.fixTooltips(".icon_arangodb, .arangoicon","right"),this.resetIndexForms()},stringToArray:function(a){var b=[];return a.split(",").forEach(function(a){a=a.replace(/(^\s+|\s+$)/g,""),""!==a&&b.push(a)}),b},checkboxToValue:function(a){return $(a).prop("checked")}})}(),function(){"use strict";window.InfoView=Backbone.View.extend({el:"#content",initialize:function(a){this.collectionName=a.collectionName,this.model=this.collection},events:{},render:function(){this.breadcrumb(),window.arangoHelper.buildCollectionSubNav(this.collectionName,"Info"),this.renderInfoView()},breadcrumb:function(){$("#subNavigationBar .breadcrumb").html("Collection: "+this.collectionName)},renderInfoView:function(){if(this.model.get("locked"))return 0;var a=function(a,b,c){if(a)arangoHelper.arangoError("Figures","Could not get revision.");else{var d=[],e={figures:c,revision:b,model:this.model};window.modalView.show("modalCollectionInfo.ejs","Collection: "+this.model.get("name"),d,e,null,null,null,null,null,"content")}}.bind(this),b=function(b,c){if(b)arangoHelper.arangoError("Figures","Could not get figures.");else{var d=c;this.model.getRevision(a,d)}}.bind(this);this.model.getFigures(b)}})}(),function(){"use strict";window.LoginView=Backbone.View.extend({el:"#content",el2:".header",el3:".footer",loggedIn:!1,loginCounter:0,events:{"keyPress #loginForm input":"keyPress","click #submitLogin":"validate","submit #dbForm":"goTo","click #logout":"logout","change #loginDatabase":"renderDBS"},template:templateEngine.createTemplate("loginView.ejs"),render:function(a){var b=this;if($(this.el).html(this.template.render({})),$(this.el2).hide(),$(this.el3).hide(),frontendConfig.authenticationEnabled&&a!==!0)window.setTimeout(function(){$("#loginUsername").focus()},300);else{var c=arangoHelper.databaseUrl("/_api/database/user");frontendConfig.authenticationEnabled===!1&&($("#logout").hide(),$(".login-window #databases").css("height","90px")),$("#loginForm").hide(),$(".login-window #databases").show(),$.ajax(c).success(function(a){$("#loginDatabase").html(""),_.each(a.result,function(a){$("#loginDatabase").append("")}),b.renderDBS()}).error(function(){console.log("could not fetch user db data")})}return $(".bodyWrapper").show(),this},clear:function(){$("#loginForm input").removeClass("form-error"),$(".wrong-credentials").hide()},keyPress:function(a){a.ctrlKey&&13===a.keyCode?(a.preventDefault(),this.validate()):a.metaKey&&13===a.keyCode&&(a.preventDefault(),this.validate())},validate:function(a){a.preventDefault(),this.clear();var b=$("#loginUsername").val(),c=$("#loginPassword").val();b&&this.collection.login(b,c,this.loginCallback.bind(this,b,c))},loginCallback:function(a,b,c){var d=this;if(c){if(0===d.loginCounter)return d.loginCounter++,void d.collection.login(a,b,this.loginCallback.bind(this,a));d.loginCounter=0,$(".wrong-credentials").show(),$("#loginDatabase").html(""),$("#loginDatabase").append("")}else{var e=arangoHelper.databaseUrl("/_api/user/"+encodeURIComponent(a)+"/database","_system");frontendConfig.authenticationEnabled===!1&&(e=arangoHelper.databaseUrl("/_api/database/user")),$(".wrong-credentials").hide(),d.loggedIn=!0,$.ajax(e).success(function(a){_.each(a.result,function(b,c){"rw"!==b&&delete a.result[c]}),$("#loginForm").hide(),$(".login-window #databases").show(),$("#loginDatabase").html(""),_.each(a.result,function(a,b){$("#loginDatabase").append("")}),d.renderDBS()}).error(function(){$(".wrong-credentials").show()})}},renderDBS:function(){if(0===$("#loginDatabase").children().length)$("#dbForm").remove(),$(".login-window #databases").prepend('
    You do not have permission to a database.
    ');else{var a=$("#loginDatabase").val();$("#goToDatabase").html("Select DB: "+a),window.setTimeout(function(){$("#goToDatabase").focus()},300)}},logout:function(){this.collection.logout()},goTo:function(a){a.preventDefault();var b=$("#loginUsername").val(),c=$("#loginDatabase").val();window.App.dbSet=c;var d=function(a){a&&arangoHelper.arangoError("User","Could not fetch user settings")},e=window.location.protocol+"//"+window.location.host+frontendConfig.basePath+"/_db/"+c+"/_admin/aardvark/index.html";window.location.href=e,$(this.el2).show(),$(this.el3).show(),$(".bodyWrapper").show(),$(".navbar").show(),$("#currentUser").text(b),this.collection.loadUserSettings(d)}})}(),function(){"use strict";window.LogsView=window.PaginationView.extend({el:"#content",id:"#logContent",paginationDiv:"#logPaginationDiv",idPrefix:"logTable",fetchedAmount:!1,initialize:function(a){this.options=a,this.convertModelToJSON()},currentLoglevel:"logall",events:{"click #arangoLogTabbar button":"setActiveLoglevel","click #logTable_first":"firstPage","click #logTable_last":"lastPage"},template:templateEngine.createTemplate("logsView.ejs"),tabbar:templateEngine.createTemplate("arangoTabbar.ejs"),table:templateEngine.createTemplate("arangoTable.ejs"),tabbarElements:{id:"arangoLogTabbar",titles:[["All","logall"],["Info","loginfo"],["Error","logerror"],["Warning","logwarning"],["Debug","logdebug"]]},tableDescription:{id:"arangoLogTable",titles:["Loglevel","Date","Message"],rows:[]},convertedRows:null,setActiveLoglevel:function(a){$(".arangodb-tabbar").removeClass("arango-active-tab"),this.currentLoglevel!==a.currentTarget.id&&(this.currentLoglevel=a.currentTarget.id,this.convertModelToJSON())},initTotalAmount:function(){var a=this;this.collection=this.options[this.currentLoglevel],this.collection.fetch({data:$.param({test:!0}),success:function(){a.convertModelToJSON()}}),this.fetchedAmount=!0},invertArray:function(a){var b,c=[],d=0;for(b=a.length-1;b>=0;b--)c[d]=a[b],d++;return c},convertModelToJSON:function(){if(!this.fetchedAmount)return void this.initTotalAmount();var a,b=this,c=[];this.collection=this.options[this.currentLoglevel],this.collection.fetch({success:function(){b.collection.each(function(b){a=new Date(1e3*b.get("timestamp")),c.push([b.getLogStatus(),arangoHelper.formatDT(a),b.get("text")])}),b.tableDescription.rows=b.invertArray(c),b.render()}})},render:function(){return $(this.el).html(this.template.render({})),$(this.id).html(this.tabbar.render({content:this.tabbarElements})),$(this.id).append(this.table.render({content:this.tableDescription})),$("#"+this.currentLoglevel).addClass("arango-active-tab"),$("#logContent").append('
    '),this.renderPagination(),this},rerender:function(){this.convertModelToJSON()}})}(),function(){"use strict";var a=function(a,b,c,d){return{type:a,title:b,callback:c,confirm:d}},b=function(a,b,c,d,e,f,g,h,i,j,k){var l={type:a,label:b};return void 0!==c&&(l.value=c),void 0!==d&&(l.info=d),void 0!==e&&(l.placeholder=e),void 0!==f&&(l.mandatory=f),void 0!==h&&(l.addDelete=h),void 0!==i&&(l.addAdd=i),void 0!==j&&(l.maxEntrySize=j),void 0!==k&&(l.tags=k),g&&(l.validateInput=function(){return g}),l};window.ModalView=Backbone.View.extend({_validators:[],_validateWatchers:[],baseTemplate:templateEngine.createTemplate("modalBase.ejs"),tableTemplate:templateEngine.createTemplate("modalTable.ejs"),el:"#modalPlaceholder",contentEl:"#modalContent",hideFooter:!1,confirm:{list:"#modal-delete-confirmation",yes:"#modal-confirm-delete",no:"#modal-abort-delete"},enabledHotkey:!1,enableHotKeys:!0,buttons:{SUCCESS:"success",NOTIFICATION:"notification",DELETE:"danger",NEUTRAL:"neutral",CLOSE:"close"},tables:{READONLY:"readonly",TEXT:"text",BLOB:"blob",PASSWORD:"password",SELECT:"select",SELECT2:"select2",CHECKBOX:"checkbox"},initialize:function(){Object.freeze(this.buttons),Object.freeze(this.tables)},createModalHotkeys:function(){$(this.el).unbind("keydown"),$(this.el).unbind("return"),$(this.el).bind("keydown","return",function(){$(".createModalDialog .modal-footer .button-success").click()}),$(".modal-body input").unbind("keydown"),$(".modal-body input").unbind("return"),$(".modal-body input",$(this.el)).bind("keydown","return",function(){$(".createModalDialog .modal-footer .button-success").click()}),$(".modal-body select").unbind("keydown"),$(".modal-body select").unbind("return"),$(".modal-body select",$(this.el)).bind("keydown","return",function(){$(".createModalDialog .modal-footer .button-success").click()})},createInitModalHotkeys:function(){var a=this;$(this.el).bind("keydown","left",function(){a.navigateThroughButtons("left")}),$(this.el).bind("keydown","right",function(){a.navigateThroughButtons("right")})},navigateThroughButtons:function(a){var b=$(".createModalDialog .modal-footer button").is(":focus");b===!1?"left"===a?$(".createModalDialog .modal-footer button").first().focus():"right"===a&&$(".createModalDialog .modal-footer button").last().focus():b===!0&&("left"===a?$(":focus").prev().focus():"right"===a&&$(":focus").next().focus())},createCloseButton:function(b,c){var d=this;return a(this.buttons.CLOSE,b,function(){d.hide(),c&&c()})},createSuccessButton:function(b,c){return a(this.buttons.SUCCESS,b,c)},createNotificationButton:function(b,c){return a(this.buttons.NOTIFICATION,b,c)},createDeleteButton:function(b,c,d){return a(this.buttons.DELETE,b,c,d)},createNeutralButton:function(b,c){return a(this.buttons.NEUTRAL,b,c)},createDisabledButton:function(b){var c=a(this.buttons.NEUTRAL,b);return c.disabled=!0,c},createReadOnlyEntry:function(a,c,d,e,f,g){var h=b(this.tables.READONLY,c,d,e,void 0,void 0,void 0,f,g);return h.id=a,h},createTextEntry:function(a,c,d,e,f,g,h){var i=b(this.tables.TEXT,c,d,e,f,g,h);return i.id=a,i},createBlobEntry:function(a,c,d,e,f,g,h){var i=b(this.tables.BLOB,c,d,e,f,g,h);return i.id=a,i},createSelect2Entry:function(a,c,d,e,f,g,h,i,j,k){var l=b(this.tables.SELECT2,c,d,e,f,g,void 0,h,i,j,k);return l.id=a,l},createPasswordEntry:function(a,c,d,e,f,g,h){var i=b(this.tables.PASSWORD,c,d,e,f,g,h);return i.id=a,i},createCheckboxEntry:function(a,c,d,e,f){var g=b(this.tables.CHECKBOX,c,d,e);return g.id=a,f&&(g.checked=f),g},createSelectEntry:function(a,c,d,e,f){var g=b(this.tables.SELECT,c,null,e);return g.id=a,d&&(g.selected=d),g.options=f,g},createOptionEntry:function(a,b){return{label:a,value:b||a}},show:function(a,b,c,d,e,f,g,h,i,j){var k,l,m=this,n=!1;c=c||[],h=Boolean(h),this.clearValidators(),c.length>0?(c.forEach(function(a){a.type===m.buttons.CLOSE&&(n=!0),a.type===m.buttons.DELETE&&(l=l||a.confirm)}),n||(k=c.pop(),c.push(m.createCloseButton("Cancel")),c.push(k))):c.push(m.createCloseButton("Close")),j?($("#"+j).html(this.baseTemplate.render({title:b,buttons:c,hideFooter:this.hideFooter,confirm:l,tabBar:i})),$("#"+j+" #modal-dialog").removeClass("fade hide modal"),$("#"+j+" .modal-header").remove(),$("#"+j+" .modal-tabbar").remove(),$("#"+j+" .modal-tabbar").remove(),$("#"+j+" .button-close").remove(),0===$("#"+j+" .modal-footer").children().length&&$("#"+j+" .modal-footer").remove()):$(this.el).html(this.baseTemplate.render({title:b,buttons:c,hideFooter:this.hideFooter,confirm:l,tabBar:i})),_.each(c,function(a,b){if(!a.disabled&&a.callback){if(a.type===m.buttons.DELETE&&!h){var c="#modalButton"+b;return j&&(c="#"+j+" #modalButton"+b),void $(c).bind("click",function(){j?($("#"+j+" "+m.confirm.yes).unbind("click"),$("#"+j+" "+m.confirm.yes).bind("click",a.callback),$("#"+j+" "+m.confirm.list).css("display","block")):($(m.confirm.yes).unbind("click"),$(m.confirm.yes).bind("click",a.callback),$(m.confirm.list).css("display","block"))})}j?$("#"+j+" #modalButton"+b).bind("click",a.callback):$("#modalButton"+b).bind("click",a.callback)}}),j?$("#"+j+" "+this.confirm.no).bind("click",function(){$("#"+j+" "+m.confirm.list).css("display","none")}):$(this.confirm.no).bind("click",function(){$(m.confirm.list).css("display","none")});var o;if("string"==typeof a)o=templateEngine.createTemplate(a),j?$("#"+j+" .createModalDialog .modal-body").html(o.render({content:d,advancedContent:e,info:f})):$("#modalPlaceholder .createModalDialog .modal-body").html(o.render({content:d,advancedContent:e,info:f}));else{var p=0;_.each(a,function(a){o=templateEngine.createTemplate(a),$(".createModalDialog .modal-body .tab-content #"+i[p]).html(o.render({content:d,advancedContent:e,info:f})),p++})}$(".createModalDialog .modalTooltips").tooltip({position:{my:"left top",at:"right+55 top-1"}});var q=d||[];e&&e.content&&(q=q.concat(e.content)),_.each(q,function(a){m.modalBindValidation(a),a.type===m.tables.SELECT2&&$("#"+a.id).select2({tags:a.tags||[],showSearchBox:!1,minimumResultsForSearch:-1,width:"336px",maximumSelectionSize:a.maxEntrySize||8})}),g&&(this.events=g,this.delegateEvents()),$("#accordion2")&&($("#accordion2 .accordion-toggle").bind("click",function(){$("#collapseOne").is(":visible")?($("#collapseOne").hide(),setTimeout(function(){$(".accordion-toggle").addClass("collapsed")},100)):($("#collapseOne").show(),setTimeout(function(){$(".accordion-toggle").removeClass("collapsed")},100))}),$("#collapseOne").hide(),setTimeout(function(){$(".accordion-toggle").addClass("collapsed")},100)),j||$("#modal-dialog").modal("show"),this.enabledHotkey===!1&&(this.createInitModalHotkeys(),this.enabledHotkey=!0),this.enableHotKeys&&this.createModalHotkeys();var r;r=j?$("#"+j+" #modal-dialog").find("input"):$("#modal-dialog").find("input"),r&&setTimeout(function(){r=j?$("#"+j+" #modal-dialog"):$("#modal-dialog"),r.length>0&&(r=r.find("input"),r.length>0&&$(r[0]).focus())},400)},modalBindValidation:function(a){var b=this;if(a.hasOwnProperty("id")&&a.hasOwnProperty("validateInput")){var c=function(){var b=$("#"+a.id),c=a.validateInput(b),d=!1;return _.each(c,function(a){var c=b.val();if(a.rule||(a={rule:a}),"function"==typeof a.rule)try{a.rule(c)}catch(e){d=a.msg||e.message}else{var f=Joi.validate(c,a.rule);f.error&&(d=a.msg||f.error.message)}return d?!1:void 0}),d?d:void 0},d=$("#"+a.id);d.on("keyup focusout",function(){var a=c(),e=d.next()[0];a?(d.addClass("invalid-input"),e?$(e).text(a):d.after('

    '+a+"

    "),$(".createModalDialog .modal-footer .button-success").prop("disabled",!0).addClass("disabled")):(d.removeClass("invalid-input"),e&&$(e).remove(),b.modalTestAll())}),this._validators.push(c),this._validateWatchers.push(d)}},modalTestAll:function(){var a=_.map(this._validators,function(a){return a()}),b=_.any(a);return b?$(".createModalDialog .modal-footer .button-success").prop("disabled",!0).addClass("disabled"):$(".createModalDialog .modal-footer .button-success").prop("disabled",!1).removeClass("disabled"),!b},clearValidators:function(){this._validators=[],_.each(this._validateWatchers,function(a){a.unbind("keyup focusout")}),this._validateWatchers=[]},hide:function(){this.clearValidators(),$("#modal-dialog").modal("hide")}})}(),function(){"use strict";window.NavigationView=Backbone.View.extend({el:"#navigationBar",subEl:"#subNavigationBar",events:{"change #arangoCollectionSelect":"navigateBySelect","click .tab":"navigateByTab","click li":"switchTab","click .arangodbLogo":"selectMenuItem","mouseenter .dropdown > *":"showDropdown","click .shortcut-icons p":"showShortcutModal","mouseleave .dropdown":"hideDropdown"},renderFirst:!0,activeSubMenu:void 0,changeDB:function(){window.location.hash="#login"},initialize:function(a){var b=this;this.userCollection=a.userCollection,this.currentDB=a.currentDB,this.dbSelectionView=new window.DBSelectionView({collection:a.database,current:this.currentDB}),this.userBarView=new window.UserBarView({userCollection:this.userCollection}),this.notificationView=new window.NotificationView({collection:a.notificationCollection}),this.statisticBarView=new window.StatisticBarView({currentDB:this.currentDB}),this.isCluster=a.isCluster,this.handleKeyboardHotkeys(),Backbone.history.on("all",function(){b.selectMenuItem()})},showShortcutModal:function(){arangoHelper.hotkeysFunctions.showHotkeysModal()},handleSelectDatabase:function(){this.dbSelectionView.render($("#dbSelect"))},template:templateEngine.createTemplate("navigationView.ejs"),templateSub:templateEngine.createTemplate("subNavigationView.ejs"),render:function(){var a=this;$(this.el).html(this.template.render({currentDB:this.currentDB,isCluster:this.isCluster})),"_system"!==this.currentDB.get("name")&&$("#dashboard").parent().remove(),$(this.subEl).html(this.templateSub.render({currentDB:this.currentDB.toJSON()})),this.dbSelectionView.render($("#dbSelect"));var b=function(a){a||this.userBarView.render()}.bind(this);return this.userCollection.whoAmI(b),this.renderFirst&&(this.renderFirst=!1,this.selectMenuItem(),$(".arangodbLogo").on("click",function(){a.selectMenuItem()}),$("#dbStatus").on("click",function(){a.changeDB()})),a.resize(),this},resize:function(){var a=$(window).height()-$(".subMenuEntries").first().height();$("#navigationBar").css("min-height",a),$("#navigationBar").css("height",a)},navigateBySelect:function(){var a=$("#arangoCollectionSelect").find("option:selected").val();window.App.navigate(a,{trigger:!0})},handleKeyboardHotkeys:function(){arangoHelper.enableKeyboardHotkeys(!0)},navigateByTab:function(a){var b=a.target||a.srcElement,c=b.id,d=!1;$(b).hasClass("fa")||(""===c&&(c=$(b).attr("class")),"links"===c?(d=!0,$("#link_dropdown").slideToggle(1),a.preventDefault()):"tools"===c?(d=!0,$("#tools_dropdown").slideToggle(1),a.preventDefault()):"dbselection"===c&&(d=!0,$("#dbs_dropdown").slideToggle(1),a.preventDefault()),d||(window.App.navigate(c,{trigger:!0}),a.preventDefault()))},handleSelectNavigation:function(){var a=this;$("#arangoCollectionSelect").change(function(){a.navigateBySelect()})},subViewConfig:{documents:"collections",collection:"collections"},subMenuConfig:{cluster:[{name:"Dashboard",view:void 0,active:!0},{name:"Logs",view:void 0,disabled:!0}],collections:[{name:"",view:void 0,active:!1}],queries:[{name:"Editor",route:"query",active:!0},{name:"Running Queries",route:"queryManagement",params:{active:!0},active:void 0},{name:"Slow Query History",route:"queryManagement",params:{active:!1},active:void 0}]},renderSubMenu:function(a){var b=this;if(void 0===a&&(a=window.isCluster?"cluster":"dashboard"),this.subMenuConfig[a]){$(this.subEl+" .bottom").html("");var c="";_.each(this.subMenuConfig[a],function(a){c=a.active?"active":"",a.disabled&&(c="disabled"),$(b.subEl+" .bottom").append('"),a.disabled||$(b.subEl+" .bottom").children().last().bind("click",function(c){b.activeSubMenu=a,b.renderSubView(a,c)})})}},renderSubView:function(a,b){window.App[a.route]&&(window.App[a.route].resetState&&window.App[a.route].resetState(),window.App[a.route]()),$(this.subEl+" .bottom").children().removeClass("active"),$(b.currentTarget).addClass("active")},switchTab:function(a){var b=$(a.currentTarget).children().first().attr("id");b&&this.selectMenuItem(b+"-menu")},selectMenuItem:function(a,b){void 0===a&&(a=window.location.hash.split("/")[0],a=a.substr(1,a.length-1)),""===a?a=window.App.isCluster?"cluster":"dashboard":"cNodes"!==a&&"dNodes"!==a||(a="nodes");try{this.renderSubMenu(a.split("-")[0])}catch(c){this.renderSubMenu(a)}$(".navlist li").removeClass("active"),"string"==typeof a&&(b?$("."+this.subViewConfig[a]+"-menu").addClass("active"):a&&($("."+a).addClass("active"),$("."+a+"-menu").addClass("active"))),arangoHelper.hideArangoNotifications()},showSubDropdown:function(a){$(a.currentTarget).find(".subBarDropdown").toggle()},showDropdown:function(a){var b=a.target||a.srcElement,c=b.id;"links"===c||"link_dropdown"===c||"links"===a.currentTarget.id?$("#link_dropdown").fadeIn(1):"tools"===c||"tools_dropdown"===c||"tools"===a.currentTarget.id?$("#tools_dropdown").fadeIn(1):"dbselection"!==c&&"dbs_dropdown"!==c&&"dbselection"!==a.currentTarget.id||$("#dbs_dropdown").fadeIn(1)},hideDropdown:function(a){var b=a.target||a.srcElement;b=$(b).parent(),$("#link_dropdown").fadeOut(1),$("#tools_dropdown").fadeOut(1),$("#dbs_dropdown").fadeOut(1)}})}(),function(){"use strict";window.NodesView=Backbone.View.extend({el:"#content",template:templateEngine.createTemplate("nodesView.ejs"),interval:5e3,knownServers:[],events:{"click #nodesContent .pure-table-body .pure-table-row":"navigateToNode"},initialize:function(a){var b=this;clearInterval(this.intervalFunction),window.App.isCluster&&(this.dbServers=a.dbServers,this.coordinators=a.coordinators,this.updateServerTime(),this.toRender=a.toRender,this.intervalFunction=window.setInterval(function(){"#cNodes"!==window.location.hash&&"#dNodes"!==window.location.hash&&"#nodes"!==window.location.hash||b.checkNodesState()},this.interval))},checkNodesState:function(){var a=function(a){_.each(a,function(a,b){_.each($(".pure-table-row"),function(c){$(c).attr("node")===b&&("GOOD"===a.Status?($(c).removeClass("noHover"),$(c).find(".state").html('')):($(c).addClass("noHover"),$(c).find(".state").html('')))})})};$.ajax({type:"GET",cache:!1,url:arangoHelper.databaseUrl("/_admin/cluster/health"),contentType:"application/json",processData:!1,async:!0,success:function(b){a(b.Health)}})},navigateToNode:function(a){if("#dNodes"!==window.location.hash&&!$(a.currentTarget).hasClass("noHover")){var b=$(a.currentTarget).attr("node");window.App.navigate("#node/"+encodeURIComponent(b),{trigger:!0})}},render:function(){var a=function(){this.continueRender()}.bind(this);this.initDoneCoords?a():this.waitForCoordinators(a)},continueRender:function(){var a;a="coordinator"===this.toRender?this.coordinators.toJSON():this.dbServers.toJSON(),this.$el.html(this.template.render({coords:a,type:this.toRender})),window.arangoHelper.buildNodesSubNav(this.toRender),this.checkNodesState()},waitForCoordinators:function(a){var b=this;window.setTimeout(function(){0===b.coordinators.length?b.waitForCoordinators(a):(this.initDoneCoords=!0,a())},200)},updateServerTime:function(){this.serverTime=(new Date).getTime()}})}(),function(){"use strict";window.NodesView2=Backbone.View.extend({el:"#content",template:templateEngine.createTemplate("nodesView2.ejs"),interval:1e4,knownServers:[],events:{"click #nodesContent .coords-nodes .pure-table-row":"navigateToNode","click #addCoord":"addCoord","click #removeCoord":"removeCoord","click #addDBs":"addDBs","click #removeDBs":"removeDBs"},initialize:function(){var a=this;clearInterval(this.intervalFunction),window.App.isCluster&&(this.updateServerTime(),this.intervalFunction=window.setInterval(function(){"#nodes"===window.location.hash&&a.render(!1)},this.interval))},navigateToNode:function(a){if(!$(a.currentTarget).hasClass("noHover")){var b=$(a.currentTarget).attr("node").slice(0,-5);window.App.navigate("#node/"+encodeURIComponent(b),{trigger:!0})}},render:function(a){var b=this,c=function(a){$.ajax({type:"GET",url:arangoHelper.databaseUrl("/_admin/cluster/numberOfServers"),contentType:"application/json",success:function(c){b.continueRender(a,c)}})};$.ajax({type:"GET",cache:!1,url:arangoHelper.databaseUrl("/_admin/cluster/health"),contentType:"application/json",processData:!1,async:!0,success:function(a){c(a.Health)},error:function(){arangoHelper.arangoError("Cluster","Could not fetch cluster information")}}),a!==!1&&arangoHelper.buildNodesSubNav("Overview")},continueRender:function(a,b){var c={},d={},e=!1;_.each(a,function(a,b){"Coordinator"===a.Role?c[b]=a:"DBServer"===a.Role&&(d[b]=a)}),null!==b.numberOfDBServers&&null!==b.numberOfCoordinators&&(e=!0);var f=function(a){this.$el.html(this.template.render({coords:c,dbs:d,scaling:e,scaleProperties:a,plannedDBs:b.numberOfDBServers,plannedCoords:b.numberOfCoordinators})),e||($(".title").css("position","relative"),$(".title").css("top","-4px"),$(".sectionHeader .information").css("margin-top","-3px"))}.bind(this);this.renderCounts(e,f)},updatePlanned:function(a){a.numberOfCoordinators&&($("#plannedCoords").val(a.numberOfCoordinators),this.renderCounts(!0)),a.numberOfDBServers&&($("#plannedDBs").val(a.numberOfDBServers),this.renderCounts(!0))},setCoordSize:function(a){var b=this,c={numberOfCoordinators:a};$.ajax({type:"PUT",url:arangoHelper.databaseUrl("/_admin/cluster/numberOfServers"),contentType:"application/json",data:JSON.stringify(c),success:function(){b.updatePlanned(c)},error:function(){arangoHelper.arangoError("Scale","Could not set coordinator size.")}})},setDBsSize:function(a){var b=this,c={numberOfDBServers:a};$.ajax({type:"PUT",url:arangoHelper.databaseUrl("/_admin/cluster/numberOfServers"),contentType:"application/json",data:JSON.stringify(c),success:function(){b.updatePlanned(c)},error:function(){arangoHelper.arangoError("Scale","Could not set coordinator size.")}})},renderCounts:function(a,b){var c=function(b,c,d,e){var f=''+c+'';d&&a===!0&&(f=f+''+d+''),e&&(f=f+''+e+''),$(b).html(f),a||($(".title").css("position","relative"),$(".title").css("top","-4px"))},d=function(a){var d=0,e=0,f=0,g=0,h=0,i=0;_.each(a,function(a){"Coordinator"===a.Role?"GOOD"===a.Status?e++:d++:"DBServer"===a.Role&&("GOOD"===a.Status?g++:h++)}),$.ajax({type:"GET",cache:!1,url:arangoHelper.databaseUrl("/_admin/cluster/numberOfServers"),contentType:"application/json",processData:!1,success:function(a){f=Math.abs(e+d-a.numberOfCoordinators),i=Math.abs(g+h-a.numberOfDBServers),b?b({coordsPending:f,coordsOk:e,coordsErrors:d,dbsPending:i,dbsOk:g,dbsErrors:h}):(c("#infoDBs",g,i,h),c("#infoCoords",e,f,d))}})};$.ajax({type:"GET",cache:!1,url:arangoHelper.databaseUrl("/_admin/cluster/health"),contentType:"application/json",processData:!1,success:function(a){d(a.Health)}})},addCoord:function(){this.setCoordSize(this.readNumberFromID("#plannedCoords",!0))},removeCoord:function(){this.setCoordSize(this.readNumberFromID("#plannedCoords",!1,!0))},addDBs:function(){this.setDBsSize(this.readNumberFromID("#plannedDBs",!0))},removeDBs:function(){this.setDBsSize(this.readNumberFromID("#plannedDBs",!1,!0))},readNumberFromID:function(a,b,c){var d=$(a).val(),e=!1;try{e=JSON.parse(d)}catch(f){}return b&&e++,c&&1!==e&&e--,e},updateServerTime:function(){this.serverTime=(new Date).getTime()}})}(),function(){"use strict";window.NodeView=Backbone.View.extend({el:"#content",template:templateEngine.createTemplate("nodeView.ejs"),interval:5e3,dashboards:[],events:{},initialize:function(a){window.App.isCluster&&(this.coordinators=a.coordinators,this.dbServers=a.dbServers,this.coordname=a.coordname,this.updateServerTime())},breadcrumb:function(a){$("#subNavigationBar .breadcrumb").html("Node: "+a)},render:function(){this.$el.html(this.template.render({coords:[]}));var a=function(){this.continueRender(),this.breadcrumb(this.coordname),$(window).trigger("resize")}.bind(this);this.initCoordDone||this.waitForCoordinators(),this.initDBDone?(this.coordname=window.location.hash.split("/")[1],this.coordinator=this.coordinators.findWhere({name:this.coordname}),a()):this.waitForDBServers(a)},continueRender:function(){var a=this;this.dashboards[this.coordinator.get("name")]=new window.DashboardView({dygraphConfig:window.dygraphConfig,database:window.App.arangoDatabase,serverToShow:{raw:this.coordinator.get("address"),isDBServer:!1,endpoint:this.coordinator.get("protocol")+"://"+this.coordinator.get("address"),target:this.coordinator.get("name")}}),this.dashboards[this.coordinator.get("name")].render(),window.setTimeout(function(){a.dashboards[a.coordinator.get("name")].resize()},500)},waitForCoordinators:function(a){var b=this;window.setTimeout(function(){0===b.coordinators.length?b.waitForCoordinators(a):(b.coordinator=b.coordinators.findWhere({name:b.coordname}),b.initCoordDone=!0,a&&a())},200)},waitForDBServers:function(a){var b=this;window.setTimeout(function(){0===b.dbServers[0].length?b.waitForDBServers(a):(b.initDBDone=!0,b.dbServer=b.dbServers[0],b.dbServer.each(function(a){"DBServer001"===a.get("name")&&(b.dbServer=a)}),a())},200)},updateServerTime:function(){this.serverTime=(new Date).getTime()}})}(),function(){"use strict";window.NotificationView=Backbone.View.extend({events:{"click .navlogo #stat_hd":"toggleNotification","click .notificationItem .fa":"removeNotification","click #removeAllNotifications":"removeAllNotifications"},initialize:function(){this.collection.bind("add",this.renderNotifications.bind(this)),this.collection.bind("remove",this.renderNotifications.bind(this)),this.collection.bind("reset",this.renderNotifications.bind(this)),window.setTimeout(function(){frontendConfig.authenticationEnabled===!1&&frontendConfig.isCluster===!1&&arangoHelper.showAuthDialog()===!0&&window.arangoHelper.arangoWarning("Warning","Authentication is disabled. Do not use this setup in production mode.")},2e3)},notificationItem:templateEngine.createTemplate("notificationItem.ejs"),el:"#notificationBar",template:templateEngine.createTemplate("notificationView.ejs"),toggleNotification:function(){var a=this.collection.length;0!==a&&$("#notification_menu").toggle()},removeAllNotifications:function(){$.noty.clearQueue(),$.noty.closeAll(),this.collection.reset(),$("#notification_menu").hide()},removeNotification:function(a){var b=a.target.id;this.collection.get(b).destroy()},renderNotifications:function(a,b,c){if(c&&c.add){var d,e=this.collection.at(this.collection.length-1),f=e.get("title"),g=3e3,h=["click"];if(e.get("content")&&(f=f+": "+e.get("content")),"error"===e.get("type")?(g=!1,h=["button"],d=[{addClass:"button-danger",text:"Close",onClick:function(a){a.close()}}]):"warning"===e.get("type")&&(g=15e3,d=[{addClass:"button-warning",text:"Close",onClick:function(a){a.close()}},{addClass:"button-danger",text:"Don't show again.",onClick:function(a){a.close(),window.arangoHelper.doNotShowAgain()}}]),$.noty.clearQueue(),$.noty.closeAll(),noty({theme:"relax",text:f,template:'
    ',maxVisible:1,closeWith:["click"],type:e.get("type"),layout:"bottom",timeout:g,buttons:d,animation:{open:{height:"show"},close:{height:"hide"},easing:"swing",speed:200,closeWith:h}}),"success"===e.get("type"))return void e.destroy()}$("#stat_hd_counter").text(this.collection.length),0===this.collection.length?($("#stat_hd").removeClass("fullNotification"),$("#notification_menu").hide()):$("#stat_hd").addClass("fullNotification"),$(".innerDropdownInnerUL").html(this.notificationItem.render({notifications:this.collection})),$(".notificationInfoIcon").tooltip({position:{my:"left top",at:"right+55 top-1"}})},render:function(){return $(this.el).html(this.template.render({notifications:this.collection})),this.renderNotifications(),this.delegateEvents(),this.el}})}(),function(){"use strict";window.ProgressView=Backbone.View.extend({template:templateEngine.createTemplate("progressBase.ejs"),el:"#progressPlaceholder",el2:"#progressPlaceholderIcon",toShow:!1,lastDelay:0,action:function(){},events:{"click .progress-action button":"performAction"},performAction:function(){"function"==typeof this.action&&this.action(),window.progressView.hide()},initialize:function(){},showWithDelay:function(a,b,c,d){var e=this;e.toShow=!0,e.lastDelay=a,setTimeout(function(){e.toShow===!0&&e.show(b,c,d)},e.lastDelay)},show:function(a,b,c){$(this.el).html(this.template.render({})),$(".progress-text").text(a),c?$(".progress-action").html('"):$(".progress-action").html(''),b?this.action=b:this.action=this.hide(),$(this.el).show()},hide:function(){var a=this;a.toShow=!1,$(this.el).hide(),this.action=function(){}}})}(),function(){"use strict";window.QueryManagementView=Backbone.View.extend({el:"#content",id:"#queryManagementContent",templateActive:templateEngine.createTemplate("queryManagementViewActive.ejs"),templateSlow:templateEngine.createTemplate("queryManagementViewSlow.ejs"), +table:templateEngine.createTemplate("arangoTable.ejs"),active:!0,shouldRender:!0,timer:0,refreshRate:2e3,initialize:function(){var a=this;this.activeCollection=new window.QueryManagementActive,this.slowCollection=new window.QueryManagementSlow,this.convertModelToJSON(!0),window.setInterval(function(){"#queries"===window.location.hash&&window.VISIBLE&&a.shouldRender&&"queryManagement"===arangoHelper.getCurrentSub().route&&(a.active?$("#arangoQueryManagementTable").is(":visible")&&a.convertModelToJSON(!0):$("#arangoQueryManagementTable").is(":visible")&&a.convertModelToJSON(!1))},a.refreshRate)},events:{"click #deleteSlowQueryHistory":"deleteSlowQueryHistoryModal","click #arangoQueryManagementTable .fa-minus-circle":"deleteRunningQueryModal"},tableDescription:{id:"arangoQueryManagementTable",titles:["ID","Query String","Runtime","Started",""],rows:[],unescaped:[!1,!1,!1,!1,!0]},deleteRunningQueryModal:function(a){this.killQueryId=$(a.currentTarget).attr("data-id");var b=[],c=[];c.push(window.modalView.createReadOnlyEntry(void 0,"Running Query","Do you want to kill the running query?",void 0,void 0,!1,void 0)),b.push(window.modalView.createDeleteButton("Kill",this.killRunningQuery.bind(this))),window.modalView.show("modalTable.ejs","Kill Running Query",b,c),$(".modal-delete-confirmation strong").html("Really kill?")},killRunningQuery:function(){this.collection.killRunningQuery(this.killQueryId,this.killRunningQueryCallback.bind(this)),window.modalView.hide()},killRunningQueryCallback:function(){this.convertModelToJSON(!0),this.renderActive()},deleteSlowQueryHistoryModal:function(){var a=[],b=[];b.push(window.modalView.createReadOnlyEntry(void 0,"Slow Query Log","Do you want to delete the slow query log entries?",void 0,void 0,!1,void 0)),a.push(window.modalView.createDeleteButton("Delete",this.deleteSlowQueryHistory.bind(this))),window.modalView.show("modalTable.ejs","Delete Slow Query Log",a,b)},deleteSlowQueryHistory:function(){this.collection.deleteSlowQueryHistory(this.slowQueryCallback.bind(this)),window.modalView.hide()},slowQueryCallback:function(){this.convertModelToJSON(!1),this.renderSlow()},render:function(){var a=arangoHelper.getCurrentSub();a.params.active?(this.active=!0,this.convertModelToJSON(!0)):(this.active=!1,this.convertModelToJSON(!1))},addEvents:function(){var a=this;$("#queryManagementContent tbody").on("mousedown",function(){clearTimeout(a.timer),a.shouldRender=!1}),$("#queryManagementContent tbody").on("mouseup",function(){a.timer=window.setTimeout(function(){a.shouldRender=!0},3e3)})},renderActive:function(){this.$el.html(this.templateActive.render({})),$(this.id).append(this.table.render({content:this.tableDescription})),$("#activequeries").addClass("arango-active-tab"),this.addEvents()},renderSlow:function(){this.$el.html(this.templateSlow.render({})),$(this.id).append(this.table.render({content:this.tableDescription})),$("#slowqueries").addClass("arango-active-tab"),this.addEvents()},convertModelToJSON:function(a){var b=this,c=[];a===!0?this.collection=this.activeCollection:this.collection=this.slowCollection,this.collection.fetch({success:function(){b.collection.each(function(b){var d="";a&&(d=''),c.push([b.get("id"),b.get("query"),b.get("runTime").toFixed(2)+" s",b.get("started"),d])});var d="No running queries.";a||(d="No slow queries."),0===c.length&&c.push([d,"","","",""]),b.tableDescription.rows=c,a?b.renderActive():b.renderSlow()}})}})}(),function(){"use strict";window.QueryView=Backbone.View.extend({el:"#content",bindParamId:"#bindParamEditor",myQueriesId:"#queryTable",template:templateEngine.createTemplate("queryView.ejs"),table:templateEngine.createTemplate("arangoTable.ejs"),outputDiv:"#outputEditors",outputTemplate:templateEngine.createTemplate("queryViewOutput.ejs"),outputCounter:0,allowUpload:!1,customQueries:[],queries:[],state:{lastQuery:{query:void 0,bindParam:void 0}},graphs:[],settings:{aqlWidth:void 0},currentQuery:{},initDone:!1,bindParamRegExp:/@(@?\w+\d*)/,bindParamTableObj:{},bindParamTableDesc:{id:"arangoBindParamTable",titles:["Key","Value"],rows:[]},myQueriesTableDesc:{id:"arangoMyQueriesTable",titles:["Name","Actions"],rows:[]},execPending:!1,aqlEditor:null,queryPreview:null,initialize:function(){this.refreshAQL()},allowParamToggle:!0,events:{"click #executeQuery":"executeQuery","click #explainQuery":"explainQuery","click #clearQuery":"clearQuery","click .outputEditorWrapper #downloadQueryResult":"downloadQueryResult","click .outputEditorWrapper .switchAce span":"switchAce","click .outputEditorWrapper .fa-close":"closeResult","click #toggleQueries1":"toggleQueries","click #toggleQueries2":"toggleQueries","click #saveCurrentQuery":"addAQL","click #exportQuery":"exportCustomQueries","click #importQuery":"openImportDialog","click #removeResults":"removeResults","click #querySpotlight":"showSpotlight","click #deleteQuery":"selectAndDeleteQueryFromTable","click #explQuery":"selectAndExplainQueryFromTable","keydown #arangoBindParamTable input":"updateBindParams","change #arangoBindParamTable input":"updateBindParams","click #arangoMyQueriesTable tbody tr":"showQueryPreview","dblclick #arangoMyQueriesTable tbody tr":"selectQueryFromTable","click #arangoMyQueriesTable #copyQuery":"selectQueryFromTable","click #closeQueryModal":"closeExportDialog","click #confirmQueryImport":"importCustomQueries","click #switchTypes":"toggleBindParams","click #arangoMyQueriesTable #runQuery":"selectAndRunQueryFromTable"},clearQuery:function(){this.aqlEditor.setValue("",1)},toggleBindParams:function(){this.allowParamToggle?($("#bindParamEditor").toggle(),$("#bindParamAceEditor").toggle(),"JSON"===$("#switchTypes").text()?($("#switchTypes").text("Table"),this.updateQueryTable(),this.bindParamAceEditor.setValue(JSON.stringify(this.bindParamTableObj,null," "),1),this.deselect(this.bindParamAceEditor)):($("#switchTypes").text("JSON"),this.renderBindParamTable())):arangoHelper.arangoError("Bind parameter","Could not parse bind parameter"),this.resize()},openExportDialog:function(){$("#queryImportDialog").modal("show")},closeExportDialog:function(){$("#queryImportDialog").modal("hide")},initQueryImport:function(){var a=this;a.allowUpload=!1,$("#importQueries").change(function(b){a.files=b.target.files||b.dataTransfer.files,a.file=a.files[0],a.allowUpload=!0,$("#confirmQueryImport").removeClass("disabled")})},importCustomQueries:function(){var a=this;if(this.allowUpload===!0){var b=function(){this.collection.fetch({success:function(){a.updateLocalQueries(),a.updateQueryTable(),a.resize(),a.allowUpload=!1,$("#confirmQueryImport").addClass("disabled"),$("#queryImportDialog").modal("hide")},error:function(a){arangoHelper.arangoError("Custom Queries",a.responseText)}})}.bind(this);a.collection.saveImportQueries(a.file,b.bind(this))}},removeResults:function(){$(".outputEditorWrapper").hide("fast",function(){$(".outputEditorWrapper").remove()}),$("#removeResults").hide()},getCustomQueryParameterByName:function(a){return this.collection.findWhere({name:a}).get("parameter")},getCustomQueryValueByName:function(a){var b;return a&&(b=this.collection.findWhere({name:a})),b?b=b.get("value"):_.each(this.queries,function(c){c.name===a&&(b=c.value)}),b},openImportDialog:function(){$("#queryImportDialog").modal("show")},closeImportDialog:function(){$("#queryImportDialog").modal("hide")},exportCustomQueries:function(){var a;$.ajax("whoAmI?_="+Date.now()).success(function(b){a=b.user,null!==a&&a!==!1||(a="root");var c="query/download/"+encodeURIComponent(a);arangoHelper.download(c)})},toggleQueries:function(a){a&&"toggleQueries1"===a.currentTarget.id?(this.updateQueryTable(),$("#bindParamAceEditor").hide(),$("#bindParamEditor").show(),$("#switchTypes").text("JSON"),$(".aqlEditorWrapper").first().width(.33*$(window).width()),this.queryPreview.setValue("No query selected.",1),this.deselect(this.queryPreview)):void 0===this.settings.aqlWidth?$(".aqlEditorWrapper").first().width(.33*$(window).width()):$(".aqlEditorWrapper").first().width(this.settings.aqlWidth),this.resize();var b=["aqlEditor","queryTable","previewWrapper","querySpotlight","bindParamEditor","toggleQueries1","toggleQueries2","saveCurrentQuery","querySize","executeQuery","switchTypes","explainQuery","importQuery","exportQuery"];_.each(b,function(a){$("#"+a).toggle()}),this.resize()},showQueryPreview:function(a){$("#arangoMyQueriesTable tr").removeClass("selected"),$(a.currentTarget).addClass("selected");var b=this.getQueryNameFromTable(a);this.queryPreview.setValue(this.getCustomQueryValueByName(b),1),this.deselect(this.queryPreview)},getQueryNameFromTable:function(a){var b;return $(a.currentTarget).is("tr")?b=$(a.currentTarget).children().first().text():$(a.currentTarget).is("span")&&(b=$(a.currentTarget).parent().parent().prev().text()),b},deleteQueryModal:function(a){var b=[],c=[];c.push(window.modalView.createReadOnlyEntry(void 0,a,"Do you want to delete the query?",void 0,void 0,!1,void 0)),b.push(window.modalView.createDeleteButton("Delete",this.deleteAQL.bind(this,a))),window.modalView.show("modalTable.ejs","Delete Query",b,c)},selectAndDeleteQueryFromTable:function(a){var b=this.getQueryNameFromTable(a);this.deleteQueryModal(b)},selectAndExplainQueryFromTable:function(a){this.selectQueryFromTable(a,!1),this.explainQuery()},selectAndRunQueryFromTable:function(a){this.selectQueryFromTable(a,!1),this.executeQuery()},selectQueryFromTable:function(a,b){var c=this.getQueryNameFromTable(a),d=this;void 0===b&&this.toggleQueries(),this.state.lastQuery.query=this.aqlEditor.getValue(),this.state.lastQuery.bindParam=this.bindParamTableObj,this.aqlEditor.setValue(this.getCustomQueryValueByName(c),1),this.fillBindParamTable(this.getCustomQueryParameterByName(c)),this.updateBindParams(),$("#lastQuery").remove(),$("#queryContent .arangoToolbarTop .pull-left").append('Previous Query'),$("#lastQuery").hide().fadeIn(500).on("click",function(){d.aqlEditor.setValue(d.state.lastQuery.query,1),d.fillBindParamTable(d.state.lastQuery.bindParam),d.updateBindParams(),$("#lastQuery").fadeOut(500,function(){$(this).remove()})})},deleteAQL:function(a){var b=function(a){a?arangoHelper.arangoError("Query","Could not delete query."):(this.updateLocalQueries(),this.updateQueryTable(),this.resize(),window.modalView.hide())}.bind(this),c=this.collection.findWhere({name:a});this.collection.remove(c),this.collection.saveCollectionQueries(b)},switchAce:function(a){var b=$(a.currentTarget).attr("counter"),c=a.currentTarget;if(!$(c).hasClass("disabled")){_.each($(c).parent().children(),function(a){$(a).removeClass("active")});var d=$(c).attr("val");$(c).addClass("active"),$(c).text(d.charAt(0).toUpperCase()+d.slice(1)),"JSON"===d?($("#outputEditor"+b).show(),$("#sentWrapper"+b).hide(),$("#outputGraph"+b).hide(),$("#outputTable"+b).hide()):"AQL"===d?($("#sentWrapper"+b).show(),$("#outputEditor"+b).hide(),$("#outputGraph"+b).hide(),$("#outputTable"+b).hide()):"Table"===d?($("#outputTable"+b).show(),$("#outputGraph"+b).hide(),$("#outputEditor"+b).hide(),$("#sentWrapper"+b).hide()):"Graph"===d&&($("#outputGraph"+b).show(),$("#outputTable"+b).hide(),$("#outputEditor"+b).hide(),$("#sentWrapper"+b).hide()),this.deselect(ace.edit("outputEditor"+b)),this.deselect(ace.edit("sentQueryEditor"+b)),this.deselect(ace.edit("sentBindParamEditor"+b))}},downloadQueryResult:function(a){var b=$(a.currentTarget).attr("counter"),c=ace.edit("sentQueryEditor"+b),d=c.getValue();if(""!==d||void 0!==d||null!==d){var e;e=0===Object.keys(this.bindParamTableObj).length?"query/result/download/"+encodeURIComponent(btoa(JSON.stringify({query:d}))):"query/result/download/"+encodeURIComponent(btoa(JSON.stringify({query:d,bindVars:this.bindParamTableObj}))),arangoHelper.download(e)}else arangoHelper.arangoError("Query error","could not query result.")},explainQuery:function(){if(!this.verifyQueryAndParams()){this.$(this.outputDiv).prepend(this.outputTemplate.render({counter:this.outputCounter,type:"Explain"}));var a=this.outputCounter,b=ace.edit("outputEditor"+a),c=ace.edit("sentQueryEditor"+a),d=ace.edit("sentBindParamEditor"+a);c.getSession().setMode("ace/mode/aql"),c.setOption("vScrollBarAlwaysVisible",!0),c.setReadOnly(!0),this.setEditorAutoHeight(c),b.setReadOnly(!0),b.getSession().setMode("ace/mode/json"),b.setOption("vScrollBarAlwaysVisible",!0),this.setEditorAutoHeight(b),d.setValue(JSON.stringify(this.bindParamTableObj),1),d.setOption("vScrollBarAlwaysVisible",!0),d.getSession().setMode("ace/mode/json"),d.setReadOnly(!0),this.setEditorAutoHeight(d),this.fillExplain(b,c,a),this.outputCounter++}},fillExplain:function(a,b,c){b.setValue(this.aqlEditor.getValue(),1);var d=this,e=this.readQueryData();if($("#outputEditorWrapper"+c+" .queryExecutionTime").text(""),this.execPending=!1,e){var f=function(){$("#outputEditorWrapper"+c+" #spinner").remove(),$("#outputEditor"+c).css("opacity","1"),$("#outputEditorWrapper"+c+" .fa-close").show(),$("#outputEditorWrapper"+c+" .switchAce").show()};$.ajax({type:"POST",url:arangoHelper.databaseUrl("/_admin/aardvark/query/explain/"),data:e,contentType:"application/json",processData:!1,success:function(b){b.msg.includes("errorMessage")?(d.removeOutputEditor(c),arangoHelper.arangoError("Explain",b.msg)):(a.setValue(b.msg,1),d.deselect(a),$.noty.clearQueue(),$.noty.closeAll(),d.handleResult(c)),f()},error:function(a){try{var b=JSON.parse(a.responseText);arangoHelper.arangoError("Explain",b.errorMessage)}catch(e){arangoHelper.arangoError("Explain","ERROR")}d.handleResult(c),d.removeOutputEditor(c),f()}})}},removeOutputEditor:function(a){$("#outputEditorWrapper"+a).hide(),$("#outputEditorWrapper"+a).remove(),0===$(".outputEditorWrapper").length&&$("#removeResults").hide()},getCachedQueryAfterRender:function(){var a=this.getCachedQuery(),b=this;if(null!==a&&void 0!==a&&""!==a&&(this.aqlEditor.setValue(a.query,1),this.aqlEditor.getSession().setUndoManager(new ace.UndoManager),""!==a.parameter||void 0!==a))try{b.bindParamTableObj=JSON.parse(a.parameter);var c;_.each($("#arangoBindParamTable input"),function(a){c=$(a).attr("name"),$(a).val(b.bindParamTableObj[c])}),b.setCachedQuery(b.aqlEditor.getValue(),JSON.stringify(b.bindParamTableObj))}catch(d){}},getCachedQuery:function(){if("undefined"!==Storage){var a=localStorage.getItem("cachedQuery");if(void 0!==a){var b=JSON.parse(a);this.currentQuery=b;try{this.bindParamTableObj=JSON.parse(b.parameter)}catch(c){}return b}}},setCachedQuery:function(a,b){if("undefined"!==Storage){var c={query:a,parameter:b};this.currentQuery=c,localStorage.setItem("cachedQuery",JSON.stringify(c))}},closeResult:function(a){var b=$("#"+$(a.currentTarget).attr("element")).parent();$(b).hide("fast",function(){$(b).remove(),0===$(".outputEditorWrapper").length&&$("#removeResults").hide()})},fillSelectBoxes:function(){var a=1e3,b=$("#querySize");b.empty(),[100,250,500,1e3,2500,5e3,1e4,"all"].forEach(function(c){b.append('")})},render:function(){this.$el.html(this.template.render({})),this.afterRender(),this.initDone||(this.settings.aqlWidth=$(".aqlEditorWrapper").width()),this.initDone=!0,this.renderBindParamTable(!0)},afterRender:function(){var a=this;this.initAce(),this.initTables(),this.fillSelectBoxes(),this.makeResizeable(),this.initQueryImport(),this.getCachedQueryAfterRender(),$(".inputEditorWrapper").height($(window).height()/10*5+25),window.setTimeout(function(){a.resize()},10),a.deselect(a.aqlEditor)},showSpotlight:function(a){var b,c;if(void 0!==a&&"click"!==a.type||(a="aql"),"aql"===a)b=function(a){this.aqlEditor.insert(a),$("#aqlEditor .ace_text-input").focus()}.bind(this),c=function(){$("#aqlEditor .ace_text-input").focus()};else{var d=$(":focus");b=function(a){var b=$(d).val();$(d).val(b+a),$(d).focus()},c=function(){$(d).focus()}}window.spotlightView.show(b,c,a)},resize:function(){this.resizeFunction()},resizeFunction:function(){$("#toggleQueries1").is(":visible")?(this.aqlEditor.resize(),$("#arangoBindParamTable thead").css("width",$("#bindParamEditor").width()),$("#arangoBindParamTable thead th").css("width",$("#bindParamEditor").width()/2),$("#arangoBindParamTable tr").css("width",$("#bindParamEditor").width()),$("#arangoBindParamTable tbody").css("height",$("#aqlEditor").height()-35),$("#arangoBindParamTable tbody").css("width",$("#bindParamEditor").width()),$("#arangoBindParamTable tbody tr").css("width",$("#bindParamEditor").width()),$("#arangoBindParamTable tbody td").css("width",$("#bindParamEditor").width()/2)):(this.queryPreview.resize(),$("#arangoMyQueriesTable thead").css("width",$("#queryTable").width()),$("#arangoMyQueriesTable thead th").css("width",$("#queryTable").width()/2),$("#arangoMyQueriesTable tr").css("width",$("#queryTable").width()),$("#arangoMyQueriesTable tbody").css("height",$("#queryTable").height()-35),$("#arangoMyQueriesTable tbody").css("width",$("#queryTable").width()),$("#arangoMyQueriesTable tbody td").css("width",$("#queryTable").width()/2))},makeResizeable:function(){var a=this;$(".aqlEditorWrapper").resizable({resize:function(){a.resizeFunction(),a.settings.aqlWidth=$(".aqlEditorWrapper").width()},handles:"e"}),$(".inputEditorWrapper").resizable({resize:function(){a.resizeFunction()},handles:"s"}),this.resizeFunction()},initTables:function(){this.$(this.bindParamId).html(this.table.render({content:this.bindParamTableDesc})),this.$(this.myQueriesId).html(this.table.render({content:this.myQueriesTableDesc}))},checkType:function(a){var b="stringtype";try{a=JSON.parse(a),b=a instanceof Array?"arraytype":typeof a+"type"}catch(c){}return b},updateBindParams:function(a){var b,c=this;if(a){b=$(a.currentTarget).attr("name"),this.bindParamTableObj[b]=arangoHelper.parseInput(a.currentTarget);var d=["arraytype","objecttype","booleantype","numbertype","stringtype"];_.each(d,function(b){$(a.currentTarget).removeClass(b)}),$(a.currentTarget).addClass(c.checkType($(a.currentTarget).val()))}else _.each($("#arangoBindParamTable input"),function(a){b=$(a).attr("name"),c.bindParamTableObj[b]=arangoHelper.parseInput(a)});this.setCachedQuery(this.aqlEditor.getValue(),JSON.stringify(this.bindParamTableObj)),a&&((a.ctrlKey||a.metaKey)&&13===a.keyCode&&(a.preventDefault(),this.executeQuery()),(a.ctrlKey||a.metaKey)&&32===a.keyCode&&(a.preventDefault(),this.showSpotlight("bind")))},parseQuery:function(a){var b=0,c=1,d=2,e=3,f=4,g=5,h=6,i=7;a+=" ";var j,k,l,m=this,n=b,o=a.length,p=[];for(k=0;o>k;++k)switch(l=a.charAt(k),n){case b:"@"===l?(n=h,j=k):"'"===l?n=c:'"'===l?n=d:"`"===l?n=e:"´"===l?n=i:"/"===l&&o>k+1&&("/"===a.charAt(k+1)?(n=f,++k):"*"===a.charAt(k+1)&&(n=g,++k));break;case f:"\r"!==l&&"\n"!==l||(n=b);break;case g:"*"===l&&o>=k+1&&"/"===a.charAt(k+1)&&(n=b,++k);break;case c:"\\"===l?++k:"'"===l&&(n=b);break;case d:"\\"===l?++k:'"'===l&&(n=b);break;case e:"`"===l&&(n=b);break;case i:"´"===l&&(n=b);break;case h:/^[@a-zA-Z0-9_]+$/.test(l)||(p.push(a.substring(j,k)),n=b,j=void 0)}var q;return _.each(p,function(a,b){q=a.match(m.bindParamRegExp),q&&(p[b]=q[1])}),{query:a,bindParams:p}},checkForNewBindParams:function(){var a=this,b=this.parseQuery(this.aqlEditor.getValue()).bindParams,c={};_.each(b,function(b){a.bindParamTableObj[b]?c[b]=a.bindParamTableObj[b]:c[b]=""}),Object.keys(b).forEach(function(b){Object.keys(a.bindParamTableObj).forEach(function(d){b===d&&(c[b]=a.bindParamTableObj[d])})}),a.bindParamTableObj=c},renderBindParamTable:function(a){$("#arangoBindParamTable tbody").html(""),a&&this.getCachedQuery();var b=0;_.each(this.bindParamTableObj,function(a,c){$("#arangoBindParamTable tbody").append(""+c+"'),b++,_.each($("#arangoBindParamTable input"),function(b){$(b).attr("name")===c&&(a instanceof Array?$(b).val(JSON.stringify(a)).addClass("arraytype"):"object"==typeof a?$(b).val(JSON.stringify(a)).addClass(typeof a+"type"):$(b).val(a).addClass(typeof a+"type"))})}),0===b&&$("#arangoBindParamTable tbody").append('No bind parameters defined.')},fillBindParamTable:function(a){_.each(a,function(a,b){_.each($("#arangoBindParamTable input"),function(c){$(c).attr("name")===b&&$(c).val(a)})})},initAce:function(){var a=this;this.aqlEditor=ace.edit("aqlEditor"),this.aqlEditor.getSession().setMode("ace/mode/aql"),this.aqlEditor.setFontSize("10pt"),this.aqlEditor.setShowPrintMargin(!1),this.bindParamAceEditor=ace.edit("bindParamAceEditor"),this.bindParamAceEditor.getSession().setMode("ace/mode/json"),this.bindParamAceEditor.setFontSize("10pt"),this.bindParamAceEditor.setShowPrintMargin(!1),this.bindParamAceEditor.getSession().on("change",function(){try{a.bindParamTableObj=JSON.parse(a.bindParamAceEditor.getValue()),a.allowParamToggle=!0,a.setCachedQuery(a.aqlEditor.getValue(),JSON.stringify(a.bindParamTableObj))}catch(b){""===a.bindParamAceEditor.getValue()?(_.each(a.bindParamTableObj,function(b,c){a.bindParamTableObj[c]=""}),a.allowParamToggle=!0):a.allowParamToggle=!1}}),this.aqlEditor.getSession().on("change",function(){a.checkForNewBindParams(),a.renderBindParamTable(),a.initDone&&a.setCachedQuery(a.aqlEditor.getValue(),JSON.stringify(a.bindParamTableObj)),a.bindParamAceEditor.setValue(JSON.stringify(a.bindParamTableObj,null," "),1),$("#aqlEditor .ace_text-input").focus(),a.resize()}),this.aqlEditor.commands.addCommand({name:"togglecomment",bindKey:{win:"Ctrl-Shift-C",linux:"Ctrl-Shift-C",mac:"Command-Shift-C"},exec:function(a){a.toggleCommentLines()},multiSelectAction:"forEach"}),this.aqlEditor.commands.addCommand({name:"executeQuery",bindKey:{win:"Ctrl-Return",mac:"Command-Return",linux:"Ctrl-Return"},exec:function(){a.executeQuery()}}),this.aqlEditor.commands.addCommand({name:"saveQuery",bindKey:{win:"Ctrl-Shift-S",mac:"Command-Shift-S",linux:"Ctrl-Shift-S"},exec:function(){a.addAQL()}}),this.aqlEditor.commands.addCommand({name:"explainQuery",bindKey:{win:"Ctrl-Shift-Return",mac:"Command-Shift-Return",linux:"Ctrl-Shift-Return"},exec:function(){a.explainQuery()}}),this.aqlEditor.commands.addCommand({name:"togglecomment",bindKey:{win:"Ctrl-Shift-C",linux:"Ctrl-Shift-C",mac:"Command-Shift-C"},exec:function(a){a.toggleCommentLines()},multiSelectAction:"forEach"}),this.aqlEditor.commands.addCommand({name:"showSpotlight",bindKey:{win:"Ctrl-Space",mac:"Ctrl-Space",linux:"Ctrl-Space"},exec:function(){a.showSpotlight()}}),this.queryPreview=ace.edit("queryPreview"),this.queryPreview.getSession().setMode("ace/mode/aql"),this.queryPreview.setReadOnly(!0),this.queryPreview.setFontSize("13px"),$("#aqlEditor .ace_text-input").focus()},updateQueryTable:function(){function a(a,b){var c;return c=a.nameb.name?1:0}var b=this;this.updateLocalQueries(),this.myQueriesTableDesc.rows=this.customQueries,_.each(this.myQueriesTableDesc.rows,function(a){a.secondRow='
    ',a.hasOwnProperty("parameter")&&delete a.parameter,delete a.value}),this.myQueriesTableDesc.rows.sort(a),_.each(this.queries,function(a){a.hasOwnProperty("parameter")&&delete a.parameter,b.myQueriesTableDesc.rows.push({name:a.name,thirdRow:''})}),this.myQueriesTableDesc.unescaped=[!1,!0,!0],this.$(this.myQueriesId).html(this.table.render({content:this.myQueriesTableDesc}))},listenKey:function(a){13===a.keyCode&&"Update"===$("#modalButton1").html()&&this.saveAQL(),this.checkSaveName()},addAQL:function(){this.refreshAQL(!0),this.createCustomQueryModal(),setTimeout(function(){$("#new-query-name").focus()},500)},createCustomQueryModal:function(){var a=[],b=[];b.push(window.modalView.createTextEntry("new-query-name","Name","",void 0,void 0,!1,[{rule:Joi.string().required(),msg:"No query name given."}])),a.push(window.modalView.createSuccessButton("Save",this.saveAQL.bind(this))),window.modalView.show("modalTable.ejs","Save Query",a,b,void 0,void 0,{"keyup #new-query-name":this.listenKey.bind(this)})},checkSaveName:function(){var a=$("#new-query-name").val();if("Insert Query"===a)return void $("#new-query-name").val("");var b=this.customQueries.some(function(b){return b.name===a});b?($("#modalButton1").removeClass("button-success"),$("#modalButton1").addClass("button-warning"),$("#modalButton1").text("Update")):($("#modalButton1").removeClass("button-warning"),$("#modalButton1").addClass("button-success"),$("#modalButton1").text("Save"))},saveAQL:function(a){a&&a.stopPropagation(),this.refreshAQL();var b=$("#new-query-name").val(),c=this.bindParamTableObj;if(!$("#new-query-name").hasClass("invalid-input")&&""!==b.trim()){var d=this.aqlEditor.getValue(),e=!1;if(_.each(this.customQueries,function(a){return a.name===b?(a.value=d,void(e=!0)):void 0}),e===!0)this.collection.findWhere({name:b}).set("value",d);else{if(""!==c&&void 0!==c||(c="{}"),"string"==typeof c)try{c=JSON.parse(c)}catch(f){arangoHelper.arangoError("Query","Could not parse bind parameter")}this.collection.add({name:b,parameter:c,value:d})}var g=function(a){if(a)arangoHelper.arangoError("Query","Could not save query");else{var b=this;this.collection.fetch({success:function(){b.updateLocalQueries()}})}}.bind(this);this.collection.saveCollectionQueries(g),window.modalView.hide()}},verifyQueryAndParams:function(){var a=!1;0===this.aqlEditor.getValue().length&&(arangoHelper.arangoError("Query","Your query is empty"),a=!0);var b=[];return _.each(this.bindParamTableObj,function(c,d){""===c&&(a=!0,b.push(d))}),b.length>0&&arangoHelper.arangoError("Bind Parameter",JSON.stringify(b)+" not defined."),a},executeQuery:function(){if(!this.verifyQueryAndParams()){this.$(this.outputDiv).prepend(this.outputTemplate.render({counter:this.outputCounter,type:"Query"})),$("#outputEditorWrapper"+this.outputCounter).hide(),$("#outputEditorWrapper"+this.outputCounter).show("fast");var a=this.outputCounter,b=ace.edit("outputEditor"+a),c=ace.edit("sentQueryEditor"+a),d=ace.edit("sentBindParamEditor"+a);c.getSession().setMode("ace/mode/aql"),c.setOption("vScrollBarAlwaysVisible",!0),c.setFontSize("13px"),c.setReadOnly(!0),this.setEditorAutoHeight(c),b.setFontSize("13px"),b.getSession().setMode("ace/mode/json"),b.setReadOnly(!0),b.setOption("vScrollBarAlwaysVisible",!0),b.setShowPrintMargin(!1),this.setEditorAutoHeight(b),d.setValue(JSON.stringify(this.bindParamTableObj),1),d.setOption("vScrollBarAlwaysVisible",!0),d.getSession().setMode("ace/mode/json"),d.setReadOnly(!0),this.setEditorAutoHeight(d),this.fillResult(b,c,a),this.outputCounter++}},readQueryData:function(){var a=$("#querySize"),b={query:this.aqlEditor.getValue(),id:"currentFrontendQuery"};return"all"===a.val()?b.batchSize=1e6:b.batchSize=parseInt(a.val(),10),Object.keys(this.bindParamTableObj).length>0&&(b.bindVars=this.bindParamTableObj),JSON.stringify(b)},fillResult:function(a,b,c){var d=this,e=this.readQueryData();e&&(b.setValue(d.aqlEditor.getValue(),1),$.ajax({type:"POST",url:arangoHelper.databaseUrl("/_api/cursor"),headers:{"x-arango-async":"store"},data:e,contentType:"application/json",processData:!1,success:function(b,e,f){f.getResponseHeader("x-arango-async-id")&&d.queryCallbackFunction(f.getResponseHeader("x-arango-async-id"),a,c),$.noty.clearQueue(),$.noty.closeAll(),d.handleResult(c)},error:function(a){try{var b=JSON.parse(a.responseText);arangoHelper.arangoError("["+b.errorNum+"]",b.errorMessage)}catch(e){arangoHelper.arangoError("Query error","ERROR")}d.handleResult(c)}}))},handleResult:function(){var a=this;window.progressView.hide(),$("#removeResults").show(),window.setTimeout(function(){a.aqlEditor.focus()},300),$(".centralRow").animate({scrollTop:$("#queryContent").height()},"fast")},setEditorAutoHeight:function(a){var b=$(".centralRow").height(),c=(b-250)/17;a.setOptions({maxLines:c,minLines:10})},deselect:function(a){var b=a.getSelection(),c=b.lead.row,d=b.lead.column;b.setSelectionRange({start:{row:c,column:d},end:{row:c,column:d}}),a.focus()},queryCallbackFunction:function(a,b,c){var d=this,e=function(a,b){$.ajax({url:arangoHelper.databaseUrl("/_api/job/"+encodeURIComponent(a)+"/cancel"),type:"PUT",success:function(){window.clearTimeout(d.checkQueryTimer),$("#outputEditorWrapper"+b).remove(),arangoHelper.arangoNotification("Query","Query canceled.")}})};$("#outputEditorWrapper"+c+" #cancelCurrentQuery").bind("click",function(){e(a,c)}),$("#outputEditorWrapper"+c+" #copy2aqlEditor").bind("click",function(){$("#toggleQueries1").is(":visible")||d.toggleQueries();var a=ace.edit("sentQueryEditor"+c).getValue(),b=JSON.parse(ace.edit("sentBindParamEditor"+c).getValue());d.aqlEditor.setValue(a,1),d.deselect(d.aqlEditor),Object.keys(b).length>0&&(d.bindParamTableObj=b,d.setCachedQuery(d.aqlEditor.getValue(),JSON.stringify(d.bindParamTableObj)),$("#bindParamEditor").is(":visible")?d.renderBindParamTable():(d.bindParamAceEditor.setValue(JSON.stringify(b),1),d.deselect(d.bindParamAceEditor))),$(".centralRow").animate({scrollTop:0},"fast"),d.resize()}),this.execPending=!1;var f=function(a){var c="";a.extra&&a.extra.warnings&&a.extra.warnings.length>0&&(c+="Warnings:\r\n\r\n",a.extra.warnings.forEach(function(a){c+="["+a.code+"], '"+a.message+"'\r\n"})),""!==c&&(c+="\r\nResult:\r\n\r\n"),b.setValue(c+JSON.stringify(a.result,void 0,2),1),b.getSession().setScrollTop(0)},g=function(a){f(a),window.progressView.hide();var e=d.analyseQuery(a.result);if(console.log("Using "+e.defaultType+" as data format."),"table"===e.defaultType){$("#outputEditorWrapper"+c+" .arangoToolbarTop").after('
    '),$("#outputTable"+c).show(),d.renderOutputTable(e,c);var g=$(".centralRow").height()-250;$(".outputEditorWrapper .tableWrapper").css("max-height",g),$("#outputEditor"+c).hide()}else"graph"===e.defaultType&&($("#outputEditorWrapper"+c+" .arangoToolbarTop").after('
    '),$("#outputGraph"+c).show(),d.renderOutputGraph(e,c),$("#outputEditor"+c).hide());$("#"+e.defaultType+"-switch").addClass("active").css("display","inline");var h=function(a,b,d){d||(d=""),$("#outputEditorWrapper"+c+" .arangoToolbarTop .pull-left").append(''+a+"")};$("#outputEditorWrapper"+c+" .pull-left #spinner").remove();var i="-";a&&a.extra&&a.extra.stats&&(i=a.extra.stats.executionTime.toFixed(3)+" s"),h(a.result.length+" elements","fa-calculator"),h(i,"fa-clock-o"),a.extra&&a.extra.stats&&(a.extra.stats.writesExecuted>0||a.extra.stats.writesIgnored>0)&&(h(a.extra.stats.writesExecuted+" writes","fa-check-circle positive"),0===a.extra.stats.writesIgnored?h(a.extra.stats.writesIgnored+" writes ignored","fa-check-circle positive","additional"):h(a.extra.stats.writesIgnored+" writes ignored","fa-exclamation-circle warning","additional")),$("#outputEditorWrapper"+c+" .switchAce").show(),$("#outputEditorWrapper"+c+" .fa-close").show(),$("#outputEditor"+c).css("opacity","1"),$("#outputEditorWrapper"+c+" #downloadQueryResult").show(),$("#outputEditorWrapper"+c+" #copy2aqlEditor").show(),$("#outputEditorWrapper"+c+" #cancelCurrentQuery").remove(),d.setEditorAutoHeight(b),d.deselect(b),a.id&&$.ajax({url:"/_api/cursor/"+encodeURIComponent(a.id),type:"DELETE"})},h=function(){$.ajax({type:"PUT",url:arangoHelper.databaseUrl("/_api/job/"+encodeURIComponent(a)),contentType:"application/json",processData:!1,success:function(a,b,c){201===c.status?g(a):204===c.status&&(d.checkQueryTimer=window.setTimeout(function(){h()},500))},error:function(a){var b;try{if("Gone"===a.statusText)return arangoHelper.arangoNotification("Query","Query execution aborted."),void d.removeOutputEditor(c);b=JSON.parse(a.responseText),arangoHelper.arangoError("Query",b.errorMessage), +b.errorMessage&&(null!==b.errorMessage.match(/\d+:\d+/g)?d.markPositionError(b.errorMessage.match(/'.*'/g)[0],b.errorMessage.match(/\d+:\d+/g)[0]):d.markPositionError(b.errorMessage.match(/\(\w+\)/g)[0]),d.removeOutputEditor(c))}catch(e){if(d.removeOutputEditor(c),409===b.code)return;400!==b.code&&404!==b.code&&arangoHelper.arangoNotification("Query","Successfully aborted.")}window.progressView.hide()}})};h()},analyseQuery:function(a){var b={defaultType:null,original:a,modified:null},c=!1;if(a[0])if(a[0].vertices&&a[0].edges){var d=0,e=0;_.each(a,function(a){a.edges&&(e+=a.edges.length,_.each(a.edges,function(a){a._from&&a._to&&d++}))});var f=d/e*100;f>=95&&(c=!0,b.defaultType="graph",b.graphInfo="object")}else{var g=0,h=a.length;_.each(a,function(a){a._from&&a._to&&g++});var i=g/h*100;i>=95&&(c=!0,b.defaultType="graph",b.graphInfo="array")}if(!c){var j,k=0,l=!0,m={};if(a.length<=1&&(l=!1),l){_.each(a,function(a){j=_.keys(a).length,j>k&&(k=j),_.each(a,function(a,b){m[b]?m[b]=m[b]+1:m[b]=1})});var n;_.each(m,function(b,c){n=b/a.length*100,l!==!1&&95>=n&&(l=!1)})}l&&(c=!0,b.defaultType="table")}return c||(b.defaultType="json"),b},markPositionError:function(a,b){var c;b&&(c=b.split(":")[0],a=a.substr(1,a.length-2));var d=this.aqlEditor.find(a);!d&&b&&(this.aqlEditor.selection.moveCursorToPosition({row:c,column:0}),this.aqlEditor.selection.selectLine()),window.setTimeout(function(){$(".ace_start").first().css("background","rgba(255, 129, 129, 0.7)")},100)},refreshAQL:function(){var a=this,b=function(b){b?arangoHelper.arangoError("Query","Could not reload Queries"):(a.updateLocalQueries(),a.updateQueryTable())},c=function(){a.getSystemQueries(b)};this.getAQL(c)},getSystemQueries:function(a){var b=this;$.ajax({type:"GET",cache:!1,url:"js/arango/aqltemplates.json",contentType:"application/json",processData:!1,success:function(c){a&&a(!1),b.queries=c},error:function(){a&&a(!0),arangoHelper.arangoNotification("Query","Error while loading system templates")}})},updateLocalQueries:function(){var a=this;this.customQueries=[],this.collection.each(function(b){a.customQueries.push({name:b.get("name"),value:b.get("value"),parameter:b.get("parameter")})})},renderOutputTable:function(a,b){var c={id:"outputTableData"+b,titles:[],rows:[]},d=!0,e=[];_.each(a.original,function(a){d===!0&&(c.titles=Object.keys(a),d=!1),_.each(a,function(a){"object"==typeof a&&(a=JSON.stringify(a)),e.push(a)}),c.rows.push(e),e=[]}),$("#outputTable"+b).append(this.table.render({content:c}))},renderOutputGraph:function(a,b){this.graphViewer2=new window.GraphViewer2({name:void 0,documentStore:window.App.arangoDocumentStore,collection:new window.GraphCollection,userConfig:window.App.userConfig,id:"#outputGraph"+b,data:a}),this.graphViewer2.renderAQL()},getAQL:function(a){var b=this;this.collection.fetch({success:function(){var c=localStorage.getItem("customQueries");if(c){var d=JSON.parse(c);_.each(d,function(a){b.collection.add({value:a.value,name:a.name})});var e=function(a){a?arangoHelper.arangoError("Custom Queries","Could not import old local storage queries"):localStorage.removeItem("customQueries")};b.collection.saveCollectionQueries(e)}b.updateLocalQueries(),a&&a()}})}})}(),function(){"use strict";window.ScaleView=Backbone.View.extend({el:"#content",template:templateEngine.createTemplate("scaleView.ejs"),interval:1e4,knownServers:[],events:{"click #addCoord":"addCoord","click #removeCoord":"removeCoord","click #addDBs":"addDBs","click #removeDBs":"removeDBs"},setCoordSize:function(a){var b=this,c={numberOfCoordinators:a};$.ajax({type:"PUT",url:arangoHelper.databaseUrl("/_admin/cluster/numberOfServers"),contentType:"application/json",data:JSON.stringify(c),success:function(){b.updateTable(c)},error:function(){arangoHelper.arangoError("Scale","Could not set coordinator size.")}})},setDBsSize:function(a){var b=this,c={numberOfDBServers:a};$.ajax({type:"PUT",url:arangoHelper.databaseUrl("/_admin/cluster/numberOfServers"),contentType:"application/json",data:JSON.stringify(c),success:function(){b.updateTable(c)},error:function(){arangoHelper.arangoError("Scale","Could not set coordinator size.")}})},addCoord:function(){this.setCoordSize(this.readNumberFromID("#plannedCoords",!0))},removeCoord:function(){this.setCoordSize(this.readNumberFromID("#plannedCoords",!1,!0))},addDBs:function(){this.setDBsSize(this.readNumberFromID("#plannedDBs",!0))},removeDBs:function(){this.setDBsSize(this.readNumberFromID("#plannedDBs",!1,!0))},readNumberFromID:function(a,b,c){var d=$(a).html(),e=!1;try{e=JSON.parse(d)}catch(f){}return b&&e++,c&&1!==e&&e--,e},initialize:function(a){var b=this;clearInterval(this.intervalFunction),window.App.isCluster&&(this.dbServers=a.dbServers,this.coordinators=a.coordinators,this.updateServerTime(),this.intervalFunction=window.setInterval(function(){"#sNodes"===window.location.hash&&b.coordinators.fetch({success:function(){b.dbServers.fetch({success:function(){b.continueRender(!0)}})}})},this.interval))},render:function(){var a=this,b=function(){var b=function(){a.continueRender()};this.waitForDBServers(b)}.bind(this);this.initDoneCoords?b():this.waitForCoordinators(b),window.arangoHelper.buildNodesSubNav("scale")},continueRender:function(a){var b,c,d=this;b=this.coordinators.toJSON(),c=this.dbServers.toJSON(),this.$el.html(this.template.render({runningCoords:b.length,runningDBs:c.length,plannedCoords:void 0,plannedDBs:void 0,initialized:a})),$.ajax({type:"GET",cache:!1,url:arangoHelper.databaseUrl("/_admin/cluster/numberOfServers"),contentType:"application/json",processData:!1,success:function(a){d.updateTable(a)}})},updateTable:function(a){var b='scaling in progress ',c='no scaling process active';a.numberOfCoordinators&&($("#plannedCoords").html(a.numberOfCoordinators),this.coordinators.toJSON().length===a.numberOfCoordinators?$("#statusCoords").html(c):$("#statusCoords").html(b)),a.numberOfDBServers&&($("#plannedDBs").html(a.numberOfDBServers),this.dbServers.toJSON().length===a.numberOfDBServers?$("#statusDBs").html(c):$("#statusDBs").html(b))},waitForDBServers:function(a){var b=this;0===this.dbServers.length?window.setInterval(function(){b.waitForDBServers(a)},300):a()},waitForCoordinators:function(a){var b=this;window.setTimeout(function(){0===b.coordinators.length?b.waitForCoordinators(a):(b.initDoneCoords=!0,a())},200)},updateServerTime:function(){this.serverTime=(new Date).getTime()}})}(),function(){"use strict";window.SettingsView=Backbone.View.extend({el:"#content",initialize:function(a){this.collectionName=a.collectionName,this.model=this.collection},events:{},render:function(){this.breadcrumb(),window.arangoHelper.buildCollectionSubNav(this.collectionName,"Settings"),this.renderSettings()},breadcrumb:function(){$("#subNavigationBar .breadcrumb").html("Collection: "+this.collectionName)},unloadCollection:function(){var a=function(a){a?arangoHelper.arangoError("Collection error",this.model.get("name")+" could not be unloaded."):void 0===a?(this.model.set("status","unloading"),this.render()):"#collections"===window.location.hash?(this.model.set("status","unloaded"),this.render()):arangoHelper.arangoNotification("Collection "+this.model.get("name")+" unloaded.")}.bind(this);this.model.unloadCollection(a),window.modalView.hide()},loadCollection:function(){var a=function(a){a?arangoHelper.arangoError("Collection error",this.model.get("name")+" could not be loaded."):void 0===a?(this.model.set("status","loading"),this.render()):"#collections"===window.location.hash?(this.model.set("status","loaded"),this.render()):arangoHelper.arangoNotification("Collection "+this.model.get("name")+" loaded.")}.bind(this);this.model.loadCollection(a),window.modalView.hide()},truncateCollection:function(){this.model.truncateCollection(),window.modalView.hide()},deleteCollection:function(){this.model.destroy({error:function(){arangoHelper.arangoError("Could not delete collection.")},success:function(){window.App.navigate("#collections",{trigger:!0})}})},saveModifiedCollection:function(){var a=function(a,b){if(a)arangoHelper.arangoError("Error","Could not get coordinator info");else{var c;c=b?this.model.get("name"):$("#change-collection-name").val();var d=this.model.get("status");if("loaded"===d){var e;try{e=JSON.parse(1024*$("#change-collection-size").val()*1024)}catch(f){return arangoHelper.arangoError("Please enter a valid number"),0}var g;try{if(g=JSON.parse($("#change-index-buckets").val()),1>g||parseInt(g,10)!==Math.pow(2,Math.log2(g)))throw new Error("invalid indexBuckets value")}catch(f){return arangoHelper.arangoError("Please enter a valid number of index buckets"),0}var h=function(a){a?arangoHelper.arangoError("Collection error: "+a.responseText):(arangoHelper.arangoNotification("Collection: Successfully changed."),window.App.navigate("#cSettings/"+c,{trigger:!0}))},i=function(a){if(a)arangoHelper.arangoError("Collection error: "+a.responseText);else{var b=$("#change-collection-sync").val();this.model.changeCollection(b,e,g,h)}}.bind(this);frontendConfig.isCluster===!1?this.model.renameCollection(c,i):i()}else if("unloaded"===d)if(this.model.get("name")!==c){var j=function(a,b){a?arangoHelper.arangoError("Collection"+b.responseText):(arangoHelper.arangoNotification("CollectionSuccessfully changed."),window.App.navigate("#cSettings/"+c,{trigger:!0}))};frontendConfig.isCluster===!1?this.model.renameCollection(c,j):j()}else window.modalView.hide()}}.bind(this);window.isCoordinator(a)},renderSettings:function(){var a=function(a,b){if(a)arangoHelper.arangoError("Error","Could not get coordinator info");else{var c=!1;"loaded"===this.model.get("status")&&(c=!0);var d=[],e=[];b||e.push(window.modalView.createTextEntry("change-collection-name","Name",this.model.get("name"),!1,"",!0,[{rule:Joi.string().regex(/^[a-zA-Z]/),msg:"Collection name must always start with a letter."},{rule:Joi.string().regex(/^[a-zA-Z0-9\-_]*$/),msg:'Only Symbols "_" and "-" are allowed.'},{rule:Joi.string().required(),msg:"No collection name given."}]));var f=function(){e.push(window.modalView.createReadOnlyEntry("change-collection-id","ID",this.model.get("id"),"")),e.push(window.modalView.createReadOnlyEntry("change-collection-type","Type",this.model.get("type"),"")),e.push(window.modalView.createReadOnlyEntry("change-collection-status","Status",this.model.get("status"),"")),d.push(window.modalView.createDeleteButton("Delete",this.deleteCollection.bind(this))),d.push(window.modalView.createDeleteButton("Truncate",this.truncateCollection.bind(this))),c?d.push(window.modalView.createNotificationButton("Unload",this.unloadCollection.bind(this))):d.push(window.modalView.createNotificationButton("Load",this.loadCollection.bind(this))),d.push(window.modalView.createSuccessButton("Save",this.saveModifiedCollection.bind(this)));var a=["General","Indices"],b=["modalTable.ejs","indicesView.ejs"];window.modalView.show(b,"Modify Collection",d,e,null,null,this.events,null,a,"content"),$($("#infoTab").children()[1]).remove()}.bind(this);if(c){var g=function(a,b){if(a)arangoHelper.arangoError("Collection","Could not fetch properties");else{var c=b.journalSize/1048576,d=b.indexBuckets,g=b.waitForSync;e.push(window.modalView.createTextEntry("change-collection-size","Journal size",c,"The maximal size of a journal or datafile (in MB). Must be at least 1.","",!0,[{rule:Joi.string().allow("").optional().regex(/^[0-9]*$/),msg:"Must be a number."}])),e.push(window.modalView.createTextEntry("change-index-buckets","Index buckets",d,"The number of index buckets for this collection. Must be at least 1 and a power of 2.","",!0,[{rule:Joi.string().allow("").optional().regex(/^[1-9][0-9]*$/),msg:"Must be a number greater than 1 and a power of 2."}])),e.push(window.modalView.createSelectEntry("change-collection-sync","Wait for sync",g,"Synchronize to disk before returning from a create or update of a document.",[{value:!1,label:"No"},{value:!0,label:"Yes"}]))}f()};this.model.getProperties(g)}else f()}}.bind(this);window.isCoordinator(a)}})}(),function(){"use strict";window.ShardsView=Backbone.View.extend({el:"#content",template:templateEngine.createTemplate("shardsView.ejs"),interval:1e4,knownServers:[],events:{"click #shardsContent .shardLeader span":"moveShard","click #shardsContent .shardFollowers span":"moveShardFollowers","click #rebalanceShards":"rebalanceShards"},initialize:function(a){var b=this;b.dbServers=a.dbServers,clearInterval(this.intervalFunction),window.App.isCluster&&(this.updateServerTime(),this.intervalFunction=window.setInterval(function(){"#shards"===window.location.hash&&b.render(!1)},this.interval))},render:function(a){var b=this;$.ajax({type:"GET",cache:!1,url:arangoHelper.databaseUrl("/_admin/cluster/shardDistribution"),contentType:"application/json",processData:!1,async:!0,success:function(a){var c,d=!1;b.shardDistribution=a.results,_.each(a.results,function(a,b){c=b.substring(0,1),"_"!==c&&"error"!==b&&"code"!==b&&(d=!0)}),d?b.continueRender(a.results):arangoHelper.renderEmpty("No collections and no shards available")},error:function(a){0!==a.readyState&&arangoHelper.arangoError("Cluster","Could not fetch sharding information.")}}),a!==!1&&arangoHelper.buildNodesSubNav("Shards")},moveShardFollowers:function(a){var b=$(a.currentTarget).html();this.moveShard(a,b)},moveShard:function(a,b){var c,d,e,f,g=this,h=window.App.currentDB.get("name");d=$(a.currentTarget).parent().parent().attr("collection"),e=$(a.currentTarget).parent().parent().attr("shard"),b?(f=$(a.currentTarget).parent().parent().attr("leader"),c=b):c=$(a.currentTarget).parent().parent().attr("leader");var i=[],j=[],k={},l=[];return g.dbServers[0].each(function(a){a.get("name")!==c&&(k[a.get("name")]={value:a.get("name"),label:a.get("name")})}),_.each(g.shardDistribution[d].Plan[e].followers,function(a){delete k[a]}),b&&delete k[f],_.each(k,function(a){l.push(a)}),l=l.reverse(),0===l.length?void arangoHelper.arangoMessage("Shards","No database server for moving the shard is available."):(j.push(window.modalView.createSelectEntry("toDBServer","Destination",void 0,"Please select the target databse server. The selected database server will be the new leader of the shard.",l)),i.push(window.modalView.createSuccessButton("Move",this.confirmMoveShards.bind(this,h,d,e,c))),void window.modalView.show("modalTable.ejs","Move shard: "+e,i,j))},confirmMoveShards:function(a,b,c,d){var e=this,f=$("#toDBServer").val(),g={database:a,collection:b,shard:c,fromServer:d,toServer:f};$.ajax({type:"POST",cache:!1,url:arangoHelper.databaseUrl("/_admin/cluster/moveShard"),contentType:"application/json",processData:!1,data:JSON.stringify(g),async:!0,success:function(a){a===!0&&(window.setTimeout(function(){e.render(!1)},1500),arangoHelper.arangoNotification("Shard "+c+" will be moved to "+f+"."))},error:function(){arangoHelper.arangoNotification("Shard "+c+" could not be moved to "+f+".")}}),window.modalView.hide()},rebalanceShards:function(){var a=this;$.ajax({type:"POST",cache:!1,url:arangoHelper.databaseUrl("/_admin/cluster/rebalanceShards"),contentType:"application/json",processData:!1,data:JSON.stringify({}),async:!0,success:function(b){b===!0&&(window.setTimeout(function(){a.render(!1)},1500),arangoHelper.arangoNotification("Started rebalance process."))},error:function(){arangoHelper.arangoNotification("Could not start rebalance process.")}}),window.modalView.hide()},continueRender:function(a){delete a.code,delete a.error,this.$el.html(this.template.render({collections:a}))},updateServerTime:function(){this.serverTime=(new Date).getTime()}})}(),function(){"use strict";window.ShowClusterView=Backbone.View.extend({detailEl:"#modalPlaceholder",el:"#content",defaultFrame:12e5,template:templateEngine.createTemplate("showCluster.ejs"),modal:templateEngine.createTemplate("waitModal.ejs"),detailTemplate:templateEngine.createTemplate("detailView.ejs"),events:{"change #selectDB":"updateCollections","change #selectCol":"updateShards","click .dbserver.success":"dashboard","click .coordinator.success":"dashboard"},replaceSVGs:function(){$(".svgToReplace").each(function(){var a=$(this),b=a.attr("id"),c=a.attr("src");$.get(c,function(c){var d=$(c).find("svg");d.attr("id",b).attr("class","icon").removeAttr("xmlns:a"),a.replaceWith(d)},"xml")})},updateServerTime:function(){this.serverTime=(new Date).getTime()},setShowAll:function(){this.graphShowAll=!0},resetShowAll:function(){this.graphShowAll=!1,this.renderLineChart()},initialize:function(a){this.options=a,this.interval=1e4,this.isUpdating=!1,this.timer=null,this.knownServers=[],this.graph=void 0,this.graphShowAll=!1,this.updateServerTime(),this.dygraphConfig=this.options.dygraphConfig,this.dbservers=new window.ClusterServers([],{interval:this.interval}),this.coordinators=new window.ClusterCoordinators([],{interval:this.interval}),this.documentStore=new window.ArangoDocuments,this.statisticsDescription=new window.StatisticsDescription,this.statisticsDescription.fetch({async:!1}),this.dbs=new window.ClusterDatabases([],{interval:this.interval}),this.cols=new window.ClusterCollections,this.shards=new window.ClusterShards,this.startUpdating()},listByAddress:function(a){var b={},c=this;this.dbservers.byAddress(b,function(b){c.coordinators.byAddress(b,a)})},updateCollections:function(){var a=this,b=$("#selectCol"),c=$("#selectDB").find(":selected").attr("id");if(c){var d=b.find(":selected").attr("id");b.html(""),this.cols.getList(c,function(c){_.each(_.pluck(c,"name"),function(a){b.append('")});var e=$("#"+d,b);1===e.length&&e.prop("selected",!0),a.updateShards()})}},updateShards:function(){var a=$("#selectDB").find(":selected").attr("id"),b=$("#selectCol").find(":selected").attr("id");this.shards.getList(a,b,function(a){$(".shardCounter").html("0"),_.each(a,function(a){$("#"+a.server+"Shards").html(a.shards.length)})})},updateServerStatus:function(a){var b=this,c=function(a,b,c){var d,e,f=c;f=f.replace(/\./g,"-"),f=f.replace(/\:/g,"_"),e=$("#id"+f),e.length<1||(d=e.attr("class").split(/\s+/)[1],e.attr("class",a+" "+d+" "+b),"coordinator"===a&&("success"===b?$(".button-gui",e.closest(".tile")).toggleClass("button-gui-disabled",!1):$(".button-gui",e.closest(".tile")).toggleClass("button-gui-disabled",!0)))};this.coordinators.getStatuses(c.bind(this,"coordinator"),function(){b.dbservers.getStatuses(c.bind(b,"dbserver")),a()})},updateDBDetailList:function(){var a=this,b=$("#selectDB"),c=b.find(":selected").attr("id");b.html(""),this.dbs.getList(function(d){_.each(_.pluck(d,"name"),function(a){b.append('")});var e=$("#"+c,b);1===e.length&&e.prop("selected",!0),a.updateCollections()})},rerender:function(){var a=this;this.updateServerStatus(function(){a.getServerStatistics(function(){a.updateServerTime(),a.data=a.generatePieData(),a.renderPieChart(a.data),a.renderLineChart(),a.updateDBDetailList()})})},render:function(){this.knownServers=[],delete this.hist;var a=this;this.listByAddress(function(b){1===Object.keys(b).length?a.type="testPlan":a.type="other",a.updateDBDetailList(),a.dbs.getList(function(c){$(a.el).html(a.template.render({dbs:_.pluck(c,"name"),byAddress:b,type:a.type})),$(a.el).append(a.modal.render({})),a.replaceSVGs(),a.getServerStatistics(function(){a.data=a.generatePieData(),a.renderPieChart(a.data),a.renderLineChart(),a.updateDBDetailList(),a.startUpdating()})})})},generatePieData:function(){var a=[],b=this;return this.data.forEach(function(c){a.push({key:c.get("name"),value:c.get("system").virtualSize,time:b.serverTime})}),a},addStatisticsItem:function(a,b,c,d){var e=this;e.hasOwnProperty("hist")||(e.hist={}),e.hist.hasOwnProperty(a)||(e.hist[a]=[]);var f=e.hist[a],g=f.length;if(0===g)f.push({time:b,snap:d,requests:c,requestsPerSecond:0});else{var h=f[g-1].time,i=f[g-1].requests;if(c>i){var j=b-h,k=0;j>0&&(k=(c-i)/j),f.push({time:b,snap:d,requests:c,requestsPerSecond:k})}}},getServerStatistics:function(a){var b=this,c=Math.round(b.serverTime/1e3);this.data=void 0;var d=new window.ClusterStatisticsCollection,e=this.coordinators.first();this.dbservers.forEach(function(a){if("ok"===a.get("status")){-1===b.knownServers.indexOf(a.id)&&b.knownServers.push(a.id);var c=new window.Statistics({name:a.id});c.url=e.get("protocol")+"://"+e.get("address")+"/_admin/clusterStatistics?DBserver="+a.get("name"),d.add(c)}}),this.coordinators.forEach(function(a){if("ok"===a.get("status")){-1===b.knownServers.indexOf(a.id)&&b.knownServers.push(a.id);var c=new window.Statistics({name:a.id});c.url=a.get("protocol")+"://"+a.get("address")+"/_admin/statistics",d.add(c)}});var f=d.size();this.data=[];var g=function(d){f--;var e=d.get("time"),g=d.get("name"),h=d.get("http").requestsTotal;b.addStatisticsItem(g,e,h,c),b.data.push(d),0===f&&a()},h=function(){f--,0===f&&a()};d.fetch(g,h)},renderPieChart:function(a){var b=$("#clusterGraphs svg").width(),c=$("#clusterGraphs svg").height(),d=Math.min(b,c)/2,e=this.dygraphConfig.colors,f=d3.svg.arc().outerRadius(d-20).innerRadius(0),g=d3.layout.pie().sort(function(a){return a.value}).value(function(a){return a.value});d3.select("#clusterGraphs").select("svg").remove();var h=d3.select("#clusterGraphs").append("svg").attr("class","clusterChart").append("g").attr("transform","translate("+b/2+","+(c/2-10)+")"),i=d3.svg.arc().outerRadius(d-2).innerRadius(d-2),j=h.selectAll(".arc").data(g(a)).enter().append("g").attr("class","slice");j.append("path").attr("d",f).style("fill",function(a,b){return e[b%e.length]}).style("stroke",function(a,b){return e[b%e.length]}),j.append("text").attr("transform",function(a){return"translate("+f.centroid(a)+")"}).style("text-anchor","middle").text(function(a){var b=a.data.value/1024/1024/1024;return b.toFixed(2)}),j.append("text").attr("transform",function(a){return"translate("+i.centroid(a)+")"}).style("text-anchor","middle").text(function(a){return a.data.key})},renderLineChart:function(){var a,b,c,d,e,f,g=this,h=1200,i=[],j=[],k=Math.round((new Date).getTime()/1e3)-h,l=g.knownServers,m=function(){return null};for(c=0;cf||(j.hasOwnProperty(f)?a=j[f]:(e=new Date(1e3*f),a=j[f]=[e].concat(l.map(m))),a[c+1]=b[d].requestsPerSecond);i=[],Object.keys(j).sort().forEach(function(a){i.push(j[a])});var n=this.dygraphConfig.getDefaultConfig("clusterRequestsPerSecond");n.labelsDiv=$("#lineGraphLegend")[0],n.labels=["datetime"].concat(l),g.graph=new Dygraph(document.getElementById("lineGraph"),i,n)},stopUpdating:function(){window.clearTimeout(this.timer),delete this.graph,this.isUpdating=!1},startUpdating:function(){if(!this.isUpdating){this.isUpdating=!0;var a=this;this.timer=window.setInterval(function(){a.rerender()},this.interval)}},dashboard:function(a){this.stopUpdating();var b,c,d=$(a.currentTarget),e={},f=d.attr("id");f=f.replace(/\-/g,"."),f=f.replace(/\_/g,":"),f=f.substr(2),e.raw=f,e.isDBServer=d.hasClass("dbserver"),e.isDBServer?(b=this.dbservers.findWhere({address:e.raw}),c=this.coordinators.findWhere({status:"ok"}),e.endpoint=c.get("protocol")+"://"+c.get("address")):(b=this.coordinators.findWhere({address:e.raw}),e.endpoint=b.get("protocol")+"://"+b.get("address")),e.target=encodeURIComponent(b.get("name")),window.App.serverToShow=e,window.App.dashboard()},getCurrentSize:function(a){"#"!==a.substr(0,1)&&(a="#"+a);var b,c;return $(a).attr("style",""),b=$(a).height(),c=$(a).width(),{height:b,width:c}},resize:function(){var a;this.graph&&(a=this.getCurrentSize(this.graph.maindiv_.id),this.graph.resize(a.width,a.height))}})}(),function(){"use strict";window.SpotlightView=Backbone.View.extend({template:templateEngine.createTemplate("spotlightView.ejs"),el:"#spotlightPlaceholder",displayLimit:8,typeahead:null,callbackSuccess:null,callbackCancel:null,collections:{system:[],doc:[],edge:[]},events:{"focusout #spotlight .tt-input":"hide","keyup #spotlight .typeahead":"listenKey"},aqlKeywordsArray:[],aqlBuiltinFunctionsArray:[],aqlKeywords:"for|return|filter|sort|limit|let|collect|asc|desc|in|into|insert|update|remove|replace|upsert|options|with|and|or|not|distinct|graph|outbound|inbound|any|all|none|aggregate|like|count|shortest_path",hide:function(){this.typeahead=$("#spotlight .typeahead").typeahead("destroy"),$(this.el).hide()},listenKey:function(a){if(27===a.keyCode)this.callbackSuccess&&this.callbackCancel(),this.hide();else if(13===a.keyCode&&this.callbackSuccess){var b=$(this.typeahead).val();this.callbackSuccess(b),this.hide()}},substringMatcher:function(a){return function(b,c){var d,e;d=[],e=new RegExp(b,"i"),_.each(a,function(a){e.test(a)&&d.push(a)}),c(d)}},updateDatasets:function(){var a=this;this.collections={system:[],doc:[],edge:[]},window.App.arangoCollectionsStore.each(function(b){b.get("isSystem")?a.collections.system.push(b.get("name")):"document"===b.get("type")?a.collections.doc.push(b.get("name")):a.collections.edge.push(b.get("name"))})},stringToArray:function(){var a=this;_.each(this.aqlKeywords.split("|"),function(b){a.aqlKeywordsArray.push(b.toUpperCase())}),a.aqlKeywordsArray.push(!0),a.aqlKeywordsArray.push(!1),a.aqlKeywordsArray.push(null)},fetchKeywords:function(a){var b=this;$.ajax({type:"GET",cache:!1,url:arangoHelper.databaseUrl("/_api/aql-builtin"),contentType:"application/json",success:function(c){b.stringToArray(),b.updateDatasets(),_.each(c.functions,function(a){b.aqlBuiltinFunctionsArray.push(a.name)}),a&&a()},error:function(){a&&a(),arangoHelper.arangoError("AQL","Could not fetch AQL function definition.")}})},show:function(a,b,c){var d=this;this.callbackSuccess=a,this.callbackCancel=b;var e=function(){var a=function(a,b,c){var d='

    '+a+"

    ";return b&&(d+=''),c&&(d+=''+c.toUpperCase()+""),d+="
    "};$(this.el).html(this.template.render({})),$(this.el).show(),"aql"===c?this.typeahead=$("#spotlight .typeahead").typeahead({hint:!0,highlight:!0,minLength:1},{name:"Functions",source:d.substringMatcher(d.aqlBuiltinFunctionsArray),limit:d.displayLimit,templates:{header:a("Functions","fa-code","aql")}},{name:"Keywords",source:d.substringMatcher(d.aqlKeywordsArray),limit:d.displayLimit,templates:{header:a("Keywords","fa-code","aql")}},{name:"Documents",source:d.substringMatcher(d.collections.doc),limit:d.displayLimit,templates:{header:a("Documents","fa-file-text-o","Collection")}},{name:"Edges",source:d.substringMatcher(d.collections.edge),limit:d.displayLimit,templates:{header:a("Edges","fa-share-alt","Collection")}},{name:"System",limit:d.displayLimit,source:d.substringMatcher(d.collections.system),templates:{header:a("System","fa-cogs","Collection")}}):this.typeahead=$("#spotlight .typeahead").typeahead({hint:!0,highlight:!0,minLength:1},{name:"Documents",source:d.substringMatcher(d.collections.doc),limit:d.displayLimit,templates:{header:a("Documents","fa-file-text-o","Collection")}},{name:"Edges",source:d.substringMatcher(d.collections.edge),limit:d.displayLimit,templates:{header:a("Edges","fa-share-alt","Collection")}},{name:"System",limit:d.displayLimit,source:d.substringMatcher(d.collections.system),templates:{header:a("System","fa-cogs","Collection")}}),$("#spotlight .typeahead").focus()}.bind(this);0===d.aqlBuiltinFunctionsArray.length?this.fetchKeywords(e):e()}})}(),function(){"use strict";window.StatisticBarView=Backbone.View.extend({el:"#statisticBar",events:{"change #arangoCollectionSelect":"navigateBySelect","click .tab":"navigateByTab"},template:templateEngine.createTemplate("statisticBarView.ejs"),initialize:function(a){this.currentDB=a.currentDB},replaceSVG:function(a){var b=a.attr("id"),c=a.attr("class"),d=a.attr("src");$.get(d,function(d){var e=$(d).find("svg");void 0===b&&(e=e.attr("id",b)),void 0===c&&(e=e.attr("class",c+" replaced-svg")),e=e.removeAttr("xmlns:a"),a.replaceWith(e)},"xml")},render:function(){var a=this;return $(this.el).html(this.template.render({isSystem:this.currentDB.get("isSystem")})),$("img.svg").each(function(){a.replaceSVG($(this))}),this},navigateBySelect:function(){var a=$("#arangoCollectionSelect").find("option:selected").val();window.App.navigate(a,{trigger:!0})},navigateByTab:function(a){var b=a.target||a.srcElement,c=b.id;return"links"===c?($("#link_dropdown").slideToggle(200),void a.preventDefault()):"tools"===c?($("#tools_dropdown").slideToggle(200),void a.preventDefault()):(window.App.navigate(c,{trigger:!0}),void a.preventDefault())},handleSelectNavigation:function(){$("#arangoCollectionSelect").change(function(){var a=$(this).find("option:selected").val();window.App.navigate(a,{trigger:!0})})},selectMenuItem:function(a){$(".navlist li").removeClass("active"),a&&$("."+a).addClass("active")}})}(),function(){"use strict";window.SupportView=Backbone.View.extend({el:"#content",template:templateEngine.createTemplate("supportView.ejs"),events:{"click .subViewNavbar .subMenuEntry":"toggleViews"},render:function(){this.$el.html(this.template.render({}))},resize:function(a){a?$(".innerContent").css("height","auto"):$(".innerContent").height($(".centralRow").height()-170)},renderSwagger:function(){var a=window.location.pathname.split("/"),b=window.location.protocol+"//"+window.location.hostname+":"+window.location.port+"/"+a[1]+"/"+a[2]+"/_admin/aardvark/api/index.html";$("#swagger").html(""),$("#swagger").append('')},toggleViews:function(a){var b=this,c=a.currentTarget.id.split("-")[0],d=["community","documentation","swagger"];_.each(d,function(a){c!==a?$("#"+a).hide():("swagger"===c?(b.renderSwagger(),$("#swagger iframe").css("height","100%"),$("#swagger iframe").css("width","100%"),$("#swagger iframe").css("margin-top","-13px"),b.resize()):b.resize(!0),$("#"+a).show())}),$(".subMenuEntries").children().removeClass("active"),$("#"+c+"-support").addClass("active")}})}(),function(){"use strict";window.TableView=Backbone.View.extend({template:templateEngine.createTemplate("tableView.ejs"),loading:templateEngine.createTemplate("loadingTableView.ejs"),initialize:function(a){this.rowClickCallback=a.rowClick},events:{"click .pure-table-body .pure-table-row":"rowClick","click .deleteButton":"removeClick"},rowClick:function(a){this.hasOwnProperty("rowClickCallback")&&this.rowClickCallback(a)},removeClick:function(a){this.hasOwnProperty("removeClickCallback")&&(this.removeClickCallback(a),a.stopPropagation())},setRowClick:function(a){this.rowClickCallback=a},setRemoveClick:function(a){this.removeClickCallback=a},render:function(){$(this.el).html(this.template.render({docs:this.collection}))},drawLoading:function(){$(this.el).html(this.loading.render({}))}})}(),function(){"use strict";window.UserBarView=Backbone.View.extend({events:{"change #userBarSelect":"navigateBySelect","click .tab":"navigateByTab","mouseenter .dropdown":"showDropdown","mouseleave .dropdown":"hideDropdown","click #userLogoutIcon":"userLogout","click #userLogout":"userLogout"},initialize:function(a){this.userCollection=a.userCollection,this.userCollection.fetch({cache:!1,async:!0}),this.userCollection.bind("change:extra",this.render.bind(this))},template:templateEngine.createTemplate("userBarView.ejs"),navigateBySelect:function(){var a=$("#arangoCollectionSelect").find("option:selected").val();window.App.navigate(a,{trigger:!0})},navigateByTab:function(a){var b=a.target||a.srcElement;b=$(b).closest("a");var c=b.attr("id");return"user"===c?($("#user_dropdown").slideToggle(200),void a.preventDefault()):(window.App.navigate(c,{trigger:!0}),void a.preventDefault())},toggleUserMenu:function(){$("#userBar .subBarDropdown").toggle()},showDropdown:function(){$("#user_dropdown").fadeIn(1)},hideDropdown:function(){$("#user_dropdown").fadeOut(1)},render:function(){if(frontendConfig.authenticationEnabled!==!1){var a=this,b=function(a,b){if(a)arangoHelper.arangoErro("User","Could not fetch user.");else{var c=null,d=null,e=!1,f=null;if(b!==!1)return f=this.userCollection.findWhere({user:b}),f.set({loggedIn:!0}),d=f.get("extra").name, +c=f.get("extra").img,e=f.get("active"),c=c?"https://s.gravatar.com/avatar/"+c+"?s=80":"img/default_user.png",d||(d=""),this.$el=$("#userBar"),this.$el.html(this.template.render({img:c,name:d,username:b,active:e})),this.delegateEvents(),this.$el}}.bind(this);$("#userBar").on("click",function(){a.toggleUserMenu()}),this.userCollection.whoAmI(b)}},userLogout:function(){var a=function(a){a?arangoHelper.arangoError("User","Logout error"):this.userCollection.logout()}.bind(this);this.userCollection.whoAmI(a)}})}(),function(){"use strict";window.UserManagementView=Backbone.View.extend({el:"#content",el2:"#userManagementThumbnailsIn",template:templateEngine.createTemplate("userManagementView.ejs"),events:{"click #createUser":"createUser","click #submitCreateUser":"submitCreateUser","click #userManagementThumbnailsIn .tile":"editUser","click #submitEditUser":"submitEditUser","click #userManagementToggle":"toggleView","keyup #userManagementSearchInput":"search","click #userManagementSearchSubmit":"search","click #callEditUserPassword":"editUserPassword","click #submitEditUserPassword":"submitEditUserPassword","click #submitEditCurrentUserProfile":"submitEditCurrentUserProfile","click .css-label":"checkBoxes","change #userSortDesc":"sorting"},dropdownVisible:!1,initialize:function(){var a=this,b=function(a,b){frontendConfig.authenticationEnabled===!0&&(a||null===b?arangoHelper.arangoError("User","Could not fetch user data"):this.currentUser=this.collection.findWhere({user:b}))}.bind(this);this.collection.fetch({cache:!1,success:function(){a.collection.whoAmI(b)}})},checkBoxes:function(a){var b=a.currentTarget.id;$("#"+b).click()},sorting:function(){$("#userSortDesc").is(":checked")?this.collection.setSortingDesc(!0):this.collection.setSortingDesc(!1),$("#userManagementDropdown").is(":visible")?this.dropdownVisible=!0:this.dropdownVisible=!1,this.render()},render:function(a){var b=!1;$("#userManagementDropdown").is(":visible")&&(b=!0);var c=function(){this.collection.sort(),$(this.el).html(this.template.render({collection:this.collection,searchString:""})),b===!0&&($("#userManagementDropdown2").show(),$("#userSortDesc").attr("checked",this.collection.sortOptions.desc),$("#userManagementToggle").toggleClass("activated"),$("#userManagementDropdown").show()),a&&this.editCurrentUser(),arangoHelper.setCheckboxStatus("#userManagementDropdown")}.bind(this);return this.collection.fetch({cache:!1,success:function(){c()}}),this},search:function(){var a,b,c,d;a=$("#userManagementSearchInput"),b=$("#userManagementSearchInput").val(),d=this.collection.filter(function(a){return-1!==a.get("user").indexOf(b)}),$(this.el).html(this.template.render({collection:d,searchString:b})),a=$("#userManagementSearchInput"),c=a.val().length,a.focus(),a[0].setSelectionRange(c,c)},createUser:function(a){a.preventDefault(),this.createCreateUserModal()},submitCreateUser:function(){var a=this,b=$("#newUsername").val(),c=$("#newName").val(),d=$("#newPassword").val(),e=$("#newStatus").is(":checked");if(this.validateUserInfo(c,b,d,e)){var f={user:b,passwd:d,active:e,extra:{name:c}};this.collection.create(f,{wait:!0,error:function(a,b){arangoHelper.parseError("User",b,a)},success:function(){a.updateUserManagement(),window.modalView.hide()}})}},validateUserInfo:function(a,b,c,d){return""===b?(arangoHelper.arangoError("You have to define an username"),$("#newUsername").closest("th").css("backgroundColor","red"),!1):!0},updateUserManagement:function(){var a=this;this.collection.fetch({cache:!1,success:function(){a.render()}})},editUser:function(a){if("createUser"!==$(a.currentTarget).find("a").attr("id")){$(a.currentTarget).hasClass("tile")&&(a.currentTarget=$(a.currentTarget).find("img")),this.collection.fetch({cache:!1});var b=this.evaluateUserName($(a.currentTarget).attr("id"),"_edit-user");""===b&&(b=$(a.currentTarget).attr("id")),window.App.navigate("user/"+encodeURIComponent(b),{trigger:!0})}},toggleView:function(){$("#userSortDesc").attr("checked",this.collection.sortOptions.desc),$("#userManagementToggle").toggleClass("activated"),$("#userManagementDropdown2").slideToggle(200)},createCreateUserModal:function(){var a=[],b=[];b.push(window.modalView.createTextEntry("newUsername","Username","",!1,"Username",!0,[{rule:Joi.string().regex(/^[a-zA-Z0-9\-_]*$/),msg:'Only symbols, "_" and "-" are allowed.'},{rule:Joi.string().required(),msg:"No username given."}])),b.push(window.modalView.createTextEntry("newName","Name","",!1,"Name",!1)),b.push(window.modalView.createPasswordEntry("newPassword","Password","",!1,"",!1)),b.push(window.modalView.createCheckboxEntry("newStatus","Active","active",!1,!0)),a.push(window.modalView.createSuccessButton("Create",this.submitCreateUser.bind(this))),window.modalView.show("modalTable.ejs","Create New User",a,b)},evaluateUserName:function(a,b){if(a){var c=a.lastIndexOf(b);return a.substring(0,c)}},updateUserProfile:function(){var a=this;this.collection.fetch({cache:!1,success:function(){a.render()}})}})}(),function(){"use strict";window.UserPermissionView=Backbone.View.extend({el:"#content",template:templateEngine.createTemplate("userPermissionView.ejs"),initialize:function(a){this.username=a.username},events:{'click #userPermissionView [type="checkbox"]':"setPermission"},render:function(){var a=this;this.collection.fetch({success:function(){a.continueRender()}})},setPermission:function(a){var b=$(a.currentTarget).is(":checked"),c=$(a.currentTarget).attr("name");b?this.grantPermission(this.currentUser.get("user"),c):this.revokePermission(this.currentUser.get("user"),c)},grantPermission:function(a,b){$.ajax({type:"PUT",url:arangoHelper.databaseUrl("/_api/user/"+encodeURIComponent(a)+"/database/"+encodeURIComponent(b)),contentType:"application/json",data:JSON.stringify({grant:"rw"})})},revokePermission:function(a,b){$.ajax({type:"PUT",url:arangoHelper.databaseUrl("/_api/user/"+encodeURIComponent(a)+"/database/"+encodeURIComponent(b)),contentType:"application/json"})},continueRender:function(){var a=this;this.currentUser=this.collection.findWhere({user:this.username}),this.breadcrumb(),arangoHelper.buildUserSubNav(this.currentUser.get("user"),"Permissions");var b=arangoHelper.databaseUrl("/_api/user/"+encodeURIComponent(a.currentUser.get("user"))+"/database");"_system"===frontendConfig.db&&(b=arangoHelper.databaseUrl("/_api/user/root/database")),$.ajax({type:"GET",url:b,contentType:"application/json",success:function(b){var c=b.result;$.ajax({type:"GET",url:arangoHelper.databaseUrl("/_api/user/"+encodeURIComponent(a.currentUser.get("user"))+"/database"),contentType:"application/json",success:function(b){var d=b.result;if(c._system){var e=[];_.each(c,function(a,b){e.push(b)}),c=e}a.finishRender(c,d)}})}})},finishRender:function(a,b){_.each(b,function(a,c){"rw"!==a&&delete b[c]}),$(this.el).html(this.template.render({allDBs:a,permissions:b}))},breadcrumb:function(){$("#subNavigationBar .breadcrumb").html("User: "+this.currentUser.get("user"))}})}(),function(){"use strict";window.UserView=Backbone.View.extend({el:"#content",initialize:function(a){this.username=a.username},render:function(){var a=this;this.collection.fetch({success:function(){a.continueRender()}})},editCurrentUser:function(){this.createEditCurrentUserModal(this.currentUser.get("user"),this.currentUser.get("extra").name,this.currentUser.get("extra").img)},continueRender:function(){this.breadcrumb(),this.currentUser=this.collection.findWhere({user:this.username}),arangoHelper.buildUserSubNav(this.currentUser.get("user"),"General"),this.currentUser.get("loggedIn")?this.editCurrentUser():this.createEditUserModal(this.currentUser.get("user"),this.currentUser.get("extra").name,this.currentUser.get("active"))},createEditUserPasswordModal:function(){var a=[],b=[];b.push(window.modalView.createPasswordEntry("newCurrentPassword","New Password","",!1,"new password",!1)),b.push(window.modalView.createPasswordEntry("confirmCurrentPassword","Confirm New Password","",!1,"confirm new password",!1)),a.push(window.modalView.createSuccessButton("Save",this.submitEditUserPassword.bind(this))),window.modalView.show("modalTable.ejs","Edit User Password",a,b)},createEditCurrentUserModal:function(a,b,c){var d=[],e=[];e.push(window.modalView.createReadOnlyEntry("id_username","Username",a)),e.push(window.modalView.createTextEntry("editCurrentName","Name",b,!1,"Name",!1)),e.push(window.modalView.createTextEntry("editCurrentUserProfileImg","Gravatar account (Mail)",c,"Mailaddress or its md5 representation of your gravatar account.The address will be converted into a md5 string. Only the md5 string will be stored, not the mailaddress.","myAccount(at)gravatar.com")),d.push(window.modalView.createNotificationButton("Change Password",this.editUserPassword.bind(this))),d.push(window.modalView.createSuccessButton("Save",this.submitEditCurrentUserProfile.bind(this))),window.modalView.show("modalTable.ejs","Edit User Profile",d,e,null,null,this.events,null,null,"content")},parseImgString:function(a){return-1===a.indexOf("@")?a:CryptoJS.MD5(a).toString()},createEditUserModal:function(a,b,c){var d,e;e=[{type:window.modalView.tables.READONLY,label:"Username",value:_.escape(a)},{type:window.modalView.tables.TEXT,label:"Name",value:b,id:"editName",placeholder:"Name"},{type:window.modalView.tables.CHECKBOX,label:"Active",value:"active",checked:c,id:"editStatus"}],d=[{title:"Delete",type:window.modalView.buttons.DELETE,callback:this.submitDeleteUser.bind(this,a)},{title:"Change Password",type:window.modalView.buttons.NOTIFICATION,callback:this.createEditUserPasswordModal.bind(this,a)},{title:"Save",type:window.modalView.buttons.SUCCESS,callback:this.submitEditUser.bind(this,a)}],window.modalView.show("modalTable.ejs","Edit User",d,e,null,null,this.events,null,null,"content")},validateStatus:function(a){return""!==a},submitDeleteUser:function(a){var b=this.collection.findWhere({user:a});b.destroy({wait:!0}),window.App.navigate("#users",{trigger:!0})},submitEditCurrentUserProfile:function(){var a=$("#editCurrentName").val(),b=$("#editCurrentUserProfileImg").val();b=this.parseImgString(b);var c=function(a){a?arangoHelper.arangoError("User","Could not edit user settings"):(arangoHelper.arangoNotification("User","Changes confirmed."),this.updateUserProfile())}.bind(this);this.currentUser.setExtras(a,b,c),window.modalView.hide()},submitEditUserPassword:function(){var a=$("#newCurrentPassword").val(),b=$("#confirmCurrentPassword").val();$("#newCurrentPassword").val(""),$("#confirmCurrentPassword").val(""),$("#newCurrentPassword").closest("th").css("backgroundColor","white"),$("#confirmCurrentPassword").closest("th").css("backgroundColor","white");var c=!1;a!==b&&(arangoHelper.arangoError("User","New passwords do not match."),c=!0),c||(this.currentUser.setPassword(a),arangoHelper.arangoNotification("User","Password changed."),window.modalView.hide())},validateUsername:function(a){return""===a?(arangoHelper.arangoError("You have to define an username"),$("#newUsername").closest("th").css("backgroundColor","red"),!1):a.match(/^[a-zA-Z][a-zA-Z0-9_\-]*$/)?!0:(arangoHelper.arangoError("Wrong Username","Username may only contain numbers, letters, _ and -"),!1)},editUserPassword:function(){window.modalView.hide(),this.createEditUserPasswordModal()},validateName:function(a){return""===a?!0:a.match(/^[a-zA-Z][a-zA-Z0-9_\-\ ]*$/)?!0:(arangoHelper.arangoError("Wrong Username","Username may only contain numbers, letters, _ and -"),!1)},submitEditUser:function(a){var b=$("#editName").val(),c=$("#editStatus").is(":checked");if(!this.validateStatus(c))return void $("#editStatus").closest("th").css("backgroundColor","red");if(!this.validateName(b))return void $("#editName").closest("th").css("backgroundColor","red");var d=this.collection.findWhere({user:a});d.save({extra:{name:b},active:c},{type:"PATCH",success:function(){arangoHelper.arangoNotification("User",d.get("user")+" updated.")},error:function(){arangoHelper.arangoError("User","Could not update "+d.get("user")+".")}})},breadcrumb:function(){$("#subNavigationBar .breadcrumb").html("User: "+this.username)}})}(),function(){"use strict";window.WorkMonitorView=Backbone.View.extend({el:"#content",id:"#workMonitorContent",template:templateEngine.createTemplate("workMonitorView.ejs"),table:templateEngine.createTemplate("arangoTable.ejs"),initialize:function(){},events:{},tableDescription:{id:"workMonitorTable",titles:["Type","Database","Task ID","Started","Url","User","Description","Method"],rows:[],unescaped:[!1,!1,!1,!1,!1,!1,!1,!1]},render:function(){var a=this;this.$el.html(this.template.render({})),this.collection.fetch({success:function(){a.parseTableData(),$(a.id).append(a.table.render({content:a.tableDescription}))}})},parseTableData:function(){var a=this;this.collection.each(function(b){if("AQL query"===b.get("type")){var c=b.get("parent");if(c)try{a.tableDescription.rows.push([b.get("type"),"(p) "+c.database,"(p) "+c.taskId,"(p) "+c.startTime,"(p) "+c.url,"(p) "+c.user,b.get("description"),"(p) "+c.method])}catch(d){console.log("some parse error")}}else"thread"!==b.get("type")&&a.tableDescription.rows.push([b.get("type"),b.get("database"),b.get("taskId"),b.get("startTime"),b.get("url"),b.get("user"),b.get("description"),b.get("method")])})}})}(),function(){"use strict";window.Router=Backbone.Router.extend({toUpdate:[],dbServers:[],isCluster:void 0,routes:{"":"cluster",dashboard:"dashboard",collections:"collections","new":"newCollection",login:"login","collection/:colid/documents/:pageid":"documents","cIndices/:colname":"cIndices","cSettings/:colname":"cSettings","cInfo/:colname":"cInfo","collection/:colid/:docid":"document",shell:"shell",queries:"query",workMonitor:"workMonitor",databases:"databases",settings:"databases",services:"applications","service/:mount":"applicationDetail",graphs:"graphManagement","graphs/:name":"showGraph",users:"userManagement","user/:name":"userView","user/:name/permission":"userPermissionView",userProfile:"userProfile",cluster:"cluster",nodes:"nodes",shards:"shards","node/:name":"node",logs:"logs",helpus:"helpUs","graph2/:name":"graph2","graph2/:name/settings":"graph2settings",support:"support"},execute:function(a,b){$("#subNavigationBar .breadcrumb").html(""),$("#subNavigationBar .bottom").html(""),$("#loadingScreen").hide(),$("#content").show(),a&&a.apply(this,b),this.graphViewer2&&this.graphViewer2.graphSettingsView&&this.graphViewer2.graphSettingsView.hide()},listenerFunctions:{},listener:function(a){_.each(window.App.listenerFunctions,function(b,c){b(a)})},checkUser:function(){var a=this;if("#login"!==window.location.hash){var b=function(){this.initOnce(),$(".bodyWrapper").show(),$(".navbar").show()}.bind(this),c=function(c,d){frontendConfig.authenticationEnabled?(a.currentUser=d,c||null===d?"#login"!==window.location.hash&&this.navigate("login",{trigger:!0}):b()):b()}.bind(this);frontendConfig.authenticationEnabled?this.userCollection.whoAmI(c):(this.initOnce(),$(".bodyWrapper").show(),$(".navbar").show())}},waitForInit:function(a,b,c){this.initFinished?(b||a(!0),b&&!c&&a(b,!0),b&&c&&a(b,c,!0)):setTimeout(function(){b||a(!1),b&&!c&&a(b,!1),b&&c&&a(b,c,!1)},350)},initFinished:!1,initialize:function(){frontendConfig.isCluster===!0&&(this.isCluster=!0),document.addEventListener("keyup",this.listener,!1),window.modalView=new window.ModalView,this.foxxList=new window.FoxxCollection,window.foxxInstallView=new window.FoxxInstallView({collection:this.foxxList}),window.progressView=new window.ProgressView;var a=this;this.userCollection=new window.ArangoUsers,this.initOnce=function(){this.initOnce=function(){};var b=function(b,c){a=this,c===!0&&a.coordinatorCollection.fetch({success:function(){a.fetchDBS()}}),b&&console.log(b)}.bind(this);window.isCoordinator(b),frontendConfig.isCluster===!1&&(this.initFinished=!0),this.arangoDatabase=new window.ArangoDatabase,this.currentDB=new window.CurrentDatabase,this.arangoCollectionsStore=new window.ArangoCollections,this.arangoDocumentStore=new window.ArangoDocument,this.coordinatorCollection=new window.ClusterCoordinators,arangoHelper.setDocumentStore(this.arangoDocumentStore),this.arangoCollectionsStore.fetch({cache:!1}),window.spotlightView=new window.SpotlightView({collection:this.arangoCollectionsStore}),this.footerView=new window.FooterView({collection:a.coordinatorCollection}),this.notificationList=new window.NotificationCollection,this.currentDB.fetch({cache:!1,success:function(){a.naviView=new window.NavigationView({database:a.arangoDatabase,currentDB:a.currentDB,notificationCollection:a.notificationList,userCollection:a.userCollection,isCluster:a.isCluster}),a.naviView.render()}}),this.queryCollection=new window.ArangoQueries,this.footerView.render(),window.checkVersion(),this.userConfig=new window.UserConfig,this.userConfig.fetch(),this.documentsView=new window.DocumentsView({collection:new window.ArangoDocuments,documentStore:this.arangoDocumentStore,collectionsStore:this.arangoCollectionsStore})}.bind(this),$(window).resize(function(){a.handleResize()}),$(window).scroll(function(){})},handleScroll:function(){$(window).scrollTop()>50?($(".navbar > .secondary").css("top",$(window).scrollTop()),$(".navbar > .secondary").css("position","absolute"),$(".navbar > .secondary").css("z-index","10"),$(".navbar > .secondary").css("width",$(window).width())):($(".navbar > .secondary").css("top","0"),$(".navbar > .secondary").css("position","relative"),$(".navbar > .secondary").css("width",""))},cluster:function(a){return this.checkUser(),a?this.isCluster===!1||void 0===this.isCluster?void("_system"===this.currentDB.get("name")?(this.routes[""]="dashboard",this.navigate("#dashboard",{trigger:!0})):(this.routes[""]="collections",this.navigate("#collections",{trigger:!0}))):(this.clusterView||(this.clusterView=new window.ClusterView({coordinators:this.coordinatorCollection,dbServers:this.dbServers})),void this.clusterView.render()):void this.waitForInit(this.cluster.bind(this))},node:function(a,b){return this.checkUser(),b&&void 0!==this.isCluster?this.isCluster===!1?(this.routes[""]="dashboard",void this.navigate("#dashboard",{trigger:!0})):(this.nodeView||(this.nodeView=new window.NodeView({coordname:a,coordinators:this.coordinatorCollection,dbServers:this.dbServers})),void this.nodeView.render()):void this.waitForInit(this.node.bind(this),a)},shards:function(a){return this.checkUser(),a&&void 0!==this.isCluster?this.isCluster===!1?(this.routes[""]="dashboard",void this.navigate("#dashboard",{trigger:!0})):(this.shardsView||(this.shardsView=new window.ShardsView({dbServers:this.dbServers})),void this.shardsView.render()):void this.waitForInit(this.shards.bind(this))},nodes:function(a){return this.checkUser(),a&&void 0!==this.isCluster?this.isCluster===!1?(this.routes[""]="dashboard",void this.navigate("#dashboard",{trigger:!0})):(this.nodesView=new window.NodesView2({}),void this.nodesView.render()):void this.waitForInit(this.nodes.bind(this))},cNodes:function(a){return this.checkUser(),a&&void 0!==this.isCluster?this.isCluster===!1?(this.routes[""]="dashboard",void this.navigate("#dashboard",{trigger:!0})):(this.nodesView=new window.NodesView({coordinators:this.coordinatorCollection,dbServers:this.dbServers[0],toRender:"coordinator"}),void this.nodesView.render()):void this.waitForInit(this.cNodes.bind(this))},dNodes:function(a){return this.checkUser(),a&&void 0!==this.isCluster?this.isCluster===!1?(this.routes[""]="dashboard",void this.navigate("#dashboard",{trigger:!0})):0===this.dbServers.length?void this.navigate("#cNodes",{trigger:!0}):(this.nodesView=new window.NodesView({coordinators:this.coordinatorCollection,dbServers:this.dbServers[0],toRender:"dbserver"}),void this.nodesView.render()):void this.waitForInit(this.dNodes.bind(this))},sNodes:function(a){return this.checkUser(),a&&void 0!==this.isCluster?this.isCluster===!1?(this.routes[""]="dashboard",void this.navigate("#dashboard",{trigger:!0})):(this.scaleView=new window.ScaleView({coordinators:this.coordinatorCollection,dbServers:this.dbServers[0]}),void this.scaleView.render()):void this.waitForInit(this.sNodes.bind(this))},addAuth:function(a){var b=this.clusterPlan.get("user");if(!b)return a.abort(),void(this.isCheckingUser||this.requestAuth());var c=b.name,d=b.passwd,e=c.concat(":",d);a.setRequestHeader("Authorization","Basic "+btoa(e))},logs:function(a,b){if(this.checkUser(),!b)return void this.waitForInit(this.logs.bind(this),a);if(!this.logsView){var c=new window.ArangoLogs({upto:!0,loglevel:4}),d=new window.ArangoLogs({loglevel:4}),e=new window.ArangoLogs({loglevel:3}),f=new window.ArangoLogs({loglevel:2}),g=new window.ArangoLogs({loglevel:1});this.logsView=new window.LogsView({logall:c,logdebug:d,loginfo:e,logwarning:f,logerror:g})}this.logsView.render()},applicationDetail:function(a,b){if(this.checkUser(),!b)return void this.waitForInit(this.applicationDetail.bind(this),a);var c=function(){this.hasOwnProperty("applicationDetailView")||(this.applicationDetailView=new window.ApplicationDetailView({model:this.foxxList.get(decodeURIComponent(a))})),this.applicationDetailView.model=this.foxxList.get(decodeURIComponent(a)),this.applicationDetailView.render("swagger")}.bind(this);0===this.foxxList.length?this.foxxList.fetch({cache:!1,success:function(){c()}}):c()},login:function(){var a=function(a,b){this.loginView||(this.loginView=new window.LoginView({collection:this.userCollection})),a||null===b?this.loginView.render():this.loginView.render(!0)}.bind(this);this.userCollection.whoAmI(a)},collections:function(a){if(this.checkUser(),!a)return void this.waitForInit(this.collections.bind(this));var b=this;this.collectionsView||(this.collectionsView=new window.CollectionsView({collection:this.arangoCollectionsStore})),this.arangoCollectionsStore.fetch({cache:!1,success:function(){b.collectionsView.render()}})},cIndices:function(a,b){var c=this;return this.checkUser(),b?void this.arangoCollectionsStore.fetch({cache:!1,success:function(){c.indicesView=new window.IndicesView({collectionName:a,collection:c.arangoCollectionsStore.findWhere({name:a})}),c.indicesView.render()}}):void this.waitForInit(this.cIndices.bind(this),a)},cSettings:function(a,b){var c=this;return this.checkUser(),b?void this.arangoCollectionsStore.fetch({cache:!1,success:function(){c.settingsView=new window.SettingsView({collectionName:a,collection:c.arangoCollectionsStore.findWhere({name:a})}),c.settingsView.render()}}):void this.waitForInit(this.cSettings.bind(this),a)},cInfo:function(a,b){var c=this;return this.checkUser(),b?void this.arangoCollectionsStore.fetch({cache:!1,success:function(){c.infoView=new window.InfoView({collectionName:a,collection:c.arangoCollectionsStore.findWhere({name:a})}),c.infoView.render()}}):void this.waitForInit(this.cInfo.bind(this),a)},documents:function(a,b,c){return this.checkUser(),c?(this.documentsView||(this.documentsView=new window.DocumentsView({collection:new window.ArangoDocuments,documentStore:this.arangoDocumentStore,collectionsStore:this.arangoCollectionsStore})),this.documentsView.setCollectionId(a,b),void this.documentsView.render()):void this.waitForInit(this.documents.bind(this),a,b)},document:function(a,b,c){if(this.checkUser(),!c)return void this.waitForInit(this.document.bind(this),a,b);this.documentView||(this.documentView=new window.DocumentView({collection:this.arangoDocumentStore})),this.documentView.colid=a;var d=window.location.hash.split("/")[2],e=(d.split("%").length-1)%3;decodeURI(d)!==d&&0!==e&&(d=decodeURIComponent(d)),this.documentView.docid=d,this.documentView.render();var f=function(a,b){a?console.log("Error","Could not fetch collection type"):this.documentView.setType(b)}.bind(this);arangoHelper.collectionApiType(a,null,f)},query:function(a){return this.checkUser(),a?(this.queryView||(this.queryView=new window.QueryView({collection:this.queryCollection})),void this.queryView.render()):void this.waitForInit(this.query.bind(this))},graph2:function(a,b){return this.checkUser(),b?(this.graphViewer2&&(this.graphViewer2.graphSettingsView&&this.graphViewer2.graphSettingsView.remove(),this.graphViewer2.remove()),this.graphViewer2=new window.GraphViewer2({name:a,documentStore:this.arangoDocumentStore,collection:new window.GraphCollection,userConfig:this.userConfig}),void this.graphViewer2.render()):void this.waitForInit(this.graph2.bind(this),a)},graph2settings:function(a,b){return this.checkUser(),b?(this.graphSettingsView&&this.graphSettingsView.remove(),this.graphSettingsView=new window.GraphSettingsView({name:a,userConfig:this.userConfig}),void this.graphSettingsView.render()):void this.waitForInit(this.graph2settings.bind(this),a)},helpUs:function(a){return this.checkUser(),a?(this.testView||(this.helpUsView=new window.HelpUsView({})),void this.helpUsView.render()):void this.waitForInit(this.helpUs.bind(this))},support:function(a){return this.checkUser(),a?(this.testView||(this.supportView=new window.SupportView({})),void this.supportView.render()):void this.waitForInit(this.support.bind(this))},workMonitor:function(a){return this.checkUser(),a?(this.workMonitorCollection||(this.workMonitorCollection=new window.WorkMonitorCollection),this.workMonitorView||(this.workMonitorView=new window.WorkMonitorView({collection:this.workMonitorCollection})),void this.workMonitorView.render()):void this.waitForInit(this.workMonitor.bind(this))},queryManagement:function(a){return this.checkUser(),a?(this.queryManagementView||(this.queryManagementView=new window.QueryManagementView({collection:void 0})),void this.queryManagementView.render()):void this.waitForInit(this.queryManagement.bind(this))},databases:function(a){if(this.checkUser(),!a)return void this.waitForInit(this.databases.bind(this));var b=function(a){a?(arangoHelper.arangoError("DB","Could not get list of allowed databases"),this.navigate("#",{trigger:!0}),$("#databaseNavi").css("display","none"),$("#databaseNaviSelect").css("display","none")):(this.databaseView||(this.databaseView=new window.DatabaseView({users:this.userCollection,collection:this.arangoDatabase})),this.databaseView.render())}.bind(this);arangoHelper.databaseAllowed(b)},dashboard:function(a){return this.checkUser(),a?(void 0===this.dashboardView&&(this.dashboardView=new window.DashboardView({dygraphConfig:window.dygraphConfig,database:this.arangoDatabase})),void this.dashboardView.render()):void this.waitForInit(this.dashboard.bind(this))},graphManagement:function(a){return this.checkUser(),a?(this.graphManagementView||(this.graphManagementView=new window.GraphManagementView({collection:new window.GraphCollection,collectionCollection:this.arangoCollectionsStore})),void this.graphManagementView.render()):void this.waitForInit(this.graphManagement.bind(this))},showGraph:function(a,b){return this.checkUser(),b?void(this.graphManagementView?this.graphManagementView.loadGraphViewer(a):(this.graphManagementView=new window.GraphManagementView({collection:new window.GraphCollection,collectionCollection:this.arangoCollectionsStore}),this.graphManagementView.render(a,!0))):void this.waitForInit(this.showGraph.bind(this),a)},applications:function(a){return this.checkUser(),a?(void 0===this.applicationsView&&(this.applicationsView=new window.ApplicationsView({collection:this.foxxList})),void this.applicationsView.reload()):void this.waitForInit(this.applications.bind(this))},handleSelectDatabase:function(a){return this.checkUser(),a?void this.naviView.handleSelectDatabase():void this.waitForInit(this.handleSelectDatabase.bind(this))},handleResize:function(){this.dashboardView&&this.dashboardView.resize(),this.graphManagementView&&this.graphManagementView.handleResize($("#content").width()),this.queryView&&this.queryView.resize(),this.naviView&&this.naviView.resize(),this.graphViewer2&&this.graphViewer2.resize(),this.documentsView&&this.documentsView.resize(),this.documentView&&this.documentView.resize()},userPermissionView:function(a,b){if(this.checkUser(),b||null===b)this.userPermissionView=new window.UserPermissionView({collection:this.userCollection,databases:this.arangoDatabase,username:a}),this.userPermissionView.render();else if(b===!1)return void this.waitForInit(this.userPermissionView.bind(this),a)},userView:function(a,b){this.checkUser(),b||null===b?(this.userView=new window.UserView({collection:this.userCollection,username:a}),this.userView.render()):b===!1&&this.waitForInit(this.userView.bind(this),a)},userManagement:function(a){return this.checkUser(),a?(this.userManagementView||(this.userManagementView=new window.UserManagementView({collection:this.userCollection})),void this.userManagementView.render()):void this.waitForInit(this.userManagement.bind(this))},userProfile:function(a){return this.checkUser(),a?(this.userManagementView||(this.userManagementView=new window.UserManagementView({collection:this.userCollection})),void this.userManagementView.render(!0)):void this.waitForInit(this.userProfile.bind(this))},fetchDBS:function(a){var b=this,c=!1;this.coordinatorCollection.each(function(a){b.dbServers.push(new window.ClusterServers([],{host:a.get("address")}))}),this.initFinished=!0,_.each(this.dbServers,function(b){b.fetch({success:function(){c===!1&&a&&(a(),c=!0)}})})},getNewRoute:function(a){return"http://"+a},registerForUpdate:function(a){this.toUpdate.push(a),a.updateUrl()}})}(),function(){"use strict";var a=function(a,b){var c=[];c.push(window.modalView.createSuccessButton("Download Page",function(){window.open("https://www.arangodb.com/download","_blank"),window.modalView.hide()}));var d=[],e=window.modalView.createReadOnlyEntry.bind(window.modalView);d.push(e("current","Current",a.toString())),b.major&&d.push(e("major","Major",b.major.version)),b.minor&&d.push(e("minor","Minor",b.minor.version)),b.bugfix&&d.push(e("bugfix","Bugfix",b.bugfix.version)),window.modalView.show("modalTable.ejs","New Version Available",c,d)};window.checkVersion=function(){$.ajax({type:"GET",cache:!1,url:arangoHelper.databaseUrl("/_api/version"),contentType:"application/json",processData:!1,async:!0,success:function(b){var c=window.versionHelper.fromString(b.version);$(".navbar #currentVersion").html(" "+b.version.substr(0,5)+''),window.parseVersions=function(b){return _.isEmpty(b)?void $("#currentVersion").addClass("up-to-date"):($("#currentVersion").addClass("out-of-date"),void $("#currentVersion").click(function(){a(c,b)}))},$.ajax({type:"GET",async:!0,crossDomain:!0,timeout:3e3,dataType:"jsonp",url:"https://www.arangodb.com/repositories/versions.php?jsonp=parseVersions&version="+encodeURIComponent(c.toString())})}})}}(),function(){"use strict";window.hasOwnProperty("TEST_BUILD")||($(document).ajaxSend(function(a,b,c){var d=window.arangoHelper.getCurrentJwt();d&&b.setRequestHeader("Authorization","bearer "+d)}),$(document).ready(function(){window.App=new window.Router,Backbone.history.start(),window.App.handleResize()}),$(document).click(function(a){a.stopPropagation(),$(a.target).hasClass("subBarDropdown")||$(a.target).hasClass("dropdown-header")||$(a.target).hasClass("dropdown-footer")||$(a.target).hasClass("toggle")||$("#userInfo").is(":visible")&&$(".subBarDropdown").hide()}))}(); \ No newline at end of file diff --git a/js/apps/system/_admin/aardvark/APP/frontend/build/app.min.js.gz b/js/apps/system/_admin/aardvark/APP/frontend/build/app.min.js.gz index 00c1ba548d..7d50fb7d05 100644 Binary files a/js/apps/system/_admin/aardvark/APP/frontend/build/app.min.js.gz and b/js/apps/system/_admin/aardvark/APP/frontend/build/app.min.js.gz differ diff --git a/js/apps/system/_admin/aardvark/APP/frontend/build/index-min.html b/js/apps/system/_admin/aardvark/APP/frontend/build/index-min.html index d81a830ff7..2d7db548eb 100644 --- a/js/apps/system/_admin/aardvark/APP/frontend/build/index-min.html +++ b/js/apps/system/_admin/aardvark/APP/frontend/build/index-min.html @@ -669,7 +669,12 @@ if (list.length > 0) {
    -
    +
    + + + +
    +
    - - - - -
    + +
    @@ -1037,7 +1040,8 @@ if (list.length > 0) {
    <% _.each(specific, function(val, key) { %> <% if (val.type === 'divider') { %>
    <%=val.name%>
    <% } else { %>
    <%=val.name%>
    -
    <% var VALUE; %> <% if (val.value) { %> <% VALUE = val.value %> <% } else { %> <% VALUE = val.default %> <% } %> <% if (val.type === 'string') { %> <% } %> <% if (val.type === 'number') { %> <% } %> <% if (val.type === 'color') { %> <% } %> <% if (val.type === 'range') { %> <% } %> <% if (val.type === 'select') { %> <% } %>
    <% } %> <% }); %>
    +
    <% var VALUE; %> <% if (val.value) { %> <% VALUE = val.value %> <% } else { %> <% VALUE = val.default %> <% } %> <% if (val.type === 'string') { %> <% } %> <% if (val.type === 'number') { %> <% } %> <% if (val.type === 'color') { %> <% } %> <% if (val.type === 'range') { %> + <% } %> <% if (val.type === 'select') { %> <% } %>
    <% } %> <% }); %> @@ -2242,13 +2246,13 @@ if (list.length > 0) { Format: -

    JSON documents embedded into a list:

    -

    -

    [{

    -

    "name": "Query Name",

    -

    "value": "Query Definition",

    -

    "parameter": "Query Bind Parameter as Object"

    -

    }]

    +
    JSON documents embedded into a list:
    +
    +[{
    +  "name": "Query Name",
    +  "value": "Query Definition",
    +  "parameter": "Query Bind Parameter as Object"
    +}]
                 
               
               
    @@ -2395,14 +2399,14 @@ if (list.length > 0) {
       
    \ No newline at end of file +
    \ No newline at end of file diff --git a/js/apps/system/_admin/aardvark/APP/frontend/build/index-min.html.gz b/js/apps/system/_admin/aardvark/APP/frontend/build/index-min.html.gz index 5396ea6bc8..1dad1a7fe2 100644 Binary files a/js/apps/system/_admin/aardvark/APP/frontend/build/index-min.html.gz and b/js/apps/system/_admin/aardvark/APP/frontend/build/index-min.html.gz differ diff --git a/js/apps/system/_admin/aardvark/APP/frontend/build/style-minified.css b/js/apps/system/_admin/aardvark/APP/frontend/build/style-minified.css index 8cdbe3a1b7..26ac0d12e3 100644 --- a/js/apps/system/_admin/aardvark/APP/frontend/build/style-minified.css +++ b/js/apps/system/_admin/aardvark/APP/frontend/build/style-minified.css @@ -1,7 +1,7 @@ @charset "UTF-8";body,body .bodyWrapper,html{height:100%}#arangoQueryManagementTable .table-cell1,#queryManagementContent .table-cell1,.log-content{word-break:break-all}#documentsTableID_filter,#documentsTableID_length,#documentsTableID_paginate,#documentsTableID_wrapper .fg-toolbar,.fixedDropdown:after,.jsoneditor .outer .tree>table>tbody>tr:first-of-type{visibility:hidden}body{background:rgba(64,74,83,.04);color:#333;display:block;font-size:14px;line-height:20px;margin:0;overflow:hidden}.fa,.fa-stack{display:inline-block}.fa.fa-pull-left,.fa.pull-left{margin-right:.3em}body .bodyWrapper{left:150px;min-height:100%;position:absolute;right:0}body .centralRow{position:relative}body .loadingScreen{background-color:#fff;bottom:0;left:0;padding-top:100px;position:absolute;right:0;top:102px;z-index:100}body .loadingScreen span{display:inline-block;margin-top:10px;text-align:center;width:100%}body .loadingScreen i{width:100%}body #offlinePlaceholder{background:rgba(64,74,83,.8);height:100%;left:0;position:fixed;top:0;width:100%;z-index:9999}body #offlinePlaceholder .offline-div{overflow:auto;position:fixed;top:20%;width:100%;z-index:1050}body #offlinePlaceholder .offline-div h3,body #offlinePlaceholder .offline-div p{font-weight:300}body #offlinePlaceholder .offline-div .pure-u{width:100%}body #offlinePlaceholder .offline-div .offline-window{background:#fff;border-radius:3px}body #offlinePlaceholder .offline-div .offline-window .offline-header{padding-top:10px;text-align:center}body #offlinePlaceholder .offline-div .offline-window .offline-body{padding-bottom:20px;padding-top:0}body #offlinePlaceholder .offline-div .offline-window .offline-body .animation_state{padding-top:20px}body #offlinePlaceholder .offline-div .offline-window .offline-body>p{margin-bottom:0;text-align:center}body #offlinePlaceholder .offline-div .offline-window .offline-body,body #offlinePlaceholder .offline-div .offline-window .offline-header{padding-left:20px;padding-right:20px}.page-title span,.pingback a.url,body,input,textarea{font-weight:400}@font-face{font-family:'Open Sans';font-style:normal;font-weight:300;src:local("Open Sans Light"),local("OpenSans-Light"),url(../fonts/opensans/OpenSansLight.woff) format("woff")}@font-face{font-family:'Open Sans';font-style:normal;font-weight:400;src:local("Open Sans"),local("OpenSans"),url(../fonts/opensans/OpenSans.woff) format("woff")}@font-face{font-family:'Open Sans';font-style:normal;font-weight:700;src:local("Open Sans Bold"),local("OpenSans-Bold"),url(../fonts/opensans/OpenSansBold.woff) format("woff")}@font-face{font-family:'Open Sans';font-style:italic;font-weight:300;src:local("Open Sans Light Italic"),local("OpenSansLight-Italic"),url(../fonts/opensans/OpenSansLightItalic.woff) format("woff")}@font-face{font-family:'Open Sans';font-style:italic;font-weight:400;src:local("Open Sans Italic"),local("OpenSans-Italic"),url(../fonts/opensans/OpenSansItalic.woff) format("woff")}@font-face{font-family:'Open Sans';font-style:italic;font-weight:700;src:local("Open Sans Bold Italic"),local("OpenSans-BoldItalic"),url(../fonts/opensans/OpenSansBoldItalic.woff) format("woff")}/*! * Font Awesome 4.4.0 by @davegandy - http://fontawesome.io - @fontawesome * License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License) - */@font-face{font-family:FontAwesome;src:url(../fonts/fontawesome/fontawesome-webfont.eot?v=4.4.0);src:url(../fonts/fontawesome/fontawesome-webfont.eot?#iefix&v=4.4.0) format("embedded-opentype"),url(../fonts/fontawesome/fontawesome-webfont.woff2?v=4.4.0) format("woff2"),url(../fonts/fontawesome/fontawesome-webfont.woff?v=4.4.0) format("woff"),url(../fonts/fontawesome/fontawesome-webfont.ttf?v=4.4.0) format("truetype"),url(../fonts/fontawesome/fontawesome-webfont.svg?v=4.4.0#fontawesomeregular) format("svg");font-weight:400;font-style:normal}.fa{font:normal normal normal 14px/1 FontAwesome;font-size:inherit;text-rendering:auto;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.fa-lg{font-size:1.3333333333em;line-height:.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.2857142857em;text-align:center}.fa-ul{padding-left:0;margin-left:2.1428571429em;list-style-type:none}.fa.fa-pull-right,.fa.pull-right{margin-left:.3em}.fa-ul>li{position:relative}.fa-li{position:absolute;left:-2.1428571429em;width:2.1428571429em;top:.1428571429em;text-align:center}.fa-li.fa-lg{left:-1.8571428571em}.fa-border{padding:.2em .25em .15em;border:.08em solid #eee;border-radius:.1em}.fa-pull-left{float:left}.fa-pull-right,.pull-right{float:right}.contentDiv li,.dashboard-bar-chart-container,.dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-chart,.dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-title,.dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-title .absolut,.dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-title .percentage,.dashboard-full-width-chart,.dashboard-full-width-chart .dashboard-full-width-chart-inner,.dashboard-full-width-chart .dashboard-full-width-chart-inner .dashboard-interior-chart,.dashboard-half-height-legend,.dashboard-large-chart,.dashboard-large-chart .dashboard-large-chart-inner,.dashboard-large-chart .dashboard-large-chart-inner .dashboard-interior-chart,.dashboard-medium-chart,.dashboard-medium-chart .dashboard-interior-chart,.dashboard-small-chart,.dashboard-small-chart .dashboard-small-chart-inner,.dashboard-small-chart .dashboard-small-chart-inner .dashboard-interior-chart,.dashboard-sub-bar,.dashboard-sub-bar .dashboard-sub-bar-title,.dashboard-tendency-container,.dashboard-tendency-container .dashboard-tendency-chart .dashboard-tendency,.dashboard-tendency-container .dashboard-tendency-chart .dashboard-tendency .dashboard-figure,.dashboard-tendency-container .dashboard-tendency-chart .dashboard-tendency .dashboard-subtitle-bar,.dashboard-title-bar .dashboard-half-title-bar,.dashboardModal,.dropdown-toolbar,.fixedDropdown .notificationItemContent,.gv-dropdown-menu,.innerDropdownInnerUL,.link-dropdown-menu,.modal-chart-detail,.modal-chart-detail .modal-body,.modal-chart-detail .modal-dashboard-legend,.modal-chart-detail .modal-inner-detail,.navlist li,.navlogo,.pagination-line li a,.pull-left,.script-dropdown-menu,.user-dropdown-menu,a.button-gui,a.headerButton,div .bigtile,div .bigtile a span.add-Icon,div .tile,div .tile a span.add-Icon,div.centralContent,div.dropdownInner ul,div.footer-center,div.footer-left{float:left}.fa-spin{-webkit-animation:fa-spin 2s infinite linear;animation:fa-spin 2s infinite linear}.fa-pulse{-webkit-animation:fa-spin 1s infinite steps(8);animation:fa-spin 1s infinite steps(8)}@-webkit-keyframes fa-spin{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}@keyframes fa-spin{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}.fa-rotate-90{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=1);-webkit-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg)}.fa-rotate-180{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=2);-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg)}.fa-rotate-270{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=3);-webkit-transform:rotate(270deg);-ms-transform:rotate(270deg);transform:rotate(270deg)}.fa-flip-horizontal{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=0);-webkit-transform:scale(-1,1);-ms-transform:scale(-1,1);transform:scale(-1,1)}.fa-flip-vertical{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=2);-webkit-transform:scale(1,-1);-ms-transform:scale(1,-1);transform:scale(1,-1)}:root .fa-flip-horizontal,:root .fa-flip-vertical,:root .fa-rotate-180,:root .fa-rotate-270,:root .fa-rotate-90{filter:none}.fa-stack{position:relative;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:#fff}.fa-glass:before{content:""}.fa-music:before{content:""}.fa-search:before{content:""}.fa-envelope-o:before{content:""}.fa-heart:before{content:""}.fa-star:before{content:""}.fa-star-o:before{content:""}.fa-user:before{content:""}.fa-film:before{content:""}.fa-th-large:before{content:""}.fa-th:before{content:""}.fa-th-list:before{content:""}.fa-check:before{content:""}.fa-close:before,.fa-remove:before,.fa-times:before{content:""}.fa-search-plus:before{content:""}.fa-search-minus:before{content:""}.fa-power-off:before{content:""}.fa-signal:before{content:""}.fa-cog:before,.fa-gear:before{content:""}.fa-trash-o:before{content:""}.fa-home:before{content:""}.fa-file-o:before{content:""}.fa-clock-o:before{content:""}.fa-road:before{content:""}.fa-download:before{content:""}.fa-arrow-circle-o-down:before{content:""}.fa-arrow-circle-o-up:before{content:""}.fa-inbox:before{content:""}.fa-play-circle-o:before{content:""}.fa-repeat:before,.fa-rotate-right:before{content:""}.fa-refresh:before{content:""}.fa-list-alt:before{content:""}.fa-lock:before{content:""}.fa-flag:before{content:""}.fa-headphones:before{content:""}.fa-volume-off:before{content:""}.fa-volume-down:before{content:""}.fa-volume-up:before{content:""}.fa-qrcode:before{content:""}.fa-barcode:before{content:""}.fa-tag:before{content:""}.fa-tags:before{content:""}.fa-book:before{content:""}.fa-bookmark:before{content:""}.fa-print:before{content:""}.fa-camera:before{content:""}.fa-font:before{content:""}.fa-bold:before{content:""}.fa-italic:before{content:""}.fa-text-height:before{content:""}.fa-text-width:before{content:""}.fa-align-left:before{content:""}.fa-align-center:before{content:""}.fa-align-right:before{content:""}.fa-align-justify:before{content:""}.fa-list:before{content:""}.fa-dedent:before,.fa-outdent:before{content:""}.fa-indent:before{content:""}.fa-video-camera:before{content:""}.fa-image:before,.fa-photo:before,.fa-picture-o:before{content:""}.fa-pencil:before{content:""}.fa-map-marker:before{content:""}.fa-adjust:before{content:""}.fa-tint:before{content:""}.fa-edit:before,.fa-pencil-square-o:before{content:""}.fa-share-square-o:before{content:""}.fa-check-square-o:before{content:""}.fa-arrows:before{content:""}.fa-step-backward:before{content:""}.fa-fast-backward:before{content:""}.fa-backward:before{content:""}.fa-play:before{content:""}.fa-pause:before{content:""}.fa-stop:before{content:""}.fa-forward:before{content:""}.fa-fast-forward:before{content:""}.fa-step-forward:before{content:""}.fa-eject:before{content:""}.fa-chevron-left:before{content:""}.fa-chevron-right:before{content:""}.fa-plus-circle:before{content:""}.fa-minus-circle:before{content:""}.fa-times-circle:before{content:""}.fa-check-circle:before{content:""}.fa-question-circle:before{content:""}.fa-info-circle:before{content:""}.fa-crosshairs:before{content:""}.fa-times-circle-o:before{content:""}.fa-check-circle-o:before{content:""}.fa-ban:before{content:""}.fa-arrow-left:before{content:""}.fa-arrow-right:before{content:""}.fa-arrow-up:before{content:""}.fa-arrow-down:before{content:""}.fa-mail-forward:before,.fa-share:before{content:""}.fa-expand:before{content:""}.fa-compress:before{content:""}.fa-plus:before{content:""}.fa-minus:before{content:""}.fa-asterisk:before{content:""}.fa-exclamation-circle:before{content:""}.fa-gift:before{content:""}.fa-leaf:before{content:""}.fa-fire:before{content:""}.fa-eye:before{content:""}.fa-eye-slash:before{content:""}.fa-exclamation-triangle:before,.fa-warning:before{content:""}.fa-plane:before{content:""}.fa-calendar:before{content:""}.fa-random:before{content:""}.fa-comment:before{content:""}.fa-magnet:before{content:""}.fa-chevron-up:before{content:""}.fa-chevron-down:before{content:""}.fa-retweet:before{content:""}.fa-shopping-cart:before{content:""}.fa-folder:before{content:""}.fa-folder-open:before{content:""}.fa-arrows-v:before{content:""}.fa-arrows-h:before{content:""}.fa-bar-chart-o:before,.fa-bar-chart:before{content:""}.fa-twitter-square:before{content:""}.fa-facebook-square:before{content:""}.fa-camera-retro:before{content:""}.fa-key:before{content:""}.fa-cogs:before,.fa-gears:before{content:""}.fa-comments:before{content:""}.fa-thumbs-o-up:before{content:""}.fa-thumbs-o-down:before{content:""}.fa-star-half:before{content:""}.fa-heart-o:before{content:""}.fa-sign-out:before{content:""}.fa-linkedin-square:before{content:""}.fa-thumb-tack:before{content:""}.fa-external-link:before{content:""}.fa-sign-in:before{content:""}.fa-trophy:before{content:""}.fa-github-square:before{content:""}.fa-upload:before{content:""}.fa-lemon-o:before{content:""}.fa-phone:before{content:""}.fa-square-o:before{content:""}.fa-bookmark-o:before{content:""}.fa-phone-square:before{content:""}.fa-twitter:before{content:""}.fa-facebook-f:before,.fa-facebook:before{content:""}.fa-github:before{content:""}.fa-unlock:before{content:""}.fa-credit-card:before{content:""}.fa-feed:before,.fa-rss:before{content:""}.fa-hdd-o:before{content:""}.fa-bullhorn:before{content:""}.fa-bell:before{content:""}.fa-certificate:before{content:""}.fa-hand-o-right:before{content:""}.fa-hand-o-left:before{content:""}.fa-hand-o-up:before{content:""}.fa-hand-o-down:before{content:""}.fa-arrow-circle-left:before{content:""}.fa-arrow-circle-right:before{content:""}.fa-arrow-circle-up:before{content:""}.fa-arrow-circle-down:before{content:""}.fa-globe:before{content:""}.fa-wrench:before{content:""}.fa-tasks:before{content:""}.fa-filter:before{content:""}.fa-briefcase:before{content:""}.fa-arrows-alt:before{content:""}.fa-group:before,.fa-users:before{content:""}.fa-chain:before,.fa-link:before{content:""}.fa-cloud:before{content:""}.fa-flask:before{content:""}.fa-cut:before,.fa-scissors:before{content:""}.fa-copy:before,.fa-files-o:before{content:""}.fa-paperclip:before{content:""}.fa-floppy-o:before,.fa-save:before{content:""}.fa-square:before{content:""}.fa-bars:before,.fa-navicon:before,.fa-reorder:before{content:""}.fa-list-ul:before{content:""}.fa-list-ol:before{content:""}.fa-strikethrough:before{content:""}.fa-underline:before{content:""}.fa-table:before{content:""}.fa-magic:before{content:""}.fa-truck:before{content:""}.fa-pinterest:before{content:""}.fa-pinterest-square:before{content:""}.fa-google-plus-square:before{content:""}.fa-google-plus:before{content:""}.fa-money:before{content:""}.fa-caret-down:before{content:""}.fa-caret-up:before{content:""}.fa-caret-left:before{content:""}.fa-caret-right:before{content:""}.fa-columns:before{content:""}.fa-sort:before,.fa-unsorted:before{content:""}.fa-sort-desc:before,.fa-sort-down:before{content:""}.fa-sort-asc:before,.fa-sort-up:before{content:""}.fa-envelope:before{content:""}.fa-linkedin:before{content:""}.fa-rotate-left:before,.fa-undo:before{content:""}.fa-gavel:before,.fa-legal:before{content:""}.fa-dashboard:before,.fa-tachometer:before{content:""}.fa-comment-o:before{content:""}.fa-comments-o:before{content:""}.fa-bolt:before,.fa-flash:before{content:""}.fa-sitemap:before{content:""}.fa-umbrella:before{content:""}.fa-clipboard:before,.fa-paste:before{content:""}.fa-lightbulb-o:before{content:""}.fa-exchange:before{content:""}.fa-cloud-download:before{content:""}.fa-cloud-upload:before{content:""}.fa-user-md:before{content:""}.fa-stethoscope:before{content:""}.fa-suitcase:before{content:""}.fa-bell-o:before{content:""}.fa-coffee:before{content:""}.fa-cutlery:before{content:""}.fa-file-text-o:before{content:""}.fa-building-o:before{content:""}.fa-hospital-o:before{content:""}.fa-ambulance:before{content:""}.fa-medkit:before{content:""}.fa-fighter-jet:before{content:""}.fa-beer:before{content:""}.fa-h-square:before{content:""}.fa-plus-square:before{content:""}.fa-angle-double-left:before{content:""}.fa-angle-double-right:before{content:""}.fa-angle-double-up:before{content:""}.fa-angle-double-down:before{content:""}.fa-angle-left:before{content:""}.fa-angle-right:before{content:""}.fa-angle-up:before{content:""}.fa-angle-down:before{content:""}.fa-desktop:before{content:""}.fa-laptop:before{content:""}.fa-tablet:before{content:""}.fa-mobile-phone:before,.fa-mobile:before{content:""}.fa-circle-o:before{content:""}.fa-quote-left:before{content:""}.fa-quote-right:before{content:""}.fa-spinner:before{content:""}.fa-circle:before{content:""}.fa-mail-reply:before,.fa-reply:before{content:""}.fa-github-alt:before{content:""}.fa-folder-o:before{content:""}.fa-folder-open-o:before{content:""}.fa-smile-o:before{content:""}.fa-frown-o:before{content:""}.fa-meh-o:before{content:""}.fa-gamepad:before{content:""}.fa-keyboard-o:before{content:""}.fa-flag-o:before{content:""}.fa-flag-checkered:before{content:""}.fa-terminal:before{content:""}.fa-code:before{content:""}.fa-mail-reply-all:before,.fa-reply-all:before{content:""}.fa-star-half-empty:before,.fa-star-half-full:before,.fa-star-half-o:before{content:""}.fa-location-arrow:before{content:""}.fa-crop:before{content:""}.fa-code-fork:before{content:""}.fa-chain-broken:before,.fa-unlink:before{content:""}.fa-question:before{content:""}.fa-info:before{content:""}.fa-exclamation:before{content:""}.fa-superscript:before{content:""}.fa-subscript:before{content:""}.fa-eraser:before{content:""}.fa-puzzle-piece:before{content:""}.fa-microphone:before{content:""}.fa-microphone-slash:before{content:""}.fa-shield:before{content:""}.fa-calendar-o:before{content:""}.fa-fire-extinguisher:before{content:""}.fa-rocket:before{content:""}.fa-maxcdn:before{content:""}.fa-chevron-circle-left:before{content:""}.fa-chevron-circle-right:before{content:""}.fa-chevron-circle-up:before{content:""}.fa-chevron-circle-down:before{content:""}.fa-html5:before{content:""}.fa-css3:before{content:""}.fa-anchor:before{content:""}.fa-unlock-alt:before{content:""}.fa-bullseye:before{content:""}.fa-ellipsis-h:before{content:""}.fa-ellipsis-v:before{content:""}.fa-rss-square:before{content:""}.fa-play-circle:before{content:""}.fa-ticket:before{content:""}.fa-minus-square:before{content:""}.fa-minus-square-o:before{content:""}.fa-level-up:before{content:""}.fa-level-down:before{content:""}.fa-check-square:before{content:""}.fa-pencil-square:before{content:""}.fa-external-link-square:before{content:""}.fa-share-square:before{content:""}.fa-compass:before{content:""}.fa-caret-square-o-down:before,.fa-toggle-down:before{content:""}.fa-caret-square-o-up:before,.fa-toggle-up:before{content:""}.fa-caret-square-o-right:before,.fa-toggle-right:before{content:""}.fa-eur:before,.fa-euro:before{content:""}.fa-gbp:before{content:""}.fa-dollar:before,.fa-usd:before{content:""}.fa-inr:before,.fa-rupee:before{content:""}.fa-cny:before,.fa-jpy:before,.fa-rmb:before,.fa-yen:before{content:""}.fa-rouble:before,.fa-rub:before,.fa-ruble:before{content:""}.fa-krw:before,.fa-won:before{content:""}.fa-bitcoin:before,.fa-btc:before{content:""}.fa-file:before{content:""}.fa-file-text:before{content:""}.fa-sort-alpha-asc:before{content:""}.fa-sort-alpha-desc:before{content:""}.fa-sort-amount-asc:before{content:""}.fa-sort-amount-desc:before{content:""}.fa-sort-numeric-asc:before{content:""}.fa-sort-numeric-desc:before{content:""}.fa-thumbs-up:before{content:""}.fa-thumbs-down:before{content:""}.fa-youtube-square:before{content:""}.fa-youtube:before{content:""}.fa-xing:before{content:""}.fa-xing-square:before{content:""}.fa-youtube-play:before{content:""}.fa-dropbox:before{content:""}.fa-stack-overflow:before{content:""}.fa-instagram:before{content:""}.fa-flickr:before{content:""}.fa-adn:before{content:""}.fa-bitbucket:before{content:""}.fa-bitbucket-square:before{content:""}.fa-tumblr:before{content:""}.fa-tumblr-square:before{content:""}.fa-long-arrow-down:before{content:""}.fa-long-arrow-up:before{content:""}.fa-long-arrow-left:before{content:""}.fa-long-arrow-right:before{content:""}.fa-apple:before{content:""}.fa-windows:before{content:""}.fa-android:before{content:""}.fa-linux:before{content:""}.fa-dribbble:before{content:""}.fa-skype:before{content:""}.fa-foursquare:before{content:""}.fa-trello:before{content:""}.fa-female:before{content:""}.fa-male:before{content:""}.fa-gittip:before,.fa-gratipay:before{content:""}.fa-sun-o:before{content:""}.fa-moon-o:before{content:""}.fa-archive:before{content:""}.fa-bug:before{content:""}.fa-vk:before{content:""}.fa-weibo:before{content:""}.fa-renren:before{content:""}.fa-pagelines:before{content:""}.fa-stack-exchange:before{content:""}.fa-arrow-circle-o-right:before{content:""}.fa-arrow-circle-o-left:before{content:""}.fa-caret-square-o-left:before,.fa-toggle-left:before{content:""}.fa-dot-circle-o:before{content:""}.fa-wheelchair:before{content:""}.fa-vimeo-square:before{content:""}.fa-try:before,.fa-turkish-lira:before{content:""}.fa-plus-square-o:before{content:""}.fa-space-shuttle:before{content:""}.fa-slack:before{content:""}.fa-envelope-square:before{content:""}.fa-wordpress:before{content:""}.fa-openid:before{content:""}.fa-bank:before,.fa-institution:before,.fa-university:before{content:""}.fa-graduation-cap:before,.fa-mortar-board:before{content:""}.fa-yahoo:before{content:""}.fa-google:before{content:""}.fa-reddit:before{content:""}.fa-reddit-square:before{content:""}.fa-stumbleupon-circle:before{content:""}.fa-stumbleupon:before{content:""}.fa-delicious:before{content:""}.fa-digg:before{content:""}.fa-pied-piper:before{content:""}.fa-pied-piper-alt:before{content:""}.fa-drupal:before{content:""}.fa-joomla:before{content:""}.fa-language:before{content:""}.fa-fax:before{content:""}.fa-building:before{content:""}.fa-child:before{content:""}.fa-paw:before{content:""}.fa-spoon:before{content:""}.fa-cube:before{content:""}.fa-cubes:before{content:""}.fa-behance:before{content:""}.fa-behance-square:before{content:""}.fa-steam:before{content:""}.fa-steam-square:before{content:""}.fa-recycle:before{content:""}.fa-automobile:before,.fa-car:before{content:""}.fa-cab:before,.fa-taxi:before{content:""}.fa-tree:before{content:""}.fa-spotify:before{content:""}.fa-deviantart:before{content:""}.fa-soundcloud:before{content:""}.fa-database:before{content:""}.fa-file-pdf-o:before{content:""}.fa-file-word-o:before{content:""}.fa-file-excel-o:before{content:""}.fa-file-powerpoint-o:before{content:""}.fa-file-image-o:before,.fa-file-photo-o:before,.fa-file-picture-o:before{content:""}.fa-file-archive-o:before,.fa-file-zip-o:before{content:""}.fa-file-audio-o:before,.fa-file-sound-o:before{content:""}.fa-file-movie-o:before,.fa-file-video-o:before{content:""}.fa-file-code-o:before{content:""}.fa-vine:before{content:""}.fa-codepen:before{content:""}.fa-jsfiddle:before{content:""}.fa-life-bouy:before,.fa-life-buoy:before,.fa-life-ring:before,.fa-life-saver:before,.fa-support:before{content:""}.fa-circle-o-notch:before{content:""}.fa-ra:before,.fa-rebel:before{content:""}.fa-empire:before,.fa-ge:before{content:""}.fa-git-square:before{content:""}.fa-git:before{content:""}.fa-hacker-news:before,.fa-y-combinator-square:before,.fa-yc-square:before{content:""}.fa-tencent-weibo:before{content:""}.fa-qq:before{content:""}.fa-wechat:before,.fa-weixin:before{content:""}.fa-paper-plane:before,.fa-send:before{content:""}.fa-paper-plane-o:before,.fa-send-o:before{content:""}.fa-history:before{content:""}.fa-circle-thin:before{content:""}.fa-header:before{content:""}.fa-paragraph:before{content:""}.fa-sliders:before{content:""}.fa-share-alt:before{content:""}.fa-share-alt-square:before{content:""}.fa-bomb:before{content:""}.fa-futbol-o:before,.fa-soccer-ball-o:before{content:""}.fa-tty:before{content:""}.fa-binoculars:before{content:""}.fa-plug:before{content:""}.fa-slideshare:before{content:""}.fa-twitch:before{content:""}.fa-yelp:before{content:""}.fa-newspaper-o:before{content:""}.fa-wifi:before{content:""}.fa-calculator:before{content:""}.fa-paypal:before{content:""}.fa-google-wallet:before{content:""}.fa-cc-visa:before{content:""}.fa-cc-mastercard:before{content:""}.fa-cc-discover:before{content:""}.fa-cc-amex:before{content:""}.fa-cc-paypal:before{content:""}.fa-cc-stripe:before{content:""}.fa-bell-slash:before{content:""}.fa-bell-slash-o:before{content:""}.fa-trash:before{content:""}.fa-copyright:before{content:""}.fa-at:before{content:""}.fa-eyedropper:before{content:""}.fa-paint-brush:before{content:""}.fa-birthday-cake:before{content:""}.fa-area-chart:before{content:""}.fa-pie-chart:before{content:""}.fa-line-chart:before{content:""}.fa-lastfm:before{content:""}.fa-lastfm-square:before{content:""}.fa-toggle-off:before{content:""}.fa-toggle-on:before{content:""}.fa-bicycle:before{content:""}.fa-bus:before{content:""}.fa-ioxhost:before{content:""}.fa-angellist:before{content:""}.fa-cc:before{content:""}.fa-ils:before,.fa-shekel:before,.fa-sheqel:before{content:""}.fa-meanpath:before{content:""}.fa-buysellads:before{content:""}.fa-connectdevelop:before{content:""}.fa-dashcube:before{content:""}.fa-forumbee:before{content:""}.fa-leanpub:before{content:""}.fa-sellsy:before{content:""}.fa-shirtsinbulk:before{content:""}.fa-simplybuilt:before{content:""}.fa-skyatlas:before{content:""}.fa-cart-plus:before{content:""}.fa-cart-arrow-down:before{content:""}.fa-diamond:before{content:""}.fa-ship:before{content:""}.fa-user-secret:before{content:""}.fa-motorcycle:before{content:""}.fa-street-view:before{content:""}.fa-heartbeat:before{content:""}.fa-venus:before{content:""}.fa-mars:before{content:""}.fa-mercury:before{content:""}.fa-intersex:before,.fa-transgender:before{content:""}.fa-transgender-alt:before{content:""}.fa-venus-double:before{content:""}.fa-mars-double:before{content:""}.fa-venus-mars:before{content:""}.fa-mars-stroke:before{content:""}.fa-mars-stroke-v:before{content:""}.fa-mars-stroke-h:before{content:""}.fa-neuter:before{content:""}.fa-genderless:before{content:""}.fa-facebook-official:before{content:""}.fa-pinterest-p:before{content:""}.fa-whatsapp:before{content:""}.fa-server:before{content:""}.fa-user-plus:before{content:""}.fa-user-times:before{content:""}.fa-bed:before,.fa-hotel:before{content:""}.fa-viacoin:before{content:""}.fa-train:before{content:""}.fa-subway:before{content:""}.fa-medium:before{content:""}.fa-y-combinator:before,.fa-yc:before{content:""}.fa-optin-monster:before{content:""}.fa-opencart:before{content:""}.fa-expeditedssl:before{content:""}.fa-battery-4:before,.fa-battery-full:before{content:""}.fa-battery-3:before,.fa-battery-three-quarters:before{content:""}.fa-battery-2:before,.fa-battery-half:before{content:""}.fa-battery-1:before,.fa-battery-quarter:before{content:""}.fa-battery-0:before,.fa-battery-empty:before{content:""}.fa-mouse-pointer:before{content:""}.fa-i-cursor:before{content:""}.fa-object-group:before{content:""}.fa-object-ungroup:before{content:""}.fa-sticky-note:before{content:""}.fa-sticky-note-o:before{content:""}.fa-cc-jcb:before{content:""}.fa-cc-diners-club:before{content:""}.fa-clone:before{content:""}.fa-balance-scale:before{content:""}.fa-hourglass-o:before{content:""}.fa-hourglass-1:before,.fa-hourglass-start:before{content:""}.fa-hourglass-2:before,.fa-hourglass-half:before{content:""}.fa-hourglass-3:before,.fa-hourglass-end:before{content:""}.fa-hourglass:before{content:""}.fa-hand-grab-o:before,.fa-hand-rock-o:before{content:""}.fa-hand-paper-o:before,.fa-hand-stop-o:before{content:""}.fa-hand-scissors-o:before{content:""}.fa-hand-lizard-o:before{content:""}.fa-hand-spock-o:before{content:""}.fa-hand-pointer-o:before{content:""}.fa-hand-peace-o:before{content:""}.fa-trademark:before{content:""}.fa-registered:before{content:""}.fa-creative-commons:before{content:""}.fa-gg:before{content:""}.fa-gg-circle:before{content:""}.fa-tripadvisor:before{content:""}.fa-odnoklassniki:before{content:""}.fa-odnoklassniki-square:before{content:""}.fa-get-pocket:before{content:""}.fa-wikipedia-w:before{content:""}.fa-safari:before{content:""}.fa-chrome:before{content:""}.fa-firefox:before{content:""}.fa-opera:before{content:""}.fa-internet-explorer:before{content:""}.fa-television:before,.fa-tv:before{content:""}.fa-contao:before{content:""}.fa-500px:before{content:""}.fa-amazon:before{content:""}.fa-calendar-plus-o:before{content:""}.fa-calendar-minus-o:before{content:""}.fa-calendar-times-o:before{content:""}.fa-calendar-check-o:before{content:""}.fa-industry:before{content:""}.fa-map-pin:before{content:""}.fa-map-signs:before{content:""}.fa-map-o:before{content:""}.fa-map:before{content:""}.fa-commenting:before{content:""}.fa-commenting-o:before{content:""}.fa-houzz:before{content:""}.fa-vimeo:before{content:""}.fa-black-tie:before{content:""}.fa-fonticons:before{content:""}@font-face{font-family:Roboto;font-weight:300;font-style:normal;src:url(../fonts/roboto/Roboto-300/Roboto-300.eot);src:url(../fonts/roboto/Roboto-300/Roboto-300.eot?#iefix) format("embedded-opentype"),local("Roboto Light"),local("Roboto-300"),url(../fonts/roboto/Roboto-300/Roboto-300.woff2) format("woff2"),url(../fonts/roboto/Roboto-300/Roboto-300.woff) format("woff"),url(../fonts/roboto/Roboto-300/Roboto-300.ttf) format("truetype"),url(../fonts/roboto/Roboto-300/Roboto-300.svg#Roboto) format("svg")}@font-face{font-family:Roboto;font-weight:400;font-style:normal;src:url(../fonts/roboto/Roboto-regular/Roboto-regular.eot);src:url(../fonts/roboto/Roboto-regular/Roboto-regular.eot?#iefix) format("embedded-opentype"),local("Roboto"),local("Roboto-regular"),url(../fonts/roboto/Roboto-regular/Roboto-regular.woff2) format("woff2"),url(../fonts/roboto/Roboto-regular/Roboto-regular.woff) format("woff"),url(../fonts/roboto/Roboto-regular/Roboto-regular.ttf) format("truetype"),url(../fonts/roboto/Roboto-regular/Roboto-regular.svg#Roboto) format("svg")}@font-face{font-family:Roboto;font-weight:500;font-style:normal;src:url(../fonts/roboto/Roboto-500/Roboto-500.eot);src:url(../fonts/roboto/Roboto-500/Roboto-500.eot?#iefix) format("embedded-opentype"),local("Roboto Medium"),local("Roboto-500"),url(../fonts/roboto/Roboto-500/Roboto-500.woff2) format("woff2"),url(../fonts/roboto/Roboto-500/Roboto-500.woff) format("woff"),url(../fonts/roboto/Roboto-500/Roboto-500.ttf) format("truetype"),url(../fonts/roboto/Roboto-500/Roboto-500.svg#Roboto) format("svg")}@font-face{font-family:Roboto;font-weight:700;font-style:normal;src:url(../fonts/roboto/Roboto-700/Roboto-700.eot);src:url(../fonts/roboto/Roboto-700/Roboto-700.eot?#iefix) format("embedded-opentype"),local("Roboto Bold"),local("Roboto-700"),url(../fonts/roboto/Roboto-700/Roboto-700.woff2) format("woff2"),url(../fonts/roboto/Roboto-700/Roboto-700.woff) format("woff"),url(../fonts/roboto/Roboto-700/Roboto-700.ttf) format("truetype"),url(../fonts/roboto/Roboto-700/Roboto-700.svg#Roboto) format("svg")}.arango-tab li,.dashboard-legend,.dashboard-sub-bar-menu,.docsThirdCol,.fixedDropdown .notificationItem i,.fixedDropdown button,.headerBar>div.headerButtonBar,.query-button,.search-field,div .bigtile .iconSet span,div .tile .iconSet span,div.footer-right,div.footer-right p,div.gv_colour_list,ul.headerButtonList li{float:right}.collectionInfoTh2,.collectionTh,.dashboard-sub-bar,.dashboard-sub-bar .dashboard-sub-bar-title,.dataNotReadyYet,.dygraph-label.dygraph-title,.figuresHeader th,.graphLabel,.inputEditorWrapper .aqlEditorWrapper .previewWrapper .previewBar,.inputEditorWrapper .aqlEditorWrapper table,.inputEditorWrapper .aqlEditorWrapper table td input,.inputEditorWrapper .aqlEditorWrapper table th,.inputEditorWrapper .bindParamEditorWrapper .previewWrapper .previewBar,.inputEditorWrapper .bindParamEditorWrapper table,.inputEditorWrapper .bindParamEditorWrapper table td input,.inputEditorWrapper .bindParamEditorWrapper table th,.modal-body,.page-title span,.pingback a.url,.snippet-no-num,.ui-tooltip,body,button,input,textarea{font-family:Roboto,sans-serif!important}.document-info .document-bold-font,.document-info .document-thin-font{font-family:droid sans mono,monospace,courier new,courier,sans-serif;font-size:11pt}#distributionChartDiv:after,.arango-tab:after,.dashboard-bar-chart-container .dashboard-bar-chart:after,.dashboard-medium-chart .dashboard-medium-chart-inner:after,.dashboard-medium-chart .dashboard-medium-chart-menu:after,.dashboard-row:after,.dashboard-sub-bar:after,.dashboard-tendency-container .dashboard-tendency-chart:after,.detail-chart:after,.document-info .document-info-container .document-inner-info-container .document-attribute:after,.headerBar>div.headerButtonBar:after,.lineChartDiv:after,.pagination-line li:after,.resizecontainer:after,.tileList:after{clear:both;content:'.';display:block;font-size:0;height:0;visibility:hidden}.caret,.contentDiv:after,.contentDiv:before,.form-actions:after,.form-actions:before,.pong-spinner:after,.pong-spinner:before{content:''}.addButton,.arango-tab a,.arango-tab li,.arangoicon,.clusterDownBtn button,.contentDiv .icon,.contentTables tr.contentRowInactive a,.deleteButton i,.dropdownImport.headerDropdown input[type=checkbox].css-checkbox label.css-label,.edit-index-table .icon_arangodb_roundminus,.fixedDropdown .notificationItem i,.fullNotification:hover,.gv-search-submit-icon,.icon-info-sign,.link>line,.node,.pagination-line li a,.script-dropdown-menu .dropdown-item,.search-submit-icon,a.button-gui,a.headerButton,div .bigtile,div .bigtile .iconSet span,div .bigtile a span.icon,div .bigtile a svg,div .tile .iconSet span,div .tile a span.icon,div .tile a svg,div.headerDropdown.headerDropdown input[type=checkbox].css-checkbox label.css-label,div.toolbox div.gv_action_button{cursor:pointer}.graphContent #graph-container{outline:0;-webkit-touch-callout:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;-webkit-user-select:none;user-select:none}#swagger #jsonLink,.arangoToolbar span.clickable:hover,.login-window button,.pure-table-body .fa,.shardFollowers span,.shardLeader span,.subnavmenu .infoEntry a.default-icon i{-moz-transition:all .2s ease-in;-o-transition:all .2s ease-in;-webkit-transition:all .2s ease-in;transition:all .2s ease-in}.login-window select{-webkit-appearance:none;background:url("data:image/svg+xml;utf8,") right 10px top 12px no-repeat #f2f2f2;background-size:16px 16px;border:0;-webkit-border-radius:2px;border-radius:2px;color:#000;font-size:14px;font-weight:400;height:40px;line-height:initial;outline:0;padding:12px;text-align:center;-moz-transition:.3s ease all;-ms-transition:.3s ease all;-o-transition:.3s ease all;-webkit-transition:.3s ease all;transition:.3s ease all;width:100%}.breadcrumb a,.navlist .dropdown-item:hover a,.navlist>li:hover a{-moz-transition:all .2s ease-in;-o-transition:all .2s ease-in;-webkit-transition:all .2s ease-in}.login-window select:disabled{opacity:.5}.login-window select:active,.login-window select:focus{border:0;outline:0}.navbar{color:#fff;left:0;right:0;z-index:1000}.ajax-file-upload-red,.button-danger{background-color:#e74c3c}.ajax-file-upload-red:focus,.ajax-file-upload-red:hover,.button-danger:focus,.button-danger:hover{background-color:#ec7063}.contentTables td span,.deleteButton i,.edit-index-table .icon_arangodb_roundminus{color:#e74c3c}.contentTables td span:focus,.contentTables td span:hover,.deleteButton i:focus,.deleteButton i:hover,.edit-index-table .icon_arangodb_roundminus:focus,.edit-index-table .icon_arangodb_roundminus:hover{color:#ec7063}.ajax-file-upload,.button-success{background-color:#2ecc71}.ajax-file-upload:focus,.ajax-file-upload:hover,.button-success:focus,.button-success:hover{background-color:#58d68d}.button-info{background-color:#3498db}.button-info:focus,.button-info:hover{background-color:#5dade2}.addButton,.contentTables td.dbThSecond span{color:#2ecc71}.addButton:focus,.addButton:hover,.contentTables td.dbThSecond span:focus,.contentTables td.dbThSecond span:hover{color:#58d68d}.button-warning{background-color:#f1c40f}.button-warning:focus,.button-warning:hover{background-color:#f4d313}.button-close,.button-neutral{background-color:#8f8d8c}.button-close:focus,.button-close:hover,.button-neutral:focus,.button-neutral:hover{background-color:#736b68}.dashboard-sub-bar-menu{color:#8f8d8c}.dashboard-sub-bar-menu:focus,.dashboard-sub-bar-menu:hover{color:#736b68}.button-primary{background-color:#34495e}.button-primary:focus,.button-primary:hover{background-color:#415b76}.button-header,a.button-gui,a.headerButton{background-color:#fff;border:1px solid #fff;color:#555}.button-header:focus,.button-header:hover,a.button-gui:focus,a.button-gui:hover,a.headerButton:focus,a.headerButton:hover{background-color:#2ecc71;border:1px solid #2ecc71;color:#fff}.button-notification{background-color:#faa020}.button-notification:focus,.button-notification:hover{background-color:#f87c0f}.button-inactive,.button-inactive:focus,.button-inactive:hover,[class*=' button-']:disabled,[class*=' button-']:focus:disabled,[class*=' button-']:hover:disabled,[class^=button-]:disabled,[class^=button-]:focus:disabled,[class^=button-]:hover:disabled,button.disabled,button.disabled:focus,button.disabled:hover{background-color:#d3d3d3}a.headerButton.disabled,a.headerButton.disabled:focus,a.headerButton.disabled:hover{color:#d3d3d3}div.queryline .fa.fa-search{color:#c2c2c2;font-size:12pt;opacity:.5;position:relative;right:21px;top:-1px}div.queryline .fa.fa-search:hover{cursor:pointer;opacity:1}.inputEditorWrapper .aqlEditorWrapper table td input,.inputEditorWrapper .bindParamEditorWrapper table td input,.jsoneditor .search .frame input,.login-window .login-input,.modal-body .select2-choices input,.modal-body input,.modal-body select,.modal-body textarea,.navbar .arango-collection-select,.newIndexClass table input,.newIndexClass table select,.pure-table-body input,.pure-table-body select,.sectionHeader .scaleGroup input,div.queryline input,div.queryline select,input.search-input{-moz-border-radius:4px;-webkit-border-radius:4px;border-radius:4px;background-color:#fff!important;border:2px solid rgba(140,138,137,.25);box-shadow:none;outline:transparent 0}.inputEditorWrapper .aqlEditorWrapper table td input:focus,.inputEditorWrapper .bindParamEditorWrapper table td input:focus,.jsoneditor .search .frame input:focus,.login-window .login-input:focus,.modal-body input:focus,.modal-body select:focus,.modal-body textarea:focus,.navbar .arango-collection-select:focus,.newIndexClass table input:focus,.newIndexClass table select:focus,.pure-table-body input:focus,.pure-table-body select:focus,.sectionHeader .scaleGroup input:focus,div.queryline input:focus,div.queryline select:focus,input.search-input:focus{border-color:#2ecc71;box-shadow:none;outline:transparent 0}.dropdown-toolbar,.gv-dropdown-menu,.link-dropdown-menu,.script-dropdown-menu,.user-dropdown-menu{background-color:#f5f8f0;border-color:#666;border-radius:3px;border-style:solid;border-width:1px;box-shadow:none;display:none;left:initial;list-style:none;margin:5px 0 0;padding:5px 0;position:absolute;right:0;top:80%;z-index:1000}.dropdown-toolbar li,.gv-dropdown-menu li,.link-dropdown-menu li,.script-dropdown-menu li,.user-dropdown-menu li{line-height:23px;white-space:nowrap;width:100%}.dropdown-toolbar .dropdown-header,.gv-dropdown-menu .dropdown-header,.link-dropdown-menu .dropdown-header,.script-dropdown-menu .dropdown-header,.user-dropdown-menu .dropdown-header{color:#999;font-size:15px;font-weight:600;font-variant:small-caps;padding:0}.dropdown-toolbar .dropdown-header:hover,.gv-dropdown-menu .dropdown-header:hover,.link-dropdown-menu .dropdown-header:hover,.script-dropdown-menu .dropdown-header:hover,.user-dropdown-menu .dropdown-header:hover{cursor:default}.dropdown-toolbar .divider,.gv-dropdown-menu .divider,.link-dropdown-menu .divider,.script-dropdown-menu .divider,.user-dropdown-menu .divider{background-color:#666;height:1px;margin:10px 0 5px}.dropdown-toolbar a,.gv-dropdown-menu a,.link-dropdown-menu a,.script-dropdown-menu a,.user-dropdown-menu a{color:#fff;padding:0 20px}.navbar2{color:#fff}.navbar2>.secondary{background-color:rgba(255,255,255,.85)}.navbar{bottom:0;float:left;-webkit-font-smoothing:subpixel-antialiased;margin-bottom:0;position:absolute;top:0;width:150px}.navbar>.primary{background-color:#404a53;float:left;height:100%;width:150px}.navbar>.resizecontainer{background-color:#fff}.navbar .no-left-margin{border:0;margin-left:0}.navbar .no-left-margin.hover{background-color:transparent}.navbar .arangodbLogo{height:auto;margin-left:6px;margin-top:15px;width:138px}.navbar .arango-collection-select{position:relative;right:-22px;top:4px}.navbar .nav .dropdown .active>.dropdown-toggle,.navbar .nav .dropdown .open.active>.dropdown-toggle,.navbar .nav .dropdown .open>.dropdown-toggle{background:#58d68d}.navbar .nav>.active>a{-webkit-box-shadow:0 0 0 transparent inset;-moz-box-shadow:0 0 0 transparent inset;box-shadow:0 0 0 transparent inset;background-color:#fff;color:#000}.navbar .nav>li>a:focus{background-color:#fff}.navbar .nav>li>a:hover{background-color:#000;color:#686766}.navbar .shortcut{bottom:31px;left:13px;position:absolute}.navbar .shortcut i{background-color:transparent;border-radius:20px;color:#fff;width:20px;padding:5px 0 6px 4px}.navbar .shortcut i:hover{background-color:#2ecc71;color:#fff;cursor:pointer}.navbar .social-icons{bottom:0;float:left;margin-left:9px;position:absolute;width:100%}.navbar .social-icons a{display:block;float:left;height:25px;width:25px}.navbar .social-icons p{background:0 0;border-radius:20px;float:left;height:25px;margin-right:10px;padding:0;width:25px}.navbar .social-icons p:hover{background:#2ecc71;cursor:pointer}.navlist li.divider,.navlist li.navbar-spacer{background-color:rgba(0,0,0,.2)}.navbar .social-icons p:hover i{color:#fff}.navbar .social-icons i{color:#fff;margin-top:6px;position:absolute}.navbar .social-icons i.fa-google,.navbar .social-icons i.fa-slack,.navbar .social-icons i.fa-stack-overflow,.navbar .social-icons i.fa-twitter{margin-left:7px}.navlogo{height:60px;width:100%}.navlogo .small{display:none}.script-dropdown-menu .dropdown-item a,.tab{display:block}.navlogo .version{bottom:33px;color:rgba(255,255,255,.7);font-size:11px;font-weight:100;left:0;padding-bottom:10px;position:absolute;text-align:center;text-transform:uppercase;width:100%}.navlist,.navlist li{width:150px}.navlogo .version .out-of-date{color:#f1c40f;font-weight:400}.navlogo .version .out-of-date:hover{cursor:pointer}.navlogo .version .up-to-date{color:#2ecc71}.navmenu{clear:both}.navlist{list-style:none;margin:0;position:relative;top:0}.navlist>li{line-height:30px}.navlist li a{outline:0}.navlist li .fa{opacity:.3;padding-left:5px;padding-right:15px;text-align:center;width:10px}.navlist li .fa.fa-heart{color:#ff7a7a;opacity:1}.navlist li.disabled:hover{cursor:default}.navlist li.disabled:hover a:hover{cursor:default;opacity:.8}div .bigtile:hover,div .tile:hover,div.footer-center p:hover{cursor:pointer}.navlist .active .tab .fa,.navlist>.active a{opacity:1}.navlist li.dropdown:hover{border-bottom-left-radius:0;border-bottom-right-radius:0}.navlist li.divider,.navlist li.navbar-spacer{border:0}.navlist li.navbar-spacer{height:2px;margin-bottom:0;margin-top:0}.navlist .active{border-left:2px solid #77cb99}.navlist .active .tab{color:#fff;margin-left:-2px}.navlist .dropdown-item,.script-dropdown-menu .dropdown-item{margin-left:0}.navlist>.active{background-color:rgba(255,255,255,.2)}.navlist .dropdown-item:hover a,.navlist>li:hover a{color:#fff;opacity:1;transition:all .2s ease-in}.navlist .dropdown-item a{border-bottom:0;display:block;font-size:11pt}.navlist .dropdown-item a:hover{background-color:#dee9cf;color:#686766}.tab{color:rgba(255,255,255,.8);font-size:9pt;font-weight:100;text-transform:uppercase;padding:5px}.tab.userImg{padding-bottom:5px}.dropdown-item a{border-bottom:0!important;font-weight:300}.dropdown-toolbar li a,footer.footer p{font-weight:100}.dropdown-toolbar{background-color:#fff!important}.dropdown-toolbar li a:hover{background:0 0;background-color:#dee9cf!important;color:#000!important}.link-dropdown-menu,.user-dropdown-menu{background-color:rgba(0,0,0,.7);border-top-right-radius:0;margin-right:-1px;margin-top:7px;z-index:50}.link-dropdown-menu .dropdown-item,.user-dropdown-menu .dropdown-item{border-left:0;border-right:0}.script-dropdown-menu .dropdown-item a:hover{color:#fff}.script-dropdown-menu .dropdown-item:hover{background-color:#2ecc71}.gv-dropdown-menu{-moz-border-radius:0;-webkit-border-radius:0;border-radius:0;background-color:rgba(0,0,0,.7);border:1px solid #c2c2c2;margin-right:-20px;margin-top:6px}.gv-dropdown-menu:after{border-bottom-color:#fff}.gv-dropdown-menu li:hover{background-color:#fff;background-image:none}.gv-dropdown-menu li a{padding:0}.gv-dropdown-menu li a label{color:#fff;padding-left:5px}.gv-dropdown-menu li a:focus{background-color:#2ecc71!important;background-image:none}#arangoCollectionSelect{display:none;float:right;margin-bottom:0;margin-right:15px;padding-bottom:0}.caret{border-left:5px solid transparent;border-right:5px solid transparent;border-top:5px solid #686766;display:inline-block;height:0;vertical-align:top;width:0}.applications-menu{display:block}.arango-logo{height:34px;padding:0!important}.arango-logo img{margin-left:22px}.footer{background-color:rgba(239,240,241,.8);display:none;font-size:14px;left:160px;right:10px;text-align:center;z-index:1000}div.footer-center,div.footer-left,div.footer-right{background:none;color:#686766}footer.footer{bottom:0;height:43px;position:fixed}footer.footer p{font-size:10pt;margin-bottom:0;padding-bottom:10px;padding-top:10px}div.footer-left{width:45%}div.footer-center{width:10%}div.footer-center p{padding-top:5px}[class*=' button-']:disabled,[class^=button-]:disabled,a.headerButton.disabled,button.disabled{cursor:not-allowed}div.footer-right{width:45%}div.footer-right p{color:#fff}div.footer-right i{color:#e74c3c;font-size:18px}div.footer-right a{color:#686766;margin-left:5px;position:relative;top:-1px}div.footer-right .isOnline{color:#2ecc71!important}.ajax-file-upload,.ajax-file-upload-red,.button-close,.button-danger,.button-header,.button-inactive,.button-info,.button-neutral,.button-notification,.button-primary,.button-success,.button-warning{-moz-border-radius:2px;-webkit-border-radius:2px;border-radius:2px;-webkit-box-shadow:0;-moz-box-shadow:0;box-shadow:0;font-size:13px;font-weight:300!important}.addButton,.deleteButton i{font-size:16pt;position:relative}.ajax-file-upload,.ajax-file-upload-red,.button-close,.button-danger,.button-inactive,.button-info,.button-neutral,.button-notification,.button-primary,.button-success,.button-warning{border:0;color:#fff;margin-left:10px;padding:4px 12px}.ajax-file-upload-red:focus,.ajax-file-upload:focus,.button-close:focus,.button-danger:focus,.button-inactive:focus,.button-info:focus,.button-neutral:focus,.button-notification:focus,.button-primary:focus,.button-success:focus,.button-warning:focus{outline:0}.ajax-file-upload i,.ajax-file-upload-red i,.button-close i,.button-danger i,.button-inactive i,.button-info i,.button-neutral i,.button-notification i,.button-primary i,.button-success i,.button-warning i{margin-left:-5px}.ajax-file-upload .fa,.ajax-file-upload-red .fa,.button-close .fa,.button-danger .fa,.button-inactive .fa,.button-info .fa,.button-neutral .fa,.button-notification .fa,.button-primary .fa,.button-success .fa,.button-warning .fa{position:relative;top:1px}.button-header{margin-top:5px}.addButton{margin-right:7px;margin-top:2px}.deleteButton i{float:right;padding-right:7px;top:12px}#closeBtnInfoView{margin-left:0!important}button.btn-server{width:120px}button.btn-small{padding:0 8px}button.gv-zoom-btn{background-size:14px 14px;height:14px;vertical-align:baseline;width:14px}button.gv-zoom-btn.btn-zoom-right{border:0;box-shadow:none;right:0;top:13px}button.gv-zoom-btn.pan-right{background-image:url(../img/gv_arrow_right.png)}button.gv-zoom-btn.pan-right:hover{background:inherit;background-image:url(../img/gv_arrow_right.png)}button.gv-zoom-btn.pan-left{background-image:url(../img/gv_arrow_left.png)}button.gv-zoom-btn.pan-left:hover{background:inherit;background-image:url(../img/gv_arrow_left.png)}button.gv-zoom-btn.pan-top{background-image:url(../img/gv_arrow_top.png)}button.gv-zoom-btn.pan-top:hover{background:inherit;background-image:url(../img/gv_arrow_top.png)}button.gv-zoom-btn.pan-bottom{background-image:url(../img/gv_arrow_bottom.png)}button.gv-zoom-btn.pan-bottom:hover{background:inherit;background-image:url(../img/gv_arrow_bottom.png)}button.gv-zoom-btn.btn-zoom{height:14px;margin:0;padding:0;position:absolute;width:16px}button.gv-zoom-btn.btn-zoom-top{border:0;box-shadow:none;left:13px;top:1}button.gv-zoom-btn.btn-zoom-left{border:0;box-shadow:none;left:0;top:13px}button.gv-zoom-btn.btn-zoom-bottom{border:0;box-shadow:none;left:13px;top:25px}button.gv-icon-btn{-moz-border-radius:0!important;-webkit-border-radius:0!important;border-radius:0!important;background-size:36px 36px;height:36px;width:36px}button.gv-icon-btn.active{background-color:#2ecc71}button.gv_dropdown_entry{height:30px;margin:4px 4px 4px 12px;width:160px}button.gv_context_button{width:65px}button.large-distance{margin-left:12px}button.short-distance{margin-left:6px}button.shutdown{margin-top:6px;padding:3px 14px}button.graphViewer-icon-button{background-color:transparent;border:0;height:20px;margin-left:5px;margin-top:-2px;padding:0;width:20px}button.graphViewer-icon-button img{height:20px;padding-bottom:10px;width:20px}ul.headerButtonList{display:inline-block;margin-bottom:0;margin-left:0;padding-left:0!important}ul.headerButtonList li{display:inline}a.button-gui,a.headerButton{-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;margin-left:5px;margin-right:5px}a.headerButton{margin-top:2px;position:relative}a.headerButton .fa,a.headerButton [class*=" icon_"],a.headerButton [class^=icon_]{display:block;height:23px;line-height:23px;position:static;right:0;text-align:center;top:0;width:27px}a.headerButton .icon_arangodb_arrowleft,a.headerButton .icon_arangodb_arrowright{font-weight:700}a.headerButton.activated{background-color:#58d68d;border:1px solid #58d68d;color:#fff}a.headerButton.activated:hover{background-color:#fff;color:#58d68d}div.toolbox{-moz-border-radius:2px;-webkit-border-radius:2px;border-radius:2px;background-color:#fff;border:1px solid rgba(140,138,137,.25);margin-right:5px;padding-bottom:5px;padding-top:5px;position:absolute;top:-10px}div.toolbox div.gv_action_button{-moz-border-radius:2px;-webkit-border-radius:2px;border-radius:2px;background-color:#fff;color:#555;height:30px;margin:5px;position:relative;text-align:center;width:30px}div.toolbox div.gv_action_button.active{background-color:#2ecc71;color:#fff}div.toolbox div.gv_action_button:first-child{margin-top:0}div.toolbox div.gv_action_button:last-child{margin-bottom:0}h6.gv_button_title,h6.gv_icon_icon{left:0;margin:0;position:absolute;right:0}h6.gv_icon_icon{font-size:22px;left:1px;top:4px}h6.gv_button_title{bottom:1px;display:none}.btn-icon{background-color:#383434;padding:4px}.gv-icon-small{background-size:16px 16px;height:16px!important;width:16px!important}.gv-icon-small.delete{background-image:url(../img/icon_delete.png)}.gv-icon-small.add{background-image:url(../img/plus_icon.png)}a.pagination-button,ul.arango-pagination a{-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px}.badge,.btn,.label{text-shadow:none!important}.navbar-inner,.thumbnail{-moz-border-radius:0;-webkit-border-radius:0;border-radius:0;-webkit-box-shadow:0;-moz-box-shadow:0;box-shadow:0}.modal-body th.actionCell>button{margin-top:-12px}.btn-old-padding{padding-bottom:4px!important;padding-top:4px!important}button.btn-overview,button.btn-server{margin:5px}a.button-gui{height:auto;margin-bottom:0;margin-top:0;padding-bottom:1px;padding-top:1px;position:absolute;right:2px;text-decoration:none!important;top:2px;width:auto}a.button-gui.button-gui-disabled{display:none}.clusterDownBtn{padding-bottom:10px;padding-top:10px;text-align:center}.clusterDownBtn button{-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;background-color:#f1f1f1;border:1px solid rgba(0,0,0,.1875);color:#333;font-size:20px;font-weight:300;margin:0;padding:12px 18px;text-align:center;text-decoration:none!important;width:250px}.clusterDownBtn button:hover{background-color:#e8e8e8;color:#4a6c30;-webkit-transition-delay:0;-webkit-transition-duration:.2s;-webkit-transition-property:all;-webkit-transition-timing-function:ease-in}.clusterDownBtn button.green{background-color:#617e2b;color:#fff}.clusterDownBtn button.green:hover{background-color:#8ba142}.bottomButtonBar{background-color:#fff;border-top:1px solid rgba(104,103,102,.1);height:30px;padding:10px}.tileList{left:10px;padding-top:5px;position:absolute;right:10px}.tileList legend{padding-left:5px}.tileList .tile:first-child a{opacity:.8}.tileList .tile:first-child a:hover{opacity:1}div .bigtile,div .tile{-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;border-radius:2px;font-size:14px;list-style:none;margin-bottom:13px;position:relative;text-align:center;z-index:1}div .bigtile progress[value],div .tile progress[value]{color:#5bc0de}div .bigtile progress::-webkit-progress-bar-value,div .tile progress::-webkit-progress-bar-value{background:#5bc0de}div .bigtile progress::-webkit-progress-value,div .tile progress::-webkit-progress-value{background:#5bc0de}div .bigtile progress::-moz-progress-bar,div .tile progress::-moz-progress-bar{background:#5bc0de}div .bigtile progress,div .tile progress{-webkit-appearance:none;border-radius:0;height:2px;margin-top:16px;position:relative;width:100%;z-index:10}div .locked.bigtile,div .locked.tile{cursor:not-allowed}div .locked.bigtile .borderBox,div .locked.bigtile .collection-type-icon,div .locked.bigtile .collectionName,div .locked.bigtile .iconSet,div .locked.tile .borderBox,div .locked.tile .collection-type-icon,div .locked.tile .collectionName,div .locked.tile .iconSet{opacity:.5}div .locked.bigtile .iconSet span:hover,div .locked.tile .iconSet span:hover{background-color:#fff!important;color:#000;cursor:not-allowed!important}div .locked.bigtile .iconSet:hover,div .locked.tile .iconSet:hover{cursor:not-allowed!important}div .bigtile .collection-type-icon:hover,div .bigtile img:hover,div .tile .collection-type-icon:hover,div .tile img:hover{cursor:pointer}div .bigtile .warning-icons,div .tile .warning-icons{background-color:#e74c3c;border-radius:2px;color:#fff;font-size:11px;height:17px;left:0;line-height:13px;margin-left:5px;margin-top:5px;padding-left:9px;padding-right:9px;position:absolute;top:0}div .bigtile .warning-icons .fa,div .tile .warning-icons .fa{font-size:11pt;margin-left:1px}div .bigtile .collection-type-icon,div .tile .collection-type-icon{color:#666;font-size:30pt;margin-left:-18px;position:absolute;top:15px}div .bigtile img,div .tile img{position:relative}div .bigtile img.icon,div .tile img.icon{height:50px;margin-top:-110px;width:50px}div .bigtile a span.add-Icon,div .tile a span.add-Icon{font-size:20px;margin-left:22px;margin-right:10px;position:relative;top:0}div .bigtile a span.icon,div .tile a span.icon{font-size:50px}div .bigtile a svg.icon,div .tile a svg.icon{height:50px;width:50px}div .bigtile .tile-icon-svg,div .tile .tile-icon-svg{cursor:pointer;fill:#686766;height:50px;margin-left:auto;margin-right:auto;margin-top:-63px;position:relative;width:50px}div .bigtile .tile-icon,div .tile .tile-icon{color:#686766;font-size:50px;line-height:1.2;margin-left:-50px}div .bigtile .icon_arangodb_edge5-2,div .bigtile .tile-icon,div .tile .icon_arangodb_edge5-2,div .tile .tile-icon{position:absolute;top:15px}div .bigtile .icon_arangodb_edge5-2,div .tile .icon_arangodb_edge5-2{display:inline-block;margin-left:5px;position:absolute;top:0;-moz-transform:rotate(80deg);-o-transform:rotate(80deg);-webkit-transform:rotate(80deg)}div .bigtile h5,div .tile h5{background:rgba(64,74,83,.8);color:#fff;font-size:12px;margin:0 5px;overflow:hidden!important;padding:4px 8px;text-overflow:ellipsis!important;white-space:nowrap!important}div .bigtile h5.inProgress,div .tile h5.inProgress{color:#5bc0de}div .bigtile .tileSelects,div .tile .tileSelects{margin-left:40px;position:relative;z-index:9999}div .bigtile .tileSelects select,div .tile .tileSelects select{float:right;height:20px;margin-right:5px;margin-top:16px;width:70px}div .bigtile .fullBorderBox,div .tile .fullBorderBox{background-color:#fff;border:1px solid rgba(140,138,137,.25);border-radius:2px;box-sizing:border-box;height:100%;margin-left:5px;margin-right:5px;position:relative;width:auto}div .bigtile .fullBorderBox .add,div .tile .fullBorderBox .add{color:#404a53}div .bigtile .fullBorderBox .add span,div .tile .fullBorderBox .add span{color:#2ecc71}div .bigtile .paddingBox,div .tile .paddingBox{box-sizing:border-box;padding-left:5px;padding-right:5px}div .bigtile .borderBox,div .tile .borderBox{background-color:#fff;border:1px solid rgba(64,74,83,.2);border-bottom:0;border-radius:2px;box-sizing:border-box;height:75px;position:relative;width:100%}div .bigtile .iconSet,div .tile .iconSet{position:absolute;right:5px;top:5px}div .bigtile .iconSet span,div .tile .iconSet span{border-radius:2px;color:#666;font-size:18px;z-index:2;padding:2px 3px}div .bigtile .iconSet span:hover,div .tile .iconSet span:hover{background-color:#2ecc71;color:#fff}div .bigtile .iconSet span.disabled,div .tile .iconSet span.disabled{cursor:default;opacity:.2}div .bigtile .iconSet span.disabled:hover,div .tile .iconSet span.disabled:hover{background-color:#fff;color:#000;cursor:default;opacity:.2}div .bigtile .badge-success,div .tile .badge-success{font-weight:300}div .bigtile .unloaded div,div .tile .unloaded div{border-bottom:16px solid #ff8f35}div .bigtile .deleted div,div .tile .deleted div{border-bottom:16px solid #700}div .bigtile .tileBadge,div .tile .tileBadge{bottom:29px;font-size:11px;font-weight:300;position:absolute;right:0}div .bigtile .tileBadge button,div .tile .tileBadge button{margin-left:0;margin-right:5px}div .bigtile .tileBadge span,div .tile .tileBadge span{display:inline-block;line-height:15px}div .bigtile .tileBadge span .corneredBadge,div .tile .tileBadge span .corneredBadge{border-bottom-style:solid;border-bottom-width:17px;border-left:5px solid transparent;border-radius:2px;color:#fff;height:0;margin-bottom:4px;margin-right:10px;padding-left:1px;padding-right:6px}div .bigtile .tileBadge span .corneredBadge.loading,div .tile .tileBadge span .corneredBadge.loading{border-bottom-color:#ff8f35}div .bigtile .tileBadge span .corneredBadge.loaded,div .tile .tileBadge span .corneredBadge.loaded{border-bottom-color:#2ecc71}div .bigtile .tileBadge span .corneredBadge.inProgress,div .tile .tileBadge span .corneredBadge.inProgress{border-bottom-color:#5bc0de}div .bigtile .tileBadge span .corneredBadge.development,div .bigtile .tileBadge span .corneredBadge.unloaded,div .tile .tileBadge span .corneredBadge.development,div .tile .tileBadge span .corneredBadge.unloaded{border-bottom-color:#ff8f35}div .tile{height:100px}div .tile-graph h5{margin-left:5px;margin-right:5px}div .tile-graph .tile-icon:hover{cursor:pointer}div .bigtile{height:309px;width:452px}div .bigtile .shardContainer{font-size:30px}div .bigtile .shardContainer span{padding:2px}.collectionName{border-bottom-left-radius:2px;border-bottom-right-radius:2px;bottom:0;font-weight:300;left:0;position:absolute;right:0;text-align:left}#userManagementThumbnailsIn .tile .paddingBox img{border-radius:58px;margin-top:-99px;padding:0}.resizecontainer{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box;padding-left:10px;padding-right:10px}.dashboard-large-chart,.dashboard-medium-chart-outer,.dashboard-sub-bar,.tendency-box-sizing .dashboard-tendency-container,div.centralContent{box-sizing:border-box}@media (max-width:738px){#collectionsDropdown ul{width:auto!important}.footer-center p{display:none}#queryContent #querySize,#queryContent #querySizeDiv,#queryContent .styled-select{margin-right:6px;width:90px!important}}@media (max-width:970px){#documentsDiv #totalDocuments{display:none}}@media (min-width:250px) and (max-width:489px){.dashboard-full-width-chart,.dashboard-full-width-chart .dashboard-full-width-chart-inner,.dashboard-full-width-chart .dashboard-sub-bar,.dashboard-large-chart .dashboard-large-chart-inner,.dashboard-large-chart .dashboard-sub-bar,.dashboard-medium-chart,.dashboard-medium-chart .dashboard-sub-bar,.resizecontainer{width:100%}.dashboard-full-width-chart .dashboard-full-width-chart-inner .dashboard-interior-chart,.dashboard-medium-chart-outer{float:left}.dashboard-large-chart .dashboard-large-chart-inner .dashboard-interior-chart{height:185px}.dashboard-sub-bar-menu{font-size:12px}.dashboard-medium-chart .dashboard-interior-chart{height:185px;width:100%}.dashboard-medium-chart .dashboard-medium-chart-menu{font-size:12px;left:10px;top:0}.dashboard-medium-chart #clusterGraphs svg{height:185px;width:27px}.dashboard-medium-chart #clusterGraphs svg text{font-size:10px}.dashboard-small-chart .dashboard-sub-bar{clear:both;height:65px;margin-bottom:0;width:100%}.dashboard-small-chart .dashboard-small-chart-inner{width:100%}.dashboard-small-chart .dashboard-small-chart-inner .dashboard-interior-chart{height:197px;width:100%}.dashboard-small-chart .dashboard-small-chart-inner .dashboard-interior-chart .nv-axis text{fill:#666;font-size:10px;font-weight:400}.dashboard-tendency-container .dashboard-tendency-chart{height:83.25px}.dashboard-tendency-container .dashboard-tendency-chart .dashboard-figure,.dashboard-tendency-container .dashboard-tendency-chart .dashboard-subtitle-bar,.dashboard-tendency-container .dashboard-tendency-chart .dashboard-tendency{width:-15px}.dashboard-tendency-container .dashboard-tendency-chart .dashboard-subtitle-bar{height:25.08px;line-height:25.08px}.dashboard-tendency-container .dashboard-tendency-chart .dashboard-figure{height:40.17px;line-height:19.08px;padding-top:5px}.dashboard-tendency-container .dashboard-sub-bar{width:100%}.dashboard-bar-chart-container{height:79.75px}.dashboard-bar-chart-container .dashboard-bar-chart{height:74.75px;width:100%}.dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-title{height:25.25px;line-height:25.25px}.dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-title .percentage{width:-4.2px}.dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-title .absolut{line-height:40px;padding-top:15px;width:-3px}.dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-chart{box-sizing:border-box;height:50px;margin-top:5px;width:100%}.dashboard-bar-chart-container .dashboard-sub-bar{padding-top:13px;width:100%}.modal-chart-detail{bottom:12.1%!important;left:50%;margin-left:-45px;width:110px!important}.modal-chart-detail .modal-body{height:95%;max-height:none;padding:5px}.modal-chart-detail .modal-dashboard-legend{display:none;font-size:12px;min-height:190px;width:10px}.absolut,.percentage{font-size:14px}.modal-chart-detail .modal-inner-detail{width:70px}.modal-body .dashboard-large-chart{width:51px}.modal-body .dashboard-large-chart .dashboard-large-chart-inner .dashboard-interior-chart,.modal-body .dashboard-large-chart .dashboard-sub-bar{width:100%}.modal-body .dashboard-medium-chart-outer{float:left;width:22px}.modal-body .dashboard-medium-chart,.modal-body .dashboard-medium-chart .dashboard-interior-chart,.modal-body .dashboard-medium-chart .dashboard-sub-bar{width:100%}.modal-body .dashboard-small-chart,.modal-body .dashboard-small-chart .dashboard-small-chart-inner,.modal-body .dashboard-small-chart .dashboard-small-chart-inner .dashboard-interior-chart{width:auto}.modal-body .dashboard-medium-chart .dashboard-medium-chart-menu{left:5px}.modal-body .dashboard-small-chart .dashboard-sub-bar{clear:both;width:auto}.modal-body .dashboard-tendency-container,.modal-body .dashboard-tendency-container .dashboard-tendency-chart,.modal-body .dashboard-tendency-container .dashboard-tendency-chart .dashboard-figure,.modal-body .dashboard-tendency-container .dashboard-tendency-chart .dashboard-subtitle-bar,.modal-body .dashboard-tendency-container .dashboard-tendency-chart .dashboard-tendency{box-sizing:border-box;width:100%}.modal-body .dashboard-tendency-container .dashboard-sub-bar{width:100%}.modal-body .dashboard-bar-chart-container .dashboard-bar-chart{width:auto}.modal-body .dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-title .percentage{width:-4.2px}.modal-body .dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-title .absolut{width:-3px}.modal-body .dashboard-bar-chart-container .dashboard-bar-chart-chart{width:-6px}.modal-body .dashboard-bar-chart-container .dashboard-sub-bar{width:100%}.absolut{font-weight:300}.dashboard-sub-bar{font-size:10px;font-weight:400}.dashboard-subtitle-bar{font-size:14px;font-weight:300}.dashboard-figure{font-size:16px;font-weight:400}.dashboard-figurePer{font-size:14px;font-weight:300}.dashboard-legend,.dygraph-axis-label.dygraph-axis-label-x,.dygraph-axis-label.dygraph-axis-label-y{font-weight:400;font-size:10px}.dashboard-legend{display:none;height:30px;width:100%}.dashboard-half-height-legend{display:none;font-size:10px;height:100px;width:0}.application-detail-view section.info{width:90px}.application-detail-view aside.meta{display:none}}@media (min-width:490px) and (max-width:729px){.dashboard-full-width-chart,.dashboard-full-width-chart .dashboard-full-width-chart-inner,.dashboard-full-width-chart .dashboard-sub-bar,.dashboard-large-chart .dashboard-large-chart-inner,.dashboard-large-chart .dashboard-sub-bar,.dashboard-medium-chart,.dashboard-medium-chart .dashboard-sub-bar,.resizecontainer{width:100%}.dashboard-full-width-chart .dashboard-full-width-chart-inner .dashboard-interior-chart,.dashboard-medium-chart-outer{float:left}.dashboard-large-chart .dashboard-large-chart-inner .dashboard-interior-chart{height:185px}.dashboard-sub-bar-menu{font-size:12px}.dashboard-medium-chart .dashboard-interior-chart{height:185px;width:100%}.dashboard-medium-chart .dashboard-medium-chart-menu{font-size:12px;left:130px;top:0}.dashboard-medium-chart #clusterGraphs svg{height:185px;width:147px}.dashboard-medium-chart #clusterGraphs svg text{font-size:10px}.dashboard-small-chart .dashboard-sub-bar{clear:both;height:65px;margin-bottom:0;width:100%}.dashboard-small-chart .dashboard-small-chart-inner{width:100%}.dashboard-small-chart .dashboard-small-chart-inner .dashboard-interior-chart{height:197px;width:100%}.dashboard-small-chart .dashboard-small-chart-inner .dashboard-interior-chart .nv-axis text{fill:#666;font-size:10px;font-weight:400}.dashboard-tendency-container .dashboard-tendency-chart{height:83.25px}.dashboard-tendency-container .dashboard-tendency-chart .dashboard-figure,.dashboard-tendency-container .dashboard-tendency-chart .dashboard-subtitle-bar,.dashboard-tendency-container .dashboard-tendency-chart .dashboard-tendency{width:25px}.dashboard-tendency-container .dashboard-tendency-chart .dashboard-subtitle-bar{height:25.08px;line-height:25.08px}.dashboard-tendency-container .dashboard-tendency-chart .dashboard-figure{height:40.17px;line-height:19.08px;padding-top:5px}.dashboard-tendency-container .dashboard-sub-bar{width:100%}.dashboard-bar-chart-container{height:79.75px}.dashboard-bar-chart-container .dashboard-bar-chart{height:74.75px;width:100%}.dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-title{height:25.25px;line-height:25.25px}.dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-title .percentage{width:51.8px}.dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-title .absolut{line-height:40px;padding-top:15px;width:21px}.dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-chart{box-sizing:border-box;height:50px;margin-top:5px;width:100%}.dashboard-bar-chart-container .dashboard-sub-bar{padding-top:13px;width:100%}.modal-chart-detail{bottom:12.1%!important;left:50%;margin-left:-165px;width:350px!important}.modal-chart-detail .modal-body{height:95%;max-height:none;padding:5px}.modal-chart-detail .modal-dashboard-legend{display:none;font-size:12px;min-height:190px;width:10px}.absolut,.percentage{font-size:14px}.modal-chart-detail .modal-inner-detail{width:310px}.modal-body .dashboard-large-chart{width:211px}.modal-body .dashboard-large-chart .dashboard-large-chart-inner .dashboard-interior-chart,.modal-body .dashboard-large-chart .dashboard-sub-bar{width:100%}.modal-body .dashboard-medium-chart-outer{float:left;width:142px}.modal-body .dashboard-medium-chart,.modal-body .dashboard-medium-chart .dashboard-interior-chart,.modal-body .dashboard-medium-chart .dashboard-sub-bar{width:100%}.modal-body .dashboard-small-chart,.modal-body .dashboard-small-chart .dashboard-small-chart-inner,.modal-body .dashboard-small-chart .dashboard-small-chart-inner .dashboard-interior-chart{width:auto}.modal-body .dashboard-medium-chart .dashboard-medium-chart-menu{left:125px}.modal-body .dashboard-small-chart .dashboard-sub-bar{clear:both;width:auto}.modal-body .dashboard-tendency-container,.modal-body .dashboard-tendency-container .dashboard-tendency-chart,.modal-body .dashboard-tendency-container .dashboard-tendency-chart .dashboard-figure,.modal-body .dashboard-tendency-container .dashboard-tendency-chart .dashboard-subtitle-bar,.modal-body .dashboard-tendency-container .dashboard-tendency-chart .dashboard-tendency{box-sizing:border-box;width:100%}.modal-body .dashboard-tendency-container .dashboard-sub-bar{width:100%}.modal-body .dashboard-bar-chart-container .dashboard-bar-chart{width:auto}.modal-body .dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-title .percentage{width:51.8px}.modal-body .dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-title .absolut{width:21px}.modal-body .dashboard-bar-chart-container .dashboard-bar-chart-chart{width:74px}.modal-body .dashboard-bar-chart-container .dashboard-sub-bar{width:100%}.absolut{font-weight:300}.dashboard-sub-bar{font-size:10px;font-weight:400}.dashboard-subtitle-bar{font-size:14px;font-weight:300}.dashboard-figure{font-size:16px;font-weight:400}.dashboard-figurePer{font-size:14px;font-weight:300}.dashboard-legend,.dygraph-axis-label.dygraph-axis-label-x,.dygraph-axis-label.dygraph-axis-label-y{font-weight:400;font-size:10px}.dashboard-legend{display:none;height:30px;width:100%}.dashboard-half-height-legend{display:none;font-size:10px;height:100px;width:0}.application-detail-view section.info{width:330px}.application-detail-view aside.meta{display:none}}@media (min-width:730px) and (max-width:969px){.dashboard-full-width-chart,.dashboard-full-width-chart .dashboard-full-width-chart-inner,.dashboard-full-width-chart .dashboard-sub-bar,.dashboard-large-chart .dashboard-large-chart-inner,.dashboard-large-chart .dashboard-sub-bar,.dashboard-medium-chart,.dashboard-medium-chart .dashboard-sub-bar,.resizecontainer{width:100%}.dashboard-full-width-chart .dashboard-full-width-chart-inner .dashboard-interior-chart,.dashboard-medium-chart-outer{float:left}.dashboard-large-chart .dashboard-large-chart-inner .dashboard-interior-chart{height:185px}.dashboard-sub-bar-menu{font-size:12px}.dashboard-medium-chart .dashboard-interior-chart{height:185px;width:100%}.dashboard-medium-chart .dashboard-medium-chart-menu{font-size:12px;left:250px;top:0}.dashboard-medium-chart #clusterGraphs svg{height:185px;width:267px}.dashboard-medium-chart #clusterGraphs svg text{font-size:10px}.dashboard-small-chart .dashboard-sub-bar{clear:both;height:65px;margin-bottom:0;width:100%}.dashboard-small-chart .dashboard-small-chart-inner{width:100%}.dashboard-small-chart .dashboard-small-chart-inner .dashboard-interior-chart{height:197px;width:100%}.dashboard-small-chart .dashboard-small-chart-inner .dashboard-interior-chart .nv-axis text{fill:#666;font-size:10px;font-weight:400}.dashboard-tendency-container .dashboard-tendency-chart{height:83.25px}.dashboard-tendency-container .dashboard-tendency-chart .dashboard-figure,.dashboard-tendency-container .dashboard-tendency-chart .dashboard-subtitle-bar,.dashboard-tendency-container .dashboard-tendency-chart .dashboard-tendency{width:65px}.dashboard-tendency-container .dashboard-tendency-chart .dashboard-subtitle-bar{height:25.08px;line-height:25.08px}.dashboard-tendency-container .dashboard-tendency-chart .dashboard-figure{height:40.17px;line-height:19.08px;padding-top:5px}.dashboard-tendency-container .dashboard-sub-bar{width:100%}.dashboard-bar-chart-container{height:79.75px}.dashboard-bar-chart-container .dashboard-bar-chart{height:74.75px;width:100%}.dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-title{height:25.25px;line-height:25.25px}.dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-title .percentage{width:107.8px}.dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-title .absolut{line-height:40px;padding-top:15px;width:45px}.dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-chart{box-sizing:border-box;height:50px;margin-top:5px;width:100%}.dashboard-bar-chart-container .dashboard-sub-bar{padding-top:13px;width:100%}.modal-chart-detail{bottom:12.1%!important;left:50%;margin-left:-285px;width:590px!important}.modal-chart-detail .modal-body{height:95%;max-height:none;padding:5px}.modal-chart-detail .modal-dashboard-legend{display:none;font-size:12px;min-height:190px;width:10px}.absolut,.percentage{font-size:14px}.modal-chart-detail .modal-inner-detail{width:550px}.modal-body .dashboard-large-chart{width:371px}.modal-body .dashboard-large-chart .dashboard-large-chart-inner .dashboard-interior-chart,.modal-body .dashboard-large-chart .dashboard-sub-bar{width:100%}.modal-body .dashboard-medium-chart-outer{float:left;width:262px}.modal-body .dashboard-medium-chart,.modal-body .dashboard-medium-chart .dashboard-interior-chart,.modal-body .dashboard-medium-chart .dashboard-sub-bar{width:100%}.modal-body .dashboard-small-chart,.modal-body .dashboard-small-chart .dashboard-small-chart-inner,.modal-body .dashboard-small-chart .dashboard-small-chart-inner .dashboard-interior-chart{width:auto}.modal-body .dashboard-medium-chart .dashboard-medium-chart-menu{left:245px}.modal-body .dashboard-small-chart .dashboard-sub-bar{clear:both;width:auto}.modal-body .dashboard-tendency-container,.modal-body .dashboard-tendency-container .dashboard-tendency-chart,.modal-body .dashboard-tendency-container .dashboard-tendency-chart .dashboard-figure,.modal-body .dashboard-tendency-container .dashboard-tendency-chart .dashboard-subtitle-bar,.modal-body .dashboard-tendency-container .dashboard-tendency-chart .dashboard-tendency{box-sizing:border-box;width:100%}.modal-body .dashboard-tendency-container .dashboard-sub-bar{width:100%}.modal-body .dashboard-bar-chart-container .dashboard-bar-chart{width:auto}.modal-body .dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-title .percentage{width:107.8px}.modal-body .dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-title .absolut{width:45px}.modal-body .dashboard-bar-chart-container .dashboard-bar-chart-chart{width:154px}.modal-body .dashboard-bar-chart-container .dashboard-sub-bar{width:100%}.absolut{font-weight:300}.dashboard-sub-bar{font-size:10px;font-weight:400}.dashboard-subtitle-bar{font-size:14px;font-weight:300}.dashboard-figure{font-size:16px;font-weight:400}.dashboard-figurePer{font-size:14px;font-weight:300}.dashboard-legend,.dygraph-axis-label.dygraph-axis-label-x,.dygraph-axis-label.dygraph-axis-label-y{font-weight:400;font-size:10px}.dashboard-legend{display:none;height:30px;width:100%}.dashboard-half-height-legend{display:none;font-size:10px;height:100px;width:0}.application-detail-view section.info{width:370px}}@media (min-width:970px) and (max-width:1209px){.dashboard-full-width-chart,.dashboard-full-width-chart .dashboard-full-width-chart-inner,.dashboard-full-width-chart .dashboard-sub-bar,.dashboard-large-chart .dashboard-large-chart-inner,.dashboard-large-chart .dashboard-sub-bar,.dashboard-medium-chart,.dashboard-medium-chart .dashboard-sub-bar,.resizecontainer{width:100%}.dashboard-full-width-chart .dashboard-full-width-chart-inner .dashboard-interior-chart,.dashboard-medium-chart-outer{float:left}.dashboard-large-chart .dashboard-large-chart-inner .dashboard-interior-chart{height:220px}.dashboard-sub-bar-menu{font-size:13px}.dashboard-medium-chart .dashboard-interior-chart{height:220px;width:100%}.dashboard-medium-chart .dashboard-medium-chart-menu{font-size:13px;left:369px;top:0}.dashboard-medium-chart #clusterGraphs svg{height:220px;width:387px}.dashboard-medium-chart #clusterGraphs svg text{font-size:11px}.dashboard-small-chart .dashboard-sub-bar{clear:both;height:65px;margin-bottom:0;width:100%}.dashboard-small-chart .dashboard-small-chart-inner{width:100%}.dashboard-small-chart .dashboard-small-chart-inner .dashboard-interior-chart{height:229px;width:100%}.dashboard-small-chart .dashboard-small-chart-inner .dashboard-interior-chart .nv-axis text{fill:#666;font-size:11px;font-weight:400}.dashboard-tendency-container .dashboard-tendency-chart{height:101.5px}.dashboard-tendency-container .dashboard-tendency-chart .dashboard-figure,.dashboard-tendency-container .dashboard-tendency-chart .dashboard-subtitle-bar,.dashboard-tendency-container .dashboard-tendency-chart .dashboard-tendency{width:105px}.dashboard-tendency-container .dashboard-tendency-chart .dashboard-subtitle-bar{height:31.17px;line-height:31.17px}.dashboard-tendency-container .dashboard-tendency-chart .dashboard-figure{height:52.33px;line-height:25.17px;padding-top:5px}.dashboard-tendency-container .dashboard-sub-bar{width:100%}.dashboard-bar-chart-container{height:98px}.dashboard-bar-chart-container .dashboard-bar-chart{height:93px;width:100%}.dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-title{height:31.33px;line-height:31.33px}.dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-title .percentage{width:163.8px}.dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-title .absolut{line-height:40px;padding-top:15px;width:69px}.dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-chart{box-sizing:border-box;height:50px;margin-top:5px;width:100%}.dashboard-bar-chart-container .dashboard-sub-bar{padding-top:13px;width:100%}.modal-chart-detail{bottom:12.1%!important;left:50%;margin-left:-405px;width:830px!important}.modal-chart-detail .modal-body{height:95%;max-height:none;padding:5px}.modal-chart-detail .modal-dashboard-legend{font-size:13px;min-height:225px;width:130px}.absolut,.percentage{font-size:15px}.modal-chart-detail .modal-inner-detail{width:670px}.modal-body .dashboard-large-chart{width:531px}.modal-body .dashboard-large-chart .dashboard-large-chart-inner .dashboard-interior-chart,.modal-body .dashboard-large-chart .dashboard-sub-bar{width:100%}.modal-body .dashboard-medium-chart-outer{float:left;width:382px}.modal-body .dashboard-medium-chart,.modal-body .dashboard-medium-chart .dashboard-interior-chart,.modal-body .dashboard-medium-chart .dashboard-sub-bar{width:100%}.modal-body .dashboard-small-chart,.modal-body .dashboard-small-chart .dashboard-small-chart-inner,.modal-body .dashboard-small-chart .dashboard-small-chart-inner .dashboard-interior-chart{width:auto}.modal-body .dashboard-medium-chart .dashboard-medium-chart-menu{left:364px}.modal-body .dashboard-small-chart .dashboard-sub-bar{clear:both;width:auto}.modal-body .dashboard-tendency-container,.modal-body .dashboard-tendency-container .dashboard-tendency-chart,.modal-body .dashboard-tendency-container .dashboard-tendency-chart .dashboard-figure,.modal-body .dashboard-tendency-container .dashboard-tendency-chart .dashboard-subtitle-bar,.modal-body .dashboard-tendency-container .dashboard-tendency-chart .dashboard-tendency{box-sizing:border-box;width:100%}.modal-body .dashboard-tendency-container .dashboard-sub-bar{width:100%}.modal-body .dashboard-bar-chart-container .dashboard-bar-chart{width:auto}.modal-body .dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-title .percentage{width:163.8px}.modal-body .dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-title .absolut{width:69px}.modal-body .dashboard-bar-chart-container .dashboard-bar-chart-chart{width:234px}.modal-body .dashboard-bar-chart-container .dashboard-sub-bar{width:100%}.absolut{font-weight:300}.dashboard-sub-bar{font-size:11px;font-weight:400}.dashboard-subtitle-bar{font-size:15px;font-weight:300}.dashboard-figure{font-size:18px;font-weight:400}.dashboard-figurePer{font-size:16px;font-weight:300}.dashboard-legend,.dygraph-axis-label.dygraph-axis-label-x,.dygraph-axis-label.dygraph-axis-label-y{font-weight:400;font-size:11px}.dashboard-legend{height:30px;width:100%}.dashboard-half-height-legend{font-size:11px;height:117.5px;width:60px}.application-detail-view section.info{width:610px}}@media (min-width:1210px) and (max-width:1449px){.dashboard-full-width-chart,.dashboard-full-width-chart .dashboard-full-width-chart-inner,.dashboard-full-width-chart .dashboard-sub-bar,.dashboard-large-chart .dashboard-large-chart-inner,.dashboard-large-chart .dashboard-sub-bar,.dashboard-medium-chart,.dashboard-medium-chart .dashboard-sub-bar,.resizecontainer{width:100%}.dashboard-full-width-chart .dashboard-full-width-chart-inner .dashboard-interior-chart,.dashboard-medium-chart-outer{float:left}.dashboard-large-chart .dashboard-large-chart-inner .dashboard-interior-chart{height:255px}.dashboard-sub-bar-menu{font-size:15px}.dashboard-medium-chart .dashboard-interior-chart{height:255px;width:100%}.dashboard-medium-chart .dashboard-medium-chart-menu{font-size:16px;left:486px;top:0}.dashboard-medium-chart #clusterGraphs svg{height:255px;width:507px}.dashboard-medium-chart #clusterGraphs svg text{font-size:12px}.dashboard-small-chart .dashboard-sub-bar{clear:both;height:65px;margin-bottom:0;width:100%}.dashboard-small-chart .dashboard-small-chart-inner{width:100%}.dashboard-small-chart .dashboard-small-chart-inner .dashboard-interior-chart{height:264px;width:100%}.dashboard-small-chart .dashboard-small-chart-inner .dashboard-interior-chart .nv-axis text{fill:#666;font-size:13px;font-weight:400}.dashboard-tendency-container .dashboard-tendency-chart{height:119px}.dashboard-tendency-container .dashboard-tendency-chart .dashboard-figure,.dashboard-tendency-container .dashboard-tendency-chart .dashboard-subtitle-bar,.dashboard-tendency-container .dashboard-tendency-chart .dashboard-tendency{width:145px}.dashboard-tendency-container .dashboard-tendency-chart .dashboard-subtitle-bar{height:37px;line-height:37px}.dashboard-tendency-container .dashboard-tendency-chart .dashboard-figure{height:64px;line-height:31px;padding-top:5px}.dashboard-tendency-container .dashboard-sub-bar{width:100%}.dashboard-bar-chart-container{height:115.5px}.dashboard-bar-chart-container .dashboard-bar-chart{height:110.5px;width:100%}.dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-title{height:37.17px;line-height:37.17px}.dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-title .percentage{width:219.8px}.dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-title .absolut{line-height:40px;padding-top:15px;width:93px}.dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-chart{box-sizing:border-box;height:50px;margin-top:5px;width:100%}.dashboard-bar-chart-container .dashboard-sub-bar{padding-top:13px;width:100%}.modal-chart-detail{bottom:12.1%!important;left:50%;margin-left:-525px;width:1070px!important}.modal-chart-detail .modal-body{height:95%;max-height:none;padding:5px}.modal-chart-detail .modal-dashboard-legend{font-size:14px;min-height:260px;width:140px}.absolut,.percentage{font-size:18px}.modal-chart-detail .modal-inner-detail{width:900px}.modal-body .dashboard-large-chart{width:691px}.modal-body .dashboard-large-chart .dashboard-large-chart-inner .dashboard-interior-chart,.modal-body .dashboard-large-chart .dashboard-sub-bar{width:100%}.modal-body .dashboard-medium-chart-outer{float:left;width:502px}.modal-body .dashboard-medium-chart,.modal-body .dashboard-medium-chart .dashboard-interior-chart,.modal-body .dashboard-medium-chart .dashboard-sub-bar{width:100%}.modal-body .dashboard-small-chart,.modal-body .dashboard-small-chart .dashboard-small-chart-inner,.modal-body .dashboard-small-chart .dashboard-small-chart-inner .dashboard-interior-chart{width:auto}.modal-body .dashboard-medium-chart .dashboard-medium-chart-menu{left:481px}.modal-body .dashboard-small-chart .dashboard-sub-bar{clear:both;width:auto}.modal-body .dashboard-tendency-container,.modal-body .dashboard-tendency-container .dashboard-tendency-chart,.modal-body .dashboard-tendency-container .dashboard-tendency-chart .dashboard-figure,.modal-body .dashboard-tendency-container .dashboard-tendency-chart .dashboard-subtitle-bar,.modal-body .dashboard-tendency-container .dashboard-tendency-chart .dashboard-tendency{box-sizing:border-box;width:100%}.modal-body .dashboard-tendency-container .dashboard-sub-bar{width:100%}.modal-body .dashboard-bar-chart-container .dashboard-bar-chart{width:auto}.modal-body .dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-title .percentage{width:219.8px}.modal-body .dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-title .absolut{width:93px}.modal-body .dashboard-bar-chart-container .dashboard-bar-chart-chart{width:314px}.modal-body .dashboard-bar-chart-container .dashboard-sub-bar{width:100%}.absolut{font-weight:300}.dashboard-sub-bar{font-size:13px;font-weight:400}.dashboard-subtitle-bar{font-size:18px;font-weight:300}.dashboard-figure{font-size:22px;font-weight:400}.dashboard-figurePer{font-size:20px;font-weight:300}.dygraph-axis-label.dygraph-axis-label-x,.dygraph-axis-label.dygraph-axis-label-y{font-size:13px;font-weight:400}.dashboard-legend{font-size:12px;font-weight:400;height:30px;width:100%}.dashboard-half-height-legend{font-size:12px;height:135px;width:65px}.application-detail-view section.info{width:850px}}@media (min-width:1450px) and (max-width:1689px){.dashboard-full-width-chart,.dashboard-full-width-chart .dashboard-full-width-chart-inner,.dashboard-full-width-chart .dashboard-sub-bar,.dashboard-large-chart .dashboard-large-chart-inner,.dashboard-large-chart .dashboard-sub-bar,.dashboard-medium-chart,.dashboard-medium-chart .dashboard-sub-bar,.resizecontainer{width:100%}.dashboard-full-width-chart .dashboard-full-width-chart-inner .dashboard-interior-chart,.dashboard-medium-chart-outer{float:left}.dashboard-large-chart .dashboard-large-chart-inner .dashboard-interior-chart{height:285px}.dashboard-sub-bar-menu{font-size:15px}.dashboard-medium-chart .dashboard-interior-chart{height:285px;width:100%}.dashboard-medium-chart .dashboard-medium-chart-menu{font-size:18px;left:604px;top:0}.dashboard-medium-chart #clusterGraphs svg{height:285px;width:627px}.dashboard-medium-chart #clusterGraphs svg text{font-size:13px}.dashboard-small-chart .dashboard-sub-bar{clear:both;height:65px;margin-bottom:0;width:100%}.dashboard-small-chart .dashboard-small-chart-inner{width:100%}.dashboard-small-chart .dashboard-small-chart-inner .dashboard-interior-chart{height:294px;width:100%}.dashboard-small-chart .dashboard-small-chart-inner .dashboard-interior-chart .nv-axis text{fill:#666;font-size:13px;font-weight:400}.dashboard-tendency-container .dashboard-tendency-chart{height:134px}.dashboard-tendency-container .dashboard-tendency-chart .dashboard-figure,.dashboard-tendency-container .dashboard-tendency-chart .dashboard-subtitle-bar,.dashboard-tendency-container .dashboard-tendency-chart .dashboard-tendency{width:185px}.dashboard-tendency-container .dashboard-tendency-chart .dashboard-subtitle-bar{height:42px;line-height:42px}.dashboard-tendency-container .dashboard-tendency-chart .dashboard-figure{height:74px;line-height:36px;padding-top:5px}.dashboard-tendency-container .dashboard-sub-bar{width:100%}.dashboard-bar-chart-container{height:130.5px}.dashboard-bar-chart-container .dashboard-bar-chart{height:125.5px;width:100%}.dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-title{height:42.17px;line-height:42.17px}.dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-title .percentage{width:275.8px}.dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-title .absolut{line-height:40px;padding-top:15px;width:117px}.dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-chart{box-sizing:border-box;height:50px;margin-top:5px;width:100%}.dashboard-bar-chart-container .dashboard-sub-bar{padding-top:13px;width:100%}.modal-chart-detail{bottom:12.1%!important;left:50%;margin-left:-645px;width:1310px!important}.modal-chart-detail .modal-body{height:95%;max-height:none;padding:5px}.modal-chart-detail .modal-dashboard-legend{font-size:15px;min-height:290px;width:150px}.absolut,.percentage{font-size:20px}.modal-chart-detail .modal-inner-detail{width:1130px}.modal-body .dashboard-large-chart{width:851px}.modal-body .dashboard-large-chart .dashboard-large-chart-inner .dashboard-interior-chart,.modal-body .dashboard-large-chart .dashboard-sub-bar{width:100%}.modal-body .dashboard-medium-chart-outer{float:left;width:622px}.modal-body .dashboard-medium-chart,.modal-body .dashboard-medium-chart .dashboard-interior-chart,.modal-body .dashboard-medium-chart .dashboard-sub-bar{width:100%}.modal-body .dashboard-small-chart,.modal-body .dashboard-small-chart .dashboard-small-chart-inner,.modal-body .dashboard-small-chart .dashboard-small-chart-inner .dashboard-interior-chart{width:auto}.modal-body .dashboard-medium-chart .dashboard-medium-chart-menu{left:599px}.modal-body .dashboard-small-chart .dashboard-sub-bar{clear:both;width:auto}.modal-body .dashboard-tendency-container,.modal-body .dashboard-tendency-container .dashboard-tendency-chart,.modal-body .dashboard-tendency-container .dashboard-tendency-chart .dashboard-figure,.modal-body .dashboard-tendency-container .dashboard-tendency-chart .dashboard-subtitle-bar,.modal-body .dashboard-tendency-container .dashboard-tendency-chart .dashboard-tendency{box-sizing:border-box;width:100%}.modal-body .dashboard-tendency-container .dashboard-sub-bar{width:100%}.modal-body .dashboard-bar-chart-container .dashboard-bar-chart{width:auto}.modal-body .dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-title .percentage{width:275.8px}.modal-body .dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-title .absolut{width:117px}.modal-body .dashboard-bar-chart-container .dashboard-bar-chart-chart{width:394px}.modal-body .dashboard-bar-chart-container .dashboard-sub-bar{width:100%}.absolut{font-weight:300}.dashboard-sub-bar{font-size:13px;font-weight:400}.dashboard-subtitle-bar{font-size:20px;font-weight:300}.dashboard-figure{font-size:26px;font-weight:400}.dashboard-figurePer{font-size:24px;font-weight:300}.dashboard-legend,.dygraph-axis-label.dygraph-axis-label-x,.dygraph-axis-label.dygraph-axis-label-y{font-weight:400;font-size:13px}.dashboard-legend{height:30px;width:100%}.dashboard-half-height-legend{font-size:13px;height:150px;width:70px}.application-detail-view section.info{width:1090px}}@media (min-width:1690px) and (max-width:1929px){.dashboard-full-width-chart,.dashboard-full-width-chart .dashboard-full-width-chart-inner,.dashboard-full-width-chart .dashboard-sub-bar,.dashboard-large-chart .dashboard-large-chart-inner,.dashboard-large-chart .dashboard-sub-bar,.dashboard-medium-chart,.dashboard-medium-chart .dashboard-sub-bar,.resizecontainer{width:100%}.dashboard-full-width-chart .dashboard-full-width-chart-inner .dashboard-interior-chart,.dashboard-medium-chart-outer{float:left}.dashboard-large-chart .dashboard-large-chart-inner .dashboard-interior-chart{height:325px}.dashboard-sub-bar-menu{font-size:16px}.dashboard-medium-chart .dashboard-interior-chart{height:325px;width:100%}.dashboard-medium-chart .dashboard-medium-chart-menu{font-size:22px;left:720px;top:0}.dashboard-medium-chart #clusterGraphs svg{height:325px;width:747px}.dashboard-medium-chart #clusterGraphs svg text{font-size:14px}.dashboard-small-chart .dashboard-sub-bar{clear:both;height:65px;margin-bottom:0;width:100%}.dashboard-small-chart .dashboard-small-chart-inner{width:100%}.dashboard-small-chart .dashboard-small-chart-inner .dashboard-interior-chart{height:334px;width:100%}.dashboard-small-chart .dashboard-small-chart-inner .dashboard-interior-chart .nv-axis text{fill:#666;font-size:14px;font-weight:400}.dashboard-tendency-container .dashboard-tendency-chart{height:154px}.dashboard-tendency-container .dashboard-tendency-chart .dashboard-figure,.dashboard-tendency-container .dashboard-tendency-chart .dashboard-subtitle-bar,.dashboard-tendency-container .dashboard-tendency-chart .dashboard-tendency{width:225px}.dashboard-tendency-container .dashboard-tendency-chart .dashboard-subtitle-bar{height:48.67px;line-height:48.67px}.dashboard-tendency-container .dashboard-tendency-chart .dashboard-figure{height:87.33px;line-height:42.67px;padding-top:5px}.dashboard-tendency-container .dashboard-sub-bar{width:100%}.dashboard-bar-chart-container{height:150.5px}.dashboard-bar-chart-container .dashboard-bar-chart{height:145.5px;width:100%}.dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-title{height:48.83px;line-height:48.83px}.dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-title .percentage{width:331.8px}.dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-title .absolut{line-height:40px;padding-top:15px;width:141px}.dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-chart{box-sizing:border-box;height:50px;margin-top:5px;width:100%}.dashboard-bar-chart-container .dashboard-sub-bar{padding-top:13px;width:100%}.modal-chart-detail{bottom:12.1%!important;left:50%;margin-left:-765px;width:1550px!important}.modal-chart-detail .modal-body{height:95%;max-height:none;padding:5px}.modal-chart-detail .modal-dashboard-legend{font-size:16px;min-height:330px;width:170px}.absolut,.percentage{font-size:24px}.modal-chart-detail .modal-inner-detail{width:1350px}.modal-body .dashboard-large-chart{width:1011px}.modal-body .dashboard-large-chart .dashboard-large-chart-inner .dashboard-interior-chart,.modal-body .dashboard-large-chart .dashboard-sub-bar{width:100%}.modal-body .dashboard-medium-chart-outer{float:left;width:742px}.modal-body .dashboard-medium-chart,.modal-body .dashboard-medium-chart .dashboard-interior-chart,.modal-body .dashboard-medium-chart .dashboard-sub-bar{width:100%}.modal-body .dashboard-small-chart,.modal-body .dashboard-small-chart .dashboard-small-chart-inner,.modal-body .dashboard-small-chart .dashboard-small-chart-inner .dashboard-interior-chart{width:auto}.modal-body .dashboard-medium-chart .dashboard-medium-chart-menu{left:715px}.modal-body .dashboard-small-chart .dashboard-sub-bar{clear:both;width:auto}.modal-body .dashboard-tendency-container,.modal-body .dashboard-tendency-container .dashboard-tendency-chart,.modal-body .dashboard-tendency-container .dashboard-tendency-chart .dashboard-figure,.modal-body .dashboard-tendency-container .dashboard-tendency-chart .dashboard-subtitle-bar,.modal-body .dashboard-tendency-container .dashboard-tendency-chart .dashboard-tendency{box-sizing:border-box;width:100%}.modal-body .dashboard-tendency-container .dashboard-sub-bar{width:100%}.modal-body .dashboard-bar-chart-container .dashboard-bar-chart{width:auto}.modal-body .dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-title .percentage{width:331.8px}.modal-body .dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-title .absolut{width:141px}.modal-body .dashboard-bar-chart-container .dashboard-bar-chart-chart{width:474px}.modal-body .dashboard-bar-chart-container .dashboard-sub-bar{width:100%}.absolut{font-weight:300}.dashboard-sub-bar{font-size:14px;font-weight:400}.dashboard-subtitle-bar{font-size:24px;font-weight:300}.dashboard-figure{font-size:30px;font-weight:400}.dashboard-figurePer{font-size:28px;font-weight:300}.dashboard-legend,.dygraph-axis-label.dygraph-axis-label-x,.dygraph-axis-label.dygraph-axis-label-y{font-weight:400;font-size:14px}.dashboard-legend{height:30px;width:100%}.dashboard-half-height-legend{font-size:14px;height:170px;width:80px}.application-detail-view section.info{width:1330px}}@media (min-width:1930px) and (max-width:2169px){.dashboard-full-width-chart,.dashboard-full-width-chart .dashboard-full-width-chart-inner,.dashboard-full-width-chart .dashboard-sub-bar,.dashboard-large-chart .dashboard-large-chart-inner,.dashboard-large-chart .dashboard-sub-bar,.dashboard-medium-chart,.dashboard-medium-chart .dashboard-sub-bar,.resizecontainer{width:100%}.dashboard-full-width-chart .dashboard-full-width-chart-inner .dashboard-interior-chart,.dashboard-medium-chart-outer{float:left}.dashboard-large-chart .dashboard-large-chart-inner .dashboard-interior-chart{height:385px}.dashboard-sub-bar-menu{font-size:17px}.dashboard-medium-chart .dashboard-interior-chart{height:385px;width:100%}.dashboard-medium-chart .dashboard-medium-chart-menu{font-size:26px;left:836px;top:0}.dashboard-medium-chart #clusterGraphs svg{height:385px;width:867px}.dashboard-medium-chart #clusterGraphs svg text{font-size:15px}.dashboard-small-chart .dashboard-sub-bar{clear:both;height:65px;margin-bottom:0;width:100%}.dashboard-small-chart .dashboard-small-chart-inner{width:100%}.dashboard-small-chart .dashboard-small-chart-inner .dashboard-interior-chart{height:394px;width:100%}.dashboard-small-chart .dashboard-small-chart-inner .dashboard-interior-chart .nv-axis text{fill:#666;font-size:14px;font-weight:400}.dashboard-tendency-container .dashboard-tendency-chart{height:184px}.dashboard-tendency-container .dashboard-tendency-chart .dashboard-figure,.dashboard-tendency-container .dashboard-tendency-chart .dashboard-subtitle-bar,.dashboard-tendency-container .dashboard-tendency-chart .dashboard-tendency{width:265px}.dashboard-tendency-container .dashboard-tendency-chart .dashboard-subtitle-bar{height:58.67px;line-height:58.67px}.dashboard-tendency-container .dashboard-tendency-chart .dashboard-figure{height:107.33px;line-height:52.67px;padding-top:5px}.dashboard-tendency-container .dashboard-sub-bar{width:100%}.dashboard-bar-chart-container{height:180.5px}.dashboard-bar-chart-container .dashboard-bar-chart{height:175.5px;width:100%}.dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-title{height:58.83px;line-height:58.83px}.dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-title .percentage{width:387.8px}.dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-title .absolut{line-height:40px;padding-top:15px;width:165px}.dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-chart{box-sizing:border-box;height:50px;margin-top:5px;width:100%}.dashboard-bar-chart-container .dashboard-sub-bar{padding-top:13px;width:100%}.modal-chart-detail{bottom:12.1%!important;left:50%;margin-left:-885px;width:1790px!important}.modal-chart-detail .modal-body{height:95%;max-height:none;padding:5px}.modal-chart-detail .modal-dashboard-legend{font-size:17px;min-height:390px;width:180px}.absolut,.percentage{font-size:28px}.modal-chart-detail .modal-inner-detail{width:1580px}.modal-body .dashboard-large-chart{width:1171px}.modal-body .dashboard-large-chart .dashboard-large-chart-inner .dashboard-interior-chart,.modal-body .dashboard-large-chart .dashboard-sub-bar{width:100%}.modal-body .dashboard-medium-chart-outer{float:left;width:862px}.modal-body .dashboard-medium-chart,.modal-body .dashboard-medium-chart .dashboard-interior-chart,.modal-body .dashboard-medium-chart .dashboard-sub-bar{width:100%}.modal-body .dashboard-small-chart,.modal-body .dashboard-small-chart .dashboard-small-chart-inner,.modal-body .dashboard-small-chart .dashboard-small-chart-inner .dashboard-interior-chart{width:auto}.modal-body .dashboard-medium-chart .dashboard-medium-chart-menu{left:831px}.modal-body .dashboard-small-chart .dashboard-sub-bar{clear:both;width:auto}.modal-body .dashboard-tendency-container,.modal-body .dashboard-tendency-container .dashboard-tendency-chart,.modal-body .dashboard-tendency-container .dashboard-tendency-chart .dashboard-figure,.modal-body .dashboard-tendency-container .dashboard-tendency-chart .dashboard-subtitle-bar,.modal-body .dashboard-tendency-container .dashboard-tendency-chart .dashboard-tendency{box-sizing:border-box;width:100%}.modal-body .dashboard-tendency-container .dashboard-sub-bar{width:100%}.modal-body .dashboard-bar-chart-container .dashboard-bar-chart{width:auto}.modal-body .dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-title .percentage{width:387.8px}.modal-body .dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-title .absolut{width:165px}.modal-body .dashboard-bar-chart-container .dashboard-bar-chart-chart{width:554px}.modal-body .dashboard-bar-chart-container .dashboard-sub-bar{width:100%}.absolut{font-weight:300}.dashboard-sub-bar{font-size:15px;font-weight:400}.dashboard-subtitle-bar{font-size:28px;font-weight:300}.dashboard-figure{font-size:34px;font-weight:400}.dashboard-figurePer{font-size:32px;font-weight:300}.dygraph-axis-label.dygraph-axis-label-x,.dygraph-axis-label.dygraph-axis-label-y{font-size:14px;font-weight:400}.dashboard-legend{font-size:15px;font-weight:400;height:30px;width:100%}.dashboard-half-height-legend{font-size:15px;height:200px;width:85px}.application-detail-view section.info{width:1570px}}@media (min-width:2170px) and (max-width:2409px){.dashboard-full-width-chart,.dashboard-full-width-chart .dashboard-full-width-chart-inner,.dashboard-full-width-chart .dashboard-sub-bar,.dashboard-large-chart .dashboard-large-chart-inner,.dashboard-large-chart .dashboard-sub-bar,.dashboard-medium-chart,.dashboard-medium-chart .dashboard-sub-bar,.resizecontainer{width:100%}.dashboard-full-width-chart .dashboard-full-width-chart-inner .dashboard-interior-chart,.dashboard-medium-chart-outer{float:left}.dashboard-large-chart .dashboard-large-chart-inner .dashboard-interior-chart{height:285px}.dashboard-sub-bar-menu{font-size:17px}.dashboard-medium-chart .dashboard-interior-chart{height:285px;width:100%}.dashboard-medium-chart .dashboard-medium-chart-menu{font-size:20px;left:962px;top:0}.dashboard-medium-chart #clusterGraphs svg{height:285px;width:987px}.dashboard-medium-chart #clusterGraphs svg text{font-size:15px}.dashboard-small-chart .dashboard-sub-bar{clear:both;height:65px;margin-bottom:0;width:100%}.dashboard-small-chart .dashboard-small-chart-inner{width:100%}.dashboard-small-chart .dashboard-small-chart-inner .dashboard-interior-chart{height:294px;width:100%}.dashboard-small-chart .dashboard-small-chart-inner .dashboard-interior-chart .nv-axis text{fill:#666;font-size:15px;font-weight:400}.dashboard-tendency-container .dashboard-tendency-chart{height:134px}.dashboard-tendency-container .dashboard-tendency-chart .dashboard-figure,.dashboard-tendency-container .dashboard-tendency-chart .dashboard-subtitle-bar,.dashboard-tendency-container .dashboard-tendency-chart .dashboard-tendency{width:305px}.dashboard-tendency-container .dashboard-tendency-chart .dashboard-subtitle-bar{height:42px;line-height:42px}.dashboard-tendency-container .dashboard-tendency-chart .dashboard-figure{height:74px;line-height:36px;padding-top:5px}.dashboard-tendency-container .dashboard-sub-bar{width:100%}.dashboard-bar-chart-container{height:130.5px}.dashboard-bar-chart-container .dashboard-bar-chart{height:125.5px;width:100%}.dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-title{height:42.17px;line-height:42.17px}.dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-title .percentage{width:443.8px}.dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-title .absolut{line-height:40px;padding-top:15px;width:189px}.dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-chart{box-sizing:border-box;height:50px;margin-top:5px;width:100%}.dashboard-bar-chart-container .dashboard-sub-bar{padding-top:13px;width:100%}.modal-chart-detail{bottom:12.1%!important;left:50%;margin-left:-1005px;width:2030px!important}.modal-chart-detail .modal-body{height:95%;max-height:none;padding:5px}.modal-chart-detail .modal-dashboard-legend{font-size:17px;min-height:290px;width:150px}.absolut,.percentage{font-size:22px}.modal-chart-detail .modal-inner-detail{width:1850px}.modal-body .dashboard-large-chart{width:1331px}.modal-body .dashboard-large-chart .dashboard-large-chart-inner .dashboard-interior-chart,.modal-body .dashboard-large-chart .dashboard-sub-bar{width:100%}.modal-body .dashboard-medium-chart-outer{float:left;width:982px}.modal-body .dashboard-medium-chart,.modal-body .dashboard-medium-chart .dashboard-interior-chart,.modal-body .dashboard-medium-chart .dashboard-sub-bar{width:100%}.modal-body .dashboard-small-chart,.modal-body .dashboard-small-chart .dashboard-small-chart-inner,.modal-body .dashboard-small-chart .dashboard-small-chart-inner .dashboard-interior-chart{width:auto}.modal-body .dashboard-medium-chart .dashboard-medium-chart-menu{left:957px}.modal-body .dashboard-small-chart .dashboard-sub-bar{clear:both;width:auto}.modal-body .dashboard-tendency-container,.modal-body .dashboard-tendency-container .dashboard-tendency-chart,.modal-body .dashboard-tendency-container .dashboard-tendency-chart .dashboard-figure,.modal-body .dashboard-tendency-container .dashboard-tendency-chart .dashboard-subtitle-bar,.modal-body .dashboard-tendency-container .dashboard-tendency-chart .dashboard-tendency{box-sizing:border-box;width:100%}.modal-body .dashboard-tendency-container .dashboard-sub-bar{width:100%}.modal-body .dashboard-bar-chart-container .dashboard-bar-chart{width:auto}.modal-body .dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-title .percentage{width:443.8px}.modal-body .dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-title .absolut{width:189px}.modal-body .dashboard-bar-chart-container .dashboard-bar-chart-chart{width:634px}.modal-body .dashboard-bar-chart-container .dashboard-sub-bar{width:100%}.absolut{font-weight:300}.dashboard-sub-bar{font-size:15px;font-weight:400}.dashboard-subtitle-bar{font-size:22px;font-weight:300}.dashboard-figure{font-size:36px;font-weight:400}.dashboard-figurePer{font-size:34px;font-weight:300}.dashboard-legend,.dygraph-axis-label.dygraph-axis-label-x,.dygraph-axis-label.dygraph-axis-label-y{font-weight:400;font-size:15px}.dashboard-legend{height:30px;width:100%}.dashboard-half-height-legend{font-size:15px;height:150px;width:70px}.application-detail-view section.info{width:1810px}}@media (min-width:2410px) and (max-width:2649px){.dashboard-full-width-chart,.dashboard-full-width-chart .dashboard-full-width-chart-inner,.dashboard-full-width-chart .dashboard-sub-bar,.dashboard-large-chart .dashboard-large-chart-inner,.dashboard-large-chart .dashboard-sub-bar,.dashboard-medium-chart,.dashboard-medium-chart .dashboard-sub-bar,.resizecontainer{width:100%}.dashboard-full-width-chart .dashboard-full-width-chart-inner .dashboard-interior-chart,.dashboard-medium-chart-outer{float:left}.dashboard-large-chart .dashboard-large-chart-inner .dashboard-interior-chart{height:285px}.dashboard-sub-bar-menu{font-size:17px}.dashboard-medium-chart .dashboard-interior-chart{height:285px;width:100%}.dashboard-medium-chart .dashboard-medium-chart-menu{font-size:20px;left:1082px;top:0}.dashboard-medium-chart #clusterGraphs svg{height:285px;width:1107px}.dashboard-medium-chart #clusterGraphs svg text{font-size:15px}.dashboard-small-chart .dashboard-sub-bar{clear:both;height:65px;margin-bottom:0;width:100%}.dashboard-small-chart .dashboard-small-chart-inner{width:100%}.dashboard-small-chart .dashboard-small-chart-inner .dashboard-interior-chart{height:294px;width:100%}.dashboard-small-chart .dashboard-small-chart-inner .dashboard-interior-chart .nv-axis text{fill:#666;font-size:15px;font-weight:400}.dashboard-tendency-container .dashboard-tendency-chart{height:134px}.dashboard-tendency-container .dashboard-tendency-chart .dashboard-figure,.dashboard-tendency-container .dashboard-tendency-chart .dashboard-subtitle-bar,.dashboard-tendency-container .dashboard-tendency-chart .dashboard-tendency{width:345px}.dashboard-tendency-container .dashboard-tendency-chart .dashboard-subtitle-bar{height:42px;line-height:42px}.dashboard-tendency-container .dashboard-tendency-chart .dashboard-figure{height:74px;line-height:36px;padding-top:5px}.dashboard-tendency-container .dashboard-sub-bar{width:100%}.dashboard-bar-chart-container{height:130.5px}.dashboard-bar-chart-container .dashboard-bar-chart{height:125.5px;width:100%}.dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-title{height:42.17px;line-height:42.17px}.dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-title .percentage{width:499.8px}.dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-title .absolut{line-height:40px;padding-top:15px;width:213px}.dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-chart{box-sizing:border-box;height:50px;margin-top:5px;width:100%}.dashboard-bar-chart-container .dashboard-sub-bar{padding-top:13px;width:100%}.modal-chart-detail{bottom:12.1%!important;left:50%;margin-left:-1125px;width:2270px!important}.modal-chart-detail .modal-body{height:95%;max-height:none;padding:5px}.modal-chart-detail .modal-dashboard-legend{font-size:17px;min-height:290px;width:150px}.absolut,.percentage{font-size:22px}.modal-chart-detail .modal-inner-detail{width:2090px}.modal-body .dashboard-large-chart{width:1491px}.modal-body .dashboard-large-chart .dashboard-large-chart-inner .dashboard-interior-chart,.modal-body .dashboard-large-chart .dashboard-sub-bar{width:100%}.modal-body .dashboard-medium-chart-outer{float:left;width:1102px}.modal-body .dashboard-medium-chart,.modal-body .dashboard-medium-chart .dashboard-interior-chart,.modal-body .dashboard-medium-chart .dashboard-sub-bar{width:100%}.modal-body .dashboard-small-chart,.modal-body .dashboard-small-chart .dashboard-small-chart-inner,.modal-body .dashboard-small-chart .dashboard-small-chart-inner .dashboard-interior-chart{width:auto}.modal-body .dashboard-medium-chart .dashboard-medium-chart-menu{left:1077px}.modal-body .dashboard-small-chart .dashboard-sub-bar{clear:both;width:auto}.modal-body .dashboard-tendency-container,.modal-body .dashboard-tendency-container .dashboard-tendency-chart,.modal-body .dashboard-tendency-container .dashboard-tendency-chart .dashboard-figure,.modal-body .dashboard-tendency-container .dashboard-tendency-chart .dashboard-subtitle-bar,.modal-body .dashboard-tendency-container .dashboard-tendency-chart .dashboard-tendency{box-sizing:border-box;width:100%}.modal-body .dashboard-tendency-container .dashboard-sub-bar{width:100%}.modal-body .dashboard-bar-chart-container .dashboard-bar-chart{width:auto}.modal-body .dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-title .percentage{width:499.8px}.modal-body .dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-title .absolut{width:213px}.modal-body .dashboard-bar-chart-container .dashboard-bar-chart-chart{width:714px}.modal-body .dashboard-bar-chart-container .dashboard-sub-bar{width:100%}.absolut{font-weight:300}.dashboard-sub-bar{font-size:15px;font-weight:400}.dashboard-subtitle-bar{font-size:22px;font-weight:300}.dashboard-figure{font-size:36px;font-weight:400}.dashboard-figurePer{font-size:34px;font-weight:300}.dashboard-legend,.dygraph-axis-label.dygraph-axis-label-x,.dygraph-axis-label.dygraph-axis-label-y{font-weight:400;font-size:15px}.dashboard-legend{height:30px;width:100%}.dashboard-half-height-legend{font-size:15px;height:150px;width:70px}.application-detail-view section.info{width:2050px}}@media (min-width:2650px) and (max-width:2889px){.dashboard-full-width-chart,.dashboard-full-width-chart .dashboard-full-width-chart-inner,.dashboard-full-width-chart .dashboard-sub-bar,.dashboard-large-chart .dashboard-large-chart-inner,.dashboard-large-chart .dashboard-sub-bar,.dashboard-medium-chart,.dashboard-medium-chart .dashboard-sub-bar,.resizecontainer{width:100%}.dashboard-full-width-chart .dashboard-full-width-chart-inner .dashboard-interior-chart,.dashboard-medium-chart-outer{float:left}.dashboard-large-chart .dashboard-large-chart-inner .dashboard-interior-chart{height:285px}.dashboard-sub-bar-menu{font-size:17px}.dashboard-medium-chart .dashboard-interior-chart{height:285px;width:100%}.dashboard-medium-chart .dashboard-medium-chart-menu{font-size:20px;left:1202px;top:0}.dashboard-medium-chart #clusterGraphs svg{height:285px;width:1227px}.dashboard-medium-chart #clusterGraphs svg text{font-size:15px}.dashboard-small-chart .dashboard-sub-bar{clear:both;height:65px;margin-bottom:0;width:100%}.dashboard-small-chart .dashboard-small-chart-inner{width:100%}.dashboard-small-chart .dashboard-small-chart-inner .dashboard-interior-chart{height:294px;width:100%}.dashboard-small-chart .dashboard-small-chart-inner .dashboard-interior-chart .nv-axis text{fill:#666;font-size:15px;font-weight:400}.dashboard-tendency-container .dashboard-tendency-chart{height:134px}.dashboard-tendency-container .dashboard-tendency-chart .dashboard-figure,.dashboard-tendency-container .dashboard-tendency-chart .dashboard-subtitle-bar,.dashboard-tendency-container .dashboard-tendency-chart .dashboard-tendency{width:385px}.dashboard-tendency-container .dashboard-tendency-chart .dashboard-subtitle-bar{height:42px;line-height:42px}.dashboard-tendency-container .dashboard-tendency-chart .dashboard-figure{height:74px;line-height:36px;padding-top:5px}.dashboard-tendency-container .dashboard-sub-bar{width:100%}.dashboard-bar-chart-container{height:130.5px}.dashboard-bar-chart-container .dashboard-bar-chart{height:125.5px;width:100%}.dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-title{height:42.17px;line-height:42.17px}.dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-title .percentage{width:555.8px}.dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-title .absolut{line-height:40px;padding-top:15px;width:237px}.dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-chart{box-sizing:border-box;height:50px;margin-top:5px;width:100%}.dashboard-bar-chart-container .dashboard-sub-bar{padding-top:13px;width:100%}.modal-chart-detail{bottom:12.1%!important;left:50%;margin-left:-1245px;width:2510px!important}.modal-chart-detail .modal-body{height:95%;max-height:none;padding:5px}.modal-chart-detail .modal-dashboard-legend{font-size:17px;min-height:290px;width:150px}.absolut,.percentage{font-size:22px}.modal-chart-detail .modal-inner-detail{width:2330px}.modal-body .dashboard-large-chart{width:1651px}.modal-body .dashboard-large-chart .dashboard-large-chart-inner .dashboard-interior-chart,.modal-body .dashboard-large-chart .dashboard-sub-bar{width:100%}.modal-body .dashboard-medium-chart-outer{float:left;width:1222px}.modal-body .dashboard-medium-chart,.modal-body .dashboard-medium-chart .dashboard-interior-chart,.modal-body .dashboard-medium-chart .dashboard-sub-bar{width:100%}.modal-body .dashboard-small-chart,.modal-body .dashboard-small-chart .dashboard-small-chart-inner,.modal-body .dashboard-small-chart .dashboard-small-chart-inner .dashboard-interior-chart{width:auto}.modal-body .dashboard-medium-chart .dashboard-medium-chart-menu{left:1197px}.modal-body .dashboard-small-chart .dashboard-sub-bar{clear:both;width:auto}.modal-body .dashboard-tendency-container,.modal-body .dashboard-tendency-container .dashboard-tendency-chart,.modal-body .dashboard-tendency-container .dashboard-tendency-chart .dashboard-figure,.modal-body .dashboard-tendency-container .dashboard-tendency-chart .dashboard-subtitle-bar,.modal-body .dashboard-tendency-container .dashboard-tendency-chart .dashboard-tendency{box-sizing:border-box;width:100%}.modal-body .dashboard-tendency-container .dashboard-sub-bar{width:100%}.modal-body .dashboard-bar-chart-container .dashboard-bar-chart{width:auto}.modal-body .dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-title .percentage{width:555.8px}.modal-body .dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-title .absolut{width:237px}.modal-body .dashboard-bar-chart-container .dashboard-bar-chart-chart{width:794px}.modal-body .dashboard-bar-chart-container .dashboard-sub-bar{width:100%}.absolut{font-weight:300}.dashboard-sub-bar{font-size:15px;font-weight:400}.dashboard-subtitle-bar{font-size:22px;font-weight:300}.dashboard-figure{font-size:36px;font-weight:400}.dashboard-figurePer{font-size:34px;font-weight:300}.dashboard-legend,.dygraph-axis-label.dygraph-axis-label-x,.dygraph-axis-label.dygraph-axis-label-y{font-weight:400;font-size:15px}.dashboard-legend{height:30px;width:100%}.dashboard-half-height-legend{font-size:15px;height:150px;width:70px}.application-detail-view section.info{width:2290px}}div.headerBar{position:absolute}div.centralRow{background:rgba(64,74,83,.04);height:100%;min-height:100%;overflow-y:auto;position:relative;right:0}div.centralContent{background-color:transparent;margin-top:10px;width:100%;padding:5px 5px 20px}.contentDiv{list-style:none;padding:0}.contentDiv li{background-color:rgba(0,0,0,.05)}.contentDiv a.add{display:block;font-weight:400;padding:40px 0;text-align:left}.modal-body th .valueCell,.modal-body th th.actionCell,.modal-body th th.keyCell,.waitModal{text-align:center}.contentDiv .icon{padding-left:5px;padding-right:5px;padding-top:10px}.contentDiv:after{clear:both}.contentDiv:after,.contentDiv:before{display:table;line-height:0}.clusterInfoIcon{float:left;padding-left:5px;padding-top:2px}.waitModal.icon{font-size:100px;height:120px}.waitModal.message{font-size:20px}.icon_arangodb_info{color:#333;font-size:23px}li a [class*=" icon_arangodb"],li a [class^=icon_arangodb]{font-size:18px;position:absolute;right:4px;top:2px}.fa-minus-circle{color:#e74c3c;font-size:14pt}.fa-plus-circle{color:#2ecc71;font-size:16pt}.fa-minus-circle:hover,.fa-plus-circle:hover{cursor:pointer}.dropdownImport,div.headerDropdown{background-color:#fff;border:1px solid rgba(140,138,137,.25);border-radius:2px;clear:both;display:none;margin-bottom:15px;padding:10px;position:relative;width:auto}.dropdownImport.smallDropdown .dropdownInner,div.headerDropdown.smallDropdown .dropdownInner{min-height:20px}.dropdownImport.headerDropdown input[type=checkbox].css-checkbox,div.headerDropdown.headerDropdown input[type=checkbox].css-checkbox{display:none}.dropdownImport.headerDropdown input[type=checkbox].css-checkbox label.css-label,div.headerDropdown.headerDropdown input[type=checkbox].css-checkbox label.css-label{background-position:0 0;background-repeat:no-repeat;display:inline-block;font-size:15px;height:15px;margin-top:0;padding-left:20px;vertical-align:middle}.dropdownImport.headerDropdown input[type=checkbox].css-checkbox:checked+label.css-label,div.headerDropdown.headerDropdown input[type=checkbox].css-checkbox:checked+label.css-label{background-position:0 -15px}div.dropdown-title{margin-bottom:10px}div.dropdownInner{-webkit-box-shadow:0;-moz-box-shadow:0;box-shadow:0;min-height:125px;position:relative;width:auto}div.dropdownInner .nav-header{font-size:10pt}div.dropdownInner>.nav-header{color:#000;font-size:10pt;font-weight:400}div.dropdownInner>label{color:#000;font-weight:300}div.dropdownInner ul{border-left:1px solid rgba(140,138,137,.25);display:inline;list-style-type:none;margin-left:10px;margin-top:10px;min-height:105px;width:175px}div.dropdownInner ul:first-of-type,div.queryline input[type=file]{border:0}div.dropdownInner ul label{color:#000;padding-left:20px}div.dropdownInner ul li .fa{color:#999;margin-right:5px}div.dropdownInner ul li .fa.fa-square-o{margin-left:1px;margin-right:6px}div.dropdownInner ul li .fa.fa-check-circle-o,div.dropdownInner ul li .fa.fa-check-square-o,div.dropdownInner ul li .fa.fa-dot-circle-o{color:#2ecc71}div.queryline{color:#000;height:35px}div.queryline .textDiv{margin-right:10px;margin-top:4px}div.queryline input,div.queryline select{margin-bottom:5px}div.queryline input{width:16%}div.queryline.querylineAdd span{color:#fff;padding-left:10px;position:relative;top:-21px}div.queryline .removeFilterItem i{margin-left:5px!important;margin-top:0!important}div.queryline div.searchByAttribute{margin-left:6px;margin-right:6px;position:relative}div.queryline div.searchByAttribute input{width:140px}div.queryline div.searchByAttribute>ul.gv-dropdown-menu{-moz-border-radius:0;-webkit-border-radius:0;border-radius:0;background-color:#fff;color:#fff;display:none;left:0;position:absolute;top:20px;width:247px}div.dropdownImport{background-color:#fff;border-radius:3px;display:none;position:relative;padding:10px 10px 5px}div.dropdownImport input{line-height:0;margin-bottom:-15px;margin-top:5px}select.filterSelect{color:#00f;margin-left:10px;margin-right:10px;width:80px}#filterHeader button{float:right;margin-left:10px!important;margin-top:1px}div.input-append button.gv_example_toggle{-moz-border-radius:0 4px 4px 0;-webkit-border-radius:0 4px 4px 0;border-radius:0 4px 4px 0;background-color:#8f8d8c;height:30px;margin-left:-1px;padding-left:10px;padding-right:10px;padding-top:12px;vertical-align:top}div.input-append button.gv_example_toggle:hover{background-color:#2ecc71}.searchEqualsLabel{margin-left:6px;margin-right:6px}img.gv-throbber{background-image:url(../img/swagger/throbber.gif)}span.gv_caret{border-top:5px solid #fff;margin-top:2px!important}input.search-input{border:1px solid #fff;height:20px;line-height:20px;margin-right:-4px;margin-top:3px;width:120px}.search-field{margin-left:10px;margin-right:3px}.search-field .fa-search{color:#c2c2c2;font-size:12pt;margin-left:-20px;opacity:.5;position:absolute;right:9px;top:9px}div.headerBar,div.headerBar .infoField{color:#000;float:right;padding-left:5px;padding-right:5px}.search-field .fa-search:hover{cursor:pointer;opacity:1}.gv-search-submit-icon,.search-submit-icon{background-image:url(../img/enter_icon.png);background-size:14px;height:14px;margin-left:-18px;opacity:.2;position:absolute;width:14px}.gv-search-submit-icon:hover,.search-submit-icon:hover{opacity:.8}.search-submit-icon{margin-top:11px}.gv-search-submit-icon{margin-top:6px}div.headerBar{background-color:none;border-radius:2px;font-size:16px;height:36px;margin-top:-55px;right:0}div.headerBar.marginTop5{margin-top:-60px}div.headerBar select:focus{outline:0}div.headerBar .infoField{background-color:#fff;border:1px solid rgba(140,138,137,.25);border-radius:3px!important;font-size:12px;margin-right:7px;margin-top:7px}div.headerBar .infoField .fa{cursor:pointer;margin-left:5px}div.headerBar input[type=checkbox].css-checkbox{display:none}div.headerBar input[type=checkbox].css-checkbox label.css-label{background-position:0 0;background-repeat:no-repeat;cursor:pointer;display:inline-block;font-size:15px;height:15px;margin-top:0;padding-left:20px;vertical-align:middle}div.headerBar input[type=checkbox].css-checkbox:checked+label.css-label{background-position:0 -15px}div.headerBar input[type=radio]{display:none}div.headerBar input[type=radio] label span{background:url(../img/check_radio_sheet.png) -38px top no-repeat;cursor:pointer;display:inline-block;height:19px;margin:-1px 4px 0 0;vertical-align:middle;width:19px}#transparentHeader input[type=checkbox].css-checkbox,.contentTables tr.contentRowActive span,.dashboard-legend .dashboard-legend-inner br,.dashboard-row .fa-arrows-alt,.modal-delete-confirmation,.nvtooltip{display:none}div.headerBar input[type=radio]:checked+label span{background:url(../img/check_radio_sheet.png) -57px top no-repeat}.headerButtonList a span .fa-top{color:#fff;font-size:7pt;position:absolute}.headerButtonList a span .fa-top:hover{color:#2ecc71}.headerButtonList a.error{color:#e74c3c}.headerButtonList a.error:hover{background-color:#e74c3c;border-color:#e74c3c;color:#fff}.headerBar a.arangoHeader{color:#000;font-size:11.5pt;font-weight:100;left:0;position:relative;top:7px}.headerBar>div.headerButtonBar{margin:4px 0;margin-bottom:0!important}.breadcrumb{background:0 0;border:0;border-radius:0;color:#fff;font-size:12pt;font-weight:100;line-height:45px;margin:0 0 0 -4px;padding:0 0 0 10px}.breadcrumb .fa{margin-left:10px;margin-right:8px}.breadcrumb .fa-ellipsis-v{font-size:10pt;opacity:0}.breadcrumb .disabledBread{color:#fff;float:left;font-size:12pt;font-weight:100;padding-right:5px;position:relative}.breadcrumb .disabledBread i{font-size:10pt;margin-left:10px}.breadcrumb .disabledBread:hover{cursor:default}.breadcrumb .activeBread{color:#fff;float:left;font-size:11pt;font-weight:100;-webkit-tap-highlight-color:transparent;-webkit-transition:opacity .2s cubic-bezier(.645,.045,.355,1);transition:opacity .2s cubic-bezier(.645,.045,.355,1)}.breadcrumb .activeBread:hover{opacity:.65}.breadcrumb a{color:#fff!important;opacity:.8;transition:all .2s ease-in}.breadcrumb a:hover,.subViewNavbar li:hover a{-moz-transition:all .2s ease-in;-o-transition:all .2s ease-in;-webkit-transition:all .2s ease-in}.breadcrumb a:hover{opacity:1;transition:all .2s ease-in}.breadcrumb #app-development-path{background-color:#fff;border-bottom:1px solid rgba(140,138,137,.25);border-left:1px solid rgba(140,138,137,.25);border-radius:3px;border-right:1px solid rgba(140,138,137,.25);height:24px;margin-left:-6px;margin-top:-10px;padding-left:5px;width:100%}.arangoHeader{font-weight:400}.sectionHeader{background-color:#404a53;margin-bottom:10px;padding-bottom:2px;padding-top:10px;width:100%}.sectionHeader .title{color:#fff;font-size:12pt;font-weight:100;line-height:20pt;margin-left:10px}.sectionHeader .information{float:right;font-size:12.5pt;font-weight:100}.sectionHeader .information .fa{font-size:17pt}.sectionHeader .information span:first-child{margin-left:10px}.sectionHeader .information span span{position:relative;top:-2px}.sectionHeader .information span.positive{color:#2ecc71}.sectionHeader .information span.warning{color:#f1c40f}.sectionHeader .information span.negative{color:#e74c3c}.sectionHeader .information i{margin-left:5px;margin-right:10px}.sectionHeader .scaleGroup{float:right;margin-right:10px;position:inherit;width:80px}.sectionHeader .scaleGroup span{border-radius:30px;color:#fff;padding:3px 5px;position:relative;top:-4px}.sectionHeader .scaleGroup span.left{background:#e74c3c;margin-right:-19px}.sectionHeader .scaleGroup span.right{background:#2ecc71;margin-left:-16px}.sectionHeader .scaleGroup span.left:hover,.sectionHeader .scaleGroup span.right:hover{cursor:pointer}.sectionHeader .scaleGroup input{background:#404a53!important;border-color:rgba(255,255,255,.3);color:#fff;font-weight:100;height:10px;text-align:center;width:40px}.checkboxLabel{margin-top:4px;padding-left:0}.css-label{background-image:url(../img/dark-check-green.png)}.css-label-round{background-image:url(../img/dark-check-green-round.png)}.modal-dashboard-header,.modal-header{background-color:#fff;border-bottom:0!important;border-radius:3px;margin-top:5px;padding-left:5px;padding-right:10px;padding-top:4px}.modal-dashboard-header .arangoHeader,.modal-header .arangoHeader{color:#000;font-size:13pt;font-weight:100;left:5px;position:relative;top:2px}.modal-dashboard-header a,.modal-header a{top:2px!important}.modal-dashboard-header .close,.modal-header .close{color:#fff;font-weight:300;margin-top:2px;opacity:.5}.modal-dashboard-header .close:hover,.modal-header .close:hover{opacity:1}.select2-drop-active{border:2px solid #3498db;border-top:0;margin-top:-2px;width:452px!important;z-index:9999999}.select2-no-results,.select2-results{font-weight:100}.modal-tabbar{border-bottom:1px solid #666}.modal-body{color:#736b68;font-size:14px;font-weight:300;max-height:410px}.modal-body input{height:20px;width:436px}.modal-body select{height:33px;width:452px}.modal-body .select2-container-multi.select2-container-active .select2-choices{border:2px solid #3498db}.modal-body .select2-choices{background-image:none!important;border:2px solid rgba(140,138,137,.25);border-radius:3px;-webkit-box-shadow:none;box-shadow:none;width:448px}.modal-body .select2-choices input:active{-webkit-box-shadow:none;box-shadow:none;outline:0!important}.modal-body .select2-choices .select2-search-choice{margin:5px 0 3px 5px!important}.modal-body .select2-choices li{background-color:#fff!important;background-image:none!important;color:#000}.modal-body tr.first,.modal-body tr.last,.modal-body tr.middle{background-color:#f5f8f0}.modal-body .select2-choices li a{margin-left:1px;margin-top:-1px}.modal-body .select2-choices:active{border:1px solid #999;-webkit-box-shadow:none!important;box-shadow:none!important;outline:transparent!important}.modal-body .nav-tabs{margin-top:15px}.modal-body .nav-tabs>li>a:hover{border-color:#8c8a89}.modal-body input,.modal-body select,.modal-body textarea{margin-top:10px}.modal-body input[type=checkbox]{margin-bottom:10px}.modal-body input[type=text].invalid-input{border-color:rgba(234,23,23,.6)}.modal-body input[type=text].invalid-input:focus{-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(234,23,23,.6);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(234,23,23,.6);box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(234,23,23,.6)}.modal-body input[type=file]{line-height:17px}.modal-body tr.spacer{height:20px}.modal-body tr.first th:first-child{border-top-left-radius:3px}.modal-body tr.first th:last-child{border-top-right-radius:3px}.modal-body tr.middle{padding-left:10px;padding-right:10px}.modal-body tr.last th:first-child{border-bottom-left-radius:3px}.modal-body tr.last th:last-child{border-bottom-right-radius:3px}.modal-body tr.first th:first-child,.modal-body tr.last th:first-child,.modal-body tr.middle th:first-child{padding-left:10px}.modal-body tr.first th:last-child,.modal-body tr.last th:last-child,.modal-body tr.middle th:last-child{padding-right:10px}.modal-body th.actionCell{width:30px}.modal-body th.keyCell{width:170px}.modal-body th.keyCell input{width:150px}.modal-body th .valueCell{width:300px}.modal-body th .valueCell input{width:290px}.modal-body th .select2-container{margin-bottom:10px;margin-top:10px}.modal-body .icon-info-sign{margin-bottom:10px;margin-left:10px;opacity:.7;padding-bottom:5px}.modal-body .icon-info-sign:hover{opacity:1}.modal-body .icon_arangodb_info{color:#736b68;font-size:18px;margin-top:-10px;position:absolute;right:12px}.modal-body .icon_arangodb_info:hover{color:#000}.modal-body .collapse{margin-right:-14px;position:relative}.modal-body .accordion-inner{border-top:0;margin-left:0;padding-left:0;padding-right:0}.modal-body .accordion-toggle span .caret{border-top-color:#000;float:right;margin-top:5px}.modal-body .accordion-toggle.collapsed span .caret{-ms-transform:rotate(90deg);-webkit-transform:rotate(90deg);transform:rotate(90deg)}.modal-body .collectionTh{height:55px}.modal-body .tab-content{min-height:200px}.modal-body .tab-content .tab-pane{border-top:1px solid #666!important;margin-left:0!important;padding-top:10px}.modal-body .tab-content .tab-pane-modal{border-top:none!important}.modal-body .tab-content #appstore{max-height:290px}.modal-body .errorMessage{background:#e74c3c;border-radius:4px;color:#fff;font-size:9pt;font-weight:100;margin-top:-9px;padding-left:5px;padding-right:5px;position:absolute}.modal-body .nav .tab-icon{margin-right:5px;margin-top:-3px;width:20px}.modal-text{font-weight:300;padding-bottom:3px;padding-top:3px}.modal-backdrop,.modal-backdrop.fade.in{opacity:.4}.fade{opacity:0;-moz-transition:opacity .03s linear;-ms-transition:opacity .03s linear;-o-transition:opacity .03s linear;-webkit-transition:opacity .03s linear;transition:opacity .03s linear}.modal{border:0!important;border-radius:3px!important;box-shadow:0;margin-left:-325px!important;width:650px;z-index:9999999}.modal .fade.in{top:12.1%!important}.modal table tr:last-child{border-bottom:0!important}.waitModal{-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;background:0 0;border:0;color:#fff}.waitModalBackdrop{opacity:.7!important}.modalTooltips span{color:#736b68;font-size:20px}.modalTooltips span:hover{color:#000}.gv-object-view{text-align:left;white-space:pre}.capitalize{text-transform:capitalize}.modal-footer{border-top:0!important;padding-right:17px}.modal-footer .button-close{margin-left:20px;margin-right:10px}.modal-header{margin-left:5px;margin-right:5px}.modal-dashboard-header{margin-left:0;margin-right:0;padding-bottom:9px}.modal-delete-confirmation button{margin-right:10px;margin-top:-4px}.modal-delete-confirmation button .modal-confirm-delete{margin-right:-18px}.modal-delete-confirmation fieldset input{float:left}.modal-delete-confirmation fieldset label{float:left;margin-left:10px}.createModalDialog table{width:100%}.createModalDialog .collection-info-figures table{float:left;margin-left:0;margin-right:0;margin-top:0;min-width:200px;padding:3px;text-align:left}.createModalDialog .figures1,.createModalDialog .figures2{margin-bottom:20px;width:300px}.createModalDialog .figures2{margin-left:20px!important}.createModalDialog .figures3{margin-bottom:0;width:100%}.foxx-store-row{border-bottom:10px solid #fff;border-top:10px solid #fff}.foxx-store-row .foxx-name{background:#404a53;border-radius:4px;color:#fff;font-weight:300;margin-bottom:8px;padding-bottom:1px;padding-left:5px;width:100%}.fixedDropdown .dropdown-header a,.fixedDropdown .notificationItem{color:#000}.foxx-store-row .foxx-store-install{padding-right:5px;padding-top:25px}.foxx-store-row .foxx-author{font-size:10pt;font-weight:300;margin-top:-4px}.foxx-store-row .foxx-version{font-weight:400;margin-top:25px}#new-app-mount{margin-right:24px;width:360px}#control_event_edge_delete_modal,#control_event_edge_edit_modal,#control_event_new_node_modal,#control_event_node_delete_modal,#control_event_node_edit_modal{margin-left:-320px;width:640px}.navlogo .stat_cpu,.navlogo .stat_ram{width:26px;height:26px}.navlogo .stat_cpu{margin-top:1px}.navlogo .stat_cpu path{fill:#aa0}.navlogo .stat_ram path{fill:#070}.navlogo .stat_req{height:22px;width:22px}.navlogo .stat_req path{fill:#aa0}#notification_menu .innerDropdownInnerUL{margin-left:0}#noty_bottom_layout_container li{border:0!important}.noty_type_error .arango_message{top:2px}.noty_bar .noty_buttons{background-color:transparent!important;border:0!important;bottom:0;height:1px;margin-bottom:30px!important;margin-top:-35px!important;position:relative;right:-23px}.noty_bar .noty_buttons button{margin-bottom:2px;margin-right:-1px}.noty_bar .arango_message{font-weight:400!important}.noty_bar .arango_message div{float:right;width:20px}.fixedDropdown{background:#fff!important;border-color:rgba(140,138,137,.25)!important;border-radius:3px!important;margin:10px -3px 0!important;right:-1px!important;width:210px}.fixedDropdown .dropdown-header,.fixedDropdown .dropdown-item,.innerDropdownInnerUL{border-bottom:1px solid rgba(0,0,0,.2)}.fixedDropdown .dropdown-header{margin-left:-1px;padding:0!important}.fixedDropdown a{padding-left:5px!important}.fixedDropdown .notificationItemContent{font-size:.9em;font-weight:300;margin-left:15px;max-width:180px;min-height:15px;white-space:normal;width:180px;word-wrap:break-word}.fixedDropdown button{margin-right:5px;margin-top:5px}.fixedDropdown .notificationItem .notificationItemTitle{color:#000;font-weight:400;max-width:165px;overflow-wrap:break-word;white-space:normal;word-wrap:break-word}.fixedDropdown .notificationItem .notificationItemTitle:hover{background-color:transparent;cursor:default}.fixedDropdown .notificationItem i{color:rgba(0,0,0,.2);font-size:20px;padding-left:5px;position:relative;right:2px}.fixedDropdown .notificationItem i:hover{color:#000}.innerDropdownInnerUL{height:220px!important;min-height:220px;overflow-x:hidden;overflow-y:auto;width:100%}.innerDropdownInnerUL .dropdown-item:hover{background-color:#e1e1e1!important}.innerDropdownInnerUL li{width:auto!important}#stat_hd{-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;border:1px solid rgba(140,138,137,.25);height:25px;margin-left:-10px;margin-top:8px;position:relative;right:3px;text-align:center;width:25px}.contentButtons,.contentTables{margin-bottom:10px;width:100%}#stat_hd #stat_hd_counter{color:#c2c2c2;line-height:25px;text-align:center}.fullNotification{background-color:#e74c3c!important;border:1px solid #e74c3c!important}.fullNotification p{color:#fff!important}.contentTables tr.contentRowActive a,.contentTables tr.contentRowInactive a{color:#000!important}.contentButtons{clear:both}.contentButtons #createDatabase,.contentButtons #createUser{margin-left:0}.contentTables thead{text-align:left}.contentTables thead tr{background-color:#fff;border-bottom:1px solid #c2c2c2}.contentTables tbody tr:nth-child(odd){background-color:#d9d9d9}.contentTables tbody tr:nth-child(even){background-color:#fff}.contentTables tr.contentRowActive{background-color:#bdcc92!important;font-weight:400}.contentTables .dbThFirst{width:90%}.contentTables .dbThSecond{width:10%}.contentTables td{padding:12px 18px}.contentTables td span{float:right;font-size:22px}.contentTables .collectionThSec{margin-right:0;width:80%}.contentTables .collectionTh{margin-right:0;width:5%}.usermenu{width:40px}.userImg{margin-top:-11px}.userImg .caret{margin-top:13px}.user-menu-img{-moz-border-radius:2px;-webkit-border-radius:2px;border-radius:2px;background-color:#fff;height:25px}.ui-tooltip{background-color:#2ecc71!important;border:0!important;border-radius:3px!important;box-shadow:none!important;color:#fff!important;font-size:10pt!important;font-weight:100!important;z-index:99999999}.tooltip-inner{max-width:300px!important;white-space:normal!important;word-wrap:break-word!important}.arangoDataTable .key,.dashboard-sub-bar .dashboard-sub-bar-title,.dbselection,.subnavmenu .icon,.subnavmenu .info,.subnavmenu .state,div.gv-colour-list li{text-overflow:ellipsis;white-space:nowrap}.index-tooltip{color:#736b68}.index-tooltip:hover{color:#000}.index-tooltip .arangoicon{font-size:18px!important}.tooltipInfoTh{width:10%}.arangoToolbar span.action:hover{background-color:#2ecc71;border-radius:3px;color:#fff;cursor:pointer}.arangoToolbar{background-color:#fff;border:1px solid rgba(140,138,137,.25);height:45px;width:100%}.arangoToolbar .pull-left,.arangoToolbar .pull-right{height:30px;margin-top:8px}.arangoToolbar .pull-left i.positive,.arangoToolbar .pull-right i.positive{color:#2ecc71}.arangoToolbar .pull-left i.warning,.arangoToolbar .pull-right i.warning{color:#f1c40f}.arangoToolbar .pull-left button{margin-left:8px}.arangoToolbar .pull-right button:first-child,.arangoToolbar .pull-right select:first-child{margin-right:6px}.arangoToolbar span{padding:5px 8px;position:relative;top:5px;font-weight:100;margin-left:10px}.arangoToolbar span.clickable{cursor:pointer;margin-left:0;opacity:.5;top:1px}.arangoToolbar span.clickable:hover{opacity:1}.arangoToolbar i{font-size:11pt;font-style:normal}.arangoToolbar i.fa{font-size:12pt;margin-right:5px}.arangoToolbar .toolbarType{background:#5bc0de;border-radius:3px;color:#fff;margin-left:8px}.arangoToolbar .styled-select{width:auto}.arangoToolbarBottom{clear:both}.arangoToolbarBottom #executeQuery{margin-right:8px}.arangoToolbarBottom .button-close:last-child{margin-right:10px}.dbselection{float:left;margin-right:3px;max-width:160px;overflow:hidden}.dbselection .fa{color:#fff;opacity:.3}.dbselection .fa-caret-square-o-down{margin-left:5px}.dashboard-bar-chart-container,.dashboard-full-width-chart .dashboard-full-width-chart-inner,.dashboard-large-chart .dashboard-large-chart-inner,.dashboard-medium-chart,.dashboard-small-chart .dashboard-small-chart-inner,.dashboard-tendency-container{background-color:#fff;border-left:0 solid #000;box-sizing:border-box}.dashboard-bar-chart-container:first-child,.dashboard-full-width-chart .dashboard-full-width-chart-inner:first-child,.dashboard-large-chart .dashboard-large-chart-inner:first-child,.dashboard-medium-chart:first-child,.dashboard-small-chart .dashboard-small-chart-inner:first-child,.dashboard-tendency-container:first-child{margin-left:0}.dashboard-bar-chart-container,.dashboard-full-width-chart,.dashboard-large-chart,.dashboard-medium-chart,.dashboard-small-chart,.dashboard-tendency-container{border:1px solid rgba(64,74,83,.2);margin-left:-1px;margin-top:-2px;position:relative}.dashboard-interior-chart{width:100%!important}.dashboard-interior-chart>div{margin-left:-15px;margin-top:10px}.dashboard-sub-bar-menu{cursor:pointer;position:absolute;right:9px;top:6px}.dataNotReadyYet{color:#f1c40f;font-size:14px;font-weight:100;text-align:center}.dashboard-sub-bar,.dashboard-sub-bar .dashboard-sub-bar-title{font-size:11pt;font-weight:600;text-align:center;text-transform:uppercase}.dashboard-sub-bar{background-color:#fff;color:rgba(0,0,0,.5);height:50px;line-height:24px;margin:0;padding:10px 6px 20px}.dashboard-sub-bar .dashboard-sub-bar-title{color:#000;opacity:.5;overflow:hidden;width:100%}.dashboard-full-width-chart{border:1px solid rgba(104,103,102,.1);border-radius:0;margin-right:12px;width:100%}.dashboard-full-width-chart .dashboard-full-width-chart-inner,.dashboard-large-chart .dashboard-large-chart-inner,.dashboard-small-chart .dashboard-small-chart-inner{border-left:5px solid #fff;border-right:5px solid #fff;border-top:5px solid #fff;padding-bottom:10px}.dashboard-full-width-chart .dashboard-full-width-chart-inner{background-color:#fff;padding-top:12px;width:100%}.dashboard-full-width-chart .dashboard-full-width-chart-inner .dashboard-subtitle-bar.top{border-bottom:1px solid #e1e1e1;height:48px;line-height:48px;text-align:right}.dashboard-full-width-chart .dashboard-full-width-chart-inner .dashboard-interior-chart .inner{margin-left:10px;margin-right:10px}.dashboard-full-width-chart .dashboard-full-width-chart-inner .dashboard-interior-chart .inner table{margin-bottom:10px;margin-top:10px;table-layout:fixed;width:100%}.dashboard-large-chart .dashboard-large-chart-inner .dashboard-interior-chart,.dashboard-medium-chart .dashboard-interior-chart{margin-bottom:0}.dashboard-full-width-chart .dashboard-full-width-chart-inner .dashboard-interior-chart .inner table .no-data{font-style:italic;font-weight:100}.dashboard-full-width-chart .dashboard-full-width-chart-inner .dashboard-interior-chart .inner table tr{border-bottom:1px solid rgba(0,0,0,.025)}.dashboard-full-width-chart .dashboard-full-width-chart-inner .dashboard-interior-chart .inner table td:first-child{width:100px}.dashboard-full-width-chart .dashboard-full-width-chart-inner .dashboard-interior-chart .inner table td:last-child{text-align:right}.dashboard-full-width-chart .state{background-color:#8c8a89;border-radius:5px;color:#fff;font-weight:300;margin-left:5px;padding-left:6px;padding-right:6px}.dashboard-large-chart .dashboard-large-chart-inner{background-color:#fff}.dashboard-small-chart{background:#fff;border-radius:0}.dashboard-small-chart .dashboard-small-chart-inner{background-color:#fff;padding-top:5px}.dashboard-small-chart .dashboard-small-chart-inner .dashboard-interior-chart .nv-bar rect{fill-opacity:.15;stroke-opacity:.8;stroke-width:.5px}.dashboard-medium-chart-outer{border-radius:0}.dashboard-medium-chart{background-color:#fff;margin-bottom:0;padding-top:10px}.dashboard-medium-chart .dashboard-medium-chart-menu{-moz-border-radius:0;-webkit-border-radius:0;border-radius:0;border:0 solid rgba(0,0,0,.3);color:rgba(0,0,0,.3);cursor:pointer;padding:0 4px;position:absolute;z-index:1000}.dashboard-medium-chart .dashboard-medium-chart-menu:hover{color:rgba(0,0,0,.7)}.dashboard-medium-chart .dashboard-medium-chart-inner{padding-bottom:10px}.dashboard-medium-chart .clusterChart .slice path{fill-opacity:.15;stroke-opacity:1;stroke-width:1.5px}.tendency-box-sizing .dashboard-row:last-child .dashboard-medium-chart-outer:last-child{margin-left:-2px}.dashboard-tendency-container{box-sizing:content-box}.dashboard-tendency-container .dashboard-sub-bar{height:46px}.dashboard-tendency-container .dashboard-tendency-chart{background-color:#fff;border-left:5px solid #fff;border-right:5px solid #fff;border-top:5px solid #fff;padding-bottom:5px}.dashboard-tendency-container .dashboard-tendency-chart .dashboard-tendency{background-color:#fff;box-sizing:border-box;margin-top:5px;padding:0;width:50%}.dashboard-tendency-container .dashboard-tendency-chart .dashboard-tendency:first-child{border-right:1px solid #e1e1e1}.dashboard-tendency-container .dashboard-tendency-chart .dashboard-tendency .dashboard-subtitle-bar{border-bottom:1px solid #e1e1e1;box-sizing:inherit;padding-right:11px;text-align:right;width:100%}.dashboard-tendency-container .dashboard-tendency-chart .dashboard-tendency .dashboard-figure{box-sizing:border-box;text-align:center;width:100%}.dashboard-bar-chart-container{background:0 0;border-radius:0;box-sizing:border-box}.dashboard-bar-chart-container .dashboard-sub-bar{padding-bottom:17px;padding-top:13px}.dashboard-bar-chart-container .dashboard-bar-chart{background-color:#fff;border-left:5px solid #fff;border-right:5px solid #fff;border-top:5px solid #fff;padding-bottom:8px;width:auto}.dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-title{margin-top:5px;padding:0 8px;width:100%}.dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-title .percentage{font-weight:400;width:100%}.dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-title .absolut{color:#000;font-weight:500;text-align:center;width:100%}.dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-chart{padding-top:10px}.dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-chart .nv-bar rect{fill-opacity:.6;stroke-opacity:.6;stroke-width:.5px}.dashboard-legend .dashboard-legend-inner{margin-right:25px;padding:10px 5px 5px 0;text-align:right}#dashboardDetailedChart .dygraph-axis-label-y,.dashboardDetailChart .dygraph-axis-label-y,.innerDashboardChart .dygraph-axis-label-y{text-align:left}.dashboard-legend .dashboard-legend-inner span{padding-left:10px}.dashboard-spacer{margin:0 12px}.dashboard-headerbar{margin-bottom:15px;margin-top:10px}.modal-chart-detail .modal-dashboard-legend .dashboard-legend-inner{padding-left:20px}.dashboard-half-height-legend .dashboard-legend-inner{padding-top:20px}.dashboard-title-bar{background-color:#686766;color:#fff;font-size:14.5px;font-weight:400;height:30px;line-height:30px;padding:0 5px 0 10px}.dashboard-title-bar .dashboard-half-title-bar{border-left:1px solid #000;margin-left:-1px;width:50%}.dashboard-title-bar .dashboard-half-title-bar:first-child{border-left:0;margin-left:0}.dashboard-row{margin-bottom:0;margin-left:2px;margin-right:0}.dygraph-axis-label.dygraph-axis-label-x,.dygraph-axis-label.dygraph-axis-label-y{color:#666}#repl-numbers,#repl-progress,#repl-ticks{width:33.3%!important}#repl-numbers .inner,#repl-progress .inner,#repl-ticks .inner{margin-top:0}#replication,#requests,#system{margin-bottom:10px}.dashboardModal{-moz-border-radius:8px!important;-webkit-border-radius:8px!important;border-radius:8px!important;height:80%;margin-left:-45%;min-width:780px;overflow:auto;padding:10px;top:10%;width:90%!important}#dashboardHttpGroup{border:6px solid #000;height:100%;width:100%}#dashboardDetailedChart{border:1px solid #000;height:300px;width:100%}.innerDashboardChart{bottom:5px;left:5px;position:absolute;right:5px;top:5px}.dashboardChart{background-color:#fff;border:1px solid rgba(0,0,0,.2);float:left;height:210px;margin:1.05%;position:relative;width:31%}.dygraph-label.dygraph-title{color:#000;font-size:15px;font-weight:400;text-align:left}#dashboardDetailedLineChart{padding-top:10px}.dashboardDistribution{float:left;width:270px}.dashboardDistribution svg{height:220px;width:250px}.showHotkeyHelp{cursor:pointer}.shortcuts{font-size:14px;font-weight:200}.shortcuts b{border-left:1px solid rgba(0,0,0,.34);margin-left:5px;padding-left:5px}.shortcuts .clearShortcut,.shortcuts b:first-child{border-left:0;margin-left:0;padding-left:0}.loginFixedWindow{background:#649068;height:100%;left:0;position:fixed;top:0;width:100%;z-index:9999}.loginFixedWindow #databases{height:140px}.loginFixedWindow #databases .no-database{background:#fff;border-radius:2px;padding:40px;text-align:center}.loginFixedWindow #databases #logout{margin-top:20px}.loginFixedWindow .resizecontainer{position:relative;top:0}.loginFixedWindow .resizecontainer img{height:33px;margin-left:-6px;margin-top:9px}.login-window{background-color:rgba(255,255,255,.75);border:1px solid rgba(140,138,137,.25);border-radius:3px;height:auto;margin:0 auto;position:relative;top:100px;width:350px;padding:20px 20px 50px}.login-window select{margin-bottom:30px;padding-left:35px;-moz-appearance:none}.login-window .login-logo-round{margin-bottom:25px;margin-top:10px}.login-window .login-logo-round img{display:block;margin:0 auto;width:150px}.login-window .checking-password{box-sizing:border-box;color:rgba(0,0,0,.5);margin-left:-21px;margin-top:-25px;position:absolute;text-align:center;width:100%}.login-window form .fa{color:rgba(0,0,0,.2);float:left;font-size:14pt;left:30px;margin-top:11px;position:absolute}.login-window .wrong-credentials{color:#e74c3c;margin-top:-30px;text-align:center}.login-window .login-space{height:50px}.login-window .login-input{background:#f2f2f2!important;border:2px #f2f2f2!important;box-sizing:border-box;font-size:14px;height:40px;margin:0 0 15px;outline:0;padding:10px 10px 10px 35px;width:100%;border-radius:3px}.login-window .form-error{border:2px solid #e74c3c!important}.login-window button{height:40px;width:100%}.query-toolbar{background-color:#f0f0f0;border-bottom:0;border-style:solid;border-width:1px;font-size:20px;height:27px;margin-left:0;margin-right:0}.queryManagementBottomActions button,.querySizeDiv{margin-right:10px}.query-toolbar span:hover{background-color:#e74c3c;color:#fff}.queryBottomActions{border-top:1px solid rgba(140,138,137,.25);padding:10px}.queryExecutionTime{margin-left:10px;margin-top:15px}.queryManagementBottomActions{background-color:#fff;border-bottom-left-radius:3px;border-bottom-right-radius:3px;border-top:1px solid #c2c2c2;height:40px;margin-top:-2px;padding-top:10px}.styled-select{float:right;height:30px;overflow:hidden;width:220px}.styled-select select{background:#fff;border:1px solid #c2c2c2!important;border-radius:0!important;font-size:14px;font-weight:300;height:30px;line-height:1;outline:0;padding:5px;padding-left:5px!important;padding-top:3px!important}.querySizeDiv,.querySizeDiv select{height:30px!important}.styled-select select:focus{outline:0}.querySizeDiv{width:130px!important}.inputEditorWrapper{border-bottom:3px solid rgba(140,138,137,.25)!important;border-left:1px solid rgba(140,138,137,.25);border-right:1px solid rgba(140,138,137,.25);clear:both;height:300px;min-height:300px;width:100%}.inputEditorWrapper .aqlEditorWrapper{border:0!important;border-right:3px solid rgba(140,138,137,.25)!important;float:left;height:100%!important;max-width:85%;min-width:20%;width:70%}.outputEditorWrapper .ace_editor,.outputEditorWrapper .graphContent,.outputEditorWrapper .tableWrapper .arango-table{border-left:1px solid rgba(140,138,137,.25);border-right:1px solid rgba(140,138,137,.25)}.inputEditorWrapper #arangoMyQueriesTable tbody tr{cursor:copy}.inputEditorWrapper .aqlEditorWrapper,.inputEditorWrapper .bindParamEditorWrapper{background-color:#fff;overflow:hidden}.inputEditorWrapper .aqlEditorWrapper .stringtype,.inputEditorWrapper .bindParamEditorWrapper .stringtype{color:#ce2f30}.inputEditorWrapper .aqlEditorWrapper .arraytype,.inputEditorWrapper .aqlEditorWrapper .objecttype,.inputEditorWrapper .bindParamEditorWrapper .arraytype,.inputEditorWrapper .bindParamEditorWrapper .objecttype{color:#00f}.inputEditorWrapper .aqlEditorWrapper .numbertype,.inputEditorWrapper .bindParamEditorWrapper .numbertype{color:#044}.inputEditorWrapper .aqlEditorWrapper .booleantype,.inputEditorWrapper .bindParamEditorWrapper .booleantype{color:#c12dad}.inputEditorWrapper .aqlEditorWrapper table,.inputEditorWrapper .bindParamEditorWrapper table{border-top:0}.inputEditorWrapper .aqlEditorWrapper table tbody,.inputEditorWrapper .bindParamEditorWrapper table tbody{display:block;overflow-y:auto}.inputEditorWrapper .aqlEditorWrapper table .truncate,.inputEditorWrapper .bindParamEditorWrapper table .truncate{opacity:.8;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:30%}.inputEditorWrapper .aqlEditorWrapper table tr.noBgColor,.inputEditorWrapper .bindParamEditorWrapper table tr.noBgColor{background-color:transparent!important}.inputEditorWrapper .aqlEditorWrapper table tr.selected,.inputEditorWrapper .bindParamEditorWrapper table tr.selected{background-color:rgba(125,188,66,.64);color:#fff}.inputEditorWrapper .aqlEditorWrapper table tr.selected .spanWrapper,.inputEditorWrapper .bindParamEditorWrapper table tr.selected .spanWrapper{background-color:rgba(255,255,255,.65)}.inputEditorWrapper .aqlEditorWrapper table tr.selected .fa-comments,.inputEditorWrapper .aqlEditorWrapper table tr.selected .fa-copy,.inputEditorWrapper .bindParamEditorWrapper table tr.selected .fa-comments,.inputEditorWrapper .bindParamEditorWrapper table tr.selected .fa-copy{color:#000}.inputEditorWrapper .aqlEditorWrapper table thead,.inputEditorWrapper .bindParamEditorWrapper table thead{display:block}#clearQuery,.arangoFrame,.display-none{display:none}.inputEditorWrapper .aqlEditorWrapper table td,.inputEditorWrapper .bindParamEditorWrapper table td{height:33px;padding:0 5px;width:50%}.inputEditorWrapper .aqlEditorWrapper table td .spanWrapper,.inputEditorWrapper .bindParamEditorWrapper table td .spanWrapper{border-radius:3px;cursor:auto;float:right}.inputEditorWrapper .aqlEditorWrapper table td .spanWrapper:hover,.inputEditorWrapper .bindParamEditorWrapper table td .spanWrapper:hover{cursor:auto}.inputEditorWrapper .aqlEditorWrapper table td .spanWrapper .fa,.inputEditorWrapper .bindParamEditorWrapper table td .spanWrapper .fa{cursor:pointer;font-size:16pt;margin-left:5px;margin-right:5px}.inputEditorWrapper .aqlEditorWrapper table td .spanWrapper .fa-minus-circle,.inputEditorWrapper .bindParamEditorWrapper table td .spanWrapper .fa-minus-circle{margin-left:20px}.inputEditorWrapper .aqlEditorWrapper table td .spanWrapper .fa-play-circle-o,.inputEditorWrapper .bindParamEditorWrapper table td .spanWrapper .fa-play-circle-o{color:#2ecc71}.inputEditorWrapper .aqlEditorWrapper table td input,.inputEditorWrapper .bindParamEditorWrapper table td input{clear:both;float:right;height:17px;margin-bottom:3px;margin-top:3px;width:auto!important}.inputEditorWrapper .aqlEditorWrapper table th,.inputEditorWrapper .bindParamEditorWrapper table th{font-weight:400;height:34px;padding:0;width:50%}.inputEditorWrapper .aqlEditorWrapper,.inputEditorWrapper .bindParamEditorWrapper{height:100%}.inputEditorWrapper .aqlEditorWrapper table thead tr th,.inputEditorWrapper .bindParamEditorWrapper table thead tr th{text-align:left}.inputEditorWrapper .aqlEditorWrapper table thead tr th:first-child,.inputEditorWrapper .bindParamEditorWrapper table thead tr th:first-child{padding-left:10px}.inputEditorWrapper .aqlEditorWrapper table tbody input,.inputEditorWrapper .bindParamEditorWrapper table tbody input{width:100%!important}.inputEditorWrapper .aqlEditorWrapper .selectError,.inputEditorWrapper .bindParamEditorWrapper .selectError{background:#e74c3c}.inputEditorWrapper .aqlEditorWrapper .aceAction,.inputEditorWrapper .bindParamEditorWrapper .aceAction{background-color:#404a53;border-radius:3px;color:#fff;cursor:pointer;font-size:13pt;height:23px;line-height:23px;opacity:.8;position:absolute;right:5px;text-align:center;top:5px;width:33px;z-index:10}.inputEditorWrapper .aqlEditorWrapper .aceAction.type,.inputEditorWrapper .bindParamEditorWrapper .aceAction.type{font-size:8pt}.inputEditorWrapper .aqlEditorWrapper .aceAction i,.inputEditorWrapper .bindParamEditorWrapper .aceAction i{margin-bottom:3px}.inputEditorWrapper .aqlEditorWrapper .aceAction:hover,.inputEditorWrapper .bindParamEditorWrapper .aceAction:hover{cursor:pointer;opacity:1}.inputEditorWrapper .aqlEditorWrapper .previewWrapper,.inputEditorWrapper .bindParamEditorWrapper .previewWrapper{background-color:#fff}.inputEditorWrapper .aqlEditorWrapper .previewWrapper .previewBar,.inputEditorWrapper .bindParamEditorWrapper .previewWrapper .previewBar{background-color:#fff;border-bottom:1px solid rgba(140,138,137,.25);height:34px}.inputEditorWrapper .aqlEditorWrapper .previewWrapper .previewBar span,.inputEditorWrapper .bindParamEditorWrapper .previewWrapper .previewBar span{margin-left:5px;padding-top:8px;position:absolute}.inputEditorWrapper .aqlEditorWrapper .previewWrapper #queryPreview,.inputEditorWrapper .aqlEditorWrapper>div,.inputEditorWrapper .bindParamEditorWrapper .previewWrapper #queryPreview,.inputEditorWrapper .bindParamEditorWrapper>div{height:100%}.inputEditorWrapper .ui-resizable-s{cursor:ns-resize}.inputEditorWrapper .ui-resizable-e{cursor:ew-resize}.queryContent{clear:both;margin-top:0;width:100%}.queryContent .arangoToolbar .fa.fa-star,.queryContent .arangoToolbar .fa.fa-star-o{color:#ff0}.outputEditors{margin-bottom:60px}.outputEditorWrapper{clear:both;height:100px;padding-top:20px;width:100%}.outputEditorWrapper .tableWrapper{max-width:100%;overflow-x:scroll}.outputEditorWrapper .outputTable{margin-right:-2px}.outputEditorWrapper .graphContent{margin-right:-2px;margin-top:0}.outputEditorWrapper .switchAce{background-color:#404a53;border-radius:3px;color:#fff;cursor:pointer;position:relative;right:-24px;top:45px;z-index:10}.outputEditorWrapper .switchAce span{margin-left:0;padding:0 8px;top:0}.outputEditorWrapper .switchAce span.active{color:#2ecc71}.outputEditorWrapper .switchAce span.disabled{cursor:not-allowed}.outputEditorWrapper .ace_editor{height:280px;width:100%}.outputEditorWrapper .ace_editor .ace_active-line{background:#fff!important}.outputEditorWrapper .sentWrapper .pull-left,.outputEditorWrapper .sentWrapper .pull-right{width:50%}#queryManagementContent{border:1px solid rgba(140,138,137,.25);padding-top:0}#queryManagementContent .arango-table{border:0}#queryManagementContent .arango-table tr th:nth-child(1){width:10%}#queryManagementContent .arango-table tr th:nth-child(1) td{text-align:center}#queryManagementContent .arango-table tr th:nth-child(2){width:50%}#queryManagementContent .arango-table tr th:nth-child(3),#queryManagementContent .arango-table tr th:nth-child(4){width:20%}.contentBar{font-size:12pt;line-height:30px}.noContent{background-color:#fff;padding:50px}.noContent p{font-size:12pt;font-weight:100;text-align:center}.row{margin:0 0 20px}.innerContent{background-color:#fff;border:1px solid rgba(140,138,137,.25);border-radius:2px;min-height:200px;padding-top:13px}.arangoFrame{background-color:rgba(0,0,0,.5);bottom:0;left:0;position:fixed;right:0;top:0;z-index:77777}.arangoFrame .outerDiv{min-height:100%;padding:20px 40px 40px;z-index:88888}.arangoFrame .innerDiv{margin-top:25px;z-index:99999}.arangoFrame .fa-times{color:#fff;float:right;font-size:12pt}.arangoFrame .fa-times:hover{color:#c2c2c2;cursor:pointer}.arangoFrame .document-content-div,.arangoFrame .document-info-div{left:40px;position:absolute;right:40px}.arangoFrame .document-content-div{bottom:80px;top:130px}.arangoFrame .document-editor{height:100%}.arangoFrame .bottomButtonBar{left:-1px;position:absolute;right:-1px}.container{margin-left:20px;margin-right:20px;width:auto!important}.arango-tab{border-bottom:1px solid #ddd;list-style:none;margin-left:0;padding-bottom:0;padding-right:10px}.arango-tab a{-moz-border-radius:0;-webkit-border-radius:0;border-radius:3px 3px 0 0;background-color:#8c8a89;border:1px solid transparent;border-bottom-color:#888;color:#fff;display:block;font-size:13px;line-height:20px;margin-right:2px;min-width:50px;padding:2px 15px;text-align:center}.arango-tab li{background-color:transparent;border:0;margin-bottom:-1px;margin-left:2px;position:relative;z-index:900}.arango-tab li.active a{background:#fff;border-bottom-color:#fff!important;border-left-color:#c2c2c2;border-right-color:#c2c2c2;border-top-color:#c2c2c2;color:#000;height:21px;margin-top:-1px}.jsoneditor,.jsoneditor .menu{background-color:#fff!important}.jsoneditor{border:0 solid rgba(0,0,0,.2)!important}.jsoneditor .menu{border-bottom:1px solid #c2c2c2!important;border-left:0!important;border-right:0!important;border-top:0!important}.jsoneditor .menu button{border:0!important}.jsoneditor .menu button:hover{background-color:#2ecc71;color:#fff}.jsoneditor .search .frame{border:0!important;margin:3px!important}.jsoneditor .search .frame .refresh{background-position:-96px -73px;height:22px;width:25px}.jsoneditor .search .frame input{margin-left:15px;margin-right:15px;margin-top:0}.jsoneditor .search .results{color:#fff!important;margin-top:3px!important}.document-editor-extra{margin-top:10px}.document-editor{margin-top:-10px;width:100%}.disabledPag,.disabledPag a{cursor:default!important;opacity:.5!important}.pagination-line{background-color:#fff;border-bottom-left-radius:2px;border-bottom-right-radius:2px;border-top:1px solid rgba(104,103,102,.1);margin:0;padding-top:12px;text-align:center}.pagination-line li a:hover,.pagination-line li.active a,.pagination-line li.active span{background-color:#404a53;color:#fff}.pagination-line li a{background-color:#fff;border:1px solid #fff;font-size:11.9px;line-height:20px;padding:2px 10px;text-decoration:none;border-width:0;min-width:12pt}.pagination-line ul{-moz-border-radius:2px;-webkit-border-radius:2px;border-radius:2px;display:inline-block;margin-bottom:0;margin-left:0}.pagination-line li{display:inline-block;margin-left:11px}.pagination-line li span{color:#000;font-size:14px;position:relative;top:2px}.pagination-line li:first-child a,.pagination-line li:first-child span,.pagination-line li:last-child a,.pagination-line li:last-child span{-webkit-box-shadow:0;-moz-box-shadow:0;box-shadow:0;background:#404a53;border:0;color:#fff;height:21px;position:relative;width:14px}.pagination-line li.disabled:first-child a,.pagination-line li.disabled:first-child span,.pagination-line li.disabled:last-child a,.pagination-line li.disabled:last-child span{background-color:#777;color:#666;cursor:default;pointer-events:none}.collection-pagination{margin-left:23px!important}.arango-pagination i.fa,.las-pagi i.fa,.pre-pagi i.fa{font-size:19px;position:relative;top:-2px}.arango-pagination li:first-child{margin-right:20px}.arango-pagination li:last-child{margin-left:30px}.pre-pagi{margin-right:-5px!important}.accordion-group{border:0}.accordion-body{height:auto!important}.accordion-heading{padding-bottom:20px;padding-top:25px}.accordion-heading a{border:1px solid #ccc;color:#000;font-weight:400;width:397px!important}.accordion-heading .accordion-toggle{border-radius:3px;box-sizing:border-box;display:block;padding:8px 15px;width:100%!important}.shell_workspace{margin-top:13px}.shell_workspace ::-webkit-scrollbar{display:none}.replShell{background-color:#fff;float:left;height:100%;min-width:100px;overflow-y:hidden;position:relative;width:100%}.replShell>div{border-radius:3px}.replShell pre{border-bottom:0;border-left:0;border-right:1px solid #a0a0a0;border-top:1px solid #a0a0a0}.jqconsole{background-color:#000;border-radius:0;padding:10px}.jqconsole-header{color:#fff}.jserror{color:#f06;margin-left:-10px}.jssuccess{color:#6f0}.jqconsole-cursor{background-color:grey}.jqconsole-blurred .jqconsole-header .jqconsole-cursor{color:#c4cccc}.jqconsole-prompt{color:#b91}.jqconsole-old-prompt{color:#f60;font-weight:400}.jqconsole-input{color:#dd0}.jqconsole-old-input{color:#bb0;font-weight:400}.jqconsole-output{color:#fff}.query-output .ace_gutter-cell{background-color:#f0f0f0}.centralContent .api-actions{margin:0!important;padding:0}.centralContent .api-actions .container{padding-bottom:10px!important;padding-top:13px!important;margin:0 5px!important}.centralContent .api-actions .resource{border-bottom:0!important;padding-left:5px!important}.centralContent .api-actions .resource .heading>.options{margin:11px 10px 0 0!important}.centralContent .api-actions .resource .heading h2 a{color:#000!important;font-weight:300!important}.centralContent .api-actions .active .heading h2 a{color:#000!important}.centralContent .api-actions .endpoint .operations .content{margin:0!important}.centralContent .api-actions .endpoint .operations .content h4{font-weight:700!important}.centralContent .api-actions .endpoints{margin-right:5px!important}.centralContent .api-actions .endpoints .endpoint:last-child{padding-bottom:5px!important}.centralContent .api-actions input[type=button]{background:#8f8d8c!important;border:none!important;box-shadow:none!important;color:#fff!important;float:right!important;font-size:14px!important;font-weight:300!important;margin-top:10px!important;padding:8px 16px!important}.centralContent .api-actions .endpoint .operations .content,.centralContent .api-actions .endpoint .operations .heading{border-radius:0!important;font-weight:300!important}.centralContent .api-actions .http_method,.centralContent .api-actions .toggleOperation{border-radius:0!important}.centralContent .api-actions .required,.centralContent .api-actions em,.centralContent .api-actions strong{font-weight:400!important}.form-actions{background:0 0;border:0}.form-actions:after,.form-actions:before{display:table;line-height:0}.form-actions:after{clear:both}.swagger-section #swagger-ui-container{margin:.3em 1em!important}.alert{padding:15px 35px 15px 14px}.alert,textarea{border-radius:0!important}.log-content{word-wrap:break-word}.tab-content{min-height:390px}.crit-table-id,.debug-table-id,.info-table-id,.log-table-id,.warn-table-id{border-spacing:0 0;font-size:15px!important;margin-top:-5px!important}.crit-table-id thead,.debug-table-id thead,.info-table-id thead,.log-table-id thead,.warn-table-id thead{background-color:#f9f9f9;border-top:6px solid #888!important;text-align:center}.crit-table-id thead tr th,.debug-table-id thead tr th,.info-table-id thead tr th,.log-table-id thead tr th,.warn-table-id thead tr th{background-color:#fff!important;border-bottom:1px solid #c2c2c2;border-top:2px solid #888}.crit-table-id .firstcol,.debug-table-id .firstcol,.info-table-id .firstcol,.log-table-id .firstcol,.warn-table-id .firstcol{cursor:default!important;max-width:80px!important;width:80px!important}.crit-table-id tbody .firstcol,.debug-table-id tbody .firstcol,.info-table-id tbody .firstcol,.log-table-id tbody .firstcol,.warn-table-id tbody .firstcol{background-color:transparent!important}.crit-table-id tbody tr td,.debug-table-id tbody tr td,.info-table-id tbody tr td,.log-table-id tbody tr td,.warn-table-id tbody tr td{padding-bottom:8px!important;padding-top:8px!important}.thirdcol{cursor:default!important;max-width:500px!important}.dataTables_empty,.seccol{cursor:default!important;margin-bottom:5px;width:100px!important}.dataTables_info{display:none}#arangoLogTable{border-top:0}#arangoLogTable tbody tr{height:40px}#arangoLogTable tbody td:nth-child(1){text-align:center;width:70px}#arangoLogTable tbody td:nth-child(2){text-align:center;width:150px}#arangoLogTable tbody td:nth-child(3){width:auto}.log-content-id{padding-bottom:0!important;padding-top:0!important}.log-content-id .dataTable{border-collapse:separate;border-spacing:0 5px;table-layout:fixed!important}.log-content-id .arango-tab{border-bottom:0!important}.log-content-id .tab-content{margin-top:1px!important}.log-content-id .arango-tabbar{left:0;margin-top:-51px;position:absolute}.log-content-id .arango-tabbar button{background-color:#fff;border:0;color:#000;float:left;font-size:10.5pt;min-width:60px;opacity:.64;outline:0;padding-left:0;padding-right:0;text-align:center;width:auto}.log-content-id .arango-tabbar button.arango-active-tab{border-bottom:2px solid #77cb99;font-weight:400;height:35px;opacity:1;padding-bottom:9px}.collectionInfoTh2,.collectionTh,.figuresHeader th{font-weight:400!important}div.gv_zoom_widget{height:300px;left:62px;opacity:.7;position:absolute;top:0;width:40px;z-index:1}div.gv_zoom_widget div.gv_zoom_buttons_bg{background-image:url(../img/gv_button_bg_reverse.png);background-size:contain;height:40px;margin-bottom:20px}div.gv_zoom_widget div.gv_zoom_slider{background:#f5f8f0;border-radius:3px;height:200px;margin:0 17px;width:4px}div.gv_zoom_widget a.ui-slider-handle{background-color:#555;border:1px solid rgba(140,138,137,.25);height:.5em;left:-.55em;outline:0}div.gv_zoom_widget a.ui-slider-handle.ui-state-hover{outline-color:#fff}.documents-size,.spotlightWrapper .typeahead:focus{outline:transparent 0}div.gv_zoom_widget a.ui-slider-handle:hover{cursor:pointer}div.gv_zoom_widget .ui-state-default{background:#f6f6f6}#menubar{margin:0 0 10px}div.gv_colour_list{max-height:680px;overflow:auto;position:absolute;right:26px;text-align:right;top:20px;z-index:1}div.gv_colour_list li{background-color:transparent;float:none;padding:2px 6px}svg.graph-viewer{background-color:#fff;border:1px solid rgba(140,138,137,.25);border-radius:3px;left:54px;position:absolute;top:-10px;z-index:0}div.gv-colour-list ul ul,div.gv-colour-list ul ul:first-child,div.gv-colour-list ul ul:last-child{border-left:1px solid rgba(104,103,102,.1);border-right:1px solid rgba(104,103,102,.1)}svg.graph-viewer text{max-width:90px;pointer-events:none}div.gv-background{position:relative}.link>line{stroke-width:1}div.gv-colour-list:hover{opacity:1}div.gv-colour-list{border-radius:3px;max-height:350px;max-width:300px;min-width:190px;opacity:.1;overflow-x:hidden!important;overflow-y:auto;position:absolute;right:8px;text-align:right;top:0;z-index:1}div.gv-colour-list li{float:none;overflow:hidden;padding:2px 6px}div.gv-colour-list ul ul:first-child{border-top:1px solid rgba(104,103,102,.1);border-top-left-radius:3px;border-top-right-radius:3px}div.gv-colour-list ul ul:last-child{border-bottom:1px solid rgba(104,103,102,.1);border-bottom-left-radius:3px;border-bottom-right-radius:3px}#tab-content-create-graph .addAfter,#tab-content-create-graph .addDelete,#tab-content-create-graph .delete{margin-top:-9px;position:absolute;right:13px}#tab-content-create-graph .tableRow.first{border-top:10px solid #fff}.graphContent{margin-top:3px}.graphContent #graph-container{background-color:#fff;z-index:5}.graphContent #graph-container:-webkit-full-screen{height:100%!important;width:100%!important}.graphContent #graph-container:-moz-full-screen{height:100%!important;width:100%!important}.graphContent #graph-container:-ms-full-screen{height:100%!important;width:100%!important}.graphContent #graph-container:-o-full-screen{height:100%!important;width:100%!important}.graphContent #graph-container:full-screen{height:100%!important;width:100%!important}.graphContent .fa.fa-desktop{margin-top:6px;position:absolute;right:20px;z-index:10}.nodeContextMenu,.nodeInfoDiv{position:fixed}.nodeInfoDiv{left:175px;overflow:hidden;top:130px;z-index:10}.nodeInfoDiv pre{background-color:rgba(64,74,83,.9);border-radius:2px;color:#fff;max-height:400px;max-width:330px;overflow:hidden}.nodeContextMenu svg #wheelnav-nodeContextMenu-title-0{transform:translate(24px,14px) scale(.7)!important}.nodeContextMenu svg #wheelnav-nodeContextMenu-title-0,.nodeContextMenu svg #wheelnav-nodeContextMenu-title-1,.nodeContextMenu svg #wheelnav-nodeContextMenu-title-2,.nodeContextMenu svg #wheelnav-nodeContextMenu-title-3{fill:#fff}.nodeContextMenu svg #wheelnav-nodeContextMenu-title-0:hover,.nodeContextMenu svg #wheelnav-nodeContextMenu-title-1:hover,.nodeContextMenu svg #wheelnav-nodeContextMenu-title-2:hover,.nodeContextMenu svg #wheelnav-nodeContextMenu-title-3:hover{fill:#2ecc71}#graphSettingsView{background-color:rgba(64,74,83,.9);border:0;border-radius:0;height:100%;overflow-y:scroll}#graphSettingsView button{margin-bottom:125px}#graphSettingsView select{width:222px}#graphSettingsContent{height:100%;max-width:50%;min-width:400px;position:fixed;right:-1px;top:103px;width:400px}#graphSettingsContent .pure-g{font-size:10pt}#graphSettingsContent .pure-g input,#graphSettingsContent .pure-g select{color:#000}#graphSettingsContent .pure-g .left{color:#fff;height:40px}#graphSettingsContent .pure-g .pure-u-2-3{text-align:right}#graphSettingsContent .pure-g .heading{border-bottom:1px solid #fff;height:10px;margin-bottom:15px}#graphSettingsContent .pure-table{padding-left:10px;padding-right:10px}div.gv-manage-button-container{margin-top:10px}legend.gv-inner{font-size:16px}input.gv-radio-button{display:block;margin-top:3px;width:auto}.addCollection .accordion,.collectionTh textarea{margin-top:10px}.collectionTh{font-size:14px;text-align:left;width:20%!important}.collectionInfoTh{min-width:60px;text-align:left;width:320px}.addCollection table tr{border-bottom:0!important;height:53px}.addCollection .icon_arangodb_info{margin-left:20px!important;position:relative;top:2px!important}.addCollection .collectionThSec{width:320px!important}.addCollection .collectionTh{width:96px}.addCollection .modalInput{width:320px}.addCollection .modalSelect{width:334px}.addCollection .accordion-toggle{width:457px!important}.change-collection .tab-content{min-height:230px}.change-collection input{width:384px!important}.change-collection select{width:398px!important}.show-collection .tab-content{min-height:200px}.collectionInfoTh2{text-align:left;width:150px}.collection-info-figures table{float:left;margin-left:0;margin-right:0;margin-top:0;min-width:200px;padding:3px;text-align:left}.figuresHeader{border-bottom:1px solid #c2c2c2}#collectionIndexTable{margin-left:0;width:100%}#collectionTab,#graphTab,#infoTab{border-bottom:0;margin-bottom:1px;padding-bottom:0;padding-right:10px}#collectionTab li,#graphTab li,#infoTab li{float:right}#collectionTab li.disabled a,#graphTab li.disabled a,#infoTab li.disabled a{cursor:not-allowed}#collectionTab a,#graphTab a,#infoTab a{background-color:#404a53;border-bottom:1px solid #666;border-top-left-radius:3px!important;border-top-right-radius:3px!important;color:#fff;font-size:13px!important;height:21px;margin-bottom:-1px;margin-right:4px;padding:2px 15px!important}#collectionTab .active>a,#graphTab .active>a,#infoTab .active>a{background-color:#fff;border-color:#888 #888 transparent!important;color:#000}#confirmCreateEdge{margin-left:20px}.collection-info-figures .icon_arangodb_info{position:relative!important;right:-4px!important}.snippet-wrap .snippet-num li{list-style:decimal-leading-zero}.snippet-no-num{list-style-type:none;margin-left:0;padding-left:0}.snippet-no-num .prettify{font-size:1.2em}.snippet-no-num .sh_number{color:#044;font-weight:100;margin-left:5px}.snippet-no-num .sh_symbol{color:#00f;font-weight:100;margin-left:5px}.snippet-no-num .sh_cbracket{color:#c7a317;font-weight:100;margin-left:5px}.snippet-no-num .sh_keyword{color:#c12dad;font-weight:100;margin-left:5px}.snippet-no-num .sh_string{color:#ce2f30;font-weight:100;margin-left:5px}.snippet-no-num .sh_array,.snippet-no-num .sh_object{color:#00f;font-weight:100;margin-left:5px}@media (max-height:490px){.social-icons{display:none}}@media (max-height:525px){.navlogo .version,.shortcut-icons{display:none}}@media (max-width:568px){#arangoLogTable .table-cell0,.breadcrumb,.document-info-div .search,.navlogo .big,.pagination-line .las-pagi,.pagination-line .pre-pagi,.social-icons{display:none}.nodeInfoDiv{left:65px}.pagination-line .arango-pagination li:first-child,.pagination-line .arango-pagination li:last-child{margin-left:0;margin-right:0}.pagination-line li a{padding:2px 4px}.login-window{padding:10px 10px 40px;width:300px}#repl-numbers,#repl-progress,#repl-ticks{width:100%!important}.dashboard-large-chart,.dashboard-medium-chart-outer:first-child{padding-right:0!important}div.dropdownInner ul label{font-size:13px}.subnavmenu a{font-size:8pt}.subViewNavbar li{font-size:8pt!important;padding:0 6px!important}.subViewNavbar li.active{height:35px}.small-label-padding{max-width:calc(100% - 2px)}.navlogo .small{display:block;height:auto;width:28px}.headerButtonBar,.navlogo .version,.primary .version,.shortcut-icons{display:none}.navbar,.navlist,.navlist li,.navmenu,.primary,.primary li{width:40px!important}.arango-collection-ul .tab{font-size:12pt;height:30px;overflow:hidden}.arango-collection-ul .tab .fa{padding-left:6px;padding-right:20px}.social-icons p{float:left;margin-left:-3px}.social-icons p .fa{font-size:16px}.footer,div.bodyWrapper{left:40px}.dashboard-bar-chart-container .dashboard-bar-chart{padding-bottom:11px}}@media (max-width:768px){.breadcrumb,.outputEditors .additional,.pagination-line .las-pagi,.pagination-line .pre-pagi{display:none}.hide-small{visibility:hidden}.pagination-line .arango-pagination li:first-child,.pagination-line .arango-pagination li:last-child{margin-left:0;margin-right:0}.pagination-line li a{padding:2px 4px}.dashboard-large-chart,.dashboard-tendency-container{box-sizing:content-box}.tendency-box-sizing .dashboard-bar-chart-container,.tendency-box-sizing .dashboard-row:last-child .dashboard-medium-chart-outer:last-child,.tendency-box-sizing .dashboard-tendency-container{margin-left:0}.tendency-box-sizing .dashboard-bar-chart-container{height:140px}.tendency-box-sizing .dashboard-bar-chart-container .dashboard-sub-bar{margin-top:-3px}}@media (min-width:569px) and (max-width:738px){.dashboard-large-chart,.dashboard-medium-chart-outer:first-child{padding-right:0!important}.document-info-div .search,.headerButtonBar span{display:none}.dashboard-bar-chart-container{padding-left:0!important;padding-right:0!important}#repl-numbers,#repl-progress,#repl-ticks{width:100%!important}.subnavmenu a{font-size:9pt}.collection-dropdown ul{width:auto!important}.arango-collection-select{display:inline-block}.dashboard-bar-chart-container .dashboard-bar-chart{padding-bottom:11px}}@media (min-width:770px) and (max-width:972px){.dashboard-tendency-container .dashboard-sub-bar{font-size:11px;height:32px;margin-bottom:10px;margin-top:-10px}.dashboard-small-chart .dashboard-sub-bar{font-size:11px;height:33px}.dashboard-small-chart .dashboard-sub-bar-title{font-size:11px;line-height:12px;margin-top:-12px}.dashboard-bar-chart-chart{margin-top:10px}.dashboard-bar-chart-container .dashboard-sub-bar{font-size:11px;margin-bottom:10px;margin-top:-16px;padding-top:18px}.dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-title .absolut{padding-top:3px}}@media (min-width:973px){.dashboard-large-chart .dashboard-sub-bar{padding-top:14px}#dataTransferDistribution .nvd3-svg,#totalTimeDistribution .nvd3-svg{padding-top:20px}#requests .small-label-padding .dashboard-small-chart .dashboard-sub-bar{font-size:12px;padding-top:30px}#requests .small-label-padding:last-child .dashboard-small-chart .dashboard-sub-bar{margin-bottom:1px}}.document-info-div{min-height:0}.document-content-div{margin-top:10px}.document-info{background-color:#fff;border-radius:3px;margin-bottom:8px;margin-top:-13px;min-height:65px;padding:5px}.document-info .document-info-container{clear:both;width:100%}.document-info .document-info-container .document-inner-info-container{float:left;margin-left:10px;margin-top:5px}.document-info .document-info-container .document-inner-info-container .document-attribute{margin-right:20px}.document-info .document-info-container .document-inner-info-container .document-attribute div{float:left}.document-info .document-bold-font{min-width:55px}.document-info .document-thin-font{color:#2ecc71}.document-info .document-type-container div{float:left}.document-info .document-type-container #document-id{margin-left:10px}.document-link:hover{cursor:pointer;text-decoration:underline}.jsoneditor .tree div{font-size:11pt}#progressPlaceholder{background-color:rgba(0,0,0,.4);bottom:0;left:0;position:fixed;right:0;top:0;z-index:9999}.progress-view{background-color:#363c39;border-radius:2px;color:#fff;height:188px;left:50%;margin:-150px 0 0 -125px;position:absolute;top:38%;width:250px}.progress-view .progress-content{border:5px solid #fff;border-radius:3px}.progress-view .progress-content .fa-spinner{font-size:100pt}.progress-view .progress-message{background-color:#fff;border-radius:0 0 2px 2px;color:#fff;font-weight:200;height:44px;margin-top:-25px;padding-top:3px;text-align:center}.progress-view .progress-text{background:#fff;color:#000;float:left;font-weight:100;height:25px;left:-5px;margin-left:5px;margin-top:10px;position:relative;top:-10px;width:100%}.progress-view .progress-action{float:right;margin-right:5px;margin-top:5px}#progressPlaceholderIcon{color:#2ecc71;float:left;font-size:22px;margin-left:10px;margin-top:7px}.pong-spinner{height:100px;margin:50px auto;position:relative;width:200px}.pong-spinner i{animation:ball 2s infinite linear;background:#8cdb8b;border-radius:10px;height:10px;position:absolute;width:10px}.pong-spinner:after,.pong-spinner:before{animation:left-player 2s infinite linear;background:#8cdb8b;height:30px;position:absolute;width:5px}.pong-spinner:after{animation:right-player 2s infinite linear;right:0}@keyframes left-player{0%,100%{top:0}50%{top:70px}}@keyframes right-player{0%,100%{top:70px}50%{top:0}}@keyframes ball{0%,100%{left:5px;top:20px}25%,75%{left:190px;top:50px}50%{left:5px;top:80px}}#spotlightPlaceholder{background-color:rgba(0,0,0,.25);bottom:0;left:0;position:fixed;right:0;top:0;z-index:2000}.spotlightWrapper{height:50px;left:25%;position:absolute;top:115px;width:50%}.spotlightWrapper .twitter-typeahead{width:100%}.spotlightWrapper .tt-highlight{color:#5bc0de;font-weight:400}.spotlightWrapper input{box-sizing:border-box;height:40px!important}.spotlightWrapper .tt-dataset{clear:both}.spotlightWrapper .tt-menu{background:#3d4246;border-radius:3px;color:#fff;height:300px;overflow:auto;width:100%}.spotlightWrapper .tt-menu .tt-suggestion:hover{background-color:#404a53;cursor:pointer}.spotlightWrapper .tt-menu .header-type{background:#32373b;clear:both;color:#fff;height:30px;padding-left:5px}.spotlightWrapper .tt-menu .header-type h4{float:left;margin:4px 0 0;padding:0}.spotlightWrapper .tt-menu .header-type .fa{font-size:12pt;margin-left:6px;margin-top:6px}.spotlightWrapper .tt-menu .header-type .type{background-color:#5bc0de;border-radius:3px;float:right;margin:4px;padding:0 5px}.spotlightWrapper .tt-menu .tt-cursor{background-color:#fff;color:#000}.spotlightWrapper .tt-menu .tt-selectable{padding-left:10px}.spotlightWrapper .typeahead{background:#3d4246;border:0 solid #3d4246;-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;color:#fff;font-size:22px;height:30px;line-height:30px;outline:transparent 0;padding:8px 12px;width:100%}.graphLabel{font-size:11pt;font-weight:600;margin-top:-25px;opacity:.5;padding-bottom:20px;text-align:center;text-transform:uppercase}.cluster-graphs>div .graphWrapper{border:1px solid rgba(140,138,137,.25);margin-left:-1px;margin-top:-1px;padding:20px 20px 10px}.cluster-graphs>div .graphWrapper .nv-controlsWrap{display:none}.cluster-graphs>div .graphWrapper .nv-legendWrap{margin-bottom:10px}.cluster-graphs>div .graphWrapper svg{height:250px;margin-left:-17px}.cluster-values{margin-top:-13px}.cluster-values>div .valueWrapper{border:1px solid rgba(140,138,137,.25);margin-left:-1px;margin-top:-1px}.cluster-values>div .valueWrapper .value{color:#000;font-size:24pt;line-height:150px;text-align:center}.cluster-values>div .valueWrapper .value.positive{color:#2ecc71}.cluster-values>div .valueWrapper .value.warning{color:#f1c40f}.cluster-values>div .valueWrapper .value.negative{color:#e74c3c}.cluster-values>div .valueWrapper div:first-child{height:150px}.application-detail-view .headerBar .subMenuEntries{margin-left:5px;margin-top:-2px}.application-detail-view .headerBar .headerButtonBar{position:absolute;right:5px}.application-detail-view section.info{float:left;padding:13px 0 0}.application-detail-view section.info .header{height:200px;margin-bottom:0;position:absolute;width:calc(100% - 20px)}.application-detail-view section.info .header div.header-icon-container{border:2px solid #d9dbdc;border-radius:150px;height:182px;left:0;margin:0 auto;overflow:hidden;width:182px}.application-detail-view section.info .header div.header-icon-container img.icon{background-color:#fff;border-radius:3px;box-sizing:border-box;height:100%;padding:10px;width:100%}.application-detail-view section.info .header .information{background-color:#fff;border:1px solid #d9dbdc;border-radius:3px;margin-bottom:20px;padding:10px 10px 0;position:relative;top:35px;width:calc(100% - 30px)}.application-detail-view section.info .header .information span{display:block;float:left;font-weight:500;width:90px}.application-detail-view section.info .header .information a{margin-right:10px}.application-detail-view section.info .header .header_right{left:190px;margin:40px auto 0;width:137px}.application-detail-view section.info .header .header_right input.delete,.application-detail-view section.info .header .header_right input.switch-docu,.application-detail-view section.info .header .header_right input.switch-mode,.application-detail-view section.info .header .header_right input.upgrade{margin-top:7.83px;padding-left:10px;padding-right:10px}.application-detail-view section.info .header .header_right input{width:130px}.application-detail-view section.info .header .header_left{margin:0 auto;padding-left:10px;padding-top:1px;text-align:center;width:33.3%}.application-detail-view section.info .header .header_left input{margin-left:0;margin-top:-4px}.application-detail-view section.info .header .header_left .header_line{margin-top:10px}.application-detail-view section.info .header .header_left .header_line p{font-size:14pt;font-weight:200}.application-detail-view section.info .header .header_left .header_line h3{float:left;margin-bottom:0;margin-top:0;padding-right:5px;width:100%}.application-detail-view section.info .header .header_left .header_line .license,.application-detail-view section.info .header .header_left .header_line .mode,.application-detail-view section.info .header .header_left .header_line .version{-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;background-color:#404a53;border:1px solid rgba(140,138,137,.25);color:#fff;font-size:13px;font-weight:300;padding:2px 8px;position:relative;top:-3px}.application-detail-view section.info .header .header_left .header_line .production{color:#2ecc71}.application-detail-view section.info .header .header_left .header_line .development{color:#f1c40f}.application-detail-view section.info .header .header_left .header_line:after{clear:both;content:'';display:table}.application-detail-view section.info .header .header_left .header_line_bottom>div{display:table;left:-3px;margin:-10px auto 0;position:absolute;width:100%}.application-detail-view section.info .header .header_left .header_line_bottom h3{width:auto}.application-detail-view section.info .header .header_left .header_line_bottom .inner{display:table;margin:0 auto;padding-left:15px;width:auto}.application-detail-view section.info .header .app-warning{-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;background:#e74c3c;color:#fff;padding:6px 8px}.application-detail-view section.info .header .app-warning h4,.application-detail-view section.info .header .app-warning p{font-size:1em;margin:0}.application-detail-view aside.meta{background-color:#fff;border:1px solid rgba(140,138,137,.25);border-radius:3px;clear:right;float:right;height:182px;margin-top:12px;max-height:182px;max-width:182px;overflow-x:hidden;position:relative;width:182px}.application-detail-view aside.meta dl{margin-bottom:0;margin-top:0;padding-left:7px;padding-top:5px}main{background-color:#fff;border-radius:3px}main .app-info{-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;background:#5bc0de;color:#fff;margin:10px;padding:6px 8px}main .app-info h4,main .app-info p{font-size:1em;margin:0}main .swagger iframe{border:0;border-radius:3px;height:100%;width:100%}main .readme{background:#fff;padding:1em 2em}main .readme .buttons{background:#fff;height:30px;position:relative;right:-15px;width:100%}.centralContent .contentIn table tr,.centralContent .modal-body .arango-table tr,.centralContent .modal-body table tr{height:40px}main .readme .buttons button{float:right}main .readme .modal-body{border-bottom:1px solid rgba(140,138,137,.25);border-left:0;border-right:0;border-top:0;padding-bottom:15px}main .readme .modal-footer{border-bottom:0;border-left:0;border-right:0;border-top:1px solid rgba(140,138,137,.25);padding-right:0}main .readme h1{float:left;text-align:left;width:100%}.tests-result .stack{border-color:#e74c3c;color:#e74c3c;font-size:12px;line-height:1.5;margin:5px 0}.tests-result-stats .fail,.tests-result-stats .pass,.tests-result-stats .pending{padding:0 2px}.tests-result-spec{margin-bottom:0}.tests-result-spec-suites .tests-result-spec-suites{margin-left:20px}.tests-result-spec-suites dd{margin-bottom:20px;margin-left:0}.tests-result-spec-tests{margin-left:20px}.tests-result-spec-test-title{padding-left:20px}.tests-result-spec-test-title .fa{line-height:18px;margin-left:-20px;margin-top:2px;position:absolute}.tests-result-spec-test-title .fa-circle{font-size:50%;margin-left:-16px}.tests-result .pass{color:#2ecc71}.tests-result .fail{color:#e74c3c}.tests-result .pending{color:#666}#swagger #jsonLink{color:rgba(64,74,83,.8);font-weight:500;opacity:.5;position:absolute;right:33px;z-index:99}#swagger #jsonLink:hover{cursor:pointer;opacity:1}#indexHeaderContent{padding:0}#indexHeaderContent #collectionEditIndexTable th,#indexHeaderContent .figuresHeader th{padding-left:10px}.new-index-view{padding:20px}.centralContent .createModalDialog{background-color:#fff;outline:0}.centralContent .contentIn{background:#fff;border:1px solid rgba(64,74,83,.2);border-radius:2px;padding:20px}.centralContent .contentIn table{border:0}.centralContent .contentIn table select{margin-top:-10px}.centralContent .modal-body{border:1px solid rgba(64,74,83,.2);color:#000;max-height:none;padding:0}.centralContent .modal-body .arango-table tr th,.centralContent .modal-body table tr th{padding-left:10px}.centralContent .modal-body .figuresHeader{background-color:#404a53;color:#fff}.centralContent .modal-body .icon_arangodb_info{margin-left:10px;right:inherit}.centralContent .modal-body .modalSelect{margin-top:0}.centralContent .modal-body .tab-pane{padding-top:0!important}.centralContent .modal-footer{background-color:transparent;border-bottom:1px solid rgba(64,74,83,.2);border-left:1px solid rgba(64,74,83,.2);border-radius:0;border-right:1px solid rgba(64,74,83,.2);border-top:0;box-shadow:none;padding:8px}.centralContent .figures1,.centralContent .figures2,.centralContent .figures3{margin-left:0!important;margin-top:40px;width:100%}.centralContent .figures1 .icon_arangodb_info,.centralContent .figures2 .icon_arangodb_info,.centralContent .figures3 .icon_arangodb_info{position:relative;text-align:center}.pure-table-body{overflow-x:none;overflow-y:auto}.pure-table-body .selected-row{background-color:rgba(46,204,113,.2)}.pure-table-body .dataTables_empty{padding-left:10px}.pure-table-body .heading{font-weight:600;height:40px;padding-bottom:10px;padding-top:10px}.pure-table-body .fa.fa-info-circle{cursor:pointer;margin-right:3px;opacity:.4}.pure-table-body .fa:hover{opacity:1}.pure-table{padding-left:20px;padding-right:20px}.pure-table.no-padding{padding-left:0;padding-right:0}.pure-table.no-padding .pure-table-row div div{padding-left:2.5px}.pure-table.no-padding.pure-table-header .pure-table-row>div:first-child .title{padding-left:10px}.pure-table.pure-title .pure-table-row{color:#717d90;font-weight:600}.pure-table.pure-title .pure-table-row:hover{background-color:#fff;cursor:default}.pure-table.pure-title .pure-table-row:last-child{border-bottom:1px solid rgba(140,138,137,.25);margin-bottom:0}.pure-table .pure-table-row{border-bottom:1px solid rgba(140,138,137,.25);color:#8a969f;font-weight:100;line-height:40px;width:100%}.pure-table .pure-table-row .padding-left{padding-left:30px}.pure-table .pure-table-row .padding-right{padding-right:30px}.pure-table .pure-table-row .actions i{margin-left:5px;margin-right:5px}.pure-table .pure-table-row:hover{background-color:#eff0eb;cursor:pointer}.pure-table .pure-table-row.disabled:hover{background-color:#fff;cursor:not-allowed}.pure-table .pure-table-row.noHover:hover{background-color:#fff;cursor:default}.pure-table .pure-table-row .left{text-align:left}.pure-table .pure-table-row .right{text-align:right}.pure-table .pure-table-row .mid{text-align:center}.pure-table .pure-table-row .positive{color:#2ecc71}.pure-table .pure-table-row .negative{color:#e74c3c}.pure-table .pure-table-row .warning{color:#f1c40f}.pure-table .pure-table-row .fa.fa-check-circle{color:#2ecc71}.pure-table .pure-table-row .fa.fa-exclamation-circle{color:#e74c3c}.pure-table .pure-table-row:last-child{border-bottom:0;margin-bottom:10px}.hotkeysList .hotkeysLabel{clear:both;color:#000;font-size:16px;font-weight:400}.hotkeysList .hotkeysContent{padding-left:10px}.hotkeysList li{line-height:25px}.hotkeysList li .hotkeysDiv{float:left}.hotkeysList .hotkeysicons{background-color:#686766;border:1px solid #000;border-radius:2px;color:#fff;display:inline;height:19px;margin-left:10px;text-align:center;width:19px}.hotkeysContentLabel{float:left;width:30%}.coords-dbs .pure-table-row.noHover,.coords-dbs .pure-table-row.noHover:hover{cursor:not-allowed!important}#nodesContent{padding-top:0}#nodesContent .pure-table-body .fa-check-circle,#nodesContent .pure-table-body .fa-exclamation-circle{font-size:15pt}.shardFollowers span:hover,.shardLeader span:hover{color:#000;cursor:pointer}input[type=range]{-webkit-appearance:none;border:1px solid #fff;border-radius:3px;margin-top:10px;width:218px}input[type=range]::-webkit-slider-runnable-track{background:#ddd;border:0;border-radius:3px;height:5px;width:218px}input[type=range]::-webkit-slider-thumb{-webkit-appearance:none;background:#2ecc71;border:0;border-radius:50%;height:16px;margin-top:-5px;width:16px}input[type=range]:focus{outline:0}input[type=range]:focus::-webkit-slider-runnable-track{background:#ccc}input[type=range]::-moz-range-track{background:#e1e1e1;border:0;border-radius:3px;height:5px;width:218px}input[type=range]::-moz-range-thumb{background:#2ecc71;border:0;border-radius:50%;height:16px;width:16px}input[type=range]:-moz-focusring{outline:#fff solid 1px;outline-offset:-1px}input[type=range]::-ms-track{background:0 0;border-color:transparent;border-width:6px 0;color:transparent;height:5px;width:218px}input[type=range]::-ms-fill-lower{background:#666;border-radius:10px}input[type=range]::-ms-fill-upper{background:#ddd;border-radius:10px}input[type=range]::-ms-thumb{background:#2ecc71;border:0;border-radius:50%;height:16px;width:16px}input[type=range]:focus::-ms-fill-lower{background:#999}input[type=range]:focus::-ms-fill-upper{background:#ccc}.arangoState{background-color:#404a53;border-radius:3px;color:#fff;font-size:10pt;font-weight:100;padding:5px 8px}.arango-table tbody tr:nth-child(even),.arango-table thead{background-color:#fff}.arango-table{width:100%}.arango-table thead th{border-bottom:1px solid #c2c2c2;font-weight:400;height:43px}.arango-table tbody tr:nth-child(odd){background:rgba(104,103,102,.05)}.arango-table tbody td{padding:10px 18px}.arango-tabbar{height:27px;width:100%}.arango-tabbar button{background-color:#404a53;border:0;border-top-left-radius:2px;border-top-right-radius:2px;color:#fff;float:right;font-weight:100;height:27px;margin-right:5px;width:82px}.arango-tabbar button:first-child{margin-right:10px}.arango-tabbar .arango-active-tab{background-color:#fff;border-bottom:1px solid #fff;border-left:1px solid #c2c2c2;border-right:1px solid #c2c2c2;border-top:1px solid #c2c2c2;color:#000;height:28px;margin-bottom:-1px}.subViewNavbar{border-bottom:2px solid #d9dbdc;height:40px;list-style:none;width:100%;z-index:1000;margin:-57px 0 15px -15px}.subViewNavbar li{cursor:pointer;float:left;font-size:10pt;line-height:30px;margin-bottom:5px;margin-top:5px;padding:0 12px}.subViewNavbar li.active{border-bottom:2px solid #77cb99;cursor:default;padding-bottom:5px}.subViewNavbar li.active a{color:#000}.subViewNavbar li.disabled{cursor:not-allowed}.subViewNavbar li.disabled:hover a{color:rgba(51,51,51,.6)}.subViewNavbar li:hover a{color:#333;transition:all .2s ease-in}.subViewNavbar li a,.subnavmenu ul li:hover a{-moz-transition:all .2s ease-in;-o-transition:all .2s ease-in;-webkit-transition:all .2s ease-in}.subViewNavbar li a{color:rgba(51,51,51,.6);transition:all .2s ease-in}.subnavmenu{background-color:#fff;height:auto}.subnavmenu .bar-img{background:0 0;border-radius:25px;margin-right:5px;width:25px}.subnavmenu .bar-img:hover{cursor:pointer}.subnavmenu ul{list-style:none;margin:0}.subnavmenu ul.top{background-color:#404a53;height:60px;width:100%}.subnavmenu ul.top li{padding:0 10px 0 0}.subnavmenu ul.bottom{border-bottom:2px solid #d9dbdc;height:40px;width:100%;z-index:1000}.subnavmenu ul.bottom li{float:left;padding:0 12px}.subnavmenu ul li{cursor:pointer;font-size:10pt;line-height:30px;margin-bottom:5px;margin-top:5px}.subnavmenu ul li.active{border-bottom:2px solid #77cb99;cursor:default;padding-bottom:5px}.subnavmenu ul li.active a{color:#000}.subnavmenu ul li.disabled{cursor:not-allowed}.subnavmenu ul li.disabled:hover a{color:rgba(51,51,51,.6)}.subnavmenu ul li:hover a{color:#333;transition:all .2s ease-in}.subnavmenu ul li a{color:rgba(51,51,51,.6);-moz-transition:all .2s ease-in;-o-transition:all .2s ease-in;-webkit-transition:all .2s ease-in;transition:all .2s ease-in}.subnavmenu .infoEntry{line-height:45px}.subnavmenu .infoEntry a{margin-right:5px}.subnavmenu .infoEntry a.default-icon i{color:#fff}.subnavmenu .infoEntry a.default-icon i:hover{color:#2ecc71;cursor:pointer}.subnavmenu .infoEntry:hover{cursor:default}.subnavmenu .infoEntry:hover .info{-webkit-touch-callout:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;-webkit-user-select:none;user-select:none;color:#fff}.subnavmenu .infoEntry.positive .health-icon,.subnavmenu .infoEntry.positive .health-state,.subnavmenu .infoEntry.positive .state{color:#2ecc71}.subnavmenu .infoEntry.negative .health-icon,.subnavmenu .infoEntry.negative .health-state{color:#e74c3c}.subnavmenu .icon,.subnavmenu .info,.subnavmenu .state{color:rgba(255,255,255,.95);display:block;float:left;font-weight:300;max-width:150px;overflow:hidden;text-transform:uppercase}.subnavmenu .icon span,.subnavmenu .info span,.subnavmenu .state span{color:#2ecc71}.subnavmenu .icon span:hover,.subnavmenu .info span:hover,.subnavmenu .state span:hover{cursor:pointer}.subnavmenu #dbStatus{padding-right:20px}.subBarDropdown{background:#fff;border:1px solid rgba(64,74,83,.2);display:none;margin-top:55px!important;min-width:200px;position:absolute;z-index:9999}.subBarDropdown li{padding:0}.subBarDropdown .dropdown-header{background-color:#77cb99;cursor:default;margin:0 -1px;padding:0!important}.subBarDropdown .dropdown-header img{border:3px solid #6dba8c;border-radius:75px;display:block;margin:10px auto 0;width:75px}.subBarDropdown .dropdown-header p,.subBarDropdown .dropdown-header small{color:#fff;text-align:center}.subBarDropdown .dropdown-header small{display:block;margin-top:-10px}.subBarDropdown .dropdown-footer{padding:0 5px 0 0!important}.subBarDropdown .dropdown-footer button{margin-bottom:5px;margin-top:-4px}.helpUs iframe{left:0;position:absolute;right:0;top:101px}#community,#documentation{padding:20px 40px 40px}#community h4,#documentation h4{font-weight:400}#community a,#documentation a{color:#3498db}#community .pure-u-1-1,#documentation .pure-u-1-1{font-weight:100}#community .center,#documentation .center{margin-top:10px;text-align:center}#community ul,#documentation ul{list-style-type:none;margin:0 0 10px 10px}#community .menu li:first-child,#community .menu li:last-child,#documentation .menu li:first-child,#documentation .menu li:last-child{padding-top:20px}@media all and (-ms-high-contrast:none),(-ms-high-contrast:active){div .bigtile .collection-type-icon,div .tile .collection-type-icon{margin-left:0!important;position:relative!important;top:-58px!important}.tile .icon_arangodb_edge5{margin-left:0!important;position:relative!important;top:-67px!important}}.arangoDataTable{display:block;position:relative;width:100%}.arangoDataTable tbody{display:inline-block;max-height:200px;overflow-y:auto;position:absolute;width:100%}.arangoDataTable thead{background-color:#fff!important;display:inline-block;font-weight:400!important;text-align:left;width:100%}.arangoDataTable thead td{overflow:hidden}.arangoDataTable thead th{border-bottom:0;cursor:default!important;font-weight:400!important;padding:10px 14px!important}.arangoDataTable thead tr{border-bottom:1px solid #c2c2c2}.arangoDataTable tr{cursor:pointer}.arangoDataTable td{padding:8px 18px!important}.arangoDataTable .key{font-weight:100;margin-top:4px;overflow:hidden}.arangoDataTable .dataTable .noPointer tr{cursor:default}.arangoDataTable .selected-row{background-color:#2ecc71!important}.arangoDataTable .selected-row div,.arangoDataTable .selected-row li,.arangoDataTable .selected-row span{color:#fff!important}.api-container #resources>li.resource:nth-child(even),table.arangoDataTable tr.even{background-color:#fff}.api-container #resources>li.resource:nth-child(odd),table.arangoDataTable tr.odd{background-color:rgba(104,103,102,.05)}#tableDiv table.dataTable td{padding:12px 18px!important}#documentsTableID_filter,#documentsTableID_length{display:none}#documentsTableID_wrapper{padding-bottom:0!important}.snippet-no-num{font-size:1em;font-weight:400;margin-bottom:0}.cuttedContent,.prettify ul li,.writeable a{overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important}.totalDocuments{color:#666;float:left;font-weight:100;margin-top:-37px!important;padding-left:10px}.prettify{border:none!important;font-size:1em!important;margin:0!important;padding:0!important}.edit-index-table tfoot,.newIndexClass table{border-top:1px solid #f7f3f2}table .sorting{background:0 0!important}.new-index-view input[type=checkbox]{float:left}.new-index-view table tr{width:600px!important}.new-index-view table tr th:last-child{width:50px!important}.new-index-view table th{font-weight:300!important;width:200px!important}#documentsDiv{padding-top:0}#documentsDiv .pure-table .snippet-container{margin-top:10px}.edit-index-table{margin-top:5px;min-width:auto!important}.edit-index-table th{padding-bottom:5px;padding-left:5px;padding-top:5px}.edit-index-table .icon_arangodb_locked{color:rgba(0,0,0,.5);cursor:default;font-size:20px;margin-left:10px}.index-button-bar i:hover,.queryline .fa-info-circle:hover{cursor:pointer}.edit-index-table .icon_arangodb_roundminus{font-size:20px;margin-left:10px}.edit-index-table tfoot i{color:#2ecc71;font-size:19px;margin-left:22px;margin-top:5px}.edit-index-table tfoot i:hover{color:#58d68d;cursor:pointer}.contentIn .arangoicon{font-size:25px;position:relative;top:-3px!important}#collectionEditIndexTable thead{border-bottom:1px solid #e5e5e5}.newIndexClass table{margin-bottom:60px}.newIndexClass table select{margin-right:7px}.newIndexClass table .arangoicon{float:right;margin-right:-12px;margin-top:5px}.index-button-bar{float:right}.index-button-bar i{color:#2ecc71;font-size:16pt;margin-right:43px}.index-button-bar #cancelIndex{margin-right:13px}.docsFirstCol,.docsSecCol,.docsThirdCol{border:0!important}.docsFirstCol{height:26px;width:80%}.docsSecCol{height:26px;min-width:400px!important;width:10%}.docsThirdCol{height:26px}.add-filter-item{margin-left:5px}.add-filter-item i{margin-top:0!important}.upload-indicator{display:none;margin-top:-3px;padding-right:10px}.documentsDropdown .dropdownImport,.documentsDropdown .headerDropdown{clear:both;margin-bottom:10px}.documents-size{background-color:#fff!important;border:1px solid #e5e5e5;border-radius:0;box-shadow:none;color:#000;float:right;font-size:11pt;font-weight:300;height:28px;line-height:18px;margin-left:10px;margin-top:0;width:115px}.ace_error{background:0 0!important}#exportHeader .fa-exclamation-circle{color:#fff;font-size:13pt;margin-right:10px}.totalDocuments:hover{color:#000}.ajax-file-upload-statusbar{-moz-border-radius:2px;-webkit-border-radius:2px;border-radius:2px;border:1px solid rgba(0,0,0,.7);margin:10px 10px 5px 5px;padding:5px;width:420px}.ajax-file-upload-filename{color:grey;height:auto;margin:0 5px 5px 10px;width:100%}.ajax-file-upload-progress{-moz-border-radius:2px;-webkit-border-radius:2px;border-radius:2px;border:1px solid #d9d9d9;display:inline-block;margin:0 10px 5px;padding:1px;position:relative;width:250px}.ajax-file-upload-bar{-moz-border-radius:2px;-webkit-border-radius:2px;border-radius:2px;background-color:rgba(0,0,0,.7);color:#fff;height:20px;width:0}.ajax-file-upload-percent{display:inline-block;left:48%;position:absolute;top:3px}.ajax-file-upload-red{font-size:13px;font-weight:400;margin-right:5px;padding:4px 15px;vertical-align:top}.ajax-file-upload{display:inline-block;font-size:16px;font-weight:700;height:25px;margin:0 10px 10px 0;padding:6px 10px 4px}.ajax-upload-dragdrop{border:1px dotted #8f8d8c;color:#736b68;padding:10px 10px 0;text-align:left;vertical-align:middle;width:506px}.ajax-upload-dragdrop span{position:relative;top:-22px}/*! + */@font-face{font-family:FontAwesome;src:url(../fonts/fontawesome/fontawesome-webfont.eot?v=4.4.0);src:url(../fonts/fontawesome/fontawesome-webfont.eot?#iefix&v=4.4.0) format("embedded-opentype"),url(../fonts/fontawesome/fontawesome-webfont.woff2?v=4.4.0) format("woff2"),url(../fonts/fontawesome/fontawesome-webfont.woff?v=4.4.0) format("woff"),url(../fonts/fontawesome/fontawesome-webfont.ttf?v=4.4.0) format("truetype"),url(../fonts/fontawesome/fontawesome-webfont.svg?v=4.4.0#fontawesomeregular) format("svg");font-weight:400;font-style:normal}.fa{font:normal normal normal 14px/1 FontAwesome;font-size:inherit;text-rendering:auto;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.fa-lg{font-size:1.3333333333em;line-height:.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.2857142857em;text-align:center}.fa-ul{padding-left:0;margin-left:2.1428571429em;list-style-type:none}.fa.fa-pull-right,.fa.pull-right{margin-left:.3em}.fa-ul>li{position:relative}.fa-li{position:absolute;left:-2.1428571429em;width:2.1428571429em;top:.1428571429em;text-align:center}.fa-li.fa-lg{left:-1.8571428571em}.fa-border{padding:.2em .25em .15em;border:.08em solid #eee;border-radius:.1em}.fa-pull-left{float:left}.fa-pull-right,.pull-right{float:right}.contentDiv li,.dashboard-bar-chart-container,.dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-chart,.dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-title,.dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-title .absolut,.dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-title .percentage,.dashboard-full-width-chart,.dashboard-full-width-chart .dashboard-full-width-chart-inner,.dashboard-full-width-chart .dashboard-full-width-chart-inner .dashboard-interior-chart,.dashboard-half-height-legend,.dashboard-large-chart,.dashboard-large-chart .dashboard-large-chart-inner,.dashboard-large-chart .dashboard-large-chart-inner .dashboard-interior-chart,.dashboard-medium-chart,.dashboard-medium-chart .dashboard-interior-chart,.dashboard-small-chart,.dashboard-small-chart .dashboard-small-chart-inner,.dashboard-small-chart .dashboard-small-chart-inner .dashboard-interior-chart,.dashboard-sub-bar,.dashboard-sub-bar .dashboard-sub-bar-title,.dashboard-tendency-container,.dashboard-tendency-container .dashboard-tendency-chart .dashboard-tendency,.dashboard-tendency-container .dashboard-tendency-chart .dashboard-tendency .dashboard-figure,.dashboard-tendency-container .dashboard-tendency-chart .dashboard-tendency .dashboard-subtitle-bar,.dashboard-title-bar .dashboard-half-title-bar,.dashboardModal,.dropdown-toolbar,.fixedDropdown .notificationItemContent,.gv-dropdown-menu,.innerDropdownInnerUL,.link-dropdown-menu,.modal-chart-detail,.modal-chart-detail .modal-body,.modal-chart-detail .modal-dashboard-legend,.modal-chart-detail .modal-inner-detail,.navlist li,.navlogo,.pagination-line li a,.pull-left,.script-dropdown-menu,.user-dropdown-menu,a.button-gui,a.headerButton,div .bigtile,div .bigtile a span.add-Icon,div .tile,div .tile a span.add-Icon,div.centralContent,div.dropdownInner ul,div.footer-center,div.footer-left{float:left}.fa-spin{-webkit-animation:fa-spin 2s infinite linear;animation:fa-spin 2s infinite linear}.fa-pulse{-webkit-animation:fa-spin 1s infinite steps(8);animation:fa-spin 1s infinite steps(8)}@-webkit-keyframes fa-spin{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}@keyframes fa-spin{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}.fa-rotate-90{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=1);-webkit-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg)}.fa-rotate-180{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=2);-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg)}.fa-rotate-270{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=3);-webkit-transform:rotate(270deg);-ms-transform:rotate(270deg);transform:rotate(270deg)}.fa-flip-horizontal{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=0);-webkit-transform:scale(-1,1);-ms-transform:scale(-1,1);transform:scale(-1,1)}.fa-flip-vertical{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=2);-webkit-transform:scale(1,-1);-ms-transform:scale(1,-1);transform:scale(1,-1)}:root .fa-flip-horizontal,:root .fa-flip-vertical,:root .fa-rotate-180,:root .fa-rotate-270,:root .fa-rotate-90{filter:none}.fa-stack{position:relative;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:#fff}.fa-glass:before{content:""}.fa-music:before{content:""}.fa-search:before{content:""}.fa-envelope-o:before{content:""}.fa-heart:before{content:""}.fa-star:before{content:""}.fa-star-o:before{content:""}.fa-user:before{content:""}.fa-film:before{content:""}.fa-th-large:before{content:""}.fa-th:before{content:""}.fa-th-list:before{content:""}.fa-check:before{content:""}.fa-close:before,.fa-remove:before,.fa-times:before{content:""}.fa-search-plus:before{content:""}.fa-search-minus:before{content:""}.fa-power-off:before{content:""}.fa-signal:before{content:""}.fa-cog:before,.fa-gear:before{content:""}.fa-trash-o:before{content:""}.fa-home:before{content:""}.fa-file-o:before{content:""}.fa-clock-o:before{content:""}.fa-road:before{content:""}.fa-download:before{content:""}.fa-arrow-circle-o-down:before{content:""}.fa-arrow-circle-o-up:before{content:""}.fa-inbox:before{content:""}.fa-play-circle-o:before{content:""}.fa-repeat:before,.fa-rotate-right:before{content:""}.fa-refresh:before{content:""}.fa-list-alt:before{content:""}.fa-lock:before{content:""}.fa-flag:before{content:""}.fa-headphones:before{content:""}.fa-volume-off:before{content:""}.fa-volume-down:before{content:""}.fa-volume-up:before{content:""}.fa-qrcode:before{content:""}.fa-barcode:before{content:""}.fa-tag:before{content:""}.fa-tags:before{content:""}.fa-book:before{content:""}.fa-bookmark:before{content:""}.fa-print:before{content:""}.fa-camera:before{content:""}.fa-font:before{content:""}.fa-bold:before{content:""}.fa-italic:before{content:""}.fa-text-height:before{content:""}.fa-text-width:before{content:""}.fa-align-left:before{content:""}.fa-align-center:before{content:""}.fa-align-right:before{content:""}.fa-align-justify:before{content:""}.fa-list:before{content:""}.fa-dedent:before,.fa-outdent:before{content:""}.fa-indent:before{content:""}.fa-video-camera:before{content:""}.fa-image:before,.fa-photo:before,.fa-picture-o:before{content:""}.fa-pencil:before{content:""}.fa-map-marker:before{content:""}.fa-adjust:before{content:""}.fa-tint:before{content:""}.fa-edit:before,.fa-pencil-square-o:before{content:""}.fa-share-square-o:before{content:""}.fa-check-square-o:before{content:""}.fa-arrows:before{content:""}.fa-step-backward:before{content:""}.fa-fast-backward:before{content:""}.fa-backward:before{content:""}.fa-play:before{content:""}.fa-pause:before{content:""}.fa-stop:before{content:""}.fa-forward:before{content:""}.fa-fast-forward:before{content:""}.fa-step-forward:before{content:""}.fa-eject:before{content:""}.fa-chevron-left:before{content:""}.fa-chevron-right:before{content:""}.fa-plus-circle:before{content:""}.fa-minus-circle:before{content:""}.fa-times-circle:before{content:""}.fa-check-circle:before{content:""}.fa-question-circle:before{content:""}.fa-info-circle:before{content:""}.fa-crosshairs:before{content:""}.fa-times-circle-o:before{content:""}.fa-check-circle-o:before{content:""}.fa-ban:before{content:""}.fa-arrow-left:before{content:""}.fa-arrow-right:before{content:""}.fa-arrow-up:before{content:""}.fa-arrow-down:before{content:""}.fa-mail-forward:before,.fa-share:before{content:""}.fa-expand:before{content:""}.fa-compress:before{content:""}.fa-plus:before{content:""}.fa-minus:before{content:""}.fa-asterisk:before{content:""}.fa-exclamation-circle:before{content:""}.fa-gift:before{content:""}.fa-leaf:before{content:""}.fa-fire:before{content:""}.fa-eye:before{content:""}.fa-eye-slash:before{content:""}.fa-exclamation-triangle:before,.fa-warning:before{content:""}.fa-plane:before{content:""}.fa-calendar:before{content:""}.fa-random:before{content:""}.fa-comment:before{content:""}.fa-magnet:before{content:""}.fa-chevron-up:before{content:""}.fa-chevron-down:before{content:""}.fa-retweet:before{content:""}.fa-shopping-cart:before{content:""}.fa-folder:before{content:""}.fa-folder-open:before{content:""}.fa-arrows-v:before{content:""}.fa-arrows-h:before{content:""}.fa-bar-chart-o:before,.fa-bar-chart:before{content:""}.fa-twitter-square:before{content:""}.fa-facebook-square:before{content:""}.fa-camera-retro:before{content:""}.fa-key:before{content:""}.fa-cogs:before,.fa-gears:before{content:""}.fa-comments:before{content:""}.fa-thumbs-o-up:before{content:""}.fa-thumbs-o-down:before{content:""}.fa-star-half:before{content:""}.fa-heart-o:before{content:""}.fa-sign-out:before{content:""}.fa-linkedin-square:before{content:""}.fa-thumb-tack:before{content:""}.fa-external-link:before{content:""}.fa-sign-in:before{content:""}.fa-trophy:before{content:""}.fa-github-square:before{content:""}.fa-upload:before{content:""}.fa-lemon-o:before{content:""}.fa-phone:before{content:""}.fa-square-o:before{content:""}.fa-bookmark-o:before{content:""}.fa-phone-square:before{content:""}.fa-twitter:before{content:""}.fa-facebook-f:before,.fa-facebook:before{content:""}.fa-github:before{content:""}.fa-unlock:before{content:""}.fa-credit-card:before{content:""}.fa-feed:before,.fa-rss:before{content:""}.fa-hdd-o:before{content:""}.fa-bullhorn:before{content:""}.fa-bell:before{content:""}.fa-certificate:before{content:""}.fa-hand-o-right:before{content:""}.fa-hand-o-left:before{content:""}.fa-hand-o-up:before{content:""}.fa-hand-o-down:before{content:""}.fa-arrow-circle-left:before{content:""}.fa-arrow-circle-right:before{content:""}.fa-arrow-circle-up:before{content:""}.fa-arrow-circle-down:before{content:""}.fa-globe:before{content:""}.fa-wrench:before{content:""}.fa-tasks:before{content:""}.fa-filter:before{content:""}.fa-briefcase:before{content:""}.fa-arrows-alt:before{content:""}.fa-group:before,.fa-users:before{content:""}.fa-chain:before,.fa-link:before{content:""}.fa-cloud:before{content:""}.fa-flask:before{content:""}.fa-cut:before,.fa-scissors:before{content:""}.fa-copy:before,.fa-files-o:before{content:""}.fa-paperclip:before{content:""}.fa-floppy-o:before,.fa-save:before{content:""}.fa-square:before{content:""}.fa-bars:before,.fa-navicon:before,.fa-reorder:before{content:""}.fa-list-ul:before{content:""}.fa-list-ol:before{content:""}.fa-strikethrough:before{content:""}.fa-underline:before{content:""}.fa-table:before{content:""}.fa-magic:before{content:""}.fa-truck:before{content:""}.fa-pinterest:before{content:""}.fa-pinterest-square:before{content:""}.fa-google-plus-square:before{content:""}.fa-google-plus:before{content:""}.fa-money:before{content:""}.fa-caret-down:before{content:""}.fa-caret-up:before{content:""}.fa-caret-left:before{content:""}.fa-caret-right:before{content:""}.fa-columns:before{content:""}.fa-sort:before,.fa-unsorted:before{content:""}.fa-sort-desc:before,.fa-sort-down:before{content:""}.fa-sort-asc:before,.fa-sort-up:before{content:""}.fa-envelope:before{content:""}.fa-linkedin:before{content:""}.fa-rotate-left:before,.fa-undo:before{content:""}.fa-gavel:before,.fa-legal:before{content:""}.fa-dashboard:before,.fa-tachometer:before{content:""}.fa-comment-o:before{content:""}.fa-comments-o:before{content:""}.fa-bolt:before,.fa-flash:before{content:""}.fa-sitemap:before{content:""}.fa-umbrella:before{content:""}.fa-clipboard:before,.fa-paste:before{content:""}.fa-lightbulb-o:before{content:""}.fa-exchange:before{content:""}.fa-cloud-download:before{content:""}.fa-cloud-upload:before{content:""}.fa-user-md:before{content:""}.fa-stethoscope:before{content:""}.fa-suitcase:before{content:""}.fa-bell-o:before{content:""}.fa-coffee:before{content:""}.fa-cutlery:before{content:""}.fa-file-text-o:before{content:""}.fa-building-o:before{content:""}.fa-hospital-o:before{content:""}.fa-ambulance:before{content:""}.fa-medkit:before{content:""}.fa-fighter-jet:before{content:""}.fa-beer:before{content:""}.fa-h-square:before{content:""}.fa-plus-square:before{content:""}.fa-angle-double-left:before{content:""}.fa-angle-double-right:before{content:""}.fa-angle-double-up:before{content:""}.fa-angle-double-down:before{content:""}.fa-angle-left:before{content:""}.fa-angle-right:before{content:""}.fa-angle-up:before{content:""}.fa-angle-down:before{content:""}.fa-desktop:before{content:""}.fa-laptop:before{content:""}.fa-tablet:before{content:""}.fa-mobile-phone:before,.fa-mobile:before{content:""}.fa-circle-o:before{content:""}.fa-quote-left:before{content:""}.fa-quote-right:before{content:""}.fa-spinner:before{content:""}.fa-circle:before{content:""}.fa-mail-reply:before,.fa-reply:before{content:""}.fa-github-alt:before{content:""}.fa-folder-o:before{content:""}.fa-folder-open-o:before{content:""}.fa-smile-o:before{content:""}.fa-frown-o:before{content:""}.fa-meh-o:before{content:""}.fa-gamepad:before{content:""}.fa-keyboard-o:before{content:""}.fa-flag-o:before{content:""}.fa-flag-checkered:before{content:""}.fa-terminal:before{content:""}.fa-code:before{content:""}.fa-mail-reply-all:before,.fa-reply-all:before{content:""}.fa-star-half-empty:before,.fa-star-half-full:before,.fa-star-half-o:before{content:""}.fa-location-arrow:before{content:""}.fa-crop:before{content:""}.fa-code-fork:before{content:""}.fa-chain-broken:before,.fa-unlink:before{content:""}.fa-question:before{content:""}.fa-info:before{content:""}.fa-exclamation:before{content:""}.fa-superscript:before{content:""}.fa-subscript:before{content:""}.fa-eraser:before{content:""}.fa-puzzle-piece:before{content:""}.fa-microphone:before{content:""}.fa-microphone-slash:before{content:""}.fa-shield:before{content:""}.fa-calendar-o:before{content:""}.fa-fire-extinguisher:before{content:""}.fa-rocket:before{content:""}.fa-maxcdn:before{content:""}.fa-chevron-circle-left:before{content:""}.fa-chevron-circle-right:before{content:""}.fa-chevron-circle-up:before{content:""}.fa-chevron-circle-down:before{content:""}.fa-html5:before{content:""}.fa-css3:before{content:""}.fa-anchor:before{content:""}.fa-unlock-alt:before{content:""}.fa-bullseye:before{content:""}.fa-ellipsis-h:before{content:""}.fa-ellipsis-v:before{content:""}.fa-rss-square:before{content:""}.fa-play-circle:before{content:""}.fa-ticket:before{content:""}.fa-minus-square:before{content:""}.fa-minus-square-o:before{content:""}.fa-level-up:before{content:""}.fa-level-down:before{content:""}.fa-check-square:before{content:""}.fa-pencil-square:before{content:""}.fa-external-link-square:before{content:""}.fa-share-square:before{content:""}.fa-compass:before{content:""}.fa-caret-square-o-down:before,.fa-toggle-down:before{content:""}.fa-caret-square-o-up:before,.fa-toggle-up:before{content:""}.fa-caret-square-o-right:before,.fa-toggle-right:before{content:""}.fa-eur:before,.fa-euro:before{content:""}.fa-gbp:before{content:""}.fa-dollar:before,.fa-usd:before{content:""}.fa-inr:before,.fa-rupee:before{content:""}.fa-cny:before,.fa-jpy:before,.fa-rmb:before,.fa-yen:before{content:""}.fa-rouble:before,.fa-rub:before,.fa-ruble:before{content:""}.fa-krw:before,.fa-won:before{content:""}.fa-bitcoin:before,.fa-btc:before{content:""}.fa-file:before{content:""}.fa-file-text:before{content:""}.fa-sort-alpha-asc:before{content:""}.fa-sort-alpha-desc:before{content:""}.fa-sort-amount-asc:before{content:""}.fa-sort-amount-desc:before{content:""}.fa-sort-numeric-asc:before{content:""}.fa-sort-numeric-desc:before{content:""}.fa-thumbs-up:before{content:""}.fa-thumbs-down:before{content:""}.fa-youtube-square:before{content:""}.fa-youtube:before{content:""}.fa-xing:before{content:""}.fa-xing-square:before{content:""}.fa-youtube-play:before{content:""}.fa-dropbox:before{content:""}.fa-stack-overflow:before{content:""}.fa-instagram:before{content:""}.fa-flickr:before{content:""}.fa-adn:before{content:""}.fa-bitbucket:before{content:""}.fa-bitbucket-square:before{content:""}.fa-tumblr:before{content:""}.fa-tumblr-square:before{content:""}.fa-long-arrow-down:before{content:""}.fa-long-arrow-up:before{content:""}.fa-long-arrow-left:before{content:""}.fa-long-arrow-right:before{content:""}.fa-apple:before{content:""}.fa-windows:before{content:""}.fa-android:before{content:""}.fa-linux:before{content:""}.fa-dribbble:before{content:""}.fa-skype:before{content:""}.fa-foursquare:before{content:""}.fa-trello:before{content:""}.fa-female:before{content:""}.fa-male:before{content:""}.fa-gittip:before,.fa-gratipay:before{content:""}.fa-sun-o:before{content:""}.fa-moon-o:before{content:""}.fa-archive:before{content:""}.fa-bug:before{content:""}.fa-vk:before{content:""}.fa-weibo:before{content:""}.fa-renren:before{content:""}.fa-pagelines:before{content:""}.fa-stack-exchange:before{content:""}.fa-arrow-circle-o-right:before{content:""}.fa-arrow-circle-o-left:before{content:""}.fa-caret-square-o-left:before,.fa-toggle-left:before{content:""}.fa-dot-circle-o:before{content:""}.fa-wheelchair:before{content:""}.fa-vimeo-square:before{content:""}.fa-try:before,.fa-turkish-lira:before{content:""}.fa-plus-square-o:before{content:""}.fa-space-shuttle:before{content:""}.fa-slack:before{content:""}.fa-envelope-square:before{content:""}.fa-wordpress:before{content:""}.fa-openid:before{content:""}.fa-bank:before,.fa-institution:before,.fa-university:before{content:""}.fa-graduation-cap:before,.fa-mortar-board:before{content:""}.fa-yahoo:before{content:""}.fa-google:before{content:""}.fa-reddit:before{content:""}.fa-reddit-square:before{content:""}.fa-stumbleupon-circle:before{content:""}.fa-stumbleupon:before{content:""}.fa-delicious:before{content:""}.fa-digg:before{content:""}.fa-pied-piper:before{content:""}.fa-pied-piper-alt:before{content:""}.fa-drupal:before{content:""}.fa-joomla:before{content:""}.fa-language:before{content:""}.fa-fax:before{content:""}.fa-building:before{content:""}.fa-child:before{content:""}.fa-paw:before{content:""}.fa-spoon:before{content:""}.fa-cube:before{content:""}.fa-cubes:before{content:""}.fa-behance:before{content:""}.fa-behance-square:before{content:""}.fa-steam:before{content:""}.fa-steam-square:before{content:""}.fa-recycle:before{content:""}.fa-automobile:before,.fa-car:before{content:""}.fa-cab:before,.fa-taxi:before{content:""}.fa-tree:before{content:""}.fa-spotify:before{content:""}.fa-deviantart:before{content:""}.fa-soundcloud:before{content:""}.fa-database:before{content:""}.fa-file-pdf-o:before{content:""}.fa-file-word-o:before{content:""}.fa-file-excel-o:before{content:""}.fa-file-powerpoint-o:before{content:""}.fa-file-image-o:before,.fa-file-photo-o:before,.fa-file-picture-o:before{content:""}.fa-file-archive-o:before,.fa-file-zip-o:before{content:""}.fa-file-audio-o:before,.fa-file-sound-o:before{content:""}.fa-file-movie-o:before,.fa-file-video-o:before{content:""}.fa-file-code-o:before{content:""}.fa-vine:before{content:""}.fa-codepen:before{content:""}.fa-jsfiddle:before{content:""}.fa-life-bouy:before,.fa-life-buoy:before,.fa-life-ring:before,.fa-life-saver:before,.fa-support:before{content:""}.fa-circle-o-notch:before{content:""}.fa-ra:before,.fa-rebel:before{content:""}.fa-empire:before,.fa-ge:before{content:""}.fa-git-square:before{content:""}.fa-git:before{content:""}.fa-hacker-news:before,.fa-y-combinator-square:before,.fa-yc-square:before{content:""}.fa-tencent-weibo:before{content:""}.fa-qq:before{content:""}.fa-wechat:before,.fa-weixin:before{content:""}.fa-paper-plane:before,.fa-send:before{content:""}.fa-paper-plane-o:before,.fa-send-o:before{content:""}.fa-history:before{content:""}.fa-circle-thin:before{content:""}.fa-header:before{content:""}.fa-paragraph:before{content:""}.fa-sliders:before{content:""}.fa-share-alt:before{content:""}.fa-share-alt-square:before{content:""}.fa-bomb:before{content:""}.fa-futbol-o:before,.fa-soccer-ball-o:before{content:""}.fa-tty:before{content:""}.fa-binoculars:before{content:""}.fa-plug:before{content:""}.fa-slideshare:before{content:""}.fa-twitch:before{content:""}.fa-yelp:before{content:""}.fa-newspaper-o:before{content:""}.fa-wifi:before{content:""}.fa-calculator:before{content:""}.fa-paypal:before{content:""}.fa-google-wallet:before{content:""}.fa-cc-visa:before{content:""}.fa-cc-mastercard:before{content:""}.fa-cc-discover:before{content:""}.fa-cc-amex:before{content:""}.fa-cc-paypal:before{content:""}.fa-cc-stripe:before{content:""}.fa-bell-slash:before{content:""}.fa-bell-slash-o:before{content:""}.fa-trash:before{content:""}.fa-copyright:before{content:""}.fa-at:before{content:""}.fa-eyedropper:before{content:""}.fa-paint-brush:before{content:""}.fa-birthday-cake:before{content:""}.fa-area-chart:before{content:""}.fa-pie-chart:before{content:""}.fa-line-chart:before{content:""}.fa-lastfm:before{content:""}.fa-lastfm-square:before{content:""}.fa-toggle-off:before{content:""}.fa-toggle-on:before{content:""}.fa-bicycle:before{content:""}.fa-bus:before{content:""}.fa-ioxhost:before{content:""}.fa-angellist:before{content:""}.fa-cc:before{content:""}.fa-ils:before,.fa-shekel:before,.fa-sheqel:before{content:""}.fa-meanpath:before{content:""}.fa-buysellads:before{content:""}.fa-connectdevelop:before{content:""}.fa-dashcube:before{content:""}.fa-forumbee:before{content:""}.fa-leanpub:before{content:""}.fa-sellsy:before{content:""}.fa-shirtsinbulk:before{content:""}.fa-simplybuilt:before{content:""}.fa-skyatlas:before{content:""}.fa-cart-plus:before{content:""}.fa-cart-arrow-down:before{content:""}.fa-diamond:before{content:""}.fa-ship:before{content:""}.fa-user-secret:before{content:""}.fa-motorcycle:before{content:""}.fa-street-view:before{content:""}.fa-heartbeat:before{content:""}.fa-venus:before{content:""}.fa-mars:before{content:""}.fa-mercury:before{content:""}.fa-intersex:before,.fa-transgender:before{content:""}.fa-transgender-alt:before{content:""}.fa-venus-double:before{content:""}.fa-mars-double:before{content:""}.fa-venus-mars:before{content:""}.fa-mars-stroke:before{content:""}.fa-mars-stroke-v:before{content:""}.fa-mars-stroke-h:before{content:""}.fa-neuter:before{content:""}.fa-genderless:before{content:""}.fa-facebook-official:before{content:""}.fa-pinterest-p:before{content:""}.fa-whatsapp:before{content:""}.fa-server:before{content:""}.fa-user-plus:before{content:""}.fa-user-times:before{content:""}.fa-bed:before,.fa-hotel:before{content:""}.fa-viacoin:before{content:""}.fa-train:before{content:""}.fa-subway:before{content:""}.fa-medium:before{content:""}.fa-y-combinator:before,.fa-yc:before{content:""}.fa-optin-monster:before{content:""}.fa-opencart:before{content:""}.fa-expeditedssl:before{content:""}.fa-battery-4:before,.fa-battery-full:before{content:""}.fa-battery-3:before,.fa-battery-three-quarters:before{content:""}.fa-battery-2:before,.fa-battery-half:before{content:""}.fa-battery-1:before,.fa-battery-quarter:before{content:""}.fa-battery-0:before,.fa-battery-empty:before{content:""}.fa-mouse-pointer:before{content:""}.fa-i-cursor:before{content:""}.fa-object-group:before{content:""}.fa-object-ungroup:before{content:""}.fa-sticky-note:before{content:""}.fa-sticky-note-o:before{content:""}.fa-cc-jcb:before{content:""}.fa-cc-diners-club:before{content:""}.fa-clone:before{content:""}.fa-balance-scale:before{content:""}.fa-hourglass-o:before{content:""}.fa-hourglass-1:before,.fa-hourglass-start:before{content:""}.fa-hourglass-2:before,.fa-hourglass-half:before{content:""}.fa-hourglass-3:before,.fa-hourglass-end:before{content:""}.fa-hourglass:before{content:""}.fa-hand-grab-o:before,.fa-hand-rock-o:before{content:""}.fa-hand-paper-o:before,.fa-hand-stop-o:before{content:""}.fa-hand-scissors-o:before{content:""}.fa-hand-lizard-o:before{content:""}.fa-hand-spock-o:before{content:""}.fa-hand-pointer-o:before{content:""}.fa-hand-peace-o:before{content:""}.fa-trademark:before{content:""}.fa-registered:before{content:""}.fa-creative-commons:before{content:""}.fa-gg:before{content:""}.fa-gg-circle:before{content:""}.fa-tripadvisor:before{content:""}.fa-odnoklassniki:before{content:""}.fa-odnoklassniki-square:before{content:""}.fa-get-pocket:before{content:""}.fa-wikipedia-w:before{content:""}.fa-safari:before{content:""}.fa-chrome:before{content:""}.fa-firefox:before{content:""}.fa-opera:before{content:""}.fa-internet-explorer:before{content:""}.fa-television:before,.fa-tv:before{content:""}.fa-contao:before{content:""}.fa-500px:before{content:""}.fa-amazon:before{content:""}.fa-calendar-plus-o:before{content:""}.fa-calendar-minus-o:before{content:""}.fa-calendar-times-o:before{content:""}.fa-calendar-check-o:before{content:""}.fa-industry:before{content:""}.fa-map-pin:before{content:""}.fa-map-signs:before{content:""}.fa-map-o:before{content:""}.fa-map:before{content:""}.fa-commenting:before{content:""}.fa-commenting-o:before{content:""}.fa-houzz:before{content:""}.fa-vimeo:before{content:""}.fa-black-tie:before{content:""}.fa-fonticons:before{content:""}@font-face{font-family:Roboto;font-weight:300;font-style:normal;src:url(../fonts/roboto/Roboto-300/Roboto-300.eot);src:url(../fonts/roboto/Roboto-300/Roboto-300.eot?#iefix) format("embedded-opentype"),local("Roboto Light"),local("Roboto-300"),url(../fonts/roboto/Roboto-300/Roboto-300.woff2) format("woff2"),url(../fonts/roboto/Roboto-300/Roboto-300.woff) format("woff"),url(../fonts/roboto/Roboto-300/Roboto-300.ttf) format("truetype"),url(../fonts/roboto/Roboto-300/Roboto-300.svg#Roboto) format("svg")}@font-face{font-family:Roboto;font-weight:400;font-style:normal;src:url(../fonts/roboto/Roboto-regular/Roboto-regular.eot);src:url(../fonts/roboto/Roboto-regular/Roboto-regular.eot?#iefix) format("embedded-opentype"),local("Roboto"),local("Roboto-regular"),url(../fonts/roboto/Roboto-regular/Roboto-regular.woff2) format("woff2"),url(../fonts/roboto/Roboto-regular/Roboto-regular.woff) format("woff"),url(../fonts/roboto/Roboto-regular/Roboto-regular.ttf) format("truetype"),url(../fonts/roboto/Roboto-regular/Roboto-regular.svg#Roboto) format("svg")}@font-face{font-family:Roboto;font-weight:500;font-style:normal;src:url(../fonts/roboto/Roboto-500/Roboto-500.eot);src:url(../fonts/roboto/Roboto-500/Roboto-500.eot?#iefix) format("embedded-opentype"),local("Roboto Medium"),local("Roboto-500"),url(../fonts/roboto/Roboto-500/Roboto-500.woff2) format("woff2"),url(../fonts/roboto/Roboto-500/Roboto-500.woff) format("woff"),url(../fonts/roboto/Roboto-500/Roboto-500.ttf) format("truetype"),url(../fonts/roboto/Roboto-500/Roboto-500.svg#Roboto) format("svg")}@font-face{font-family:Roboto;font-weight:700;font-style:normal;src:url(../fonts/roboto/Roboto-700/Roboto-700.eot);src:url(../fonts/roboto/Roboto-700/Roboto-700.eot?#iefix) format("embedded-opentype"),local("Roboto Bold"),local("Roboto-700"),url(../fonts/roboto/Roboto-700/Roboto-700.woff2) format("woff2"),url(../fonts/roboto/Roboto-700/Roboto-700.woff) format("woff"),url(../fonts/roboto/Roboto-700/Roboto-700.ttf) format("truetype"),url(../fonts/roboto/Roboto-700/Roboto-700.svg#Roboto) format("svg")}.arango-tab li,.dashboard-legend,.dashboard-sub-bar-menu,.docsThirdCol,.fixedDropdown .notificationItem i,.fixedDropdown button,.headerBar>div.headerButtonBar,.query-button,.search-field,div .bigtile .iconSet span,div .tile .iconSet span,div.footer-right,div.footer-right p,div.gv_colour_list,ul.headerButtonList li{float:right}.collectionInfoTh2,.collectionTh,.dashboard-sub-bar,.dashboard-sub-bar .dashboard-sub-bar-title,.dataNotReadyYet,.dygraph-label.dygraph-title,.figuresHeader th,.graphLabel,.inputEditorWrapper .aqlEditorWrapper .previewWrapper .previewBar,.inputEditorWrapper .aqlEditorWrapper table,.inputEditorWrapper .aqlEditorWrapper table td input,.inputEditorWrapper .aqlEditorWrapper table th,.inputEditorWrapper .bindParamEditorWrapper .previewWrapper .previewBar,.inputEditorWrapper .bindParamEditorWrapper table,.inputEditorWrapper .bindParamEditorWrapper table td input,.inputEditorWrapper .bindParamEditorWrapper table th,.modal-body,.page-title span,.pingback a.url,.snippet-no-num,.ui-tooltip,body,button,input,textarea{font-family:Roboto,sans-serif!important}.document-info .document-bold-font,.document-info .document-thin-font{font-family:droid sans mono,monospace,courier new,courier,sans-serif;font-size:11pt}#distributionChartDiv:after,.arango-tab:after,.dashboard-bar-chart-container .dashboard-bar-chart:after,.dashboard-medium-chart .dashboard-medium-chart-inner:after,.dashboard-medium-chart .dashboard-medium-chart-menu:after,.dashboard-row:after,.dashboard-sub-bar:after,.dashboard-tendency-container .dashboard-tendency-chart:after,.detail-chart:after,.document-info .document-info-container .document-inner-info-container .document-attribute:after,.headerBar>div.headerButtonBar:after,.lineChartDiv:after,.pagination-line li:after,.resizecontainer:after,.tileList:after{clear:both;content:'.';display:block;font-size:0;height:0;visibility:hidden}.caret,.contentDiv:after,.contentDiv:before,.form-actions:after,.form-actions:before,.pong-spinner:after,.pong-spinner:before{content:''}.addButton,.arango-tab a,.arango-tab li,.arangoicon,.clusterDownBtn button,.contentDiv .icon,.contentTables tr.contentRowInactive a,.deleteButton i,.dropdownImport.headerDropdown input[type=checkbox].css-checkbox label.css-label,.edit-index-table .icon_arangodb_roundminus,.fixedDropdown .notificationItem i,.fullNotification:hover,.gv-search-submit-icon,.icon-info-sign,.link>line,.node,.pagination-line li a,.script-dropdown-menu .dropdown-item,.search-submit-icon,a.button-gui,a.headerButton,div .bigtile,div .bigtile .iconSet span,div .bigtile a span.icon,div .bigtile a svg,div .tile .iconSet span,div .tile a span.icon,div .tile a svg,div.headerDropdown.headerDropdown input[type=checkbox].css-checkbox label.css-label,div.toolbox div.gv_action_button{cursor:pointer}.graphContent #graph-container{outline:0;-webkit-touch-callout:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;-webkit-user-select:none;user-select:none}#swagger #jsonLink,.arangoToolbar span.clickable:hover,.login-window button,.pure-table-body .fa,.shardFollowers span,.shardLeader span,.subnavmenu .infoEntry a.default-icon i{-moz-transition:all .2s ease-in;-o-transition:all .2s ease-in;-webkit-transition:all .2s ease-in;transition:all .2s ease-in}.login-window select{-webkit-appearance:none;background:url("data:image/svg+xml;utf8,") right 10px top 12px no-repeat #f2f2f2;background-size:16px 16px;border:0;-webkit-border-radius:2px;border-radius:2px;color:#000;font-size:14px;font-weight:400;height:40px;line-height:initial;outline:0;padding:12px;text-align:center;-moz-transition:.3s ease all;-ms-transition:.3s ease all;-o-transition:.3s ease all;-webkit-transition:.3s ease all;transition:.3s ease all;width:100%}.breadcrumb a,.navlist .dropdown-item:hover a,.navlist>li:hover a{-moz-transition:all .2s ease-in;-o-transition:all .2s ease-in;-webkit-transition:all .2s ease-in}.login-window select:disabled{opacity:.5}.login-window select:active,.login-window select:focus{border:0;outline:0}.navbar{color:#fff;left:0;right:0;z-index:1000}.ajax-file-upload-red,.button-danger{background-color:#e74c3c}.ajax-file-upload-red:focus,.ajax-file-upload-red:hover,.button-danger:focus,.button-danger:hover{background-color:#ec7063}.contentTables td span,.deleteButton i,.edit-index-table .icon_arangodb_roundminus{color:#e74c3c}.contentTables td span:focus,.contentTables td span:hover,.deleteButton i:focus,.deleteButton i:hover,.edit-index-table .icon_arangodb_roundminus:focus,.edit-index-table .icon_arangodb_roundminus:hover{color:#ec7063}.ajax-file-upload,.button-success{background-color:#2ecc71}.ajax-file-upload:focus,.ajax-file-upload:hover,.button-success:focus,.button-success:hover{background-color:#58d68d}.button-info{background-color:#3498db}.button-info:focus,.button-info:hover{background-color:#5dade2}.addButton,.contentTables td.dbThSecond span{color:#2ecc71}.addButton:focus,.addButton:hover,.contentTables td.dbThSecond span:focus,.contentTables td.dbThSecond span:hover{color:#58d68d}.button-warning{background-color:#f1c40f}.button-warning:focus,.button-warning:hover{background-color:#f4d313}.button-close,.button-neutral{background-color:#8f8d8c}.button-close:focus,.button-close:hover,.button-neutral:focus,.button-neutral:hover{background-color:#736b68}.dashboard-sub-bar-menu{color:#8f8d8c}.dashboard-sub-bar-menu:focus,.dashboard-sub-bar-menu:hover{color:#736b68}.button-primary{background-color:#34495e}.button-primary:focus,.button-primary:hover{background-color:#415b76}.button-header,a.button-gui,a.headerButton{background-color:#fff;border:1px solid #fff;color:#555}.button-header:focus,.button-header:hover,a.button-gui:focus,a.button-gui:hover,a.headerButton:focus,a.headerButton:hover{background-color:#2ecc71;border:1px solid #2ecc71;color:#fff}.button-notification{background-color:#faa020}.button-notification:focus,.button-notification:hover{background-color:#f87c0f}.button-inactive,.button-inactive:focus,.button-inactive:hover,[class*=' button-']:disabled,[class*=' button-']:focus:disabled,[class*=' button-']:hover:disabled,[class^=button-]:disabled,[class^=button-]:focus:disabled,[class^=button-]:hover:disabled,button.disabled,button.disabled:focus,button.disabled:hover{background-color:#d3d3d3}a.headerButton.disabled,a.headerButton.disabled:focus,a.headerButton.disabled:hover{color:#d3d3d3}div.queryline .fa.fa-search{color:#c2c2c2;font-size:12pt;opacity:.5;position:relative;right:21px;top:-1px}div.queryline .fa.fa-search:hover{cursor:pointer;opacity:1}.inputEditorWrapper .aqlEditorWrapper table td input,.inputEditorWrapper .bindParamEditorWrapper table td input,.jsoneditor .search .frame input,.login-window .login-input,.modal-body .select2-choices input,.modal-body input,.modal-body select,.modal-body textarea,.navbar .arango-collection-select,.newIndexClass table input,.newIndexClass table select,.pure-table-body input,.pure-table-body select,.sectionHeader .scaleGroup input,div.queryline input,div.queryline select,input.search-input{-moz-border-radius:4px;-webkit-border-radius:4px;border-radius:4px;background-color:#fff!important;border:2px solid rgba(140,138,137,.25);box-shadow:none;outline:transparent 0}.inputEditorWrapper .aqlEditorWrapper table td input:focus,.inputEditorWrapper .bindParamEditorWrapper table td input:focus,.jsoneditor .search .frame input:focus,.login-window .login-input:focus,.modal-body input:focus,.modal-body select:focus,.modal-body textarea:focus,.navbar .arango-collection-select:focus,.newIndexClass table input:focus,.newIndexClass table select:focus,.pure-table-body input:focus,.pure-table-body select:focus,.sectionHeader .scaleGroup input:focus,div.queryline input:focus,div.queryline select:focus,input.search-input:focus{border-color:#2ecc71;box-shadow:none;outline:transparent 0}.dropdown-toolbar,.gv-dropdown-menu,.link-dropdown-menu,.script-dropdown-menu,.user-dropdown-menu{background-color:#f5f8f0;border-color:#666;border-radius:3px;border-style:solid;border-width:1px;box-shadow:none;display:none;left:initial;list-style:none;margin:5px 0 0;padding:5px 0;position:absolute;right:0;top:80%;z-index:1000}.dropdown-toolbar li,.gv-dropdown-menu li,.link-dropdown-menu li,.script-dropdown-menu li,.user-dropdown-menu li{line-height:23px;white-space:nowrap;width:100%}.dropdown-toolbar .dropdown-header,.gv-dropdown-menu .dropdown-header,.link-dropdown-menu .dropdown-header,.script-dropdown-menu .dropdown-header,.user-dropdown-menu .dropdown-header{color:#999;font-size:15px;font-weight:600;font-variant:small-caps;padding:0}.dropdown-toolbar .dropdown-header:hover,.gv-dropdown-menu .dropdown-header:hover,.link-dropdown-menu .dropdown-header:hover,.script-dropdown-menu .dropdown-header:hover,.user-dropdown-menu .dropdown-header:hover{cursor:default}.dropdown-toolbar .divider,.gv-dropdown-menu .divider,.link-dropdown-menu .divider,.script-dropdown-menu .divider,.user-dropdown-menu .divider{background-color:#666;height:1px;margin:10px 0 5px}.dropdown-toolbar a,.gv-dropdown-menu a,.link-dropdown-menu a,.script-dropdown-menu a,.user-dropdown-menu a{color:#fff;padding:0 20px}.navbar2{color:#fff}.navbar2>.secondary{background-color:rgba(255,255,255,.85)}.navbar{bottom:0;float:left;-webkit-font-smoothing:subpixel-antialiased;margin-bottom:0;position:absolute;top:0;width:150px}.navbar>.primary{background-color:#404a53;float:left;height:100%;width:150px}.navbar>.resizecontainer{background-color:#fff}.navbar .no-left-margin{border:0;margin-left:0}.navbar .no-left-margin.hover{background-color:transparent}.navbar .arangodbLogo{height:auto;margin-left:6px;margin-top:15px;width:138px}.navbar .arango-collection-select{position:relative;right:-22px;top:4px}.navbar .nav .dropdown .active>.dropdown-toggle,.navbar .nav .dropdown .open.active>.dropdown-toggle,.navbar .nav .dropdown .open>.dropdown-toggle{background:#58d68d}.navbar .nav>.active>a{-webkit-box-shadow:0 0 0 transparent inset;-moz-box-shadow:0 0 0 transparent inset;box-shadow:0 0 0 transparent inset;background-color:#fff;color:#000}.navbar .nav>li>a:focus{background-color:#fff}.navbar .nav>li>a:hover{background-color:#000;color:#686766}.navbar .shortcut{bottom:31px;left:13px;position:absolute}.navbar .shortcut i{background-color:transparent;border-radius:20px;color:#fff;width:20px;padding:5px 0 6px 4px}.navbar .shortcut i:hover{background-color:#2ecc71;color:#fff;cursor:pointer}.navbar .social-icons{bottom:0;float:left;margin-left:9px;position:absolute;width:100%}.navbar .social-icons a{display:block;float:left;height:25px;width:25px}.navbar .social-icons p{background:0 0;border-radius:20px;float:left;height:25px;margin-right:10px;padding:0;width:25px}.navlist li .fa,.navlogo .version{padding-left:5px;text-align:center}.navbar .social-icons p:hover{background:#2ecc71;cursor:pointer}.navlist li.divider,.navlist li.navbar-spacer{background-color:rgba(0,0,0,.2)}.navbar .social-icons p:hover i{color:#fff}.navbar .social-icons i{color:#fff;margin-top:6px;position:absolute}.navbar .social-icons i.fa-google,.navbar .social-icons i.fa-slack,.navbar .social-icons i.fa-stack-overflow,.navbar .social-icons i.fa-twitter{margin-left:7px}.navlogo{height:60px;width:100%}.navlogo .small{display:none}.script-dropdown-menu .dropdown-item a,.tab{display:block}.navlogo .version{bottom:33px;color:rgba(255,255,255,.7);font-size:11px;font-weight:100;left:0;padding-bottom:10px;position:absolute;text-transform:uppercase;width:100%}.navlist,.navlist li{width:150px}.navlogo .version .out-of-date{color:#f1c40f;font-weight:400}.navlogo .version .out-of-date i{font-size:9pt;margin-left:5px;margin-top:3px;position:absolute}.navlogo .version .out-of-date:hover{cursor:pointer}.navlogo .version .up-to-date{color:#2ecc71}.navmenu{clear:both}.navlist{list-style:none;margin:0;position:relative;top:0}.navlist>li{line-height:30px}.navlist li a{outline:0}.navlist li .fa{opacity:.3;padding-right:15px;width:10px}.navlist li .fa.fa-heart{color:#ff7a7a;opacity:1}.navlist li.disabled:hover{cursor:default}.navlist li.disabled:hover a:hover{cursor:default;opacity:.8}div .bigtile:hover,div .tile:hover,div.footer-center p:hover{cursor:pointer}.navlist .active .tab .fa,.navlist>.active a{opacity:1}.navlist li.dropdown:hover{border-bottom-left-radius:0;border-bottom-right-radius:0}.navlist li.divider,.navlist li.navbar-spacer{border:0}.navlist li.navbar-spacer{height:2px;margin-bottom:0;margin-top:0}.navlist .active{border-left:2px solid #77cb99}.navlist .active .tab{color:#fff;margin-left:-2px}.navlist .dropdown-item,.script-dropdown-menu .dropdown-item{margin-left:0}.navlist>.active{background-color:rgba(255,255,255,.2)}.navlist .dropdown-item:hover a,.navlist>li:hover a{color:#fff;opacity:1;transition:all .2s ease-in}.navlist .dropdown-item a{border-bottom:0;display:block;font-size:11pt}.navlist .dropdown-item a:hover{background-color:#dee9cf;color:#686766}.tab{color:rgba(255,255,255,.8);font-size:9pt;font-weight:100;text-transform:uppercase;padding:5px}.tab.userImg{padding-bottom:5px}.dropdown-item a{border-bottom:0!important;font-weight:300}.dropdown-toolbar li a,footer.footer p{font-weight:100}.dropdown-toolbar{background-color:#fff!important}.dropdown-toolbar li a:hover{background:0 0;background-color:#dee9cf!important;color:#000!important}.link-dropdown-menu,.user-dropdown-menu{background-color:rgba(0,0,0,.7);border-top-right-radius:0;margin-right:-1px;margin-top:7px;z-index:50}.link-dropdown-menu .dropdown-item,.user-dropdown-menu .dropdown-item{border-left:0;border-right:0}.script-dropdown-menu .dropdown-item a:hover{color:#fff}.script-dropdown-menu .dropdown-item:hover{background-color:#2ecc71}.gv-dropdown-menu{-moz-border-radius:0;-webkit-border-radius:0;border-radius:0;background-color:rgba(0,0,0,.7);border:1px solid #c2c2c2;margin-right:-20px;margin-top:6px}.gv-dropdown-menu:after{border-bottom-color:#fff}.gv-dropdown-menu li:hover{background-color:#fff;background-image:none}.gv-dropdown-menu li a{padding:0}.gv-dropdown-menu li a label{color:#fff;padding-left:5px}.gv-dropdown-menu li a:focus{background-color:#2ecc71!important;background-image:none}#arangoCollectionSelect{display:none;float:right;margin-bottom:0;margin-right:15px;padding-bottom:0}.caret{border-left:5px solid transparent;border-right:5px solid transparent;border-top:5px solid #686766;display:inline-block;height:0;vertical-align:top;width:0}.applications-menu{display:block}.arango-logo{height:34px;padding:0!important}.arango-logo img{margin-left:22px}.footer{background-color:rgba(239,240,241,.8);display:none;font-size:14px;left:160px;right:10px;text-align:center;z-index:1000}div.footer-center,div.footer-left,div.footer-right{background:none;color:#686766}footer.footer{bottom:0;height:43px;position:fixed}footer.footer p{font-size:10pt;margin-bottom:0;padding-bottom:10px;padding-top:10px}div.footer-left{width:45%}div.footer-center{width:10%}div.footer-center p{padding-top:5px}[class*=' button-']:disabled,[class^=button-]:disabled,a.headerButton.disabled,button.disabled{cursor:not-allowed}div.footer-right{width:45%}div.footer-right p{color:#fff}div.footer-right i{color:#e74c3c;font-size:18px}div.footer-right a{color:#686766;margin-left:5px;position:relative;top:-1px}div.footer-right .isOnline{color:#2ecc71!important}.ajax-file-upload,.ajax-file-upload-red,.button-close,.button-danger,.button-header,.button-inactive,.button-info,.button-neutral,.button-notification,.button-primary,.button-success,.button-warning{-moz-border-radius:2px;-webkit-border-radius:2px;border-radius:2px;-webkit-box-shadow:0;-moz-box-shadow:0;box-shadow:0;font-size:13px;font-weight:300!important}.addButton,.deleteButton i{font-size:16pt;position:relative}.ajax-file-upload,.ajax-file-upload-red,.button-close,.button-danger,.button-inactive,.button-info,.button-neutral,.button-notification,.button-primary,.button-success,.button-warning{border:0;color:#fff;margin-left:10px;padding:4px 12px}.ajax-file-upload-red:focus,.ajax-file-upload:focus,.button-close:focus,.button-danger:focus,.button-inactive:focus,.button-info:focus,.button-neutral:focus,.button-notification:focus,.button-primary:focus,.button-success:focus,.button-warning:focus{outline:0}.ajax-file-upload i,.ajax-file-upload-red i,.button-close i,.button-danger i,.button-inactive i,.button-info i,.button-neutral i,.button-notification i,.button-primary i,.button-success i,.button-warning i{margin-left:-5px}.ajax-file-upload .fa,.ajax-file-upload-red .fa,.button-close .fa,.button-danger .fa,.button-inactive .fa,.button-info .fa,.button-neutral .fa,.button-notification .fa,.button-primary .fa,.button-success .fa,.button-warning .fa{position:relative;top:1px}.button-header{margin-top:5px}.addButton{margin-right:7px;margin-top:2px}.deleteButton i{float:right;padding-right:7px;top:12px}#closeBtnInfoView{margin-left:0!important}button.btn-server{width:120px}button.btn-small{padding:0 8px}button.gv-zoom-btn{background-size:14px 14px;height:14px;vertical-align:baseline;width:14px}button.gv-zoom-btn.btn-zoom-right{border:0;box-shadow:none;right:0;top:13px}button.gv-zoom-btn.pan-right{background-image:url(../img/gv_arrow_right.png)}button.gv-zoom-btn.pan-right:hover{background:inherit;background-image:url(../img/gv_arrow_right.png)}button.gv-zoom-btn.pan-left{background-image:url(../img/gv_arrow_left.png)}button.gv-zoom-btn.pan-left:hover{background:inherit;background-image:url(../img/gv_arrow_left.png)}button.gv-zoom-btn.pan-top{background-image:url(../img/gv_arrow_top.png)}button.gv-zoom-btn.pan-top:hover{background:inherit;background-image:url(../img/gv_arrow_top.png)}button.gv-zoom-btn.pan-bottom{background-image:url(../img/gv_arrow_bottom.png)}button.gv-zoom-btn.pan-bottom:hover{background:inherit;background-image:url(../img/gv_arrow_bottom.png)}button.gv-zoom-btn.btn-zoom{height:14px;margin:0;padding:0;position:absolute;width:16px}button.gv-zoom-btn.btn-zoom-top{border:0;box-shadow:none;left:13px;top:1}button.gv-zoom-btn.btn-zoom-left{border:0;box-shadow:none;left:0;top:13px}button.gv-zoom-btn.btn-zoom-bottom{border:0;box-shadow:none;left:13px;top:25px}button.gv-icon-btn{-moz-border-radius:0!important;-webkit-border-radius:0!important;border-radius:0!important;background-size:36px 36px;height:36px;width:36px}button.gv-icon-btn.active{background-color:#2ecc71}button.gv_dropdown_entry{height:30px;margin:4px 4px 4px 12px;width:160px}button.gv_context_button{width:65px}button.large-distance{margin-left:12px}button.short-distance{margin-left:6px}button.shutdown{margin-top:6px;padding:3px 14px}button.graphViewer-icon-button{background-color:transparent;border:0;height:20px;margin-left:5px;margin-top:-2px;padding:0;width:20px}button.graphViewer-icon-button img{height:20px;padding-bottom:10px;width:20px}ul.headerButtonList{display:inline-block;margin-bottom:0;margin-left:0;padding-left:0!important}ul.headerButtonList li{display:inline}a.button-gui,a.headerButton{-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;margin-left:5px;margin-right:5px}a.headerButton{margin-top:2px;position:relative}a.headerButton .fa,a.headerButton [class*=" icon_"],a.headerButton [class^=icon_]{display:block;height:23px;line-height:23px;position:static;right:0;text-align:center;top:0;width:27px}a.headerButton .icon_arangodb_arrowleft,a.headerButton .icon_arangodb_arrowright{font-weight:700}a.headerButton.activated{background-color:#58d68d;border:1px solid #58d68d;color:#fff}a.headerButton.activated:hover{background-color:#fff;color:#58d68d}div.toolbox{-moz-border-radius:2px;-webkit-border-radius:2px;border-radius:2px;background-color:#fff;border:1px solid rgba(140,138,137,.25);margin-right:5px;padding-bottom:5px;padding-top:5px;position:absolute;top:-10px}div.toolbox div.gv_action_button{-moz-border-radius:2px;-webkit-border-radius:2px;border-radius:2px;background-color:#fff;color:#555;height:30px;margin:5px;position:relative;text-align:center;width:30px}div.toolbox div.gv_action_button.active{background-color:#2ecc71;color:#fff}div.toolbox div.gv_action_button:first-child{margin-top:0}div.toolbox div.gv_action_button:last-child{margin-bottom:0}h6.gv_button_title,h6.gv_icon_icon{left:0;margin:0;position:absolute;right:0}h6.gv_icon_icon{font-size:22px;left:1px;top:4px}h6.gv_button_title{bottom:1px;display:none}.btn-icon{background-color:#383434;padding:4px}.gv-icon-small{background-size:16px 16px;height:16px!important;width:16px!important}.gv-icon-small.delete{background-image:url(../img/icon_delete.png)}.gv-icon-small.add{background-image:url(../img/plus_icon.png)}a.pagination-button,ul.arango-pagination a{-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px}.badge,.btn,.label{text-shadow:none!important}.navbar-inner,.thumbnail{-moz-border-radius:0;-webkit-border-radius:0;border-radius:0;-webkit-box-shadow:0;-moz-box-shadow:0;box-shadow:0}.modal-body th.actionCell>button{margin-top:-12px}.btn-old-padding{padding-bottom:4px!important;padding-top:4px!important}button.btn-overview,button.btn-server{margin:5px}a.button-gui{height:auto;margin-bottom:0;margin-top:0;padding-bottom:1px;padding-top:1px;position:absolute;right:2px;text-decoration:none!important;top:2px;width:auto}a.button-gui.button-gui-disabled{display:none}.clusterDownBtn{padding-bottom:10px;padding-top:10px;text-align:center}.clusterDownBtn button{-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;background-color:#f1f1f1;border:1px solid rgba(0,0,0,.1875);color:#333;font-size:20px;font-weight:300;margin:0;padding:12px 18px;text-align:center;text-decoration:none!important;width:250px}.clusterDownBtn button:hover{background-color:#e8e8e8;color:#4a6c30;-webkit-transition-delay:0;-webkit-transition-duration:.2s;-webkit-transition-property:all;-webkit-transition-timing-function:ease-in}.clusterDownBtn button.green{background-color:#617e2b;color:#fff}.clusterDownBtn button.green:hover{background-color:#8ba142}.bottomButtonBar{background-color:#fff;border-top:1px solid rgba(104,103,102,.1);height:30px;padding:10px}.tileList{left:10px;padding-top:5px;position:absolute;right:10px}.tileList legend{padding-left:5px}.tileList .tile:first-child a{opacity:.8}.tileList .tile:first-child a:hover{opacity:1}div .bigtile,div .tile{-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;border-radius:2px;font-size:14px;list-style:none;margin-bottom:13px;position:relative;text-align:center;z-index:1}div .bigtile progress[value],div .tile progress[value]{color:#5bc0de}div .bigtile progress::-webkit-progress-bar-value,div .tile progress::-webkit-progress-bar-value{background:#5bc0de}div .bigtile progress::-webkit-progress-value,div .tile progress::-webkit-progress-value{background:#5bc0de}div .bigtile progress::-moz-progress-bar,div .tile progress::-moz-progress-bar{background:#5bc0de}div .bigtile progress,div .tile progress{-webkit-appearance:none;border-radius:0;height:2px;margin-top:16px;position:relative;width:100%;z-index:10}div .locked.bigtile,div .locked.tile{cursor:not-allowed}div .locked.bigtile .borderBox,div .locked.bigtile .collection-type-icon,div .locked.bigtile .collectionName,div .locked.bigtile .iconSet,div .locked.tile .borderBox,div .locked.tile .collection-type-icon,div .locked.tile .collectionName,div .locked.tile .iconSet{opacity:.5}div .locked.bigtile .iconSet span:hover,div .locked.tile .iconSet span:hover{background-color:#fff!important;color:#000;cursor:not-allowed!important}div .locked.bigtile .iconSet:hover,div .locked.tile .iconSet:hover{cursor:not-allowed!important}div .bigtile .collection-type-icon:hover,div .bigtile img:hover,div .tile .collection-type-icon:hover,div .tile img:hover{cursor:pointer}div .bigtile .warning-icons,div .tile .warning-icons{background-color:#e74c3c;border-radius:2px;color:#fff;font-size:11px;height:17px;left:0;line-height:13px;margin-left:5px;margin-top:5px;padding-left:9px;padding-right:9px;position:absolute;top:0}div .bigtile .warning-icons .fa,div .tile .warning-icons .fa{font-size:11pt;margin-left:1px}div .bigtile .collection-type-icon,div .tile .collection-type-icon{color:#666;font-size:30pt;margin-left:-18px;position:absolute;top:15px}div .bigtile img,div .tile img{position:relative}div .bigtile img.icon,div .tile img.icon{height:50px;margin-top:-110px;width:50px}div .bigtile a span.add-Icon,div .tile a span.add-Icon{font-size:20px;margin-left:22px;margin-right:10px;position:relative;top:0}div .bigtile a span.icon,div .tile a span.icon{font-size:50px}div .bigtile a svg.icon,div .tile a svg.icon{height:50px;width:50px}div .bigtile .tile-icon-svg,div .tile .tile-icon-svg{cursor:pointer;fill:#686766;height:50px;margin-left:auto;margin-right:auto;margin-top:-63px;position:relative;width:50px}div .bigtile .tile-icon,div .tile .tile-icon{color:#686766;font-size:50px;line-height:1.2;margin-left:-50px}div .bigtile .icon_arangodb_edge5-2,div .bigtile .tile-icon,div .tile .icon_arangodb_edge5-2,div .tile .tile-icon{position:absolute;top:15px}div .bigtile .icon_arangodb_edge5-2,div .tile .icon_arangodb_edge5-2{display:inline-block;margin-left:5px;position:absolute;top:0;-moz-transform:rotate(80deg);-o-transform:rotate(80deg);-webkit-transform:rotate(80deg)}div .bigtile h5,div .tile h5{background:rgba(64,74,83,.8);color:#fff;font-size:12px;margin:0 5px;overflow:hidden!important;padding:4px 8px;text-overflow:ellipsis!important;white-space:nowrap!important}div .bigtile h5.inProgress,div .tile h5.inProgress{color:#5bc0de}div .bigtile .tileSelects,div .tile .tileSelects{margin-left:40px;position:relative;z-index:9999}div .bigtile .tileSelects select,div .tile .tileSelects select{float:right;height:20px;margin-right:5px;margin-top:16px;width:70px}div .bigtile .fullBorderBox,div .tile .fullBorderBox{background-color:#fff;border:1px solid rgba(140,138,137,.25);border-radius:2px;box-sizing:border-box;height:100%;margin-left:5px;margin-right:5px;position:relative;width:auto}div .bigtile .fullBorderBox .add,div .tile .fullBorderBox .add{color:#404a53}div .bigtile .fullBorderBox .add span,div .tile .fullBorderBox .add span{color:#2ecc71}div .bigtile .paddingBox,div .tile .paddingBox{box-sizing:border-box;padding-left:5px;padding-right:5px}div .bigtile .borderBox,div .tile .borderBox{background-color:#fff;border:1px solid rgba(64,74,83,.2);border-bottom:0;border-radius:2px;box-sizing:border-box;height:75px;position:relative;width:100%}div .bigtile .iconSet,div .tile .iconSet{position:absolute;right:5px;top:5px}div .bigtile .iconSet span,div .tile .iconSet span{border-radius:2px;color:#666;font-size:18px;z-index:2;padding:2px 3px}div .bigtile .iconSet span:hover,div .tile .iconSet span:hover{background-color:#2ecc71;color:#fff}div .bigtile .iconSet span.disabled,div .tile .iconSet span.disabled{cursor:default;opacity:.2}div .bigtile .iconSet span.disabled:hover,div .tile .iconSet span.disabled:hover{background-color:#fff;color:#000;cursor:default;opacity:.2}div .bigtile .badge-success,div .tile .badge-success{font-weight:300}div .bigtile .unloaded div,div .tile .unloaded div{border-bottom:16px solid #ff8f35}div .bigtile .deleted div,div .tile .deleted div{border-bottom:16px solid #700}div .bigtile .tileBadge,div .tile .tileBadge{bottom:29px;font-size:11px;font-weight:300;position:absolute;right:0}div .bigtile .tileBadge button,div .tile .tileBadge button{margin-left:0;margin-right:5px}div .bigtile .tileBadge span,div .tile .tileBadge span{display:inline-block;line-height:15px}div .bigtile .tileBadge span .corneredBadge,div .tile .tileBadge span .corneredBadge{border-bottom-style:solid;border-bottom-width:17px;border-left:5px solid transparent;border-radius:2px;color:#fff;height:0;margin-bottom:4px;margin-right:10px;padding-left:1px;padding-right:6px}div .bigtile .tileBadge span .corneredBadge.loading,div .tile .tileBadge span .corneredBadge.loading{border-bottom-color:#ff8f35}div .bigtile .tileBadge span .corneredBadge.loaded,div .tile .tileBadge span .corneredBadge.loaded{border-bottom-color:#2ecc71}div .bigtile .tileBadge span .corneredBadge.inProgress,div .tile .tileBadge span .corneredBadge.inProgress{border-bottom-color:#5bc0de}div .bigtile .tileBadge span .corneredBadge.development,div .bigtile .tileBadge span .corneredBadge.unloaded,div .tile .tileBadge span .corneredBadge.development,div .tile .tileBadge span .corneredBadge.unloaded{border-bottom-color:#ff8f35}div .tile{height:100px}div .tile-graph h5{margin-left:5px;margin-right:5px}div .tile-graph .tile-icon:hover{cursor:pointer}div .bigtile{height:309px;width:452px}div .bigtile .shardContainer{font-size:30px}div .bigtile .shardContainer span{padding:2px}.collectionName{border-bottom-left-radius:2px;border-bottom-right-radius:2px;bottom:0;font-weight:300;left:0;position:absolute;right:0;text-align:left}#userManagementThumbnailsIn .tile .paddingBox img{border-radius:58px;margin-top:-99px;padding:0}.resizecontainer{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box;padding-left:10px;padding-right:10px}.dashboard-large-chart,.dashboard-medium-chart-outer,.dashboard-sub-bar,.tendency-box-sizing .dashboard-tendency-container,div.centralContent{box-sizing:border-box}@media (max-width:738px){#collectionsDropdown ul{width:auto!important}.footer-center p{display:none}#queryContent #querySize,#queryContent #querySizeDiv,#queryContent .styled-select{margin-right:6px;width:90px!important}}@media (max-width:970px){#documentsDiv #totalDocuments{display:none}}@media (min-width:250px) and (max-width:489px){.dashboard-full-width-chart,.dashboard-full-width-chart .dashboard-full-width-chart-inner,.dashboard-full-width-chart .dashboard-sub-bar,.dashboard-large-chart .dashboard-large-chart-inner,.dashboard-large-chart .dashboard-sub-bar,.dashboard-medium-chart,.dashboard-medium-chart .dashboard-sub-bar,.resizecontainer{width:100%}.dashboard-full-width-chart .dashboard-full-width-chart-inner .dashboard-interior-chart,.dashboard-medium-chart-outer{float:left}.dashboard-large-chart .dashboard-large-chart-inner .dashboard-interior-chart{height:185px}.dashboard-sub-bar-menu{font-size:12px}.dashboard-medium-chart .dashboard-interior-chart{height:185px;width:100%}.dashboard-medium-chart .dashboard-medium-chart-menu{font-size:12px;left:10px;top:0}.dashboard-medium-chart #clusterGraphs svg{height:185px;width:27px}.dashboard-medium-chart #clusterGraphs svg text{font-size:10px}.dashboard-small-chart .dashboard-sub-bar{clear:both;height:65px;margin-bottom:0;width:100%}.dashboard-small-chart .dashboard-small-chart-inner{width:100%}.dashboard-small-chart .dashboard-small-chart-inner .dashboard-interior-chart{height:197px;width:100%}.dashboard-small-chart .dashboard-small-chart-inner .dashboard-interior-chart .nv-axis text{fill:#666;font-size:10px;font-weight:400}.dashboard-tendency-container .dashboard-tendency-chart{height:83.25px}.dashboard-tendency-container .dashboard-tendency-chart .dashboard-figure,.dashboard-tendency-container .dashboard-tendency-chart .dashboard-subtitle-bar,.dashboard-tendency-container .dashboard-tendency-chart .dashboard-tendency{width:-15px}.dashboard-tendency-container .dashboard-tendency-chart .dashboard-subtitle-bar{height:25.08px;line-height:25.08px}.dashboard-tendency-container .dashboard-tendency-chart .dashboard-figure{height:40.17px;line-height:19.08px;padding-top:5px}.dashboard-tendency-container .dashboard-sub-bar{width:100%}.dashboard-bar-chart-container{height:79.75px}.dashboard-bar-chart-container .dashboard-bar-chart{height:74.75px;width:100%}.dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-title{height:25.25px;line-height:25.25px}.dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-title .percentage{width:-4.2px}.dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-title .absolut{line-height:40px;padding-top:15px;width:-3px}.dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-chart{box-sizing:border-box;height:50px;margin-top:5px;width:100%}.dashboard-bar-chart-container .dashboard-sub-bar{padding-top:13px;width:100%}.modal-chart-detail{bottom:12.1%!important;left:50%;margin-left:-45px;width:110px!important}.modal-chart-detail .modal-body{height:95%;max-height:none;padding:5px}.modal-chart-detail .modal-dashboard-legend{display:none;font-size:12px;min-height:190px;width:10px}.absolut,.percentage{font-size:14px}.modal-chart-detail .modal-inner-detail{width:70px}.modal-body .dashboard-large-chart{width:51px}.modal-body .dashboard-large-chart .dashboard-large-chart-inner .dashboard-interior-chart,.modal-body .dashboard-large-chart .dashboard-sub-bar{width:100%}.modal-body .dashboard-medium-chart-outer{float:left;width:22px}.modal-body .dashboard-medium-chart,.modal-body .dashboard-medium-chart .dashboard-interior-chart,.modal-body .dashboard-medium-chart .dashboard-sub-bar{width:100%}.modal-body .dashboard-small-chart,.modal-body .dashboard-small-chart .dashboard-small-chart-inner,.modal-body .dashboard-small-chart .dashboard-small-chart-inner .dashboard-interior-chart{width:auto}.modal-body .dashboard-medium-chart .dashboard-medium-chart-menu{left:5px}.modal-body .dashboard-small-chart .dashboard-sub-bar{clear:both;width:auto}.modal-body .dashboard-tendency-container,.modal-body .dashboard-tendency-container .dashboard-tendency-chart,.modal-body .dashboard-tendency-container .dashboard-tendency-chart .dashboard-figure,.modal-body .dashboard-tendency-container .dashboard-tendency-chart .dashboard-subtitle-bar,.modal-body .dashboard-tendency-container .dashboard-tendency-chart .dashboard-tendency{box-sizing:border-box;width:100%}.modal-body .dashboard-tendency-container .dashboard-sub-bar{width:100%}.modal-body .dashboard-bar-chart-container .dashboard-bar-chart{width:auto}.modal-body .dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-title .percentage{width:-4.2px}.modal-body .dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-title .absolut{width:-3px}.modal-body .dashboard-bar-chart-container .dashboard-bar-chart-chart{width:-6px}.modal-body .dashboard-bar-chart-container .dashboard-sub-bar{width:100%}.absolut{font-weight:300}.dashboard-sub-bar{font-size:10px;font-weight:400}.dashboard-subtitle-bar{font-size:14px;font-weight:300}.dashboard-figure{font-size:16px;font-weight:400}.dashboard-figurePer{font-size:14px;font-weight:300}.dashboard-legend,.dygraph-axis-label.dygraph-axis-label-x,.dygraph-axis-label.dygraph-axis-label-y{font-weight:400;font-size:10px}.dashboard-legend{display:none;height:30px;width:100%}.dashboard-half-height-legend{display:none;font-size:10px;height:100px;width:0}.application-detail-view section.info{width:90px}.application-detail-view aside.meta{display:none}}@media (min-width:490px) and (max-width:729px){.dashboard-full-width-chart,.dashboard-full-width-chart .dashboard-full-width-chart-inner,.dashboard-full-width-chart .dashboard-sub-bar,.dashboard-large-chart .dashboard-large-chart-inner,.dashboard-large-chart .dashboard-sub-bar,.dashboard-medium-chart,.dashboard-medium-chart .dashboard-sub-bar,.resizecontainer{width:100%}.dashboard-full-width-chart .dashboard-full-width-chart-inner .dashboard-interior-chart,.dashboard-medium-chart-outer{float:left}.dashboard-large-chart .dashboard-large-chart-inner .dashboard-interior-chart{height:185px}.dashboard-sub-bar-menu{font-size:12px}.dashboard-medium-chart .dashboard-interior-chart{height:185px;width:100%}.dashboard-medium-chart .dashboard-medium-chart-menu{font-size:12px;left:130px;top:0}.dashboard-medium-chart #clusterGraphs svg{height:185px;width:147px}.dashboard-medium-chart #clusterGraphs svg text{font-size:10px}.dashboard-small-chart .dashboard-sub-bar{clear:both;height:65px;margin-bottom:0;width:100%}.dashboard-small-chart .dashboard-small-chart-inner{width:100%}.dashboard-small-chart .dashboard-small-chart-inner .dashboard-interior-chart{height:197px;width:100%}.dashboard-small-chart .dashboard-small-chart-inner .dashboard-interior-chart .nv-axis text{fill:#666;font-size:10px;font-weight:400}.dashboard-tendency-container .dashboard-tendency-chart{height:83.25px}.dashboard-tendency-container .dashboard-tendency-chart .dashboard-figure,.dashboard-tendency-container .dashboard-tendency-chart .dashboard-subtitle-bar,.dashboard-tendency-container .dashboard-tendency-chart .dashboard-tendency{width:25px}.dashboard-tendency-container .dashboard-tendency-chart .dashboard-subtitle-bar{height:25.08px;line-height:25.08px}.dashboard-tendency-container .dashboard-tendency-chart .dashboard-figure{height:40.17px;line-height:19.08px;padding-top:5px}.dashboard-tendency-container .dashboard-sub-bar{width:100%}.dashboard-bar-chart-container{height:79.75px}.dashboard-bar-chart-container .dashboard-bar-chart{height:74.75px;width:100%}.dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-title{height:25.25px;line-height:25.25px}.dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-title .percentage{width:51.8px}.dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-title .absolut{line-height:40px;padding-top:15px;width:21px}.dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-chart{box-sizing:border-box;height:50px;margin-top:5px;width:100%}.dashboard-bar-chart-container .dashboard-sub-bar{padding-top:13px;width:100%}.modal-chart-detail{bottom:12.1%!important;left:50%;margin-left:-165px;width:350px!important}.modal-chart-detail .modal-body{height:95%;max-height:none;padding:5px}.modal-chart-detail .modal-dashboard-legend{display:none;font-size:12px;min-height:190px;width:10px}.absolut,.percentage{font-size:14px}.modal-chart-detail .modal-inner-detail{width:310px}.modal-body .dashboard-large-chart{width:211px}.modal-body .dashboard-large-chart .dashboard-large-chart-inner .dashboard-interior-chart,.modal-body .dashboard-large-chart .dashboard-sub-bar{width:100%}.modal-body .dashboard-medium-chart-outer{float:left;width:142px}.modal-body .dashboard-medium-chart,.modal-body .dashboard-medium-chart .dashboard-interior-chart,.modal-body .dashboard-medium-chart .dashboard-sub-bar{width:100%}.modal-body .dashboard-small-chart,.modal-body .dashboard-small-chart .dashboard-small-chart-inner,.modal-body .dashboard-small-chart .dashboard-small-chart-inner .dashboard-interior-chart{width:auto}.modal-body .dashboard-medium-chart .dashboard-medium-chart-menu{left:125px}.modal-body .dashboard-small-chart .dashboard-sub-bar{clear:both;width:auto}.modal-body .dashboard-tendency-container,.modal-body .dashboard-tendency-container .dashboard-tendency-chart,.modal-body .dashboard-tendency-container .dashboard-tendency-chart .dashboard-figure,.modal-body .dashboard-tendency-container .dashboard-tendency-chart .dashboard-subtitle-bar,.modal-body .dashboard-tendency-container .dashboard-tendency-chart .dashboard-tendency{box-sizing:border-box;width:100%}.modal-body .dashboard-tendency-container .dashboard-sub-bar{width:100%}.modal-body .dashboard-bar-chart-container .dashboard-bar-chart{width:auto}.modal-body .dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-title .percentage{width:51.8px}.modal-body .dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-title .absolut{width:21px}.modal-body .dashboard-bar-chart-container .dashboard-bar-chart-chart{width:74px}.modal-body .dashboard-bar-chart-container .dashboard-sub-bar{width:100%}.absolut{font-weight:300}.dashboard-sub-bar{font-size:10px;font-weight:400}.dashboard-subtitle-bar{font-size:14px;font-weight:300}.dashboard-figure{font-size:16px;font-weight:400}.dashboard-figurePer{font-size:14px;font-weight:300}.dashboard-legend,.dygraph-axis-label.dygraph-axis-label-x,.dygraph-axis-label.dygraph-axis-label-y{font-weight:400;font-size:10px}.dashboard-legend{display:none;height:30px;width:100%}.dashboard-half-height-legend{display:none;font-size:10px;height:100px;width:0}.application-detail-view section.info{width:330px}.application-detail-view aside.meta{display:none}}@media (min-width:730px) and (max-width:969px){.dashboard-full-width-chart,.dashboard-full-width-chart .dashboard-full-width-chart-inner,.dashboard-full-width-chart .dashboard-sub-bar,.dashboard-large-chart .dashboard-large-chart-inner,.dashboard-large-chart .dashboard-sub-bar,.dashboard-medium-chart,.dashboard-medium-chart .dashboard-sub-bar,.resizecontainer{width:100%}.dashboard-full-width-chart .dashboard-full-width-chart-inner .dashboard-interior-chart,.dashboard-medium-chart-outer{float:left}.dashboard-large-chart .dashboard-large-chart-inner .dashboard-interior-chart{height:185px}.dashboard-sub-bar-menu{font-size:12px}.dashboard-medium-chart .dashboard-interior-chart{height:185px;width:100%}.dashboard-medium-chart .dashboard-medium-chart-menu{font-size:12px;left:250px;top:0}.dashboard-medium-chart #clusterGraphs svg{height:185px;width:267px}.dashboard-medium-chart #clusterGraphs svg text{font-size:10px}.dashboard-small-chart .dashboard-sub-bar{clear:both;height:65px;margin-bottom:0;width:100%}.dashboard-small-chart .dashboard-small-chart-inner{width:100%}.dashboard-small-chart .dashboard-small-chart-inner .dashboard-interior-chart{height:197px;width:100%}.dashboard-small-chart .dashboard-small-chart-inner .dashboard-interior-chart .nv-axis text{fill:#666;font-size:10px;font-weight:400}.dashboard-tendency-container .dashboard-tendency-chart{height:83.25px}.dashboard-tendency-container .dashboard-tendency-chart .dashboard-figure,.dashboard-tendency-container .dashboard-tendency-chart .dashboard-subtitle-bar,.dashboard-tendency-container .dashboard-tendency-chart .dashboard-tendency{width:65px}.dashboard-tendency-container .dashboard-tendency-chart .dashboard-subtitle-bar{height:25.08px;line-height:25.08px}.dashboard-tendency-container .dashboard-tendency-chart .dashboard-figure{height:40.17px;line-height:19.08px;padding-top:5px}.dashboard-tendency-container .dashboard-sub-bar{width:100%}.dashboard-bar-chart-container{height:79.75px}.dashboard-bar-chart-container .dashboard-bar-chart{height:74.75px;width:100%}.dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-title{height:25.25px;line-height:25.25px}.dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-title .percentage{width:107.8px}.dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-title .absolut{line-height:40px;padding-top:15px;width:45px}.dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-chart{box-sizing:border-box;height:50px;margin-top:5px;width:100%}.dashboard-bar-chart-container .dashboard-sub-bar{padding-top:13px;width:100%}.modal-chart-detail{bottom:12.1%!important;left:50%;margin-left:-285px;width:590px!important}.modal-chart-detail .modal-body{height:95%;max-height:none;padding:5px}.modal-chart-detail .modal-dashboard-legend{display:none;font-size:12px;min-height:190px;width:10px}.absolut,.percentage{font-size:14px}.modal-chart-detail .modal-inner-detail{width:550px}.modal-body .dashboard-large-chart{width:371px}.modal-body .dashboard-large-chart .dashboard-large-chart-inner .dashboard-interior-chart,.modal-body .dashboard-large-chart .dashboard-sub-bar{width:100%}.modal-body .dashboard-medium-chart-outer{float:left;width:262px}.modal-body .dashboard-medium-chart,.modal-body .dashboard-medium-chart .dashboard-interior-chart,.modal-body .dashboard-medium-chart .dashboard-sub-bar{width:100%}.modal-body .dashboard-small-chart,.modal-body .dashboard-small-chart .dashboard-small-chart-inner,.modal-body .dashboard-small-chart .dashboard-small-chart-inner .dashboard-interior-chart{width:auto}.modal-body .dashboard-medium-chart .dashboard-medium-chart-menu{left:245px}.modal-body .dashboard-small-chart .dashboard-sub-bar{clear:both;width:auto}.modal-body .dashboard-tendency-container,.modal-body .dashboard-tendency-container .dashboard-tendency-chart,.modal-body .dashboard-tendency-container .dashboard-tendency-chart .dashboard-figure,.modal-body .dashboard-tendency-container .dashboard-tendency-chart .dashboard-subtitle-bar,.modal-body .dashboard-tendency-container .dashboard-tendency-chart .dashboard-tendency{box-sizing:border-box;width:100%}.modal-body .dashboard-tendency-container .dashboard-sub-bar{width:100%}.modal-body .dashboard-bar-chart-container .dashboard-bar-chart{width:auto}.modal-body .dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-title .percentage{width:107.8px}.modal-body .dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-title .absolut{width:45px}.modal-body .dashboard-bar-chart-container .dashboard-bar-chart-chart{width:154px}.modal-body .dashboard-bar-chart-container .dashboard-sub-bar{width:100%}.absolut{font-weight:300}.dashboard-sub-bar{font-size:10px;font-weight:400}.dashboard-subtitle-bar{font-size:14px;font-weight:300}.dashboard-figure{font-size:16px;font-weight:400}.dashboard-figurePer{font-size:14px;font-weight:300}.dashboard-legend,.dygraph-axis-label.dygraph-axis-label-x,.dygraph-axis-label.dygraph-axis-label-y{font-weight:400;font-size:10px}.dashboard-legend{display:none;height:30px;width:100%}.dashboard-half-height-legend{display:none;font-size:10px;height:100px;width:0}.application-detail-view section.info{width:370px}}@media (min-width:970px) and (max-width:1209px){.dashboard-full-width-chart,.dashboard-full-width-chart .dashboard-full-width-chart-inner,.dashboard-full-width-chart .dashboard-sub-bar,.dashboard-large-chart .dashboard-large-chart-inner,.dashboard-large-chart .dashboard-sub-bar,.dashboard-medium-chart,.dashboard-medium-chart .dashboard-sub-bar,.resizecontainer{width:100%}.dashboard-full-width-chart .dashboard-full-width-chart-inner .dashboard-interior-chart,.dashboard-medium-chart-outer{float:left}.dashboard-large-chart .dashboard-large-chart-inner .dashboard-interior-chart{height:220px}.dashboard-sub-bar-menu{font-size:13px}.dashboard-medium-chart .dashboard-interior-chart{height:220px;width:100%}.dashboard-medium-chart .dashboard-medium-chart-menu{font-size:13px;left:369px;top:0}.dashboard-medium-chart #clusterGraphs svg{height:220px;width:387px}.dashboard-medium-chart #clusterGraphs svg text{font-size:11px}.dashboard-small-chart .dashboard-sub-bar{clear:both;height:65px;margin-bottom:0;width:100%}.dashboard-small-chart .dashboard-small-chart-inner{width:100%}.dashboard-small-chart .dashboard-small-chart-inner .dashboard-interior-chart{height:229px;width:100%}.dashboard-small-chart .dashboard-small-chart-inner .dashboard-interior-chart .nv-axis text{fill:#666;font-size:11px;font-weight:400}.dashboard-tendency-container .dashboard-tendency-chart{height:101.5px}.dashboard-tendency-container .dashboard-tendency-chart .dashboard-figure,.dashboard-tendency-container .dashboard-tendency-chart .dashboard-subtitle-bar,.dashboard-tendency-container .dashboard-tendency-chart .dashboard-tendency{width:105px}.dashboard-tendency-container .dashboard-tendency-chart .dashboard-subtitle-bar{height:31.17px;line-height:31.17px}.dashboard-tendency-container .dashboard-tendency-chart .dashboard-figure{height:52.33px;line-height:25.17px;padding-top:5px}.dashboard-tendency-container .dashboard-sub-bar{width:100%}.dashboard-bar-chart-container{height:98px}.dashboard-bar-chart-container .dashboard-bar-chart{height:93px;width:100%}.dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-title{height:31.33px;line-height:31.33px}.dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-title .percentage{width:163.8px}.dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-title .absolut{line-height:40px;padding-top:15px;width:69px}.dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-chart{box-sizing:border-box;height:50px;margin-top:5px;width:100%}.dashboard-bar-chart-container .dashboard-sub-bar{padding-top:13px;width:100%}.modal-chart-detail{bottom:12.1%!important;left:50%;margin-left:-405px;width:830px!important}.modal-chart-detail .modal-body{height:95%;max-height:none;padding:5px}.modal-chart-detail .modal-dashboard-legend{font-size:13px;min-height:225px;width:130px}.absolut,.percentage{font-size:15px}.modal-chart-detail .modal-inner-detail{width:670px}.modal-body .dashboard-large-chart{width:531px}.modal-body .dashboard-large-chart .dashboard-large-chart-inner .dashboard-interior-chart,.modal-body .dashboard-large-chart .dashboard-sub-bar{width:100%}.modal-body .dashboard-medium-chart-outer{float:left;width:382px}.modal-body .dashboard-medium-chart,.modal-body .dashboard-medium-chart .dashboard-interior-chart,.modal-body .dashboard-medium-chart .dashboard-sub-bar{width:100%}.modal-body .dashboard-small-chart,.modal-body .dashboard-small-chart .dashboard-small-chart-inner,.modal-body .dashboard-small-chart .dashboard-small-chart-inner .dashboard-interior-chart{width:auto}.modal-body .dashboard-medium-chart .dashboard-medium-chart-menu{left:364px}.modal-body .dashboard-small-chart .dashboard-sub-bar{clear:both;width:auto}.modal-body .dashboard-tendency-container,.modal-body .dashboard-tendency-container .dashboard-tendency-chart,.modal-body .dashboard-tendency-container .dashboard-tendency-chart .dashboard-figure,.modal-body .dashboard-tendency-container .dashboard-tendency-chart .dashboard-subtitle-bar,.modal-body .dashboard-tendency-container .dashboard-tendency-chart .dashboard-tendency{box-sizing:border-box;width:100%}.modal-body .dashboard-tendency-container .dashboard-sub-bar{width:100%}.modal-body .dashboard-bar-chart-container .dashboard-bar-chart{width:auto}.modal-body .dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-title .percentage{width:163.8px}.modal-body .dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-title .absolut{width:69px}.modal-body .dashboard-bar-chart-container .dashboard-bar-chart-chart{width:234px}.modal-body .dashboard-bar-chart-container .dashboard-sub-bar{width:100%}.absolut{font-weight:300}.dashboard-sub-bar{font-size:11px;font-weight:400}.dashboard-subtitle-bar{font-size:15px;font-weight:300}.dashboard-figure{font-size:18px;font-weight:400}.dashboard-figurePer{font-size:16px;font-weight:300}.dashboard-legend,.dygraph-axis-label.dygraph-axis-label-x,.dygraph-axis-label.dygraph-axis-label-y{font-weight:400;font-size:11px}.dashboard-legend{height:30px;width:100%}.dashboard-half-height-legend{font-size:11px;height:117.5px;width:60px}.application-detail-view section.info{width:610px}}@media (min-width:1210px) and (max-width:1449px){.dashboard-full-width-chart,.dashboard-full-width-chart .dashboard-full-width-chart-inner,.dashboard-full-width-chart .dashboard-sub-bar,.dashboard-large-chart .dashboard-large-chart-inner,.dashboard-large-chart .dashboard-sub-bar,.dashboard-medium-chart,.dashboard-medium-chart .dashboard-sub-bar,.resizecontainer{width:100%}.dashboard-full-width-chart .dashboard-full-width-chart-inner .dashboard-interior-chart,.dashboard-medium-chart-outer{float:left}.dashboard-large-chart .dashboard-large-chart-inner .dashboard-interior-chart{height:255px}.dashboard-sub-bar-menu{font-size:15px}.dashboard-medium-chart .dashboard-interior-chart{height:255px;width:100%}.dashboard-medium-chart .dashboard-medium-chart-menu{font-size:16px;left:486px;top:0}.dashboard-medium-chart #clusterGraphs svg{height:255px;width:507px}.dashboard-medium-chart #clusterGraphs svg text{font-size:12px}.dashboard-small-chart .dashboard-sub-bar{clear:both;height:65px;margin-bottom:0;width:100%}.dashboard-small-chart .dashboard-small-chart-inner{width:100%}.dashboard-small-chart .dashboard-small-chart-inner .dashboard-interior-chart{height:264px;width:100%}.dashboard-small-chart .dashboard-small-chart-inner .dashboard-interior-chart .nv-axis text{fill:#666;font-size:13px;font-weight:400}.dashboard-tendency-container .dashboard-tendency-chart{height:119px}.dashboard-tendency-container .dashboard-tendency-chart .dashboard-figure,.dashboard-tendency-container .dashboard-tendency-chart .dashboard-subtitle-bar,.dashboard-tendency-container .dashboard-tendency-chart .dashboard-tendency{width:145px}.dashboard-tendency-container .dashboard-tendency-chart .dashboard-subtitle-bar{height:37px;line-height:37px}.dashboard-tendency-container .dashboard-tendency-chart .dashboard-figure{height:64px;line-height:31px;padding-top:5px}.dashboard-tendency-container .dashboard-sub-bar{width:100%}.dashboard-bar-chart-container{height:115.5px}.dashboard-bar-chart-container .dashboard-bar-chart{height:110.5px;width:100%}.dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-title{height:37.17px;line-height:37.17px}.dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-title .percentage{width:219.8px}.dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-title .absolut{line-height:40px;padding-top:15px;width:93px}.dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-chart{box-sizing:border-box;height:50px;margin-top:5px;width:100%}.dashboard-bar-chart-container .dashboard-sub-bar{padding-top:13px;width:100%}.modal-chart-detail{bottom:12.1%!important;left:50%;margin-left:-525px;width:1070px!important}.modal-chart-detail .modal-body{height:95%;max-height:none;padding:5px}.modal-chart-detail .modal-dashboard-legend{font-size:14px;min-height:260px;width:140px}.absolut,.percentage{font-size:18px}.modal-chart-detail .modal-inner-detail{width:900px}.modal-body .dashboard-large-chart{width:691px}.modal-body .dashboard-large-chart .dashboard-large-chart-inner .dashboard-interior-chart,.modal-body .dashboard-large-chart .dashboard-sub-bar{width:100%}.modal-body .dashboard-medium-chart-outer{float:left;width:502px}.modal-body .dashboard-medium-chart,.modal-body .dashboard-medium-chart .dashboard-interior-chart,.modal-body .dashboard-medium-chart .dashboard-sub-bar{width:100%}.modal-body .dashboard-small-chart,.modal-body .dashboard-small-chart .dashboard-small-chart-inner,.modal-body .dashboard-small-chart .dashboard-small-chart-inner .dashboard-interior-chart{width:auto}.modal-body .dashboard-medium-chart .dashboard-medium-chart-menu{left:481px}.modal-body .dashboard-small-chart .dashboard-sub-bar{clear:both;width:auto}.modal-body .dashboard-tendency-container,.modal-body .dashboard-tendency-container .dashboard-tendency-chart,.modal-body .dashboard-tendency-container .dashboard-tendency-chart .dashboard-figure,.modal-body .dashboard-tendency-container .dashboard-tendency-chart .dashboard-subtitle-bar,.modal-body .dashboard-tendency-container .dashboard-tendency-chart .dashboard-tendency{box-sizing:border-box;width:100%}.modal-body .dashboard-tendency-container .dashboard-sub-bar{width:100%}.modal-body .dashboard-bar-chart-container .dashboard-bar-chart{width:auto}.modal-body .dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-title .percentage{width:219.8px}.modal-body .dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-title .absolut{width:93px}.modal-body .dashboard-bar-chart-container .dashboard-bar-chart-chart{width:314px}.modal-body .dashboard-bar-chart-container .dashboard-sub-bar{width:100%}.absolut{font-weight:300}.dashboard-sub-bar{font-size:13px;font-weight:400}.dashboard-subtitle-bar{font-size:18px;font-weight:300}.dashboard-figure{font-size:22px;font-weight:400}.dashboard-figurePer{font-size:20px;font-weight:300}.dygraph-axis-label.dygraph-axis-label-x,.dygraph-axis-label.dygraph-axis-label-y{font-size:13px;font-weight:400}.dashboard-legend{font-size:12px;font-weight:400;height:30px;width:100%}.dashboard-half-height-legend{font-size:12px;height:135px;width:65px}.application-detail-view section.info{width:850px}}@media (min-width:1450px) and (max-width:1689px){.dashboard-full-width-chart,.dashboard-full-width-chart .dashboard-full-width-chart-inner,.dashboard-full-width-chart .dashboard-sub-bar,.dashboard-large-chart .dashboard-large-chart-inner,.dashboard-large-chart .dashboard-sub-bar,.dashboard-medium-chart,.dashboard-medium-chart .dashboard-sub-bar,.resizecontainer{width:100%}.dashboard-full-width-chart .dashboard-full-width-chart-inner .dashboard-interior-chart,.dashboard-medium-chart-outer{float:left}.dashboard-large-chart .dashboard-large-chart-inner .dashboard-interior-chart{height:285px}.dashboard-sub-bar-menu{font-size:15px}.dashboard-medium-chart .dashboard-interior-chart{height:285px;width:100%}.dashboard-medium-chart .dashboard-medium-chart-menu{font-size:18px;left:604px;top:0}.dashboard-medium-chart #clusterGraphs svg{height:285px;width:627px}.dashboard-medium-chart #clusterGraphs svg text{font-size:13px}.dashboard-small-chart .dashboard-sub-bar{clear:both;height:65px;margin-bottom:0;width:100%}.dashboard-small-chart .dashboard-small-chart-inner{width:100%}.dashboard-small-chart .dashboard-small-chart-inner .dashboard-interior-chart{height:294px;width:100%}.dashboard-small-chart .dashboard-small-chart-inner .dashboard-interior-chart .nv-axis text{fill:#666;font-size:13px;font-weight:400}.dashboard-tendency-container .dashboard-tendency-chart{height:134px}.dashboard-tendency-container .dashboard-tendency-chart .dashboard-figure,.dashboard-tendency-container .dashboard-tendency-chart .dashboard-subtitle-bar,.dashboard-tendency-container .dashboard-tendency-chart .dashboard-tendency{width:185px}.dashboard-tendency-container .dashboard-tendency-chart .dashboard-subtitle-bar{height:42px;line-height:42px}.dashboard-tendency-container .dashboard-tendency-chart .dashboard-figure{height:74px;line-height:36px;padding-top:5px}.dashboard-tendency-container .dashboard-sub-bar{width:100%}.dashboard-bar-chart-container{height:130.5px}.dashboard-bar-chart-container .dashboard-bar-chart{height:125.5px;width:100%}.dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-title{height:42.17px;line-height:42.17px}.dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-title .percentage{width:275.8px}.dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-title .absolut{line-height:40px;padding-top:15px;width:117px}.dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-chart{box-sizing:border-box;height:50px;margin-top:5px;width:100%}.dashboard-bar-chart-container .dashboard-sub-bar{padding-top:13px;width:100%}.modal-chart-detail{bottom:12.1%!important;left:50%;margin-left:-645px;width:1310px!important}.modal-chart-detail .modal-body{height:95%;max-height:none;padding:5px}.modal-chart-detail .modal-dashboard-legend{font-size:15px;min-height:290px;width:150px}.absolut,.percentage{font-size:20px}.modal-chart-detail .modal-inner-detail{width:1130px}.modal-body .dashboard-large-chart{width:851px}.modal-body .dashboard-large-chart .dashboard-large-chart-inner .dashboard-interior-chart,.modal-body .dashboard-large-chart .dashboard-sub-bar{width:100%}.modal-body .dashboard-medium-chart-outer{float:left;width:622px}.modal-body .dashboard-medium-chart,.modal-body .dashboard-medium-chart .dashboard-interior-chart,.modal-body .dashboard-medium-chart .dashboard-sub-bar{width:100%}.modal-body .dashboard-small-chart,.modal-body .dashboard-small-chart .dashboard-small-chart-inner,.modal-body .dashboard-small-chart .dashboard-small-chart-inner .dashboard-interior-chart{width:auto}.modal-body .dashboard-medium-chart .dashboard-medium-chart-menu{left:599px}.modal-body .dashboard-small-chart .dashboard-sub-bar{clear:both;width:auto}.modal-body .dashboard-tendency-container,.modal-body .dashboard-tendency-container .dashboard-tendency-chart,.modal-body .dashboard-tendency-container .dashboard-tendency-chart .dashboard-figure,.modal-body .dashboard-tendency-container .dashboard-tendency-chart .dashboard-subtitle-bar,.modal-body .dashboard-tendency-container .dashboard-tendency-chart .dashboard-tendency{box-sizing:border-box;width:100%}.modal-body .dashboard-tendency-container .dashboard-sub-bar{width:100%}.modal-body .dashboard-bar-chart-container .dashboard-bar-chart{width:auto}.modal-body .dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-title .percentage{width:275.8px}.modal-body .dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-title .absolut{width:117px}.modal-body .dashboard-bar-chart-container .dashboard-bar-chart-chart{width:394px}.modal-body .dashboard-bar-chart-container .dashboard-sub-bar{width:100%}.absolut{font-weight:300}.dashboard-sub-bar{font-size:13px;font-weight:400}.dashboard-subtitle-bar{font-size:20px;font-weight:300}.dashboard-figure{font-size:26px;font-weight:400}.dashboard-figurePer{font-size:24px;font-weight:300}.dashboard-legend,.dygraph-axis-label.dygraph-axis-label-x,.dygraph-axis-label.dygraph-axis-label-y{font-weight:400;font-size:13px}.dashboard-legend{height:30px;width:100%}.dashboard-half-height-legend{font-size:13px;height:150px;width:70px}.application-detail-view section.info{width:1090px}}@media (min-width:1690px) and (max-width:1929px){.dashboard-full-width-chart,.dashboard-full-width-chart .dashboard-full-width-chart-inner,.dashboard-full-width-chart .dashboard-sub-bar,.dashboard-large-chart .dashboard-large-chart-inner,.dashboard-large-chart .dashboard-sub-bar,.dashboard-medium-chart,.dashboard-medium-chart .dashboard-sub-bar,.resizecontainer{width:100%}.dashboard-full-width-chart .dashboard-full-width-chart-inner .dashboard-interior-chart,.dashboard-medium-chart-outer{float:left}.dashboard-large-chart .dashboard-large-chart-inner .dashboard-interior-chart{height:325px}.dashboard-sub-bar-menu{font-size:16px}.dashboard-medium-chart .dashboard-interior-chart{height:325px;width:100%}.dashboard-medium-chart .dashboard-medium-chart-menu{font-size:22px;left:720px;top:0}.dashboard-medium-chart #clusterGraphs svg{height:325px;width:747px}.dashboard-medium-chart #clusterGraphs svg text{font-size:14px}.dashboard-small-chart .dashboard-sub-bar{clear:both;height:65px;margin-bottom:0;width:100%}.dashboard-small-chart .dashboard-small-chart-inner{width:100%}.dashboard-small-chart .dashboard-small-chart-inner .dashboard-interior-chart{height:334px;width:100%}.dashboard-small-chart .dashboard-small-chart-inner .dashboard-interior-chart .nv-axis text{fill:#666;font-size:14px;font-weight:400}.dashboard-tendency-container .dashboard-tendency-chart{height:154px}.dashboard-tendency-container .dashboard-tendency-chart .dashboard-figure,.dashboard-tendency-container .dashboard-tendency-chart .dashboard-subtitle-bar,.dashboard-tendency-container .dashboard-tendency-chart .dashboard-tendency{width:225px}.dashboard-tendency-container .dashboard-tendency-chart .dashboard-subtitle-bar{height:48.67px;line-height:48.67px}.dashboard-tendency-container .dashboard-tendency-chart .dashboard-figure{height:87.33px;line-height:42.67px;padding-top:5px}.dashboard-tendency-container .dashboard-sub-bar{width:100%}.dashboard-bar-chart-container{height:150.5px}.dashboard-bar-chart-container .dashboard-bar-chart{height:145.5px;width:100%}.dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-title{height:48.83px;line-height:48.83px}.dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-title .percentage{width:331.8px}.dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-title .absolut{line-height:40px;padding-top:15px;width:141px}.dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-chart{box-sizing:border-box;height:50px;margin-top:5px;width:100%}.dashboard-bar-chart-container .dashboard-sub-bar{padding-top:13px;width:100%}.modal-chart-detail{bottom:12.1%!important;left:50%;margin-left:-765px;width:1550px!important}.modal-chart-detail .modal-body{height:95%;max-height:none;padding:5px}.modal-chart-detail .modal-dashboard-legend{font-size:16px;min-height:330px;width:170px}.absolut,.percentage{font-size:24px}.modal-chart-detail .modal-inner-detail{width:1350px}.modal-body .dashboard-large-chart{width:1011px}.modal-body .dashboard-large-chart .dashboard-large-chart-inner .dashboard-interior-chart,.modal-body .dashboard-large-chart .dashboard-sub-bar{width:100%}.modal-body .dashboard-medium-chart-outer{float:left;width:742px}.modal-body .dashboard-medium-chart,.modal-body .dashboard-medium-chart .dashboard-interior-chart,.modal-body .dashboard-medium-chart .dashboard-sub-bar{width:100%}.modal-body .dashboard-small-chart,.modal-body .dashboard-small-chart .dashboard-small-chart-inner,.modal-body .dashboard-small-chart .dashboard-small-chart-inner .dashboard-interior-chart{width:auto}.modal-body .dashboard-medium-chart .dashboard-medium-chart-menu{left:715px}.modal-body .dashboard-small-chart .dashboard-sub-bar{clear:both;width:auto}.modal-body .dashboard-tendency-container,.modal-body .dashboard-tendency-container .dashboard-tendency-chart,.modal-body .dashboard-tendency-container .dashboard-tendency-chart .dashboard-figure,.modal-body .dashboard-tendency-container .dashboard-tendency-chart .dashboard-subtitle-bar,.modal-body .dashboard-tendency-container .dashboard-tendency-chart .dashboard-tendency{box-sizing:border-box;width:100%}.modal-body .dashboard-tendency-container .dashboard-sub-bar{width:100%}.modal-body .dashboard-bar-chart-container .dashboard-bar-chart{width:auto}.modal-body .dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-title .percentage{width:331.8px}.modal-body .dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-title .absolut{width:141px}.modal-body .dashboard-bar-chart-container .dashboard-bar-chart-chart{width:474px}.modal-body .dashboard-bar-chart-container .dashboard-sub-bar{width:100%}.absolut{font-weight:300}.dashboard-sub-bar{font-size:14px;font-weight:400}.dashboard-subtitle-bar{font-size:24px;font-weight:300}.dashboard-figure{font-size:30px;font-weight:400}.dashboard-figurePer{font-size:28px;font-weight:300}.dashboard-legend,.dygraph-axis-label.dygraph-axis-label-x,.dygraph-axis-label.dygraph-axis-label-y{font-weight:400;font-size:14px}.dashboard-legend{height:30px;width:100%}.dashboard-half-height-legend{font-size:14px;height:170px;width:80px}.application-detail-view section.info{width:1330px}}@media (min-width:1930px) and (max-width:2169px){.dashboard-full-width-chart,.dashboard-full-width-chart .dashboard-full-width-chart-inner,.dashboard-full-width-chart .dashboard-sub-bar,.dashboard-large-chart .dashboard-large-chart-inner,.dashboard-large-chart .dashboard-sub-bar,.dashboard-medium-chart,.dashboard-medium-chart .dashboard-sub-bar,.resizecontainer{width:100%}.dashboard-full-width-chart .dashboard-full-width-chart-inner .dashboard-interior-chart,.dashboard-medium-chart-outer{float:left}.dashboard-large-chart .dashboard-large-chart-inner .dashboard-interior-chart{height:385px}.dashboard-sub-bar-menu{font-size:17px}.dashboard-medium-chart .dashboard-interior-chart{height:385px;width:100%}.dashboard-medium-chart .dashboard-medium-chart-menu{font-size:26px;left:836px;top:0}.dashboard-medium-chart #clusterGraphs svg{height:385px;width:867px}.dashboard-medium-chart #clusterGraphs svg text{font-size:15px}.dashboard-small-chart .dashboard-sub-bar{clear:both;height:65px;margin-bottom:0;width:100%}.dashboard-small-chart .dashboard-small-chart-inner{width:100%}.dashboard-small-chart .dashboard-small-chart-inner .dashboard-interior-chart{height:394px;width:100%}.dashboard-small-chart .dashboard-small-chart-inner .dashboard-interior-chart .nv-axis text{fill:#666;font-size:14px;font-weight:400}.dashboard-tendency-container .dashboard-tendency-chart{height:184px}.dashboard-tendency-container .dashboard-tendency-chart .dashboard-figure,.dashboard-tendency-container .dashboard-tendency-chart .dashboard-subtitle-bar,.dashboard-tendency-container .dashboard-tendency-chart .dashboard-tendency{width:265px}.dashboard-tendency-container .dashboard-tendency-chart .dashboard-subtitle-bar{height:58.67px;line-height:58.67px}.dashboard-tendency-container .dashboard-tendency-chart .dashboard-figure{height:107.33px;line-height:52.67px;padding-top:5px}.dashboard-tendency-container .dashboard-sub-bar{width:100%}.dashboard-bar-chart-container{height:180.5px}.dashboard-bar-chart-container .dashboard-bar-chart{height:175.5px;width:100%}.dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-title{height:58.83px;line-height:58.83px}.dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-title .percentage{width:387.8px}.dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-title .absolut{line-height:40px;padding-top:15px;width:165px}.dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-chart{box-sizing:border-box;height:50px;margin-top:5px;width:100%}.dashboard-bar-chart-container .dashboard-sub-bar{padding-top:13px;width:100%}.modal-chart-detail{bottom:12.1%!important;left:50%;margin-left:-885px;width:1790px!important}.modal-chart-detail .modal-body{height:95%;max-height:none;padding:5px}.modal-chart-detail .modal-dashboard-legend{font-size:17px;min-height:390px;width:180px}.absolut,.percentage{font-size:28px}.modal-chart-detail .modal-inner-detail{width:1580px}.modal-body .dashboard-large-chart{width:1171px}.modal-body .dashboard-large-chart .dashboard-large-chart-inner .dashboard-interior-chart,.modal-body .dashboard-large-chart .dashboard-sub-bar{width:100%}.modal-body .dashboard-medium-chart-outer{float:left;width:862px}.modal-body .dashboard-medium-chart,.modal-body .dashboard-medium-chart .dashboard-interior-chart,.modal-body .dashboard-medium-chart .dashboard-sub-bar{width:100%}.modal-body .dashboard-small-chart,.modal-body .dashboard-small-chart .dashboard-small-chart-inner,.modal-body .dashboard-small-chart .dashboard-small-chart-inner .dashboard-interior-chart{width:auto}.modal-body .dashboard-medium-chart .dashboard-medium-chart-menu{left:831px}.modal-body .dashboard-small-chart .dashboard-sub-bar{clear:both;width:auto}.modal-body .dashboard-tendency-container,.modal-body .dashboard-tendency-container .dashboard-tendency-chart,.modal-body .dashboard-tendency-container .dashboard-tendency-chart .dashboard-figure,.modal-body .dashboard-tendency-container .dashboard-tendency-chart .dashboard-subtitle-bar,.modal-body .dashboard-tendency-container .dashboard-tendency-chart .dashboard-tendency{box-sizing:border-box;width:100%}.modal-body .dashboard-tendency-container .dashboard-sub-bar{width:100%}.modal-body .dashboard-bar-chart-container .dashboard-bar-chart{width:auto}.modal-body .dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-title .percentage{width:387.8px}.modal-body .dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-title .absolut{width:165px}.modal-body .dashboard-bar-chart-container .dashboard-bar-chart-chart{width:554px}.modal-body .dashboard-bar-chart-container .dashboard-sub-bar{width:100%}.absolut{font-weight:300}.dashboard-sub-bar{font-size:15px;font-weight:400}.dashboard-subtitle-bar{font-size:28px;font-weight:300}.dashboard-figure{font-size:34px;font-weight:400}.dashboard-figurePer{font-size:32px;font-weight:300}.dygraph-axis-label.dygraph-axis-label-x,.dygraph-axis-label.dygraph-axis-label-y{font-size:14px;font-weight:400}.dashboard-legend{font-size:15px;font-weight:400;height:30px;width:100%}.dashboard-half-height-legend{font-size:15px;height:200px;width:85px}.application-detail-view section.info{width:1570px}}@media (min-width:2170px) and (max-width:2409px){.dashboard-full-width-chart,.dashboard-full-width-chart .dashboard-full-width-chart-inner,.dashboard-full-width-chart .dashboard-sub-bar,.dashboard-large-chart .dashboard-large-chart-inner,.dashboard-large-chart .dashboard-sub-bar,.dashboard-medium-chart,.dashboard-medium-chart .dashboard-sub-bar,.resizecontainer{width:100%}.dashboard-full-width-chart .dashboard-full-width-chart-inner .dashboard-interior-chart,.dashboard-medium-chart-outer{float:left}.dashboard-large-chart .dashboard-large-chart-inner .dashboard-interior-chart{height:285px}.dashboard-sub-bar-menu{font-size:17px}.dashboard-medium-chart .dashboard-interior-chart{height:285px;width:100%}.dashboard-medium-chart .dashboard-medium-chart-menu{font-size:20px;left:962px;top:0}.dashboard-medium-chart #clusterGraphs svg{height:285px;width:987px}.dashboard-medium-chart #clusterGraphs svg text{font-size:15px}.dashboard-small-chart .dashboard-sub-bar{clear:both;height:65px;margin-bottom:0;width:100%}.dashboard-small-chart .dashboard-small-chart-inner{width:100%}.dashboard-small-chart .dashboard-small-chart-inner .dashboard-interior-chart{height:294px;width:100%}.dashboard-small-chart .dashboard-small-chart-inner .dashboard-interior-chart .nv-axis text{fill:#666;font-size:15px;font-weight:400}.dashboard-tendency-container .dashboard-tendency-chart{height:134px}.dashboard-tendency-container .dashboard-tendency-chart .dashboard-figure,.dashboard-tendency-container .dashboard-tendency-chart .dashboard-subtitle-bar,.dashboard-tendency-container .dashboard-tendency-chart .dashboard-tendency{width:305px}.dashboard-tendency-container .dashboard-tendency-chart .dashboard-subtitle-bar{height:42px;line-height:42px}.dashboard-tendency-container .dashboard-tendency-chart .dashboard-figure{height:74px;line-height:36px;padding-top:5px}.dashboard-tendency-container .dashboard-sub-bar{width:100%}.dashboard-bar-chart-container{height:130.5px}.dashboard-bar-chart-container .dashboard-bar-chart{height:125.5px;width:100%}.dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-title{height:42.17px;line-height:42.17px}.dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-title .percentage{width:443.8px}.dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-title .absolut{line-height:40px;padding-top:15px;width:189px}.dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-chart{box-sizing:border-box;height:50px;margin-top:5px;width:100%}.dashboard-bar-chart-container .dashboard-sub-bar{padding-top:13px;width:100%}.modal-chart-detail{bottom:12.1%!important;left:50%;margin-left:-1005px;width:2030px!important}.modal-chart-detail .modal-body{height:95%;max-height:none;padding:5px}.modal-chart-detail .modal-dashboard-legend{font-size:17px;min-height:290px;width:150px}.absolut,.percentage{font-size:22px}.modal-chart-detail .modal-inner-detail{width:1850px}.modal-body .dashboard-large-chart{width:1331px}.modal-body .dashboard-large-chart .dashboard-large-chart-inner .dashboard-interior-chart,.modal-body .dashboard-large-chart .dashboard-sub-bar{width:100%}.modal-body .dashboard-medium-chart-outer{float:left;width:982px}.modal-body .dashboard-medium-chart,.modal-body .dashboard-medium-chart .dashboard-interior-chart,.modal-body .dashboard-medium-chart .dashboard-sub-bar{width:100%}.modal-body .dashboard-small-chart,.modal-body .dashboard-small-chart .dashboard-small-chart-inner,.modal-body .dashboard-small-chart .dashboard-small-chart-inner .dashboard-interior-chart{width:auto}.modal-body .dashboard-medium-chart .dashboard-medium-chart-menu{left:957px}.modal-body .dashboard-small-chart .dashboard-sub-bar{clear:both;width:auto}.modal-body .dashboard-tendency-container,.modal-body .dashboard-tendency-container .dashboard-tendency-chart,.modal-body .dashboard-tendency-container .dashboard-tendency-chart .dashboard-figure,.modal-body .dashboard-tendency-container .dashboard-tendency-chart .dashboard-subtitle-bar,.modal-body .dashboard-tendency-container .dashboard-tendency-chart .dashboard-tendency{box-sizing:border-box;width:100%}.modal-body .dashboard-tendency-container .dashboard-sub-bar{width:100%}.modal-body .dashboard-bar-chart-container .dashboard-bar-chart{width:auto}.modal-body .dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-title .percentage{width:443.8px}.modal-body .dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-title .absolut{width:189px}.modal-body .dashboard-bar-chart-container .dashboard-bar-chart-chart{width:634px}.modal-body .dashboard-bar-chart-container .dashboard-sub-bar{width:100%}.absolut{font-weight:300}.dashboard-sub-bar{font-size:15px;font-weight:400}.dashboard-subtitle-bar{font-size:22px;font-weight:300}.dashboard-figure{font-size:36px;font-weight:400}.dashboard-figurePer{font-size:34px;font-weight:300}.dashboard-legend,.dygraph-axis-label.dygraph-axis-label-x,.dygraph-axis-label.dygraph-axis-label-y{font-weight:400;font-size:15px}.dashboard-legend{height:30px;width:100%}.dashboard-half-height-legend{font-size:15px;height:150px;width:70px}.application-detail-view section.info{width:1810px}}@media (min-width:2410px) and (max-width:2649px){.dashboard-full-width-chart,.dashboard-full-width-chart .dashboard-full-width-chart-inner,.dashboard-full-width-chart .dashboard-sub-bar,.dashboard-large-chart .dashboard-large-chart-inner,.dashboard-large-chart .dashboard-sub-bar,.dashboard-medium-chart,.dashboard-medium-chart .dashboard-sub-bar,.resizecontainer{width:100%}.dashboard-full-width-chart .dashboard-full-width-chart-inner .dashboard-interior-chart,.dashboard-medium-chart-outer{float:left}.dashboard-large-chart .dashboard-large-chart-inner .dashboard-interior-chart{height:285px}.dashboard-sub-bar-menu{font-size:17px}.dashboard-medium-chart .dashboard-interior-chart{height:285px;width:100%}.dashboard-medium-chart .dashboard-medium-chart-menu{font-size:20px;left:1082px;top:0}.dashboard-medium-chart #clusterGraphs svg{height:285px;width:1107px}.dashboard-medium-chart #clusterGraphs svg text{font-size:15px}.dashboard-small-chart .dashboard-sub-bar{clear:both;height:65px;margin-bottom:0;width:100%}.dashboard-small-chart .dashboard-small-chart-inner{width:100%}.dashboard-small-chart .dashboard-small-chart-inner .dashboard-interior-chart{height:294px;width:100%}.dashboard-small-chart .dashboard-small-chart-inner .dashboard-interior-chart .nv-axis text{fill:#666;font-size:15px;font-weight:400}.dashboard-tendency-container .dashboard-tendency-chart{height:134px}.dashboard-tendency-container .dashboard-tendency-chart .dashboard-figure,.dashboard-tendency-container .dashboard-tendency-chart .dashboard-subtitle-bar,.dashboard-tendency-container .dashboard-tendency-chart .dashboard-tendency{width:345px}.dashboard-tendency-container .dashboard-tendency-chart .dashboard-subtitle-bar{height:42px;line-height:42px}.dashboard-tendency-container .dashboard-tendency-chart .dashboard-figure{height:74px;line-height:36px;padding-top:5px}.dashboard-tendency-container .dashboard-sub-bar{width:100%}.dashboard-bar-chart-container{height:130.5px}.dashboard-bar-chart-container .dashboard-bar-chart{height:125.5px;width:100%}.dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-title{height:42.17px;line-height:42.17px}.dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-title .percentage{width:499.8px}.dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-title .absolut{line-height:40px;padding-top:15px;width:213px}.dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-chart{box-sizing:border-box;height:50px;margin-top:5px;width:100%}.dashboard-bar-chart-container .dashboard-sub-bar{padding-top:13px;width:100%}.modal-chart-detail{bottom:12.1%!important;left:50%;margin-left:-1125px;width:2270px!important}.modal-chart-detail .modal-body{height:95%;max-height:none;padding:5px}.modal-chart-detail .modal-dashboard-legend{font-size:17px;min-height:290px;width:150px}.absolut,.percentage{font-size:22px}.modal-chart-detail .modal-inner-detail{width:2090px}.modal-body .dashboard-large-chart{width:1491px}.modal-body .dashboard-large-chart .dashboard-large-chart-inner .dashboard-interior-chart,.modal-body .dashboard-large-chart .dashboard-sub-bar{width:100%}.modal-body .dashboard-medium-chart-outer{float:left;width:1102px}.modal-body .dashboard-medium-chart,.modal-body .dashboard-medium-chart .dashboard-interior-chart,.modal-body .dashboard-medium-chart .dashboard-sub-bar{width:100%}.modal-body .dashboard-small-chart,.modal-body .dashboard-small-chart .dashboard-small-chart-inner,.modal-body .dashboard-small-chart .dashboard-small-chart-inner .dashboard-interior-chart{width:auto}.modal-body .dashboard-medium-chart .dashboard-medium-chart-menu{left:1077px}.modal-body .dashboard-small-chart .dashboard-sub-bar{clear:both;width:auto}.modal-body .dashboard-tendency-container,.modal-body .dashboard-tendency-container .dashboard-tendency-chart,.modal-body .dashboard-tendency-container .dashboard-tendency-chart .dashboard-figure,.modal-body .dashboard-tendency-container .dashboard-tendency-chart .dashboard-subtitle-bar,.modal-body .dashboard-tendency-container .dashboard-tendency-chart .dashboard-tendency{box-sizing:border-box;width:100%}.modal-body .dashboard-tendency-container .dashboard-sub-bar{width:100%}.modal-body .dashboard-bar-chart-container .dashboard-bar-chart{width:auto}.modal-body .dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-title .percentage{width:499.8px}.modal-body .dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-title .absolut{width:213px}.modal-body .dashboard-bar-chart-container .dashboard-bar-chart-chart{width:714px}.modal-body .dashboard-bar-chart-container .dashboard-sub-bar{width:100%}.absolut{font-weight:300}.dashboard-sub-bar{font-size:15px;font-weight:400}.dashboard-subtitle-bar{font-size:22px;font-weight:300}.dashboard-figure{font-size:36px;font-weight:400}.dashboard-figurePer{font-size:34px;font-weight:300}.dashboard-legend,.dygraph-axis-label.dygraph-axis-label-x,.dygraph-axis-label.dygraph-axis-label-y{font-weight:400;font-size:15px}.dashboard-legend{height:30px;width:100%}.dashboard-half-height-legend{font-size:15px;height:150px;width:70px}.application-detail-view section.info{width:2050px}}@media (min-width:2650px) and (max-width:2889px){.dashboard-full-width-chart,.dashboard-full-width-chart .dashboard-full-width-chart-inner,.dashboard-full-width-chart .dashboard-sub-bar,.dashboard-large-chart .dashboard-large-chart-inner,.dashboard-large-chart .dashboard-sub-bar,.dashboard-medium-chart,.dashboard-medium-chart .dashboard-sub-bar,.resizecontainer{width:100%}.dashboard-full-width-chart .dashboard-full-width-chart-inner .dashboard-interior-chart,.dashboard-medium-chart-outer{float:left}.dashboard-large-chart .dashboard-large-chart-inner .dashboard-interior-chart{height:285px}.dashboard-sub-bar-menu{font-size:17px}.dashboard-medium-chart .dashboard-interior-chart{height:285px;width:100%}.dashboard-medium-chart .dashboard-medium-chart-menu{font-size:20px;left:1202px;top:0}.dashboard-medium-chart #clusterGraphs svg{height:285px;width:1227px}.dashboard-medium-chart #clusterGraphs svg text{font-size:15px}.dashboard-small-chart .dashboard-sub-bar{clear:both;height:65px;margin-bottom:0;width:100%}.dashboard-small-chart .dashboard-small-chart-inner{width:100%}.dashboard-small-chart .dashboard-small-chart-inner .dashboard-interior-chart{height:294px;width:100%}.dashboard-small-chart .dashboard-small-chart-inner .dashboard-interior-chart .nv-axis text{fill:#666;font-size:15px;font-weight:400}.dashboard-tendency-container .dashboard-tendency-chart{height:134px}.dashboard-tendency-container .dashboard-tendency-chart .dashboard-figure,.dashboard-tendency-container .dashboard-tendency-chart .dashboard-subtitle-bar,.dashboard-tendency-container .dashboard-tendency-chart .dashboard-tendency{width:385px}.dashboard-tendency-container .dashboard-tendency-chart .dashboard-subtitle-bar{height:42px;line-height:42px}.dashboard-tendency-container .dashboard-tendency-chart .dashboard-figure{height:74px;line-height:36px;padding-top:5px}.dashboard-tendency-container .dashboard-sub-bar{width:100%}.dashboard-bar-chart-container{height:130.5px}.dashboard-bar-chart-container .dashboard-bar-chart{height:125.5px;width:100%}.dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-title{height:42.17px;line-height:42.17px}.dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-title .percentage{width:555.8px}.dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-title .absolut{line-height:40px;padding-top:15px;width:237px}.dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-chart{box-sizing:border-box;height:50px;margin-top:5px;width:100%}.dashboard-bar-chart-container .dashboard-sub-bar{padding-top:13px;width:100%}.modal-chart-detail{bottom:12.1%!important;left:50%;margin-left:-1245px;width:2510px!important}.modal-chart-detail .modal-body{height:95%;max-height:none;padding:5px}.modal-chart-detail .modal-dashboard-legend{font-size:17px;min-height:290px;width:150px}.absolut,.percentage{font-size:22px}.modal-chart-detail .modal-inner-detail{width:2330px}.modal-body .dashboard-large-chart{width:1651px}.modal-body .dashboard-large-chart .dashboard-large-chart-inner .dashboard-interior-chart,.modal-body .dashboard-large-chart .dashboard-sub-bar{width:100%}.modal-body .dashboard-medium-chart-outer{float:left;width:1222px}.modal-body .dashboard-medium-chart,.modal-body .dashboard-medium-chart .dashboard-interior-chart,.modal-body .dashboard-medium-chart .dashboard-sub-bar{width:100%}.modal-body .dashboard-small-chart,.modal-body .dashboard-small-chart .dashboard-small-chart-inner,.modal-body .dashboard-small-chart .dashboard-small-chart-inner .dashboard-interior-chart{width:auto}.modal-body .dashboard-medium-chart .dashboard-medium-chart-menu{left:1197px}.modal-body .dashboard-small-chart .dashboard-sub-bar{clear:both;width:auto}.modal-body .dashboard-tendency-container,.modal-body .dashboard-tendency-container .dashboard-tendency-chart,.modal-body .dashboard-tendency-container .dashboard-tendency-chart .dashboard-figure,.modal-body .dashboard-tendency-container .dashboard-tendency-chart .dashboard-subtitle-bar,.modal-body .dashboard-tendency-container .dashboard-tendency-chart .dashboard-tendency{box-sizing:border-box;width:100%}.modal-body .dashboard-tendency-container .dashboard-sub-bar{width:100%}.modal-body .dashboard-bar-chart-container .dashboard-bar-chart{width:auto}.modal-body .dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-title .percentage{width:555.8px}.modal-body .dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-title .absolut{width:237px}.modal-body .dashboard-bar-chart-container .dashboard-bar-chart-chart{width:794px}.modal-body .dashboard-bar-chart-container .dashboard-sub-bar{width:100%}.absolut{font-weight:300}.dashboard-sub-bar{font-size:15px;font-weight:400}.dashboard-subtitle-bar{font-size:22px;font-weight:300}.dashboard-figure{font-size:36px;font-weight:400}.dashboard-figurePer{font-size:34px;font-weight:300}.dashboard-legend,.dygraph-axis-label.dygraph-axis-label-x,.dygraph-axis-label.dygraph-axis-label-y{font-weight:400;font-size:15px}.dashboard-legend{height:30px;width:100%}.dashboard-half-height-legend{font-size:15px;height:150px;width:70px}.application-detail-view section.info{width:2290px}}div.headerBar{position:absolute}div.centralRow{background:rgba(64,74,83,.04);height:100%;min-height:100%;overflow-y:auto;position:relative;right:0}div.centralContent{background-color:transparent;margin-top:10px;width:100%;padding:5px 5px 20px}.contentDiv{list-style:none;padding:0}.contentDiv li{background-color:rgba(0,0,0,.05)}.contentDiv a.add{display:block;font-weight:400;padding:40px 0;text-align:left}.modal-body th .valueCell,.modal-body th th.actionCell,.modal-body th th.keyCell,.waitModal{text-align:center}.contentDiv .icon{padding-left:5px;padding-right:5px;padding-top:10px}.contentDiv:after{clear:both}.contentDiv:after,.contentDiv:before{display:table;line-height:0}.clusterInfoIcon{float:left;padding-left:5px;padding-top:2px}.waitModal.icon{font-size:100px;height:120px}.waitModal.message{font-size:20px}.icon_arangodb_info{color:#333;font-size:23px}li a [class*=" icon_arangodb"],li a [class^=icon_arangodb]{font-size:18px;position:absolute;right:4px;top:2px}.fa-minus-circle{color:#e74c3c;font-size:14pt}.fa-plus-circle{color:#2ecc71;font-size:16pt}.fa-minus-circle:hover,.fa-plus-circle:hover{cursor:pointer}.dropdownImport,div.headerDropdown{background-color:#fff;border:1px solid rgba(140,138,137,.25);border-radius:2px;clear:both;display:none;margin-bottom:15px;padding:10px;position:relative;width:auto}.dropdownImport.smallDropdown .dropdownInner,div.headerDropdown.smallDropdown .dropdownInner{min-height:20px}.dropdownImport.headerDropdown input[type=checkbox].css-checkbox,div.headerDropdown.headerDropdown input[type=checkbox].css-checkbox{display:none}.dropdownImport.headerDropdown input[type=checkbox].css-checkbox label.css-label,div.headerDropdown.headerDropdown input[type=checkbox].css-checkbox label.css-label{background-position:0 0;background-repeat:no-repeat;display:inline-block;font-size:15px;height:15px;margin-top:0;padding-left:20px;vertical-align:middle}.dropdownImport.headerDropdown input[type=checkbox].css-checkbox:checked+label.css-label,div.headerDropdown.headerDropdown input[type=checkbox].css-checkbox:checked+label.css-label{background-position:0 -15px}div.dropdown-title{margin-bottom:10px}div.dropdownInner{-webkit-box-shadow:0;-moz-box-shadow:0;box-shadow:0;min-height:125px;position:relative;width:auto}div.dropdownInner .nav-header{font-size:10pt}div.dropdownInner>.nav-header{color:#000;font-size:10pt;font-weight:400}div.dropdownInner>label{color:#000;font-weight:300}div.dropdownInner ul{border-left:1px solid rgba(140,138,137,.25);display:inline;list-style-type:none;margin-left:10px;margin-top:10px;min-height:105px;width:175px}div.dropdownInner ul:first-of-type,div.queryline input[type=file]{border:0}div.dropdownInner ul label{color:#000;padding-left:20px}div.dropdownInner ul li .fa{color:#999;margin-right:5px}div.dropdownInner ul li .fa.fa-square-o{margin-left:1px;margin-right:6px}div.dropdownInner ul li .fa.fa-check-circle-o,div.dropdownInner ul li .fa.fa-check-square-o,div.dropdownInner ul li .fa.fa-dot-circle-o{color:#2ecc71}div.queryline{color:#000;height:35px}div.queryline .textDiv{margin-right:10px;margin-top:4px}div.queryline input,div.queryline select{margin-bottom:5px}div.queryline input{width:16%}div.queryline.querylineAdd span{color:#fff;padding-left:10px;position:relative;top:-21px}div.queryline .removeFilterItem i{font-size:16pt;margin-left:4px!important;margin-top:0!important}div.queryline div.searchByAttribute{margin-left:6px;margin-right:6px;position:relative}div.queryline div.searchByAttribute input{width:140px}div.queryline div.searchByAttribute>ul.gv-dropdown-menu{-moz-border-radius:0;-webkit-border-radius:0;border-radius:0;background-color:#fff;color:#fff;display:none;left:0;position:absolute;top:20px;width:247px}div.dropdownImport{background-color:#fff;border-radius:3px;display:none;position:relative;padding:10px 10px 5px}div.dropdownImport input{line-height:0;margin-bottom:-15px;margin-top:5px}select.filterSelect{color:#00f;margin-left:10px;margin-right:10px;width:80px}#filterHeader button{float:right;margin-left:10px!important;margin-top:1px}div.input-append button.gv_example_toggle{-moz-border-radius:0 4px 4px 0;-webkit-border-radius:0 4px 4px 0;border-radius:0 4px 4px 0;background-color:#8f8d8c;height:30px;margin-left:-1px;padding-left:10px;padding-right:10px;padding-top:12px;vertical-align:top}div.input-append button.gv_example_toggle:hover{background-color:#2ecc71}.searchEqualsLabel{margin-left:6px;margin-right:6px}img.gv-throbber{background-image:url(../img/swagger/throbber.gif)}span.gv_caret{border-top:5px solid #fff;margin-top:2px!important}input.search-input{border:1px solid #fff;height:20px;line-height:20px;margin-right:-4px;margin-top:3px;width:120px}.search-field{margin-left:10px;margin-right:3px}.search-field .fa-search{color:#c2c2c2;font-size:12pt;margin-left:-20px;opacity:.5;position:absolute;right:9px;top:9px}div.headerBar,div.headerBar .infoField{color:#000;float:right;padding-left:5px;padding-right:5px}.search-field .fa-search:hover{cursor:pointer;opacity:1}.gv-search-submit-icon,.search-submit-icon{background-image:url(../img/enter_icon.png);background-size:14px;height:14px;margin-left:-18px;opacity:.2;position:absolute;width:14px}.gv-search-submit-icon:hover,.search-submit-icon:hover{opacity:.8}.search-submit-icon{margin-top:11px}.gv-search-submit-icon{margin-top:6px}div.headerBar{background-color:none;border-radius:2px;font-size:16px;height:36px;margin-top:-55px;right:0}div.headerBar.marginTop5{margin-top:-60px}div.headerBar select:focus{outline:0}div.headerBar .infoField{background-color:#fff;border:1px solid rgba(140,138,137,.25);border-radius:3px!important;font-size:12px;margin-right:7px;margin-top:7px}div.headerBar .infoField .fa{cursor:pointer;margin-left:5px}div.headerBar input[type=checkbox].css-checkbox{display:none}div.headerBar input[type=checkbox].css-checkbox label.css-label{background-position:0 0;background-repeat:no-repeat;cursor:pointer;display:inline-block;font-size:15px;height:15px;margin-top:0;padding-left:20px;vertical-align:middle}div.headerBar input[type=checkbox].css-checkbox:checked+label.css-label{background-position:0 -15px}div.headerBar input[type=radio]{display:none}div.headerBar input[type=radio] label span{background:url(../img/check_radio_sheet.png) -38px top no-repeat;cursor:pointer;display:inline-block;height:19px;margin:-1px 4px 0 0;vertical-align:middle;width:19px}#transparentHeader input[type=checkbox].css-checkbox,.contentTables tr.contentRowActive span,.dashboard-legend .dashboard-legend-inner br,.dashboard-row .fa-arrows-alt,.modal-delete-confirmation,.nvtooltip{display:none}div.headerBar input[type=radio]:checked+label span{background:url(../img/check_radio_sheet.png) -57px top no-repeat}.headerButtonList a span .fa-top{color:#fff;font-size:7pt;position:absolute}.headerButtonList a span .fa-top:hover{color:#2ecc71}.headerButtonList a.error{color:#e74c3c}.headerButtonList a.error:hover{background-color:#e74c3c;border-color:#e74c3c;color:#fff}.headerBar a.arangoHeader{color:#000;font-size:11.5pt;font-weight:100;left:0;position:relative;top:7px}.headerBar>div.headerButtonBar{margin:4px 0;margin-bottom:0!important}.breadcrumb{background:0 0;border:0;border-radius:0;color:#fff;font-size:12pt;font-weight:100;line-height:45px;margin:0 0 0 -4px;padding:0 0 0 10px}.breadcrumb .fa{margin-left:10px;margin-right:8px}.breadcrumb .fa-ellipsis-v{font-size:10pt;opacity:0}.breadcrumb .disabledBread{color:#fff;float:left;font-size:12pt;font-weight:100;padding-right:5px;position:relative}.breadcrumb .disabledBread i{font-size:10pt;margin-left:10px}.breadcrumb .disabledBread:hover{cursor:default}.breadcrumb .activeBread{color:#fff;float:left;font-size:11pt;font-weight:100;-webkit-tap-highlight-color:transparent;-webkit-transition:opacity .2s cubic-bezier(.645,.045,.355,1);transition:opacity .2s cubic-bezier(.645,.045,.355,1)}.breadcrumb .activeBread:hover{opacity:.65}.breadcrumb a{color:#fff!important;opacity:.8;transition:all .2s ease-in}.breadcrumb a:hover,.subViewNavbar li:hover a{-moz-transition:all .2s ease-in;-o-transition:all .2s ease-in;-webkit-transition:all .2s ease-in}.breadcrumb a:hover{opacity:1;transition:all .2s ease-in}.breadcrumb #app-development-path{background-color:#fff;border-bottom:1px solid rgba(140,138,137,.25);border-left:1px solid rgba(140,138,137,.25);border-radius:3px;border-right:1px solid rgba(140,138,137,.25);height:24px;margin-left:-6px;margin-top:-10px;padding-left:5px;width:100%}.arangoHeader{font-weight:400}.sectionHeader{background-color:#404a53;margin-bottom:10px;padding-bottom:2px;padding-top:10px;width:100%}.sectionHeader .title{color:#fff;font-size:12pt;font-weight:100;line-height:20pt;margin-left:10px}.sectionHeader .information{float:right;font-size:12.5pt;font-weight:100}.sectionHeader .information .fa{font-size:17pt}.sectionHeader .information span:first-child{margin-left:10px}.sectionHeader .information span span{position:relative;top:-2px}.sectionHeader .information span.positive{color:#2ecc71}.sectionHeader .information span.warning{color:#f1c40f}.sectionHeader .information span.negative{color:#e74c3c}.sectionHeader .information i{margin-left:5px;margin-right:10px}.sectionHeader .scaleGroup{float:right;margin-right:10px;position:inherit;width:80px}.sectionHeader .scaleGroup span{border-radius:30px;color:#fff;padding:3px 5px;position:relative;top:-4px}.sectionHeader .scaleGroup span.left{background:#e74c3c;margin-right:-19px}.sectionHeader .scaleGroup span.right{background:#2ecc71;margin-left:-16px}.sectionHeader .scaleGroup span.left:hover,.sectionHeader .scaleGroup span.right:hover{cursor:pointer}.sectionHeader .scaleGroup input{background:#404a53!important;border-color:rgba(255,255,255,.3);color:#fff;font-weight:100;height:10px;text-align:center;width:40px}.checkboxLabel{margin-top:4px;padding-left:0}.css-label{background-image:url(../img/dark-check-green.png)}.css-label-round{background-image:url(../img/dark-check-green-round.png)}.modal-dashboard-header,.modal-header{background-color:#fff;border-bottom:0!important;border-radius:3px;margin-top:5px;padding-left:5px;padding-right:10px;padding-top:4px}.modal-dashboard-header .arangoHeader,.modal-header .arangoHeader{color:#000;font-size:13pt;font-weight:100;left:5px;position:relative;top:2px}.modal-dashboard-header a,.modal-header a{top:2px!important}.modal-dashboard-header .close,.modal-header .close{color:#fff;font-weight:300;margin-top:2px;opacity:.5}.modal-dashboard-header .close:hover,.modal-header .close:hover{opacity:1}.select2-drop-active{border:2px solid #3498db;border-top:0;margin-top:-2px;width:452px!important;z-index:9999999}.select2-no-results,.select2-results{font-weight:100}.modal-tabbar{border-bottom:1px solid #666}.modal-body{color:#736b68;font-size:14px;font-weight:300;max-height:410px}.modal-body input{height:20px;width:436px}.modal-body select{height:33px;width:452px}.modal-body .select2-container-multi.select2-container-active .select2-choices{border:2px solid #3498db}.modal-body .select2-choices{background-image:none!important;border:2px solid rgba(140,138,137,.25);border-radius:3px;-webkit-box-shadow:none;box-shadow:none;width:448px}.modal-body .select2-choices input:active{-webkit-box-shadow:none;box-shadow:none;outline:0!important}.modal-body .select2-choices .select2-search-choice{margin:5px 0 3px 5px!important}.modal-body .select2-choices li{background-color:#fff!important;background-image:none!important;color:#000}.modal-body tr.first,.modal-body tr.last,.modal-body tr.middle{background-color:#f5f8f0}.modal-body .select2-choices li a{margin-left:1px;margin-top:-1px}.modal-body .select2-choices:active{border:1px solid #999;-webkit-box-shadow:none!important;box-shadow:none!important;outline:transparent!important}.modal-body .nav-tabs{margin-top:15px}.modal-body .nav-tabs>li>a:hover{border-color:#8c8a89}.modal-body input,.modal-body select,.modal-body textarea{margin-top:10px}.modal-body input[type=checkbox]{margin-bottom:10px}.modal-body input[type=text].invalid-input{border-color:rgba(234,23,23,.6)}.modal-body input[type=text].invalid-input:focus{-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(234,23,23,.6);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(234,23,23,.6);box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(234,23,23,.6)}.modal-body input[type=file]{line-height:17px}.modal-body tr.spacer{height:20px}.modal-body tr.first th:first-child{border-top-left-radius:3px}.modal-body tr.first th:last-child{border-top-right-radius:3px}.modal-body tr.middle{padding-left:10px;padding-right:10px}.modal-body tr.last th:first-child{border-bottom-left-radius:3px}.modal-body tr.last th:last-child{border-bottom-right-radius:3px}.modal-body tr.first th:first-child,.modal-body tr.last th:first-child,.modal-body tr.middle th:first-child{padding-left:10px}.modal-body tr.first th:last-child,.modal-body tr.last th:last-child,.modal-body tr.middle th:last-child{padding-right:10px}.modal-body th.actionCell{width:30px}.modal-body th.keyCell{width:170px}.modal-body th.keyCell input{width:150px}.modal-body th .valueCell{width:300px}.modal-body th .valueCell input{width:290px}.modal-body th .select2-container{margin-bottom:10px;margin-top:10px}.modal-body .icon-info-sign{margin-bottom:10px;margin-left:10px;opacity:.7;padding-bottom:5px}.modal-body .icon-info-sign:hover{opacity:1}.modal-body .icon_arangodb_info{color:#736b68;font-size:18px;margin-top:-10px;position:absolute;right:12px}.modal-body .icon_arangodb_info:hover{color:#000}.modal-body .collapse{margin-right:-14px;position:relative}.modal-body .accordion-inner{border-top:0;margin-left:0;padding-left:0;padding-right:0}.modal-body .accordion-toggle span .caret{border-top-color:#000;float:right;margin-top:5px}.modal-body .accordion-toggle.collapsed span .caret{-ms-transform:rotate(90deg);-webkit-transform:rotate(90deg);transform:rotate(90deg)}.modal-body .collectionTh{height:55px}.modal-body .tab-content{min-height:200px}.modal-body .tab-content .tab-pane{border-top:1px solid #666!important;margin-left:0!important;padding-top:10px}.modal-body .tab-content .tab-pane-modal{border-top:none!important}.modal-body .tab-content #appstore{max-height:290px}.modal-body .errorMessage{background:#e74c3c;border-radius:4px;color:#fff;font-size:9pt;font-weight:100;margin-top:-9px;padding-left:5px;padding-right:5px;position:absolute}.modal-body .nav .tab-icon{margin-right:5px;margin-top:-3px;width:20px}.modal-body pre{margin-right:20px;margin-top:20px}.modal-text{font-weight:300;padding-bottom:3px;padding-top:3px}.modal-backdrop,.modal-backdrop.fade.in{opacity:.4}.fade{opacity:0;-moz-transition:opacity .03s linear;-ms-transition:opacity .03s linear;-o-transition:opacity .03s linear;-webkit-transition:opacity .03s linear;transition:opacity .03s linear}.modal{border:0!important;border-radius:3px!important;box-shadow:0;margin-left:-325px!important;width:650px;z-index:9999999}.modal .fade.in{top:12.1%!important}.modal table tr:last-child{border-bottom:0!important}.waitModal{-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;background:0 0;border:0;color:#fff}.waitModalBackdrop{opacity:.7!important}.modalTooltips span{color:#736b68;font-size:20px}.modalTooltips span:hover{color:#000}.gv-object-view{text-align:left;white-space:pre}.capitalize{text-transform:capitalize}.modal-footer{border-top:0!important;padding-right:17px}.modal-footer .button-close{margin-left:20px;margin-right:10px}.modal-header{margin-left:5px;margin-right:5px}.modal-dashboard-header{margin-left:0;margin-right:0;padding-bottom:9px}.modal-delete-confirmation button{margin-right:10px;margin-top:-4px}.modal-delete-confirmation button .modal-confirm-delete{margin-right:-18px}.modal-delete-confirmation fieldset input{float:left}.modal-delete-confirmation fieldset label{float:left;margin-left:10px}.createModalDialog table{width:100%}.createModalDialog .collection-info-figures table{float:left;margin-left:0;margin-right:0;margin-top:0;min-width:200px;padding:3px;text-align:left}.createModalDialog .figures1,.createModalDialog .figures2{margin-bottom:20px;width:300px}.createModalDialog .figures2{margin-left:20px!important}.createModalDialog .figures3{margin-bottom:0;width:100%}.foxx-store-row{border-bottom:10px solid #fff;border-top:10px solid #fff}.foxx-store-row .foxx-name{background:#404a53;border-radius:4px;color:#fff;font-weight:300;margin-bottom:8px;padding-bottom:1px;padding-left:5px;width:100%}.fixedDropdown .dropdown-header a,.fixedDropdown .notificationItem{color:#000}.foxx-store-row .foxx-store-install{padding-right:5px;padding-top:25px}.foxx-store-row .foxx-author{font-size:10pt;font-weight:300;margin-top:-4px}.foxx-store-row .foxx-version{font-weight:400;margin-top:25px}#new-app-mount{margin-right:24px;width:360px}#control_event_edge_delete_modal,#control_event_edge_edit_modal,#control_event_new_node_modal,#control_event_node_delete_modal,#control_event_node_edit_modal{margin-left:-320px;width:640px}.navlogo .stat_cpu,.navlogo .stat_ram{width:26px;height:26px}.navlogo .stat_cpu{margin-top:1px}.navlogo .stat_cpu path{fill:#aa0}.navlogo .stat_ram path{fill:#070}.navlogo .stat_req{height:22px;width:22px}.navlogo .stat_req path{fill:#aa0}#notification_menu .innerDropdownInnerUL{margin-left:0}#noty_bottom_layout_container li{border:0!important}.noty_type_error .arango_message{top:2px}.noty_bar .noty_buttons{background-color:transparent!important;border:0!important;bottom:0;height:1px;margin-bottom:30px!important;margin-top:-35px!important;position:relative;right:-23px}.noty_bar .noty_buttons button{margin-bottom:2px;margin-right:-1px}.noty_bar .arango_message{font-weight:400!important}.noty_bar .arango_message div{float:right;width:20px}.fixedDropdown{background:#fff!important;border-color:rgba(140,138,137,.25)!important;border-radius:3px!important;margin:10px -3px 0!important;right:-1px!important;width:210px}.fixedDropdown .dropdown-header,.fixedDropdown .dropdown-item,.innerDropdownInnerUL{border-bottom:1px solid rgba(0,0,0,.2)}.fixedDropdown .dropdown-header{margin-left:-1px;padding:0!important}.fixedDropdown a{padding-left:5px!important}.fixedDropdown .notificationItemContent{font-size:.9em;font-weight:300;margin-left:15px;max-width:180px;min-height:15px;white-space:normal;width:180px;word-wrap:break-word}.fixedDropdown button{margin-right:5px;margin-top:5px}.fixedDropdown .notificationItem .notificationItemTitle{color:#000;font-weight:400;max-width:165px;overflow-wrap:break-word;white-space:normal;word-wrap:break-word}.fixedDropdown .notificationItem .notificationItemTitle:hover{background-color:transparent;cursor:default}.fixedDropdown .notificationItem i{color:rgba(0,0,0,.2);font-size:20px;padding-left:5px;position:relative;right:2px}.fixedDropdown .notificationItem i:hover{color:#000}.innerDropdownInnerUL{height:220px!important;min-height:220px;overflow-x:hidden;overflow-y:auto;width:100%}.innerDropdownInnerUL .dropdown-item:hover{background-color:#e1e1e1!important}.innerDropdownInnerUL li{width:auto!important}#stat_hd{-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;border:1px solid rgba(140,138,137,.25);height:25px;margin-left:-10px;margin-top:8px;position:relative;right:3px;text-align:center;width:25px}.contentButtons,.contentTables{margin-bottom:10px;width:100%}#stat_hd #stat_hd_counter{color:#c2c2c2;line-height:25px;text-align:center}.fullNotification{background-color:#e74c3c!important;border:1px solid #e74c3c!important}.fullNotification p{color:#fff!important}.contentTables tr.contentRowActive a,.contentTables tr.contentRowInactive a{color:#000!important}.contentButtons{clear:both}.contentButtons #createDatabase,.contentButtons #createUser{margin-left:0}.contentTables thead{text-align:left}.contentTables thead tr{background-color:#fff;border-bottom:1px solid #c2c2c2}.contentTables tbody tr:nth-child(odd){background-color:#d9d9d9}.contentTables tbody tr:nth-child(even){background-color:#fff}.contentTables tr.contentRowActive{background-color:#bdcc92!important;font-weight:400}.contentTables .dbThFirst{width:90%}.contentTables .dbThSecond{width:10%}.contentTables td{padding:12px 18px}.contentTables td span{float:right;font-size:22px}.contentTables .collectionThSec{margin-right:0;width:80%}.contentTables .collectionTh{margin-right:0;width:5%}.usermenu{width:40px}.userImg{margin-top:-11px}.userImg .caret{margin-top:13px}.user-menu-img{-moz-border-radius:2px;-webkit-border-radius:2px;border-radius:2px;background-color:#fff;height:25px}.ui-tooltip{background-color:#2ecc71!important;border:0!important;border-radius:3px!important;box-shadow:none!important;color:#fff!important;font-size:10pt!important;font-weight:100!important;z-index:99999999}.tooltip-inner{max-width:300px!important;white-space:normal!important;word-wrap:break-word!important}.arangoDataTable .key,.dashboard-sub-bar .dashboard-sub-bar-title,.dbselection,.subnavmenu .icon,.subnavmenu .info,.subnavmenu .state,div.gv-colour-list li{text-overflow:ellipsis;white-space:nowrap}.index-tooltip{color:#736b68}.index-tooltip:hover{color:#000}.index-tooltip .arangoicon{font-size:18px!important}.tooltipInfoTh{width:10%}.arangoToolbar span.action:hover{background-color:#2ecc71;border-radius:3px;color:#fff;cursor:pointer}.arangoToolbar{background-color:#fff;border:1px solid rgba(140,138,137,.25);height:45px;width:100%}.arangoToolbar .pull-left,.arangoToolbar .pull-right{height:30px;margin-top:8px}.arangoToolbar .pull-left i.positive,.arangoToolbar .pull-right i.positive{color:#2ecc71}.arangoToolbar .pull-left i.warning,.arangoToolbar .pull-right i.warning{color:#f1c40f}.arangoToolbar .pull-left button{margin-left:8px}.arangoToolbar .pull-right button:first-child,.arangoToolbar .pull-right select:first-child{margin-right:6px}.arangoToolbar span{padding:5px 8px;position:relative;top:5px;font-weight:100;margin-left:10px}.arangoToolbar span.clickable{cursor:pointer;margin-left:0;opacity:.5;top:1px}.arangoToolbar span.clickable:hover{opacity:1}.arangoToolbar i{font-size:11pt;font-style:normal}.arangoToolbar i.fa{font-size:12pt;margin-right:5px}.arangoToolbar .toolbarType{background:#5bc0de;border-radius:3px;color:#fff;margin-left:8px}.arangoToolbar .styled-select{width:auto}.arangoToolbarBottom{clear:both}.arangoToolbarBottom #executeQuery{margin-right:8px}.arangoToolbarBottom .button-close:last-child{margin-right:10px}.dbselection{float:left;margin-right:3px;max-width:160px;overflow:hidden}.dbselection .fa{color:#fff;opacity:.3}.dbselection .fa-caret-square-o-down{margin-left:5px}.dashboard-bar-chart-container,.dashboard-full-width-chart .dashboard-full-width-chart-inner,.dashboard-large-chart .dashboard-large-chart-inner,.dashboard-medium-chart,.dashboard-small-chart .dashboard-small-chart-inner,.dashboard-tendency-container{background-color:#fff;border-left:0 solid #000;box-sizing:border-box}.dashboard-bar-chart-container:first-child,.dashboard-full-width-chart .dashboard-full-width-chart-inner:first-child,.dashboard-large-chart .dashboard-large-chart-inner:first-child,.dashboard-medium-chart:first-child,.dashboard-small-chart .dashboard-small-chart-inner:first-child,.dashboard-tendency-container:first-child{margin-left:0}.dashboard-bar-chart-container,.dashboard-full-width-chart,.dashboard-large-chart,.dashboard-medium-chart,.dashboard-small-chart,.dashboard-tendency-container{border:1px solid rgba(64,74,83,.2);margin-left:-1px;margin-top:-2px;position:relative}.dashboard-interior-chart{width:100%!important}.dashboard-interior-chart>div{margin-left:-15px;margin-top:10px}.dashboard-sub-bar-menu{cursor:pointer;position:absolute;right:9px;top:6px}.dataNotReadyYet{color:#f1c40f;font-size:14px;font-weight:100;text-align:center}.dashboard-sub-bar,.dashboard-sub-bar .dashboard-sub-bar-title{font-size:11pt;font-weight:600;text-align:center;text-transform:uppercase}.dashboard-sub-bar{background-color:#fff;color:rgba(0,0,0,.5);height:50px;line-height:24px;margin:0;padding:10px 6px 20px}.dashboard-sub-bar .dashboard-sub-bar-title{color:#000;opacity:.5;overflow:hidden;width:100%}.dashboard-full-width-chart{border:1px solid rgba(104,103,102,.1);border-radius:0;margin-right:12px;width:100%}.dashboard-full-width-chart .dashboard-full-width-chart-inner,.dashboard-large-chart .dashboard-large-chart-inner,.dashboard-small-chart .dashboard-small-chart-inner{border-left:5px solid #fff;border-right:5px solid #fff;border-top:5px solid #fff;padding-bottom:10px}.dashboard-full-width-chart .dashboard-full-width-chart-inner{background-color:#fff;padding-top:12px;width:100%}.dashboard-full-width-chart .dashboard-full-width-chart-inner .dashboard-subtitle-bar.top{border-bottom:1px solid #e1e1e1;height:48px;line-height:48px;text-align:right}.dashboard-full-width-chart .dashboard-full-width-chart-inner .dashboard-interior-chart .inner{margin-left:10px;margin-right:10px}.dashboard-full-width-chart .dashboard-full-width-chart-inner .dashboard-interior-chart .inner table{margin-bottom:10px;margin-top:10px;table-layout:fixed;width:100%}.dashboard-large-chart .dashboard-large-chart-inner .dashboard-interior-chart,.dashboard-medium-chart .dashboard-interior-chart{margin-bottom:0}.dashboard-full-width-chart .dashboard-full-width-chart-inner .dashboard-interior-chart .inner table .no-data{font-style:italic;font-weight:100}.dashboard-full-width-chart .dashboard-full-width-chart-inner .dashboard-interior-chart .inner table tr{border-bottom:1px solid rgba(0,0,0,.025)}.dashboard-full-width-chart .dashboard-full-width-chart-inner .dashboard-interior-chart .inner table td:first-child{width:100px}.dashboard-full-width-chart .dashboard-full-width-chart-inner .dashboard-interior-chart .inner table td:last-child{text-align:right}.dashboard-full-width-chart .state{background-color:#8c8a89;border-radius:5px;color:#fff;font-weight:300;margin-left:5px;padding-left:6px;padding-right:6px}.dashboard-large-chart .dashboard-large-chart-inner{background-color:#fff}.dashboard-small-chart{background:#fff;border-radius:0}.dashboard-small-chart .dashboard-small-chart-inner{background-color:#fff;padding-top:5px}.dashboard-small-chart .dashboard-small-chart-inner .dashboard-interior-chart .nv-bar rect{fill-opacity:.15;stroke-opacity:.8;stroke-width:.5px}.dashboard-medium-chart-outer{border-radius:0}.dashboard-medium-chart{background-color:#fff;margin-bottom:0;padding-top:10px}.dashboard-medium-chart .dashboard-medium-chart-menu{-moz-border-radius:0;-webkit-border-radius:0;border-radius:0;border:0 solid rgba(0,0,0,.3);color:rgba(0,0,0,.3);cursor:pointer;padding:0 4px;position:absolute;z-index:1000}.dashboard-medium-chart .dashboard-medium-chart-menu:hover{color:rgba(0,0,0,.7)}.dashboard-medium-chart .dashboard-medium-chart-inner{padding-bottom:10px}.dashboard-medium-chart .clusterChart .slice path{fill-opacity:.15;stroke-opacity:1;stroke-width:1.5px}.tendency-box-sizing .dashboard-row:last-child .dashboard-medium-chart-outer:last-child{margin-left:-2px}.dashboard-tendency-container{box-sizing:content-box}.dashboard-tendency-container .dashboard-sub-bar{height:46px}.dashboard-tendency-container .dashboard-tendency-chart{background-color:#fff;border-left:5px solid #fff;border-right:5px solid #fff;border-top:5px solid #fff;padding-bottom:5px}.dashboard-tendency-container .dashboard-tendency-chart .dashboard-tendency{background-color:#fff;box-sizing:border-box;margin-top:5px;padding:0;width:50%}.dashboard-tendency-container .dashboard-tendency-chart .dashboard-tendency:first-child{border-right:1px solid #e1e1e1}.dashboard-tendency-container .dashboard-tendency-chart .dashboard-tendency .dashboard-subtitle-bar{border-bottom:1px solid #e1e1e1;box-sizing:inherit;padding-right:11px;text-align:right;width:100%}.dashboard-tendency-container .dashboard-tendency-chart .dashboard-tendency .dashboard-figure{box-sizing:border-box;text-align:center;width:100%}.dashboard-bar-chart-container{background:0 0;border-radius:0;box-sizing:border-box}.dashboard-bar-chart-container .dashboard-sub-bar{padding-bottom:17px;padding-top:13px}.dashboard-bar-chart-container .dashboard-bar-chart{background-color:#fff;border-left:5px solid #fff;border-right:5px solid #fff;border-top:5px solid #fff;padding-bottom:8px;width:auto}.dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-title{margin-top:5px;padding:0 8px;width:100%}.dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-title .percentage{font-weight:400;width:100%}.dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-title .absolut{color:#000;font-weight:500;text-align:center;width:100%}.dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-chart{padding-top:10px}.dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-chart .nv-bar rect{fill-opacity:.6;stroke-opacity:.6;stroke-width:.5px}.dashboard-legend .dashboard-legend-inner{margin-right:25px;padding:10px 5px 5px 0;text-align:right}#dashboardDetailedChart .dygraph-axis-label-y,.dashboardDetailChart .dygraph-axis-label-y,.innerDashboardChart .dygraph-axis-label-y{text-align:left}.dashboard-legend .dashboard-legend-inner span{padding-left:10px}.dashboard-spacer{margin:0 12px}.dashboard-headerbar{margin-bottom:15px;margin-top:10px}.modal-chart-detail .modal-dashboard-legend .dashboard-legend-inner{padding-left:20px}.dashboard-half-height-legend .dashboard-legend-inner{padding-top:20px}.dashboard-title-bar{background-color:#686766;color:#fff;font-size:14.5px;font-weight:400;height:30px;line-height:30px;padding:0 5px 0 10px}.dashboard-title-bar .dashboard-half-title-bar{border-left:1px solid #000;margin-left:-1px;width:50%}.dashboard-title-bar .dashboard-half-title-bar:first-child{border-left:0;margin-left:0}.dashboard-row{margin-bottom:0;margin-left:2px;margin-right:0}.dygraph-axis-label.dygraph-axis-label-x,.dygraph-axis-label.dygraph-axis-label-y{color:#666}#repl-numbers,#repl-progress,#repl-ticks{width:33.3%!important}#repl-numbers .inner,#repl-progress .inner,#repl-ticks .inner{margin-top:0}#replication,#requests,#system{margin-bottom:10px}.dashboardModal{-moz-border-radius:8px!important;-webkit-border-radius:8px!important;border-radius:8px!important;height:80%;margin-left:-45%;min-width:780px;overflow:auto;padding:10px;top:10%;width:90%!important}#dashboardHttpGroup{border:6px solid #000;height:100%;width:100%}#dashboardDetailedChart{border:1px solid #000;height:300px;width:100%}.innerDashboardChart{bottom:5px;left:5px;position:absolute;right:5px;top:5px}.dashboardChart{background-color:#fff;border:1px solid rgba(0,0,0,.2);float:left;height:210px;margin:1.05%;position:relative;width:31%}.dygraph-label.dygraph-title{color:#000;font-size:15px;font-weight:400;text-align:left}#dashboardDetailedLineChart{padding-top:10px}.dashboardDistribution{float:left;width:270px}.dashboardDistribution svg{height:220px;width:250px}.showHotkeyHelp{cursor:pointer}.shortcuts{font-size:14px;font-weight:200}.shortcuts b{border-left:1px solid rgba(0,0,0,.34);margin-left:5px;padding-left:5px}.shortcuts .clearShortcut,.shortcuts b:first-child{border-left:0;margin-left:0;padding-left:0}.loginFixedWindow{background:#649068;height:100%;left:0;position:fixed;top:0;width:100%;z-index:9999}.loginFixedWindow #databases{height:140px}.loginFixedWindow #databases .no-database{background:#fff;border-radius:2px;padding:40px;text-align:center}.loginFixedWindow #databases #logout{margin-top:20px}.loginFixedWindow .resizecontainer{position:relative;top:0}.loginFixedWindow .resizecontainer img{height:33px;margin-left:-6px;margin-top:9px}.login-window{background-color:rgba(255,255,255,.75);border:1px solid rgba(140,138,137,.25);border-radius:3px;height:auto;margin:0 auto;position:relative;top:100px;width:350px;padding:20px 20px 50px}.login-window select{margin-bottom:30px;padding-left:35px;-moz-appearance:none}.login-window .login-logo-round{margin-bottom:25px;margin-top:10px}.login-window .login-logo-round img{display:block;margin:0 auto;width:150px}.login-window .checking-password{box-sizing:border-box;color:rgba(0,0,0,.5);margin-left:-21px;margin-top:-25px;position:absolute;text-align:center;width:100%}.login-window form .fa{color:rgba(0,0,0,.2);float:left;font-size:14pt;left:30px;margin-top:11px;position:absolute}.login-window .wrong-credentials{color:#e74c3c;margin-left:-20px;margin-top:-24px;position:absolute;text-align:center;width:100%}.login-window .login-space{height:50px}.login-window .login-input{background:#f2f2f2!important;border:2px #f2f2f2!important;box-sizing:border-box;font-size:14px;height:40px;margin:0 0 15px;outline:0;padding:10px 10px 10px 35px;width:100%;border-radius:3px}.login-window .form-error{border:2px solid #e74c3c!important}.login-window button{height:40px;width:100%}.query-toolbar{background-color:#f0f0f0;border-bottom:0;border-style:solid;border-width:1px;font-size:20px;height:27px;margin-left:0;margin-right:0}.queryManagementBottomActions button,.querySizeDiv{margin-right:10px}.query-toolbar span:hover{background-color:#e74c3c;color:#fff}.queryBottomActions{border-top:1px solid rgba(140,138,137,.25);padding:10px}.queryExecutionTime{margin-left:10px;margin-top:15px}.queryManagementBottomActions{background-color:#fff;border-bottom-left-radius:3px;border-bottom-right-radius:3px;border-top:1px solid #c2c2c2;height:40px;margin-top:-2px;padding-top:10px}.styled-select{float:right;height:30px;overflow:hidden;width:220px}.styled-select select{background:#fff;border:1px solid #c2c2c2!important;border-radius:0!important;font-size:14px;font-weight:300;height:30px;line-height:1;outline:0;padding:5px;padding-left:5px!important;padding-top:3px!important}.querySizeDiv,.querySizeDiv select{height:30px!important}.styled-select select:focus{outline:0}.querySizeDiv{width:130px!important}.inputEditorWrapper{border-bottom:3px solid rgba(140,138,137,.25)!important;border-left:1px solid rgba(140,138,137,.25);border-right:1px solid rgba(140,138,137,.25);clear:both;height:300px;min-height:300px;width:100%}.inputEditorWrapper .aqlEditorWrapper{border:0!important;border-right:3px solid rgba(140,138,137,.25)!important;float:left;height:100%!important;max-width:85%;min-width:20%;width:70%}.outputEditorWrapper .ace_editor,.outputEditorWrapper .graphContent,.outputEditorWrapper .tableWrapper .arango-table{border-left:1px solid rgba(140,138,137,.25);border-right:1px solid rgba(140,138,137,.25)}.inputEditorWrapper #arangoMyQueriesTable tbody tr{cursor:copy}.inputEditorWrapper .aqlEditorWrapper,.inputEditorWrapper .bindParamEditorWrapper{background-color:#fff;overflow:hidden}.inputEditorWrapper .aqlEditorWrapper .stringtype,.inputEditorWrapper .bindParamEditorWrapper .stringtype{color:#ce2f30}.inputEditorWrapper .aqlEditorWrapper .arraytype,.inputEditorWrapper .aqlEditorWrapper .objecttype,.inputEditorWrapper .bindParamEditorWrapper .arraytype,.inputEditorWrapper .bindParamEditorWrapper .objecttype{color:#00f}.inputEditorWrapper .aqlEditorWrapper .numbertype,.inputEditorWrapper .bindParamEditorWrapper .numbertype{color:#044}.inputEditorWrapper .aqlEditorWrapper .booleantype,.inputEditorWrapper .bindParamEditorWrapper .booleantype{color:#c12dad}.inputEditorWrapper .aqlEditorWrapper table,.inputEditorWrapper .bindParamEditorWrapper table{border-top:0}.inputEditorWrapper .aqlEditorWrapper table tbody,.inputEditorWrapper .bindParamEditorWrapper table tbody{display:block;overflow-y:auto}.inputEditorWrapper .aqlEditorWrapper table .truncate,.inputEditorWrapper .bindParamEditorWrapper table .truncate{opacity:.8;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:30%}.inputEditorWrapper .aqlEditorWrapper table tr.noBgColor,.inputEditorWrapper .bindParamEditorWrapper table tr.noBgColor{background-color:transparent!important}.inputEditorWrapper .aqlEditorWrapper table tr.selected,.inputEditorWrapper .bindParamEditorWrapper table tr.selected{background-color:rgba(125,188,66,.64);color:#fff}.inputEditorWrapper .aqlEditorWrapper table tr.selected .spanWrapper,.inputEditorWrapper .bindParamEditorWrapper table tr.selected .spanWrapper{background-color:rgba(255,255,255,.65)}.inputEditorWrapper .aqlEditorWrapper table tr.selected .fa-comments,.inputEditorWrapper .aqlEditorWrapper table tr.selected .fa-copy,.inputEditorWrapper .bindParamEditorWrapper table tr.selected .fa-comments,.inputEditorWrapper .bindParamEditorWrapper table tr.selected .fa-copy{color:#000}.inputEditorWrapper .aqlEditorWrapper table thead,.inputEditorWrapper .bindParamEditorWrapper table thead{display:block}#clearQuery,.arangoFrame,.display-none{display:none}.inputEditorWrapper .aqlEditorWrapper table td,.inputEditorWrapper .bindParamEditorWrapper table td{height:33px;padding:0 5px;width:50%}.inputEditorWrapper .aqlEditorWrapper table td .spanWrapper,.inputEditorWrapper .bindParamEditorWrapper table td .spanWrapper{border-radius:3px;cursor:auto;float:right}.inputEditorWrapper .aqlEditorWrapper table td .spanWrapper:hover,.inputEditorWrapper .bindParamEditorWrapper table td .spanWrapper:hover{cursor:auto}.inputEditorWrapper .aqlEditorWrapper table td .spanWrapper .fa,.inputEditorWrapper .bindParamEditorWrapper table td .spanWrapper .fa{cursor:pointer;font-size:16pt;margin-left:5px;margin-right:5px}.inputEditorWrapper .aqlEditorWrapper table td .spanWrapper .fa-minus-circle,.inputEditorWrapper .bindParamEditorWrapper table td .spanWrapper .fa-minus-circle{margin-left:20px}.inputEditorWrapper .aqlEditorWrapper table td .spanWrapper .fa-play-circle-o,.inputEditorWrapper .bindParamEditorWrapper table td .spanWrapper .fa-play-circle-o{color:#2ecc71}.inputEditorWrapper .aqlEditorWrapper table td input,.inputEditorWrapper .bindParamEditorWrapper table td input{clear:both;float:right;height:17px;margin-bottom:3px;margin-top:3px;width:auto!important}.inputEditorWrapper .aqlEditorWrapper table th,.inputEditorWrapper .bindParamEditorWrapper table th{font-weight:400;height:34px;padding:0;width:50%}.inputEditorWrapper .aqlEditorWrapper,.inputEditorWrapper .bindParamEditorWrapper{height:100%}.inputEditorWrapper .aqlEditorWrapper table thead tr th,.inputEditorWrapper .bindParamEditorWrapper table thead tr th{text-align:left}.inputEditorWrapper .aqlEditorWrapper table thead tr th:first-child,.inputEditorWrapper .bindParamEditorWrapper table thead tr th:first-child{padding-left:10px}.inputEditorWrapper .aqlEditorWrapper table tbody input,.inputEditorWrapper .bindParamEditorWrapper table tbody input{width:100%!important}.inputEditorWrapper .aqlEditorWrapper .selectError,.inputEditorWrapper .bindParamEditorWrapper .selectError{background:#e74c3c}.inputEditorWrapper .aqlEditorWrapper .aceAction,.inputEditorWrapper .bindParamEditorWrapper .aceAction{background-color:#404a53;border-radius:3px;color:#fff;cursor:pointer;font-size:13pt;height:23px;line-height:23px;opacity:.8;position:absolute;right:5px;text-align:center;top:5px;width:33px;z-index:10}.inputEditorWrapper .aqlEditorWrapper .aceAction.type,.inputEditorWrapper .bindParamEditorWrapper .aceAction.type{font-size:8pt}.inputEditorWrapper .aqlEditorWrapper .aceAction i,.inputEditorWrapper .bindParamEditorWrapper .aceAction i{margin-bottom:3px}.inputEditorWrapper .aqlEditorWrapper .aceAction:hover,.inputEditorWrapper .bindParamEditorWrapper .aceAction:hover{cursor:pointer;opacity:1}.inputEditorWrapper .aqlEditorWrapper .previewWrapper,.inputEditorWrapper .bindParamEditorWrapper .previewWrapper{background-color:#fff}.inputEditorWrapper .aqlEditorWrapper .previewWrapper .previewBar,.inputEditorWrapper .bindParamEditorWrapper .previewWrapper .previewBar{background-color:#fff;border-bottom:1px solid rgba(140,138,137,.25);height:34px}.inputEditorWrapper .aqlEditorWrapper .previewWrapper .previewBar span,.inputEditorWrapper .bindParamEditorWrapper .previewWrapper .previewBar span{margin-left:5px;padding-top:8px;position:absolute}.inputEditorWrapper .aqlEditorWrapper .previewWrapper #queryPreview,.inputEditorWrapper .aqlEditorWrapper>div,.inputEditorWrapper .bindParamEditorWrapper .previewWrapper #queryPreview,.inputEditorWrapper .bindParamEditorWrapper>div{height:100%}.inputEditorWrapper .ui-resizable-s{cursor:ns-resize}.inputEditorWrapper .ui-resizable-e{cursor:ew-resize}.queryContent{clear:both;margin-top:0;width:100%}.queryContent .arangoToolbar .fa.fa-star,.queryContent .arangoToolbar .fa.fa-star-o{color:#ff0}.outputEditors{margin-bottom:60px}.outputEditorWrapper{clear:both;height:100px;padding-top:20px;width:100%}.outputEditorWrapper .tableWrapper{max-width:100%;overflow-x:scroll}.outputEditorWrapper .outputTable{margin-right:-2px}.outputEditorWrapper .graphContent{margin-right:-2px;margin-top:0}.outputEditorWrapper .switchAce{background-color:#404a53;border-radius:3px;color:#fff;cursor:pointer;position:relative;right:-24px;top:45px;z-index:10}.outputEditorWrapper .switchAce span{margin-left:0;padding:0 8px;top:0}.outputEditorWrapper .switchAce span.active{color:#2ecc71}.outputEditorWrapper .switchAce span.disabled{cursor:not-allowed}.outputEditorWrapper .ace_editor{height:280px;width:100%}.outputEditorWrapper .ace_editor .ace_active-line{background:#fff!important}.outputEditorWrapper .sentWrapper .pull-left,.outputEditorWrapper .sentWrapper .pull-right{width:50%}#queryManagementContent{border:1px solid rgba(140,138,137,.25);padding-top:0}#queryManagementContent .arango-table{border:0}#queryManagementContent .arango-table tr th:nth-child(1){width:10%}#queryManagementContent .arango-table tr th:nth-child(1) td{text-align:center}#queryManagementContent .arango-table tr th:nth-child(2){width:50%}#queryManagementContent .arango-table tr th:nth-child(3),#queryManagementContent .arango-table tr th:nth-child(4){width:20%}.contentBar{font-size:12pt;line-height:30px}.noContent{background-color:#fff;padding:50px}.noContent p{font-size:12pt;font-weight:100;text-align:center}.row{margin:0 0 20px}.innerContent{background-color:#fff;border:1px solid rgba(140,138,137,.25);border-radius:2px;min-height:200px;padding-top:13px}.arangoFrame{background-color:rgba(0,0,0,.5);bottom:0;left:0;position:fixed;right:0;top:0;z-index:77777}.arangoFrame .outerDiv{min-height:100%;padding:20px 40px 40px;z-index:88888}.arangoFrame .innerDiv{margin-top:25px;z-index:99999}.arangoFrame .fa-times{color:#fff;float:right;font-size:12pt}.arangoFrame .fa-times:hover{color:#c2c2c2;cursor:pointer}.arangoFrame .document-content-div,.arangoFrame .document-info-div{left:40px;position:absolute;right:40px}.arangoFrame .document-content-div{bottom:80px;top:130px}.arangoFrame .document-editor{height:100%}.arangoFrame .bottomButtonBar{left:-1px;position:absolute;right:-1px}.container{margin-left:20px;margin-right:20px;width:auto!important}.arango-tab{border-bottom:1px solid #ddd;list-style:none;margin-left:0;padding-bottom:0;padding-right:10px}.arango-tab a{-moz-border-radius:0;-webkit-border-radius:0;border-radius:3px 3px 0 0;background-color:#8c8a89;border:1px solid transparent;border-bottom-color:#888;color:#fff;display:block;font-size:13px;line-height:20px;margin-right:2px;min-width:50px;padding:2px 15px;text-align:center}.arango-tab li{background-color:transparent;border:0;margin-bottom:-1px;margin-left:2px;position:relative;z-index:900}.arango-tab li.active a{background:#fff;border-bottom-color:#fff!important;border-left-color:#c2c2c2;border-right-color:#c2c2c2;border-top-color:#c2c2c2;color:#000;height:21px;margin-top:-1px}.jsoneditor,.jsoneditor .menu{background-color:#fff!important}.jsoneditor{border:0 solid rgba(0,0,0,.2)!important}.jsoneditor .menu{border-bottom:1px solid #c2c2c2!important;border-left:0!important;border-right:0!important;border-top:0!important}.jsoneditor .menu button{border:0!important}.jsoneditor .menu button:hover{background-color:#2ecc71;color:#fff}.jsoneditor .search .frame{border:0!important;margin:3px!important}.jsoneditor .search .frame .refresh{background-position:-96px -73px;height:22px;width:25px}.jsoneditor .search .frame input{margin-left:15px;margin-right:15px;margin-top:0}.jsoneditor .search .results{color:#fff!important;margin-top:3px!important}.document-editor-extra{margin-top:10px}.document-editor{margin-top:-10px;width:100%}.disabledPag,.disabledPag a{cursor:default!important;opacity:.5!important}.pagination-line{background-color:#fff;border-bottom-left-radius:2px;border-bottom-right-radius:2px;border-top:1px solid rgba(104,103,102,.1);margin:0;padding-top:12px;text-align:center}.pagination-line li a:hover,.pagination-line li.active a,.pagination-line li.active span{background-color:#404a53;color:#fff}.pagination-line li a{background-color:#fff;border:1px solid #fff;font-size:11.9px;line-height:20px;padding:2px 10px;text-decoration:none;border-width:0;min-width:12pt}.pagination-line ul{-moz-border-radius:2px;-webkit-border-radius:2px;border-radius:2px;display:inline-block;margin-bottom:0;margin-left:0}.pagination-line li{display:inline-block;margin-left:11px}.pagination-line li span{color:#000;font-size:14px;position:relative;top:2px}.pagination-line li:first-child a,.pagination-line li:first-child span,.pagination-line li:last-child a,.pagination-line li:last-child span{-webkit-box-shadow:0;-moz-box-shadow:0;box-shadow:0;background:#404a53;border:0;color:#fff;height:21px;position:relative;width:14px}.pagination-line li.disabled:first-child a,.pagination-line li.disabled:first-child span,.pagination-line li.disabled:last-child a,.pagination-line li.disabled:last-child span{background-color:#777;color:#666;cursor:default;pointer-events:none}.collection-pagination{margin-left:23px!important}.arango-pagination i.fa,.las-pagi i.fa,.pre-pagi i.fa{font-size:19px;position:relative;top:-2px}.arango-pagination li:first-child{margin-right:20px}.arango-pagination li:last-child{margin-left:30px}.pre-pagi{margin-right:-5px!important}.accordion-group{border:0}.accordion-body{height:auto!important}.accordion-heading{padding-bottom:20px;padding-top:25px}.accordion-heading a{border:1px solid #ccc;color:#000;font-weight:400;width:397px!important}.accordion-heading .accordion-toggle{border-radius:3px;box-sizing:border-box;display:block;padding:8px 15px;width:100%!important}.shell_workspace{margin-top:13px}.shell_workspace ::-webkit-scrollbar{display:none}.replShell{background-color:#fff;float:left;height:100%;min-width:100px;overflow-y:hidden;position:relative;width:100%}.replShell>div{border-radius:3px}.replShell pre{border-bottom:0;border-left:0;border-right:1px solid #a0a0a0;border-top:1px solid #a0a0a0}.jqconsole{background-color:#000;border-radius:0;padding:10px}.jqconsole-header{color:#fff}.jserror{color:#f06;margin-left:-10px}.jssuccess{color:#6f0}.jqconsole-cursor{background-color:grey}.jqconsole-blurred .jqconsole-header .jqconsole-cursor{color:#c4cccc}.jqconsole-prompt{color:#b91}.jqconsole-old-prompt{color:#f60;font-weight:400}.jqconsole-input{color:#dd0}.jqconsole-old-input{color:#bb0;font-weight:400}.jqconsole-output{color:#fff}.query-output .ace_gutter-cell{background-color:#f0f0f0}.centralContent .api-actions{margin:0!important;padding:0}.centralContent .api-actions .container{padding-bottom:10px!important;padding-top:13px!important;margin:0 5px!important}.centralContent .api-actions .resource{border-bottom:0!important;padding-left:5px!important}.centralContent .api-actions .resource .heading>.options{margin:11px 10px 0 0!important}.centralContent .api-actions .resource .heading h2 a{color:#000!important;font-weight:300!important}.centralContent .api-actions .active .heading h2 a{color:#000!important}.centralContent .api-actions .endpoint .operations .content{margin:0!important}.centralContent .api-actions .endpoint .operations .content h4{font-weight:700!important}.centralContent .api-actions .endpoints{margin-right:5px!important}.centralContent .api-actions .endpoints .endpoint:last-child{padding-bottom:5px!important}.centralContent .api-actions input[type=button]{background:#8f8d8c!important;border:none!important;box-shadow:none!important;color:#fff!important;float:right!important;font-size:14px!important;font-weight:300!important;margin-top:10px!important;padding:8px 16px!important}.centralContent .api-actions .endpoint .operations .content,.centralContent .api-actions .endpoint .operations .heading{border-radius:0!important;font-weight:300!important}.centralContent .api-actions .http_method,.centralContent .api-actions .toggleOperation{border-radius:0!important}.centralContent .api-actions .required,.centralContent .api-actions em,.centralContent .api-actions strong{font-weight:400!important}.form-actions{background:0 0;border:0}.form-actions:after,.form-actions:before{display:table;line-height:0}.form-actions:after{clear:both}.swagger-section #swagger-ui-container{margin:.3em 1em!important}.alert{padding:15px 35px 15px 14px}.alert,textarea{border-radius:0!important}.log-content{word-wrap:break-word}.tab-content{min-height:390px}.crit-table-id,.debug-table-id,.info-table-id,.log-table-id,.warn-table-id{border-spacing:0 0;font-size:15px!important;margin-top:-5px!important}.crit-table-id thead,.debug-table-id thead,.info-table-id thead,.log-table-id thead,.warn-table-id thead{background-color:#f9f9f9;border-top:6px solid #888!important;text-align:center}.crit-table-id thead tr th,.debug-table-id thead tr th,.info-table-id thead tr th,.log-table-id thead tr th,.warn-table-id thead tr th{background-color:#fff!important;border-bottom:1px solid #c2c2c2;border-top:2px solid #888}.crit-table-id .firstcol,.debug-table-id .firstcol,.info-table-id .firstcol,.log-table-id .firstcol,.warn-table-id .firstcol{cursor:default!important;max-width:80px!important;width:80px!important}.crit-table-id tbody .firstcol,.debug-table-id tbody .firstcol,.info-table-id tbody .firstcol,.log-table-id tbody .firstcol,.warn-table-id tbody .firstcol{background-color:transparent!important}.crit-table-id tbody tr td,.debug-table-id tbody tr td,.info-table-id tbody tr td,.log-table-id tbody tr td,.warn-table-id tbody tr td{padding-bottom:8px!important;padding-top:8px!important}.thirdcol{cursor:default!important;max-width:500px!important}.dataTables_empty,.seccol{cursor:default!important;margin-bottom:5px;width:100px!important}.dataTables_info{display:none}#arangoLogTable{border-top:0}#arangoLogTable tbody tr{height:40px}#arangoLogTable tbody td:nth-child(1){text-align:center;width:70px}#arangoLogTable tbody td:nth-child(2){text-align:center;width:150px}#arangoLogTable tbody td:nth-child(3){width:auto}.log-content-id{padding-bottom:0!important;padding-top:0!important}.log-content-id .dataTable{border-collapse:separate;border-spacing:0 5px;table-layout:fixed!important}.log-content-id .arango-tab{border-bottom:0!important}.log-content-id .tab-content{margin-top:1px!important}.log-content-id .arango-tabbar{left:0;margin-top:-51px;position:absolute}.log-content-id .arango-tabbar button{background-color:#fff;border:0;color:#000;float:left;font-size:10.5pt;min-width:60px;opacity:.64;outline:0;padding-left:0;padding-right:0;text-align:center;width:auto}.log-content-id .arango-tabbar button.arango-active-tab{border-bottom:2px solid #77cb99;font-weight:400;height:35px;opacity:1;padding-bottom:9px}.collectionInfoTh2,.collectionTh,.figuresHeader th{font-weight:400!important}div.gv_zoom_widget{height:300px;left:62px;opacity:.7;position:absolute;top:0;width:40px;z-index:1}div.gv_zoom_widget div.gv_zoom_buttons_bg{background-image:url(../img/gv_button_bg_reverse.png);background-size:contain;height:40px;margin-bottom:20px}div.gv_zoom_widget div.gv_zoom_slider{background:#f5f8f0;border-radius:3px;height:200px;margin:0 17px;width:4px}div.gv_zoom_widget a.ui-slider-handle{background-color:#555;border:1px solid rgba(140,138,137,.25);height:.5em;left:-.55em;outline:0}div.gv_zoom_widget a.ui-slider-handle.ui-state-hover{outline-color:#fff}.documents-size,.spotlightWrapper .typeahead:focus{outline:transparent 0}div.gv_zoom_widget a.ui-slider-handle:hover{cursor:pointer}div.gv_zoom_widget .ui-state-default{background:#f6f6f6}#menubar{margin:0 0 10px}div.gv_colour_list{max-height:680px;overflow:auto;position:absolute;right:26px;text-align:right;top:20px;z-index:1}div.gv_colour_list li{background-color:transparent;float:none;padding:2px 6px}svg.graph-viewer{background-color:#fff;border:1px solid rgba(140,138,137,.25);border-radius:3px;left:54px;position:absolute;top:-10px;z-index:0}div.gv-colour-list ul ul,div.gv-colour-list ul ul:first-child,div.gv-colour-list ul ul:last-child{border-left:1px solid rgba(104,103,102,.1);border-right:1px solid rgba(104,103,102,.1)}svg.graph-viewer text{max-width:90px;pointer-events:none}div.gv-background{position:relative}.link>line{stroke-width:1}div.gv-colour-list:hover{opacity:1}div.gv-colour-list{border-radius:3px;max-height:350px;max-width:300px;min-width:190px;opacity:.1;overflow-x:hidden!important;overflow-y:auto;position:absolute;right:8px;text-align:right;top:0;z-index:1}div.gv-colour-list li{float:none;overflow:hidden;padding:2px 6px}div.gv-colour-list ul ul:first-child{border-top:1px solid rgba(104,103,102,.1);border-top-left-radius:3px;border-top-right-radius:3px}div.gv-colour-list ul ul:last-child{border-bottom:1px solid rgba(104,103,102,.1);border-bottom-left-radius:3px;border-bottom-right-radius:3px}#tab-content-create-graph .addAfter,#tab-content-create-graph .addDelete,#tab-content-create-graph .delete{margin-top:-9px;position:absolute;right:13px}#tab-content-create-graph .tableRow.first{border-top:10px solid #fff}.graphContent{margin-top:3px}.graphContent #graph-container{background-color:#fff;z-index:5}.graphContent #graph-container:-webkit-full-screen{height:100%!important;width:100%!important}.graphContent #graph-container:-moz-full-screen{height:100%!important;width:100%!important}.graphContent #graph-container:-ms-full-screen{height:100%!important;width:100%!important}.graphContent #graph-container:-o-full-screen{height:100%!important;width:100%!important}.graphContent #graph-container:full-screen{height:100%!important;width:100%!important}.graphContent .fa.fa-desktop{margin-top:6px;position:absolute;right:20px;z-index:10}.nodeContextMenu,.nodeInfoDiv{position:fixed}.nodeInfoDiv{left:175px;overflow:hidden;top:130px;z-index:10}.nodeInfoDiv pre{background-color:rgba(64,74,83,.9);border-radius:2px;color:#fff;max-height:400px;max-width:330px;overflow:hidden}.nodeContextMenu svg #wheelnav-nodeContextMenu-title-0{transform:translate(24px,14px) scale(.7)!important}.nodeContextMenu svg #wheelnav-nodeContextMenu-title-0,.nodeContextMenu svg #wheelnav-nodeContextMenu-title-1,.nodeContextMenu svg #wheelnav-nodeContextMenu-title-2,.nodeContextMenu svg #wheelnav-nodeContextMenu-title-3{fill:#fff}.nodeContextMenu svg #wheelnav-nodeContextMenu-title-0:hover,.nodeContextMenu svg #wheelnav-nodeContextMenu-title-1:hover,.nodeContextMenu svg #wheelnav-nodeContextMenu-title-2:hover,.nodeContextMenu svg #wheelnav-nodeContextMenu-title-3:hover{fill:#2ecc71}#graphSettingsView{background-color:rgba(64,74,83,.9);border:0;border-radius:0;height:100%;overflow-y:scroll}#graphSettingsView button{margin-bottom:125px}#graphSettingsView select{width:222px}#graphSettingsContent{height:100%;max-width:50%;min-width:400px;position:fixed;right:-1px;top:103px;width:400px}#graphSettingsContent .pure-g{font-size:10pt}#graphSettingsContent .pure-g input,#graphSettingsContent .pure-g select{color:#000}#graphSettingsContent .pure-g .left{color:#fff;height:40px}#graphSettingsContent .pure-g .pure-u-1-3{line-height:30px}#graphSettingsContent .pure-g .pure-u-2-3{text-align:right}#graphSettingsContent .pure-g .heading{border-bottom:1px solid #fff;height:10px;margin-bottom:15px}#graphSettingsContent .pure-g .rangeLabel{float:left;margin-left:4px;margin-top:5px;position:relative}#graphSettingsContent .pure-table{padding-left:10px;padding-right:10px}div.gv-manage-button-container{margin-top:10px}legend.gv-inner{font-size:16px}input.gv-radio-button{display:block;margin-top:3px;width:auto}.addCollection .accordion,.collectionTh textarea{margin-top:10px}.collectionTh{font-size:14px;text-align:left;width:20%!important}.collectionInfoTh{min-width:60px;text-align:left;width:320px}.addCollection table tr{border-bottom:0!important;height:53px}.addCollection .icon_arangodb_info{margin-left:20px!important;position:relative;top:2px!important}.addCollection .collectionThSec{width:320px!important}.addCollection .collectionTh{width:96px}.addCollection .modalInput{width:320px}.addCollection .modalSelect{width:334px}.addCollection .accordion-toggle{width:457px!important}.change-collection .tab-content{min-height:230px}.change-collection input{width:384px!important}.change-collection select{width:398px!important}.show-collection .tab-content{min-height:200px}.collectionInfoTh2{text-align:left;width:150px}.collection-info-figures table{float:left;margin-left:0;margin-right:0;margin-top:0;min-width:200px;padding:3px;text-align:left}.figuresHeader{border-bottom:1px solid #c2c2c2}#collectionIndexTable{margin-left:0;width:100%}#collectionTab,#graphTab,#infoTab{border-bottom:0;margin-bottom:1px;padding-bottom:0;padding-right:10px}#collectionTab li,#graphTab li,#infoTab li{float:right}#collectionTab li.disabled a,#graphTab li.disabled a,#infoTab li.disabled a{cursor:not-allowed}#collectionTab a,#graphTab a,#infoTab a{background-color:#404a53;border-bottom:1px solid #666;border-top-left-radius:3px!important;border-top-right-radius:3px!important;color:#fff;font-size:13px!important;height:21px;margin-bottom:-1px;margin-right:4px;padding:2px 15px!important}#collectionTab .active>a,#graphTab .active>a,#infoTab .active>a{background-color:#fff;border-color:#888 #888 transparent!important;color:#000}#confirmCreateEdge{margin-left:20px}.collection-info-figures .icon_arangodb_info{position:relative!important;right:-4px!important}.snippet-wrap .snippet-num li{list-style:decimal-leading-zero}.snippet-no-num{list-style-type:none;margin-left:0;padding-left:0}.snippet-no-num .prettify{font-size:1.2em}.snippet-no-num .sh_number{color:#044;font-weight:100;margin-left:5px}.snippet-no-num .sh_symbol{color:#00f;font-weight:100;margin-left:5px}.snippet-no-num .sh_cbracket{color:#c7a317;font-weight:100;margin-left:5px}.snippet-no-num .sh_keyword{color:#c12dad;font-weight:100;margin-left:5px}.snippet-no-num .sh_string{color:#ce2f30;font-weight:100;margin-left:5px}.snippet-no-num .sh_array,.snippet-no-num .sh_object{color:#00f;font-weight:100;margin-left:5px}@media (max-height:490px){.social-icons{display:none}#navigationBar{overflow:scroll;overflow-x:hidden!important}}@media (max-height:525px){.navlogo .version,.shortcut-icons{display:none}}@media (max-width:568px){#arangoLogTable .table-cell0,.breadcrumb,.document-info-div .search,.navlogo .big,.pagination-line .las-pagi,.pagination-line .pre-pagi,.social-icons{display:none}.nodeInfoDiv{left:65px}.pagination-line .arango-pagination li:first-child,.pagination-line .arango-pagination li:last-child{margin-left:0;margin-right:0}.pagination-line li a{padding:2px 4px}.login-window{padding:10px 10px 40px;width:300px}#repl-numbers,#repl-progress,#repl-ticks{width:100%!important}.dashboard-large-chart,.dashboard-medium-chart-outer:first-child{padding-right:0!important}div.dropdownInner ul label{font-size:13px}.subnavmenu a{font-size:8pt}.subViewNavbar li{font-size:8pt!important;padding:0 6px!important}.subViewNavbar li.active{height:35px}.small-label-padding{max-width:calc(100% - 2px)}.navlogo .small{display:block;height:auto;width:28px}.headerButtonBar,.navlogo .version,.primary .version,.shortcut-icons{display:none}.navbar,.navlist,.navlist li,.navmenu,.primary,.primary li{width:40px!important}.arango-collection-ul .tab{font-size:12pt;height:30px;overflow:hidden}.arango-collection-ul .tab .fa{padding-left:6px;padding-right:20px}.social-icons p{float:left;margin-left:-3px}.social-icons p .fa{font-size:16px}.footer,div.bodyWrapper{left:40px}.dashboard-bar-chart-container .dashboard-bar-chart{padding-bottom:11px}}@media (max-width:768px){.breadcrumb,.outputEditors .additional,.pagination-line .las-pagi,.pagination-line .pre-pagi{display:none}.hide-small{visibility:hidden}.pagination-line .arango-pagination li:first-child,.pagination-line .arango-pagination li:last-child{margin-left:0;margin-right:0}.pagination-line li a{padding:2px 4px}.dashboard-large-chart,.dashboard-tendency-container{box-sizing:content-box}.tendency-box-sizing .dashboard-bar-chart-container,.tendency-box-sizing .dashboard-row:last-child .dashboard-medium-chart-outer:last-child,.tendency-box-sizing .dashboard-tendency-container{margin-left:0}.tendency-box-sizing .dashboard-bar-chart-container{height:140px}.tendency-box-sizing .dashboard-bar-chart-container .dashboard-sub-bar{margin-top:-3px}}@media (min-width:569px) and (max-width:738px){.dashboard-large-chart,.dashboard-medium-chart-outer:first-child{padding-right:0!important}.document-info-div .search,.headerButtonBar span{display:none}.dashboard-bar-chart-container{padding-left:0!important;padding-right:0!important}#repl-numbers,#repl-progress,#repl-ticks{width:100%!important}.subnavmenu a{font-size:9pt}.collection-dropdown ul{width:auto!important}.arango-collection-select{display:inline-block}.dashboard-bar-chart-container .dashboard-bar-chart{padding-bottom:11px}}@media (min-width:770px) and (max-width:972px){.dashboard-tendency-container .dashboard-sub-bar{font-size:11px;height:32px;margin-bottom:10px;margin-top:-10px}.dashboard-small-chart .dashboard-sub-bar{font-size:11px;height:33px}.dashboard-small-chart .dashboard-sub-bar-title{font-size:11px;line-height:12px;margin-top:-12px}.dashboard-bar-chart-chart{margin-top:10px}.dashboard-bar-chart-container .dashboard-sub-bar{font-size:11px;margin-bottom:10px;margin-top:-16px;padding-top:18px}.dashboard-bar-chart-container .dashboard-bar-chart .dashboard-bar-chart-title .absolut{padding-top:3px}}@media (min-width:973px){.dashboard-large-chart .dashboard-sub-bar{padding-top:14px}#dataTransferDistribution .nvd3-svg,#totalTimeDistribution .nvd3-svg{padding-top:20px}#requests .small-label-padding .dashboard-small-chart .dashboard-sub-bar{font-size:12px;padding-top:30px}#requests .small-label-padding:last-child .dashboard-small-chart .dashboard-sub-bar{margin-bottom:1px}}@media (max-width:1024px){#docsSort{display:none}}.document-info-div{min-height:0}.document-content-div{margin-top:10px}.document-info{background-color:#fff;border-radius:3px;margin-bottom:8px;margin-top:-13px;min-height:65px;padding:5px}.document-info .document-info-container{clear:both;width:100%}.document-info .document-info-container .document-inner-info-container{float:left;margin-left:10px;margin-top:5px}.document-info .document-info-container .document-inner-info-container .document-attribute{margin-right:20px}.document-info .document-info-container .document-inner-info-container .document-attribute div{float:left}.document-info .document-bold-font{min-width:55px}.document-info .document-thin-font{color:#2ecc71}.document-info .document-type-container div{float:left}.document-info .document-type-container #document-id{margin-left:10px}.document-link:hover{cursor:pointer;text-decoration:underline}.jsoneditor .tree div{font-size:11pt}#progressPlaceholder{background-color:rgba(0,0,0,.4);bottom:0;left:0;position:fixed;right:0;top:0;z-index:9999}.progress-view{background-color:#363c39;border-radius:2px;color:#fff;height:188px;left:50%;margin:-150px 0 0 -125px;position:absolute;top:38%;width:250px}.progress-view .progress-content{border:5px solid #fff;border-radius:3px}.progress-view .progress-content .fa-spinner{font-size:100pt}.progress-view .progress-message{background-color:#fff;border-radius:0 0 2px 2px;color:#fff;font-weight:200;height:44px;margin-top:-25px;padding-top:3px;text-align:center}.progress-view .progress-text{background:#fff;color:#000;float:left;font-weight:100;height:25px;left:-5px;margin-left:5px;margin-top:10px;position:relative;top:-10px;width:100%}.progress-view .progress-action{float:right;margin-right:5px;margin-top:5px}#progressPlaceholderIcon{color:#2ecc71;float:left;font-size:22px;margin-left:10px;margin-top:7px}.pong-spinner{height:100px;margin:50px auto;position:relative;width:200px}.pong-spinner i{animation:ball 2s infinite linear;background:#8cdb8b;border-radius:10px;height:10px;position:absolute;width:10px}.pong-spinner:after,.pong-spinner:before{animation:left-player 2s infinite linear;background:#8cdb8b;height:30px;position:absolute;width:5px}.pong-spinner:after{animation:right-player 2s infinite linear;right:0}@keyframes left-player{0%,100%{top:0}50%{top:70px}}@keyframes right-player{0%,100%{top:70px}50%{top:0}}@keyframes ball{0%,100%{left:5px;top:20px}25%,75%{left:190px;top:50px}50%{left:5px;top:80px}}#spotlightPlaceholder{background-color:rgba(0,0,0,.25);bottom:0;left:0;position:fixed;right:0;top:0;z-index:2000}.spotlightWrapper{height:50px;left:25%;position:absolute;top:115px;width:50%}.spotlightWrapper .twitter-typeahead{width:100%}.spotlightWrapper .tt-highlight{color:#5bc0de;font-weight:400}.spotlightWrapper input{box-sizing:border-box;height:40px!important}.spotlightWrapper .tt-dataset{clear:both}.spotlightWrapper .tt-menu{background:#3d4246;border-radius:3px;color:#fff;height:300px;overflow:auto;width:100%}.spotlightWrapper .tt-menu .tt-suggestion:hover{background-color:#404a53;cursor:pointer}.spotlightWrapper .tt-menu .header-type{background:#32373b;clear:both;color:#fff;height:30px;padding-left:5px}.spotlightWrapper .tt-menu .header-type h4{float:left;margin:4px 0 0;padding:0}.spotlightWrapper .tt-menu .header-type .fa{font-size:12pt;margin-left:6px;margin-top:6px}.spotlightWrapper .tt-menu .header-type .type{background-color:#5bc0de;border-radius:3px;float:right;margin:4px;padding:0 5px}.spotlightWrapper .tt-menu .tt-cursor{background-color:#fff;color:#000}.spotlightWrapper .tt-menu .tt-selectable{padding-left:10px}.spotlightWrapper .typeahead{background:#3d4246;border:0 solid #3d4246;-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;color:#fff;font-size:22px;height:30px;line-height:30px;outline:transparent 0;padding:8px 12px;width:100%}.graphLabel{font-size:11pt;font-weight:600;margin-top:-25px;opacity:.5;padding-bottom:20px;text-align:center;text-transform:uppercase}.cluster-graphs>div .graphWrapper{border:1px solid rgba(140,138,137,.25);margin-left:-1px;margin-top:-1px;padding:20px 20px 10px}.cluster-graphs>div .graphWrapper .nv-controlsWrap{display:none}.cluster-graphs>div .graphWrapper .nv-legendWrap{margin-bottom:10px}.cluster-graphs>div .graphWrapper svg{height:250px;margin-left:-17px}.cluster-values{margin-top:-13px}.cluster-values>div .valueWrapper{border:1px solid rgba(140,138,137,.25);margin-left:-1px;margin-top:-1px}.cluster-values>div .valueWrapper .value{color:#000;font-size:24pt;line-height:150px;text-align:center}.cluster-values>div .valueWrapper .value.positive{color:#2ecc71}.cluster-values>div .valueWrapper .value.warning{color:#f1c40f}.cluster-values>div .valueWrapper .value.negative{color:#e74c3c}.cluster-values>div .valueWrapper div:first-child{height:150px}.application-detail-view .headerBar .subMenuEntries{margin-left:5px;margin-top:-2px}.application-detail-view .headerBar .headerButtonBar{position:absolute;right:5px}.application-detail-view section.info{float:left;padding:13px 0 0}.application-detail-view section.info .header{height:200px;margin-bottom:0;position:absolute;width:calc(100% - 20px)}.application-detail-view section.info .header div.header-icon-container{border:2px solid #d9dbdc;border-radius:150px;height:182px;left:0;margin:0 auto;overflow:hidden;width:182px}.application-detail-view section.info .header div.header-icon-container img.icon{background-color:#fff;border-radius:3px;box-sizing:border-box;height:100%;padding:10px;width:100%}.application-detail-view section.info .header .information{background-color:#fff;border:1px solid #d9dbdc;border-radius:3px;margin-bottom:20px;padding:10px 10px 0;position:relative;top:35px;width:calc(100% - 30px)}.application-detail-view section.info .header .information span{display:block;float:left;font-weight:500;width:90px}.application-detail-view section.info .header .information a{margin-right:10px}.application-detail-view section.info .header .header_right{left:190px;margin:40px auto 0;width:137px}.application-detail-view section.info .header .header_right input.delete,.application-detail-view section.info .header .header_right input.switch-docu,.application-detail-view section.info .header .header_right input.switch-mode,.application-detail-view section.info .header .header_right input.upgrade{margin-top:7.83px;padding-left:10px;padding-right:10px}.application-detail-view section.info .header .header_right input{width:130px}.application-detail-view section.info .header .header_left{margin:0 auto;padding-left:10px;padding-top:1px;text-align:center;width:33.3%}.application-detail-view section.info .header .header_left input{margin-left:0;margin-top:-4px}.application-detail-view section.info .header .header_left .header_line{margin-top:10px}.application-detail-view section.info .header .header_left .header_line p{font-size:14pt;font-weight:200}.application-detail-view section.info .header .header_left .header_line h3{float:left;margin-bottom:0;margin-top:0;padding-right:5px;width:100%}.application-detail-view section.info .header .header_left .header_line .license,.application-detail-view section.info .header .header_left .header_line .mode,.application-detail-view section.info .header .header_left .header_line .version{-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;background-color:#404a53;border:1px solid rgba(140,138,137,.25);color:#fff;font-size:13px;font-weight:300;padding:2px 8px;position:relative;top:-3px}.application-detail-view section.info .header .header_left .header_line .production{color:#2ecc71}.application-detail-view section.info .header .header_left .header_line .development{color:#f1c40f}.application-detail-view section.info .header .header_left .header_line:after{clear:both;content:'';display:table}.application-detail-view section.info .header .header_left .header_line_bottom>div{display:table;left:-3px;margin:-10px auto 0;position:absolute;width:100%}.application-detail-view section.info .header .header_left .header_line_bottom h3{width:auto}.application-detail-view section.info .header .header_left .header_line_bottom .inner{display:table;margin:0 auto;padding-left:15px;width:auto}.application-detail-view section.info .header .app-warning{-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;background:#e74c3c;color:#fff;padding:6px 8px}.application-detail-view section.info .header .app-warning h4,.application-detail-view section.info .header .app-warning p{font-size:1em;margin:0}.application-detail-view aside.meta{background-color:#fff;border:1px solid rgba(140,138,137,.25);border-radius:3px;clear:right;float:right;height:182px;margin-top:12px;max-height:182px;max-width:182px;overflow-x:hidden;position:relative;width:182px}.application-detail-view aside.meta dl{margin-bottom:0;margin-top:0;padding-left:7px;padding-top:5px}main{background-color:#fff;border-radius:3px}main .app-info{-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;background:#5bc0de;color:#fff;margin:10px;padding:6px 8px}main .app-info h4,main .app-info p{font-size:1em;margin:0}main .swagger iframe{border:0;border-radius:3px;height:100%;width:100%}main .readme{background:#fff;padding:1em 2em}main .readme .buttons{background:#fff;height:30px;position:relative;right:-15px;width:100%}.centralContent .contentIn table tr,.centralContent .modal-body .arango-table tr,.centralContent .modal-body table tr{height:40px}main .readme .buttons button{float:right}main .readme .modal-body{border-bottom:1px solid rgba(140,138,137,.25);border-left:0;border-right:0;border-top:0;padding-bottom:15px}main .readme .modal-footer{border-bottom:0;border-left:0;border-right:0;border-top:1px solid rgba(140,138,137,.25);padding-right:0}main .readme h1{float:left;text-align:left;width:100%}.tests-result .stack{border-color:#e74c3c;color:#e74c3c;font-size:12px;line-height:1.5;margin:5px 0}.tests-result-stats .fail,.tests-result-stats .pass,.tests-result-stats .pending{padding:0 2px}.tests-result-spec{margin-bottom:0}.tests-result-spec-suites .tests-result-spec-suites{margin-left:20px}.tests-result-spec-suites dd{margin-bottom:20px;margin-left:0}.tests-result-spec-tests{margin-left:20px}.tests-result-spec-test-title{padding-left:20px}.tests-result-spec-test-title .fa{line-height:18px;margin-left:-20px;margin-top:2px;position:absolute}.tests-result-spec-test-title .fa-circle{font-size:50%;margin-left:-16px}.tests-result .pass{color:#2ecc71}.tests-result .fail{color:#e74c3c}.tests-result .pending{color:#666}#swagger #jsonLink{color:rgba(64,74,83,.8);font-weight:500;opacity:.5;position:absolute;right:33px;z-index:99}#swagger #jsonLink:hover{cursor:pointer;opacity:1}#indexHeaderContent{padding:0}#indexHeaderContent #collectionEditIndexTable th,#indexHeaderContent .figuresHeader th{padding-left:10px}.new-index-view{padding:20px}.centralContent .createModalDialog{background-color:#fff;outline:0}.centralContent .contentIn{background:#fff;border:1px solid rgba(64,74,83,.2);border-radius:2px;padding:20px}.centralContent .contentIn table{border:0}.centralContent .contentIn table select{margin-top:-10px}.centralContent .modal-body{border:1px solid rgba(64,74,83,.2);color:#000;max-height:none;padding:0}.centralContent .modal-body .arango-table tr th,.centralContent .modal-body table tr th{padding-left:10px}.centralContent .modal-body .figuresHeader{background-color:#404a53;color:#fff}.centralContent .modal-body .icon_arangodb_info{margin-left:10px;right:inherit}.centralContent .modal-body .modalSelect{margin-top:0}.centralContent .modal-body .tab-pane{padding-top:0!important}.centralContent .modal-footer{background-color:transparent;border-bottom:1px solid rgba(64,74,83,.2);border-left:1px solid rgba(64,74,83,.2);border-radius:0;border-right:1px solid rgba(64,74,83,.2);border-top:0;box-shadow:none;padding:8px}.centralContent .figures1,.centralContent .figures2,.centralContent .figures3{margin-left:0!important;margin-top:40px;width:100%}.centralContent .figures1 .icon_arangodb_info,.centralContent .figures2 .icon_arangodb_info,.centralContent .figures3 .icon_arangodb_info{position:relative;text-align:center}.pure-table-body{overflow-x:none;overflow-y:auto}.pure-table-body .selected-row{background-color:rgba(46,204,113,.2)}.pure-table-body .dataTables_empty{padding-left:10px}.pure-table-body .heading{font-weight:600;height:40px;padding-bottom:10px;padding-top:10px}.pure-table-body .fa.fa-info-circle{cursor:pointer;margin-right:3px;opacity:.4}.pure-table-body .fa:hover{opacity:1}.pure-table{padding-left:20px;padding-right:20px}.pure-table.no-padding{padding-left:0;padding-right:0}.pure-table.no-padding .pure-table-row div div{padding-left:2.5px}.pure-table.no-padding.pure-table-header .pure-table-row>div:first-child .title{padding-left:10px}.pure-table.pure-title .pure-table-row{color:#717d90;font-weight:600}.pure-table.pure-title .pure-table-row:hover{background-color:#fff;cursor:default}.pure-table.pure-title .pure-table-row:last-child{border-bottom:1px solid rgba(140,138,137,.25);margin-bottom:0}.pure-table .pure-table-row{border-bottom:1px solid rgba(140,138,137,.25);color:#8a969f;font-weight:100;line-height:40px;width:100%}.pure-table .pure-table-row .padding-left{padding-left:30px}.pure-table .pure-table-row .padding-right{padding-right:30px}.pure-table .pure-table-row .actions i{margin-left:5px;margin-right:5px}.pure-table .pure-table-row:hover{background-color:#eff0eb;cursor:pointer}.pure-table .pure-table-row.disabled:hover{background-color:#fff;cursor:not-allowed}.pure-table .pure-table-row.noHover:hover{background-color:#fff;cursor:default}.pure-table .pure-table-row .left{text-align:left}.pure-table .pure-table-row .right{text-align:right}.pure-table .pure-table-row .mid{text-align:center}.pure-table .pure-table-row .positive{color:#2ecc71}.pure-table .pure-table-row .negative{color:#e74c3c}.pure-table .pure-table-row .warning{color:#f1c40f}.pure-table .pure-table-row .fa.fa-check-circle{color:#2ecc71}.pure-table .pure-table-row .fa.fa-exclamation-circle{color:#e74c3c}.pure-table .pure-table-row:last-child{border-bottom:0;margin-bottom:10px}.hotkeysList .hotkeysLabel{clear:both;color:#000;font-size:16px;font-weight:400}.hotkeysList .hotkeysContent{padding-left:10px}.hotkeysList li{line-height:25px}.hotkeysList li .hotkeysDiv{float:left}.hotkeysList .hotkeysicons{background-color:#686766;border:1px solid #000;border-radius:2px;color:#fff;display:inline;height:19px;margin-left:10px;text-align:center;width:19px}.hotkeysContentLabel{float:left;width:30%}.coords-dbs .pure-table-row.noHover,.coords-dbs .pure-table-row.noHover:hover{cursor:not-allowed!important}#nodesContent{padding-top:0}#nodesContent .pure-table-body .fa-check-circle,#nodesContent .pure-table-body .fa-exclamation-circle{font-size:15pt}.shardFollowers span:hover,.shardLeader span:hover{color:#000;cursor:pointer}input[type=range]{-webkit-appearance:none;border:1px solid #fff;border-radius:3px;margin-top:10px;width:218px}input[type=range]::-webkit-slider-runnable-track{background:#ddd;border:0;border-radius:3px;height:5px;width:218px}input[type=range]::-webkit-slider-thumb{-webkit-appearance:none;background:#2ecc71;border:0;border-radius:50%;height:16px;margin-top:-5px;width:16px}input[type=range]:focus{outline:0}input[type=range]:focus::-webkit-slider-runnable-track{background:#ccc}input[type=range]::-moz-range-track{background:#e1e1e1;border:0;border-radius:3px;height:5px;width:218px}input[type=range]::-moz-range-thumb{background:#2ecc71;border:0;border-radius:50%;height:16px;width:16px}input[type=range]:-moz-focusring{outline:#fff solid 1px;outline-offset:-1px}input[type=range]::-ms-track{background:0 0;border-color:transparent;border-width:6px 0;color:transparent;height:5px;width:218px}input[type=range]::-ms-fill-lower{background:#666;border-radius:10px}input[type=range]::-ms-fill-upper{background:#ddd;border-radius:10px}input[type=range]::-ms-thumb{background:#2ecc71;border:0;border-radius:50%;height:16px;width:16px}input[type=range]:focus::-ms-fill-lower{background:#999}input[type=range]:focus::-ms-fill-upper{background:#ccc}.arangoState{background-color:#404a53;border-radius:3px;color:#fff;font-size:10pt;font-weight:100;padding:5px 8px}.arango-table tbody tr:nth-child(even),.arango-table thead{background-color:#fff}.arango-table{width:100%}.arango-table thead th{border-bottom:1px solid #c2c2c2;font-weight:400;height:43px}.arango-table tbody tr:nth-child(odd){background:rgba(104,103,102,.05)}.arango-table tbody td{padding:10px 18px}.arango-tabbar{height:27px;width:100%}.arango-tabbar button{background-color:#404a53;border:0;border-top-left-radius:2px;border-top-right-radius:2px;color:#fff;float:right;font-weight:100;height:27px;margin-right:5px;width:82px}.arango-tabbar button:first-child{margin-right:10px}.arango-tabbar .arango-active-tab{background-color:#fff;border-bottom:1px solid #fff;border-left:1px solid #c2c2c2;border-right:1px solid #c2c2c2;border-top:1px solid #c2c2c2;color:#000;height:28px;margin-bottom:-1px}.subViewNavbar{border-bottom:2px solid #d9dbdc;height:40px;list-style:none;width:100%;z-index:1000;margin:-57px 0 15px -15px}.subViewNavbar li{cursor:pointer;float:left;font-size:10pt;line-height:30px;margin-bottom:5px;margin-top:5px;padding:0 12px}.subViewNavbar li.active{border-bottom:2px solid #77cb99;cursor:default;padding-bottom:5px}.subViewNavbar li.active a{color:#000}.subViewNavbar li.disabled{cursor:not-allowed}.subViewNavbar li.disabled:hover a{color:rgba(51,51,51,.6)}.subViewNavbar li:hover a{color:#333;transition:all .2s ease-in}.subViewNavbar li a,.subnavmenu ul li:hover a{-moz-transition:all .2s ease-in;-o-transition:all .2s ease-in;-webkit-transition:all .2s ease-in}.subViewNavbar li a{color:rgba(51,51,51,.6);transition:all .2s ease-in}.subnavmenu{background-color:#fff;height:auto}.subnavmenu .bar-img{background:0 0;border-radius:25px;margin-right:5px;width:25px}.subnavmenu .bar-img:hover{cursor:pointer}.subnavmenu ul{list-style:none;margin:0}.subnavmenu ul.top{background-color:#404a53;height:60px;width:100%}.subnavmenu ul.top li{padding:0 10px 0 0}.subnavmenu ul.bottom{border-bottom:2px solid #d9dbdc;height:40px;width:100%;z-index:1000}.subnavmenu ul.bottom li{float:left;padding:0 12px}.subnavmenu ul li{cursor:pointer;font-size:10pt;line-height:30px;margin-bottom:5px;margin-top:5px}.subnavmenu ul li.active{border-bottom:2px solid #77cb99;cursor:default;padding-bottom:5px}.subnavmenu ul li.active a{color:#000}.subnavmenu ul li.disabled{cursor:not-allowed}.subnavmenu ul li.disabled:hover a{color:rgba(51,51,51,.6)}.subnavmenu ul li:hover a{color:#333;transition:all .2s ease-in}.subnavmenu ul li a{color:rgba(51,51,51,.6);-moz-transition:all .2s ease-in;-o-transition:all .2s ease-in;-webkit-transition:all .2s ease-in;transition:all .2s ease-in}.subnavmenu .infoEntry{line-height:45px}.subnavmenu .infoEntry a{margin-right:5px}.subnavmenu .infoEntry a.default-icon i{color:#fff}.subnavmenu .infoEntry a.default-icon i:hover{color:#2ecc71;cursor:pointer}.subnavmenu .infoEntry:hover{cursor:default}.subnavmenu .infoEntry:hover .info{-webkit-touch-callout:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;-webkit-user-select:none;user-select:none;color:#fff}.subnavmenu .infoEntry.positive .health-icon,.subnavmenu .infoEntry.positive .health-state,.subnavmenu .infoEntry.positive .state{color:#2ecc71}.subnavmenu .infoEntry.negative .health-icon,.subnavmenu .infoEntry.negative .health-state{color:#e74c3c}.subnavmenu .icon,.subnavmenu .info,.subnavmenu .state{color:rgba(255,255,255,.95);display:block;float:left;font-weight:300;max-width:150px;overflow:hidden;text-transform:uppercase}.subnavmenu .icon span,.subnavmenu .info span,.subnavmenu .state span{color:#2ecc71}.subnavmenu .icon span:hover,.subnavmenu .info span:hover,.subnavmenu .state span:hover{cursor:pointer}.subnavmenu #dbStatus{padding-right:20px}.subBarDropdown{background:#fff;border:1px solid rgba(64,74,83,.2);display:none;margin-top:55px!important;min-width:200px;position:absolute;z-index:9999}.subBarDropdown li{padding:0}.subBarDropdown .dropdown-header{background-color:#77cb99;cursor:default;margin:0 -1px;padding:0!important}.subBarDropdown .dropdown-header img{border:3px solid #6dba8c;border-radius:75px;display:block;margin:10px auto 0;width:75px}.subBarDropdown .dropdown-header p,.subBarDropdown .dropdown-header small{color:#fff;text-align:center}.subBarDropdown .dropdown-header small{display:block;margin-top:-10px}.subBarDropdown .dropdown-footer{padding:0 5px 0 0!important}.subBarDropdown .dropdown-footer button{margin-bottom:5px;margin-top:-4px}.helpUs iframe{left:0;position:absolute;right:0;top:101px}#community,#documentation{padding:20px 40px 40px}#community h4,#documentation h4{font-weight:400}#community a,#documentation a{color:#3498db}#community .pure-u-1-1,#documentation .pure-u-1-1{font-weight:100}#community .center,#documentation .center{margin-top:10px;text-align:center}#community ul,#documentation ul{list-style-type:none;margin:0 0 10px 10px}#community .menu li:first-child,#community .menu li:last-child,#documentation .menu li:first-child,#documentation .menu li:last-child{padding-top:20px}@media all and (-ms-high-contrast:none),(-ms-high-contrast:active){div .bigtile .collection-type-icon,div .tile .collection-type-icon{margin-left:0!important;position:relative!important;top:-58px!important}.tile .icon_arangodb_edge5{margin-left:0!important;position:relative!important;top:-67px!important}}.arangoDataTable{display:block;position:relative;width:100%}.arangoDataTable tbody{display:inline-block;max-height:200px;overflow-y:auto;position:absolute;width:100%}.arangoDataTable thead{background-color:#fff!important;display:inline-block;font-weight:400!important;text-align:left;width:100%}.arangoDataTable thead td{overflow:hidden}.arangoDataTable thead th{border-bottom:0;cursor:default!important;font-weight:400!important;padding:10px 14px!important}.arangoDataTable thead tr{border-bottom:1px solid #c2c2c2}.arangoDataTable tr{cursor:pointer}.arangoDataTable td{padding:8px 18px!important}.arangoDataTable .key{font-weight:100;margin-top:4px;overflow:hidden}.arangoDataTable .dataTable .noPointer tr{cursor:default}.arangoDataTable .selected-row{background-color:#2ecc71!important}.arangoDataTable .selected-row div,.arangoDataTable .selected-row li,.arangoDataTable .selected-row span{color:#fff!important}.api-container #resources>li.resource:nth-child(even),table.arangoDataTable tr.even{background-color:#fff}.api-container #resources>li.resource:nth-child(odd),table.arangoDataTable tr.odd{background-color:rgba(104,103,102,.05)}#tableDiv table.dataTable td{padding:12px 18px!important}#documentsTableID_filter,#documentsTableID_length{display:none}#documentsTableID_wrapper{padding-bottom:0!important}.snippet-no-num{font-size:1em;font-weight:400;margin-bottom:0}.cuttedContent,.prettify ul li,.writeable a{overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important}.totalDocuments{color:#666;float:left;font-weight:100;margin-top:-37px!important;padding-left:10px}.prettify{border:none!important;font-size:1em!important;margin:0!important;padding:0!important}.edit-index-table tfoot,.newIndexClass table{border-top:1px solid #f7f3f2}table .sorting{background:0 0!important}.new-index-view input[type=checkbox]{float:left}.new-index-view table tr{width:600px!important}.new-index-view table tr th:last-child{width:50px!important}.new-index-view table th{font-weight:300!important;width:200px!important}#documentsDiv{padding-top:0}#documentsDiv .pure-table .snippet-container{margin-top:10px}.edit-index-table{margin-top:5px;min-width:auto!important}.edit-index-table th{padding-bottom:5px;padding-left:5px;padding-top:5px}.edit-index-table .icon_arangodb_locked{color:rgba(0,0,0,.5);cursor:default;font-size:20px;margin-left:10px}.index-button-bar i:hover,.queryline .fa-info-circle:hover{cursor:pointer}.edit-index-table .icon_arangodb_roundminus{font-size:20px;margin-left:10px}.edit-index-table tfoot i{color:#2ecc71;font-size:19px;margin-left:22px;margin-top:5px}.edit-index-table tfoot i:hover{color:#58d68d;cursor:pointer}.contentIn .arangoicon{font-size:25px;position:relative;top:-3px!important}#collectionEditIndexTable thead{border-bottom:1px solid #e5e5e5}.newIndexClass table{margin-bottom:60px}.newIndexClass table select{margin-right:7px}.newIndexClass table .arangoicon{float:right;margin-right:-12px;margin-top:5px}.index-button-bar{float:right}.index-button-bar i{color:#2ecc71;font-size:16pt;margin-right:43px}.index-button-bar #cancelIndex{margin-right:13px}.docsFirstCol,.docsSecCol,.docsThirdCol{border:0!important}.docsFirstCol{height:26px;width:80%}.docsSecCol{height:26px;min-width:400px!important;width:10%}.docsThirdCol{height:26px}.add-filter-item{margin-left:4px}.add-filter-item i{margin-top:0!important}.upload-indicator{display:none;margin-top:-3px;padding-right:10px}.documentsDropdown .dropdownImport,.documentsDropdown .headerDropdown{clear:both;margin-bottom:10px}.documents-size{background-color:#fff!important;border:1px solid #e5e5e5;border-radius:0;box-shadow:none;color:#000;float:right;font-size:11pt;font-weight:300;height:28px;line-height:18px;margin-left:10px;margin-top:0;width:115px}.ace_error{background:0 0!important}#exportHeader .fa-exclamation-circle{color:#fff;font-size:13pt;margin-right:10px}.totalDocuments:hover{color:#000}.ajax-file-upload-statusbar{-moz-border-radius:2px;-webkit-border-radius:2px;border-radius:2px;border:1px solid rgba(0,0,0,.7);margin:10px 10px 5px 5px;padding:5px;width:420px}.ajax-file-upload-filename{color:grey;height:auto;margin:0 5px 5px 10px;width:100%}.ajax-file-upload-progress{-moz-border-radius:2px;-webkit-border-radius:2px;border-radius:2px;border:1px solid #d9d9d9;display:inline-block;margin:0 10px 5px;padding:1px;position:relative;width:250px}.ajax-file-upload-bar{-moz-border-radius:2px;-webkit-border-radius:2px;border-radius:2px;background-color:rgba(0,0,0,.7);color:#fff;height:20px;width:0}.ajax-file-upload-percent{display:inline-block;left:48%;position:absolute;top:3px}.ajax-file-upload-red{font-size:13px;font-weight:400;margin-right:5px;padding:4px 15px;vertical-align:top}.ajax-file-upload{display:inline-block;font-size:16px;font-weight:700;height:25px;margin:0 10px 10px 0;padding:6px 10px 4px}.ajax-upload-dragdrop{border:1px dotted #8f8d8c;color:#736b68;padding:10px 10px 0;text-align:left;vertical-align:middle;width:506px}.ajax-upload-dragdrop span{position:relative;top:-22px}/*! Animate.css - http://daneden.me/animate Licensed under the MIT license - http://opensource.org/licenses/MIT diff --git a/js/apps/system/_admin/aardvark/APP/frontend/build/style-minified.css.gz b/js/apps/system/_admin/aardvark/APP/frontend/build/style-minified.css.gz index 82b2009288..2aef56720a 100644 Binary files a/js/apps/system/_admin/aardvark/APP/frontend/build/style-minified.css.gz and b/js/apps/system/_admin/aardvark/APP/frontend/build/style-minified.css.gz differ diff --git a/js/apps/system/_admin/aardvark/APP/frontend/build/style.css.gz b/js/apps/system/_admin/aardvark/APP/frontend/build/style.css.gz index e2d62ee86b..43c5285b0e 100644 Binary files a/js/apps/system/_admin/aardvark/APP/frontend/build/style.css.gz and b/js/apps/system/_admin/aardvark/APP/frontend/build/style.css.gz differ diff --git a/js/apps/system/_admin/aardvark/APP/frontend/fonts/fontawesome/FontAwesome.otf b/js/apps/system/_admin/aardvark/APP/frontend/fonts/fontawesome/FontAwesome.otf index 681bdd4d4c..d4de13e832 100644 Binary files a/js/apps/system/_admin/aardvark/APP/frontend/fonts/fontawesome/FontAwesome.otf and b/js/apps/system/_admin/aardvark/APP/frontend/fonts/fontawesome/FontAwesome.otf differ diff --git a/js/apps/system/_admin/aardvark/APP/frontend/fonts/fontawesome/fontawesome-webfont.eot b/js/apps/system/_admin/aardvark/APP/frontend/fonts/fontawesome/fontawesome-webfont.eot index a30335d748..c7b00d2ba8 100755 Binary files a/js/apps/system/_admin/aardvark/APP/frontend/fonts/fontawesome/fontawesome-webfont.eot and b/js/apps/system/_admin/aardvark/APP/frontend/fonts/fontawesome/fontawesome-webfont.eot differ diff --git a/js/apps/system/_admin/aardvark/APP/frontend/fonts/fontawesome/fontawesome-webfont.svg b/js/apps/system/_admin/aardvark/APP/frontend/fonts/fontawesome/fontawesome-webfont.svg index 6fd19abcb9..8b66187fe0 100755 --- a/js/apps/system/_admin/aardvark/APP/frontend/fonts/fontawesome/fontawesome-webfont.svg +++ b/js/apps/system/_admin/aardvark/APP/frontend/fonts/fontawesome/fontawesome-webfont.svg @@ -1,6 +1,6 @@ - + @@ -169,7 +169,7 @@ - + @@ -178,7 +178,7 @@ - + @@ -219,8 +219,8 @@ - - + + @@ -362,8 +362,8 @@ - - + + @@ -410,7 +410,7 @@ - + @@ -454,7 +454,7 @@ - + @@ -484,7 +484,7 @@ - + @@ -555,7 +555,7 @@ - + @@ -600,11 +600,11 @@ - - + + - + @@ -621,20 +621,65 @@ - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/js/apps/system/_admin/aardvark/APP/frontend/fonts/fontawesome/fontawesome-webfont.ttf b/js/apps/system/_admin/aardvark/APP/frontend/fonts/fontawesome/fontawesome-webfont.ttf index d7994e1308..f221e50a2e 100755 Binary files a/js/apps/system/_admin/aardvark/APP/frontend/fonts/fontawesome/fontawesome-webfont.ttf and b/js/apps/system/_admin/aardvark/APP/frontend/fonts/fontawesome/fontawesome-webfont.ttf differ diff --git a/js/apps/system/_admin/aardvark/APP/frontend/fonts/fontawesome/fontawesome-webfont.woff b/js/apps/system/_admin/aardvark/APP/frontend/fonts/fontawesome/fontawesome-webfont.woff index 6fd4ede0f3..6e7483cf61 100755 Binary files a/js/apps/system/_admin/aardvark/APP/frontend/fonts/fontawesome/fontawesome-webfont.woff and b/js/apps/system/_admin/aardvark/APP/frontend/fonts/fontawesome/fontawesome-webfont.woff differ diff --git a/js/apps/system/_admin/aardvark/APP/frontend/fonts/fontawesome/fontawesome-webfont.woff2 b/js/apps/system/_admin/aardvark/APP/frontend/fonts/fontawesome/fontawesome-webfont.woff2 index 5560193ccc..7eb74fd127 100644 Binary files a/js/apps/system/_admin/aardvark/APP/frontend/fonts/fontawesome/fontawesome-webfont.woff2 and b/js/apps/system/_admin/aardvark/APP/frontend/fonts/fontawesome/fontawesome-webfont.woff2 differ diff --git a/js/apps/system/_admin/aardvark/APP/frontend/js/collections/queryManagementCollectionActive.js b/js/apps/system/_admin/aardvark/APP/frontend/js/collections/queryManagementCollectionActive.js index d0a8f10f88..ce93f3461c 100644 --- a/js/apps/system/_admin/aardvark/APP/frontend/js/collections/queryManagementCollectionActive.js +++ b/js/apps/system/_admin/aardvark/APP/frontend/js/collections/queryManagementCollectionActive.js @@ -1,18 +1,30 @@ /* jshint browser: true */ /* jshint unused: false */ -/* global window, Backbone, $, frontendConfig */ +/* global window, Backbone, arangoHelper, $, frontendConfig */ (function () { 'use strict'; window.QueryManagementActive = Backbone.Collection.extend({ model: window.queryManagementModel, url: function () { - return frontendConfig.basePath + '/_api/query/current'; + var url = frontendConfig.basePath + '/_api/query/current'; + + if (window.frontendConfig.db !== '_system') { + url = arangoHelper.databaseUrl('/_api/query/current'); + } + + return url; }, killRunningQuery: function (id, callback) { + var url = frontendConfig.basePath + '/_api/query/' + encodeURIComponent(id); + + if (window.frontendConfig.db !== '_system') { + url = arangoHelper.databaseUrl('/_api/query/' + encodeURIComponent(id)); + } + $.ajax({ - url: frontendConfig.basePath + '/_api/query/' + encodeURIComponent(id), + url: url, type: 'DELETE', success: function (result) { callback(); diff --git a/js/apps/system/_admin/aardvark/APP/frontend/js/collections/queryManagementCollectionSlow.js b/js/apps/system/_admin/aardvark/APP/frontend/js/collections/queryManagementCollectionSlow.js index b87f009d18..4047e7cf93 100644 --- a/js/apps/system/_admin/aardvark/APP/frontend/js/collections/queryManagementCollectionSlow.js +++ b/js/apps/system/_admin/aardvark/APP/frontend/js/collections/queryManagementCollectionSlow.js @@ -1,21 +1,36 @@ /* jshint browser: true */ /* jshint unused: false */ -/* global window, Backbone, $ */ +/* global window, Backbone, arangoHelper, frontendConfig, $ */ (function () { 'use strict'; window.QueryManagementSlow = Backbone.Collection.extend({ model: window.queryManagementModel, - url: '/_api/query/slow', + + url: function () { + var url = frontendConfig.basePath + '/_api/query/slow'; + + if (window.frontendConfig.db !== '_system') { + url = arangoHelper.databaseUrl('/_api/query/slow'); + } + + return url; + }, deleteSlowQueryHistory: function (callback) { - var self = this; + var url = frontendConfig.basePath + '/_api/query/slow'; + + if (window.frontendConfig.db !== '_system') { + url = arangoHelper.databaseUrl('/_api/query/slow'); + } + $.ajax({ - url: self.url, + url: url, type: 'DELETE', success: function (result) { callback(); } }); } + }); }()); diff --git a/js/apps/system/_admin/aardvark/APP/frontend/js/routers/router.js b/js/apps/system/_admin/aardvark/APP/frontend/js/routers/router.js index 2b5c2621f6..f8d97a55d7 100644 --- a/js/apps/system/_admin/aardvark/APP/frontend/js/routers/router.js +++ b/js/apps/system/_admin/aardvark/APP/frontend/js/routers/router.js @@ -889,6 +889,9 @@ if (this.queryView) { this.queryView.resize(); } + if (this.naviView) { + this.naviView.resize(); + } if (this.graphViewer2) { this.graphViewer2.resize(); } diff --git a/js/apps/system/_admin/aardvark/APP/frontend/js/routers/versionCheck.js b/js/apps/system/_admin/aardvark/APP/frontend/js/routers/versionCheck.js index 7d851f2f0d..6754bb7613 100644 --- a/js/apps/system/_admin/aardvark/APP/frontend/js/routers/versionCheck.js +++ b/js/apps/system/_admin/aardvark/APP/frontend/js/routers/versionCheck.js @@ -137,7 +137,9 @@ success: function (data) { var currentVersion = window.versionHelper.fromString(data.version); - $('.navbar #currentVersion').text(' ' + data.version.substr(0, 3)); + $('.navbar #currentVersion').html( + ' ' + data.version.substr(0, 5) + '' + ); window.parseVersions = function (json) { if (_.isEmpty(json)) { diff --git a/js/apps/system/_admin/aardvark/APP/frontend/js/templates/documentsView.ejs b/js/apps/system/_admin/aardvark/APP/frontend/js/templates/documentsView.ejs index 2c8697dfce..8e0b1507ed 100644 --- a/js/apps/system/_admin/aardvark/APP/frontend/js/templates/documentsView.ejs +++ b/js/apps/system/_admin/aardvark/APP/frontend/js/templates/documentsView.ejs @@ -57,7 +57,12 @@
    -
    +
    + + + +
    +
    - - - - -
    + +
    '); + '
    '); this.filters[num] = true; + + this.checkFilterState(); }, filterValueKeydown: function (e) { @@ -445,6 +447,29 @@ } }, + checkFilterState: function () { + var length = $('#filterHeader .queryline').length; + + if (length === 1) { + $('#filterHeader .removeFilterItem').remove(); + } else { + if ($('#filterHeader .queryline').first().find('.removeFilterItem').length === 0) { + var id = $('#filterHeader .queryline').first().children().first().attr('id'); + var num = id.substr(14, id.length); + + $('#filterHeader .queryline').first().find('.add-filter-item').after( + ' ' + + ''); + } + } + + if ($('#filterHeader .queryline').first().find('.add-filter-item').length === 0) { + $('#filterHeader .queryline').first().find('.filterValue').after( + '' + ); + } + }, + removeFilterItem: function (e) { // removes line from the filter widget var button = e.currentTarget; @@ -456,6 +481,7 @@ // remove the line from the DOM $(button.parentElement).remove(); + this.checkFilterState(); }, removeAllFilterItems: function () { diff --git a/js/apps/system/_admin/aardvark/APP/frontend/js/views/graphSettingsView.js b/js/apps/system/_admin/aardvark/APP/frontend/js/views/graphSettingsView.js index 356aca1e8b..f1c9cc3b0a 100644 --- a/js/apps/system/_admin/aardvark/APP/frontend/js/views/graphSettingsView.js +++ b/js/apps/system/_admin/aardvark/APP/frontend/js/views/graphSettingsView.js @@ -73,6 +73,19 @@ desc: 'Node label. Please choose a valid and available node attribute.', default: '_key' }, + 'nodeLabelByCollection': { + type: 'select', + name: 'Label by coll?', + desc: 'Set label text by collection. If activated node label attribute will be ignored.', + no: { + name: 'No', + val: 'false' + }, + yes: { + name: 'Yes', + val: 'true' + } + }, 'nodeLabelThreshold': { type: 'range', name: 'Label threshold', @@ -117,6 +130,19 @@ name: 'Label', desc: 'Default edge label.' }, + 'edgeLabelByCollection': { + type: 'select', + name: 'Label by coll?', + desc: 'Set label text by collection. If activated edge label attribute will be ignored.', + no: { + name: 'No', + val: 'false' + }, + yes: { + name: 'Yes', + val: 'true' + } + }, 'edgeLabelThreshold': { type: 'range', name: 'Label threshold', @@ -248,25 +274,19 @@ if (overwrite) { config[combinedName] = overwrite; } else { - config[combinedName] = { - layout: $('#g_layout').val(), - renderer: $('#g_renderer').val(), - depth: $('#g_depth').val(), - nodeColor: $('#g_nodeColor').val(), - nodeColorAttribute: $('#g_nodeColorAttribute').val(), - nodeColorByCollection: $('#g_nodeColorByCollection').val(), - nodeLabelThreshold: $('#g_nodeLabelThreshold').val(), - edgeColor: $('#g_edgeColor').val(), - edgeColorAttribute: $('#g_edgeColorAttribute').val(), - edgeColorByCollection: $('#g_edgeColorByCollection').val(), - edgeLabelThreshold: $('#g_edgeLabelThreshold').val(), - nodeLabel: $('#g_nodeLabel').val(), - edgeLabel: $('#g_edgeLabel').val(), - edgeType: $('#g_edgeType').val(), - nodeSize: $('#g_nodeSize').val(), - edgeEditable: $('#g_edgeEditable').val(), - nodeStart: $('#g_nodeStart').val() - }; + var object = {}; + + var id; + $('#graphSettingsView select').each(function (key, elem) { + id = elem.id; + object[id.substr(2, elem.id.length)] = $(elem).val(); + }); + $('#graphSettingsView input').each(function (key, elem) { + id = elem.id; + object[id.substr(2, elem.id.length)] = $(elem).val(); + }); + + config[combinedName] = object; } if (nodeStart) { @@ -306,6 +326,8 @@ edgeType: 'line', nodeSize: '', edgeEditable: 'false', + nodeLabelByCollection: 'false', + edgeLabelByCollection: 'false', nodeStart: '' }; this.saveGraphSettings(null, null, null, obj); @@ -345,6 +367,10 @@ _.each(this.graphConfig, function (val, key) { $('#g_' + key).val(val); }); + + // range customization + $('#g_nodeLabelThreshold_label').text(this.graphConfig.nodeLabelThreshold); + $('#g_edgeLabelThreshold_label').text(this.graphConfig.edgeLabelThreshold); } else { this.setDefaults(); } diff --git a/js/apps/system/_admin/aardvark/APP/frontend/js/views/graphViewer2.js b/js/apps/system/_admin/aardvark/APP/frontend/js/views/graphViewer2.js index 68d0ef45f3..6c81f8f374 100644 --- a/js/apps/system/_admin/aardvark/APP/frontend/js/views/graphViewer2.js +++ b/js/apps/system/_admin/aardvark/APP/frontend/js/views/graphViewer2.js @@ -574,7 +574,11 @@ } // rerender graph - sigma.canvas.edges.autoCurve(self.currentGraph); + if (this.graphConfig) { + if (this.graphConfig.edgeType === 'curve') { + sigma.canvas.edges.autoCurve(self.currentGraph); + } + } self.currentGraph.refresh(); } else { arangoHelper.arangoError('Graph', 'Could not create edge.'); @@ -1070,6 +1074,10 @@ if (this.graphConfig) { if (this.graphConfig.edgeType) { settings.defaultEdgeType = this.graphConfig.edgeType; + + if (this.graphConfig.edgeType === 'arrow') { + settings.minArrowSize = 7; + } } if (this.graphConfig.nodeLabelThreshold) { @@ -1140,7 +1148,11 @@ // for canvas renderer allow graph editing if (renderer === 'canvas') { // render parallel edges - sigma.canvas.edges.autoCurve(s); + if (this.graphConfig) { + if (this.graphConfig.edgeType === 'curve') { + sigma.canvas.edges.autoCurve(s); + } + } s.refresh(); if (!self.aqlMode) { @@ -1218,11 +1230,13 @@ }); } - if (this.graphConfig.edgeEditable) { - s.bind('rightClickEdge', function (e) { - var edgeId = e.data.edge.id; - self.createEdgeContextMenu(edgeId, e); - }); + if (this.graphConfig) { + if (this.graphConfig.edgeEditable) { + s.bind('rightClickEdge', function (e) { + var edgeId = e.data.edge.id; + self.createEdgeContextMenu(edgeId, e); + }); + } } s.bind('doubleClickNode', function (e) { diff --git a/js/apps/system/_admin/aardvark/APP/frontend/js/views/navigationView.js b/js/apps/system/_admin/aardvark/APP/frontend/js/views/navigationView.js index 529d1054c5..92089e5a42 100644 --- a/js/apps/system/_admin/aardvark/APP/frontend/js/views/navigationView.js +++ b/js/apps/system/_admin/aardvark/APP/frontend/js/views/navigationView.js @@ -105,9 +105,18 @@ }); } + self.resize(); + return this; }, + resize: function () { + // set menu sizes - responsive + var height = $(window).height() - $('.subMenuEntries').first().height(); + $('#navigationBar').css('min-height', height); + $('#navigationBar').css('height', height); + }, + navigateBySelect: function () { var navigateTo = $('#arangoCollectionSelect').find('option:selected').val(); window.App.navigate(navigateTo, {trigger: true}); diff --git a/js/apps/system/_admin/aardvark/APP/frontend/scss/_documentsView.scss b/js/apps/system/_admin/aardvark/APP/frontend/scss/_documentsView.scss index d1c7eff386..c2017343d4 100644 --- a/js/apps/system/_admin/aardvark/APP/frontend/scss/_documentsView.scss +++ b/js/apps/system/_admin/aardvark/APP/frontend/scss/_documentsView.scss @@ -153,7 +153,7 @@ } .add-filter-item { - margin-left: 5px; + margin-left: 4px; i { margin-top: 0 !important; diff --git a/js/apps/system/_admin/aardvark/APP/frontend/scss/_dropdowns.scss b/js/apps/system/_admin/aardvark/APP/frontend/scss/_dropdowns.scss index 500b8938da..9f6cd7c92a 100644 --- a/js/apps/system/_admin/aardvark/APP/frontend/scss/_dropdowns.scss +++ b/js/apps/system/_admin/aardvark/APP/frontend/scss/_dropdowns.scss @@ -137,7 +137,8 @@ div.queryline { } .removeFilterItem i { - margin-left: 5px !important; + font-size: 16pt; + margin-left: 4px !important; margin-top: 0 !important; } diff --git a/js/apps/system/_admin/aardvark/APP/frontend/scss/_graphViewer2.scss b/js/apps/system/_admin/aardvark/APP/frontend/scss/_graphViewer2.scss index b83bd9671b..92935e4db4 100644 --- a/js/apps/system/_admin/aardvark/APP/frontend/scss/_graphViewer2.scss +++ b/js/apps/system/_admin/aardvark/APP/frontend/scss/_graphViewer2.scss @@ -121,6 +121,10 @@ height: 40px; } + .pure-u-1-3 { + line-height: 30px; + } + .pure-u-2-3 { text-align: right; } @@ -131,6 +135,13 @@ margin-bottom: 15px; } + .rangeLabel { + float: left; + margin-left: 4px; + margin-top: 5px; + position: relative; + } + } .pure-table { diff --git a/js/apps/system/_admin/aardvark/APP/frontend/scss/_login.scss b/js/apps/system/_admin/aardvark/APP/frontend/scss/_login.scss index 875ec0288c..7197085c39 100644 --- a/js/apps/system/_admin/aardvark/APP/frontend/scss/_login.scss +++ b/js/apps/system/_admin/aardvark/APP/frontend/scss/_login.scss @@ -92,8 +92,11 @@ .wrong-credentials { color: $c-negative; - margin-top: -30px; + margin-left: -20px; + margin-top: -24px; + position: absolute; text-align: center; + width: 100%; } .login-space { diff --git a/js/apps/system/_admin/aardvark/APP/frontend/scss/_modals.scss b/js/apps/system/_admin/aardvark/APP/frontend/scss/_modals.scss index 2e7d694acf..b726c663bb 100644 --- a/js/apps/system/_admin/aardvark/APP/frontend/scss/_modals.scss +++ b/js/apps/system/_admin/aardvark/APP/frontend/scss/_modals.scss @@ -332,6 +332,10 @@ width: 20px; } + pre { + margin-right: 20px; + margin-top: 20px; + } } .modal-text { diff --git a/js/apps/system/_admin/aardvark/APP/frontend/scss/_navbar.scss b/js/apps/system/_admin/aardvark/APP/frontend/scss/_navbar.scss index 90e94a23a5..c18ae08272 100644 --- a/js/apps/system/_admin/aardvark/APP/frontend/scss/_navbar.scss +++ b/js/apps/system/_admin/aardvark/APP/frontend/scss/_navbar.scss @@ -175,6 +175,7 @@ $navbar-size: 150px; font-weight: 100; left: 0; padding-bottom: 10px; + padding-left: 5px; position: absolute; text-align: center; text-transform: uppercase; @@ -184,6 +185,13 @@ $navbar-size: 150px; color: $c-warning; font-weight: 400; + i { + font-size: 9pt; + margin-left: 5px; + margin-top: 3px; + position: absolute; + } + &:hover { cursor: pointer; } diff --git a/js/apps/system/_admin/aardvark/APP/frontend/scss/_screenSizes.scss b/js/apps/system/_admin/aardvark/APP/frontend/scss/_screenSizes.scss index 64e80c6feb..5d31db5939 100644 --- a/js/apps/system/_admin/aardvark/APP/frontend/scss/_screenSizes.scss +++ b/js/apps/system/_admin/aardvark/APP/frontend/scss/_screenSizes.scss @@ -4,6 +4,11 @@ .social-icons { display: none; } + + #navigationBar { + overflow: scroll; + overflow-x: hidden !important; + } } @media (max-height: 525px) { @@ -401,5 +406,8 @@ } } -@media (min-width: 1042px) and (max-width: 1284px) { +@media (max-width: 1024px) { + #docsSort { + display: none; + } }