Repository: ambari Updated Branches: refs/heads/trunk bf2a6445c -> 3e3bb2dab
AMBARI-15886. Services status check labels and progress bar changes for Hive, Pig and Files view (pallavkul) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/3e3bb2da Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/3e3bb2da Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/3e3bb2da Branch: refs/heads/trunk Commit: 3e3bb2dab8f7a3d2777c8df31bc18f7be86eac5e Parents: bf2a644 Author: Pallav Kulshreshtha <[email protected]> Authored: Fri Apr 22 14:29:13 2016 +0530 Committer: Pallav Kulshreshtha <[email protected]> Committed: Fri Apr 22 14:29:13 2016 +0530 ---------------------------------------------------------------------- .../main/resources/ui/app/controllers/splash.js | 10 ++++++++++ .../src/main/resources/ui/app/routes/splash.js | 2 +- .../main/resources/ui/app/templates/splash.hbs | 17 +++++++++++++---- .../ui/hive-web/app/controllers/splash.js | 14 +++++++++++--- .../resources/ui/hive-web/app/routes/splash.js | 2 +- .../ui/hive-web/app/templates/splash.hbs | 19 +++++++++++++++---- .../ui/pig-web/app/controllers/splash.js | 14 +++++++++++++- .../resources/ui/pig-web/app/routes/splash.js | 2 +- .../ui/pig-web/app/templates/splash.hbs | 18 ++++++++++++++---- 9 files changed, 79 insertions(+), 19 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/3e3bb2da/contrib/views/files/src/main/resources/ui/app/controllers/splash.js ---------------------------------------------------------------------- diff --git a/contrib/views/files/src/main/resources/ui/app/controllers/splash.js b/contrib/views/files/src/main/resources/ui/app/controllers/splash.js index 84a404a..a25fe8f 100644 --- a/contrib/views/files/src/main/resources/ui/app/controllers/splash.js +++ b/contrib/views/files/src/main/resources/ui/app/controllers/splash.js @@ -40,6 +40,12 @@ export default Ember.Controller.extend({ var processResponse = function(name, data) { + if( data != undefined ){ + data = data; + } else { + data = Ember.Object.create( {trace: null, message: "Server Error", status: "500"}); + } + model.set(name + 'Test', data.status == 200); if (data.status != 200) { @@ -82,6 +88,10 @@ export default Ember.Controller.extend({ return 'width: ' + this.get("model").get("percent") + '%;'; }.property("model.percent"), + allTestsCompleted: function(){ + return this.get("model").get("hdfsTestDone"); + }.property('model.hdfsTestDone'), + modelhdfsTestDone: function() { return this.get('model.hdfsTestDone'); }.property('model.hdfsTestDone' ), http://git-wip-us.apache.org/repos/asf/ambari/blob/3e3bb2da/contrib/views/files/src/main/resources/ui/app/routes/splash.js ---------------------------------------------------------------------- diff --git a/contrib/views/files/src/main/resources/ui/app/routes/splash.js b/contrib/views/files/src/main/resources/ui/app/routes/splash.js index 6005937..822711c 100644 --- a/contrib/views/files/src/main/resources/ui/app/routes/splash.js +++ b/contrib/views/files/src/main/resources/ui/app/routes/splash.js @@ -41,7 +41,7 @@ export default Ember.Route.extend({ if (model.get("hdfsTest")) { Ember.run.later(this, function() { self.send('transition'); - }, 3000); + }, 2000); } }); }, http://git-wip-us.apache.org/repos/asf/ambari/blob/3e3bb2da/contrib/views/files/src/main/resources/ui/app/templates/splash.hbs ---------------------------------------------------------------------- diff --git a/contrib/views/files/src/main/resources/ui/app/templates/splash.hbs b/contrib/views/files/src/main/resources/ui/app/templates/splash.hbs index 72406a0..4a45366 100644 --- a/contrib/views/files/src/main/resources/ui/app/templates/splash.hbs +++ b/contrib/views/files/src/main/resources/ui/app/templates/splash.hbs @@ -19,12 +19,21 @@ <div class="spinner"></div> <div class="container-fluid"> <h1>Welcome to the File Browser View</h1> - <h2>Please wait...</h2> + {{#if allTestsCompleted }} + <h3>Service checks completed.</h3> + {{else}} + <h3>Service checks in progress.</h3> + {{/if}} - <div class="progress progress-striped active"> - <div class="progress-bar" role="progressbar" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" style={{progressBarStyle}}> + {{#if errors}} + <div class="progress active"> + <div class="progress-bar progress-bar-danger" role="progressbar" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" style={{progressBarStyle}}></div> </div> - </div> + {{else}} + <div class="progress progress-striped active"> + <div class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" style={{progressBarStyle}}></div> + </div> + {{/if}} <table class="table"> <tbody> http://git-wip-us.apache.org/repos/asf/ambari/blob/3e3bb2da/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/splash.js ---------------------------------------------------------------------- diff --git a/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/splash.js b/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/splash.js index eec1f17..5db93f7 100644 --- a/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/splash.js +++ b/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/splash.js @@ -33,10 +33,14 @@ export default Ember.Controller.extend({ var processResponse = function(name, data) { - if(data.databases){ - data = Ember.Object.create( {trace: null, message: "OK", status: "200"}); + if( data != undefined ){ + if(data.databases){ + data = Ember.Object.create( {trace: null, message: "OK", status: "200"}); + } else { + data = data; + } } else { - data = data; + data = Ember.Object.create( {trace: null, message: "Server Error", status: "500"}); } model.set(name + 'Test', data.status == 200); @@ -83,6 +87,10 @@ export default Ember.Controller.extend({ return 'width: ' + this.get("model").get("percent") + '%;'; }.property("model.percent"), + allTestsCompleted: function(){ + return this.get('modelhdfsTestDone') && this.get('modelhiveserverTestDone') && this.get('modelatsTestDone'); + }.property('modelhdfsTestDone', 'modelhiveserverTestDone', 'modelatsTestDone'), + modelhdfsTestDone: function() { return this.get('model.hdfsTestDone'); }.property('model.hdfsTestDone' ), http://git-wip-us.apache.org/repos/asf/ambari/blob/3e3bb2da/contrib/views/hive/src/main/resources/ui/hive-web/app/routes/splash.js ---------------------------------------------------------------------- diff --git a/contrib/views/hive/src/main/resources/ui/hive-web/app/routes/splash.js b/contrib/views/hive/src/main/resources/ui/hive-web/app/routes/splash.js index 1ff155c..05bcbcf 100644 --- a/contrib/views/hive/src/main/resources/ui/hive-web/app/routes/splash.js +++ b/contrib/views/hive/src/main/resources/ui/hive-web/app/routes/splash.js @@ -45,7 +45,7 @@ export default Ember.Route.extend({ if (model.get("hiveserverTest") && model.get("hdfsTest") && model.get("atsTest")) { Ember.run.later(this, function() { self.send('transition'); - }, 5000); + }, 2000); } }); }, http://git-wip-us.apache.org/repos/asf/ambari/blob/3e3bb2da/contrib/views/hive/src/main/resources/ui/hive-web/app/templates/splash.hbs ---------------------------------------------------------------------- diff --git a/contrib/views/hive/src/main/resources/ui/hive-web/app/templates/splash.hbs b/contrib/views/hive/src/main/resources/ui/hive-web/app/templates/splash.hbs index 3e81a9c..84c7a71 100644 --- a/contrib/views/hive/src/main/resources/ui/hive-web/app/templates/splash.hbs +++ b/contrib/views/hive/src/main/resources/ui/hive-web/app/templates/splash.hbs @@ -19,11 +19,22 @@ <div class="spinner"></div> <div class="container-fluid"> <h1>Welcome to the Hive View</h1> - <h2>Please wait...</h2> - <div class="progress progress-striped active"> - <div class="progress-bar" role="progressbar" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" {{bind-attr style="progressBarStyle"}}> + {{#if allTestsCompleted }} + <h3>Service checks completed.</h3> + {{else}} + <h3>Service checks in progress.</h3> + {{/if}} + + {{#if errors}} + <div class="progress active"> + <div class="progress-bar progress-bar-danger" role="progressbar" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" {{bind-attr style="progressBarStyle"}}></div> </div> - </div> + {{else}} + <div class="progress progress-striped active"> + <div class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" {{bind-attr style="progressBarStyle"}}></div> + </div> + {{/if}} + <table class="table"> <tbody> <tr> http://git-wip-us.apache.org/repos/asf/ambari/blob/3e3bb2da/contrib/views/pig/src/main/resources/ui/pig-web/app/controllers/splash.js ---------------------------------------------------------------------- diff --git a/contrib/views/pig/src/main/resources/ui/pig-web/app/controllers/splash.js b/contrib/views/pig/src/main/resources/ui/pig-web/app/controllers/splash.js index 959d6d0..f58d437 100644 --- a/contrib/views/pig/src/main/resources/ui/pig-web/app/controllers/splash.js +++ b/contrib/views/pig/src/main/resources/ui/pig-web/app/controllers/splash.js @@ -33,6 +33,13 @@ App.SplashController = Ember.ObjectController.extend({ var url = App.getNamespaceUrl() + '/resources/pig/help/'; var self = this; var processResponse = function(name, data) { + + if( data != undefined ){ + data = data; + } else { + data = Ember.Object.create( {trace: null, message: "Server Error", status: "500"}); + } + model.set(name + 'Test', data.status == 200); if (data.status != 200) { @@ -68,5 +75,10 @@ App.SplashController = Ember.ObjectController.extend({ }, progressBarStyle: function() { return 'width: ' + this.get("model").get("percent") + '%;'; - }.property("model.percent") + }.property("model.percent"), + + allTestsCompleted: function(){ + return this.get("model").get("hdfsTestDone") && this.get("model").get("webhcatTestDone") && this.get("model").get("storageTestDone"); + }.property('model.hdfsTestDone', 'model.webhcatTestDone', 'model.storageTestDone') + }); http://git-wip-us.apache.org/repos/asf/ambari/blob/3e3bb2da/contrib/views/pig/src/main/resources/ui/pig-web/app/routes/splash.js ---------------------------------------------------------------------- diff --git a/contrib/views/pig/src/main/resources/ui/pig-web/app/routes/splash.js b/contrib/views/pig/src/main/resources/ui/pig-web/app/routes/splash.js index 5223a5a..1d848e3 100644 --- a/contrib/views/pig/src/main/resources/ui/pig-web/app/routes/splash.js +++ b/contrib/views/pig/src/main/resources/ui/pig-web/app/routes/splash.js @@ -45,7 +45,7 @@ App.SplashRoute = Em.Route.extend({ } else { self.transitionTo('pig.scripts'); } - }, 1000); + }, 2000); } }); } http://git-wip-us.apache.org/repos/asf/ambari/blob/3e3bb2da/contrib/views/pig/src/main/resources/ui/pig-web/app/templates/splash.hbs ---------------------------------------------------------------------- diff --git a/contrib/views/pig/src/main/resources/ui/pig-web/app/templates/splash.hbs b/contrib/views/pig/src/main/resources/ui/pig-web/app/templates/splash.hbs index 7455a4f..d635a91 100644 --- a/contrib/views/pig/src/main/resources/ui/pig-web/app/templates/splash.hbs +++ b/contrib/views/pig/src/main/resources/ui/pig-web/app/templates/splash.hbs @@ -18,12 +18,22 @@ <div class="container-fluid"> <h1>{{t 'splash.welcome'}}</h1> - <h2>{{t 'splash.please_wait'}}</h2> - <div class="progress progress-striped active"> - <div class="progress-bar" role="progressbar" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" {{bind-attr style="progressBarStyle"}}> + {{#if allTestsCompleted }} + <h3>Service checks completed.</h3> + {{else}} + <h3>Service checks in progress.</h3> + {{/if}} + + {{#if errors}} + <div class="progress active"> + <div class="progress-bar progress-bar-danger" role="progressbar" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" {{bind-attr style="progressBarStyle"}}></div> </div> - </div> + {{else}} + <div class="progress progress-striped active"> + <div class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" {{bind-attr style="progressBarStyle"}}></div> + </div> + {{/if}} <table class="table"> <tbody>
