mirror of
https://github.com/OpenNebula/one.git
synced 2024-12-27 03:21:29 +03:00
Co-authored-by: Tino Vázquez <cvazquez@opennebula.io>
This commit is contained in:
parent
083bec9844
commit
8c9caee42f
@ -130,6 +130,7 @@ define(function(require) {
|
|||||||
$( ".cardinality_slider_div", context).html(RangeSlider.html({
|
$( ".cardinality_slider_div", context).html(RangeSlider.html({
|
||||||
min: min_vms,
|
min: min_vms,
|
||||||
max: max_vms,
|
max: max_vms,
|
||||||
|
max_value: max_vms,
|
||||||
initial: role_template.cardinality,
|
initial: role_template.cardinality,
|
||||||
label: Locale.tr("Number of VMs for Role")+" "+role_template.name,
|
label: Locale.tr("Number of VMs for Role")+" "+role_template.name,
|
||||||
name: "cardinality"
|
name: "cardinality"
|
||||||
|
@ -404,37 +404,47 @@ define(function(require) {
|
|||||||
var role = $(this).closest(".provision_role_ul").data("role");
|
var role = $(this).closest(".provision_role_ul").data("role");
|
||||||
$(".provision_info_flow", context).data("role_id", role.name);
|
$(".provision_info_flow", context).data("role_id", role.name);
|
||||||
|
|
||||||
|
var vms = [];
|
||||||
|
var promises = [];
|
||||||
|
|
||||||
if (role.nodes && role.nodes.length > 0) {
|
if (role.nodes && role.nodes.length > 0) {
|
||||||
var vms = [];
|
$.each(role.nodes, function(_, node) {
|
||||||
|
if (node.vm_info !== undefined) {
|
||||||
|
function promiseVmInfo(id, success) {
|
||||||
|
return $.ajax({
|
||||||
|
url: "vm/" + id,
|
||||||
|
type: "GET",
|
||||||
|
dataType: "json",
|
||||||
|
success: function (vm_json) {
|
||||||
|
vms.push(vm_json);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
$.each(role.nodes, function(_, node){
|
promises.push(promiseVmInfo(node.deploy_id))
|
||||||
if(node.vm_info != undefined){
|
|
||||||
OpenNebulaVm.show({
|
|
||||||
data : { id: node.deploy_id },
|
|
||||||
timeout: true,
|
|
||||||
success: function (_, vm_json) {
|
|
||||||
vms.push(vm_json);
|
|
||||||
ProvisionVmsList.generate(
|
|
||||||
$(".provision_role_vms_container", context),
|
|
||||||
{
|
|
||||||
title: role.name + " " + Locale.tr("VMs"),
|
|
||||||
active: true,
|
|
||||||
refresh: false,
|
|
||||||
create: false,
|
|
||||||
filter: false,
|
|
||||||
data: vms
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$.when.apply($, promises).then(function() {
|
||||||
|
ProvisionVmsList.generate(
|
||||||
|
$(".provision_role_vms_container", context),
|
||||||
|
{
|
||||||
|
title: role.name + " " + Locale.tr("VMs"),
|
||||||
|
active: true,
|
||||||
|
refresh: true,
|
||||||
|
create: false,
|
||||||
|
filter: false,
|
||||||
|
data: vms
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
context.on("click", ".provision_role_cardinality_button", function(){
|
context.on("click", ".provision_role_cardinality_button", function(){
|
||||||
var role = $(this).closest(".provision_role_ul").data("role");
|
var role = $(this).closest(".provision_role_ul").data("role");
|
||||||
var role_name = role.name
|
var min_vms = (role.min_vms||0);
|
||||||
var min_vms = (role.min_vms||1);
|
|
||||||
var max_vms = (role.max_vms||100);
|
var max_vms = (role.max_vms||100);
|
||||||
|
|
||||||
|
|
||||||
@ -465,6 +475,7 @@ define(function(require) {
|
|||||||
$( ".cardinality_slider_div", context).html(RangeSlider.html({
|
$( ".cardinality_slider_div", context).html(RangeSlider.html({
|
||||||
min: min_vms,
|
min: min_vms,
|
||||||
max: max_vms,
|
max: max_vms,
|
||||||
|
max_value: max_vms,
|
||||||
initial: role.cardinality,
|
initial: role.cardinality,
|
||||||
label: Locale.tr("Number of VMs for Role")+" "+role_name
|
label: Locale.tr("Number of VMs for Role")+" "+role_name
|
||||||
}));
|
}));
|
||||||
|
@ -1020,7 +1020,12 @@ define(function(require) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function get_provision_ips(data) {
|
function get_provision_ips(data) {
|
||||||
return "<i class=\"fas fa-fw fa-lg fa-globe\"></i> " + OpenNebula.VM.ipsStr(data, ", ");
|
return (
|
||||||
|
"<div style=\"display: flex; gap: 5px;\">" +
|
||||||
|
"<i class=\"fas fa-fw fa-lg fa-globe\"></i>" +
|
||||||
|
"<div>" + OpenNebula.VM.ipsStr(data, ", ") + "</div>" +
|
||||||
|
"</div>"
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// @params
|
// @params
|
||||||
|
Loading…
Reference in New Issue
Block a user