You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by bm...@apache.org on 2013/07/16 01:18:07 UTC

git commit: Added a default cluster name and added a tooltip for setting --cluster in the WebUI.

Updated Branches:
  refs/heads/master b94026218 -> 3f89d05a2


Added a default cluster name and added a tooltip for setting --cluster
in the WebUI.

From: Ross Allen <ro...@mesosphe.re>
Review: https://reviews.apache.org/r/12394


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/3f89d05a
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/3f89d05a
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/3f89d05a

Branch: refs/heads/master
Commit: 3f89d05a2e807de0ee161f6d3904a40ac99921ff
Parents: b940262
Author: Benjamin Mahler <bm...@twitter.com>
Authored: Mon Jul 15 15:44:06 2013 -0700
Committer: Benjamin Mahler <bm...@twitter.com>
Committed: Mon Jul 15 15:44:07 2013 -0700

----------------------------------------------------------------------
 src/webui/master/static/controllers.js      |  6 +++++-
 src/webui/master/static/home.html           | 10 +++++++++-
 src/webui/master/static/slave.html          | 10 +++++++++-
 src/webui/master/static/slave_executor.html | 10 +++++++++-
 4 files changed, 32 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/3f89d05a/src/webui/master/static/controllers.js
----------------------------------------------------------------------
diff --git a/src/webui/master/static/controllers.js b/src/webui/master/static/controllers.js
index 07d837a..d81b4fc 100644
--- a/src/webui/master/static/controllers.js
+++ b/src/webui/master/static/controllers.js
@@ -129,12 +129,16 @@ function update($scope, $timeout, data) {
           $scope.redirect = $scope.redirect - 1000;
           $timeout(countdown, 1000);
         }
-      }
+      };
       countdown();
       return false; // Don't continue polling.
     }
   }
 
+  // A cluster is named if the state returns a non-empty string name.
+  // Track whether this cluster is named in a Boolean for display purposes.
+  $scope.clusterNamed = !!$scope.state.cluster;
+
   // Check for selected text, and allow up to 20 seconds to pass before
   // potentially wiping the user highlighted text.
   // TODO(bmahler): This is to avoid the annoying loss of highlighting when

http://git-wip-us.apache.org/repos/asf/mesos/blob/3f89d05a/src/webui/master/static/home.html
----------------------------------------------------------------------
diff --git a/src/webui/master/static/home.html b/src/webui/master/static/home.html
index f06b364..d45cc94 100644
--- a/src/webui/master/static/home.html
+++ b/src/webui/master/static/home.html
@@ -10,7 +10,15 @@
     <div class="well">
       <dl class="inline clearfix">
         <dt>Cluster:</dt>
-        <dd>{{state.cluster}}</dd>
+        <dd>
+          <span ng-show="clusterNamed">{{state.cluster}}</span>
+          <span ng-show="!clusterNamed">
+            (Unnamed)
+            <i class="icon-info-sign"
+              tooltip="To name this cluster, set the --cluster flag when starting the master."
+              tooltip-placement="right"></i>
+          </span>
+        </dd>
         <dt>Server:</dt>
         <dd>{{state.pid.split("@")[1]}}</dd>
         <dt>Built:</dt>

http://git-wip-us.apache.org/repos/asf/mesos/blob/3f89d05a/src/webui/master/static/slave.html
----------------------------------------------------------------------
diff --git a/src/webui/master/static/slave.html b/src/webui/master/static/slave.html
index a80b837..c923644 100644
--- a/src/webui/master/static/slave.html
+++ b/src/webui/master/static/slave.html
@@ -19,7 +19,15 @@
     <div class="well">
       <dl class="inline clearfix">
         <dt>Cluster:</dt>
-        <dd>{{cluster}}</dd>
+        <dd>
+          <span ng-show="clusterNamed">{{cluster}}</span>
+          <span ng-show="!clusterNamed">
+            (Unnamed)
+            <i class="icon-info-sign"
+              tooltip="To name this cluster, set the --cluster flag when starting the master."
+              tooltip-placement="right"></i>
+          </span>
+        </dd>
         <dt>Master:</dt>
         <dd>{{state.master_hostname}}</dd>
         <dt>Started:</dt>

http://git-wip-us.apache.org/repos/asf/mesos/blob/3f89d05a/src/webui/master/static/slave_executor.html
----------------------------------------------------------------------
diff --git a/src/webui/master/static/slave_executor.html b/src/webui/master/static/slave_executor.html
index 4d7e8d0..c2c9528 100644
--- a/src/webui/master/static/slave_executor.html
+++ b/src/webui/master/static/slave_executor.html
@@ -36,7 +36,15 @@
 
       <dl class="inline clearfix">
         <dt>Cluster:</dt>
-        <dd>{{cluster}}</dd>
+        <dd>
+          <span ng-show="clusterNamed">{{cluster}}</span>
+          <span ng-show="!clusterNamed">
+            (Unnamed)
+            <i class="icon-info-sign"
+              tooltip="To name this cluster, set the --cluster flag when starting the master."
+              tooltip-placement="right"></i>
+          </span>
+        </dd>
         <dt>Master:</dt>
         <dd>{{state.master_hostname}}</dd>
       </dl>