+ if (me.supportsWipeDisk) {
+ tbar.push('-');
+ tbar.push({
+ xtype: 'proxmoxButton',
+ text: gettext('Wipe Disk'),
+ parentXType: 'treepanel',
+ dangerous: true,
+ confirmMsg: function(rec) {
+ const data = rec.data;
+
+ let mainMessage = Ext.String.format(
+ gettext('Are you sure you want to wipe {0}?'),
+ data.devpath,
+ );
+ mainMessage += `<br> ${gettext('All data on the device will be lost!')}`;
+
+ const type = me.renderDiskType(data["disk-type"]);
+
+ let usage;
+ if (data.children.length > 0) {
+ const partitionUsage = data.children.map(
+ partition => me.renderDiskUsage(partition.used),
+ ).join(', ');
+ usage = `${gettext('Partitions')} (${partitionUsage})`;
+ } else {
+ usage = me.renderDiskUsage(data.used, undefined, rec);
+ }
+
+ const size = Proxmox.Utils.format_size(data.size);
+ const serial = Ext.String.htmlEncode(data.serial);
+
+ let additionalInfo = `${gettext('Type')}: ${type}<br>`;
+ additionalInfo += `${gettext('Usage')}: ${usage}<br>`;
+ additionalInfo += `${gettext('Size')}: ${size}<br>`;
+ additionalInfo += `${gettext('Serial')}: ${serial}`;
+
+ return `${mainMessage}<br><br>${additionalInfo}`;
+ },
+ disabled: true,
+ enableFn: function(rec) {
+ // TODO enable for partitions once they can be selected for ZFS,LVM,etc. creation
+ if (!rec || rec.data.parent) {
+ return false;
+ } else {
+ return true;
+ }
+ },
+ handler: 'wipeDisk',
+ });
+ }
+