You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by xi...@apache.org on 2015/04/23 03:54:24 UTC

[1/2] ambari git commit: AMBARI-10674. Content shown in widgets must be confined to the widget space.(xiwang)

Repository: ambari
Updated Branches:
  refs/heads/trunk 387ca9df4 -> dc92b6d6b


AMBARI-10674. Content shown in widgets must be confined to the widget space.(xiwang)


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

Branch: refs/heads/trunk
Commit: dc92b6d6b58f3fba20c0485ee61435d14673129c
Parents: 1aea1d6
Author: Xi Wang <xi...@apache.org>
Authored: Wed Apr 22 16:25:47 2015 -0700
Committer: Xi Wang <xi...@apache.org>
Committed: Wed Apr 22 18:52:17 2015 -0700

----------------------------------------------------------------------
 ambari-web/app/styles/enhanced_service_dashboard.less   |  8 ++++++++
 .../app/templates/common/widget/number_widget.hbs       |  2 +-
 ambari-web/app/views/common/widget/gauge_widget_view.js |  4 ++--
 .../app/views/common/widget/number_widget_view.js       | 12 +++++++++++-
 4 files changed, 22 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/dc92b6d6/ambari-web/app/styles/enhanced_service_dashboard.less
----------------------------------------------------------------------
diff --git a/ambari-web/app/styles/enhanced_service_dashboard.less b/ambari-web/app/styles/enhanced_service_dashboard.less
index 3b9b56a..b4acfa9 100644
--- a/ambari-web/app/styles/enhanced_service_dashboard.less
+++ b/ambari-web/app/styles/enhanced_service_dashboard.less
@@ -79,12 +79,17 @@
       color: @health-status-green;
       font-weight: bold;
       font-size: 35px;
+      width: 95%;
+      position: absolute;
     }
     .template-widget,
     .number-widget {
       .frame;
       .content {
         padding-top: 70px;
+        height: 50px;
+        overflow: hidden;
+        text-overflow: ellipsis;
       }
     }
     .graph-widget {
@@ -115,6 +120,9 @@
     .green {
       color: @health-status-green;
     }
+    .grey {
+      color: #D6DDDF;
+    }
   }
 }
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/dc92b6d6/ambari-web/app/templates/common/widget/number_widget.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/common/widget/number_widget.hbs b/ambari-web/app/templates/common/widget/number_widget.hbs
index 59c5420..6bb82e3 100644
--- a/ambari-web/app/templates/common/widget/number_widget.hbs
+++ b/ambari-web/app/templates/common/widget/number_widget.hbs
@@ -28,7 +28,7 @@
     <a class="corner-icon pull-right" href="#" {{action editWidget target="view"}}>
       <i class="icon-edit"></i>
     </a>
-    <div {{bindAttr class="view.contentColor :content"}}>{{view.value}}</div>
+    <div {{bindAttr class="view.contentColor :content"}}>{{view.displayValue}}</div>
   {{else}}
     <div class="spinner"></div>
   {{/if}}

http://git-wip-us.apache.org/repos/asf/ambari/blob/dc92b6d6/ambari-web/app/views/common/widget/gauge_widget_view.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/common/widget/gauge_widget_view.js b/ambari-web/app/views/common/widget/gauge_widget_view.js
index 3eb49ef..3acfa10 100644
--- a/ambari-web/app/views/common/widget/gauge_widget_view.js
+++ b/ambari-web/app/views/common/widget/gauge_widget_view.js
@@ -73,8 +73,8 @@ App.GaugeWidgetView = Em.View.extend(App.WidgetMixin, {
 
     data: function () {
       var data = parseFloat(this.get('parentView.value')) * this.get('FACTOR');
-      if (isNaN(data)) return [0, this.get('MAX_VALUE')];
-      return [data, this.get('MAX_VALUE') - data];
+      if (isNaN(data) || data > this.get('MAX_VALUE')) return [0, this.get('MAX_VALUE')];
+      return [data.toFixed(0), this.get('MAX_VALUE') - data.toFixed(0)];
     }.property('parentView.value'),
 
     contentColor: function () {

http://git-wip-us.apache.org/repos/asf/ambari/blob/dc92b6d6/ambari-web/app/views/common/widget/number_widget_view.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/common/widget/number_widget_view.js b/ambari-web/app/views/common/widget/number_widget_view.js
index 0a4523e..fc8a53b 100644
--- a/ambari-web/app/views/common/widget/number_widget_view.js
+++ b/ambari-web/app/views/common/widget/number_widget_view.js
@@ -26,6 +26,14 @@ App.NumberWidgetView = Em.View.extend(App.WidgetMixin, {
    */
   value: '',
 
+  displayValue: function () {
+    var value = parseFloat(this.get('value'));
+    if (isNaN(value)) return Em.I18n.t('common.na');
+    var value = value % 1 != 0? value.toFixed(2): value;
+    var unit = this.get('content.properties.display_unit')? this.get('content.properties.display_unit'): '';
+    return value + unit;
+  }.property('value'),
+
   /**
    * common metrics container
    * @type {Array}
@@ -41,7 +49,9 @@ App.NumberWidgetView = Em.View.extend(App.WidgetMixin, {
     var warningThreshold = parseFloat(this.get('content.properties.warning_threshold'));
     var errorThreshold = parseFloat(this.get('content.properties.error_threshold'));
 
-    if (isNaN(warningThreshold) || isNaN(errorThreshold) || value <= warningThreshold) {
+    if (isNaN(value)) {
+      return 'grey';
+    } else if (isNaN(warningThreshold) || isNaN(errorThreshold) || value <= warningThreshold) {
       return 'green';
     } else if (value <= errorThreshold) {
       return 'orange';


[2/2] ambari git commit: AMBARI-10668. Make the Widget Browser popup taller to occupy available screen space.(xiwang)

Posted by xi...@apache.org.
AMBARI-10668. Make the Widget Browser popup taller to occupy available screen space.(xiwang)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/1aea1d69
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/1aea1d69
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/1aea1d69

Branch: refs/heads/trunk
Commit: 1aea1d69a4ad546c9bb22f9ec3e0b60ed5efbf32
Parents: 387ca9d
Author: Xi Wang <xi...@apache.org>
Authored: Wed Apr 22 11:24:08 2015 -0700
Committer: Xi Wang <xi...@apache.org>
Committed: Wed Apr 22 18:52:17 2015 -0700

----------------------------------------------------------------------
 .../app/styles/enhanced_service_dashboard.less  | 173 ++++++++++---------
 1 file changed, 92 insertions(+), 81 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/1aea1d69/ambari-web/app/styles/enhanced_service_dashboard.less
----------------------------------------------------------------------
diff --git a/ambari-web/app/styles/enhanced_service_dashboard.less b/ambari-web/app/styles/enhanced_service_dashboard.less
index b669c2c..3b9b56a 100644
--- a/ambari-web/app/styles/enhanced_service_dashboard.less
+++ b/ambari-web/app/styles/enhanced_service_dashboard.less
@@ -431,98 +431,109 @@
   }
 }
 
-#widget-browser-popup {
-  min-width: 750px;
-  max-width: 900px;
-  #shared-mine-tabs {
-    a {
-      font-size: 15px;
+.sixty-percent-width-modal.widgets-browser-popup {
+  .modal {
+    max-height: 703px;
+    .modal-body {
+      max-height: 543px;
     }
   }
-  #services-filter-bar {
-    padding: 0px 10px 10px 10px;
-    a {
-      font-size: 14px;
-      padding: 5px 3px;
-      line-height: 30px;
-    }
-    a:hover {
-      cursor: pointer;
-    }
-    a.active {
-      color: #555555;
-      border: 1px #ddd solid;
-      border-bottom-style: none;
-    }
-    a.active:hover {
-      text-decoration: none;
-      cursor: default;
-    }
-  }
-  #widgets-info {
-    .widgets-info-container {
-      .span6.widget-info-section {
-        width: 44%;
-        height: 122px;
-        margin: 5px 15px;
-        padding-top: 10px;
-        padding-left: 5px;
+  
+  #widget-browser-popup {
+    min-width: 750px;
+    max-width: 900px;
+    #shared-mine-tabs {
+      a {
+        font-size: 15px;
+      }
+    }
+    #services-filter-bar {
+      padding: 0px 10px 10px 10px;
+      a {
+        font-size: 14px;
+        padding: 5px 3px;
+        line-height: 30px;
       }
-      .span6.widget-info-section:hover {
-        background-color: #eee;
-        .icon {
-          background-color: white;
-        }
+      a:hover {
+        cursor: pointer;
       }
-      .icon {
-        border: 1px solid #ddd;
-        .widget-icon-image {
-          img {
-            display: block;
-            margin: 5px auto;
-          }
-        }
+      a.active {
+        color: #555555;
+        border: 1px #ddd solid;
+        border-bottom-style: none;
       }
-      .label-description {
-        padding-top: 5px;
-        .label-text {
-          display: block;
-          font-size: 14px;
-          font-weight: bold;
-          margin-bottom: 1px;
-          white-space: nowrap;
-          overflow: hidden;
-          text-overflow: ellipsis;
+      a.active:hover {
+        text-decoration: none;
+        cursor: default;
+      }
+    }
+    #widgets-info {
+      .widgets-info-container {
+        .span6.widget-info-section {
+          width: 44%;
+          height: 122px;
+          margin: 5px 15px;
+          padding-top: 10px;
+          padding-left: 5px;
         }
-        .description-text {
-          font-size: 12px;
-          display: block;
-          color: #808080;
-          overflow: hidden;
-          text-overflow: ellipsis;
-          height: 60px;
+        .span6.widget-info-section:hover {
+          background-color: #eee;
+          .icon {
+            background-color: white;
+          }
         }
-      }
-      .widget-section-actions {
-        position: relative;
-        top: -30px;
-        right: 5px;
-        .btn {
-          padding: 3px 8px;
-          width: 60px;
+        .icon {
+          border: 1px solid #ddd;
+          .widget-icon-image {
+            img {
+              display: block;
+              margin: 5px auto;
+            }
+          }
         }
-        .added-btn {
-          margin-left: 63px;;
+        .label-description {
+          padding-top: 5px;
+          .label-text {
+            display: block;
+            font-size: 14px;
+            font-weight: bold;
+            margin-bottom: 1px;
+            white-space: nowrap;
+            overflow: hidden;
+            text-overflow: ellipsis;
+          }
+          .description-text {
+            font-size: 12px;
+            display: block;
+            color: #808080;
+            overflow: hidden;
+            text-overflow: ellipsis;
+            height: 60px;
+          }
         }
-        .dropdown-menu {
-          min-width: 110px;
-          left: 0px;
+        .widget-section-actions {
+          position: relative;
+          top: -30px;
+          right: 5px;
+          .btn {
+            padding: 3px 8px;
+            width: 60px;
+          }
+          .added-btn {
+            margin-left: 63px;;
+          }
+          .dropdown-menu {
+            min-width: 110px;
+            left: 0px;
+          }
         }
       }
-    }
-    .no-widgets-text {
-      padding-left: 20px;
-      color: #808080;
+      .no-widgets-text {
+        padding-left: 20px;
+        color: #808080;
+      }
     }
   }
 }
+
+