Skip to content

Commit

Permalink
fix added to task page and computed prop moved to allocation model
Browse files Browse the repository at this point in the history
  • Loading branch information
philrenaud committed Apr 20, 2022
1 parent 3926584 commit f16fdc5
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion ui/.ember-cli
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
Setting `disableAnalytics` to true will prevent any data from being sent.
*/
"disableAnalytics": false,
"proxy": "http://127.0.0.1:4646"
"proxy": "http://192.168.56.11:4646"
}
8 changes: 0 additions & 8 deletions ui/app/components/task-row.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,6 @@ export default class TaskRow extends Component {
return !Ember.testing;
}

// When per_alloc is set to true on a volume, the volumes are duplicated between active allocations.
// We differentiate them with a [#] suffix, inferred from a volume's allocation's name property.
@computed('task.allocation.name')
get volumeExtension() {
let allocName = this.task.allocation.name;
return allocName.substring(allocName.lastIndexOf('['));
}

// Since all tasks for an allocation share the same tracker, use the registry
@computed('task.{allocation,isRunning}')
get stats() {
Expand Down
7 changes: 7 additions & 0 deletions ui/app/models/allocation.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,13 @@ export default class Allocation extends Model {
return [];
}

// When per_alloc is set to true on a volume, the volumes are duplicated between active allocations.
// We differentiate them with a [#] suffix, inferred from a volume's allocation's name property.
@computed('name')
get volumeExtension() {
return this.name.substring(this.name.lastIndexOf('['));
}

@fragmentArray('task-state') states;
@fragmentArray('reschedule-event') rescheduleEvents;

Expand Down
5 changes: 3 additions & 2 deletions ui/app/templates/allocations/allocation/task/index.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -161,12 +161,13 @@
</td>
<td data-test-volume-client-source>
{{#if row.model.isCSI}}
{{log "ah heck" row.model}}
<LinkTo
@route="csi.volumes.volume"
@model={{concat row.model.volume "@" row.model.namespace.id
@model={{concat row.model.source (if row.model.volumeDeclaration.perAlloc this.model.allocation.volumeExtension) "@" row.model.namespace.id
}}
>
{{row.model.volume}}
{{row.model.source}}
</LinkTo>
{{else}}
{{row.model.source}}
Expand Down
2 changes: 1 addition & 1 deletion ui/app/templates/components/task-row.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
{{#if volume.isCSI}}
<LinkTo
@route="csi.volumes.volume"
@model={{concat volume.source (if volume.volumeDeclaration.perAlloc this.volumeExtension) "@" volume.namespace.id}}
@model={{concat volume.source (if volume.volumeDeclaration.perAlloc this.task.allocation.volumeExtension) "@" volume.namespace.id}}
>
{{volume.source}}
</LinkTo>
Expand Down

0 comments on commit f16fdc5

Please sign in to comment.