You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by jo...@apache.org on 2014/09/19 19:19:21 UTC

[13/29] git commit: AMBARI-7385. Slider View: Multiple fixes for failed app (alexantonenko)

AMBARI-7385. Slider View: Multiple fixes for failed app (alexantonenko)


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

Branch: refs/heads/branch-alerts-dev
Commit: d7b09b61a996772f1ad44d728b53d4306c1a95c3
Parents: 44fbcce
Author: Alex Antonenko <hi...@gmail.com>
Authored: Thu Sep 18 16:04:27 2014 +0300
Committer: Alex Antonenko <hi...@gmail.com>
Committed: Fri Sep 19 11:43:07 2014 +0300

----------------------------------------------------------------------
 .../ui/app/controllers/slider_app_controller.js | 22 ++++++++++++++---
 .../resources/ui/app/styles/application.less    | 21 +++++++++++++++-
 .../resources/ui/app/templates/application.hbs  |  2 +-
 .../resources/ui/app/templates/slider_app.hbs   | 26 +++++++++++---------
 .../ui/app/templates/slider_title_tooltip.hbs   |  4 ++-
 5 files changed, 56 insertions(+), 19 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/d7b09b61/contrib/views/slider/src/main/resources/ui/app/controllers/slider_app_controller.js
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/resources/ui/app/controllers/slider_app_controller.js b/contrib/views/slider/src/main/resources/ui/app/controllers/slider_app_controller.js
index 2779a57..d1bfccf 100644
--- a/contrib/views/slider/src/main/resources/ui/app/controllers/slider_app_controller.js
+++ b/contrib/views/slider/src/main/resources/ui/app/controllers/slider_app_controller.js
@@ -22,10 +22,24 @@ App.SliderAppController = Ember.ObjectController.extend({
    * List of Slider App tabs
    * @type {{title: string, linkTo: string}[]}
    */
-  sliderAppTabs: Ember.A([
-    Ember.Object.create({title: Ember.I18n.t('common.summary'), linkTo: 'slider_app.summary'}),
-    Ember.Object.create({title: Ember.I18n.t('common.configs'), linkTo: 'slider_app.configs'})
-  ]),
+  sliderAppTabs: function () {
+    var configs = this.get("model.configs");
+    var tabs = Ember.A([
+      Ember.Object.create({title: Ember.I18n.t('common.summary'), linkTo: 'slider_app.summary'})
+    ]);
+    if(typeof configs == "object" && Object.keys(configs).length > 0){
+      tabs.pushObject(Ember.Object.create({title: Ember.I18n.t('common.configs'), linkTo: 'slider_app.configs'}));
+    }
+    return tabs;
+  }.property('model.configs'),
+
+  /**
+   * Do we have quicklinks ?
+   * @type {bool}
+   */
+  weHaveQuicklinks: function () {
+    return (Em.get(this.get('model'), 'quickLinks.content.content.length') > 0);
+  }.property('model.quickLinks.content.content.length'),
 
   /**
    * List of available for model actions

http://git-wip-us.apache.org/repos/asf/ambari/blob/d7b09b61/contrib/views/slider/src/main/resources/ui/app/styles/application.less
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/resources/ui/app/styles/application.less b/contrib/views/slider/src/main/resources/ui/app/styles/application.less
index 90f10d7..44c6487 100644
--- a/contrib/views/slider/src/main/resources/ui/app/styles/application.less
+++ b/contrib/views/slider/src/main/resources/ui/app/styles/application.less
@@ -562,6 +562,9 @@ a {
     td:first-child {
       text-align: right;
     }
+    span{
+      word-break: break-all;
+    }
   }
   .panel-components {
     .status {
@@ -852,4 +855,20 @@ a {
     color: #ffffff;
     background-color: #51a351;
   }
-}
\ No newline at end of file
+}
+.slider-app-title {
+  font-style: italic;
+  cursor: pointer;
+}
+.popover.bottom{
+  .popover-content{
+    background: #ffffff;
+    background: -moz-linear-gradient(top,  #f7f7f7 0%, #f7f7f7 18%, #ffffff 19%, #ffffff 100%);
+    background: -webkit-gradient(linear, top, top, color-stop(0%,#f7f7f7), color-stop(18%,#f7f7f7), color-stop(19%,#ffffff), color-stop(100%,#ffffff));
+    background: -webkit-linear-gradient(top,  #f7f7f7 0%,#f7f7f7 18%,#ffffff 19%,#ffffff 100%);
+    background: -o-linear-gradient(top,  #f7f7f7 0%,#f7f7f7 18%,#ffffff 19%,#ffffff 100%);
+    background: -ms-linear-gradient(top,  #f7f7f7 0%,#f7f7f7 18%,#ffffff 19%,#ffffff 100%);
+    background: linear-gradient(to bottom,  #f7f7f7 0%,#f7f7f7 18%,#ffffff 19%,#ffffff 100%);
+    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f7f7f7', endColorstr='#ffffff',GradientType=1 );
+  }
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/d7b09b61/contrib/views/slider/src/main/resources/ui/app/templates/application.hbs
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/resources/ui/app/templates/application.hbs b/contrib/views/slider/src/main/resources/ui/app/templates/application.hbs
index 439c3a3..625eaca 100755
--- a/contrib/views/slider/src/main/resources/ui/app/templates/application.hbs
+++ b/contrib/views/slider/src/main/resources/ui/app/templates/application.hbs
@@ -18,7 +18,7 @@
 
 <div>
   {{#view view.SliderTitleView}}
-    <h1>{{t slider.apps.title}} - <span {{bs-bind-popover view.popover}}>{{App.instance}}</span></h1>
+    <h1>{{t slider.apps.title}} - <span class="slider-app-title" {{bs-bind-popover view.popover}}>{{App.instance}}</span></h1>
   {{/view}}
 </div>
 {{#if App.viewEnabled}}

http://git-wip-us.apache.org/repos/asf/ambari/blob/d7b09b61/contrib/views/slider/src/main/resources/ui/app/templates/slider_app.hbs
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/resources/ui/app/templates/slider_app.hbs b/contrib/views/slider/src/main/resources/ui/app/templates/slider_app.hbs
index f435bdf..8e4b0df 100644
--- a/contrib/views/slider/src/main/resources/ui/app/templates/slider_app.hbs
+++ b/contrib/views/slider/src/main/resources/ui/app/templates/slider_app.hbs
@@ -40,18 +40,20 @@
     </div>
   </div>
 
-  <div class="col-md-3 quick-links-wrapper pull-right">
-    <ul class="nav nav-pills move">
-      <li class="dropdown">
-        <a class="dropdown-toggle" data-toggle="dropdown" href="#">{{t common.quickLinks}}<b class="caret"></b></a>
-        <ul class="dropdown-menu">
-          {{#each quickLink in model.quickLinks}}
-            <li><a {{bind-attr href="quickLink.url"}} target="_blank">{{quickLink.label}}</a></li>
-          {{/each}}
-        </ul>
-      </li>
-    </ul>
-  </div>
+  {{#if weHaveQuicklinks}}
+    <div class="col-md-3 quick-links-wrapper pull-right">
+      <ul class="nav nav-pills move">
+        <li class="dropdown">
+          <a class="dropdown-toggle" data-toggle="dropdown" href="#">{{t common.quickLinks}}<b class="caret"></b></a>
+          <ul class="dropdown-menu">
+            {{#each quickLink in model.quickLinks}}
+              <li><a {{bind-attr href="quickLink.url"}} target="_blank">{{quickLink.label}}</a></li>
+            {{/each}}
+          </ul>
+        </li>
+      </ul>
+    </div>
+  {{/if}}
 
   {{bs-tabs contentBinding="sliderAppTabs" default="summary"}}
   <div style="margin-top: 20px;">

http://git-wip-us.apache.org/repos/asf/ambari/blob/d7b09b61/contrib/views/slider/src/main/resources/ui/app/templates/slider_title_tooltip.hbs
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/resources/ui/app/templates/slider_title_tooltip.hbs b/contrib/views/slider/src/main/resources/ui/app/templates/slider_title_tooltip.hbs
index 3d3e03e..1b80aa2 100644
--- a/contrib/views/slider/src/main/resources/ui/app/templates/slider_title_tooltip.hbs
+++ b/contrib/views/slider/src/main/resources/ui/app/templates/slider_title_tooltip.hbs
@@ -17,7 +17,9 @@
 }}
 
 <div class="slider-name-popover">
-  <h3><strong>{{App.instance}}</strong></h3>
+  <div class="header">
+    <h3><strong>{{App.instance}}</strong></h3>
+  </div>
   {{#each config in view.content}}
     <div class="row">
       <div class="col-md-4">{{humanize config.name}}</div>