Permalink
Browse files

killed no more used OverviewSection.startJoinCluster

Change-Id: I6065d1de7f56ca4b396a5c6cd2ecae16288d4e77
Reviewed-on: http://review.northscale.com:8080/820
Reviewed-by: Matt Ingenthron <matt@northscale.com>
Tested-by: Matt Ingenthron <matt@northscale.com>
  • Loading branch information...
1 parent 9aa3faa commit 0fd5311ebe477b0a6030a2794bc38b5b248f5271 Aliaksey Kandratsenka committed with Matt Ingenthron Jun 21, 2010
Showing with 1 addition and 66 deletions.
  1. +0 −62 deps/menelaus/priv/js/app.js
  2. +1 −4 deps/menelaus/priv/public/index.html
@@ -969,65 +969,6 @@ var OverviewSection = {
$('.active_node_count').text(ViewHelpers.count(activeNodeCount, "active node"));
},
- startJoinCluster: function () {
- var dialog = $('#join_cluster_dialog');
- var form = dialog.find('form');
- $('#join_cluster_dialog_errors_container').empty();
- $('#join_cluster_dialog form').get(0).reset();
- dialog.find("input:not([type]), input[type=text], input[type=password]").not('[name=clusterMemberHostIp], [name=clusterMemberPort]').val('');
-
- $('#join_cluster_dialog_errors_container').empty();
-
- showDialog('join_cluster_dialog', {
- onHide: function () {
- form.unbind('submit');
- }});
- form.bind('submit', function (e) {
- e.preventDefault();
-
- function simpleValidation() {
- var p = {};
- _.each("clusterMemberHostIp user password".split(' '), function (name) {
- p[name] = form.find('[name=' + name + ']').val();
- });
-
- var errors = [];
-
- if (p['clusterMemberHostIp'] == "")
- errors.push("Web Console IP Address cannot be blank.");
- if (p['clusterMemberPort'] == '')
- errors.push("Web Console Port cannot be blank.");
- if ((p['user'] || p['password']) && !(p['user'] && p['password'])) {
- errors.push("Username and Password must either both be present or missing.");
- }
-
- return errors;
- }
-
- var errors = simpleValidation();
- if (errors.length) {
- renderTemplate('join_cluster_dialog_errors', errors);
- return;
- }
-
- var overlay = overlayWithSpinner(form);
-
- postWithValidationErrors('/node/controller/doJoinCluster', form, function (data, status) {
- if (status != 'success') {
- overlay.remove();
- renderTemplate('join_cluster_dialog_errors', data)
- } else {
- var user = form.find('[name=user]').val();
- var password = form.find('[name=password]').val();
- DAO.setAuthCookie(user, password);
- $.cookie('cluster_join_flash', '1');
- reloadAppWithDelay(5000);
- }
- }, {
- timeout: 7000
- })
- });
- },
leaveCluster: function () {
showDialog("eject_confirmation_dialog", {
eventBindings: [['.save_button', 'click', function (e) {
@@ -1398,9 +1339,6 @@ var ServersSection = {
},
onAdd: function () {
var self = this;
- // cut & pasted from OverviewSection.startJoinCluster 'cause we're
- // reusing it's cluster join dialog for
- // now. OverviewSection.startJoinCluster will probably die soon
var dialog = $('#join_cluster_dialog');
var form = dialog.find('form');
@@ -89,7 +89,7 @@ <h2 class="header_2" id="get_started_expander"><span class="expander_2 block">&n
<div class="right">
<div class="pad">
<span id="join_leave_switch" class="join-possible">
- <a id="cluster_join_button" class="button_big" href="javascript:OverviewSection.startJoinCluster();">
+ <a id="cluster_join_button" class="button_big">
Join Cluster
</a>
<a id="cluster_leave_button" class="button_big" href="javascript:OverviewSection.leaveCluster();">
@@ -123,9 +123,6 @@ <h1>Status</h1>
<div class="labeled_line">
<h2 class="label">Cluster Health:</h2>
<div class="line_cnt">
- {% if (canJoinCluster) { %}
- <a href="javascript:OverviewSection.startJoinCluster();" class="button_medium float_right" style="margin-top:-9px;">Join Cluster</a>
- {% }; %}
<div class="alert_1">{%= V.setAttribute('class', isWarning ? 'warning_1' : '') %}{%= V.setAttribute('class', isCritical ? 'critical_1' : '') %}</div>
<a href="javascript:nav.go('alerts');">{% if (isCritical) { %}Critical{% } else if (isWarning) { %}Warning{% } else { %}Healthy{% } %}</a>
<span class="comment">({%= h(V.count(nodesCount, 'server node')) %} managing <a href="javascript:nav.go('buckets');">{%=h(V.count(bucketsCount, 'bucket'))%}</a>)</span>

0 comments on commit 0fd5311

Please sign in to comment.