feat(xo-server,xo-web): show link to the SR for the garbage collector (coalesce) task (#7189)
See https://github.com/vatesfr/xen-orchestra/issues/5379#issuecomment-1765170973
This commit is contained in:
@@ -9,6 +9,7 @@
|
||||
|
||||
- [VM/Disks] Display task information when importing VDIs (PR [#7197](https://github.com/vatesfr/xen-orchestra/pull/7197))
|
||||
- [REST API] Support VM import using the XVA format
|
||||
- [Task] Show the related SR on the Garbage Collector Task ( vdi coalescing) (PR [#7189](https://github.com/vatesfr/xen-orchestra/pull/7189))
|
||||
|
||||
### Bug fixes
|
||||
|
||||
|
||||
@@ -697,6 +697,10 @@ const TRANSFORMS = {
|
||||
// -----------------------------------------------------------------
|
||||
|
||||
task(obj) {
|
||||
let applies_to
|
||||
if (obj.other_config.applies_to) {
|
||||
applies_to = obj.$xapi.getObject(obj.other_config.applies_to, undefined).uuid
|
||||
}
|
||||
return {
|
||||
allowedOperations: obj.allowed_operations,
|
||||
created: toTimestamp(obj.created),
|
||||
@@ -708,7 +712,7 @@ const TRANSFORMS = {
|
||||
result: obj.result,
|
||||
status: obj.status,
|
||||
xapiRef: obj.$ref,
|
||||
|
||||
applies_to,
|
||||
$host: link(obj, 'resident_on'),
|
||||
}
|
||||
},
|
||||
|
||||
@@ -66,15 +66,22 @@ const FILTERS = {
|
||||
|
||||
@connectStore(() => ({
|
||||
host: createGetObject((_, props) => props.item.$host),
|
||||
appliesTo: createGetObject((_, props) => props.item.applies_to),
|
||||
}))
|
||||
export class TaskItem extends Component {
|
||||
render() {
|
||||
const { host, item: task } = this.props
|
||||
|
||||
const { appliesTo, host, item: task } = this.props
|
||||
// garbage collection task has an uuid in the desc
|
||||
const showDesc = task.name_description && task.name_label !== 'Garbage Collection'
|
||||
return (
|
||||
<div>
|
||||
{task.name_label} ({task.name_description && `${task.name_description} `}
|
||||
{task.name_label} ({showDesc && `${task.name_description} `}
|
||||
on {host ? <Link to={`/hosts/${host.id}`}>{host.name_label}</Link> : `unknown host − ${task.$host}`})
|
||||
{appliesTo !== undefined && (
|
||||
<span>
|
||||
, applies to <Link to={`/srs/${appliesTo.id}`}>{appliesTo.name_label}</Link>
|
||||
</span>
|
||||
)}
|
||||
{task.disappeared === undefined && ` ${Math.round(task.progress * 100)}%`}
|
||||
</div>
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user