mirror of https://gitee.com/bigwinds/arangodb
Merge branch 'devel' of ssh://github.com/triAGENS/ArangoDB into devel
This commit is contained in:
commit
c683fde9ba
|
@ -382,6 +382,11 @@ void ArangoClient::parse (ProgramOptions& options,
|
||||||
TRI_SetUserTempPath((char*) _tempPath.c_str());
|
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
|
// check if have a password
|
||||||
_hasPassword = options.has("server.password")
|
_hasPassword = options.has("server.password")
|
||||||
|| _disableAuthentication
|
|| _disableAuthentication
|
||||||
|
|
|
@ -1,20 +1,23 @@
|
||||||
<script id="symmetricPlan.ejs" type="text/template">
|
<script id="symmetricPlan.ejs" type="text/template">
|
||||||
<div class="headerBar">
|
<div class="headerBar">
|
||||||
<% if (isSymmetric) { %>
|
<% if (isSymmetric) { %>
|
||||||
<a class="arangoHeader">Plan a symmetric cluster</a>
|
<a class="arangoHeader">Plan a symmetric cluster</a>
|
||||||
<% } else { %>
|
<% } else { %>
|
||||||
<a class="arangoHeader">Plan a asymmetric cluster</a>
|
<a class="arangoHeader">Plan a asymmetric cluster</a>
|
||||||
<% } %>
|
<% } %>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="innerContent">
|
||||||
|
|
||||||
<form action="javascript:void(0);" autocomplete="on" class="form-horizontal">
|
<form action="javascript:void(0);" autocomplete="on" class="form-horizontal">
|
||||||
<fieldset id="server_list">
|
<fieldset id="server_list">
|
||||||
</fieldset>
|
</fieldset>
|
||||||
<div class="control-group">
|
<div class="control-group">
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
<button class="button-close" id="cancel">Cancel</button>
|
<button class="button-close" id="cancel">Cancel</button>
|
||||||
<button class="button-success" id="startSymmetricPlan">Launch Cluster</button>
|
<button class="button-notification" id="test-all-connections">Test all connections</button>
|
||||||
|
<button class="button-neutral" id="startSymmetricPlan">Launch Cluster</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
</div>
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -11,10 +11,12 @@
|
||||||
modal: templateEngine.createTemplate("waitModal.ejs"),
|
modal: templateEngine.createTemplate("waitModal.ejs"),
|
||||||
|
|
||||||
events: {
|
events: {
|
||||||
"click #startSymmetricPlan": "startPlan",
|
"click #startSymmetricPlan" : "startPlan",
|
||||||
"click .add": "addEntry",
|
"click .add" : "addEntry",
|
||||||
"click .delete": "removeEntry",
|
"click .delete" : "removeEntry",
|
||||||
"click #cancel": "cancel"
|
"click #cancel" : "cancel",
|
||||||
|
"focusout .host" : "autoCheckConnections",
|
||||||
|
"focusout .port" : "autoCheckConnections"
|
||||||
},
|
},
|
||||||
|
|
||||||
cancel: function() {
|
cancel: function() {
|
||||||
|
@ -95,6 +97,9 @@
|
||||||
},
|
},
|
||||||
|
|
||||||
addEntry: function() {
|
addEntry: function() {
|
||||||
|
//disable launch button
|
||||||
|
this.disableLaunchButton();
|
||||||
|
|
||||||
$("#server_list").append(this.entryTemplate.render({
|
$("#server_list").append(this.entryTemplate.render({
|
||||||
isSymmetric: this.isSymmetric,
|
isSymmetric: this.isSymmetric,
|
||||||
isFirst: false,
|
isFirst: false,
|
||||||
|
@ -107,6 +112,7 @@
|
||||||
|
|
||||||
removeEntry: function(e) {
|
removeEntry: function(e) {
|
||||||
$(e.currentTarget).closest(".control-group").remove();
|
$(e.currentTarget).closest(".control-group").remove();
|
||||||
|
this.checkAllConnections();
|
||||||
},
|
},
|
||||||
|
|
||||||
render: function(isSymmetric) {
|
render: function(isSymmetric) {
|
||||||
|
@ -157,10 +163,94 @@
|
||||||
port: ''
|
port: ''
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
//initially disable lunch button
|
||||||
|
this.disableLaunchButton();
|
||||||
|
|
||||||
$(this.el).append(this.modal.render({}));
|
$(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');
|
||||||
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
}());
|
}());
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -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;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,5 +1,5 @@
|
||||||
<script id="navigationView.ejs" type="text/template">
|
<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 id="dbSelect" class="dropdown databases-menu"></li>
|
||||||
<li class="collections-menu"><a id="collections" class="tab" href="#collections">Collections</a></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>
|
<li class="graphviewer-menu"><a id="graph" class="tab" href="#graph">Graphs</a></li>
|
||||||
|
@ -58,7 +58,7 @@
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<select id="arangoCollectionSelect">
|
<select id="arangoCollectionSelect" class="arango-collection-select">
|
||||||
<option value="" selected="selected">Select</option>
|
<option value="" selected="selected">Select</option>
|
||||||
<option value="#">Dashboard</option>
|
<option value="#">Dashboard</option>
|
||||||
|
|
||||||
|
|
|
@ -51,7 +51,7 @@
|
||||||
error: function (data) {
|
error: function (data) {
|
||||||
self.isOffline = true;
|
self.isOffline = true;
|
||||||
self.isOfflineCounter++;
|
self.isOfflineCounter++;
|
||||||
if (self.isOfflineCounter >= 3) {
|
if (self.isOfflineCounter >= 2) {
|
||||||
arangoHelper.arangoError("Server", "Server is offline");
|
arangoHelper.arangoError("Server", "Server is offline");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -58,3 +58,13 @@ a.dbserver {
|
||||||
right: 60px;
|
right: 60px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.cluster-connection-check-success {
|
||||||
|
color: $c-positive;
|
||||||
|
margin-left: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cluster-connection-check-fail {
|
||||||
|
color: $c-negative;
|
||||||
|
margin-left: 20px;
|
||||||
|
}
|
|
@ -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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -2648,6 +2648,14 @@ a.dbserver.single {
|
||||||
a.dbserver.double {
|
a.dbserver.double {
|
||||||
right: 60px; }
|
right: 60px; }
|
||||||
|
|
||||||
|
.cluster-connection-check-success {
|
||||||
|
color: #8aa051;
|
||||||
|
margin-left: 20px; }
|
||||||
|
|
||||||
|
.cluster-connection-check-fail {
|
||||||
|
color: #da4f49;
|
||||||
|
margin-left: 20px; }
|
||||||
|
|
||||||
.machineClass {
|
.machineClass {
|
||||||
background-color: #e1e1e1;
|
background-color: #e1e1e1;
|
||||||
margin-left: 31px;
|
margin-left: 31px;
|
||||||
|
|
|
@ -3644,6 +3644,22 @@ input.gv-radio-button {
|
||||||
.snippet-no-num .sh_array {
|
.snippet-no-num .sh_array {
|
||||||
color: #00f; }
|
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 {
|
.arangoDataTable {
|
||||||
border-spacing: 0 0;
|
border-spacing: 0 0;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|
|
@ -57,6 +57,8 @@
|
||||||
@import 'collection';
|
@import 'collection';
|
||||||
// Snippet coloring (docs view)
|
// Snippet coloring (docs view)
|
||||||
@import 'snippet';
|
@import 'snippet';
|
||||||
|
// screen sizes
|
||||||
|
@import 'screenSizes';
|
||||||
|
|
||||||
// Data Tables, TODO: might all be superflous
|
// Data Tables, TODO: might all be superflous
|
||||||
@import 'dataTables';
|
@import 'dataTables';
|
||||||
|
|
|
@ -126,7 +126,6 @@
|
||||||
"frontend/css/nv.d3.css",
|
"frontend/css/nv.d3.css",
|
||||||
"frontend/css/swaggerView.css",
|
"frontend/css/swaggerView.css",
|
||||||
"frontend/css/ansi.css",
|
"frontend/css/ansi.css",
|
||||||
"frontend/css/screenSizes.css",
|
|
||||||
"frontend/css/jsoneditor.css",
|
"frontend/css/jsoneditor.css",
|
||||||
"frontend/ttf/arangofont/style.css"
|
"frontend/ttf/arangofont/style.css"
|
||||||
]
|
]
|
||||||
|
|
Loading…
Reference in New Issue