deleteTpl: TemplateRef<any>;
@ViewChild('removingStatTpl', { static: true })
removingStatTpl: TemplateRef<any>;
- @ViewChild('provisionedNotAvailableTooltipTpl', { static: true })
- provisionedNotAvailableTooltipTpl: TemplateRef<any>;
- @ViewChild('totalProvisionedNotAvailableTooltipTpl', { static: true })
- totalProvisionedNotAvailableTooltipTpl: TemplateRef<any>;
@ViewChild('forcePromoteConfirmation', { static: true })
forcePromoteConfirmation: TemplateRef<any>;
+ @ViewChild('usedTmpl', { static: true })
+ usedTmpl: TemplateRef<any>;
+ @ViewChild('totalUsedTmpl', { static: true })
+ totalUsedTmpl: TemplateRef<any>;
+ @ViewChild('imageUsageTpl', { static: true })
+ imageUsageTpl: TemplateRef<any>;
permission: Permission;
tableActions: CdTableAction[];
icon: Icons.edit,
click: () => this.actionPrimary(true),
name: this.actionLabels.PROMOTE,
- visible: () => this.selection.first() != null && !this.selection.first().primary
+ visible: () => this.selection.first() != null && !this.selection.first().primary,
+ disable: () =>
+ this.selection.first().mirror_mode === 'Disabled'
+ ? 'Mirroring needs to be enabled on the image to perform this action'
+ : ''
};
const demoteAction: CdTableAction = {
permission: 'update',
icon: Icons.edit,
click: () => this.actionPrimary(false),
name: this.actionLabels.DEMOTE,
- visible: () => this.selection.first() != null && this.selection.first().primary
+ visible: () => this.selection.first() != null && this.selection.first().primary,
+ disable: () =>
+ this.selection.first().mirror_mode === 'Disabled'
+ ? 'Mirroring needs to be enabled on the image to perform this action'
+ : ''
};
this.tableActions = [
addAction,
sortable: false,
pipe: this.dimlessBinaryPipe
},
+ {
+ name: $localize`Usage`,
+ prop: 'usage',
+ cellTemplate: this.imageUsageTpl,
+ flexGrow: 1.5
+ },
{
name: $localize`Objects`,
prop: 'num_objs',
sortable: false,
pipe: this.dimlessBinaryPipe
},
- {
- name: $localize`Provisioned`,
- prop: 'disk_usage',
- cellClass: 'text-center',
- flexGrow: 1,
- pipe: this.dimlessBinaryPipe,
- sortable: false,
- cellTemplate: this.provisionedNotAvailableTooltipTpl
- },
- {
- name: $localize`Total provisioned`,
- prop: 'total_disk_usage',
- cellClass: 'text-center',
- flexGrow: 1,
- pipe: this.dimlessBinaryPipe,
- sortable: false,
- cellTemplate: this.totalProvisionedNotAvailableTooltipTpl
- },
{
name: $localize`Parent`,
prop: 'parent',