From bdde68342f41418e07696ca4e9cb8d078d4fcd92 Mon Sep 17 00:00:00 2001 From: jsteemann Date: Mon, 24 Oct 2016 10:55:29 +0200 Subject: [PATCH 1/8] fix struct/class mismatch --- arangod/Aql/CollectionScanner.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 { From 77e8214aa3baf805f8f843a528c6025cfb4c8b74 Mon Sep 17 00:00:00 2001 From: jsteemann Date: Mon, 24 Oct 2016 10:56:30 +0200 Subject: [PATCH 2/8] simplify --- arangod/VocBase/Ditch.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) 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 From 59c6bf661a833f0ff642850063e8f6a576235263 Mon Sep 17 00:00:00 2001 From: Mark Date: Mon, 24 Oct 2016 11:17:56 +0200 Subject: [PATCH 3/8] fixed windows compile errors --- arangod/Aql/AstNode.cpp | 2 +- arangod/Aql/CollectionScanner.cpp | 8 ++++---- arangod/VocBase/EdgeCollectionInfo.cpp | 8 ++++---- arangod/VocBase/Traverser.cpp | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) 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/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), From 7a38f3fd094240adeb21f3283cc57f2b8f52ce56 Mon Sep 17 00:00:00 2001 From: Wilfried Goesgens Date: Mon, 24 Oct 2016 13:09:54 +0200 Subject: [PATCH 4/8] Fix commandline parsing of release script. --- Installation/release.sh | 66 +++++++++++++++++++++++------------------ 1 file changed, 37 insertions(+), 29 deletions(-) diff --git a/Installation/release.sh b/Installation/release.sh index 411085ad08..de3b555802 100755 --- a/Installation/release.sh +++ b/Installation/release.sh @@ -9,40 +9,49 @@ 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" + fi + VERSION="$1" + shift + ;; + esac done if [ "$#" -ne 1 ]; then @@ -50,7 +59,6 @@ if [ "$#" -ne 1 ]; then exit 1 fi -VERSION="$1" if echo ${VERSION} | grep -q -- '-'; then echo "${VERSION} mustn't contain minuses! " From bdc51eecb7b0248b9ed933c2e8e6f8e1542d662d Mon Sep 17 00:00:00 2001 From: Wilfried Goesgens Date: Mon, 24 Oct 2016 13:10:59 +0200 Subject: [PATCH 5/8] exit release script on error. --- Installation/release.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/Installation/release.sh b/Installation/release.sh index de3b555802..cc8caf7e2a 100755 --- a/Installation/release.sh +++ b/Installation/release.sh @@ -47,6 +47,7 @@ while [ "$#" -gt 1 ]; do *) if test -n "${VERSION}"; then echo "we already have a version ${VERSION} aborting because of $1" + exit 1 fi VERSION="$1" shift From 9593c42c4d8fae2a7b52fd9dc7a3f9e253b71f15 Mon Sep 17 00:00:00 2001 From: Andreas Streichardt Date: Mon, 24 Oct 2016 13:33:40 +0200 Subject: [PATCH 6/8] Make ssl stuff copy pastable --- Documentation/DocuBlocks/serverKeyfile.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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" From 1fd4625188af42f2fc483237160f83d988b91ba9 Mon Sep 17 00:00:00 2001 From: hkernbach Date: Mon, 24 Oct 2016 14:08:25 +0200 Subject: [PATCH 7/8] gruntfile cleanup --- js/apps/system/_admin/aardvark/APP/GruntFile.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) 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", From f8b7b602ba3539d9383350347a75e346b0ca6c18 Mon Sep 17 00:00:00 2001 From: hkernbach Date: Mon, 24 Oct 2016 14:11:16 +0200 Subject: [PATCH 8/8] gv colors --- .../system/_admin/aardvark/APP/aardvark.js | 3 + .../frontend/js/views/graphSettingsView.js | 12 +++- .../APP/frontend/js/views/graphViewer.js | 59 +++++++++++++------ 3 files changed, 54 insertions(+), 20 deletions(-) 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;