diff --git a/ogcp/forms/action_forms.py b/ogcp/forms/action_forms.py index 951ea06..c81b326 100644 --- a/ogcp/forms/action_forms.py +++ b/ogcp/forms/action_forms.py @@ -98,6 +98,7 @@ class ImageRestoreForm(FlaskForm): restore = SubmitField(label=_l('Restore')) class ClientDetailsForm(FlaskForm): + server = HiddenField() name = StringField(label=_l('Name')) ip = StringField(label=_l('IP')) mac = StringField(label=_l('MAC')) diff --git a/ogcp/static/js/ogcp.js b/ogcp/static/js/ogcp.js index 8678759..bdd7581 100644 --- a/ogcp/static/js/ogcp.js +++ b/ogcp/static/js/ogcp.js @@ -64,6 +64,12 @@ function checkParentsCheckboxes() { if (checkboxChildren.length == 0) return; + if (this.name == "scope-server") { + const checkedChildren = checkboxChildren.filter(":checked"); + checkbox.checked = checkedChildren.length > 0; + return; + } + const unCheckedChildren = checkboxChildren.filter(":not(:checked)"); checkbox.indeterminate = diff --git a/ogcp/templates/macros.html b/ogcp/templates/macros.html index 28c4f5a..f67b1a6 100644 --- a/ogcp/templates/macros.html +++ b/ogcp/templates/macros.html @@ -23,7 +23,12 @@ {% macro scopes_tree_collapse_level(scopes, parent_id, state) -%} {% for scope in scopes %}