diff --git a/Documentation/DocuBlocks/serverKeyfile.md b/Documentation/DocuBlocks/serverKeyfile.md index a22f115602..8230489e3f 100644 --- a/Documentation/DocuBlocks/serverKeyfile.md +++ b/Documentation/DocuBlocks/serverKeyfile.md @@ -3,7 +3,7 @@ @brief keyfile containing server certificate `--ssl.keyfile filename` -If SSL encryption is used, this option must be used to specify the filename +If SSL encryption is used, this option must be used to specify the filename of the server private key. The file must be PEM formatted and contain both the certificate and the server's private key. @@ -23,7 +23,7 @@ cp server.key server.key.org openssl rsa -in server.key.org -out server.key # sign the csr with the key, creates certificate PEM file "server.crt" -openssl x509 -req -days 365 -in server.csr -signkey server.key -out +openssl x509 -req -days 365 -in server.csr -signkey server.key -out \ server.crt # combine certificate and key into single PEM file "server.pem" diff --git a/Installation/release.sh b/Installation/release.sh index 411085ad08..cc8caf7e2a 100755 --- a/Installation/release.sh +++ b/Installation/release.sh @@ -9,40 +9,50 @@ EXAMPLES=1 LINT=1 while [ "$#" -gt 1 ]; do - if [ "$1" == "--no-lint" ]; then - LINT=0 - shift - fi + case "$1" in + --no-lint) + LINT=0 + shift + ;; - if [ "$1" == "--no-build" ]; then - BUILD=0 - shift - fi + --no-build) + BUILD=0 + shift + ;; - if [ "$1" == "--recycle-build" ]; then - BUILD=2 - shift - fi + --recycle-build) + BUILD=2 + shift + ;; - if [ "$1" == "--no-swagger" ]; then - SWAGGER=0 - shift - fi + --no-swagger) + SWAGGER=0 + shift + ;; - if [ "$1" == "--no-examples" ]; then - EXAMPLES=0 - shift - fi + --no-examples) + EXAMPLES=0 + shift + ;; - if [ "$1" == "--no-commit" ]; then - TAG=0 - shift - fi + --no-commit) + TAG=0 + shift + ;; - if [ "$1" == "--no-book" ]; then - BOOK=0 - shift - fi + --no-book) + BOOK=0 + shift + ;; + *) + if test -n "${VERSION}"; then + echo "we already have a version ${VERSION} aborting because of $1" + exit 1 + fi + VERSION="$1" + shift + ;; + esac done if [ "$#" -ne 1 ]; then @@ -50,7 +60,6 @@ if [ "$#" -ne 1 ]; then exit 1 fi -VERSION="$1" if echo ${VERSION} | grep -q -- '-'; then echo "${VERSION} mustn't contain minuses! " diff --git a/arangod/Aql/AstNode.cpp b/arangod/Aql/AstNode.cpp index a219f123fd..4549f6cd17 100644 --- a/arangod/Aql/AstNode.cpp +++ b/arangod/Aql/AstNode.cpp @@ -892,7 +892,7 @@ VPackSlice AstNode::computeValue() const { /// @brief compute the value for a constant value node /// the value is owned by the node and must not be freed by the caller -VPackSlice AstNode::computeValue(Transaction* trx) const { +VPackSlice AstNode::computeValue(arangodb::Transaction* trx) const { TRI_ASSERT(isConstant()); if (computedValue == nullptr) { diff --git a/arangod/Aql/CollectionScanner.cpp b/arangod/Aql/CollectionScanner.cpp index 330de02e2e..5c50afe8e0 100644 --- a/arangod/Aql/CollectionScanner.cpp +++ b/arangod/Aql/CollectionScanner.cpp @@ -29,12 +29,12 @@ using namespace arangodb::aql; CollectionScanner::CollectionScanner(arangodb::Transaction* trx, - ManagedDocumentResult* mmdr, + arangodb::ManagedDocumentResult* mmdr, std::string const& collection, bool readRandom) : _cursor(trx->indexScan(collection, - (readRandom ? Transaction::CursorType::ANY - : Transaction::CursorType::ALL), + (readRandom ? arangodb::Transaction::CursorType::ANY + : arangodb::Transaction::CursorType::ALL), Transaction::IndexHandle(), VPackSlice(), mmdr, 0, UINT64_MAX, 1000, false)) { TRI_ASSERT(_cursor->successful()); @@ -42,7 +42,7 @@ CollectionScanner::CollectionScanner(arangodb::Transaction* trx, CollectionScanner::~CollectionScanner() {} -void CollectionScanner::scan(std::vector& result, size_t batchSize) { +void CollectionScanner::scan(std::vector& result, size_t batchSize) { result.clear(); if (!_cursor->hasMore()) { diff --git a/arangod/Aql/CollectionScanner.h b/arangod/Aql/CollectionScanner.h index fe30a7509f..0ea0adbd98 100644 --- a/arangod/Aql/CollectionScanner.h +++ b/arangod/Aql/CollectionScanner.h @@ -29,7 +29,7 @@ namespace arangodb { class ManagedDocumentResult; -class OperationCursor; +struct OperationCursor; class Transaction; namespace aql { diff --git a/arangod/VocBase/Ditch.cpp b/arangod/VocBase/Ditch.cpp index 487f5a6589..505efef546 100644 --- a/arangod/VocBase/Ditch.cpp +++ b/arangod/VocBase/Ditch.cpp @@ -261,12 +261,14 @@ bool Ditches::contains(Ditch::DitchType type) { void Ditches::freeDitch(Ditch* ditch) { TRI_ASSERT(ditch != nullptr); + bool const isDocumentDitch = (ditch->type() == Ditch::TRI_DITCH_DOCUMENT); + { MUTEX_LOCKER(mutexLocker, _lock); unlink(ditch); - if (ditch->type() == Ditch::TRI_DITCH_DOCUMENT) { + if (isDocumentDitch) { // decrease counter --_numDocumentDitches; } @@ -415,16 +417,15 @@ void Ditches::link(Ditch* ditch) { // empty list if (_end == nullptr) { _begin = ditch; - _end = ditch; } // add to the end else { ditch->_prev = _end; - _end->_next = ditch; - _end = ditch; } + + _end = ditch; if (isDocumentDitch) { // increase counter diff --git a/arangod/VocBase/EdgeCollectionInfo.cpp b/arangod/VocBase/EdgeCollectionInfo.cpp index 768f4732f5..c8f9586078 100644 --- a/arangod/VocBase/EdgeCollectionInfo.cpp +++ b/arangod/VocBase/EdgeCollectionInfo.cpp @@ -62,7 +62,7 @@ EdgeCollectionInfo::EdgeCollectionInfo(arangodb::Transaction* trx, std::unique_ptr EdgeCollectionInfo::getEdges( std::string const& vertexId, - ManagedDocumentResult* mmdr) { + arangodb::ManagedDocumentResult* mmdr) { _searchBuilder.clear(); EdgeIndex::buildSearchValue(_forwardDir, vertexId, _searchBuilder); return _trx->indexScan(_collectionName, @@ -72,7 +72,7 @@ std::unique_ptr EdgeCollectionInfo::getEdges( std::unique_ptr EdgeCollectionInfo::getEdges( VPackSlice const& vertexId, - ManagedDocumentResult* mmdr) { + arangodb::ManagedDocumentResult* mmdr) { _searchBuilder.clear(); EdgeIndex::buildSearchValue(_forwardDir, vertexId, _searchBuilder); return _trx->indexScan(_collectionName, @@ -102,7 +102,7 @@ int EdgeCollectionInfo::getEdgesCoordinator(VPackSlice const& vertexId, std::unique_ptr EdgeCollectionInfo::getReverseEdges( std::string const& vertexId, - ManagedDocumentResult* mmdr) { + arangodb::ManagedDocumentResult* mmdr) { _searchBuilder.clear(); EdgeIndex::buildSearchValue(_backwardDir, vertexId, _searchBuilder); return _trx->indexScan(_collectionName, @@ -112,7 +112,7 @@ std::unique_ptr EdgeCollectionInfo::getReverseEdges( std::unique_ptr EdgeCollectionInfo::getReverseEdges( VPackSlice const& vertexId, - ManagedDocumentResult* mmdr) { + arangodb::ManagedDocumentResult* mmdr) { _searchBuilder.clear(); EdgeIndex::buildSearchValue(_backwardDir, vertexId, _searchBuilder); return _trx->indexScan(_collectionName, diff --git a/arangod/VocBase/Traverser.cpp b/arangod/VocBase/Traverser.cpp index 3661d9d84c..44a984a4ae 100644 --- a/arangod/VocBase/Traverser.cpp +++ b/arangod/VocBase/Traverser.cpp @@ -332,7 +332,7 @@ void Traverser::UniqueVertexGetter::reset(VPackSlice startVertex) { } Traverser::Traverser(arangodb::traverser::TraverserOptions* opts, arangodb::Transaction* trx, - ManagedDocumentResult* mmdr) + arangodb::ManagedDocumentResult* mmdr) : _trx(trx), _mmdr(mmdr), _startIdBuilder(trx), diff --git a/js/apps/system/_admin/aardvark/APP/GruntFile.js b/js/apps/system/_admin/aardvark/APP/GruntFile.js index d1cd1b3381..0eb330d91c 100644 --- a/js/apps/system/_admin/aardvark/APP/GruntFile.js +++ b/js/apps/system/_admin/aardvark/APP/GruntFile.js @@ -19,11 +19,7 @@ "frontend/js/lib/bootstrap-min.js", "frontend/js/lib/d3.min.js", "frontend/js/lib/nv.d3.min.js", - "frontend/js/lib/dygraph-combined.min.js", - "frontend/js/lib/jquery-2.1.0.min.js", - "frontend/js/lib/underscore-min.js", - "frontend/js/lib/backbone-min.js", - "frontend/js/lib/bootstrap-min.js" + "frontend/js/lib/dygraph-combined.min.js" ], css: [ "frontend/css/swagger/hightlight.default.css", diff --git a/js/apps/system/_admin/aardvark/APP/aardvark.js b/js/apps/system/_admin/aardvark/APP/aardvark.js index 9a8f09b39c..a8a1add304 100644 --- a/js/apps/system/_admin/aardvark/APP/aardvark.js +++ b/js/apps/system/_admin/aardvark/APP/aardvark.js @@ -510,6 +510,7 @@ authRouter.get('/graph/:name', function (req, res) { } } } + edgeObj.sortColor = edgeObj.color; edgesObj[edge._id] = edgeObj; }); @@ -548,6 +549,7 @@ authRouter.get('/graph/:name', function (req, res) { label: nodeLabel, size: nodeSize || 3, color: config.nodeColor || '#2ecc71', + sortColor: undefined, x: Math.random(), y: Math.random() }; @@ -572,6 +574,7 @@ authRouter.get('/graph/:name', function (req, res) { } } + nodeObj.sortColor = nodeObj.color; nodesObj[node._id] = nodeObj; } }); 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 43f7b0ab40..af455f305f 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 @@ -350,7 +350,11 @@ if (value === 'true') { window.App.graphViewer.switchNodeColorByCollection(true); } else { - window.App.graphViewer.switchNodeColorByCollection(false); + if ($('#g_nodeColorAttribute').is(':disabled')) { + window.App.graphViewer.switchNodeColorByCollection(false); + } else { + window.App.graphViewer.switchNodeColorByCollection(false, true); + } } return; // EDGES COLORING @@ -359,7 +363,11 @@ if (value === 'true') { window.App.graphViewer.switchEdgeColorByCollection(true); } else { - window.App.graphViewer.switchEdgeColorByCollection(false); + if ($('#g_nodeColorAttribute').is(':disabled')) { + window.App.graphViewer.switchEdgeColorByCollection(false); + } else { + window.App.graphViewer.switchEdgeColorByCollection(false, true); + } } return; } diff --git a/js/apps/system/_admin/aardvark/APP/frontend/js/views/graphViewer.js b/js/apps/system/_admin/aardvark/APP/frontend/js/views/graphViewer.js index ee0c8e3257..3f4e00012a 100644 --- a/js/apps/system/_admin/aardvark/APP/frontend/js/views/graphViewer.js +++ b/js/apps/system/_admin/aardvark/APP/frontend/js/views/graphViewer.js @@ -259,24 +259,31 @@ this.killCurrentGraph(); // TODO add WebGL features this.renderGraph(this.graphData.modified, null, false, layout, 'canvas'); - if ($('#g_nodeColorByCollection').val() === 'true') { this.switchNodeColorByCollection(true); } else { - if (this.ncolor) { - this.updateColors(true, true, this.ncolor, this.ecolor); + if ($('#g_nodeColor').is(':disabled')) { + this.updateColors(true, true, null, null, true); } else { - this.updateColors(true, true, '#2ecc71', '#2ecc71'); + if (this.ncolor) { + this.updateColors(true, true, this.ncolor, this.ecolor); + } else { + this.updateColors(true, true, '#2ecc71', '#2ecc71'); + } } } if ($('#g_edgeColorByCollection').val() === 'true') { this.switchEdgeColorByCollection(true); } else { - if (this.ecolor) { - this.updateColors(true, true, this.ncolor, this.ecolor); + if ($('#g_edgeColor').is(':disabled')) { + this.updateColors(true, true, null, null, true); } else { - this.updateColors(true, true, '#2ecc71', '#2ecc71'); + if (this.ecolor) { + this.updateColors(true, true, this.ncolor, this.ecolor); + } else { + this.updateColors(true, true, '#2ecc71', '#2ecc71'); + } } } }, @@ -315,7 +322,7 @@ } }, - switchNodeColorByCollection: function (boolean) { + switchNodeColorByCollection: function (boolean, origin) { var self = this; self.buildCollectionColors(); if (boolean) { @@ -325,15 +332,19 @@ self.currentGraph.refresh(); } else { - if (this.ncolor) { - this.updateColors(true, null, this.ncolor, this.ecolor); + if (origin) { + this.updateColors(true, null, null, null, origin); } else { - this.updateColors(true, null, '#2ecc71', '#2ecc71'); + if (this.ncolor) { + this.updateColors(true, null, this.ncolor, this.ecolor); + } else { + this.updateColors(true, null, '#2ecc71', '#2ecc71'); + } } } }, - switchEdgeColorByCollection: function (boolean) { + switchEdgeColorByCollection: function (boolean, origin) { var self = this; self.buildCollectionColors(); @@ -344,10 +355,14 @@ self.currentGraph.refresh(); } else { - if (this.ecolor) { - this.updateColors(null, true, this.ncolor, this.ecolor); + if (origin) { + this.updateColors(true, null, null, null, origin); } else { - this.updateColors(null, true, '#2ecc71', '#2ecc71'); + if (this.ecolor) { + this.updateColors(null, true, this.ncolor, this.ecolor); + } else { + this.updateColors(null, true, '#2ecc71', '#2ecc71'); + } } } }, @@ -1084,7 +1099,7 @@ } }, - updateColors: function (nodes, edges, ncolor, ecolor) { + updateColors: function (nodes, edges, ncolor, ecolor, origin) { var combinedName = frontendConfig.db + '_' + this.name; var self = this; @@ -1101,7 +1116,11 @@ self.graphConfig = data.toJSON().graphs[combinedName]; try { self.currentGraph.graph.nodes().forEach(function (n) { - n.color = ncolor; + if (origin) { + n.color = n.sortColor; + } else { + n.color = ncolor; + } }); } catch (e) { self.graphNotInitialized = true; @@ -1112,7 +1131,11 @@ if (edges === true) { try { self.currentGraph.graph.edges().forEach(function (e) { - e.color = ecolor; + if (origin) { + e.color = e.sortColor; + } else { + e.color = ecolor; + } }); } catch (ignore) { self.graphNotInitialized = true;