mirror of
https://git.proxmox.com/git/pve-manager
synced 2025-08-14 15:58:20 +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/GaugeWidget.js \
|
||||
panel/HealthWidget.js \
|
||||
window/Edit.js \
|
||||
window/LoginWindow.js \
|
||||
window/TaskViewer.js \
|
||||
window/Wizard.js \
|
||||
|
@ -1,5 +1,5 @@
|
||||
Ext.define('PVE.CephCreateMon', {
|
||||
extend: 'PVE.window.Edit',
|
||||
extend: 'Proxmox.window.Edit',
|
||||
alias: ['widget.pveCephCreateMon'],
|
||||
|
||||
subject: 'Ceph Monitor/Manager',
|
||||
|
@ -74,7 +74,7 @@ Ext.define('PVE.form.CephDiskSelector', {
|
||||
});
|
||||
|
||||
Ext.define('PVE.CephCreateOsd', {
|
||||
extend: 'PVE.window.Edit',
|
||||
extend: 'Proxmox.window.Edit',
|
||||
alias: ['widget.pveCephCreateOsd'],
|
||||
|
||||
subject: 'Ceph OSD',
|
||||
@ -130,7 +130,7 @@ Ext.define('PVE.CephCreateOsd', {
|
||||
});
|
||||
|
||||
Ext.define('PVE.CephRemoveOsd', {
|
||||
extend: 'PVE.window.Edit',
|
||||
extend: 'Proxmox.window.Edit',
|
||||
alias: ['widget.pveCephRemoveOsd'],
|
||||
|
||||
isRemove: true,
|
||||
|
@ -1,5 +1,5 @@
|
||||
Ext.define('PVE.CephCreatePool', {
|
||||
extend: 'PVE.window.Edit',
|
||||
extend: 'Proxmox.window.Edit',
|
||||
alias: 'widget.pveCephCreatePool',
|
||||
|
||||
showProgress: true,
|
||||
|
@ -1,5 +1,5 @@
|
||||
Ext.define('PVE.dc.ACLAdd', {
|
||||
extend: 'PVE.window.Edit',
|
||||
extend: 'Proxmox.window.Edit',
|
||||
alias: ['widget.pveACLAdd'],
|
||||
url: '/access/acl',
|
||||
method: 'PUT',
|
||||
|
@ -1,5 +1,5 @@
|
||||
Ext.define('PVE.dc.AuthEdit', {
|
||||
extend: 'PVE.window.Edit',
|
||||
extend: 'Proxmox.window.Edit',
|
||||
alias: ['widget.pveDcAuthEdit'],
|
||||
|
||||
isAdd: true,
|
||||
|
@ -1,5 +1,5 @@
|
||||
Ext.define('PVE.dc.BackupEdit', {
|
||||
extend: 'PVE.window.Edit',
|
||||
extend: 'Proxmox.window.Edit',
|
||||
alias: ['widget.pveDcBackupEdit'],
|
||||
|
||||
defaultFocus: undefined,
|
||||
|
@ -1,5 +1,5 @@
|
||||
Ext.define('PVE.dc.GroupEdit', {
|
||||
extend: 'PVE.window.Edit',
|
||||
extend: 'Proxmox.window.Edit',
|
||||
alias: ['widget.pveDcGroupEdit'],
|
||||
|
||||
initComponent : function() {
|
||||
|
@ -1,5 +1,5 @@
|
||||
Ext.define('PVE.dc.PoolEdit', {
|
||||
extend: 'PVE.window.Edit',
|
||||
extend: 'Proxmox.window.Edit',
|
||||
alias: ['widget.pveDcPoolEdit'],
|
||||
|
||||
initComponent : function() {
|
||||
|
@ -6,7 +6,7 @@ Ext.define('pve-security-groups', {
|
||||
});
|
||||
|
||||
Ext.define('PVE.SecurityGroupEdit', {
|
||||
extend: 'PVE.window.Edit',
|
||||
extend: 'Proxmox.window.Edit',
|
||||
|
||||
base_url: "/cluster/firewall/groups",
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
Ext.define('PVE.dc.UserEdit', {
|
||||
extend: 'PVE.window.Edit',
|
||||
extend: 'Proxmox.window.Edit',
|
||||
alias: ['widget.pveDcUserEdit'],
|
||||
|
||||
isAdd: true,
|
||||
|
@ -1,5 +1,5 @@
|
||||
Ext.define('PVE.window.PasswordEdit', {
|
||||
extend: 'PVE.window.Edit',
|
||||
extend: 'Proxmox.window.Edit',
|
||||
|
||||
initComponent : function() {
|
||||
var me = this;
|
||||
|
@ -1,5 +1,5 @@
|
||||
Ext.define('PVE.FirewallAliasEdit', {
|
||||
extend: 'PVE.window.Edit',
|
||||
extend: 'Proxmox.window.Edit',
|
||||
|
||||
base_url: undefined,
|
||||
|
||||
|
@ -38,7 +38,7 @@ Ext.define('PVE.FirewallOptions', {
|
||||
required: true,
|
||||
defaultValue: 'nolog',
|
||||
editor: {
|
||||
xtype: 'pveWindowEdit',
|
||||
xtype: 'proxmoxWindowEdit',
|
||||
subject: name,
|
||||
fieldDefaults: { labelWidth: labelWidth || 100 },
|
||||
items: {
|
||||
@ -85,7 +85,7 @@ Ext.define('PVE.FirewallOptions', {
|
||||
required: true,
|
||||
defaultValue: 'DROP',
|
||||
editor: {
|
||||
xtype: 'pveWindowEdit',
|
||||
xtype: 'proxmoxWindowEdit',
|
||||
subject: gettext('Input Policy'),
|
||||
items: {
|
||||
xtype: 'pveFirewallPolicySelector',
|
||||
@ -101,7 +101,7 @@ Ext.define('PVE.FirewallOptions', {
|
||||
required: true,
|
||||
defaultValue: 'ACCEPT',
|
||||
editor: {
|
||||
xtype: 'pveWindowEdit',
|
||||
xtype: 'proxmoxWindowEdit',
|
||||
subject: gettext('Output Policy'),
|
||||
items: {
|
||||
xtype: 'pveFirewallPolicySelector',
|
||||
|
@ -222,7 +222,7 @@ Ext.define('PVE.FirewallRulePanel', {
|
||||
});
|
||||
|
||||
Ext.define('PVE.FirewallRuleEdit', {
|
||||
extend: 'PVE.window.Edit',
|
||||
extend: 'Proxmox.window.Edit',
|
||||
|
||||
base_url: undefined,
|
||||
list_refs_url: undefined,
|
||||
@ -287,7 +287,7 @@ Ext.define('PVE.FirewallRuleEdit', {
|
||||
});
|
||||
|
||||
Ext.define('PVE.FirewallGroupRuleEdit', {
|
||||
extend: 'PVE.window.Edit',
|
||||
extend: 'Proxmox.window.Edit',
|
||||
|
||||
base_url: undefined,
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
Ext.define('PVE.pool.AddVM', {
|
||||
extend: 'PVE.window.Edit',
|
||||
extend: 'Proxmox.window.Edit',
|
||||
width: 600,
|
||||
height: 400,
|
||||
isAdd: true,
|
||||
@ -97,7 +97,7 @@ Ext.define('PVE.pool.AddVM', {
|
||||
});
|
||||
|
||||
Ext.define('PVE.pool.AddStorage', {
|
||||
extend: 'PVE.window.Edit',
|
||||
extend: 'Proxmox.window.Edit',
|
||||
|
||||
initComponent : function() {
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
Ext.define('PVE.window.ReplicaEdit', {
|
||||
extend: 'PVE.window.Edit',
|
||||
extend: 'Proxmox.window.Edit',
|
||||
xtype: 'pveReplicaEdit',
|
||||
|
||||
subject: gettext('Replication Job'),
|
||||
|
@ -191,7 +191,7 @@ Ext.define('PVE.ha.GroupInputPanel', {
|
||||
});
|
||||
|
||||
Ext.define('PVE.ha.GroupEdit', {
|
||||
extend: 'PVE.window.Edit',
|
||||
extend: 'Proxmox.window.Edit',
|
||||
|
||||
groupId: undefined,
|
||||
|
||||
|
@ -155,7 +155,7 @@ Ext.define('PVE.ha.VMResourceInputPanel', {
|
||||
});
|
||||
|
||||
Ext.define('PVE.ha.VMResourceEdit', {
|
||||
extend: 'PVE.window.Edit',
|
||||
extend: 'Proxmox.window.Edit',
|
||||
|
||||
vmid: undefined,
|
||||
guestType: undefined,
|
||||
|
@ -97,7 +97,7 @@ Ext.define('PVE.lxc.DNSInputPanel', {
|
||||
});
|
||||
|
||||
Ext.define('PVE.lxc.DNSEdit', {
|
||||
extend: 'PVE.window.Edit',
|
||||
extend: 'Proxmox.window.Edit',
|
||||
|
||||
initComponent : function() {
|
||||
var me = this;
|
||||
@ -161,7 +161,7 @@ Ext.define('PVE.lxc.DNS', {
|
||||
defaultValue: me.pveSelNode.data.name,
|
||||
header: gettext('Hostname'),
|
||||
editor: caps.vms['VM.Config.Network'] ? {
|
||||
xtype: 'pveWindowEdit',
|
||||
xtype: 'proxmoxWindowEdit',
|
||||
subject: gettext('Hostname'),
|
||||
items: {
|
||||
xtype: 'inputpanel',
|
||||
|
@ -286,7 +286,7 @@ Ext.define('PVE.lxc.MountPointInputPanel', {
|
||||
});
|
||||
|
||||
Ext.define('PVE.lxc.MountPointEdit', {
|
||||
extend: 'PVE.window.Edit',
|
||||
extend: 'Proxmox.window.Edit',
|
||||
|
||||
unprivileged: false,
|
||||
|
||||
|
@ -293,7 +293,7 @@ Ext.define('PVE.lxc.NetworkInputPanel', {
|
||||
|
||||
|
||||
Ext.define('PVE.lxc.NetworkEdit', {
|
||||
extend: 'PVE.window.Edit',
|
||||
extend: 'Proxmox.window.Edit',
|
||||
|
||||
isAdd: true,
|
||||
|
||||
|
@ -27,7 +27,7 @@ Ext.define('PVE.lxc.Options', {
|
||||
defaultValue: '',
|
||||
renderer: Proxmox.Utils.format_boolean,
|
||||
editor: caps.vms['VM.Config.Options'] ? {
|
||||
xtype: 'pveWindowEdit',
|
||||
xtype: 'proxmoxWindowEdit',
|
||||
subject: gettext('Start at boot'),
|
||||
items: {
|
||||
xtype: 'proxmoxcheckbox',
|
||||
@ -61,7 +61,7 @@ Ext.define('PVE.lxc.Options', {
|
||||
defaultValue: 1,
|
||||
renderer: Proxmox.Utils.format_enabled_toggle,
|
||||
editor: caps.vms['VM.Config.Options'] ? {
|
||||
xtype: 'pveWindowEdit',
|
||||
xtype: 'proxmoxWindowEdit',
|
||||
subject: '/dev/console',
|
||||
items: {
|
||||
xtype: 'proxmoxcheckbox',
|
||||
@ -78,7 +78,7 @@ Ext.define('PVE.lxc.Options', {
|
||||
header: gettext('TTY count'),
|
||||
defaultValue: 2,
|
||||
editor: caps.vms['VM.Config.Options'] ? {
|
||||
xtype: 'pveWindowEdit',
|
||||
xtype: 'proxmoxWindowEdit',
|
||||
subject: gettext('TTY count'),
|
||||
items: {
|
||||
xtype: 'proxmoxintegerfield',
|
||||
@ -96,7 +96,7 @@ Ext.define('PVE.lxc.Options', {
|
||||
header: gettext('Console mode'),
|
||||
defaultValue: 'tty',
|
||||
editor: caps.vms['VM.Config.Options'] ? {
|
||||
xtype: 'pveWindowEdit',
|
||||
xtype: 'proxmoxWindowEdit',
|
||||
subject: gettext('Console mode'),
|
||||
items: {
|
||||
xtype: 'proxmoxKVComboBox',
|
||||
@ -118,7 +118,7 @@ Ext.define('PVE.lxc.Options', {
|
||||
defaultValue: false,
|
||||
renderer: Proxmox.Utils.format_boolean,
|
||||
editor: caps.vms['VM.Config.Options'] ? {
|
||||
xtype: 'pveWindowEdit',
|
||||
xtype: 'proxmoxWindowEdit',
|
||||
subject: gettext('Protection'),
|
||||
items: {
|
||||
xtype: 'proxmoxcheckbox',
|
||||
|
@ -2,7 +2,7 @@
|
||||
var labelWidth = 120;
|
||||
|
||||
Ext.define('PVE.lxc.MemoryEdit', {
|
||||
extend: 'PVE.window.Edit',
|
||||
extend: 'Proxmox.window.Edit',
|
||||
|
||||
initComponent : function() {
|
||||
var me = this;
|
||||
@ -20,7 +20,7 @@ Ext.define('PVE.lxc.MemoryEdit', {
|
||||
|
||||
|
||||
Ext.define('PVE.lxc.CPUEdit', {
|
||||
extend: 'PVE.window.Edit',
|
||||
extend: 'Proxmox.window.Edit',
|
||||
|
||||
initComponent : function() {
|
||||
var me = this;
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*global Blob*/
|
||||
Ext.define('PVE.node.SubscriptionKeyEdit', {
|
||||
extend: 'PVE.window.Edit',
|
||||
extend: 'Proxmox.window.Edit',
|
||||
title: gettext('Upload Subscription Key'),
|
||||
width: 300,
|
||||
items: {
|
||||
|
@ -62,7 +62,7 @@ Ext.define('PVE.IPSetList', {
|
||||
if (!rec) {
|
||||
return;
|
||||
}
|
||||
var win = Ext.create('PVE.window.Edit', {
|
||||
var win = Ext.create('Proxmox.window.Edit', {
|
||||
subject: "IPSet '" + rec.data.name + "'",
|
||||
url: me.base_url,
|
||||
method: 'POST',
|
||||
@ -103,7 +103,7 @@ Ext.define('PVE.IPSetList', {
|
||||
text: gettext('Create'),
|
||||
handler: function() {
|
||||
sm.deselectAll();
|
||||
var win = Ext.create('PVE.window.Edit', {
|
||||
var win = Ext.create('Proxmox.window.Edit', {
|
||||
subject: 'IPSet',
|
||||
url: me.base_url,
|
||||
method: 'POST',
|
||||
@ -163,7 +163,7 @@ Ext.define('PVE.IPSetList', {
|
||||
});
|
||||
|
||||
Ext.define('PVE.IPSetCidrEdit', {
|
||||
extend: 'PVE.window.Edit',
|
||||
extend: 'Proxmox.window.Edit',
|
||||
|
||||
cidr: undefined,
|
||||
|
||||
|
@ -149,7 +149,7 @@ Ext.define('PVE.qemu.BootOrderPanel', {
|
||||
});
|
||||
|
||||
Ext.define('PVE.qemu.BootOrderEdit', {
|
||||
extend: 'PVE.window.Edit',
|
||||
extend: 'Proxmox.window.Edit',
|
||||
|
||||
items: [{
|
||||
xtype: 'pveQemuBootOrderPanel',
|
||||
|
@ -142,7 +142,7 @@ Ext.define('PVE.qemu.CDInputPanel', {
|
||||
});
|
||||
|
||||
Ext.define('PVE.qemu.CDEdit', {
|
||||
extend: 'PVE.window.Edit',
|
||||
extend: 'Proxmox.window.Edit',
|
||||
|
||||
initComponent : function() {
|
||||
var me = this;
|
||||
|
@ -56,7 +56,7 @@ Ext.define('PVE.qemu.CPUOptionsInputPanel', {
|
||||
});
|
||||
|
||||
Ext.define('PVE.qemu.CPUOptions', {
|
||||
extend: 'PVE.window.Edit',
|
||||
extend: 'Proxmox.window.Edit',
|
||||
|
||||
initComponent : function() {
|
||||
var me = this;
|
||||
|
@ -1,5 +1,5 @@
|
||||
Ext.define('PVE.qemu.DisplayEdit', {
|
||||
extend: 'PVE.window.Edit',
|
||||
extend: 'Proxmox.window.Edit',
|
||||
|
||||
vmconfig: undefined,
|
||||
|
||||
|
@ -249,7 +249,7 @@ Ext.define('PVE.qemu.HDInputPanel', {
|
||||
/*jslint confusion: false */
|
||||
|
||||
Ext.define('PVE.qemu.HDEdit', {
|
||||
extend: 'PVE.window.Edit',
|
||||
extend: 'Proxmox.window.Edit',
|
||||
|
||||
isAdd: true,
|
||||
|
||||
|
@ -51,7 +51,7 @@ Ext.define('PVE.qemu.EFIDiskInputPanel', {
|
||||
});
|
||||
|
||||
Ext.define('PVE.qemu.EFIDiskEdit', {
|
||||
extend: 'PVE.window.Edit',
|
||||
extend: 'Proxmox.window.Edit',
|
||||
|
||||
isAdd: true,
|
||||
subject: gettext('EFI Disk'),
|
||||
|
@ -158,7 +158,7 @@ Ext.define('PVE.qemu.HDThrottleInputPanel', {
|
||||
});
|
||||
|
||||
Ext.define('PVE.qemu.HDThrottle', {
|
||||
extend: 'PVE.window.Edit',
|
||||
extend: 'Proxmox.window.Edit',
|
||||
|
||||
isAdd: true,
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
Ext.define('PVE.qemu.KeyboardEdit', {
|
||||
extend: 'PVE.window.Edit',
|
||||
extend: 'Proxmox.window.Edit',
|
||||
|
||||
initComponent : function() {
|
||||
var me = this;
|
||||
|
@ -149,7 +149,7 @@ Ext.define('PVE.qemu.MemoryInputPanel', {
|
||||
});
|
||||
|
||||
Ext.define('PVE.qemu.MemoryEdit', {
|
||||
extend: 'PVE.window.Edit',
|
||||
extend: 'Proxmox.window.Edit',
|
||||
|
||||
initComponent : function() {
|
||||
var me = this;
|
||||
|
@ -169,7 +169,7 @@ Ext.define('PVE.qemu.NetworkInputPanel', {
|
||||
});
|
||||
|
||||
Ext.define('PVE.qemu.NetworkEdit', {
|
||||
extend: 'PVE.window.Edit',
|
||||
extend: 'Proxmox.window.Edit',
|
||||
|
||||
isAdd: true,
|
||||
|
||||
|
@ -96,7 +96,7 @@ Ext.define('PVE.qemu.OSTypeInputPanel', {
|
||||
});
|
||||
|
||||
Ext.define('PVE.qemu.OSTypeEdit', {
|
||||
extend: 'PVE.window.Edit',
|
||||
extend: 'Proxmox.window.Edit',
|
||||
|
||||
subject: 'OS Type',
|
||||
|
||||
|
@ -27,7 +27,7 @@ Ext.define('PVE.qemu.Options', {
|
||||
defaultValue: me.pveSelNode.data.name,
|
||||
header: gettext('Name'),
|
||||
editor: caps.vms['VM.Config.Options'] ? {
|
||||
xtype: 'pveWindowEdit',
|
||||
xtype: 'proxmoxWindowEdit',
|
||||
subject: gettext('Name'),
|
||||
items: {
|
||||
xtype: 'inputpanel',
|
||||
@ -56,7 +56,7 @@ Ext.define('PVE.qemu.Options', {
|
||||
defaultValue: '',
|
||||
renderer: Proxmox.Utils.format_boolean,
|
||||
editor: caps.vms['VM.Config.Options'] ? {
|
||||
xtype: 'pveWindowEdit',
|
||||
xtype: 'proxmoxWindowEdit',
|
||||
subject: gettext('Start at boot'),
|
||||
items: {
|
||||
xtype: 'proxmoxcheckbox',
|
||||
@ -126,7 +126,7 @@ Ext.define('PVE.qemu.Options', {
|
||||
defaultValue: true,
|
||||
renderer: Proxmox.Utils.format_boolean,
|
||||
editor: caps.vms['VM.Config.HWType'] ? {
|
||||
xtype: 'pveWindowEdit',
|
||||
xtype: 'proxmoxWindowEdit',
|
||||
subject: gettext('Use tablet for pointer'),
|
||||
items: {
|
||||
xtype: 'proxmoxcheckbox',
|
||||
@ -144,7 +144,7 @@ Ext.define('PVE.qemu.Options', {
|
||||
defaultValue: 'disk,network,usb',
|
||||
renderer: PVE.Utils.render_hotplug_features,
|
||||
editor: caps.vms['VM.Config.HWType'] ? {
|
||||
xtype: 'pveWindowEdit',
|
||||
xtype: 'proxmoxWindowEdit',
|
||||
subject: gettext('Hotplug'),
|
||||
items: {
|
||||
xtype: 'pveHotplugFeatureSelector',
|
||||
@ -161,7 +161,7 @@ Ext.define('PVE.qemu.Options', {
|
||||
defaultValue: true,
|
||||
renderer: Proxmox.Utils.format_boolean,
|
||||
editor: caps.vms['VM.Config.HWType'] ? {
|
||||
xtype: 'pveWindowEdit',
|
||||
xtype: 'proxmoxWindowEdit',
|
||||
subject: gettext('ACPI support'),
|
||||
items: {
|
||||
xtype: 'proxmoxcheckbox',
|
||||
@ -191,7 +191,7 @@ Ext.define('PVE.qemu.Options', {
|
||||
defaultValue: true,
|
||||
renderer: Proxmox.Utils.format_boolean,
|
||||
editor: caps.vms['VM.Config.HWType'] ? {
|
||||
xtype: 'pveWindowEdit',
|
||||
xtype: 'proxmoxWindowEdit',
|
||||
subject: gettext('KVM hardware virtualization'),
|
||||
items: {
|
||||
xtype: 'proxmoxcheckbox',
|
||||
@ -209,7 +209,7 @@ Ext.define('PVE.qemu.Options', {
|
||||
defaultValue: false,
|
||||
renderer: Proxmox.Utils.format_boolean,
|
||||
editor: caps.vms['VM.PowerMgmt'] ? {
|
||||
xtype: 'pveWindowEdit',
|
||||
xtype: 'proxmoxWindowEdit',
|
||||
subject: gettext('Freeze CPU at startup'),
|
||||
items: {
|
||||
xtype: 'proxmoxcheckbox',
|
||||
@ -227,7 +227,7 @@ Ext.define('PVE.qemu.Options', {
|
||||
defaultValue: false,
|
||||
renderer: Proxmox.Utils.format_boolean,
|
||||
editor: caps.vms['VM.Config.Options'] ? {
|
||||
xtype: 'pveWindowEdit',
|
||||
xtype: 'proxmoxWindowEdit',
|
||||
subject: gettext('Use local time for RTC'),
|
||||
items: {
|
||||
xtype: 'proxmoxcheckbox',
|
||||
@ -244,7 +244,7 @@ Ext.define('PVE.qemu.Options', {
|
||||
header: gettext('RTC start date'),
|
||||
defaultValue: 'now',
|
||||
editor: caps.vms['VM.Config.Options'] ? {
|
||||
xtype: 'pveWindowEdit',
|
||||
xtype: 'proxmoxWindowEdit',
|
||||
subject: gettext('RTC start date'),
|
||||
items: {
|
||||
xtype: 'proxmoxtextfield',
|
||||
@ -268,7 +268,7 @@ Ext.define('PVE.qemu.Options', {
|
||||
defaultValue: false,
|
||||
renderer: Proxmox.Utils.format_boolean,
|
||||
editor: caps.vms['VM.Config.Options'] ? {
|
||||
xtype: 'pveWindowEdit',
|
||||
xtype: 'proxmoxWindowEdit',
|
||||
subject: gettext('Qemu Agent'),
|
||||
items: {
|
||||
xtype: 'proxmoxcheckbox',
|
||||
@ -285,7 +285,7 @@ Ext.define('PVE.qemu.Options', {
|
||||
defaultValue: false,
|
||||
renderer: Proxmox.Utils.format_boolean,
|
||||
editor: caps.vms['VM.Config.Options'] ? {
|
||||
xtype: 'pveWindowEdit',
|
||||
xtype: 'proxmoxWindowEdit',
|
||||
subject: gettext('Protection'),
|
||||
items: {
|
||||
xtype: 'proxmoxcheckbox',
|
||||
|
@ -133,7 +133,7 @@ Ext.define('PVE.qemu.ProcessorInputPanel', {
|
||||
});
|
||||
|
||||
Ext.define('PVE.qemu.ProcessorEdit', {
|
||||
extend: 'PVE.window.Edit',
|
||||
extend: 'Proxmox.window.Edit',
|
||||
|
||||
initComponent : function() {
|
||||
var me = this;
|
||||
|
@ -1,5 +1,5 @@
|
||||
Ext.define('PVE.qemu.BiosEdit', {
|
||||
extend: 'PVE.window.Edit',
|
||||
extend: 'Proxmox.window.Edit',
|
||||
alias: 'widget.pveQemuBiosEdit',
|
||||
|
||||
initComponent : function() {
|
||||
|
@ -1,5 +1,5 @@
|
||||
Ext.define('PVE.qemu.ScsiHwEdit', {
|
||||
extend: 'PVE.window.Edit',
|
||||
extend: 'Proxmox.window.Edit',
|
||||
|
||||
initComponent : function() {
|
||||
var me = this;
|
||||
|
@ -78,7 +78,7 @@ Ext.define('PVE.qemu.Smbios1InputPanel', {
|
||||
});
|
||||
|
||||
Ext.define('PVE.qemu.Smbios1Edit', {
|
||||
extend: 'PVE.window.Edit',
|
||||
extend: 'Proxmox.window.Edit',
|
||||
|
||||
initComponent : function() {
|
||||
/*jslint confusion: true */
|
||||
|
@ -150,7 +150,7 @@ Ext.define('PVE.qemu.USBInputPanel', {
|
||||
});
|
||||
|
||||
Ext.define('PVE.qemu.USBEdit', {
|
||||
extend: 'PVE.window.Edit',
|
||||
extend: 'Proxmox.window.Edit',
|
||||
|
||||
vmconfig: undefined,
|
||||
|
||||
|
@ -91,7 +91,7 @@ Ext.define('PVE.storage.DirInputPanel', {
|
||||
});
|
||||
|
||||
Ext.define('PVE.storage.DirEdit', {
|
||||
extend: 'PVE.window.Edit',
|
||||
extend: 'Proxmox.window.Edit',
|
||||
|
||||
initComponent : function() {
|
||||
var me = this;
|
||||
|
@ -165,7 +165,7 @@ Ext.define('PVE.storage.GlusterFsInputPanel', {
|
||||
});
|
||||
|
||||
Ext.define('PVE.storage.GlusterFsEdit', {
|
||||
extend: 'PVE.window.Edit',
|
||||
extend: 'Proxmox.window.Edit',
|
||||
|
||||
initComponent : function() {
|
||||
var me = this;
|
||||
|
@ -146,7 +146,7 @@ Ext.define('PVE.storage.IScsiInputPanel', {
|
||||
});
|
||||
|
||||
Ext.define('PVE.storage.IScsiEdit', {
|
||||
extend: 'PVE.window.Edit',
|
||||
extend: 'Proxmox.window.Edit',
|
||||
|
||||
initComponent : function() {
|
||||
var me = this;
|
||||
|
@ -220,7 +220,7 @@ Ext.define('PVE.storage.LVMInputPanel', {
|
||||
});
|
||||
|
||||
Ext.define('PVE.storage.LVMEdit', {
|
||||
extend: 'PVE.window.Edit',
|
||||
extend: 'Proxmox.window.Edit',
|
||||
|
||||
initComponent : function() {
|
||||
var me = this;
|
||||
|
@ -208,7 +208,7 @@ Ext.define('PVE.storage.LvmThinInputPanel', {
|
||||
});
|
||||
|
||||
Ext.define('PVE.storage.LvmThinEdit', {
|
||||
extend: 'PVE.window.Edit',
|
||||
extend: 'Proxmox.window.Edit',
|
||||
|
||||
initComponent : function() {
|
||||
var me = this;
|
||||
|
@ -160,7 +160,7 @@ Ext.define('PVE.storage.NFSInputPanel', {
|
||||
});
|
||||
|
||||
Ext.define('PVE.storage.NFSEdit', {
|
||||
extend: 'PVE.window.Edit',
|
||||
extend: 'Proxmox.window.Edit',
|
||||
|
||||
initComponent : function() {
|
||||
var me = this;
|
||||
|
@ -117,7 +117,7 @@ Ext.define('PVE.storage.RBDInputPanel', {
|
||||
});
|
||||
|
||||
Ext.define('PVE.storage.RBDEdit', {
|
||||
extend: 'PVE.window.Edit',
|
||||
extend: 'Proxmox.window.Edit',
|
||||
|
||||
initComponent : function() {
|
||||
var me = this;
|
||||
|
@ -67,7 +67,7 @@ Ext.define('PVE.storage.SheepdogInputPanel', {
|
||||
});
|
||||
|
||||
Ext.define('PVE.storage.SheepdogEdit', {
|
||||
extend: 'PVE.window.Edit',
|
||||
extend: 'Proxmox.window.Edit',
|
||||
|
||||
initComponent : function() {
|
||||
var me = this;
|
||||
|
@ -124,7 +124,7 @@ Ext.define('PVE.storage.ZFSInputPanel', {
|
||||
});
|
||||
|
||||
Ext.define('PVE.storage.ZFSEdit', {
|
||||
extend: 'PVE.window.Edit',
|
||||
extend: 'Proxmox.window.Edit',
|
||||
|
||||
initComponent : function() {
|
||||
var me = this;
|
||||
|
@ -135,7 +135,7 @@ Ext.define('PVE.storage.ZFSPoolInputPanel', {
|
||||
});
|
||||
|
||||
Ext.define('PVE.storage.ZFSPoolEdit', {
|
||||
extend: 'PVE.window.Edit',
|
||||
extend: 'Proxmox.window.Edit',
|
||||
|
||||
initComponent : function() {
|
||||
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', {
|
||||
extend: 'PVE.window.Edit',
|
||||
extend: 'Proxmox.window.Edit',
|
||||
|
||||
initComponent : function() {
|
||||
var me = this;
|
||||
|
@ -1,5 +1,5 @@
|
||||
Ext.define('PVE.window.Restore', {
|
||||
extend: 'Ext.window.Window', // fixme: PVE.window.Edit?
|
||||
extend: 'Ext.window.Window', // fixme: Proxmox.window.Edit?
|
||||
|
||||
resizable: false,
|
||||
|
||||
|
@ -55,7 +55,7 @@ Ext.define('PVE.panel.StartupInputPanel', {
|
||||
});
|
||||
|
||||
Ext.define('PVE.window.StartupEdit', {
|
||||
extend: 'PVE.window.Edit',
|
||||
extend: 'Proxmox.window.Edit',
|
||||
alias: 'widget.pveWindowStartupEdit',
|
||||
onlineHelp: undefined,
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user