Commit f3ddc10d authored by Dietmar Maurer's avatar Dietmar Maurer

fix bug #179: set default button 'no' for dangerous actions

parent c8e44125
pve-manager (2.0-64) unstable; urgency=low
* fix bug #179: set default button 'no' for dangerous actions
-- Proxmox Support Team <support@proxmox.com> Tue, 24 Apr 2012 08:09:23 +0200
pve-manager (2.0-63) unstable; urgency=low
* fix bug 128: implement pvectl startall/stopall
......
......@@ -2,7 +2,7 @@ RELEASE=2.0
VERSION=2.0
PACKAGE=pve-manager
PACKAGERELEASE=63
PACKAGERELEASE=64
BINDIR=${DESTDIR}/usr/bin
PERLLIBDIR=${DESTDIR}/usr/share/perl5
......
include ../defines.mk
LINGUAS=de it fr ja es sv ru zh_CN
LINGUAS=de it fr ja es sv ru tr zh_CN
all: $(patsubst %, pve-lang-%.js, $(LINGUAS))
......
This diff is collapsed.
......@@ -15,6 +15,9 @@ Ext.define('PVE.button.Button', {
// function(record) or text
confirmMsg: false,
// take special care in confirm box (select no as default).
dangerous: false,
initComponent: function() {
/*jslint confusion: true */
......@@ -36,12 +39,19 @@ Ext.define('PVE.button.Button', {
msg = me.confirmMsg;
if (Ext.isFunction(me.confirmMsg)) {
msg = me.confirmMsg(rec);
}
Ext.Msg.confirm(gettext('Confirm'), msg, function(btn) {
if (btn !== 'yes') {
return;
}
Ext.MessageBox.defaultButton = me.dangerous ? 2 : 1;
Ext.Msg.show({
title: gettext('Confirmtest'),
icon: 'ext-mb-question',
msg: msg,
buttons: Ext.Msg.YESNO,
callback: function(btn) {
if (btn !== 'yes') {
return;
}
me.realHandler(button, event, rec);
}
me.realHandler(button, event, rec);
});
} else {
me.realHandler(button, event, rec);
......
......@@ -116,6 +116,7 @@ Ext.define('PVE.grid.BackupView', {
text: gettext('Remove'),
disabled: true,
selModel: sm,
dangerous: true,
confirmMsg: function(rec) {
var msg = Ext.String.format(gettext('Are you sure you want to remove entry {0}'),
"'" + rec.data.volid + "'");
......
......@@ -85,6 +85,7 @@ Ext.define('PVE.openvz.Config', {
var removeBtn = Ext.create('PVE.button.Button', {
text: gettext('Remove'),
disabled: !caps.vms['VM.Allocate'],
dangerous: true,
confirmMsg: Ext.String.format(gettext('Are you sure you want to remove VM {0}? This will permanently erase all VM data.'), vmid),
handler: function() {
PVE.Utils.API2Request({
......
......@@ -85,6 +85,7 @@ Ext.define('PVE.qemu.Config', {
var removeBtn = Ext.create('PVE.button.Button', {
text: gettext('Remove'),
disabled: !caps.vms['VM.Allocate'],
dangerous: true,
confirmMsg: Ext.String.format(gettext('Are you sure you want to remove VM {0}? This will permanently erase all VM data.'), vmid),
handler: function() {
PVE.Utils.API2Request({
......
......@@ -210,6 +210,7 @@ Ext.define('PVE.qemu.HardwareView', {
text: gettext('Remove'),
selModel: sm,
disabled: true,
dangerous: true,
confirmMsg: function(rec) {
var msg = Ext.String.format(gettext('Are you sure you want to remove entry {0}'),
"'" + me.renderKey(rec.data.key, {}, rec) + "'");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment