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 2014/09/03 20:21:56 UTC
[1/2] git commit: AMBARI-7125. Config History: modify SCV box to show
date/time using 'ago' format (and show the absolute date/time in the
popover).(XI WANG)
Repository: ambari
Updated Branches:
refs/heads/trunk 7c3ea59fc -> ef2426271
AMBARI-7125. Config History: modify SCV box to show date/time using 'ago' format (and show the absolute date/time in the popover).(XI WANG)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/ef242627
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/ef242627
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/ef242627
Branch: refs/heads/trunk
Commit: ef2426271472b11bbfabdb70a088aa80b469e890
Parents: 0368417
Author: Xi Wang <xi...@apache.org>
Authored: Tue Sep 2 18:06:23 2014 -0700
Committer: Xi Wang <xi...@apache.org>
Committed: Wed Sep 3 11:21:16 2014 -0700
----------------------------------------------------------------------
ambari-web/app/models/service_config_version.js | 6 +++---
ambari-web/app/styles/application.less | 12 ++++++++++--
.../templates/common/configs/config_history_flow.hbs | 10 ++++++----
.../app/templates/main/dashboard/config_history.hbs | 2 +-
ambari-web/vendor/scripts/jquery.timeago.js | 6 +++---
5 files changed, 23 insertions(+), 13 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/ef242627/ambari-web/app/models/service_config_version.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/models/service_config_version.js b/ambari-web/app/models/service_config_version.js
index 8d5c6fd..1a3922c 100644
--- a/ambari-web/app/models/service_config_version.js
+++ b/ambari-web/app/models/service_config_version.js
@@ -51,11 +51,11 @@ App.ServiceConfigVersion = DS.Model.extend({
makeCurrentButtonText: function() {
return Em.I18n.t('dashboard.configHistory.info-bar.revert.versionButton').format(this.get('versionText'));
}.property('versionText'),
- modifiedDate: function () {
+ createdDate: function () {
return dateUtil.dateFormat(this.get('createTime'));
}.property('createTime'),
- shortModifiedDate: function () {
- return dateUtil.dateFormat(this.get('createTime'), 'MMM DD, YYYY');
+ timeSinceCreated: function () {
+ return $.timeago(this.get('createTime'));
}.property('createTime'),
/**
* determine whether ServiceConfigVersion is requested from server
http://git-wip-us.apache.org/repos/asf/ambari/blob/ef242627/ambari-web/app/styles/application.less
----------------------------------------------------------------------
diff --git a/ambari-web/app/styles/application.less b/ambari-web/app/styles/application.less
index 5d384ec..183106e 100644
--- a/ambari-web/app/styles/application.less
+++ b/ambari-web/app/styles/application.less
@@ -4982,11 +4982,9 @@ ul.inline li {
.top-label {
min-width: 20px;
padding: 5px;
- padding-bottom: 1px;
}
.content {
padding: 0 5px;
- line-height: 19px;
text-align: center;
color: #555555;
}
@@ -5016,6 +5014,11 @@ ul.inline li {
.notes{
word-wrap: break-word;
}
+ .date{
+ color: #808080;
+ font-size: 11px;
+ word-wrap: break-word;
+ }
}
.btn {
font-size: 13px;
@@ -5159,6 +5162,11 @@ ul.inline li {
cursor: default;
.content {
padding: 1px 5px 15px 5px;
+ .date{
+ color: #808080;
+ font-size: 11px;
+ word-wrap: break-word;
+ }
.notes{
word-wrap: break-word;
}
http://git-wip-us.apache.org/repos/asf/ambari/blob/ef242627/ambari-web/app/templates/common/configs/config_history_flow.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/common/configs/config_history_flow.hbs b/ambari-web/app/templates/common/configs/config_history_flow.hbs
index fe8f1eb..ec79fc2 100644
--- a/ambari-web/app/templates/common/configs/config_history_flow.hbs
+++ b/ambari-web/app/templates/common/configs/config_history_flow.hbs
@@ -36,12 +36,13 @@
{{/if}}
</div>
<div class="content">{{serviceVersion.author}}</div>
- <div class="content">{{serviceVersion.modifiedDate}}</div>
+ <div class="content">{{serviceVersion.timeSinceCreated}}</div>
</div>
<div class="version-popover">
<div class="content"> <strong>{{serviceVersion.displayName}}</strong> <span class="label label-info">{{serviceVersion.versionText}}</span>
<strong>{{t services.service.config.configHistory.configGroup}}:{{serviceVersion.configGroupName}}</strong>
+ <div class="date">{{serviceVersion.createdDate}}</div>
<div class="notes">{{serviceVersion.briefNotes}}</div>
</div>
<div class="version-operations-buttons">
@@ -72,7 +73,7 @@
<span class="label label-success">{{t common.current}}</span>
{{/if}}
<strong>{{view.compareServiceVersion.author}}</strong> {{t dashboard.configHistory.info-bar.authoredOn}}
- <strong>{{view.compareServiceVersion.modifiedDate}}</strong>
+ <strong>{{view.compareServiceVersion.createdDate}}</strong>
</div>
<div class="pull-right operations-button">
<button class="btn btn-success" {{action revert view.serviceVersionsReferences.compare target="view"}} {{bindAttr disabled="view.versionActionsDisabled" class="view.compareServiceVersion.isCurrent:hidden"}}>{{view.compareServiceVersion.makeCurrentButtonText}}</button>
@@ -91,13 +92,14 @@
<li {{bindAttr class=":pointer :dropdown-submenu serviceVersion.isDisplayed:not-allowed"}}>
<div class="row-fluid version-in-dropdown " {{action switchVersion serviceVersion target="view"}}>
<div class="span2">{{serviceVersion.versionText}}</div>
- <div class="span6">{{serviceVersion.modifiedDate}}</div>
+ <div class="span6">{{serviceVersion.createdDate}}</div>
<div class="span3">{{serviceVersion.author}}</div>
<div class="pull-right"><i class="icon-caret-right"></i></div>
</div>
<ul class="dropdown-menu version-info-operations">
<div class="content"> <strong>{{serviceVersion.displayName}}</strong> <span class="label label-info">{{serviceVersion.versionText}}</span>
<strong>{{t services.service.config.configHistory.configGroup}}:{{serviceVersion.configGroupName}}</strong>
+ <div class="date">{{serviceVersion.createdDate}}</div>
<div class="notes">{{serviceVersion.briefNotes}}</div>
</div>
<div class="version-operations-buttons">
@@ -123,7 +125,7 @@
{{#if view.displayedServiceVersion.isCurrent}}
<span class="label label-success">{{t common.current}}</span>
{{/if}}
- <strong>{{view.displayedServiceVersion.author}}</strong> {{t dashboard.configHistory.info-bar.authoredOn}} <strong>{{view.displayedServiceVersion.modifiedDate}}</strong>
+ <strong>{{view.displayedServiceVersion.author}}</strong> {{t dashboard.configHistory.info-bar.authoredOn}} <strong>{{view.displayedServiceVersion.createdDate}}</strong>
</div>
<div class="pull-right operations-button">
<div {{bindAttr class="view.displayedServiceVersion.isCurrent::hidden"}}>
http://git-wip-us.apache.org/repos/asf/ambari/blob/ef242627/ambari-web/app/templates/main/dashboard/config_history.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/dashboard/config_history.hbs b/ambari-web/app/templates/main/dashboard/config_history.hbs
index 9b2718b..8156e58 100644
--- a/ambari-web/app/templates/main/dashboard/config_history.hbs
+++ b/ambari-web/app/templates/main/dashboard/config_history.hbs
@@ -55,7 +55,7 @@
</span>
{{/if}}
</td>
- <td>{{item.modifiedDate}}</td>
+ <td>{{item.createdDate}}</td>
<td>{{item.author}}</td>
<td>{{item.briefNotes}}</td>
{{/view}}
http://git-wip-us.apache.org/repos/asf/ambari/blob/ef242627/ambari-web/vendor/scripts/jquery.timeago.js
----------------------------------------------------------------------
diff --git a/ambari-web/vendor/scripts/jquery.timeago.js b/ambari-web/vendor/scripts/jquery.timeago.js
index 41e7827..1614ccc 100644
--- a/ambari-web/vendor/scripts/jquery.timeago.js
+++ b/ambari-web/vendor/scripts/jquery.timeago.js
@@ -36,12 +36,12 @@
prefixFromNow: null,
suffixAgo: "ago",
suffixFromNow: "from now",
- seconds: "less than a minute",
+ seconds: "a moment",
minute: "about a minute",
minutes: "%d minutes",
hour: "about an hour",
- hours: "about %d hours",
- day: "a day",
+ hours: "%d hours",
+ day: "about a day",
days: "%d days",
month: "about a month",
months: "%d months",
[2/2] git commit: AMBARI-7122. Configs: when there is only one
version, dropdown list is empty.(XIWANG)
Posted by xi...@apache.org.
AMBARI-7122. Configs: when there is only one version, dropdown list is empty.(XIWANG)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/03684175
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/03684175
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/03684175
Branch: refs/heads/trunk
Commit: 03684175c8f75944de50c6975c6e89596e009c30
Parents: 7c3ea59
Author: Xi Wang <xi...@apache.org>
Authored: Tue Sep 2 15:18:32 2014 -0700
Committer: Xi Wang <xi...@apache.org>
Committed: Wed Sep 3 11:21:16 2014 -0700
----------------------------------------------------------------------
ambari-web/app/styles/application.less | 23 ++++++++++++++++----
.../common/configs/config_history_flow.hbs | 4 ++--
.../views/common/configs/config_history_flow.js | 3 ++-
3 files changed, 23 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/03684175/ambari-web/app/styles/application.less
----------------------------------------------------------------------
diff --git a/ambari-web/app/styles/application.less b/ambari-web/app/styles/application.less
index 3a63981..5d384ec 100644
--- a/ambari-web/app/styles/application.less
+++ b/ambari-web/app/styles/application.less
@@ -5120,16 +5120,31 @@ ul.inline li {
font-size: 13px;
li {
line-height: 30px;
+ .icon-caret-right {
+ font-size: 18px;
+ margin-right: 20px;
+ }
}
li:hover {
background-color: #666666;
background-image: linear-gradient(to bottom, #666666, #555555);
- color: white;
+ color: #ffffff;
}
- .icon-caret-right {
- font-size: 18px;
- margin-right: 20px;
+ li.not-allowed {
+ // the version which is displayed
+ cursor: not-allowed;
+ color: #808080;
+ .icon-caret-right,
+ .dropdown-menu {
+ display: none;
+ }
}
+ li.not-allowed:hover {
+ background-color: #ffffff;
+ background-image: none;
+ color: #808080;
+ }
+
div.row-fluid, a {
padding-left: 10px;
}
http://git-wip-us.apache.org/repos/asf/ambari/blob/03684175/ambari-web/app/templates/common/configs/config_history_flow.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/common/configs/config_history_flow.hbs b/ambari-web/app/templates/common/configs/config_history_flow.hbs
index 014950c..fe8f1eb 100644
--- a/ambari-web/app/templates/common/configs/config_history_flow.hbs
+++ b/ambari-web/app/templates/common/configs/config_history_flow.hbs
@@ -88,8 +88,8 @@
</button>
<ul class="dropdown-menu">
{{#each serviceVersion in view.dropDownList}}
- <li class="pointer dropdown-submenu">
- <div class="row-fluid version-in-dropdown" {{action switchVersion serviceVersion target="view"}}>
+ <li {{bindAttr class=":pointer :dropdown-submenu serviceVersion.isDisplayed:not-allowed"}}>
+ <div class="row-fluid version-in-dropdown " {{action switchVersion serviceVersion target="view"}}>
<div class="span2">{{serviceVersion.versionText}}</div>
<div class="span6">{{serviceVersion.modifiedDate}}</div>
<div class="span3">{{serviceVersion.author}}</div>
http://git-wip-us.apache.org/repos/asf/ambari/blob/03684175/ambari-web/app/views/common/configs/config_history_flow.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/common/configs/config_history_flow.js b/ambari-web/app/views/common/configs/config_history_flow.js
index 5813eeb..d7d8d3f 100644
--- a/ambari-web/app/views/common/configs/config_history_flow.js
+++ b/ambari-web/app/views/common/configs/config_history_flow.js
@@ -126,7 +126,7 @@ App.ConfigHistoryFlowView = Em.View.extend({
* by default 6 is number of items in short list
*/
dropDownList: function () {
- var serviceVersions = this.get('serviceVersions').without(this.get('displayedServiceVersion')).slice(0).reverse();
+ var serviceVersions = this.get('serviceVersions').slice(0).reverse();
if (this.get('showFullList')) {
return serviceVersions;
}
@@ -282,6 +282,7 @@ App.ConfigHistoryFlowView = Em.View.extend({
* switch configs view version to chosen
*/
switchVersion: function (event) {
+ if (event.context.get("isDisplayed")) return;
var version = event.context.get('version');
var versionIndex = 0;