1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-16 22:50:10 +03:00

Changes in Sunstone with schedule actions and instantiate dialog (#2093)

* Changed texts on instantiate section

* F #1548: Fixed bug with schedule actions in Sunstone
This commit is contained in:
juanmont 2018-05-14 16:57:17 +02:00 committed by Tino Vázquez
parent 6403ab909a
commit edb88c2f09
7 changed files with 32 additions and 25 deletions

View File

@ -485,7 +485,8 @@ define(function(require) {
NicsSection.insert(template_json,
$(".nicsContext" + template_json.VMTEMPLATE.ID, context),
{ "forceIPv4": true,
"securityGroups": Config.isFeatureEnabled("secgroups")
"securityGroups": Config.isFeatureEnabled("secgroups"),
"name": " "
});
VMGroupSection.insert(template_json,

View File

@ -58,13 +58,13 @@
</div>
{{/isFeatureEnabled}}
{{/advancedSection}}
{{#advancedSection (tr "User / Group") }}
{{#advancedSection (tr "Instantiate as different user / group")}}
{{#isFeatureEnabled "show_as_uid_instantiate"}}
<div class="row">
<div class="small-12 columns usersContext{{element.ID}}">
<fieldset>
<legend>
<i class="fas fa-user"></i> {{tr "Instantiate as a different user"}}
<i class="fas fa-user"></i>
</legend>
<div class="provision_uid_selector{{element.ID}}" data-tab-content>{{{usersDatatable}}}</div>
</fieldset>
@ -76,7 +76,7 @@
<div class="small-12 columns groupContext{{element.ID}}">
<fieldset>
<legend>
<i class="fas fa-users"></i> {{tr "Instantiate as a different group"}}
<i class="fas fa-users"></i>
</legend>
<div class="provision_gid_selector{{element.ID}}" data-tab-content>{{{groupDatatable}}}</div>
</fieldset>
@ -84,13 +84,13 @@
</div>
{{/isFeatureEnabled}}
{{/advancedSection}}
{{#advancedSection (tr "Host") }}
{{#advancedSection (tr "Deploy VM in a specific Host") }}
{{#isFeatureEnabled "show_host_instantiate"}}
<div class="row">
<div class="small-12 columns hostContext{{element.ID}}">
<fieldset>
<legend>
<i class="fas fa-hdd"></i> {{tr "Deploy VM in a specific Host"}}
<i class="fas fa-hdd"></i>
</legend>
<div class="provision_host_selector{{element.ID}}" data-tab-content>{{{hostsDatatable}}}</div>
<div class="row">
@ -107,13 +107,13 @@
</div>
{{/isFeatureEnabled}}
{{/advancedSection}}
{{#advancedSection (tr "Datastore") }}
{{#advancedSection (tr "Deploy VM in a specific Datastore") }}
{{#isFeatureEnabled "show_ds_instantiate"}}
<div class="row">
<div class="small-12 columns dsContext{{element.ID}}">
<fieldset>
<legend>
<i class="fas fa-folder-open"></i> {{tr "Deploy VM in a specific Datastore"}}
<i class="fas fa-folder-open"></i>
</legend>
<div class="provision_ds_selector{{element.ID}}" data-tab-content>{{{dsDatatable}}}</div>
<div class="row">
@ -130,25 +130,25 @@
</div>
{{/isFeatureEnabled}}
{{/advancedSection}}
{{#advancedSection (tr "Actions") }}
{{#advancedSection (tr "Schedule Actions for VM") }}
<div class="row">
<div class="large-12 columns actionContext{{element.ID}}">
<fieldset>
<legend>
<i class="fas fa-calendar-alt"></i> {{tr "Schedule Actions for VM"}}
<i class="fas fa-calendar-alt"></i>
</legend>
{{{table_sched_actions}}}
</fieldset>
</div>
</div>
{{/advancedSection}}
{{#advancedSection (tr "VM Group") }}
{{#advancedSection (tr "Associate VM to a VM Group") }}
{{#isFeatureEnabled "show_vmgroup_instantiate"}}
<div class="row">
<div class="small-12 columns vmgroupContext{{element.ID}}">
<fieldset>
<legend>
<i class="fas fa-globe"></i> {{tr "Associate VM to a VM Group"}}
<i class="fas fa-globe"></i>
</legend>
<div>
<a class="button small provision_add_vmgroup">

View File

@ -73,7 +73,7 @@ define(function(require) {
<th>' + Locale.tr("End") + '</th>\
<th>' + Locale.tr("Done") + '</th>\
<th>' + Locale.tr("Message") + '</th>\
<th colspan="">' + Locale.tr("Actions") + '</th>\
<th colspan=""> </th>\
<th><button id="add_scheduling_vms_action" class="button small success right radius" >' + Locale.tr("Add action") + '</button></th>\
</tr>\
</thead>\

View File

@ -293,7 +293,12 @@ define(function(require) {
*/
function _generate_provision_network_accordion(context, options) {
context.off();
context.html(TemplateSection());
var name = "Network";
if (options.name)
name = options.name;
context.html(TemplateSection({
"name": Locale.tr(name)
}));
if (options.hide_add_button == true){
$(".provision_add_network_interface", context).hide();

View File

@ -1,6 +1,6 @@
<fieldset>
<legend>
<i class="fas fa-globe"></i> {{tr "Network"}}
<i class="fas fa-globe"></i> {{name}}
</legend>
<div>
<dl class="accordion provision_nic_accordion" data-accordion data-allow-all-closed="true">

View File

@ -156,6 +156,7 @@ define(function (require) {
}
function _retrieve(context) {
$("#scheduling_" + this.res + "_actions_table .create", context).remove();
var actionsJSON = [];
$("#scheduling_" + this.res + "_actions_table tbody tr").each(function (index) {
var first = $(this).children("td")[0];
@ -286,18 +287,18 @@ define(function (require) {
var end_str = "";
if (scheduling_action.REPEAT !== undefined) {
if (scheduling_action.REPEAT === 0) {
if (scheduling_action.REPEAT == 0) {
rep_str = "Weekly ";
} else if (scheduling_action.REPEAT === 1) {
} else if (scheduling_action.REPEAT == 1) {
rep_str = "Monthly ";
} else if (scheduling_action.REPEAT === 2) {
} else if (scheduling_action.REPEAT == 2) {
rep_str = "Yearly ";
} else if (scheduling_action.REPEAT === 3) {
} else if (scheduling_action.REPEAT == 3) {
rep_str = "Each " + scheduling_action.DAYS + " hours";
}
if (scheduling_action.REPEAT !== 3) {
if (scheduling_action.REPEAT !== 0) {
if (scheduling_action.REPEAT != 3) {
if (scheduling_action.REPEAT != 0) {
rep_str += scheduling_action.DAYS;
} else {
rep_str += Humanize.week_days(scheduling_action.DAYS);
@ -306,11 +307,11 @@ define(function (require) {
}
if (scheduling_action.END_TYPE !== undefined) {
if (scheduling_action.END_TYPE === 0) {
if (scheduling_action.END_TYPE == 0) {
end_str = "None";
} else if (scheduling_action.END_TYPE === 1) {
} else if (scheduling_action.END_TYPE == 1) {
end_str = "After " + scheduling_action.END_VALUE + " times";
} else if (scheduling_action.END_TYPE === 2) {
} else if (scheduling_action.END_TYPE == 2) {
end_str = "on " + Humanize.prettyTime(scheduling_action.END_VALUE);
}
}

View File

@ -28,7 +28,7 @@
<th> {{tr "Time"}} </th>
<th> {{tr "Rep"}} </th>
<th> {{tr "Ends"}} </th>
<th colspan=""> {{tr "Actions"}} </th>
<th colspan=""> </th>
<th>
<button id="add_scheduling_{{res}}_action" class="button small success right radius"> {{tr "Add action"}} </button>
</th>