mirror of
https://github.com/kemko/nomad.git
synced 2026-01-01 16:05:42 +03:00
ui: Remove unrequired node read from task log streaming page. (#24973)
Co-authored-by: Phil Renaud <phil@riotindustries.com>
This commit is contained in:
3
.changelog/24973.txt
Normal file
3
.changelog/24973.txt
Normal file
@@ -0,0 +1,3 @@
|
||||
```release-note:bug
|
||||
ui: Remove unrequired node read API call when attempting to stream task logs
|
||||
```
|
||||
@@ -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')
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user