]> git.proxmox.com Git - pve-manager.git/blob - www/manager/qemu/OSTypeEdit.js
imported from svn 'pve-manager/pve2'
[pve-manager.git] / www / manager / qemu / OSTypeEdit.js
1 Ext.define('PVE.qemu.OSTypeInputPanel', {
2 extend: 'PVE.panel.InputPanel',
3 alias: 'widget.PVE.qemu.OSTypeInputPanel',
4
5 initComponent : function() {
6 var me = this;
7
8 me.column1 = [
9 {
10 xtype: 'component',
11 html: 'Microsoft Windows',
12 cls:'x-form-check-group-label'
13 },
14 {
15 xtype: 'radiofield',
16 name: 'ostype',
17 inputValue: 'win7'
18 },
19 {
20 xtype: 'radiofield',
21 name: 'ostype',
22 inputValue: 'w2k8'
23 },
24 {
25 xtype: 'radiofield',
26 name: 'ostype',
27 inputValue: 'wxp'
28 },
29 {
30 xtype: 'radiofield',
31 name: 'ostype',
32 inputValue: 'w2k'
33 }
34 ];
35
36 me.column2 = [
37 {
38 xtype: 'component',
39 html: 'Linux/Other',
40 cls:'x-form-check-group-label'
41 },
42 {
43 xtype: 'radiofield',
44 name: 'ostype',
45 inputValue: 'l26'
46 },
47 {
48 xtype: 'radiofield',
49 name: 'ostype',
50 inputValue: 'l24'
51 },
52 {
53 xtype: 'radiofield',
54 name: 'ostype',
55 inputValue: 'other'
56 }
57 ];
58
59 Ext.Array.each(me.column1, function(def) {
60 if (def.inputValue) {
61 def.boxLabel = PVE.Utils.render_kvm_ostype(def.inputValue);
62 }
63 });
64 Ext.Array.each(me.column2, function(def) {
65 if (def.inputValue) {
66 def.boxLabel = PVE.Utils.render_kvm_ostype(def.inputValue);
67 }
68 });
69
70 Ext.apply(me, {
71 useFieldContainer: {
72 xtype: 'radiogroup',
73 allowBlank: false
74 }
75 });
76
77 me.callParent();
78 }
79 });
80
81 Ext.define('PVE.qemu.OSTypeEdit', {
82 extend: 'PVE.window.Edit',
83
84 initComponent : function() {
85 var me = this;
86
87 Ext.apply(me, {
88 title: 'OS Type',
89 items: Ext.create('PVE.qemu.OSTypeInputPanel')
90 });
91
92 me.callParent();
93
94 me.load({
95 success: function(response, options) {
96 var value = response.result.data.ostype || 'other';
97 me.setValues({ ostype: value});
98 }
99 });
100 }
101 });