]> git.proxmox.com Git - pve-manager.git/blame - www/manager6/qemu/OSTypeEdit.js
copy qemu/OSTypeEdit.js from manager to manager6
[pve-manager.git] / www / manager6 / qemu / OSTypeEdit.js
CommitLineData
d3ce36d9
DM
1Ext.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: 'win8'
18 },
19 {
20 xtype: 'radiofield',
21 name: 'ostype',
22 inputValue: 'win7'
23 },
24 {
25 xtype: 'radiofield',
26 name: 'ostype',
27 inputValue: 'w2k8'
28 },
29 {
30 xtype: 'radiofield',
31 name: 'ostype',
32 inputValue: 'wxp'
33 },
34 {
35 xtype: 'radiofield',
36 name: 'ostype',
37 inputValue: 'w2k'
38 }
39 ];
40
41 me.column2 = [
42 {
43 xtype: 'component',
44 html: 'Linux/' + gettext('Other OS types'),
45 cls:'x-form-check-group-label'
46 },
47 {
48 xtype: 'radiofield',
49 name: 'ostype',
50 inputValue: 'l26'
51 },
52 {
53 xtype: 'radiofield',
54 name: 'ostype',
55 inputValue: 'l24'
56 },
57 {
58 xtype: 'radiofield',
59 name: 'ostype',
60 inputValue: 'solaris'
61 },
62 {
63 xtype: 'radiofield',
64 name: 'ostype',
65 inputValue: 'other'
66 }
67 ];
68
69 Ext.Array.each(me.column1, function(def) {
70 if (def.inputValue) {
71 def.boxLabel = PVE.Utils.render_kvm_ostype(def.inputValue);
72 }
73 });
74 Ext.Array.each(me.column2, function(def) {
75 if (def.inputValue) {
76 def.boxLabel = PVE.Utils.render_kvm_ostype(def.inputValue);
77 }
78 });
79
80 Ext.apply(me, {
81 useFieldContainer: {
82 xtype: 'radiogroup',
83 allowBlank: false
84 }
85 });
86
87 me.callParent();
88 }
89});
90
91Ext.define('PVE.qemu.OSTypeEdit', {
92 extend: 'PVE.window.Edit',
93
94 initComponent : function() {
95 var me = this;
96
97 Ext.apply(me, {
98 subject: 'OS Type',
99 items: Ext.create('PVE.qemu.OSTypeInputPanel')
100 });
101
102 me.callParent();
103
104 me.load({
105 success: function(response, options) {
106 var value = response.result.data.ostype || 'other';
107 me.setValues({ ostype: value});
108 }
109 });
110 }
111});