1
0
Fork 0

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

This commit is contained in:
Max Neunhoeffer 2014-03-24 14:04:59 +01:00
commit c683fde9ba
12 changed files with 194 additions and 50 deletions

View File

@ -382,6 +382,11 @@ void ArangoClient::parse (ProgramOptions& options,
TRI_SetUserTempPath((char*) _tempPath.c_str());
}
if (options.has("server.username")) {
// if a username is specified explicitly, assume authentication is desired
_disableAuthentication = false;
}
// check if have a password
_hasPassword = options.has("server.password")
|| _disableAuthentication

View File

@ -1,20 +1,23 @@
<script id="symmetricPlan.ejs" type="text/template">
<div class="headerBar">
<% if (isSymmetric) { %>
<a class="arangoHeader">Plan a symmetric cluster</a>
<% } else { %>
<a class="arangoHeader">Plan a asymmetric cluster</a>
<% } %>
</div>
<form action="javascript:void(0);" autocomplete="on" class="form-horizontal">
<fieldset id="server_list">
</fieldset>
<div class="control-group">
<div class="controls">
<button class="button-close" id="cancel">Cancel</button>
<button class="button-success" id="startSymmetricPlan">Launch Cluster</button>
</div>
<div class="headerBar">
<% if (isSymmetric) { %>
<a class="arangoHeader">Plan a symmetric cluster</a>
<% } else { %>
<a class="arangoHeader">Plan a asymmetric cluster</a>
<% } %>
</div>
<div class="innerContent">
<form action="javascript:void(0);" autocomplete="on" class="form-horizontal">
<fieldset id="server_list">
</fieldset>
<div class="control-group">
<div class="controls">
<button class="button-close" id="cancel">Cancel</button>
<button class="button-notification" id="test-all-connections">Test all connections</button>
<button class="button-neutral" id="startSymmetricPlan">Launch Cluster</button>
</div>
</div>
</form>
</div>
</form>
</script>

View File

@ -11,10 +11,12 @@
modal: templateEngine.createTemplate("waitModal.ejs"),
events: {
"click #startSymmetricPlan": "startPlan",
"click .add": "addEntry",
"click .delete": "removeEntry",
"click #cancel": "cancel"
"click #startSymmetricPlan" : "startPlan",
"click .add" : "addEntry",
"click .delete" : "removeEntry",
"click #cancel" : "cancel",
"focusout .host" : "autoCheckConnections",
"focusout .port" : "autoCheckConnections"
},
cancel: function() {
@ -95,6 +97,9 @@
},
addEntry: function() {
//disable launch button
this.disableLaunchButton();
$("#server_list").append(this.entryTemplate.render({
isSymmetric: this.isSymmetric,
isFirst: false,
@ -107,6 +112,7 @@
removeEntry: function(e) {
$(e.currentTarget).closest(".control-group").remove();
this.checkAllConnections();
},
render: function(isSymmetric) {
@ -157,10 +163,94 @@
port: ''
}));
}
//initially disable lunch button
this.disableLaunchButton();
$(this.el).append(this.modal.render({}));
},
autoCheckConnections: function (e) {
var host,
port,
currentTarget = $(e.currentTarget);
//eval which field was left
if(currentTarget.attr('class').indexOf('host') !== -1) {
host = currentTarget.val();
//eval value of port
port = currentTarget.nextAll('.port').val();
} else {
port = currentTarget.val();
//eval value of port
host = currentTarget.prevAll('.host').val();
}
if (host !== '' && port !== '') {
this.checkAllConnections();
}
},
checkConnection: function(host, port, target) {
$(target).find('.cluster-connection-check-success').remove();
$(target).find('.cluster-connection-check-fail').remove();
var result = false;
try {
$.ajax({
async: false,
cache: false,
type: "GET",
url: "http://" + host + ":" + port + "/_api/version",
success: function() {
$(target).append(
'<span class="cluster-connection-check-success">Connection: ok</span>'
);
result = true;
},
error: function() {
$(target).append(
'<span class="cluster-connection-check-fail">Connection: fail</span>'
);
}
});
} catch (e) {
this.disableLaunchButton();
}
return result;
},
checkAllConnections: function() {
var self = this;
var hasError = false;
$('.dispatcher').each(
function(i, dispatcher) {
var target = $('.controls', dispatcher)[0];
var host = $('.host', dispatcher).val();
var port = $('.port', dispatcher).val();
if (!self.checkConnection(host, port, target)) {
hasError = true;
}
}
);
if (!hasError) {
this.enableLaunchButton();
} else {
this.disableLaunchButton();
}
},
disableLaunchButton: function() {
$('#startSymmetricPlan').attr('disabled', 'disabled');
$('#startSymmetricPlan').removeClass('button-success');
$('#startSymmetricPlan').addClass('button-neutral');
},
enableLaunchButton: function() {
$('#startSymmetricPlan').attr('disabled', false);
$('#startSymmetricPlan').removeClass('button-neutral');
$('#startSymmetricPlan').addClass('button-success');
}
});
}());

View File

@ -1,25 +0,0 @@
@media (max-width: 798px) {
#arangoCollectionUl {
display: none;
}
#collectionsDropdown ul {
width: auto !important;
}
#arangoCollectionSelect {
display: inline-block;
}
}
@media (min-width: 799px) and (max-width: 1041px) {
#arangoCollectionUl a {
font-size: 11px;
padding: 7px 5px 10px;
}
}
@media (min-width: 1042px) and (max-width: 1284px) {
#arangoCollectionUl a {
font-size: 13px;
}
}

View File

@ -1,5 +1,5 @@
<script id="navigationView.ejs" type="text/template">
<ul class="navlist" id="arangoCollectionUl">
<ul class="navlist arango-collection-ul" id="arangoCollectionUl">
<li id="dbSelect" class="dropdown databases-menu"></li>
<li class="collections-menu"><a id="collections" class="tab" href="#collections">Collections</a></li>
<li class="graphviewer-menu"><a id="graph" class="tab" href="#graph">Graphs</a></li>
@ -58,7 +58,7 @@
</li>
</ul>
<select id="arangoCollectionSelect">
<select id="arangoCollectionSelect" class="arango-collection-select">
<option value="" selected="selected">Select</option>
<option value="#">Dashboard</option>

View File

@ -51,7 +51,7 @@
error: function (data) {
self.isOffline = true;
self.isOfflineCounter++;
if (self.isOfflineCounter >= 3) {
if (self.isOfflineCounter >= 2) {
arangoHelper.arangoError("Server", "Server is offline");
}
}

View File

@ -58,3 +58,13 @@ a.dbserver {
right: 60px;
}
}
.cluster-connection-check-success {
color: $c-positive;
margin-left: 20px;
}
.cluster-connection-check-fail {
color: $c-negative;
margin-left: 20px;
}

View File

@ -0,0 +1,36 @@
@media (max-width: 798px) {
.arango-collection-ul {
display: none;
}
.collection-dropdown {
ul {
width: auto !important;
}
}
.arango-collection-select {
display: inline-block;
}
}
@media (min-width: 799px) and (max-width: 1041px) {
.arango-collection-ul {
a {
font-size: 11px;
padding: 7px 5px 10px;
}
}
}
@media (min-width: 1042px) and (max-width: 1284px) {
.arango-collection-ul {
a {
font-size: 13px;
}
}
}

View File

@ -2648,6 +2648,14 @@ a.dbserver.single {
a.dbserver.double {
right: 60px; }
.cluster-connection-check-success {
color: #8aa051;
margin-left: 20px; }
.cluster-connection-check-fail {
color: #da4f49;
margin-left: 20px; }
.machineClass {
background-color: #e1e1e1;
margin-left: 31px;

View File

@ -3644,6 +3644,22 @@ input.gv-radio-button {
.snippet-no-num .sh_array {
color: #00f; }
@media (max-width: 798px) {
.arango-collection-ul {
display: none; }
.collection-dropdown ul {
width: auto !important; }
.arango-collection-select {
display: inline-block; } }
@media (min-width: 799px) and (max-width: 1041px) {
.arango-collection-ul a {
font-size: 11px;
padding: 7px 5px 10px; } }
@media (min-width: 1042px) and (max-width: 1284px) {
.arango-collection-ul a {
font-size: 13px; } }
.arangoDataTable {
border-spacing: 0 0;
position: relative;

View File

@ -57,6 +57,8 @@
@import 'collection';
// Snippet coloring (docs view)
@import 'snippet';
// screen sizes
@import 'screenSizes';
// Data Tables, TODO: might all be superflous
@import 'dataTables';

View File

@ -126,7 +126,6 @@
"frontend/css/nv.d3.css",
"frontend/css/swaggerView.css",
"frontend/css/ansi.css",
"frontend/css/screenSizes.css",
"frontend/css/jsoneditor.css",
"frontend/ttf/arangofont/style.css"
]