You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by yu...@apache.org on 2013/06/19 02:04:37 UTC
svn commit: r1494397 - in /incubator/ambari/trunk/ambari-web/app:
messages.js styles/application.less templates/main/dashboard.hbs
templates/main/dashboard/plus_button_filter.hbs views/main/dashboard.js
Author: yusaku
Date: Wed Jun 19 00:04:37 2013
New Revision: 1494397
URL: http://svn.apache.org/r1494397
Log:
AMBARI-2426. Set default widgets to show for the Dashboard. (Xi Wang via yusaku)
Modified:
incubator/ambari/trunk/ambari-web/app/messages.js
incubator/ambari/trunk/ambari-web/app/styles/application.less
incubator/ambari/trunk/ambari-web/app/templates/main/dashboard.hbs
incubator/ambari/trunk/ambari-web/app/templates/main/dashboard/plus_button_filter.hbs
incubator/ambari/trunk/ambari-web/app/views/main/dashboard.js
Modified: incubator/ambari/trunk/ambari-web/app/messages.js
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/messages.js?rev=1494397&r1=1494396&r2=1494397&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/messages.js (original)
+++ incubator/ambari/trunk/ambari-web/app/messages.js Wed Jun 19 00:04:37 2013
@@ -997,6 +997,7 @@ Em.I18n.translations = {
'dashboard.button.switch': 'Switch to classic dashboard',
'dashboard.button.switchShort': 'Switch',
'dashboard.button.reset': 'Reset all widgets to default ',
+ 'dashboard.button.gangliaLink': 'View metrics in Ganglia',
'dashboard.widgets.NameNodeHeap': 'NameNode Heap',
'dashboard.widgets.NameNodeCpu': 'NameNode CPU WIO',
Modified: incubator/ambari/trunk/ambari-web/app/styles/application.less
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/styles/application.less?rev=1494397&r1=1494396&r2=1494397&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/styles/application.less (original)
+++ incubator/ambari/trunk/ambari-web/app/styles/application.less Wed Jun 19 00:04:37 2013
@@ -1918,46 +1918,51 @@ table.graphs {
#dashboard-widgets-container{
h4{
line-height: 30px;
+ margin-bottom: 0px;
+ margin-top: 0px;
}
- .filter-components{
- right: 0;
- left: auto;
- li {
- ul{
- margin-left: 0px;
- }
- display: block;
- padding: 3px 0 3px 5px;
- line-height: 20px;
-
- label.checkbox {
- padding-left: 3px;
- }
- input[type="checkbox"] {
- margin: 4px 4px 2px 2px;
- }
- }
- &>li {
- &>ul {
- width: 180px;
- margin-left: 0;
- }
- }
- }
.add-widget-button{
- color: #000000;
- margin-top: 5px;
+ margin-top: 0px;
margin-left: -22px;
width: 70px;
+ .add-button{
+ color: #666666;
+ }
+ .filter-components{
+ color: #333333;
+ right: 0;
+ left: auto;
+ li {
+ display: block;
+ padding: 3px 0 3px 5px;
+ line-height: 20px;
+ ul{
+ margin-left: 0px;
+ }
+ label.checkbox {
+ padding-left: 3px;
+ }
+ input[type="checkbox"] {
+ margin: 4px 4px 2px 2px;
+ }
+ }
+ &>li {
+ &>ul {
+ width: 180px;
+ margin-left: 0;
+ }
+ }
+ }
}
.more-options-button{
- margin-top: 5px;
+ margin-top: 0px;
margin-left: 0px;
margin-right: 6px;
padding: 1px;
width: 70px;
.icon-cog{
+ color: #666666;
font-size: 18px;
position: relative;
left: 3px;
Modified: incubator/ambari/trunk/ambari-web/app/templates/main/dashboard.hbs
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/templates/main/dashboard.hbs?rev=1494397&r1=1494396&r2=1494397&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/templates/main/dashboard.hbs (original)
+++ incubator/ambari/trunk/ambari-web/app/templates/main/dashboard.hbs Wed Jun 19 00:04:37 2013
@@ -83,22 +83,28 @@
<a class="add-widget-button span1">{{view view.plusButtonFilterView}}</a>
<div class="btn-group">
<button class="btn dropdown-toggle span1 more-options-button" data-toggle="dropdown">
- <i class="icon-cog"></i>
- <span class= "caret"></span>
+ <i class="icon-cog"></i>
+ <span class= "caret"></span>
</button>
<ul class="dropdown-menu right-align-dropdown">
<li>
- <a class="" {{action "resetAllWidgets" target="view"}}>
+ <a {{action "resetAllWidgets" target="view"}}>
<i class="icon-refresh"></i>
{{t dashboard.button.reset}}
</a>
</li>
<li>
- <a class="" {{action "switchToClassic" target="view"}}>
+ <a {{action "switchToClassic" target="view"}}>
<i class="icon-backward"></i>
{{t dashboard.button.switch}}
</a>
</li>
+ <li>
+ <a target="_blank" {{bindAttr href="view.gangliaUrl"}}>
+ <i class="icon-share"></i>
+ {{t dashboard.button.gangliaLink}}
+ </a>
+ </li>
</ul>
</div>
</div>
Modified: incubator/ambari/trunk/ambari-web/app/templates/main/dashboard/plus_button_filter.hbs
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/templates/main/dashboard/plus_button_filter.hbs?rev=1494397&r1=1494396&r2=1494397&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/templates/main/dashboard/plus_button_filter.hbs (original)
+++ incubator/ambari/trunk/ambari-web/app/templates/main/dashboard/plus_button_filter.hbs Wed Jun 19 00:04:37 2013
@@ -16,7 +16,7 @@
* limitations under the License.
}}
-<button class="btn single-btn-group" {{action "clickFilterButton" target="view"}} >
+<button class="btn single-btn-group add-button" {{action "clickFilterButton" target="view"}} >
<i class="icon-plus"></i> <span style="font-weight: bold">{{t common.add}}</span>
</button>
<ul class="dropdown-menu filter-components" >
@@ -42,6 +42,9 @@
<li>{{t dashboard.widgets.nothing}}</li>
</ul>
</li>
- <button class="btn" {{action "closeFilter" target="view"}}>{{t common.cancel}}</button>
+ <li>
+ <button class="btn" {{action "closeFilter" target="view"}}>{{t common.cancel}}</button>
+ </li>
+
{{/if}}
</ul>
Modified: incubator/ambari/trunk/ambari-web/app/views/main/dashboard.js
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/views/main/dashboard.js?rev=1494397&r1=1494396&r2=1494397&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/views/main/dashboard.js (original)
+++ incubator/ambari/trunk/ambari-web/app/views/main/dashboard.js Wed Jun 19 00:04:37 2013
@@ -194,7 +194,11 @@ App.MainDashboardView = Em.View.extend({
// called when first load/refresh/jump back page
this.getUserPref(this.get('persistKey'));
var currentPrefObject = this.get('currentPrefObject');
- if (currentPrefObject) {
+ if (currentPrefObject) { // fit for no dashboard version
+ if (!currentPrefObject.dashboardVersion) {
+ currentPrefObject.dashboardVersion = 'new';
+ this.postUserPref(this.get('persistKey'), currentPrefObject);
+ }
this.translateToReal(currentPrefObject);
} else {
// post persist then translate init object
@@ -237,10 +241,11 @@ App.MainDashboardView = Em.View.extend({
initPrefObject: Em.Object.create({
dashboardVersion: 'new',
visible: [
- '11', '12', '13', '14', //cluster-metrics
- '1', '2', '3', '4', '5', '15', '17', //hdfs
- '6', '7', '8', '9', '10', '18', '16',//map reduce
- '20', '21', '19', '23' //hbase
+ '2', '4', '8', '10',
+ '17', '11', '12', '13', '14',
+ '18', '1', '6', '5', '9',
+ '3', '7', '15', '16', '20',
+ '19', '21', '23'
], // all in order
hidden: [['22','Region In Transition']],
threshold: {1: [80, 90], 2: [85, 95], 3: [90, 95], 4: [80, 90], 5: [1000, 3000], 6: [70, 90], 7: [90, 95], 8: [50, 75], 9: [30000, 120000],