ui: Remove unrequired node read from task log streaming page. (#24973)

Co-authored-by: Phil Renaud <phil@riotindustries.com>
This commit is contained in:
James Rasell
2025-01-30 08:42:27 +01:00
committed by GitHub
parent 47c14ddf28
commit bfd5f38761
3 changed files with 10 additions and 6 deletions

3
.changelog/24973.txt Normal file
View File

@@ -0,0 +1,3 @@
```release-note:bug
ui: Remove unrequired node read API call when attempting to stream task logs
```

View File

@@ -25,7 +25,7 @@ class MockAbortController {
export default class TaskLog extends Component {
@service token;
@service userSettings;
@service can;
allocation = null;
task = null;
@@ -50,11 +50,13 @@ export default class TaskLog extends Component {
@computed('allocation.{id,node.httpAddr}', 'useServer')
get logUrl() {
const address = this.get('allocation.node.httpAddr');
let address;
const allocation = this.get('allocation.id');
if (this.can.can('read client')) {
address = this.get('allocation.node.httpAddr');
}
const url = `/v1/client/fs/logs/${allocation}`;
return this.useServer ? url : `//${address}${url}`;
return this.useServer ? url : address ? `//${address}${url}` : url;
}
@computed('task', 'mode')

View File

@@ -7,7 +7,6 @@ import Route from '@ember/routing/route';
export default class LogsRoute extends Route {
model() {
const task = super.model(...arguments);
return task && task.get('allocation.node').then(() => task);
return super.model(...arguments);
}
}