YARN-8797. [UI2] Improve error pages in new YARN UI. Contributed by Akhil PB.
This commit is contained in:
parent
9bc8b1cfd3
commit
94d82f4162
@ -61,11 +61,14 @@ export default Ember.Controller.extend({
|
|||||||
}.property('currentPath'),
|
}.property('currentPath'),
|
||||||
|
|
||||||
clusterInfo: function() {
|
clusterInfo: function() {
|
||||||
return this.model.clusterInfo.get('firstObject');
|
if (this.model && this.model.clusterInfo) {
|
||||||
|
return this.model.clusterInfo.get('firstObject');
|
||||||
|
}
|
||||||
|
return null;
|
||||||
}.property('model.clusterInfo'),
|
}.property('model.clusterInfo'),
|
||||||
|
|
||||||
userInfo: function() {
|
userInfo: function() {
|
||||||
if (this.model.userInfo) {
|
if (this.model && this.model.userInfo) {
|
||||||
return this.model.userInfo.get('firstObject');
|
return this.model.userInfo.get('firstObject');
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
|
@ -70,9 +70,6 @@ Router.map(function() {
|
|||||||
this.route('info', {path: '/:component_name/instances/:instance_name/info'});
|
this.route('info', {path: '/:component_name/instances/:instance_name/info'});
|
||||||
});
|
});
|
||||||
this.route('yarn-app-attempt', { path: '/yarn-app-attempt/:app_attempt_id'});
|
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-queues', { path: '/yarn-queues/:queue_name' });
|
||||||
this.route('yarn-queue-apps', { path: '/yarn-queue-apps/:queue_name' });
|
this.route('yarn-queue-apps', { path: '/yarn-queue-apps/:queue_name' });
|
||||||
this.route('yarn-tools', function() {
|
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('yarn-flowrun-metric', { path: '/yarn-flowrun-metric/:flowrun_uid/:metric_id'});
|
||||||
this.route('timeline-error', {path: 'timeline-error/:error_id'});
|
this.route('timeline-error', {path: 'timeline-error/:error_id'});
|
||||||
|
|
||||||
|
this.route('notauth');
|
||||||
|
this.route('notfound');
|
||||||
|
this.route('error', { path: '*:' });
|
||||||
});
|
});
|
||||||
|
|
||||||
export default Router;
|
export default Router;
|
||||||
|
@ -22,7 +22,9 @@ import AbstractRoute from './abstract';
|
|||||||
export default AbstractRoute.extend({
|
export default AbstractRoute.extend({
|
||||||
model() {
|
model() {
|
||||||
return Ember.RSVP.hash({
|
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() {
|
userInfo: this.store.findAll('cluster-user-info', {reload: true}).catch(function() {
|
||||||
return null;
|
return null;
|
||||||
})
|
})
|
||||||
@ -37,7 +39,9 @@ export default AbstractRoute.extend({
|
|||||||
* error handler page.
|
* error handler page.
|
||||||
*/
|
*/
|
||||||
error: function (error) {
|
error: function (error) {
|
||||||
Ember.Logger.log(error.stack);
|
if (error && error.stack) {
|
||||||
|
Ember.Logger.log(error.stack);
|
||||||
|
}
|
||||||
|
|
||||||
if (error && error.errors[0] && parseInt(error.errors[0].status) === 404) {
|
if (error && error.errors[0] && parseInt(error.errors[0].status) === 404) {
|
||||||
this.intermediateTransitionTo('/notfound');
|
this.intermediateTransitionTo('/notfound');
|
||||||
|
@ -16,4 +16,4 @@
|
|||||||
limitations under the License.
|
limitations under the License.
|
||||||
--}}
|
--}}
|
||||||
|
|
||||||
<h3 align = "center">Sorry, Error Occurred.</h3>
|
<h3 align = "center">Sorry, error occurred.</h3>
|
||||||
|
@ -17,4 +17,4 @@
|
|||||||
--}}
|
--}}
|
||||||
|
|
||||||
<h2 align = "center">404, Not Found</h2>
|
<h2 align = "center">404, Not Found</h2>
|
||||||
<h4 align = "center">Please Check your URL</h4>
|
<h4 align = "center">Please check your URL</h4>
|
||||||
|
Loading…
Reference in New Issue
Block a user