Skip to content

Commit

Permalink
Merge pull request #18823 from Sanskar531/ui-logs-disabled-message
Browse files Browse the repository at this point in the history
UI: Show message for when log collection is disabled
  • Loading branch information
philrenaud authored Dec 18, 2023
2 parents a6e1646 + e0e8357 commit 7a87049
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .changelog/18823.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:improvement
ui: Adds a warning message to pages in the Web UI when logs are disabled
```
6 changes: 6 additions & 0 deletions ui/app/components/task-log.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export default class TaskLog extends Component {

// When true, logs cannot be fetched from either the client or the server
noConnection = false;
logsDisabled = false;

clientTimeout = 1000;
serverTimeout = 5000;
Expand Down Expand Up @@ -82,6 +83,11 @@ export default class TaskLog extends Component {
timeout(timing),
]).then(
(response) => {
// whenever the log files 404, it is due to log collection
// being disabled.
if (response.status === 404) {
this.set('logsDisabled', true);
}
return response;
},
(error) => {
Expand Down
13 changes: 13 additions & 0 deletions ui/app/templates/components/task-log.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,19 @@
</div>
</div>
{{/if}}
{{#if this.logsDisabled}}
<div data-test-connection-error class="notification is-error">
<div class="columns">
<div class="column">
<h3 class="title is-4">Cannot fetch logs</h3>
<p>Logs unavailable. Log collection may be disabled.</p>
</div>
<div class="column is-centered is-minimum">
<button data-test-connection-error-dismiss class="button is-danger" onclick={{action (mut this.logsDisabled) false}} type="button">Okay</button>
</div>
</div>
</div>
{{/if}}
<div class="boxed-section-head task-log-head">
<span>
<button data-test-log-action="stdout" class="button {{if (eq this.mode "stdout") "is-info"}}" {{action "setMode" "stdout"}} type="button">stdout</button>
Expand Down

0 comments on commit 7a87049

Please sign in to comment.