AMBARI-19563. Dashboard-Show YARN RM URL in actions and flow graph and organize tabs. (Padma Priya N via gauravn7)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/b4bb42a7 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/b4bb42a7 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/b4bb42a7 Branch: refs/heads/branch-dev-patch-upgrade Commit: b4bb42a7dbbe08287d09cec6cef64f43f0d43f2f Parents: 684c9e6 Author: Gaurav Nagar <[email protected]> Authored: Tue Jan 17 14:55:45 2017 +0530 Committer: Gaurav Nagar <[email protected]> Committed: Tue Jan 17 14:55:45 2017 +0530 ---------------------------------------------------------------------- .../resources/ui/app/components/job-details.js | 29 +++++++++++++++++--- .../ui/app/components/workflow-job-details.js | 3 ++ .../ui/app/templates/components/job-details.hbs | 20 +++++++------- .../components/workflow-job-action-info.hbs | 8 ------ .../components/workflow-job-details.hbs | 14 ++++++++++ 5 files changed, 52 insertions(+), 22 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/b4bb42a7/contrib/views/wfmanager/src/main/resources/ui/app/components/job-details.js ---------------------------------------------------------------------- diff --git a/contrib/views/wfmanager/src/main/resources/ui/app/components/job-details.js b/contrib/views/wfmanager/src/main/resources/ui/app/components/job-details.js index 32f5ef4..91e1ce3 100644 --- a/contrib/views/wfmanager/src/main/resources/ui/app/components/job-details.js +++ b/contrib/views/wfmanager/src/main/resources/ui/app/components/job-details.js @@ -329,7 +329,21 @@ export default Ember.Component.extend({ this.sendAction('close'); }, doRefresh : function(){ - this.sendAction('doRefresh'); + var tab = this.$(this.get('currentTab')).prop('href'); + var currentTabHref = tab.substr(tab.indexOf('#')+1); + if(currentTabHref === 'jobLog'){ + this.send('getJobLog', this.get('logParams')); + }else if(currentTabHref === 'jobErrorLog'){ + this.send('getErrorLog'); + }else if(currentTabHref === 'jobAuditLog'){ + this.send('getAuditLog'); + }else if(currentTabHref === 'jobDag'){ + this.send('getJobDag'); + }else if(currentTabHref === 'coordActionReruns'){ + this.send('getCoordActionReruns'); + }else{ + this.sendAction('doRefresh'); + } }, getJobDefinition : function () { Ember.$.get(Ember.ENV.API_URL+'/v2/job/'+this.get('id')+'?show=definition&timezone=GMT',function(response){ @@ -342,6 +356,7 @@ export default Ember.Component.extend({ this.set('model.actionDetails', this.get('model.actions')[0]); }, getJobLog : function (params){ + this.set('logParams', params); var url = Ember.ENV.API_URL+'/v2/job/'+this.get('id')+'?show=log'; if(params && params.logFilter){ url = url + '&logfilter=' + params.logFilter; @@ -350,7 +365,9 @@ export default Ember.Component.extend({ url = url + '&type=action&scope='+ params.logActionList; } Ember.$.get(url,function(response){ - response = response.trim().length > 0 ? response : "No messages present"; + if(Ember.isBlank(response)){ + response = 'No Logs'; + } this.set('model.jobLog', response); }.bind(this)).fail(function(error){ this.set('error', error); @@ -358,7 +375,9 @@ export default Ember.Component.extend({ }, getErrorLog : function (){ Ember.$.get(Ember.ENV.API_URL+'/v2/job/'+this.get('id')+'?show=errorlog',function(response){ - response = response.trim().length > 0 ? response : "No messages present"; + if(Ember.isBlank(response)){ + response = 'No Errors'; + } this.set('model.errorLog', response); }.bind(this)).fail(function(error){ this.set('error', error); @@ -366,7 +385,9 @@ export default Ember.Component.extend({ }, getAuditLog : function (){ Ember.$.get(Ember.ENV.API_URL+'/v2/job/'+this.get('id')+'?show=auditlog',function(response){ - response = response.trim().length > 0 ? response : "No messages present"; + if(Ember.isBlank(response)){ + response = 'No Logs'; + } this.set('model.auditLog', response); }.bind(this)).fail(function(error){ this.set('error', error); http://git-wip-us.apache.org/repos/asf/ambari/blob/b4bb42a7/contrib/views/wfmanager/src/main/resources/ui/app/components/workflow-job-details.js ---------------------------------------------------------------------- diff --git a/contrib/views/wfmanager/src/main/resources/ui/app/components/workflow-job-details.js b/contrib/views/wfmanager/src/main/resources/ui/app/components/workflow-job-details.js index 4873a31..7a868fa 100644 --- a/contrib/views/wfmanager/src/main/resources/ui/app/components/workflow-job-details.js +++ b/contrib/views/wfmanager/src/main/resources/ui/app/components/workflow-job-details.js @@ -26,6 +26,9 @@ export default Ember.Component.extend({ }, getActionDetails(action){ this.sendAction('getActionDetails',action); + }, + openConsoleUrl(url){ + window.open(url, '_blank'); } } }); http://git-wip-us.apache.org/repos/asf/ambari/blob/b4bb42a7/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/job-details.hbs ---------------------------------------------------------------------- diff --git a/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/job-details.hbs b/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/job-details.hbs index 32e468f..c783ad0 100644 --- a/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/job-details.hbs +++ b/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/job-details.hbs @@ -31,19 +31,19 @@ {{#if fromBundleId}} <li class="breadcrumb-item"> <a href="#" {{action 'back' 'bundles' fromBundleId}}> - {{#workflow-icon workflowType="bundles"}}{{/workflow-icon}} [ <span title="{{fromBundleId}}">{{dashboardContext.currentBundleName}}</span> ] + {{#workflow-icon workflowType="bundles"}}{{/workflow-icon}} <span title="{{fromBundleId}}">{{dashboardContext.currentBundleName}}</span> </a> </li> {{/if}} {{#if fromCoordId}} <li class="breadcrumb-item"> <a href="#" {{action 'back' 'coords' fromCoordId}}> - {{#workflow-icon workflowType="coords"}}{{/workflow-icon}} [ <span title="{{fromCoordId}}">{{dashboardContext.currentCoordName}}</span> ] + {{#workflow-icon workflowType="coords"}}{{/workflow-icon}} <span title="{{fromCoordId}}">{{dashboardContext.currentCoordName}}</span> </a> </li> {{/if}} <li class="breadcrumb-item"> - {{#workflow-icon workflowType=model.jobType}}{{/workflow-icon}} [ <span title="{{id}}">{{name}}</span> ] + {{#workflow-icon workflowType=model.jobType}}{{/workflow-icon}} <span title="{{id}}">{{name}}</span> </li> </ol> </div> @@ -60,12 +60,12 @@ <ul class="nav nav-tabs" role="tablist"> <li role="presentation" class="active"><a href="#jobInfo" aria-controls="job-info" role="tab" data-toggle="tab">Info</a></li> <li {{action 'showFirstActionDetail'}} role="presentation"><a href="#jobAction" aria-controls="job-action" role="tab" data-toggle="tab">Action</a></li> - <li {{action 'getJobDefinition'}} role="presentation"><a href="#jobDefinition" aria-controls="jobDefinition" role="tab" data-toggle="tab">Definition</a></li> - <li role="presentation"><a href="#jobConfig" aria-controls="jobConfig" role="tab" data-toggle="tab">Configuration</a></li> + <li {{action 'getJobDag'}} role="presentation"><a href="#jobDag" aria-controls="jobDag" role="tab" data-toggle="tab">Flow Graph</a></li> <li {{action 'getJobLog'}} role="presentation"><a href="#jobLog" aria-controls="jobLog" role="tab" data-toggle="tab">Log</a></li> <li {{action 'getErrorLog'}} role="presentation"><a href="#jobErrorLog" aria-controls="jobErrorLog" role="tab" data-toggle="tab">Error Log</a></li> <li {{action 'getAuditLog'}} role="presentation"><a href="#jobAuditLog" aria-controls="jobAuditLog" role="tab" data-toggle="tab">Audit Log</a></li> - <li {{action 'getJobDag'}} role="presentation"><a href="#jobDag" aria-controls="jobDag" role="tab" data-toggle="tab">Flow Graph</a></li> + <li role="presentation"><a href="#jobConfig" aria-controls="jobConfig" role="tab" data-toggle="tab">Configuration</a></li> + <li {{action 'getJobDefinition'}} role="presentation"><a href="#jobDefinition" aria-controls="jobDefinition" role="tab" data-toggle="tab">Definition</a></li> <li role="presentation" class="pull-right"> <button type="button" class="btn btn-success" title="Edit Workflow" {{action "editWorkflow" model.appPath}}> Edit Workflow @@ -81,12 +81,12 @@ <ul class="nav nav-tabs" role="tablist"> <li role="presentation" class="active"><a href="#jobInfo" aria-controls="job-info" role="tab" data-toggle="tab">Info</a></li> <li {{action 'showFirstActionDetail'}} role="presentation"><a href="#jobAction" aria-controls="job-action" role="tab" data-toggle="tab">Workflow Jobs</a></li> - <li {{action 'getJobDefinition'}} role="presentation"><a href="#jobDefinition" aria-controls="jobDefinition" role="tab" data-toggle="tab">Definition</a></li> - <li role="presentation"><a href="#jobConfig" aria-controls="jobConfig" role="tab" data-toggle="tab">Configuration</a></li> <li {{action 'getJobLog'}} role="presentation"><a href="#jobLog" aria-controls="jobLog" role="tab" data-toggle="tab">Log</a></li> <li {{action 'getErrorLog'}} role="presentation"><a href="#jobErrorLog" aria-controls="jobErrorLog" role="tab" data-toggle="tab">Error Log</a></li> <li {{action 'getAuditLog'}} role="presentation"><a href="#jobAuditLog" aria-controls="jobAuditLog" role="tab" data-toggle="tab">Audit Log</a></li> <li {{action 'getCoordActionReruns'}} role="presentation"><a href="#coordActionReruns" aria-controls="coordActionReruns" role="tab" data-toggle="tab">Action Reruns</a></li> + <li role="presentation"><a href="#jobConfig" aria-controls="jobConfig" role="tab" data-toggle="tab">Configuration</a></li> + <li {{action 'getJobDefinition'}} role="presentation"><a href="#jobDefinition" aria-controls="jobDefinition" role="tab" data-toggle="tab">Definition</a></li> </ul> </div> {{/coord-job-details}} @@ -96,11 +96,11 @@ <ul class="nav nav-tabs" role="tablist"> <li role="presentation" class="active"><a href="#jobInfo" aria-controls="job-info" role="tab" data-toggle="tab">Info</a></li> <li role="presentation"><a href="#coordJobs" aria-controls="coord-jobs" role="tab" data-toggle="tab">Coord Jobs</a></li> - <li {{action 'getJobDefinition'}} role="presentation"><a href="#jobDefinition" aria-controls="jobDefinition" role="tab" data-toggle="tab">Definition</a></li> - <li role="presentation"><a href="#jobConfig" aria-controls="jobConfig" role="tab" data-toggle="tab">Configuration</a></li> <li {{action 'getJobLog'}} role="presentation"><a href="#jobLog" aria-controls="jobLog" role="tab" data-toggle="tab">Log</a></li> <li {{action 'getErrorLog'}} role="presentation"><a href="#jobErrorLog" aria-controls="jobErrorLog" role="tab" data-toggle="tab">Error Log</a></li> <li {{action 'getAuditLog'}} role="presentation"><a href="#jobAuditLog" aria-controls="jobAuditLog" role="tab" data-toggle="tab">Audit Log</a></li> + <li role="presentation"><a href="#jobConfig" aria-controls="jobConfig" role="tab" data-toggle="tab">Configuration</a></li> + <li {{action 'getJobDefinition'}} role="presentation"><a href="#jobDefinition" aria-controls="jobDefinition" role="tab" data-toggle="tab">Definition</a></li> </ul> </div> {{/bundle-job-details}} http://git-wip-us.apache.org/repos/asf/ambari/blob/b4bb42a7/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/workflow-job-action-info.hbs ---------------------------------------------------------------------- diff --git a/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/workflow-job-action-info.hbs b/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/workflow-job-action-info.hbs index 8d1e09c..51986ce 100644 --- a/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/workflow-job-action-info.hbs +++ b/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/workflow-job-action-info.hbs @@ -60,14 +60,6 @@ <div class="col-md-10">{{actionInfo.externalStatus}}</div> </div> <div class="col-md-12"> - <div class="col-md-2">Console URL</div> - {{#unless (eq "-" actionInfo.consoleUrl)}} - <div class="col-md-10"><a target="_blank" href="{{actionInfo.consoleUrl}}">{{actionInfo.consoleUrl}}</a></div> - {{else}} - <div class="col-md-10">{{actionInfo.consoleUrl}}</div> - {{/unless}} - </div> - <div class="col-md-12"> <div class="col-md-2">Tracker URI</div> {{#unless (eq "-" actionInfo.trackerUri)}} <div class="col-md-10"><a target="_blank" href="{{actionInfo.trackerUri}}">{{actionInfo.trackerUri}}</a></div> http://git-wip-us.apache.org/repos/asf/ambari/blob/b4bb42a7/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/workflow-job-details.hbs ---------------------------------------------------------------------- diff --git a/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/workflow-job-details.hbs b/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/workflow-job-details.hbs index 114ca37..89997aa 100644 --- a/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/workflow-job-details.hbs +++ b/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/workflow-job-details.hbs @@ -79,6 +79,7 @@ <th>Transition</th> <th>Start Time</th> <th>End Time</th> + <th>Job Url</th> </tr> </thead> <tbody> @@ -90,6 +91,11 @@ <td>{{actionInfo.transition}}</td> <td>{{actionInfo.startTime}}</td> <td>{{actionInfo.endTime}}</td> + {{#unless (eq "-" actionInfo.consoleUrl)}} + <td><a target="_blank" href="#" {{action 'openConsoleUrl' actionInfo.consoleUrl preventDefault=true}}><i class="fa fa-external-link" aria-hidden="true"></i></a></td> + {{else}} + <td>{{actionInfo.consoleUrl}}</td> + {{/unless}} </tr> {{/each}} </tbody> @@ -219,6 +225,14 @@ <div class="col-md-4 text-bold">End Time</div> <div class="col-md-8">{{model.actionInfo.endTime}}</div> </div> + <div class="row"> + <div class="col-md-4 text-bold">External ID</div> + <div class="col-md-8">{{model.actionInfo.externalId}}</div> + </div> + <div class="row"> + <div class="col-md-4 text-bold">Job URL</div> + <div class="col-md-8"><a target="_blank" href="{{model.actionInfo.consoleUrl}}"><i class="fa fa-external-link" aria-hidden="true"></i></a></div> + </div> <div class="row pull-right" {{action 'getActionDetails' model.actionInfo}}> <div class="col-md-12"> <a data-toggle="modal" href="#" data-target="#actionDetailsModal">More</a>
