@@ -55,28 +55,6 @@ def self.description
5555 def self . params_for_create
5656 {
5757 :fields => [
58- {
59- :component => 'text-field' ,
60- :id => 'host_default_vnc_port_start' ,
61- :name => 'host_default_vnc_port_start' ,
62- :label => _ ( 'Host Default VNC Start Port' ) ,
63- :type => 'number' ,
64- :validate => [ {
65- :type => 'max-number-value' ,
66- :value => 65_535 ,
67- } ]
68- } ,
69- {
70- :component => 'text-field' ,
71- :id => 'host_default_vnc_port_end' ,
72- :name => 'host_default_vnc_port_end' ,
73- :label => _ ( 'Host Default VNC End Port' ) ,
74- :type => 'number' ,
75- :validate => [ {
76- :type => 'max-number-value' ,
77- :value => 65_535 ,
78- } ]
79- } ,
8058 {
8159 :component => 'sub-form' ,
8260 :id => 'endpoints-subform' ,
@@ -233,6 +211,63 @@ def self.params_for_create
233211 } ,
234212 ] ,
235213 } ,
214+ {
215+ :component => 'tab-item' ,
216+ :id => 'vnc-console-tab' ,
217+ :name => 'vnc-console-tab' ,
218+ :title => _ ( 'VNC Console Ports' ) ,
219+ :fields => [
220+ {
221+ :component => 'protocol-selector' ,
222+ :id => 'vnc-console' ,
223+ :name => 'vnc-console' ,
224+ :skipSubmit => true ,
225+ :label => _ ( 'VNC Console Ports' ) ,
226+ :initialValue => 'none' ,
227+ :options => [
228+ {
229+ :label => _ ( "Disabled" ) ,
230+ :value => 'none' ,
231+ } ,
232+ {
233+ :label => _ ( "Enabled" ) ,
234+ :value => "enabled" ,
235+ :pivot => "host_default_vnc_port_start" ,
236+ } ,
237+ ]
238+ } ,
239+ {
240+ :component => 'text-field' ,
241+ :id => 'host_default_vnc_port_start' ,
242+ :name => 'host_default_vnc_port_start' ,
243+ :label => _ ( 'Host Default VNC Start Port' ) ,
244+ :type => 'number' ,
245+ :condition => {
246+ :when => 'vnc-console' ,
247+ :is => 'enabled' ,
248+ } ,
249+ :validate => [ {
250+ :type => 'max-number-value' ,
251+ :value => 65_535 ,
252+ } ]
253+ } ,
254+ {
255+ :component => 'text-field' ,
256+ :id => 'host_default_vnc_port_end' ,
257+ :name => 'host_default_vnc_port_end' ,
258+ :label => _ ( 'Host Default VNC End Port' ) ,
259+ :type => 'number' ,
260+ :condition => {
261+ :when => 'vnc-console' ,
262+ :is => 'enabled' ,
263+ } ,
264+ :validate => [ {
265+ :type => 'max-number-value' ,
266+ :value => 65_535 ,
267+ } ]
268+ }
269+ ]
270+ }
236271 ]
237272 ]
238273 } ,
0 commit comments