diff --git a/arangod/RestServer/ArangoServer.cpp b/arangod/RestServer/ArangoServer.cpp index 6f9f93eab0..d7971cbde9 100644 --- a/arangod/RestServer/ArangoServer.cpp +++ b/arangod/RestServer/ArangoServer.cpp @@ -1001,7 +1001,7 @@ int ArangoServer::runUnitTests (TRI_vocbase_t* vocbase) { context->_context->Global()->Set(v8::String::New("SYS_UNIT_TESTS_RESULT"), v8::True()); // run tests - char const* input = "require(\"test_runner\").runCommandLineTests();"; + char const* input = "require(\"org/arangodb/testrunner\").runCommandLineTests();"; TRI_ExecuteJavaScriptString(context->_context, v8::String::New(input), name, true); if (tryCatch.HasCaught()) { diff --git a/arangosh/V8Client/arangosh.cpp b/arangosh/V8Client/arangosh.cpp index d98c467688..c5063541b1 100644 --- a/arangosh/V8Client/arangosh.cpp +++ b/arangosh/V8Client/arangosh.cpp @@ -1589,7 +1589,7 @@ static bool RunUnitTests (v8::Handle context) { context->Global()->Set(v8::String::New("SYS_UNIT_TESTS_RESULT"), v8::True()); // run tests - char const* input = "require(\"test_runner\").runCommandLineTests();"; + char const* input = "require(\"org/arangodb/testrunner\").runCommandLineTests();"; v8::Local name(v8::String::New("(arangosh)")); TRI_ExecuteJavaScriptString(context, v8::String::New(input), name, true); diff --git a/js/apps/system/aardvark/frontend/js/collections/foxxCollection.js b/js/apps/system/aardvark/frontend/js/collections/foxxCollection.js index d63a1b9520..def733d158 100644 --- a/js/apps/system/aardvark/frontend/js/collections/foxxCollection.js +++ b/js/apps/system/aardvark/frontend/js/collections/foxxCollection.js @@ -53,6 +53,26 @@ return result; }, + gitInfo: function (key) { + var result; + $.ajax({ + cache: false, + type: "GET", + async: false, // sequential calls! + url: "/_admin/aardvark/foxxes/gitinfo/"+key, + contentType: "application/json", + processData: false, + success: function(data) { + result = data; + }, + error: function(data) { + result = data; + } + }); + + return result; + }, + purgeFoxx: function (key) { var msg, url = "/_admin/aardvark/foxxes/purge/"+key; $.ajax({ diff --git a/js/apps/system/aardvark/frontend/js/views/foxxInstalledView.js b/js/apps/system/aardvark/frontend/js/views/foxxInstalledView.js index 063855ae13..de816b47f1 100644 --- a/js/apps/system/aardvark/frontend/js/views/foxxInstalledView.js +++ b/js/apps/system/aardvark/frontend/js/views/foxxInstalledView.js @@ -40,6 +40,14 @@ ) ]; var buttonInfoConfig = [ + window.modalView.createDeleteButton( + "Remove", this.confirmRemovalSingle.bind(this) + ), + window.modalView.createSuccessButton( + "Install", this.installDialog.bind(this) + ) + ]; + var buttonInfoConfigUpdate = [ window.modalView.createDeleteButton( "Remove", this.confirmRemovalSingle.bind(this) ), @@ -51,6 +59,17 @@ ) ]; var buttonInfoMultipleVersionsConfig = [ + window.modalView.createDeleteButton( + "Remove All", this.confirmRemovalAll.bind(this) + ), + window.modalView.createDeleteButton( + "Remove", this.confirmRemovalSingle.bind(this) + ), + window.modalView.createSuccessButton( + "Install", this.installDialog.bind(this) + ) + ]; + var buttonInfoMultipleVersionsConfigUpdate = [ window.modalView.createDeleteButton( "Remove All", this.confirmRemovalAll.bind(this) ), @@ -78,12 +97,24 @@ "Application Settings", buttonInfoConfig ); + this.showInfoModUpdate = window.modalView.show.bind( + window.modalView, + "modalTable.ejs", + "Application Settings", + buttonInfoConfigUpdate + ); this.showInfoMultipleVersionsMod = window.modalView.show.bind( window.modalView, "modalTable.ejs", "Application Settings", buttonInfoMultipleVersionsConfig ); + this.showInfoMultipleVersionsModUpdate = window.modalView.show.bind( + window.modalView, + "modalTable.ejs", + "Application Settings", + buttonInfoMultipleVersionsConfigUpdate + ); this.showSystemInfoMod = window.modalView.show.bind( window.modalView, "modalTable.ejs", @@ -267,7 +298,15 @@ }, infoDialog: function(event) { - var versions, isSystem = false; + var name = this.model.get("name"), + mountinfo = this.model.collection.gitInfo(name), + versions, isSystem = false, isGit; + + if (mountinfo.git === true) { + this.model.set("isGit", mountinfo.git); + this.model.set("gitUrl", mountinfo.url); + } + if (this.model.get("isSystem")) { isSystem = true; } else { @@ -275,14 +314,21 @@ } versions = this.model.get("versions"); + isGit = this.model.get("isGit"); event.stopPropagation(); - if (isSystem === false && !versions) { + if (isSystem === false && !versions && !isGit) { this.showInfoMod(this.fillInfoValues()); } - else if (isSystem === false && versions) { + else if (isSystem === false && !versions && isGit) { + this.showInfoModUpdate(this.fillInfoValues()); + } + else if (isSystem === false && versions && !isGit) { this.showInfoMultipleVersionsMod(this.fillInfoValues()); } + else if (isSystem === false && versions && isGit) { + this.showInfoMultipleVersionsModUpdate(this.fillInfoValues()); + } else { this.showSystemInfoMod(this.fillInfoValues()); } @@ -301,9 +347,9 @@ }, update: function() { - var url = this.model.get("git"), - name = '', + var url = this.model.get("gitUrl"), version = 'master', + name = '', result; if (url === undefined || url === '') { @@ -311,7 +357,7 @@ return; } - result = this.collection.installFoxxFromGithub(url, name, version); + result = this.model.collection.installFoxxFromGithub(url, name, version); if (result === true) { window.modalView.hide(); window.App.applicationsView.reload(); diff --git a/js/common/modules/test_runner.js b/js/common/modules/org/arangodb/testrunner.js similarity index 100% rename from js/common/modules/test_runner.js rename to js/common/modules/org/arangodb/testrunner.js