Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue 5135 - UI - Disk monitoring threshold does update properly #5136

Merged
merged 1 commit into from Jan 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions ldap/servers/slapd/libglobs.c
Expand Up @@ -2173,9 +2173,9 @@ config_set_disk_threshold(const char *attrname, char *value, char *errorbuf, int

errno = 0;
threshold = strtoll(value, &endp, 10);
if (*endp != '\0' || threshold <= 4096 || errno == ERANGE) {
if (*endp != '\0' || threshold < 4096 || errno == ERANGE) {
slapi_create_errormsg(errorbuf, SLAPI_DSE_RETURNTEXT_SIZE,
"%s: \"%s\" is invalid, threshold must be greater than 4096 and less then %lld",
"%s: \"%s\" is invalid, threshold must be greater than or equal to 4096 and less then %lld",
attrname, value, (long long int)LONG_MAX);
retVal = LDAP_OPERATIONS_ERROR;
return retVal;
Expand Down
2 changes: 2 additions & 0 deletions src/cockpit/389-console/src/LDAPEditor.jsx
Expand Up @@ -767,6 +767,7 @@ export class LDAPEditor extends React.Component {
});
}
},
/*
{
title: 'Roles ...',
isDisabled: true,
Expand All @@ -780,6 +781,7 @@ export class LDAPEditor extends React.Component {
title: 'Smart Referrals ...',
isDisabled: true
},
*/
{
isSeparator: true
},
Expand Down
2 changes: 2 additions & 0 deletions src/cockpit/389-console/src/lib/ldap_editor/treeView.jsx
Expand Up @@ -451,6 +451,7 @@ class EditorTreeView extends React.Component {
>
ACIs ...
</DropdownItem>,
/*
<DropdownItem
isDisabled
key="tree-view-roles"
Expand All @@ -469,6 +470,7 @@ class EditorTreeView extends React.Component {
>
Smart Referrals ...
</DropdownItem>,
*/
<DropdownSeparator key="separator-3" />,
<DropdownItem
key="tree-view-delete"
Expand Down
15 changes: 12 additions & 3 deletions src/cockpit/389-console/src/lib/server/settings.jsx
Expand Up @@ -5,6 +5,7 @@ import {
Button,
Checkbox,
Form,
FormHelperText,
FormSelect,
FormSelectOption,
Grid,
Expand Down Expand Up @@ -270,6 +271,13 @@ export class ServerSettings extends React.Component {
valueErr = true;
disableSaveBtn = true;
}
if (attr === 'nsslapd-disk-monitoring-threshold') {
const numVal = Number(value);
if (numVal < 4096) {
droideck marked this conversation as resolved.
Show resolved Hide resolved
valueErr = true;
disableSaveBtn = true;
}
}
} else if (nav_tab == "adv") {
// Handle special cases for anon limit dn
if (attr == 'nsslapd-anonlimitsdn' && !valid_dn(value)) {
Expand Down Expand Up @@ -850,15 +858,17 @@ export class ServerSettings extends React.Component {
min={4096}
max={9223372036854775807}
onMinus={() => { this.onMinusConfig("nsslapd-disk-monitoring-threshold", "diskmon") }}
onChange={(e) => { this.onConfigChange(e, "nsslapd-disk-monitoring-threshold", 4096, 9223372036854775807, "diskmon") }}
onChange={(e) => { this.onConfigChange(e, "nsslapd-disk-monitoring-threshold", 1, 9223372036854775807, "diskmon") }}
onPlus={() => { this.onPlusConfig("nsslapd-disk-monitoring-threshold", "diskmon") }}
inputName="input"
inputAriaLabel="number input"
minusBtnAriaLabel="minus"
plusBtnAriaLabel="plus"
widthChars={8}
validated={this.state.errObjDiskMon.diskThreshold ? ValidatedOptions.error : ValidatedOptions.default}
/>
<FormHelperText isError isHidden={!this.state.errObjDiskMon['nsslapd-disk-monitoring-threshold']}>
Value must be greater than or equal to 4096
droideck marked this conversation as resolved.
Show resolved Hide resolved
</FormHelperText>
</GridItem>
</Grid>
<Grid
Expand All @@ -880,7 +890,6 @@ export class ServerSettings extends React.Component {
minusBtnAriaLabel="minus"
plusBtnAriaLabel="plus"
widthChars={8}
validated={this.state.errObjDiskMon.diskThreshold ? ValidatedOptions.error : ValidatedOptions.default}
/>
</GridItem>
</Grid>
Expand Down