1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-04-01 06:50:25 +03:00

Feature #4525: Enable VNC by default

This commit is contained in:
Carlos Martín 2016-06-07 19:05:59 +02:00
parent fffc798cd0
commit 2bc378bd51
2 changed files with 20 additions and 10 deletions

View File

@ -74,12 +74,18 @@ define(function(require) {
function _setup(context) {
$("input[name='graphics_type']", context).change(function() {
if ($(this).attr("value") !== '') {
$('input[wizard_field="LISTEN"]', context).val("0.0.0.0");
if($('input[wizard_field="LISTEN"]', context).val() == ""){
$('input[wizard_field="LISTEN"]', context).val("0.0.0.0");
}
$('.graphics-setting', context).removeAttr('disabled').prop('wizard_field_disabled', false);
} else {
$('input[wizard_field="LISTEN"]', context).val('');
$('.graphics-setting', context).attr('disabled', 'disabled').prop('wizard_field_disabled', true);
}
});
$("input[name='graphics_type']", context).change();
context.off("click", '#add_input');
context.on("click", '#add_input', function() {
var table = $('#input_table', context)[0];
@ -141,7 +147,9 @@ define(function(require) {
if (graphicsJSON) {
var type = graphicsJSON.TYPE;
if (type) {
$("input[value='" + type.toUpperCase() + "']").click();
$(".graphics input[wizard_field='TYPE'][value='" + type.toUpperCase() + "']", context).click();
} else {
$(".graphics input[wizard_field='TYPE'][value='']", context).click();
}
if (graphicsJSON["RANDOM_PASSWD"] == "YES") {
@ -150,6 +158,8 @@ define(function(require) {
WizardFields.fill(context, graphicsJSON);
delete templateJSON['GRAPHICS']
} else {
$(".graphics input[wizard_field='TYPE'][value='']", context).click();
}
var inputsJSON = templateJSON['INPUT'];

View File

@ -20,9 +20,9 @@
<legend>{{tr "Graphics"}}</legend>
<div class="">
<div class="large-12 columns text-center">
<input type="radio" wizard_field="TYPE" name="graphics_type" ID="radioNoneType{{uniqueId}}" value="" checked>
<input type="radio" wizard_field="TYPE" name="graphics_type" ID="radioNoneType{{uniqueId}}" value="">
<label for="radioNoneType{{uniqueId}}">{{tr "None"}}</label>
<input type="radio" wizard_field="TYPE" name="graphics_type" ID="radioVncType{{uniqueId}}" value="VNC">
<input type="radio" wizard_field="TYPE" name="graphics_type" ID="radioVncType{{uniqueId}}" value="VNC" checked>
<label for="radioVncType{{uniqueId}}">VNC</label>
<input type="radio" wizard_field="TYPE" name="graphics_type" ID="radioSdlType{{uniqueId}}" value="SDL" class="hypervisor only_kvm" >
<label class="hypervisor only_kvm" for="radioSdlType{{uniqueId}}">SDL</label>
@ -35,7 +35,7 @@
<div class="large-12 columns">
<label>
{{tr "Listen on IP"}}
<input type="text" wizard_field="LISTEN" placeholder="0.0.0.0"/>
<input class="graphics-setting" type="text" wizard_field="LISTEN" placeholder="0.0.0.0"/>
</label>
</div>
</div>
@ -44,13 +44,13 @@
<label>
{{tr "Server port"}}
{{{tip (tr "Port for the VNC/SPICE server")}}}
<input type="text" wizard_field="PORT"/>
<input class="graphics-setting" type="text" wizard_field="PORT"/>
</label>
</div>
<div class="medium-6 columns">
<label>
{{tr "Keymap"}}
<input type="text" wizard_field="KEYMAP" placeholder="en-us"/>
<input class="graphics-setting" type="text" wizard_field="KEYMAP" placeholder="en-us"/>
</label>
</div>
</div>
@ -58,13 +58,13 @@
<div class="large-12 columns">
<label>
{{tr "Password"}}
<input type="text" wizard_field="PASSWD"/>
<input class="graphics-setting" type="text" wizard_field="PASSWD"/>
</label>
</div>
</div>
<div class=" hypervisor only_kvm vm_updateconf_hide">
<div class="columns large-12">
<input type="checkbox" class="RANDOM_PASSWD" id="RANDOM_PASSWD{{uniqueId}}">
<input type="checkbox" class="RANDOM_PASSWD graphics-setting" id="RANDOM_PASSWD{{uniqueId}}">
<label for="RANDOM_PASSWD{{uniqueId}}">
{{tr "Generate random password"}}
</label>