mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-21 14:50:08 +03:00
Bug #4732: Disable NIC edit in wizard for VR VM Templates
This commit is contained in:
parent
349e15c01b
commit
2a6d38ae43
@ -51,6 +51,10 @@ define(function(require) {
|
||||
this.wizardTabId = WIZARD_TAB_ID + UniqueId.id();
|
||||
this.icon = 'fa-laptop';
|
||||
this.title = Locale.tr("General");
|
||||
|
||||
if(opts.listener != undefined){
|
||||
this.listener = opts.listener;
|
||||
}
|
||||
}
|
||||
|
||||
WizardTab.prototype.constructor = WizardTab;
|
||||
@ -94,6 +98,8 @@ define(function(require) {
|
||||
}
|
||||
|
||||
function _setup(context) {
|
||||
var that = this;
|
||||
|
||||
$(document).on('click', "[href='#" + this.wizardTabId + "']", function(){
|
||||
//context.foundation('slider', 'reflow');
|
||||
});
|
||||
@ -114,6 +120,12 @@ define(function(require) {
|
||||
});
|
||||
|
||||
CapacityCreate.setup($("div.capacityCreate", context));
|
||||
|
||||
if(that.listener != undefined){
|
||||
$(context).on("change", "input[wizard_field=VROUTER]", function(){
|
||||
that.listener.notify();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function _retrieve(context) {
|
||||
|
@ -68,6 +68,7 @@ define(function(require) {
|
||||
WizardTab.prototype.fill = _fill;
|
||||
WizardTab.prototype.renameTabLinks = _renameTabLinks;
|
||||
WizardTab.prototype.addNicTab = _addNicTab;
|
||||
WizardTab.prototype.notify = _notify;
|
||||
|
||||
return WizardTab;
|
||||
|
||||
@ -265,4 +266,18 @@ define(function(require) {
|
||||
this.listener.notify();
|
||||
}
|
||||
}
|
||||
|
||||
function _notify(context, templateJSON) {
|
||||
if (templateJSON.VROUTER == "YES"){
|
||||
while($("i.remove-tab", context).length > 0){
|
||||
$("i.remove-tab", context).click();
|
||||
}
|
||||
|
||||
$("#tf_btn_nics", context).hide();
|
||||
$(".vrouter_no_nics", context).show();
|
||||
} else {
|
||||
$("#tf_btn_nics", context).show();
|
||||
$(".vrouter_no_nics", context).hide();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -25,6 +25,14 @@
|
||||
</div>
|
||||
<div class="medium-10 columns">
|
||||
<div class="tabs-content vertical" id="{{contentsContainerId}}" data-tabs-content="{{linksContainerId}}"></div>
|
||||
<div class="row vrouter_no_nics" style="display: none">
|
||||
<div class="small-12 columns">
|
||||
<span class="radius secondary label">
|
||||
<i class="fa fa-inco-circle"/> {{tr "VM Templates for Virtual Routers cannot define NICs"}}
|
||||
</span>
|
||||
<p><br/></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="medium-6 columns">
|
||||
<label for="DEFAULT_MODEL">
|
||||
|
Loading…
x
Reference in New Issue
Block a user