YARN-8797. [UI2] Improve error pages in new YARN UI. Contributed by Akhil PB.

This commit is contained in:
Sunil G 2018-10-05 14:28:54 +05:30
parent 9bc8b1cfd3
commit 94d82f4162
5 changed files with 17 additions and 9 deletions

View File

@ -61,11 +61,14 @@ export default Ember.Controller.extend({
}.property('currentPath'),
clusterInfo: function() {
if (this.model && this.model.clusterInfo) {
return this.model.clusterInfo.get('firstObject');
}
return null;
}.property('model.clusterInfo'),
userInfo: function() {
if (this.model.userInfo) {
if (this.model && this.model.userInfo) {
return this.model.userInfo.get('firstObject');
}
return null;

View File

@ -70,9 +70,6 @@ Router.map(function() {
this.route('info', {path: '/:component_name/instances/:instance_name/info'});
});
this.route('yarn-app-attempt', { path: '/yarn-app-attempt/:app_attempt_id'});
this.route('error');
this.route('notfound', { path: '*:' });
this.route('notauth', { path: '*:' });
this.route('yarn-queues', { path: '/yarn-queues/:queue_name' });
this.route('yarn-queue-apps', { path: '/yarn-queue-apps/:queue_name' });
this.route('yarn-tools', function() {
@ -92,6 +89,10 @@ Router.map(function() {
});
this.route('yarn-flowrun-metric', { path: '/yarn-flowrun-metric/:flowrun_uid/:metric_id'});
this.route('timeline-error', {path: 'timeline-error/:error_id'});
this.route('notauth');
this.route('notfound');
this.route('error', { path: '*:' });
});
export default Router;

View File

@ -22,7 +22,9 @@ import AbstractRoute from './abstract';
export default AbstractRoute.extend({
model() {
return Ember.RSVP.hash({
clusterInfo: this.store.findAll('ClusterInfo', {reload: true}),
clusterInfo: this.store.findAll('ClusterInfo', {reload: true}).catch(function() {
return null;
}),
userInfo: this.store.findAll('cluster-user-info', {reload: true}).catch(function() {
return null;
})
@ -37,7 +39,9 @@ export default AbstractRoute.extend({
* error handler page.
*/
error: function (error) {
if (error && error.stack) {
Ember.Logger.log(error.stack);
}
if (error && error.errors[0] && parseInt(error.errors[0].status) === 404) {
this.intermediateTransitionTo('/notfound');

View File

@ -16,4 +16,4 @@
limitations under the License.
--}}
<h3 align = "center">Sorry, Error Occurred.</h3>
<h3 align = "center">Sorry, error occurred.</h3>

View File

@ -17,4 +17,4 @@
--}}
<h2 align = "center">404, Not Found</h2>
<h4 align = "center">Please Check your URL</h4>
<h4 align = "center">Please check your URL</h4>