YARN-8742. [UI2] Container logs on Application / Service pages on UI2 are not available many case, improve error messages in such cases. Contributed by Akhil PB.

(cherry picked from commit 32a35dc94b)
This commit is contained in:
Sunil G 2018-09-24 12:20:28 +05:30
parent 6699b9658e
commit 0196ffaa22
4 changed files with 43 additions and 24 deletions

View File

@ -253,5 +253,10 @@ export default Ember.Controller.extend({
} }
return lines.slice(lines.length - 10).join("\n"); return lines.slice(lines.length - 10).join("\n");
} }
) ),
isLogAggregationNotSucceeded: Ember.computed("model.app", function() {
const logAggregationStatus = this.get("model.app.logAggregationStatus");
return logAggregationStatus !== "SUCCEEDED";
})
}); });

View File

@ -32,4 +32,9 @@
.yarn-app-final-status .label { .yarn-app-final-status .label {
vertical-align: middle; vertical-align: middle;
} }
.quick-links {
display: block;
margin-left: -5px;
}
} }

View File

@ -102,9 +102,9 @@
{{#if model.serviceName}} {{#if model.serviceName}}
{{#if model.quicklinks}} {{#if model.quicklinks}}
<div class="btn-group"> <div class="btn-group quick-links">
<button type="button" class="btn btn-unstyled dropdown-toggle" title="Quick links" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> <button type="button" class="btn btn-unstyled dropdown-toggle" title="Quick links" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<i class="glyphicon glyphicon-option-vertical" /> <i class="glyphicon glyphicon-option-vertical" /> Quicklinks
</button> </button>
<ul class="dropdown-menu dropdown-menu-right"> <ul class="dropdown-menu dropdown-menu-right">
{{#each model.quicklinks as |link|}} {{#each model.quicklinks as |link|}}
@ -115,7 +115,7 @@
{{/if}} {{/if}}
{{/if}} {{/if}}
</div> </div>
<div> <div class="btn-group">
<span title="Queue" class="yarn-tooltip"> <span title="Queue" class="yarn-tooltip">
<i class="glyphicon glyphicon-tasks glyphicon-gray" /> {{model.app.queue}} <i class="glyphicon glyphicon-tasks glyphicon-gray" /> {{model.app.queue}}
</span> </span>

View File

@ -28,7 +28,7 @@
{{model.app.logAggregationStatus}} {{model.app.logAggregationStatus}}
</span> </span>
{{#if _isLoadingTopPanel}} {{#if _isLoadingTopPanel}}
<div class="text-center" style="z-index: 100; position: absolute; left: 46%;"> <div class="text-center" style="z-index: 100; position: absolute; left: 46%; top: 45px;">
<img src="assets/images/spinner.gif" alt="Loading..."> <img src="assets/images/spinner.gif" alt="Loading...">
</div> </div>
{{/if}} {{/if}}
@ -36,6 +36,7 @@
<div class="row"> <div class="row">
<div class="col-md-6"> <div class="col-md-6">
<label>Choose attempt to fetch containers</label> <label>Choose attempt to fetch containers</label>
<div>
<select class="js-fetch-attempt-containers" onchange={{action "showContainersForAttemptId" value="target.value"}} style="max-width:350px;"> <select class="js-fetch-attempt-containers" onchange={{action "showContainersForAttemptId" value="target.value"}} style="max-width:350px;">
<option value="" selected={{eq selectedAttemptId ''}}>None</option> <option value="" selected={{eq selectedAttemptId ''}}>None</option>
{{#each attemptList as |attempt|}} {{#each attemptList as |attempt|}}
@ -43,9 +44,11 @@
{{/each}} {{/each}}
</select> </select>
</div> </div>
</div>
{{#if attemptContainerList}} {{#if attemptContainerList}}
<div class="col-md-6"> <div class="col-md-6">
<label>Choose container to fetch logs</label> <label>Choose container to fetch logs</label>
<div>
<select class="js-fetch-logs-containers" onchange={{action "showLogFilesForContainerId" value="target.value"}} style="max-width:350px"> <select class="js-fetch-logs-containers" onchange={{action "showLogFilesForContainerId" value="target.value"}} style="max-width:350px">
<option value="" selected={{eq selectedContainerId ''}}>None</option> <option value="" selected={{eq selectedContainerId ''}}>None</option>
{{#each attemptContainerList as |container|}} {{#each attemptContainerList as |container|}}
@ -53,6 +56,7 @@
{{/each}} {{/each}}
</select> </select>
</div> </div>
</div>
{{else}} {{else}}
{{#if (and selectedAttemptId (not _isLoadingTopPanel))}} {{#if (and selectedAttemptId (not _isLoadingTopPanel))}}
<div class="col-md-4"> <div class="col-md-4">
@ -88,6 +92,7 @@
<div class="row"> <div class="row">
<div class="col-md-6" style="margin-bottom:20px;"> <div class="col-md-6" style="margin-bottom:20px;">
<label>Choose log for {{selectedContainerId}}</label> <label>Choose log for {{selectedContainerId}}</label>
<div>
<select class="js-fetch-log-for-container" onchange={{action "showContentForLogFile" value="target.value"}} style="max-width:350px"> <select class="js-fetch-log-for-container" onchange={{action "showContentForLogFile" value="target.value"}} style="max-width:350px">
<option value="" selected={{eq selectedLogFileName ''}}>None</option> <option value="" selected={{eq selectedLogFileName ''}}>None</option>
{{#each containerLogFiles as |file|}} {{#each containerLogFiles as |file|}}
@ -95,6 +100,7 @@
{{/each}} {{/each}}
</select> </select>
</div> </div>
</div>
{{#if selectedLogFileName}} {{#if selectedLogFileName}}
<div class="col-md-6"> <div class="col-md-6">
<label>Find in log</label> <label>Find in log</label>
@ -125,7 +131,10 @@
{{else}} {{else}}
{{#unless _isLoadingBottomPanel}} {{#unless _isLoadingBottomPanel}}
<div class="col-md-12" style="margin-top:20px;"> <div class="col-md-12" style="margin-top:20px;">
<h4 class="text-center">No log data available!</h4> <h4 class="text-center">Logs are not available!</h4>
{{#if isLogAggregationNotSucceeded}}
<h4 class="text-center">Log aggregation may not be complete, check back later!</h4>
{{/if}}
</div> </div>
{{/unless}} {{/unless}}
{{/if}} {{/if}}