From 95f4eaded8e55162ddd4a67a0ac9854bc1605f30 Mon Sep 17 00:00:00 2001 From: bergware Date: Wed, 22 Aug 2018 16:00:38 +0200 Subject: [PATCH] VMs must have at least one core selected --- plugins/dynamix/CPUset.page | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/plugins/dynamix/CPUset.page b/plugins/dynamix/CPUset.page index 715d69bf8..1d3844d00 100644 --- a/plugins/dynamix/CPUset.page +++ b/plugins/dynamix/CPUset.page @@ -136,8 +136,12 @@ function reset(form) { } } function buttons(form) { - // we need the Apply and Done buttons react on checkbox changes - $(form).find('input[type=checkbox]').each(function(){$(this).on('input change',function(){ + $(form).find('input[type=checkbox]').each(function(){$(this).on('change',function(){ + var checked = 'input[name^="'+$(this).prop('name').split(':')[0]+':'+'"]:checked'; + var cores = $(form).find(checked).length; + // vms must have at least one core selected + if ($(form).prop('name')=='vm') $(form).find(checked).prop('disabled',cores<2); + // we need the Apply and Done buttons react on checkbox changes $(form).find('input[value="Apply"]').prop('disabled',false); $(form).find('input[value="Done"]').val('Reset').prop('onclick',null).off('click').click(function(){reset(form);}); });});