Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(xo-server,xo-web): show link to the SR for the garbage collector (coalesce) task #7189

Merged
merged 2 commits into from
Nov 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.unreleased.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 5 additions & 1 deletion packages/xo-server/src/xapi-object-to-xo.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand All @@ -708,7 +712,7 @@ const TRANSFORMS = {
result: obj.result,
status: obj.status,
xapiRef: obj.$ref,

applies_to,
$host: link(obj, 'resident_on'),
}
},
Expand Down
13 changes: 10 additions & 3 deletions packages/xo-web/src/xo-app/tasks/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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>
)
Expand Down