ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From srima...@apache.org
Subject ambari git commit: AMBARJ-15436. Supportability: Create 'Reset UI' button in Ambari's experimental page (Zhe (Joe) Wang via srimanth)
Date Sat, 19 Mar 2016 00:52:47 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-2.2 b2bc74da6 -> edfbe19b6


AMBARJ-15436. Supportability: Create 'Reset UI' button in Ambari's experimental page (Zhe
(Joe) Wang via srimanth)


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

Branch: refs/heads/branch-2.2
Commit: edfbe19b64f8b0e52a41790d0f0c72d44111430c
Parents: b2bc74d
Author: Srimanth Gunturi <sgunturi@hortonworks.com>
Authored: Fri Mar 18 17:52:07 2016 -0700
Committer: Srimanth Gunturi <sgunturi@hortonworks.com>
Committed: Fri Mar 18 17:52:07 2016 -0700

----------------------------------------------------------------------
 ambari-web/app/controllers/experimental.js   | 20 ++++++++++++++++++++
 ambari-web/app/mappers/server_data_mapper.js | 12 ++++++++++++
 ambari-web/app/messages.js                   |  5 ++++-
 ambari-web/app/templates/experimental.hbs    | 19 +++++++++++++++----
 4 files changed, 51 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/edfbe19b/ambari-web/app/controllers/experimental.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/experimental.js b/ambari-web/app/controllers/experimental.js
index d338622..9e3cad3 100644
--- a/ambari-web/app/controllers/experimental.js
+++ b/ambari-web/app/controllers/experimental.js
@@ -56,5 +56,25 @@ App.ExperimentalController = Em.Controller.extend(App.UserPref, {
 
   doCancel: function () {
     App.router.transitionTo('root.index');
+  },
+
+  doResetUIStates: function () {
+    var self = this;
+    return App.ModalPopup.show({
+      header: Em.I18n.t('reset.ui.states'),
+      bodyClass: Ember.View.extend({
+        template: Ember.Handlebars.compile(Em.I18n.t('reset.ui.states.body'))
+      }),
+      primary: Em.I18n.t('yes'),
+      onPrimary: function () {
+        var router = App.router;
+        App.db.cleanUp();
+        router.clearAllSteps();
+        App.cache.clear();
+        App.clusterStatus.setClusterStatus({});
+        this.hide();
+        router.transitionTo('root.index');
+      }
+    });
   }
 });

http://git-wip-us.apache.org/repos/asf/ambari/blob/edfbe19b/ambari-web/app/mappers/server_data_mapper.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/mappers/server_data_mapper.js b/ambari-web/app/mappers/server_data_mapper.js
index 99fd80f..2d5b4f4 100644
--- a/ambari-web/app/mappers/server_data_mapper.js
+++ b/ambari-web/app/mappers/server_data_mapper.js
@@ -30,6 +30,18 @@ App.cache = {
   'currentConfigVersions': {}
 };
 
+App.cache.clear = function () {
+  var clear = App.cache.clear;
+  App.cache = {
+    'previousHostStatuses': {},
+    'previousComponentStatuses': {},
+    'previousComponentPassiveStates': {},
+    'services': [],
+    'currentConfigVersions': {}
+  };
+  App.cache.clear = clear;
+};
+
 App.ServerDataMapper = Em.Object.extend({
   jsonKey: false,
   map: function (json) {

http://git-wip-us.apache.org/repos/asf/ambari/blob/edfbe19b/ambari-web/app/messages.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js
index 5addc9b..1aaa112 100644
--- a/ambari-web/app/messages.js
+++ b/ambari-web/app/messages.js
@@ -2953,5 +2953,8 @@ Em.I18n.translations = {
       ' get back to a stable state. Are you sure you want to exit the wizard?',
   'admin.activateHawqStandby.wizard.step3.notice.inProgress':'Please wait while HAWQ Standby
Master is being activated',
   'admin.activateHawqStandby.wizard.step3.notice.completed':'HAWQ Standby Master has been
activated successfully.',
-  'admin.activateHawqStandby.wizard.step3.activateHawqStandbyCommand.context': "Execute HAWQ
Standby Master activate command"
+  'admin.activateHawqStandby.wizard.step3.activateHawqStandbyCommand.context': "Execute HAWQ
Standby Master activate command",
+
+  'reset.ui.states': 'Reset UI State',
+  'reset.ui.states.body': 'You should proceed only if the UI is misbehaving (such as incorrect
navigation upon login, UI is stuck and won&apos;t load, etc.).  Are you sure you want
to reset the UI state?'
 };

http://git-wip-us.apache.org/repos/asf/ambari/blob/edfbe19b/ambari-web/app/templates/experimental.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/experimental.hbs b/ambari-web/app/templates/experimental.hbs
index 2873679..3eac9a7 100644
--- a/ambari-web/app/templates/experimental.hbs
+++ b/ambari-web/app/templates/experimental.hbs
@@ -25,9 +25,9 @@
     Ambari's experimental functionality is provided <strong>as-is</strong>.<br>
     Any changes will effect application behavior, including data corruption. Users making
changes do so at their own risk.<br>
     Experimental functionality can be modified or removed at any time without notice.
-  </p>  
+  </p>
 </div>
-    
+
 {{#if App}}
   {{#if App.supports}}
     <table class="table table-bordered table-striped">
@@ -48,12 +48,23 @@
 		    {{/each}}
     </tbody>
     </table>
-    <div class="control-group" style="margin-bottom: 100px;">
+    <div class="control-group" style="margin-bottom: 70px;">
 	    <div class="controls pull-right">
 	      <button class="btn" {{action doCancel target="controller"}}>{{t form.cancel}}</button>
 	      <button class="btn btn-primary" {{action doSave target="controller"}}>{{t common.save}}</button>
 	    </div>
-	  </div>
+    </div>
+    <hr>
+    <div class="control-group" style="margin-bottom: 100px;">
+        {{#isAccessible upgrade_ADMIN}}
+            <div class="controls pull-left" style="margin-bottom: 100px;">
+                <button class="btn btn-danger" {{action doResetUIStates target="controller"}}>{{t
reset.ui.states}}</button>
+                <p class="pull-right" style="margin-left: 10px; padding-top: 5px;">
+                    Reset UI state locally and on the server
+                </p>
+            </div>
+        {{/isAccessible}}
+    </div>
   {{else}}
     <div class="alert alert-error">
       No application supports found. Please login to Ambari and revisit this page.


Mime
View raw message