mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-16 22:50:10 +03:00
This commit is contained in:
parent
1bb8ae76db
commit
b630b267b5
@ -80,6 +80,14 @@ define(function(require) {
|
||||
}
|
||||
},
|
||||
|
||||
"isAdvancedEnabled": function(featureName) {
|
||||
if (_config['view']['features'] && featureName in _config['view']['features']) {
|
||||
return _config['view']['features'][featureName];
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
},
|
||||
|
||||
"tabTableColumns": function(tabName) {
|
||||
if (!_config['view']['tabs'][tabName]) {
|
||||
return [];
|
||||
|
@ -152,6 +152,10 @@ define(function(require) {
|
||||
CreateUtils.setupPCIRows($(".pci-row", context));
|
||||
|
||||
$("input.pci-type-nic", context).change();
|
||||
|
||||
if (!Config.isAdvancedEnabled("show_attach_nic_advanced")){
|
||||
$("#nic_values", context).hide();
|
||||
}
|
||||
}
|
||||
|
||||
function _retrieve(context) {
|
||||
|
@ -16,6 +16,7 @@
|
||||
|
||||
{{{vnetsTableSelectHTML}}}
|
||||
<br>
|
||||
<div id="nic_values">
|
||||
{{#advancedSection (tr "Advanced options") }}
|
||||
<fieldset>
|
||||
<legend>{{tr "Choose Network"}}</legend>
|
||||
@ -54,7 +55,7 @@
|
||||
</label>
|
||||
<input type="text" wizard_field="OPENNEBULA_MANAGED" id="OPENNEBULA_MANAGED" name="OPENNEBULA_MANAGED"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<legend>{{tr "Override Network Values IPv4"}}</legend>
|
||||
@ -286,3 +287,4 @@
|
||||
</fieldset>
|
||||
</div>
|
||||
{{/advancedSection}}
|
||||
</div>
|
||||
|
@ -166,6 +166,10 @@ define(function(require) {
|
||||
$("input[name=\"custom_disk_dev_prefix\"]",context).parent().hide();
|
||||
}
|
||||
});
|
||||
|
||||
if (!Config.isAdvancedEnabled("show_attach_disk_advanced")){
|
||||
$("#image_values", context).hide();
|
||||
}
|
||||
}
|
||||
|
||||
function _retrieve(context) {
|
||||
|
@ -25,40 +25,42 @@
|
||||
<div id="disk_type" class="image">
|
||||
{{{imageTableSelectHTML}}}
|
||||
<br>
|
||||
{{#advancedSection (tr "Advanced options") }}
|
||||
<fieldset>
|
||||
<legend>{{tr "Image"}}</legend>
|
||||
<div class="row">
|
||||
<div class="medium-6 columns">
|
||||
<label for="IMAGE_ID">
|
||||
{{tr "Image ID"}}
|
||||
</label>
|
||||
<input type="text" wizard_field="IMAGE_ID" id="IMAGE_ID" name="IMAGE_ID"/>
|
||||
<div id="image_values">
|
||||
{{#advancedSection (tr "Advanced options") }}
|
||||
<fieldset>
|
||||
<legend>{{tr "Image"}}</legend>
|
||||
<div class="row">
|
||||
<div class="medium-6 columns">
|
||||
<label for="IMAGE_ID">
|
||||
{{tr "Image ID"}}
|
||||
</label>
|
||||
<input type="text" wizard_field="IMAGE_ID" id="IMAGE_ID" name="IMAGE_ID"/>
|
||||
</div>
|
||||
<div class="medium-6 columns">
|
||||
<label for="IMAGE">
|
||||
{{tr "Image name"}}
|
||||
</label>
|
||||
<input type="text" wizard_field="IMAGE" id="IMAGE" name="IMAGE"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="medium-6 columns">
|
||||
<label for="IMAGE">
|
||||
{{tr "Image name"}}
|
||||
</label>
|
||||
<input type="text" wizard_field="IMAGE" id="IMAGE" name="IMAGE"/>
|
||||
<div class="row">
|
||||
<div class="medium-6 columns">
|
||||
<label for="IMAGE_UID">
|
||||
{{tr "Image owner's user ID"}}
|
||||
</label>
|
||||
<input type="text" wizard_field="IMAGE_UID" id="IMAGE_UID" name="IMAGE_UID"/>
|
||||
</div>
|
||||
<div class="medium-6 columns">
|
||||
<label for="IMAGE_UNAME">
|
||||
{{tr "Image owner's user name"}}
|
||||
</label>
|
||||
<input type="text" wizard_field="IMAGE_UNAME" id="IMAGE_UNAME" name="IMAGE_UNAME"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="medium-6 columns">
|
||||
<label for="IMAGE_UID">
|
||||
{{tr "Image owner's user ID"}}
|
||||
</label>
|
||||
<input type="text" wizard_field="IMAGE_UID" id="IMAGE_UID" name="IMAGE_UID"/>
|
||||
</div>
|
||||
<div class="medium-6 columns">
|
||||
<label for="IMAGE_UNAME">
|
||||
{{tr "Image owner's user name"}}
|
||||
</label>
|
||||
<input type="text" wizard_field="IMAGE_UNAME" id="IMAGE_UNAME" name="IMAGE_UNAME"/>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
</fieldset>
|
||||
{{> ./options volatile=false }}
|
||||
{{/advancedSection}}
|
||||
</div>
|
||||
</div>
|
||||
<div id="disk_type" class="volatile" style="display: none;">
|
||||
<div class="row">
|
||||
@ -106,7 +108,9 @@
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
{{#isAdvancedEnabled "show_attach_disk_advanced"}}
|
||||
{{#advancedSection (tr "Advanced options") }}
|
||||
{{> ./options volatile=true }}
|
||||
{{/advancedSection}}
|
||||
{{/isAdvancedEnabled}}
|
||||
</div>
|
||||
|
@ -0,0 +1,32 @@
|
||||
/* -------------------------------------------------------------------------- */
|
||||
/* Copyright 2002-2018, OpenNebula Project, OpenNebula Systems */
|
||||
/* */
|
||||
/* Licensed under the Apache License, Version 2.0 (the "License"); you may */
|
||||
/* not use this file except in compliance with the License. You may obtain */
|
||||
/* a copy of the License at */
|
||||
/* */
|
||||
/* http://www.apache.org/licenses/LICENSE-2.0 */
|
||||
/* */
|
||||
/* Unless required by applicable law or agreed to in writing, software */
|
||||
/* distributed under the License is distributed on an "AS IS" BASIS, */
|
||||
/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */
|
||||
/* See the License for the specific language governing permissions and */
|
||||
/* limitations under the License. */
|
||||
/* -------------------------------------------------------------------------- */
|
||||
|
||||
define(function (require) {
|
||||
var Handlebars = require('hbs/handlebars');
|
||||
var Config = require('sunstone-config');
|
||||
|
||||
var isAdvancedEnabled = function (feature, options) {
|
||||
if (Config.isAdvancedEnabled(feature)) {
|
||||
return options.fn(this);
|
||||
} else {
|
||||
return options.inverse(this);
|
||||
}
|
||||
};
|
||||
|
||||
Handlebars.registerHelper('isAdvancedEnabled', isAdvancedEnabled);
|
||||
|
||||
return isAdvancedEnabled;
|
||||
});
|
Loading…
x
Reference in New Issue
Block a user