]>
git.proxmox.com Git - pve-manager.git/blob - www/manager6/window/SafeDestroy.js
1 /* Popup a message window
2 * where the user has to manually enter the ressource ID
3 * to enable the destroy button
5 Ext
.define('PVE.window.SafeDestroy', {
6 extend
: 'Ext.window.Window',
7 alias
: 'widget.pveSafeDestroy',
8 title
: gettext('Are you sure?'),
10 buttonAlign
: 'center',
32 fieldLabel
: gettext('Please enter the VM ID to confirm'),
36 change: function(f
, value
) {
37 if (value
=== this.vmid
) {
38 this.submitBtn
.enable();
40 this.submitBtn
.disable();
51 text
: gettext('Remove'),
53 handler: function () {
55 PVE
.Utils
.API2Request({
59 failure: function(response
, opts
) {
60 Ext
.Msg
.alert('Error', response
.htmlStatus
);
63 me
.up('window').close();
66 text
: gettext('Cancel'),
68 this.up('window').close();
73 initComponent: function() {
77 var msg
= Ext
.String
.format(gettext('Are you sure you want to remove VM {0}? This will permanently erase all VM data.'), me
.vmid
);
79 var submitBtn
= me
.down('toolbar').getComponent('removeButton');
80 submitBtn
.base_url
= me
.base_url
;
82 var safepanel
= me
.getComponent('safepanel');
83 safepanel
.getComponent('message').setValue(msg
);
84 safepanel
.getComponent('input').vmid
= me
.vmid
;
85 safepanel
.getComponent('input').submitBtn
= submitBtn
;