mirror of
https://github.com/OpenNebula/one.git
synced 2026-11-20 03:42:52 +09:00
B #1328: Error in group create/update
(cherry picked from commit 7866950b61)
This commit is contained in:
1 parent
aaa488fefa
commit
aa4ab987db
2 files changed
+37
-22
No files matched your search
@@ -277,9 +277,15 @@ define(function(require) {
|
||||
group_json['group']['default_admin_view'] = default_admin_view;
|
||||
}
|
||||
|
||||
group_json['group']['opennebula']={};
|
||||
group_json['group']['opennebula']["default_image_persistent_new"] = $('#default_image_persistent_new', context).is(':checked')?'YES':'NO';
|
||||
group_json['group']['opennebula']["default_image_persistent"] = $('#default_image_persistent', context).is(':checked')?'YES':'NO';
|
||||
group_json['group']['opennebula'] = {};
|
||||
|
||||
if ($('#default_image_persistent_new', context).val() !== ""){
|
||||
group_json['group']['opennebula']["default_image_persistent_new"] = $('#default_image_persistent_new', context).val();
|
||||
}
|
||||
|
||||
if ($('#default_image_persistent', context).val() !== ""){
|
||||
group_json['group']['opennebula']["default_image_persistent"] = $('#default_image_persistent', context).val();
|
||||
}
|
||||
|
||||
Sunstone.runAction("Group.create",group_json);
|
||||
return false;
|
||||
@@ -310,9 +316,15 @@ define(function(require) {
|
||||
template_json['SUNSTONE'] = sunstone_template;
|
||||
}
|
||||
|
||||
template_json['OPENNEBULA']={};
|
||||
template_json['OPENNEBULA']["default_image_persistent_new"] = $('#default_image_persistent_new', context).is(':checked')?'YES':'NO';
|
||||
template_json['OPENNEBULA']["default_image_persistent"] = $('#default_image_persistent', context).is(':checked')?'YES':'NO';
|
||||
template_json['OPENNEBULA'] = {};
|
||||
|
||||
if ($('#default_image_persistent_new', context).val() !== ""){
|
||||
template_json['OPENNEBULA']["default_image_persistent_new"] = $('#default_image_persistent_new', context).val();
|
||||
}
|
||||
|
||||
if ($('#default_image_persistent', context).val() !== ""){
|
||||
template_json['OPENNEBULA']["default_image_persistent"] = $('#default_image_persistent', context).val();
|
||||
}
|
||||
|
||||
var template_str = TemplateUtils.templateToString(template_json);
|
||||
Sunstone.runAction("Group.update", this.resourceId, template_str);
|
||||
@@ -386,10 +398,13 @@ define(function(require) {
|
||||
$('#admin_view_default', context).val("").change();
|
||||
}
|
||||
|
||||
if(opennebula_template && opennebula_template.DEFAULT_IMAGE_PERSISTENT_NEW == "YES")
|
||||
$('#default_image_persistent_new', context).prop('checked', true);
|
||||
if(opennebula_template && opennebula_template.DEFAULT_IMAGE_PERSISTENT == "YES")
|
||||
$('#default_image_persistent', context).prop('checked', true);
|
||||
if (opennebula_template && opennebula_template.DEFAULT_IMAGE_PERSISTENT_NEW){
|
||||
$('#default_image_persistent_new', context).val(opennebula_template.DEFAULT_IMAGE_PERSISTENT_NEW);
|
||||
}
|
||||
|
||||
if (opennebula_template && opennebula_template.DEFAULT_IMAGE_PERSISTENT){
|
||||
$('#default_image_persistent', context).val(opennebula_template.DEFAULT_IMAGE_PERSISTENT);
|
||||
}
|
||||
}
|
||||
|
||||
function _generateViewsSelect(context, idPrefix, value) {
|
||||
|
||||
@@ -93,7 +93,7 @@
|
||||
{{#if description}}
|
||||
<span class="tip">{{description}}</span>
|
||||
{{/if}}
|
||||
<a id="link_{{link}}"">{{tr "Image"}}</a>
|
||||
<a id="link_{{link}}">{{tr "Image"}}</a>
|
||||
</h6>
|
||||
<table class="dataTable">
|
||||
<tr>
|
||||
@@ -154,15 +154,15 @@
|
||||
<div class="large-6 columns">
|
||||
{{tr "Make new images persistent by default"}}
|
||||
<span class="tip">
|
||||
{{tr "Control the default value for the PERSISTENT attribute on image creation (oneimage create). By default images are no persistent if not set."}}
|
||||
{{tr "Control the default value for the PERSISTENT attribute on image creation (oneimage create)."}}
|
||||
</span>
|
||||
</div>
|
||||
<div class="large-4 columns">
|
||||
<div class="switch left">
|
||||
<input class="switch-input" id="default_image_persistent_new" name="DEFAULT_IMAGE_PERSISTENT_NEW" type="checkbox">
|
||||
<label class="switch-paddle" for="default_image_persistent_new">
|
||||
</label>
|
||||
</div>
|
||||
<select id="default_image_persistent_new">
|
||||
<option val=""></option>
|
||||
<option val="YES"> {{tr "YES"}}</option>
|
||||
<option val="NO"> {{tr "NO"}}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
@@ -173,11 +173,11 @@
|
||||
</span>
|
||||
</div>
|
||||
<div class="large-4 columns">
|
||||
<div class="switch left">
|
||||
<input class="switch-input " id="default_image_persistent" name="DEFAULT_IMAGE_PERSISTENT" type="checkbox">
|
||||
<label class="switch-paddle" for="default_image_persistent">
|
||||
</label>
|
||||
</div>
|
||||
<select id="default_image_persistent">
|
||||
<option val=""></option>
|
||||
<option val="YES"> {{tr "YES"}}</option>
|
||||
<option val="NO"> {{tr "NO"}}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
|
||||
Reference in new issue
Block a user