]>
git.proxmox.com Git - pve-manager.git/blob - www/manager6/qemu/DisplayEdit.js
1 Ext
.define('PVE.qemu.DisplayInputPanel', {
2 extend
: 'Proxmox.panel.InputPanel',
3 xtype
: 'pveDisplayInputPanel',
4 onlineHelp
: 'qm_display',
6 onGetValues: function(values
) {
7 let ret
= PVE
.Parser
.printPropertyString(values
, 'type');
9 return { 'delete': 'vga' };
17 clipboard
: '__default__',
20 matchNonGUIOption: function(get) {
21 return get('type').match(/^(serial\d|none)$/);
23 memoryEmptyText: function(get) {
24 let val
= get('type');
25 if (val
=== "cirrus") {
27 } else if (val
=== "std" || val
.match(/^qxl\d?$/) || val
=== "vmware") {
29 } else if (val
.match(/^virtio/)) {
31 } else if (get('matchNonGUIOption')) {
34 console
.debug("unexpected display type", val
);
35 return Proxmox
.Utils
.defaultText
;
43 xtype
: 'proxmoxKVComboBox',
46 fieldLabel
: gettext('Graphic card'),
47 comboItems
: Object
.entries(PVE
.Utils
.kvm_vga_drivers
),
48 validator: function(v
) {
49 let cfg
= this.up('proxmoxWindowEdit').vmconfig
|| {};
51 if (v
.match(/^serial\d+$/) && (!cfg
[v
] || cfg
[v
] !== 'socket')) {
52 let fmt
= gettext("Serial interface '{0}' is not correctly configured.");
53 return Ext
.String
.format(fmt
, v
);
62 xtype
: 'proxmoxintegerfield',
63 emptyText
: Proxmox
.Utils
.defaultText
,
64 fieldLabel
: gettext('Memory') + ' (MiB)',
70 emptyText
: '{memoryEmptyText}',
71 disabled
: '{matchNonGUIOption}',
76 Ext
.define('PVE.qemu.DisplayEdit', {
77 extend
: 'Proxmox.window.Edit',
81 subject
: gettext('Display'),
85 xtype
: 'pveDisplayInputPanel',
88 initComponent: function() {
94 success: function(response
) {
95 me
.vmconfig
= response
.result
.data
;
96 let vga
= me
.vmconfig
.vga
|| '__default__';
97 me
.setValues(PVE
.Parser
.parsePropertyString(vga
, 'type'));