diff --git a/plugins/shared_filesystem_storage/app/javascript/widgets/app/components/castellum/configuration/edit.jsx b/plugins/shared_filesystem_storage/app/javascript/widgets/app/components/castellum/configuration/edit.jsx index cc478d04e2..87188ec004 100644 --- a/plugins/shared_filesystem_storage/app/javascript/widgets/app/components/castellum/configuration/edit.jsx +++ b/plugins/shared_filesystem_storage/app/javascript/widgets/app/components/castellum/configuration/edit.jsx @@ -9,13 +9,8 @@ const FormBody = ({ close, errors }) => { const values = useContext(Form.Context).formValues let validationError = "" - if ( - values.low_enabled == "false" && - values.high_enabled == "false" && - values.critical_enabled == "false" - ) { - validationError = - "To use autoscaling, at least one threshold must be enabled." + if (values.low_enabled == "false" && values.high_enabled == "false" && values.critical_enabled == "false") { + validationError = "To use autoscaling, at least one threshold must be enabled." } return ( @@ -23,11 +18,7 @@ const FormBody = ({ close, errors }) => { - + Do nothing Auto-shrink share @@ -39,12 +30,7 @@ const FormBody = ({ close, errors }) => { labelWidth={5} labelClass="control-label secondary-label" > - + { labelWidth={5} labelClass="control-label secondary-label" > - + - + Do nothing Auto-extend share @@ -77,12 +53,7 @@ const FormBody = ({ close, errors }) => { labelWidth={5} labelClass="control-label secondary-label" > - + { labelWidth={5} labelClass="control-label secondary-label" > - + - + Do nothing Auto-extend share immediately @@ -124,11 +85,7 @@ const FormBody = ({ close, errors }) => { /> - + Percentage-step resizing Single-step resizing @@ -162,8 +119,7 @@ const FormBody = ({ close, errors }) => { /> - As an exception, multiple steps can be taken at once to resolve a - critical usage level. + As an exception, multiple steps can be taken at once to resolve a critical usage level. @@ -190,6 +146,17 @@ const FormBody = ({ close, errors }) => { labelClass="control-label secondary-label" > + + + + Treat crossings of this constraint as a critical usage level + + @@ -234,7 +201,6 @@ export default class CastellumConfigurationEditModal extends React.Component { size_minimum: (cfg.size_constraints || {}).minimum || "", size_maximum: (cfg.size_constraints || {}).maximum || "", free_minimum: (cfg.size_constraints || {}).minimum_free || "", - minimum_free_is_critical: (cfg.size_constraints || {}).minimum_free != "" ? "true" : "false", } } @@ -248,9 +214,7 @@ export default class CastellumConfigurationEditModal extends React.Component { validate(values) { return ( - (values.low_enabled == "true" || - values.high_enabled == "true" || - values.critical_enabled == "true") && + (values.low_enabled == "true" || values.high_enabled == "true" || values.critical_enabled == "true") && (values.size_step_single == "true" || values.size_step_percent != "") ) } @@ -291,9 +255,12 @@ export default class CastellumConfigurationEditModal extends React.Component { if (values.free_minimum != "") { config.size_constraints = config.size_constraints || {} config.size_constraints.minimum_free = parseInt(values.free_minimum, 10) + } + if (values.free_minimum != "" && values.minimum_free_is_critical) { + config.size_constraints = config.size_constraints || {} config.size_constraints.minimum_free_is_critical = true } - + this.props .configureAutoscaling(this.props.projectID, config) .then(this.close) @@ -319,9 +286,7 @@ export default class CastellumConfigurationEditModal extends React.Component { className="shared_filesystem_storage" > - - Configure Autoscaling - + Configure Autoscaling
- As an exception, multiple steps can be taken at once to resolve a - critical usage level. + As an exception, multiple steps can be taken at once to resolve a critical usage level.