diff --git a/js/apps/system/aardvark/frontend/js/templates/progressBase.ejs b/js/apps/system/aardvark/frontend/js/templates/progressBase.ejs index 17ce45edd7..7d7a107d0a 100644 --- a/js/apps/system/aardvark/frontend/js/templates/progressBase.ejs +++ b/js/apps/system/aardvark/frontend/js/templates/progressBase.ejs @@ -3,6 +3,9 @@

-
+
+
+
+
diff --git a/js/apps/system/aardvark/frontend/js/views/databaseView.js b/js/apps/system/aardvark/frontend/js/views/databaseView.js index 84843ee972..36a8571113 100644 --- a/js/apps/system/aardvark/frontend/js/views/databaseView.js +++ b/js/apps/system/aardvark/frontend/js/views/databaseView.js @@ -26,7 +26,8 @@ "click #databaseSearchSubmit" : "search", "click #databaseToggle" : "toggleSettingsDropdown", "click .css-label" : "checkBoxes", - "change #dbSortDesc" : "sorting" + "change #dbSortDesc" : "sorting", + "click svg" : "switchDatabase" }, sorting: function() { @@ -130,6 +131,12 @@ this.createAddDatabaseModal(); }, + switchDatabase: function(e) { + var changeTo = $(e.currentTarget).parent().find("h5").text(); + var url = this.collection.createDatabaseURL(changeTo); + window.location.replace(url); + }, + submitCreateDatabase: function() { var self = this; var name = $('#newDatabaseName').val(); diff --git a/js/apps/system/aardvark/frontend/js/views/progressView.js b/js/apps/system/aardvark/frontend/js/views/progressView.js index 73d920766c..323c001254 100644 --- a/js/apps/system/aardvark/frontend/js/views/progressView.js +++ b/js/apps/system/aardvark/frontend/js/views/progressView.js @@ -14,19 +14,34 @@ el2: "#progressPlaceholderIcon", + action: function(){}, + + events: { + "click .progress-action button": "performAction" + }, + + performAction: function() { + this.action(); + }, + initialize: function() { }, - show: function(msg) { + show: function(msg, action, button) { $(this.el).html(this.template.render({})); - $(".progress-message").text(msg); + $(".progress-text").text(msg); + $(".progress-action").html(button); + + this.action = action; + $(this.el).show(); - $(this.el2).html(''); + //$(this.el2).html(''); }, hide: function() { $(this.el).hide(); - $(this.el2).html(''); + this.action = function(){}; + //$(this.el2).html(''); } }); diff --git a/js/apps/system/aardvark/frontend/js/views/queryView.js b/js/apps/system/aardvark/frontend/js/views/queryView.js index 9c46614413..f96c0c9e6d 100644 --- a/js/apps/system/aardvark/frontend/js/views/queryView.js +++ b/js/apps/system/aardvark/frontend/js/views/queryView.js @@ -554,6 +554,22 @@ this.queries = _.sortBy(this.queries, 'name'); this.customQueries = _.sortBy(this.customQueries, 'name'); }, + + abortQuery: function () { + /* + $.ajax({ + type: "DELETE", + url: "/_api/cursor/currentFrontendQuery", + contentType: "application/json", + processData: false, + success: function (data) { + }, + error: function (data) { + } + }); + */ + }, + submitQuery: function () { var self = this; var inputEditor = ace.edit("aqlEditor"); @@ -562,14 +578,20 @@ var sizeBox = $('#querySize'); var data = { query: selectedText || inputEditor.getValue(), - batchSize: parseInt(sizeBox.val(), 10) + batchSize: parseInt(sizeBox.val(), 10), + id: "currentFrontendQuery" }; var outputEditor = ace.edit("queryOutput"); // clear result outputEditor.setValue(''); - window.progressView.show("Query is operating..."); + window.progressView.show( + "Query is operating...", + self.abortQuery("id"), + '' + ); + $.ajax({ type: "POST", url: "/_api/cursor", diff --git a/js/apps/system/aardvark/frontend/scss/_progressView.scss b/js/apps/system/aardvark/frontend/scss/_progressView.scss index 2006c2e3bc..ac366cd075 100644 --- a/js/apps/system/aardvark/frontend/scss/_progressView.scss +++ b/js/apps/system/aardvark/frontend/scss/_progressView.scss @@ -1,4 +1,5 @@ #progressPlaceholder { + background-color: rgba(0, 0, 0, .4); bottom: 0; left: 0; position: fixed; @@ -8,25 +9,22 @@ } .progress-view { - opacity: 0; - background-color: rgba(0, 0, 0, .0); - border-radius: 5px; + background-color: #fff; + border: 1px solid $c-nav-bg; + border-radius: 2px; color: $c-nav-bg; - height: 180px; + height: 188px; left: 50%; margin: -100px 0 0 -150px; position: absolute; top: 50%; - opacity: 0; width: 300px; .progress-content { margin-left: 90px; margin-top: 10px; - opacity: 0; .fa-spinner { - opacity: 0; font-size: 100pt; } @@ -34,15 +32,26 @@ .progress-message { background-color: $c-nav-bg; - border-radius: 0 0 5px 5px; + border-radius: 0 0 2px 2px; border-top: 1px solid #fff; color: #fff; font-weight: 200; - height: 25px; + height: 33px; padding-top: 3px; text-align: center; - opacity: 0; } + + .progress-text { + float: left; + margin-left: 5px; + margin-top: 4px; + } + + .progress-action { + float: right; + margin-right: 2px; + } + } #progressPlaceholderIcon { diff --git a/js/apps/system/aardvark/frontend/scss/_tiles.scss b/js/apps/system/aardvark/frontend/scss/_tiles.scss index 0259840a61..7674deea76 100644 --- a/js/apps/system/aardvark/frontend/scss/_tiles.scss +++ b/js/apps/system/aardvark/frontend/scss/_tiles.scss @@ -64,6 +64,7 @@ $iconsize: 50px; } svg.tile-icon-svg { + cursor: pointer; fill: $c-icon-grey; height: $iconsize; margin-left: 90px; diff --git a/js/apps/system/aardvark/frontend/scss/generated.css b/js/apps/system/aardvark/frontend/scss/generated.css index 170b6795bb..73f56b34a1 100644 --- a/js/apps/system/aardvark/frontend/scss/generated.css +++ b/js/apps/system/aardvark/frontend/scss/generated.css @@ -2001,6 +2001,7 @@ div .tile, div .bigtile { height: 50px; width: 50px; } div .tile svg.tile-icon-svg, div .bigtile svg.tile-icon-svg { + cursor: pointer; fill: #686766; height: 50px; margin-left: 90px; @@ -5848,6 +5849,7 @@ input.gv-radio-button { visibility: hidden; } #progressPlaceholder { + background-color: rgba(0, 0, 0, 0.4); bottom: 0; left: 0; position: fixed; @@ -5856,34 +5858,37 @@ input.gv-radio-button { z-index: 9999; } .progress-view { - opacity: 0; - background-color: transparent; - border-radius: 5px; + background-color: #fff; + border: 1px solid #333232; + border-radius: 2px; color: #333232; - height: 180px; + height: 188px; left: 50%; margin: -100px 0 0 -150px; position: absolute; top: 50%; - opacity: 0; width: 300px; } .progress-view .progress-content { margin-left: 90px; - margin-top: 10px; - opacity: 0; } + margin-top: 10px; } .progress-view .progress-content .fa-spinner { - opacity: 0; font-size: 100pt; } .progress-view .progress-message { background-color: #333232; - border-radius: 0 0 5px 5px; + border-radius: 0 0 2px 2px; border-top: 1px solid #fff; color: #fff; font-weight: 200; - height: 25px; + height: 33px; padding-top: 3px; - text-align: center; - opacity: 0; } + text-align: center; } + .progress-view .progress-text { + float: left; + margin-left: 5px; + margin-top: 4px; } + .progress-view .progress-action { + float: right; + margin-right: 2px; } #progressPlaceholderIcon { color: #8aa051; diff --git a/js/server/modules/org/arangodb/testing.js b/js/server/modules/org/arangodb/testing.js index 3d749d1718..9754e04901 100644 --- a/js/server/modules/org/arangodb/testing.js +++ b/js/server/modules/org/arangodb/testing.js @@ -344,26 +344,31 @@ function copy (src, dst) { fs.write(dst, buffer); } -function checkInstanceAlive(instanceInfo) { - var res = statusExternal(instanceInfo.pid, false); - var ret = res.status === "RUNNING"; - if (! ret) { - print("ArangoD with PID " + instanceInfo.pid.pid + " gone:"); - instanceInfo.exitStatus = res; - print(instanceInfo); - if (res.hasOwnProperty('signal') && - (res.signal === 11)) - { - var storeArangodPath = "/var/tmp/arangod_" + instanceInfo.pid.pid; - print("Core dump written; copying arangod to " + - storeArangodPath + " for later analysis."); - res.gdbHint = "Run debugger with 'gdb " + - storeArangodPath + - " /var/tmp/core*" + instanceInfo.pid.pid + "*'"; - copy("bin/arangod", storeArangodPath); +function checkInstanceAlive(instanceInfo, options) { + if (options.cluster === false) { + var res = statusExternal(instanceInfo.pid, false); + var ret = res.status === "RUNNING"; + if (! ret) { + print("ArangoD with PID " + instanceInfo.pid.pid + " gone:"); + instanceInfo.exitStatus = res; + print(instanceInfo); + if (res.hasOwnProperty('signal') && + (res.signal === 11)) + { + var storeArangodPath = "/var/tmp/arangod_" + instanceInfo.pid.pid; + print("Core dump written; copying arangod to " + + storeArangodPath + " for later analysis."); + res.gdbHint = "Run debugger with 'gdb " + + storeArangodPath + + " /var/tmp/core*" + instanceInfo.pid.pid + "*'"; + copy("bin/arangod", storeArangodPath); + } } + return ret; + } + else { + return instanceInfo.kickstarter.isHealthy(); } - return ret; } function shutdownInstance (instanceInfo, options) { @@ -629,7 +634,7 @@ function performTests(options, testList, testname) { if (r !== true && !options.force) { break; } - continueTesting = checkInstanceAlive(instanceInfo); + continueTesting = checkInstanceAlive(instanceInfo, options); } else { print("Skipped " + te + " because of " + filtered.filter); @@ -777,7 +782,7 @@ testFuncs.shell_client = function(options) { break; } - continueTesting = checkInstanceAlive(instanceInfo); + continueTesting = checkInstanceAlive(instanceInfo, options); } else { print("Skipped " + te + " because of " + filtered.filter); @@ -885,7 +890,7 @@ function rubyTests (options, ssl) { break; } - continueTesting = checkInstanceAlive(instanceInfo); + continueTesting = checkInstanceAlive(instanceInfo, options); } else { @@ -1161,7 +1166,7 @@ testFuncs.arangob = function (options) { r = runArangoBenchmark(options, instanceInfo, benchTodo[i]); results[i] = r; - continueTesting = checkInstanceAlive(instanceInfo); + continueTesting = checkInstanceAlive(instanceInfo, options); if (r !== 0 && !options.force) { break; @@ -1235,7 +1240,7 @@ testFuncs.authentication_parameters = function (options) { }; all_ok = false; } - continueTesting = checkInstanceAlive(instanceInfo); + continueTesting = checkInstanceAlive(instanceInfo, options); } results.auth_full.status = all_ok; @@ -1271,7 +1276,7 @@ testFuncs.authentication_parameters = function (options) { }; all_ok = false; } - continueTesting = checkInstanceAlive(instanceInfo); + continueTesting = checkInstanceAlive(instanceInfo, options); } results.auth_system.status = all_ok; @@ -1308,7 +1313,7 @@ testFuncs.authentication_parameters = function (options) { }; all_ok = false; } - continueTesting = checkInstanceAlive(instanceInfo); + continueTesting = checkInstanceAlive(instanceInfo, options); } results.auth_none.status = all_ok;