You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ak...@apache.org on 2014/03/04 19:37:57 UTC
git commit: AMBARI-4941. Mirroring: Edit Dataset dialog shows
incorrect data. (akovalenko)
Repository: ambari
Updated Branches:
refs/heads/trunk 6fdec13f3 -> fdab4bd7f
AMBARI-4941. Mirroring: Edit Dataset dialog shows incorrect data. (akovalenko)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/fdab4bd7
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/fdab4bd7
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/fdab4bd7
Branch: refs/heads/trunk
Commit: fdab4bd7fbd1879905cb6eafaa74e634610ee088
Parents: 6fdec13
Author: Aleksandr Kovalenko <ak...@hortonworks.com>
Authored: Tue Mar 4 20:36:37 2014 +0200
Committer: Aleksandr Kovalenko <ak...@hortonworks.com>
Committed: Tue Mar 4 20:37:41 2014 +0200
----------------------------------------------------------------------
.../controllers/main/mirroring/edit_dataset_controller.js | 2 +-
.../main/mirroring/manage_clusters_controller.js | 2 +-
ambari-web/app/controllers/main/mirroring_controller.js | 2 +-
ambari-web/app/templates/main/mirroring/edit_dataset.hbs | 10 +++++-----
ambari-web/app/views/main/mirroring/edit_dataset_view.js | 8 ++++++--
ambari-web/app/views/main/mirroring/jobs_view.js | 2 +-
6 files changed, 15 insertions(+), 11 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/fdab4bd7/ambari-web/app/controllers/main/mirroring/edit_dataset_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/mirroring/edit_dataset_controller.js b/ambari-web/app/controllers/main/mirroring/edit_dataset_controller.js
index fa5b466..532323d 100644
--- a/ambari-web/app/controllers/main/mirroring/edit_dataset_controller.js
+++ b/ambari-web/app/controllers/main/mirroring/edit_dataset_controller.js
@@ -222,7 +222,7 @@ App.MainMirroringEditDataSetController = Ember.Controller.extend({
// Compose XML data, that will be sended to server
var dataToSend = '<?xml version="1.0"?><feed description="" name="' + datasetName + '" xmlns="uri:falcon:feed:0.1"><frequency>' + repeatOptionSelected + '(' + datasetFrequency + ')' +
'</frequency><clusters><cluster name="' + sourceCluster + '" type="source"><validity start="' + scheduleStartDateFormatted + '" end="' + scheduleEndDateFormatted +
- '"/><retention limit="days(7)" action="delete"/></cluster><cluster name="' + targetCluster + '" type="target"><validity start="' + scheduleStartDateFormatted + '" end="' + scheduleStartDateFormatted +
+ '"/><retention limit="days(7)" action="delete"/></cluster><cluster name="' + targetCluster + '" type="target"><validity start="' + scheduleStartDateFormatted + '" end="' + scheduleEndDateFormatted +
'"/><retention limit="months(1)" action="delete"/><locations><location type="data" path="' + targetDir + '" /></locations></cluster></clusters><locations><location type="data" path="' +
sourceDir + '" /></locations><ACL owner="hue" group="users" permission="0755" /><schema location="/none" provider="none"/></feed>';
if (this.get('isEdit')) {
http://git-wip-us.apache.org/repos/asf/ambari/blob/fdab4bd7/ambari-web/app/controllers/main/mirroring/manage_clusters_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/mirroring/manage_clusters_controller.js b/ambari-web/app/controllers/main/mirroring/manage_clusters_controller.js
index e345253..e6c7304 100644
--- a/ambari-web/app/controllers/main/mirroring/manage_clusters_controller.js
+++ b/ambari-web/app/controllers/main/mirroring/manage_clusters_controller.js
@@ -173,7 +173,7 @@ App.MainMirroringManageClustersController = Em.ArrayController.extend({
'" version="2.2.0" /><interface type="execute" endpoint="' + cluster.get('execute') +
'" version="2.2.0" /><interface type="workflow" endpoint="' + cluster.get('workflow') +
'" version="4.0.0" />' + '<interface type="messaging" endpoint="tcp://' + App.get('falconServerURL') +':61616?daemon=true" version="5.1.6" />' +
- '<interface type="write" endpoint="hdfs://c6401.ambari.apache.org:8020" version="2.2.0" />' +
+ '<interface type="write" endpoint="hdfs://'+ App.get('falconServerURL') +':8020" version="2.2.0" />' +
'</interfaces><locations><location name="staging" path="' + cluster.get('staging') +
'" /><location name="temp" path="' + cluster.get('temp') +
'" /><location name="working" path="' + cluster.get('working') +
http://git-wip-us.apache.org/repos/asf/ambari/blob/fdab4bd7/ambari-web/app/controllers/main/mirroring_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/mirroring_controller.js b/ambari-web/app/controllers/main/mirroring_controller.js
index fee1278..0f2f605 100644
--- a/ambari-web/app/controllers/main/mirroring_controller.js
+++ b/ambari-web/app/controllers/main/mirroring_controller.js
@@ -116,7 +116,7 @@ App.MainMirroringController = Em.ArrayController.extend({
targetClusterName: targetCluster['@attributes'].name,
sourceDir: parsedData.feed.locations.location['@attributes'].path,
targetDir: targetCluster.locations.location['@attributes'].path,
- frequency: parsedData.feed.frequency['#text'].match(/\d/)[0],
+ frequency: parsedData.feed.frequency['#text'].match(/\d+/)[0],
frequencyUnit: parsedData.feed.frequency['#text'].match(/\w+(?=\()/)[0],
scheduleEndDate: sourceCluster.validity['@attributes'].end,
scheduleStartDate: sourceCluster.validity['@attributes'].start,
http://git-wip-us.apache.org/repos/asf/ambari/blob/fdab4bd7/ambari-web/app/templates/main/mirroring/edit_dataset.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/mirroring/edit_dataset.hbs b/ambari-web/app/templates/main/mirroring/edit_dataset.hbs
index d0cabff..c984fc7 100644
--- a/ambari-web/app/templates/main/mirroring/edit_dataset.hbs
+++ b/ambari-web/app/templates/main/mirroring/edit_dataset.hbs
@@ -24,7 +24,7 @@
{{t mirroring.dataset.name}}
</td>
<td colspan="2" style="text-align: left">
- {{view Ember.TextField valueBinding="formFields.datasetName" class="span4"}}
+ {{view Ember.TextField valueBinding="formFields.datasetName" class="span4" disabledBinding="controller.isEdit"}}
<span class="help-inline">{{errorMessages.name}}</span>
</td>
</tr>
@@ -97,10 +97,10 @@
<td colspan="1"> {{t mirroring.dataset.schedule}} </td>
<td colspan="2" style="text-align: left">
<div {{bindAttr class="errors.isStartDateError:error"}}>
- {{view Ember.TextField valueBinding="formFields.datasetStartDate" class="input-small datepicker"}}
- {{view Ember.Select contentBinding="view.hourOptions" selectionBinding="formFields.hoursForStart" class="input-mini"}}
- {{view Ember.Select contentBinding="view.minuteOptions" selectionBinding="formFields.minutesForStart" class="input-mini"}}
- {{view Ember.Select contentBinding="view.middayPeriodOptions" selectionBinding="formFields.middayPeriodForStart" class="input-mini"}}
+ {{view Ember.TextField valueBinding="formFields.datasetStartDate" class="input-small datepicker" disabledBinding="controller.isEdit"}}
+ {{view view.select contentBinding="view.hourOptions" selectionBinding="formFields.hoursForStart" class="input-mini" disabledBinding="controller.isEdit"}}
+ {{view view.select contentBinding="view.minuteOptions" selectionBinding="formFields.minutesForStart" class="input-mini" disabledBinding="controller.isEdit"}}
+ {{view view.select contentBinding="view.middayPeriodOptions" selectionBinding="formFields.middayPeriodForStart" class="input-mini" disabledBinding="controller.isEdit"}}
<span class="help-inline">{{errorMessages.startDate}}</span>
</div>
<div>
http://git-wip-us.apache.org/repos/asf/ambari/blob/fdab4bd7/ambari-web/app/views/main/mirroring/edit_dataset_view.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/mirroring/edit_dataset_view.js b/ambari-web/app/views/main/mirroring/edit_dataset_view.js
index 694922a..fad84fd 100644
--- a/ambari-web/app/views/main/mirroring/edit_dataset_view.js
+++ b/ambari-web/app/views/main/mirroring/edit_dataset_view.js
@@ -78,11 +78,15 @@ App.MainMirroringEditDataSetView = Em.View.extend({
formFields.set('hoursForEnd', this.get('controller').toAMPMHours(endHours));
formFields.set('minutesForStart', scheduleStartDate.slice(14, 16));
formFields.set('minutesForEnd', scheduleEndDate.slice(14, 16));
- formFields.set('middayPeriodForStart', startHours > 12 || startHours === '00' ? 'PM' : 'AM');
- formFields.set('middayPeriodForEnd', endHours > 12 || endHours === '00' ? 'PM' : 'AM');
+ formFields.set('middayPeriodForStart', startHours > 11 ? 'PM' : 'AM');
+ formFields.set('middayPeriodForEnd', endHours > 11 ? 'PM' : 'AM');
}
}.observes('isLoaded', 'App.router.mainMirroringController.selectedDataset', 'controller.isEdit'),
+ select: Em.Select.extend({
+ attributeBindings: ['disabled']
+ }),
+
didInsertElement: function () {
$('.datepicker').datepicker({
format: 'mm/dd/yyyy'
http://git-wip-us.apache.org/repos/asf/ambari/blob/fdab4bd7/ambari-web/app/views/main/mirroring/jobs_view.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/mirroring/jobs_view.js b/ambari-web/app/views/main/mirroring/jobs_view.js
index 9919f52..18a26b5 100644
--- a/ambari-web/app/views/main/mirroring/jobs_view.js
+++ b/ambari-web/app/views/main/mirroring/jobs_view.js
@@ -24,7 +24,7 @@ App.MainDatasetJobsView = App.TableView.extend({
templateName: require('templates/main/mirroring/jobs'),
content: function () {
return this.get('controller.jobs');
- }.property('controller.jobs'),
+ }.property('controller.jobs', 'controller.jobs.length'),
dataset: function () {
return this.get('controller.content');