mirror of
https://git.proxmox.com/git/pve-manager
synced 2025-08-15 03:58:26 +00:00
use windowEdit from widget toolkit
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com> Reviewed-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
parent
bc0eaf5870
commit
9fccc702ec
@ -74,7 +74,6 @@ JSSRC= \
|
|||||||
panel/InputPanel.js \
|
panel/InputPanel.js \
|
||||||
panel/GaugeWidget.js \
|
panel/GaugeWidget.js \
|
||||||
panel/HealthWidget.js \
|
panel/HealthWidget.js \
|
||||||
window/Edit.js \
|
|
||||||
window/LoginWindow.js \
|
window/LoginWindow.js \
|
||||||
window/TaskViewer.js \
|
window/TaskViewer.js \
|
||||||
window/Wizard.js \
|
window/Wizard.js \
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
Ext.define('PVE.CephCreateMon', {
|
Ext.define('PVE.CephCreateMon', {
|
||||||
extend: 'PVE.window.Edit',
|
extend: 'Proxmox.window.Edit',
|
||||||
alias: ['widget.pveCephCreateMon'],
|
alias: ['widget.pveCephCreateMon'],
|
||||||
|
|
||||||
subject: 'Ceph Monitor/Manager',
|
subject: 'Ceph Monitor/Manager',
|
||||||
|
@ -74,7 +74,7 @@ Ext.define('PVE.form.CephDiskSelector', {
|
|||||||
});
|
});
|
||||||
|
|
||||||
Ext.define('PVE.CephCreateOsd', {
|
Ext.define('PVE.CephCreateOsd', {
|
||||||
extend: 'PVE.window.Edit',
|
extend: 'Proxmox.window.Edit',
|
||||||
alias: ['widget.pveCephCreateOsd'],
|
alias: ['widget.pveCephCreateOsd'],
|
||||||
|
|
||||||
subject: 'Ceph OSD',
|
subject: 'Ceph OSD',
|
||||||
@ -130,7 +130,7 @@ Ext.define('PVE.CephCreateOsd', {
|
|||||||
});
|
});
|
||||||
|
|
||||||
Ext.define('PVE.CephRemoveOsd', {
|
Ext.define('PVE.CephRemoveOsd', {
|
||||||
extend: 'PVE.window.Edit',
|
extend: 'Proxmox.window.Edit',
|
||||||
alias: ['widget.pveCephRemoveOsd'],
|
alias: ['widget.pveCephRemoveOsd'],
|
||||||
|
|
||||||
isRemove: true,
|
isRemove: true,
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
Ext.define('PVE.CephCreatePool', {
|
Ext.define('PVE.CephCreatePool', {
|
||||||
extend: 'PVE.window.Edit',
|
extend: 'Proxmox.window.Edit',
|
||||||
alias: 'widget.pveCephCreatePool',
|
alias: 'widget.pveCephCreatePool',
|
||||||
|
|
||||||
showProgress: true,
|
showProgress: true,
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
Ext.define('PVE.dc.ACLAdd', {
|
Ext.define('PVE.dc.ACLAdd', {
|
||||||
extend: 'PVE.window.Edit',
|
extend: 'Proxmox.window.Edit',
|
||||||
alias: ['widget.pveACLAdd'],
|
alias: ['widget.pveACLAdd'],
|
||||||
url: '/access/acl',
|
url: '/access/acl',
|
||||||
method: 'PUT',
|
method: 'PUT',
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
Ext.define('PVE.dc.AuthEdit', {
|
Ext.define('PVE.dc.AuthEdit', {
|
||||||
extend: 'PVE.window.Edit',
|
extend: 'Proxmox.window.Edit',
|
||||||
alias: ['widget.pveDcAuthEdit'],
|
alias: ['widget.pveDcAuthEdit'],
|
||||||
|
|
||||||
isAdd: true,
|
isAdd: true,
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
Ext.define('PVE.dc.BackupEdit', {
|
Ext.define('PVE.dc.BackupEdit', {
|
||||||
extend: 'PVE.window.Edit',
|
extend: 'Proxmox.window.Edit',
|
||||||
alias: ['widget.pveDcBackupEdit'],
|
alias: ['widget.pveDcBackupEdit'],
|
||||||
|
|
||||||
defaultFocus: undefined,
|
defaultFocus: undefined,
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
Ext.define('PVE.dc.GroupEdit', {
|
Ext.define('PVE.dc.GroupEdit', {
|
||||||
extend: 'PVE.window.Edit',
|
extend: 'Proxmox.window.Edit',
|
||||||
alias: ['widget.pveDcGroupEdit'],
|
alias: ['widget.pveDcGroupEdit'],
|
||||||
|
|
||||||
initComponent : function() {
|
initComponent : function() {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
Ext.define('PVE.dc.PoolEdit', {
|
Ext.define('PVE.dc.PoolEdit', {
|
||||||
extend: 'PVE.window.Edit',
|
extend: 'Proxmox.window.Edit',
|
||||||
alias: ['widget.pveDcPoolEdit'],
|
alias: ['widget.pveDcPoolEdit'],
|
||||||
|
|
||||||
initComponent : function() {
|
initComponent : function() {
|
||||||
|
@ -6,7 +6,7 @@ Ext.define('pve-security-groups', {
|
|||||||
});
|
});
|
||||||
|
|
||||||
Ext.define('PVE.SecurityGroupEdit', {
|
Ext.define('PVE.SecurityGroupEdit', {
|
||||||
extend: 'PVE.window.Edit',
|
extend: 'Proxmox.window.Edit',
|
||||||
|
|
||||||
base_url: "/cluster/firewall/groups",
|
base_url: "/cluster/firewall/groups",
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
Ext.define('PVE.dc.UserEdit', {
|
Ext.define('PVE.dc.UserEdit', {
|
||||||
extend: 'PVE.window.Edit',
|
extend: 'Proxmox.window.Edit',
|
||||||
alias: ['widget.pveDcUserEdit'],
|
alias: ['widget.pveDcUserEdit'],
|
||||||
|
|
||||||
isAdd: true,
|
isAdd: true,
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
Ext.define('PVE.window.PasswordEdit', {
|
Ext.define('PVE.window.PasswordEdit', {
|
||||||
extend: 'PVE.window.Edit',
|
extend: 'Proxmox.window.Edit',
|
||||||
|
|
||||||
initComponent : function() {
|
initComponent : function() {
|
||||||
var me = this;
|
var me = this;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
Ext.define('PVE.FirewallAliasEdit', {
|
Ext.define('PVE.FirewallAliasEdit', {
|
||||||
extend: 'PVE.window.Edit',
|
extend: 'Proxmox.window.Edit',
|
||||||
|
|
||||||
base_url: undefined,
|
base_url: undefined,
|
||||||
|
|
||||||
|
@ -38,7 +38,7 @@ Ext.define('PVE.FirewallOptions', {
|
|||||||
required: true,
|
required: true,
|
||||||
defaultValue: 'nolog',
|
defaultValue: 'nolog',
|
||||||
editor: {
|
editor: {
|
||||||
xtype: 'pveWindowEdit',
|
xtype: 'proxmoxWindowEdit',
|
||||||
subject: name,
|
subject: name,
|
||||||
fieldDefaults: { labelWidth: labelWidth || 100 },
|
fieldDefaults: { labelWidth: labelWidth || 100 },
|
||||||
items: {
|
items: {
|
||||||
@ -85,7 +85,7 @@ Ext.define('PVE.FirewallOptions', {
|
|||||||
required: true,
|
required: true,
|
||||||
defaultValue: 'DROP',
|
defaultValue: 'DROP',
|
||||||
editor: {
|
editor: {
|
||||||
xtype: 'pveWindowEdit',
|
xtype: 'proxmoxWindowEdit',
|
||||||
subject: gettext('Input Policy'),
|
subject: gettext('Input Policy'),
|
||||||
items: {
|
items: {
|
||||||
xtype: 'pveFirewallPolicySelector',
|
xtype: 'pveFirewallPolicySelector',
|
||||||
@ -101,7 +101,7 @@ Ext.define('PVE.FirewallOptions', {
|
|||||||
required: true,
|
required: true,
|
||||||
defaultValue: 'ACCEPT',
|
defaultValue: 'ACCEPT',
|
||||||
editor: {
|
editor: {
|
||||||
xtype: 'pveWindowEdit',
|
xtype: 'proxmoxWindowEdit',
|
||||||
subject: gettext('Output Policy'),
|
subject: gettext('Output Policy'),
|
||||||
items: {
|
items: {
|
||||||
xtype: 'pveFirewallPolicySelector',
|
xtype: 'pveFirewallPolicySelector',
|
||||||
|
@ -222,7 +222,7 @@ Ext.define('PVE.FirewallRulePanel', {
|
|||||||
});
|
});
|
||||||
|
|
||||||
Ext.define('PVE.FirewallRuleEdit', {
|
Ext.define('PVE.FirewallRuleEdit', {
|
||||||
extend: 'PVE.window.Edit',
|
extend: 'Proxmox.window.Edit',
|
||||||
|
|
||||||
base_url: undefined,
|
base_url: undefined,
|
||||||
list_refs_url: undefined,
|
list_refs_url: undefined,
|
||||||
@ -287,7 +287,7 @@ Ext.define('PVE.FirewallRuleEdit', {
|
|||||||
});
|
});
|
||||||
|
|
||||||
Ext.define('PVE.FirewallGroupRuleEdit', {
|
Ext.define('PVE.FirewallGroupRuleEdit', {
|
||||||
extend: 'PVE.window.Edit',
|
extend: 'Proxmox.window.Edit',
|
||||||
|
|
||||||
base_url: undefined,
|
base_url: undefined,
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
Ext.define('PVE.pool.AddVM', {
|
Ext.define('PVE.pool.AddVM', {
|
||||||
extend: 'PVE.window.Edit',
|
extend: 'Proxmox.window.Edit',
|
||||||
width: 600,
|
width: 600,
|
||||||
height: 400,
|
height: 400,
|
||||||
isAdd: true,
|
isAdd: true,
|
||||||
@ -97,7 +97,7 @@ Ext.define('PVE.pool.AddVM', {
|
|||||||
});
|
});
|
||||||
|
|
||||||
Ext.define('PVE.pool.AddStorage', {
|
Ext.define('PVE.pool.AddStorage', {
|
||||||
extend: 'PVE.window.Edit',
|
extend: 'Proxmox.window.Edit',
|
||||||
|
|
||||||
initComponent : function() {
|
initComponent : function() {
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
Ext.define('PVE.window.ReplicaEdit', {
|
Ext.define('PVE.window.ReplicaEdit', {
|
||||||
extend: 'PVE.window.Edit',
|
extend: 'Proxmox.window.Edit',
|
||||||
xtype: 'pveReplicaEdit',
|
xtype: 'pveReplicaEdit',
|
||||||
|
|
||||||
subject: gettext('Replication Job'),
|
subject: gettext('Replication Job'),
|
||||||
|
@ -191,7 +191,7 @@ Ext.define('PVE.ha.GroupInputPanel', {
|
|||||||
});
|
});
|
||||||
|
|
||||||
Ext.define('PVE.ha.GroupEdit', {
|
Ext.define('PVE.ha.GroupEdit', {
|
||||||
extend: 'PVE.window.Edit',
|
extend: 'Proxmox.window.Edit',
|
||||||
|
|
||||||
groupId: undefined,
|
groupId: undefined,
|
||||||
|
|
||||||
|
@ -155,7 +155,7 @@ Ext.define('PVE.ha.VMResourceInputPanel', {
|
|||||||
});
|
});
|
||||||
|
|
||||||
Ext.define('PVE.ha.VMResourceEdit', {
|
Ext.define('PVE.ha.VMResourceEdit', {
|
||||||
extend: 'PVE.window.Edit',
|
extend: 'Proxmox.window.Edit',
|
||||||
|
|
||||||
vmid: undefined,
|
vmid: undefined,
|
||||||
guestType: undefined,
|
guestType: undefined,
|
||||||
|
@ -97,7 +97,7 @@ Ext.define('PVE.lxc.DNSInputPanel', {
|
|||||||
});
|
});
|
||||||
|
|
||||||
Ext.define('PVE.lxc.DNSEdit', {
|
Ext.define('PVE.lxc.DNSEdit', {
|
||||||
extend: 'PVE.window.Edit',
|
extend: 'Proxmox.window.Edit',
|
||||||
|
|
||||||
initComponent : function() {
|
initComponent : function() {
|
||||||
var me = this;
|
var me = this;
|
||||||
@ -161,7 +161,7 @@ Ext.define('PVE.lxc.DNS', {
|
|||||||
defaultValue: me.pveSelNode.data.name,
|
defaultValue: me.pveSelNode.data.name,
|
||||||
header: gettext('Hostname'),
|
header: gettext('Hostname'),
|
||||||
editor: caps.vms['VM.Config.Network'] ? {
|
editor: caps.vms['VM.Config.Network'] ? {
|
||||||
xtype: 'pveWindowEdit',
|
xtype: 'proxmoxWindowEdit',
|
||||||
subject: gettext('Hostname'),
|
subject: gettext('Hostname'),
|
||||||
items: {
|
items: {
|
||||||
xtype: 'inputpanel',
|
xtype: 'inputpanel',
|
||||||
|
@ -286,7 +286,7 @@ Ext.define('PVE.lxc.MountPointInputPanel', {
|
|||||||
});
|
});
|
||||||
|
|
||||||
Ext.define('PVE.lxc.MountPointEdit', {
|
Ext.define('PVE.lxc.MountPointEdit', {
|
||||||
extend: 'PVE.window.Edit',
|
extend: 'Proxmox.window.Edit',
|
||||||
|
|
||||||
unprivileged: false,
|
unprivileged: false,
|
||||||
|
|
||||||
|
@ -293,7 +293,7 @@ Ext.define('PVE.lxc.NetworkInputPanel', {
|
|||||||
|
|
||||||
|
|
||||||
Ext.define('PVE.lxc.NetworkEdit', {
|
Ext.define('PVE.lxc.NetworkEdit', {
|
||||||
extend: 'PVE.window.Edit',
|
extend: 'Proxmox.window.Edit',
|
||||||
|
|
||||||
isAdd: true,
|
isAdd: true,
|
||||||
|
|
||||||
|
@ -27,7 +27,7 @@ Ext.define('PVE.lxc.Options', {
|
|||||||
defaultValue: '',
|
defaultValue: '',
|
||||||
renderer: Proxmox.Utils.format_boolean,
|
renderer: Proxmox.Utils.format_boolean,
|
||||||
editor: caps.vms['VM.Config.Options'] ? {
|
editor: caps.vms['VM.Config.Options'] ? {
|
||||||
xtype: 'pveWindowEdit',
|
xtype: 'proxmoxWindowEdit',
|
||||||
subject: gettext('Start at boot'),
|
subject: gettext('Start at boot'),
|
||||||
items: {
|
items: {
|
||||||
xtype: 'proxmoxcheckbox',
|
xtype: 'proxmoxcheckbox',
|
||||||
@ -61,7 +61,7 @@ Ext.define('PVE.lxc.Options', {
|
|||||||
defaultValue: 1,
|
defaultValue: 1,
|
||||||
renderer: Proxmox.Utils.format_enabled_toggle,
|
renderer: Proxmox.Utils.format_enabled_toggle,
|
||||||
editor: caps.vms['VM.Config.Options'] ? {
|
editor: caps.vms['VM.Config.Options'] ? {
|
||||||
xtype: 'pveWindowEdit',
|
xtype: 'proxmoxWindowEdit',
|
||||||
subject: '/dev/console',
|
subject: '/dev/console',
|
||||||
items: {
|
items: {
|
||||||
xtype: 'proxmoxcheckbox',
|
xtype: 'proxmoxcheckbox',
|
||||||
@ -78,7 +78,7 @@ Ext.define('PVE.lxc.Options', {
|
|||||||
header: gettext('TTY count'),
|
header: gettext('TTY count'),
|
||||||
defaultValue: 2,
|
defaultValue: 2,
|
||||||
editor: caps.vms['VM.Config.Options'] ? {
|
editor: caps.vms['VM.Config.Options'] ? {
|
||||||
xtype: 'pveWindowEdit',
|
xtype: 'proxmoxWindowEdit',
|
||||||
subject: gettext('TTY count'),
|
subject: gettext('TTY count'),
|
||||||
items: {
|
items: {
|
||||||
xtype: 'proxmoxintegerfield',
|
xtype: 'proxmoxintegerfield',
|
||||||
@ -96,7 +96,7 @@ Ext.define('PVE.lxc.Options', {
|
|||||||
header: gettext('Console mode'),
|
header: gettext('Console mode'),
|
||||||
defaultValue: 'tty',
|
defaultValue: 'tty',
|
||||||
editor: caps.vms['VM.Config.Options'] ? {
|
editor: caps.vms['VM.Config.Options'] ? {
|
||||||
xtype: 'pveWindowEdit',
|
xtype: 'proxmoxWindowEdit',
|
||||||
subject: gettext('Console mode'),
|
subject: gettext('Console mode'),
|
||||||
items: {
|
items: {
|
||||||
xtype: 'proxmoxKVComboBox',
|
xtype: 'proxmoxKVComboBox',
|
||||||
@ -118,7 +118,7 @@ Ext.define('PVE.lxc.Options', {
|
|||||||
defaultValue: false,
|
defaultValue: false,
|
||||||
renderer: Proxmox.Utils.format_boolean,
|
renderer: Proxmox.Utils.format_boolean,
|
||||||
editor: caps.vms['VM.Config.Options'] ? {
|
editor: caps.vms['VM.Config.Options'] ? {
|
||||||
xtype: 'pveWindowEdit',
|
xtype: 'proxmoxWindowEdit',
|
||||||
subject: gettext('Protection'),
|
subject: gettext('Protection'),
|
||||||
items: {
|
items: {
|
||||||
xtype: 'proxmoxcheckbox',
|
xtype: 'proxmoxcheckbox',
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
var labelWidth = 120;
|
var labelWidth = 120;
|
||||||
|
|
||||||
Ext.define('PVE.lxc.MemoryEdit', {
|
Ext.define('PVE.lxc.MemoryEdit', {
|
||||||
extend: 'PVE.window.Edit',
|
extend: 'Proxmox.window.Edit',
|
||||||
|
|
||||||
initComponent : function() {
|
initComponent : function() {
|
||||||
var me = this;
|
var me = this;
|
||||||
@ -20,7 +20,7 @@ Ext.define('PVE.lxc.MemoryEdit', {
|
|||||||
|
|
||||||
|
|
||||||
Ext.define('PVE.lxc.CPUEdit', {
|
Ext.define('PVE.lxc.CPUEdit', {
|
||||||
extend: 'PVE.window.Edit',
|
extend: 'Proxmox.window.Edit',
|
||||||
|
|
||||||
initComponent : function() {
|
initComponent : function() {
|
||||||
var me = this;
|
var me = this;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*global Blob*/
|
/*global Blob*/
|
||||||
Ext.define('PVE.node.SubscriptionKeyEdit', {
|
Ext.define('PVE.node.SubscriptionKeyEdit', {
|
||||||
extend: 'PVE.window.Edit',
|
extend: 'Proxmox.window.Edit',
|
||||||
title: gettext('Upload Subscription Key'),
|
title: gettext('Upload Subscription Key'),
|
||||||
width: 300,
|
width: 300,
|
||||||
items: {
|
items: {
|
||||||
|
@ -62,7 +62,7 @@ Ext.define('PVE.IPSetList', {
|
|||||||
if (!rec) {
|
if (!rec) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var win = Ext.create('PVE.window.Edit', {
|
var win = Ext.create('Proxmox.window.Edit', {
|
||||||
subject: "IPSet '" + rec.data.name + "'",
|
subject: "IPSet '" + rec.data.name + "'",
|
||||||
url: me.base_url,
|
url: me.base_url,
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
@ -103,7 +103,7 @@ Ext.define('PVE.IPSetList', {
|
|||||||
text: gettext('Create'),
|
text: gettext('Create'),
|
||||||
handler: function() {
|
handler: function() {
|
||||||
sm.deselectAll();
|
sm.deselectAll();
|
||||||
var win = Ext.create('PVE.window.Edit', {
|
var win = Ext.create('Proxmox.window.Edit', {
|
||||||
subject: 'IPSet',
|
subject: 'IPSet',
|
||||||
url: me.base_url,
|
url: me.base_url,
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
@ -163,7 +163,7 @@ Ext.define('PVE.IPSetList', {
|
|||||||
});
|
});
|
||||||
|
|
||||||
Ext.define('PVE.IPSetCidrEdit', {
|
Ext.define('PVE.IPSetCidrEdit', {
|
||||||
extend: 'PVE.window.Edit',
|
extend: 'Proxmox.window.Edit',
|
||||||
|
|
||||||
cidr: undefined,
|
cidr: undefined,
|
||||||
|
|
||||||
|
@ -149,7 +149,7 @@ Ext.define('PVE.qemu.BootOrderPanel', {
|
|||||||
});
|
});
|
||||||
|
|
||||||
Ext.define('PVE.qemu.BootOrderEdit', {
|
Ext.define('PVE.qemu.BootOrderEdit', {
|
||||||
extend: 'PVE.window.Edit',
|
extend: 'Proxmox.window.Edit',
|
||||||
|
|
||||||
items: [{
|
items: [{
|
||||||
xtype: 'pveQemuBootOrderPanel',
|
xtype: 'pveQemuBootOrderPanel',
|
||||||
|
@ -142,7 +142,7 @@ Ext.define('PVE.qemu.CDInputPanel', {
|
|||||||
});
|
});
|
||||||
|
|
||||||
Ext.define('PVE.qemu.CDEdit', {
|
Ext.define('PVE.qemu.CDEdit', {
|
||||||
extend: 'PVE.window.Edit',
|
extend: 'Proxmox.window.Edit',
|
||||||
|
|
||||||
initComponent : function() {
|
initComponent : function() {
|
||||||
var me = this;
|
var me = this;
|
||||||
|
@ -56,7 +56,7 @@ Ext.define('PVE.qemu.CPUOptionsInputPanel', {
|
|||||||
});
|
});
|
||||||
|
|
||||||
Ext.define('PVE.qemu.CPUOptions', {
|
Ext.define('PVE.qemu.CPUOptions', {
|
||||||
extend: 'PVE.window.Edit',
|
extend: 'Proxmox.window.Edit',
|
||||||
|
|
||||||
initComponent : function() {
|
initComponent : function() {
|
||||||
var me = this;
|
var me = this;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
Ext.define('PVE.qemu.DisplayEdit', {
|
Ext.define('PVE.qemu.DisplayEdit', {
|
||||||
extend: 'PVE.window.Edit',
|
extend: 'Proxmox.window.Edit',
|
||||||
|
|
||||||
vmconfig: undefined,
|
vmconfig: undefined,
|
||||||
|
|
||||||
|
@ -249,7 +249,7 @@ Ext.define('PVE.qemu.HDInputPanel', {
|
|||||||
/*jslint confusion: false */
|
/*jslint confusion: false */
|
||||||
|
|
||||||
Ext.define('PVE.qemu.HDEdit', {
|
Ext.define('PVE.qemu.HDEdit', {
|
||||||
extend: 'PVE.window.Edit',
|
extend: 'Proxmox.window.Edit',
|
||||||
|
|
||||||
isAdd: true,
|
isAdd: true,
|
||||||
|
|
||||||
|
@ -51,7 +51,7 @@ Ext.define('PVE.qemu.EFIDiskInputPanel', {
|
|||||||
});
|
});
|
||||||
|
|
||||||
Ext.define('PVE.qemu.EFIDiskEdit', {
|
Ext.define('PVE.qemu.EFIDiskEdit', {
|
||||||
extend: 'PVE.window.Edit',
|
extend: 'Proxmox.window.Edit',
|
||||||
|
|
||||||
isAdd: true,
|
isAdd: true,
|
||||||
subject: gettext('EFI Disk'),
|
subject: gettext('EFI Disk'),
|
||||||
|
@ -158,7 +158,7 @@ Ext.define('PVE.qemu.HDThrottleInputPanel', {
|
|||||||
});
|
});
|
||||||
|
|
||||||
Ext.define('PVE.qemu.HDThrottle', {
|
Ext.define('PVE.qemu.HDThrottle', {
|
||||||
extend: 'PVE.window.Edit',
|
extend: 'Proxmox.window.Edit',
|
||||||
|
|
||||||
isAdd: true,
|
isAdd: true,
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
Ext.define('PVE.qemu.KeyboardEdit', {
|
Ext.define('PVE.qemu.KeyboardEdit', {
|
||||||
extend: 'PVE.window.Edit',
|
extend: 'Proxmox.window.Edit',
|
||||||
|
|
||||||
initComponent : function() {
|
initComponent : function() {
|
||||||
var me = this;
|
var me = this;
|
||||||
|
@ -149,7 +149,7 @@ Ext.define('PVE.qemu.MemoryInputPanel', {
|
|||||||
});
|
});
|
||||||
|
|
||||||
Ext.define('PVE.qemu.MemoryEdit', {
|
Ext.define('PVE.qemu.MemoryEdit', {
|
||||||
extend: 'PVE.window.Edit',
|
extend: 'Proxmox.window.Edit',
|
||||||
|
|
||||||
initComponent : function() {
|
initComponent : function() {
|
||||||
var me = this;
|
var me = this;
|
||||||
|
@ -169,7 +169,7 @@ Ext.define('PVE.qemu.NetworkInputPanel', {
|
|||||||
});
|
});
|
||||||
|
|
||||||
Ext.define('PVE.qemu.NetworkEdit', {
|
Ext.define('PVE.qemu.NetworkEdit', {
|
||||||
extend: 'PVE.window.Edit',
|
extend: 'Proxmox.window.Edit',
|
||||||
|
|
||||||
isAdd: true,
|
isAdd: true,
|
||||||
|
|
||||||
|
@ -96,7 +96,7 @@ Ext.define('PVE.qemu.OSTypeInputPanel', {
|
|||||||
});
|
});
|
||||||
|
|
||||||
Ext.define('PVE.qemu.OSTypeEdit', {
|
Ext.define('PVE.qemu.OSTypeEdit', {
|
||||||
extend: 'PVE.window.Edit',
|
extend: 'Proxmox.window.Edit',
|
||||||
|
|
||||||
subject: 'OS Type',
|
subject: 'OS Type',
|
||||||
|
|
||||||
|
@ -27,7 +27,7 @@ Ext.define('PVE.qemu.Options', {
|
|||||||
defaultValue: me.pveSelNode.data.name,
|
defaultValue: me.pveSelNode.data.name,
|
||||||
header: gettext('Name'),
|
header: gettext('Name'),
|
||||||
editor: caps.vms['VM.Config.Options'] ? {
|
editor: caps.vms['VM.Config.Options'] ? {
|
||||||
xtype: 'pveWindowEdit',
|
xtype: 'proxmoxWindowEdit',
|
||||||
subject: gettext('Name'),
|
subject: gettext('Name'),
|
||||||
items: {
|
items: {
|
||||||
xtype: 'inputpanel',
|
xtype: 'inputpanel',
|
||||||
@ -56,7 +56,7 @@ Ext.define('PVE.qemu.Options', {
|
|||||||
defaultValue: '',
|
defaultValue: '',
|
||||||
renderer: Proxmox.Utils.format_boolean,
|
renderer: Proxmox.Utils.format_boolean,
|
||||||
editor: caps.vms['VM.Config.Options'] ? {
|
editor: caps.vms['VM.Config.Options'] ? {
|
||||||
xtype: 'pveWindowEdit',
|
xtype: 'proxmoxWindowEdit',
|
||||||
subject: gettext('Start at boot'),
|
subject: gettext('Start at boot'),
|
||||||
items: {
|
items: {
|
||||||
xtype: 'proxmoxcheckbox',
|
xtype: 'proxmoxcheckbox',
|
||||||
@ -126,7 +126,7 @@ Ext.define('PVE.qemu.Options', {
|
|||||||
defaultValue: true,
|
defaultValue: true,
|
||||||
renderer: Proxmox.Utils.format_boolean,
|
renderer: Proxmox.Utils.format_boolean,
|
||||||
editor: caps.vms['VM.Config.HWType'] ? {
|
editor: caps.vms['VM.Config.HWType'] ? {
|
||||||
xtype: 'pveWindowEdit',
|
xtype: 'proxmoxWindowEdit',
|
||||||
subject: gettext('Use tablet for pointer'),
|
subject: gettext('Use tablet for pointer'),
|
||||||
items: {
|
items: {
|
||||||
xtype: 'proxmoxcheckbox',
|
xtype: 'proxmoxcheckbox',
|
||||||
@ -144,7 +144,7 @@ Ext.define('PVE.qemu.Options', {
|
|||||||
defaultValue: 'disk,network,usb',
|
defaultValue: 'disk,network,usb',
|
||||||
renderer: PVE.Utils.render_hotplug_features,
|
renderer: PVE.Utils.render_hotplug_features,
|
||||||
editor: caps.vms['VM.Config.HWType'] ? {
|
editor: caps.vms['VM.Config.HWType'] ? {
|
||||||
xtype: 'pveWindowEdit',
|
xtype: 'proxmoxWindowEdit',
|
||||||
subject: gettext('Hotplug'),
|
subject: gettext('Hotplug'),
|
||||||
items: {
|
items: {
|
||||||
xtype: 'pveHotplugFeatureSelector',
|
xtype: 'pveHotplugFeatureSelector',
|
||||||
@ -161,7 +161,7 @@ Ext.define('PVE.qemu.Options', {
|
|||||||
defaultValue: true,
|
defaultValue: true,
|
||||||
renderer: Proxmox.Utils.format_boolean,
|
renderer: Proxmox.Utils.format_boolean,
|
||||||
editor: caps.vms['VM.Config.HWType'] ? {
|
editor: caps.vms['VM.Config.HWType'] ? {
|
||||||
xtype: 'pveWindowEdit',
|
xtype: 'proxmoxWindowEdit',
|
||||||
subject: gettext('ACPI support'),
|
subject: gettext('ACPI support'),
|
||||||
items: {
|
items: {
|
||||||
xtype: 'proxmoxcheckbox',
|
xtype: 'proxmoxcheckbox',
|
||||||
@ -191,7 +191,7 @@ Ext.define('PVE.qemu.Options', {
|
|||||||
defaultValue: true,
|
defaultValue: true,
|
||||||
renderer: Proxmox.Utils.format_boolean,
|
renderer: Proxmox.Utils.format_boolean,
|
||||||
editor: caps.vms['VM.Config.HWType'] ? {
|
editor: caps.vms['VM.Config.HWType'] ? {
|
||||||
xtype: 'pveWindowEdit',
|
xtype: 'proxmoxWindowEdit',
|
||||||
subject: gettext('KVM hardware virtualization'),
|
subject: gettext('KVM hardware virtualization'),
|
||||||
items: {
|
items: {
|
||||||
xtype: 'proxmoxcheckbox',
|
xtype: 'proxmoxcheckbox',
|
||||||
@ -209,7 +209,7 @@ Ext.define('PVE.qemu.Options', {
|
|||||||
defaultValue: false,
|
defaultValue: false,
|
||||||
renderer: Proxmox.Utils.format_boolean,
|
renderer: Proxmox.Utils.format_boolean,
|
||||||
editor: caps.vms['VM.PowerMgmt'] ? {
|
editor: caps.vms['VM.PowerMgmt'] ? {
|
||||||
xtype: 'pveWindowEdit',
|
xtype: 'proxmoxWindowEdit',
|
||||||
subject: gettext('Freeze CPU at startup'),
|
subject: gettext('Freeze CPU at startup'),
|
||||||
items: {
|
items: {
|
||||||
xtype: 'proxmoxcheckbox',
|
xtype: 'proxmoxcheckbox',
|
||||||
@ -227,7 +227,7 @@ Ext.define('PVE.qemu.Options', {
|
|||||||
defaultValue: false,
|
defaultValue: false,
|
||||||
renderer: Proxmox.Utils.format_boolean,
|
renderer: Proxmox.Utils.format_boolean,
|
||||||
editor: caps.vms['VM.Config.Options'] ? {
|
editor: caps.vms['VM.Config.Options'] ? {
|
||||||
xtype: 'pveWindowEdit',
|
xtype: 'proxmoxWindowEdit',
|
||||||
subject: gettext('Use local time for RTC'),
|
subject: gettext('Use local time for RTC'),
|
||||||
items: {
|
items: {
|
||||||
xtype: 'proxmoxcheckbox',
|
xtype: 'proxmoxcheckbox',
|
||||||
@ -244,7 +244,7 @@ Ext.define('PVE.qemu.Options', {
|
|||||||
header: gettext('RTC start date'),
|
header: gettext('RTC start date'),
|
||||||
defaultValue: 'now',
|
defaultValue: 'now',
|
||||||
editor: caps.vms['VM.Config.Options'] ? {
|
editor: caps.vms['VM.Config.Options'] ? {
|
||||||
xtype: 'pveWindowEdit',
|
xtype: 'proxmoxWindowEdit',
|
||||||
subject: gettext('RTC start date'),
|
subject: gettext('RTC start date'),
|
||||||
items: {
|
items: {
|
||||||
xtype: 'proxmoxtextfield',
|
xtype: 'proxmoxtextfield',
|
||||||
@ -268,7 +268,7 @@ Ext.define('PVE.qemu.Options', {
|
|||||||
defaultValue: false,
|
defaultValue: false,
|
||||||
renderer: Proxmox.Utils.format_boolean,
|
renderer: Proxmox.Utils.format_boolean,
|
||||||
editor: caps.vms['VM.Config.Options'] ? {
|
editor: caps.vms['VM.Config.Options'] ? {
|
||||||
xtype: 'pveWindowEdit',
|
xtype: 'proxmoxWindowEdit',
|
||||||
subject: gettext('Qemu Agent'),
|
subject: gettext('Qemu Agent'),
|
||||||
items: {
|
items: {
|
||||||
xtype: 'proxmoxcheckbox',
|
xtype: 'proxmoxcheckbox',
|
||||||
@ -285,7 +285,7 @@ Ext.define('PVE.qemu.Options', {
|
|||||||
defaultValue: false,
|
defaultValue: false,
|
||||||
renderer: Proxmox.Utils.format_boolean,
|
renderer: Proxmox.Utils.format_boolean,
|
||||||
editor: caps.vms['VM.Config.Options'] ? {
|
editor: caps.vms['VM.Config.Options'] ? {
|
||||||
xtype: 'pveWindowEdit',
|
xtype: 'proxmoxWindowEdit',
|
||||||
subject: gettext('Protection'),
|
subject: gettext('Protection'),
|
||||||
items: {
|
items: {
|
||||||
xtype: 'proxmoxcheckbox',
|
xtype: 'proxmoxcheckbox',
|
||||||
|
@ -133,7 +133,7 @@ Ext.define('PVE.qemu.ProcessorInputPanel', {
|
|||||||
});
|
});
|
||||||
|
|
||||||
Ext.define('PVE.qemu.ProcessorEdit', {
|
Ext.define('PVE.qemu.ProcessorEdit', {
|
||||||
extend: 'PVE.window.Edit',
|
extend: 'Proxmox.window.Edit',
|
||||||
|
|
||||||
initComponent : function() {
|
initComponent : function() {
|
||||||
var me = this;
|
var me = this;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
Ext.define('PVE.qemu.BiosEdit', {
|
Ext.define('PVE.qemu.BiosEdit', {
|
||||||
extend: 'PVE.window.Edit',
|
extend: 'Proxmox.window.Edit',
|
||||||
alias: 'widget.pveQemuBiosEdit',
|
alias: 'widget.pveQemuBiosEdit',
|
||||||
|
|
||||||
initComponent : function() {
|
initComponent : function() {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
Ext.define('PVE.qemu.ScsiHwEdit', {
|
Ext.define('PVE.qemu.ScsiHwEdit', {
|
||||||
extend: 'PVE.window.Edit',
|
extend: 'Proxmox.window.Edit',
|
||||||
|
|
||||||
initComponent : function() {
|
initComponent : function() {
|
||||||
var me = this;
|
var me = this;
|
||||||
|
@ -78,7 +78,7 @@ Ext.define('PVE.qemu.Smbios1InputPanel', {
|
|||||||
});
|
});
|
||||||
|
|
||||||
Ext.define('PVE.qemu.Smbios1Edit', {
|
Ext.define('PVE.qemu.Smbios1Edit', {
|
||||||
extend: 'PVE.window.Edit',
|
extend: 'Proxmox.window.Edit',
|
||||||
|
|
||||||
initComponent : function() {
|
initComponent : function() {
|
||||||
/*jslint confusion: true */
|
/*jslint confusion: true */
|
||||||
|
@ -150,7 +150,7 @@ Ext.define('PVE.qemu.USBInputPanel', {
|
|||||||
});
|
});
|
||||||
|
|
||||||
Ext.define('PVE.qemu.USBEdit', {
|
Ext.define('PVE.qemu.USBEdit', {
|
||||||
extend: 'PVE.window.Edit',
|
extend: 'Proxmox.window.Edit',
|
||||||
|
|
||||||
vmconfig: undefined,
|
vmconfig: undefined,
|
||||||
|
|
||||||
|
@ -91,7 +91,7 @@ Ext.define('PVE.storage.DirInputPanel', {
|
|||||||
});
|
});
|
||||||
|
|
||||||
Ext.define('PVE.storage.DirEdit', {
|
Ext.define('PVE.storage.DirEdit', {
|
||||||
extend: 'PVE.window.Edit',
|
extend: 'Proxmox.window.Edit',
|
||||||
|
|
||||||
initComponent : function() {
|
initComponent : function() {
|
||||||
var me = this;
|
var me = this;
|
||||||
|
@ -165,7 +165,7 @@ Ext.define('PVE.storage.GlusterFsInputPanel', {
|
|||||||
});
|
});
|
||||||
|
|
||||||
Ext.define('PVE.storage.GlusterFsEdit', {
|
Ext.define('PVE.storage.GlusterFsEdit', {
|
||||||
extend: 'PVE.window.Edit',
|
extend: 'Proxmox.window.Edit',
|
||||||
|
|
||||||
initComponent : function() {
|
initComponent : function() {
|
||||||
var me = this;
|
var me = this;
|
||||||
|
@ -146,7 +146,7 @@ Ext.define('PVE.storage.IScsiInputPanel', {
|
|||||||
});
|
});
|
||||||
|
|
||||||
Ext.define('PVE.storage.IScsiEdit', {
|
Ext.define('PVE.storage.IScsiEdit', {
|
||||||
extend: 'PVE.window.Edit',
|
extend: 'Proxmox.window.Edit',
|
||||||
|
|
||||||
initComponent : function() {
|
initComponent : function() {
|
||||||
var me = this;
|
var me = this;
|
||||||
|
@ -220,7 +220,7 @@ Ext.define('PVE.storage.LVMInputPanel', {
|
|||||||
});
|
});
|
||||||
|
|
||||||
Ext.define('PVE.storage.LVMEdit', {
|
Ext.define('PVE.storage.LVMEdit', {
|
||||||
extend: 'PVE.window.Edit',
|
extend: 'Proxmox.window.Edit',
|
||||||
|
|
||||||
initComponent : function() {
|
initComponent : function() {
|
||||||
var me = this;
|
var me = this;
|
||||||
|
@ -208,7 +208,7 @@ Ext.define('PVE.storage.LvmThinInputPanel', {
|
|||||||
});
|
});
|
||||||
|
|
||||||
Ext.define('PVE.storage.LvmThinEdit', {
|
Ext.define('PVE.storage.LvmThinEdit', {
|
||||||
extend: 'PVE.window.Edit',
|
extend: 'Proxmox.window.Edit',
|
||||||
|
|
||||||
initComponent : function() {
|
initComponent : function() {
|
||||||
var me = this;
|
var me = this;
|
||||||
|
@ -160,7 +160,7 @@ Ext.define('PVE.storage.NFSInputPanel', {
|
|||||||
});
|
});
|
||||||
|
|
||||||
Ext.define('PVE.storage.NFSEdit', {
|
Ext.define('PVE.storage.NFSEdit', {
|
||||||
extend: 'PVE.window.Edit',
|
extend: 'Proxmox.window.Edit',
|
||||||
|
|
||||||
initComponent : function() {
|
initComponent : function() {
|
||||||
var me = this;
|
var me = this;
|
||||||
|
@ -117,7 +117,7 @@ Ext.define('PVE.storage.RBDInputPanel', {
|
|||||||
});
|
});
|
||||||
|
|
||||||
Ext.define('PVE.storage.RBDEdit', {
|
Ext.define('PVE.storage.RBDEdit', {
|
||||||
extend: 'PVE.window.Edit',
|
extend: 'Proxmox.window.Edit',
|
||||||
|
|
||||||
initComponent : function() {
|
initComponent : function() {
|
||||||
var me = this;
|
var me = this;
|
||||||
|
@ -67,7 +67,7 @@ Ext.define('PVE.storage.SheepdogInputPanel', {
|
|||||||
});
|
});
|
||||||
|
|
||||||
Ext.define('PVE.storage.SheepdogEdit', {
|
Ext.define('PVE.storage.SheepdogEdit', {
|
||||||
extend: 'PVE.window.Edit',
|
extend: 'Proxmox.window.Edit',
|
||||||
|
|
||||||
initComponent : function() {
|
initComponent : function() {
|
||||||
var me = this;
|
var me = this;
|
||||||
|
@ -124,7 +124,7 @@ Ext.define('PVE.storage.ZFSInputPanel', {
|
|||||||
});
|
});
|
||||||
|
|
||||||
Ext.define('PVE.storage.ZFSEdit', {
|
Ext.define('PVE.storage.ZFSEdit', {
|
||||||
extend: 'PVE.window.Edit',
|
extend: 'Proxmox.window.Edit',
|
||||||
|
|
||||||
initComponent : function() {
|
initComponent : function() {
|
||||||
var me = this;
|
var me = this;
|
||||||
|
@ -135,7 +135,7 @@ Ext.define('PVE.storage.ZFSPoolInputPanel', {
|
|||||||
});
|
});
|
||||||
|
|
||||||
Ext.define('PVE.storage.ZFSPoolEdit', {
|
Ext.define('PVE.storage.ZFSPoolEdit', {
|
||||||
extend: 'PVE.window.Edit',
|
extend: 'Proxmox.window.Edit',
|
||||||
|
|
||||||
initComponent : function() {
|
initComponent : function() {
|
||||||
var me = this;
|
var me = this;
|
||||||
|
@ -1,308 +0,0 @@
|
|||||||
Ext.define('PVE.window.Edit', {
|
|
||||||
extend: 'Ext.window.Window',
|
|
||||||
alias: 'widget.pveWindowEdit',
|
|
||||||
|
|
||||||
resizable: false,
|
|
||||||
|
|
||||||
// use this tio atimatically generate a title like
|
|
||||||
// Create: <subject>
|
|
||||||
subject: undefined,
|
|
||||||
|
|
||||||
// set isCreate to true if you want a Create button (instead of
|
|
||||||
// OK and RESET)
|
|
||||||
isCreate: false,
|
|
||||||
|
|
||||||
// set to true if you want an Add button (instead of Create)
|
|
||||||
isAdd: false,
|
|
||||||
|
|
||||||
// set to true if you want an Remove button (instead of Create)
|
|
||||||
isRemove: false,
|
|
||||||
|
|
||||||
backgroundDelay: 0,
|
|
||||||
|
|
||||||
// needed for finding the reference to submitbutton
|
|
||||||
// because we do not have a controller
|
|
||||||
referenceHolder: true,
|
|
||||||
defaultButton: 'submitbutton',
|
|
||||||
|
|
||||||
// finds the first form field
|
|
||||||
defaultFocus: 'field',
|
|
||||||
|
|
||||||
showProgress: false,
|
|
||||||
|
|
||||||
// assign a reference from pve-docs, to add a help button docked to the
|
|
||||||
// bottom of the window. If undefined we magically fall back to the
|
|
||||||
// onlineHelp of our first item, if set.
|
|
||||||
onlineHelp: undefined,
|
|
||||||
|
|
||||||
isValid: function() {
|
|
||||||
var me = this;
|
|
||||||
|
|
||||||
var form = me.formPanel.getForm();
|
|
||||||
return form.isValid();
|
|
||||||
},
|
|
||||||
|
|
||||||
getValues: function(dirtyOnly) {
|
|
||||||
var me = this;
|
|
||||||
|
|
||||||
var values = {};
|
|
||||||
|
|
||||||
var form = me.formPanel.getForm();
|
|
||||||
|
|
||||||
form.getFields().each(function(field) {
|
|
||||||
if (!field.up('inputpanel') && (!dirtyOnly || field.isDirty())) {
|
|
||||||
Proxmox.Utils.assemble_field_data(values, field.getSubmitData());
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
Ext.Array.each(me.query('inputpanel'), function(panel) {
|
|
||||||
Proxmox.Utils.assemble_field_data(values, panel.getValues(dirtyOnly));
|
|
||||||
});
|
|
||||||
|
|
||||||
return values;
|
|
||||||
},
|
|
||||||
|
|
||||||
setValues: function(values) {
|
|
||||||
var me = this;
|
|
||||||
|
|
||||||
var form = me.formPanel.getForm();
|
|
||||||
|
|
||||||
Ext.iterate(values, function(fieldId, val) {
|
|
||||||
var field = form.findField(fieldId);
|
|
||||||
if (field && !field.up('inputpanel')) {
|
|
||||||
field.setValue(val);
|
|
||||||
if (form.trackResetOnLoad) {
|
|
||||||
field.resetOriginalValue();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
Ext.Array.each(me.query('inputpanel'), function(panel) {
|
|
||||||
panel.setValues(values);
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
submit: function() {
|
|
||||||
var me = this;
|
|
||||||
|
|
||||||
var form = me.formPanel.getForm();
|
|
||||||
|
|
||||||
var values = me.getValues();
|
|
||||||
Ext.Object.each(values, function(name, val) {
|
|
||||||
if (values.hasOwnProperty(name)) {
|
|
||||||
if (Ext.isArray(val) && !val.length) {
|
|
||||||
values[name] = '';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
if (me.digest) {
|
|
||||||
values.digest = me.digest;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (me.backgroundDelay) {
|
|
||||||
values.background_delay = me.backgroundDelay;
|
|
||||||
}
|
|
||||||
|
|
||||||
var url = me.url;
|
|
||||||
if (me.method === 'DELETE') {
|
|
||||||
url = url + "?" + Ext.Object.toQueryString(values);
|
|
||||||
values = undefined;
|
|
||||||
}
|
|
||||||
|
|
||||||
Proxmox.Utils.API2Request({
|
|
||||||
url: url,
|
|
||||||
waitMsgTarget: me,
|
|
||||||
method: me.method || (me.backgroundDelay ? 'POST' : 'PUT'),
|
|
||||||
params: values,
|
|
||||||
failure: function(response, options) {
|
|
||||||
if (response.result && response.result.errors) {
|
|
||||||
form.markInvalid(response.result.errors);
|
|
||||||
}
|
|
||||||
Ext.Msg.alert(gettext('Error'), response.htmlStatus);
|
|
||||||
},
|
|
||||||
success: function(response, options) {
|
|
||||||
var hasProgressBar = (me.backgroundDelay || me.showProgress) &&
|
|
||||||
response.result.data ? true : false;
|
|
||||||
|
|
||||||
if (hasProgressBar) {
|
|
||||||
// stay around so we can trigger our close events
|
|
||||||
// when background action is completed
|
|
||||||
me.hide();
|
|
||||||
|
|
||||||
var upid = response.result.data;
|
|
||||||
var win = Ext.create('PVE.window.TaskProgress', {
|
|
||||||
upid: upid,
|
|
||||||
listeners: {
|
|
||||||
destroy: function () {
|
|
||||||
me.close();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
win.show();
|
|
||||||
} else {
|
|
||||||
me.close();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
load: function(options) {
|
|
||||||
var me = this;
|
|
||||||
|
|
||||||
var form = me.formPanel.getForm();
|
|
||||||
|
|
||||||
options = options || {};
|
|
||||||
|
|
||||||
var newopts = Ext.apply({
|
|
||||||
waitMsgTarget: me
|
|
||||||
}, options);
|
|
||||||
|
|
||||||
var createWrapper = function(successFn) {
|
|
||||||
Ext.apply(newopts, {
|
|
||||||
url: me.url,
|
|
||||||
method: 'GET',
|
|
||||||
success: function(response, opts) {
|
|
||||||
form.clearInvalid();
|
|
||||||
me.digest = response.result.data.digest;
|
|
||||||
if (successFn) {
|
|
||||||
successFn(response, opts);
|
|
||||||
} else {
|
|
||||||
me.setValues(response.result.data);
|
|
||||||
}
|
|
||||||
// hack: fix ExtJS bug
|
|
||||||
Ext.Array.each(me.query('radiofield'), function(f) {
|
|
||||||
f.resetOriginalValue();
|
|
||||||
});
|
|
||||||
},
|
|
||||||
failure: function(response, opts) {
|
|
||||||
Ext.Msg.alert(gettext('Error'), response.htmlStatus, function() {
|
|
||||||
me.close();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
createWrapper(options.success);
|
|
||||||
|
|
||||||
Proxmox.Utils.API2Request(newopts);
|
|
||||||
},
|
|
||||||
|
|
||||||
initComponent : function() {
|
|
||||||
var me = this;
|
|
||||||
|
|
||||||
if (!me.url) {
|
|
||||||
throw "no url specified";
|
|
||||||
}
|
|
||||||
|
|
||||||
if (me.create) {throw "deprecated parameter, use isCreate";}
|
|
||||||
|
|
||||||
var items = Ext.isArray(me.items) ? me.items : [ me.items ];
|
|
||||||
|
|
||||||
me.items = undefined;
|
|
||||||
|
|
||||||
me.formPanel = Ext.create('Ext.form.Panel', {
|
|
||||||
url: me.url,
|
|
||||||
method: me.method || 'PUT',
|
|
||||||
trackResetOnLoad: true,
|
|
||||||
bodyPadding: 10,
|
|
||||||
border: false,
|
|
||||||
defaults: Ext.apply({}, me.defaults, {
|
|
||||||
border: false
|
|
||||||
}),
|
|
||||||
fieldDefaults: Ext.apply({}, me.fieldDefaults, {
|
|
||||||
labelWidth: 100,
|
|
||||||
anchor: '100%'
|
|
||||||
}),
|
|
||||||
items: items
|
|
||||||
});
|
|
||||||
|
|
||||||
var form = me.formPanel.getForm();
|
|
||||||
|
|
||||||
var submitText;
|
|
||||||
if (me.isCreate) {
|
|
||||||
if (me.isAdd) {
|
|
||||||
submitText = gettext('Add');
|
|
||||||
} else if (me.isRemove) {
|
|
||||||
submitText = gettext('Remove');
|
|
||||||
} else {
|
|
||||||
submitText = gettext('Create');
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
submitText = gettext('OK');
|
|
||||||
}
|
|
||||||
|
|
||||||
var submitBtn = Ext.create('Ext.Button', {
|
|
||||||
reference: 'submitbutton',
|
|
||||||
text: submitText,
|
|
||||||
disabled: !me.isCreate,
|
|
||||||
handler: function() {
|
|
||||||
me.submit();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
var resetBtn = Ext.create('Ext.Button', {
|
|
||||||
text: 'Reset',
|
|
||||||
disabled: true,
|
|
||||||
handler: function(){
|
|
||||||
form.reset();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
var set_button_status = function() {
|
|
||||||
var valid = form.isValid();
|
|
||||||
var dirty = form.isDirty();
|
|
||||||
submitBtn.setDisabled(!valid || !(dirty || me.isCreate));
|
|
||||||
resetBtn.setDisabled(!dirty);
|
|
||||||
};
|
|
||||||
|
|
||||||
form.on('dirtychange', set_button_status);
|
|
||||||
form.on('validitychange', set_button_status);
|
|
||||||
|
|
||||||
var colwidth = 300;
|
|
||||||
if (me.fieldDefaults && me.fieldDefaults.labelWidth) {
|
|
||||||
colwidth += me.fieldDefaults.labelWidth - 100;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
var twoColumn = items[0].column1 || items[0].column2;
|
|
||||||
|
|
||||||
if (me.subject && !me.title) {
|
|
||||||
me.title = Proxmox.Utils.dialog_title(me.subject, me.isCreate, me.isAdd);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (me.isCreate) {
|
|
||||||
me.buttons = [ submitBtn ] ;
|
|
||||||
} else {
|
|
||||||
me.buttons = [ submitBtn, resetBtn ];
|
|
||||||
}
|
|
||||||
|
|
||||||
var onlineHelp = me.onlineHelp || items[0].onlineHelp;
|
|
||||||
if (onlineHelp) {
|
|
||||||
var helpButton = Ext.create('PVE.button.Help');
|
|
||||||
me.buttons.unshift(helpButton, '->');
|
|
||||||
Ext.GlobalEvents.fireEvent('pveShowHelp', onlineHelp);
|
|
||||||
}
|
|
||||||
|
|
||||||
Ext.applyIf(me, {
|
|
||||||
modal: true,
|
|
||||||
width: twoColumn ? colwidth*2 : colwidth,
|
|
||||||
border: false,
|
|
||||||
items: [ me.formPanel ]
|
|
||||||
});
|
|
||||||
|
|
||||||
me.callParent();
|
|
||||||
|
|
||||||
// always mark invalid fields
|
|
||||||
me.on('afterlayout', function() {
|
|
||||||
// on touch devices, the isValid function
|
|
||||||
// triggers a layout, which triggers an isValid
|
|
||||||
// and so on
|
|
||||||
// to prevent this we disable the layouting here
|
|
||||||
// and enable it afterwards
|
|
||||||
me.suspendLayout = true;
|
|
||||||
me.isValid();
|
|
||||||
me.suspendLayout = false;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
@ -1,5 +1,5 @@
|
|||||||
Ext.define('PVE.window.NotesEdit', {
|
Ext.define('PVE.window.NotesEdit', {
|
||||||
extend: 'PVE.window.Edit',
|
extend: 'Proxmox.window.Edit',
|
||||||
|
|
||||||
initComponent : function() {
|
initComponent : function() {
|
||||||
var me = this;
|
var me = this;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
Ext.define('PVE.window.Restore', {
|
Ext.define('PVE.window.Restore', {
|
||||||
extend: 'Ext.window.Window', // fixme: PVE.window.Edit?
|
extend: 'Ext.window.Window', // fixme: Proxmox.window.Edit?
|
||||||
|
|
||||||
resizable: false,
|
resizable: false,
|
||||||
|
|
||||||
|
@ -55,7 +55,7 @@ Ext.define('PVE.panel.StartupInputPanel', {
|
|||||||
});
|
});
|
||||||
|
|
||||||
Ext.define('PVE.window.StartupEdit', {
|
Ext.define('PVE.window.StartupEdit', {
|
||||||
extend: 'PVE.window.Edit',
|
extend: 'Proxmox.window.Edit',
|
||||||
alias: 'widget.pveWindowStartupEdit',
|
alias: 'widget.pveWindowStartupEdit',
|
||||||
onlineHelp: undefined,
|
onlineHelp: undefined,
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user