1
0
Fork 0

Merge branch 'devel' of https://github.com/triAGENS/ArangoDB into devel

This commit is contained in:
Jan Steemann 2014-10-17 16:13:56 +02:00
commit 63e378bb0b
8 changed files with 122 additions and 55 deletions

View File

@ -3,6 +3,9 @@
<p class="progress-content">
<i class="fa fa-spinner fa-spin"></i>
</p>
<div class="progress-message"></div>
<div class="progress-message">
<div class="progress-text"></div>
<div class="progress-action"></div>
</div>
</div>
</script>

View File

@ -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();

View File

@ -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('<i class="fa fa-spinner fa-spin"></i>');
//$(this.el2).html('<i class="fa fa-spinner fa-spin"></i>');
},
hide: function() {
$(this.el).hide();
$(this.el2).html('');
this.action = function(){};
//$(this.el2).html('');
}
});

View File

@ -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"),
'<button class="button-danger">Abort Query</button>'
);
$.ajax({
type: "POST",
url: "/_api/cursor",

View File

@ -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 {

View File

@ -64,6 +64,7 @@ $iconsize: 50px;
}
svg.tile-icon-svg {
cursor: pointer;
fill: $c-icon-grey;
height: $iconsize;
margin-left: 90px;

View File

@ -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;

View File

@ -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;