This is an automated email from the git hooks/post-receive script.
mreynolds pushed a commit to branch 389-ds-base-1.4.1
in repository 389-ds-base.
The following commit(s) were added to refs/heads/389-ds-base-1.4.1 by this push:
new becdf20 Issue 50696 - Fix various UI bugs
becdf20 is described below
commit becdf20b58bd0c296b88d290e22e8929739067f0
Author: Mark Reynolds <mreynolds(a)redhat.com>
AuthorDate: Thu Nov 7 16:21:21 2019 -0500
Issue 50696 - Fix various UI bugs
https://bugzilla.redhat.com/show_bug.cgi?id=1751004
Bug 1751004 - Log Settings "Create New Log Every" takes non integer as
input, it even takes alphabets
https://bugzilla.redhat.com/show_bug.cgi?id=1748349
Bug 1748349 - 'View objectclass' modal dialog doesn't have all controls
disabled
https://bugzilla.redhat.com/show_bug.cgi?id=1688614
Bug 1688614 - Chaining Configuration Error: Cockpit had an unexpected internal error
https://bugzilla.redhat.com/show_bug.cgi?id=1748355
Bug 1748355 - LDAPI and Autobind configuration should have a warning
https://bugzilla.redhat.com/show_bug.cgi?id=1751157
Bug 1751157 - Cannot Create Database Link
https://bugzilla.redhat.com/show_bug.cgi?id=1751011
Bug 1751011 - DS instance can be easily destroyed by changing non existing Directory
Manager DN
https://bugzilla.redhat.com/show_bug.cgi?id=1688663
Bug 1688663 - Cockpit: Enable Replication failed with error "Failed to add
replication manager because the base DN of the entry does not exist"
https://bugzilla.redhat.com/show_bug.cgi?id=1751035
Bug 1751035 - Allow and Deny same Ciphers same time
relates:
https://pagure.io/389-ds-base/issue/50696
Reviewed by: spichugi(Thanks!)
---
src/cockpit/389-console/src/database.jsx | 10 ++--
.../389-console/src/lib/database/chaining.jsx | 8 ++-
.../389-console/src/lib/database/suffix.jsx | 8 ++-
.../389-console/src/lib/monitor/serverMonitor.jsx | 2 +-
.../389-console/src/lib/replication/replModals.jsx | 23 +++++++--
.../389-console/src/lib/replication/replSuffix.jsx | 23 +++++++--
.../389-console/src/lib/security/ciphers.jsx | 58 +++++++++++++++++++---
src/cockpit/389-console/src/lib/tools.jsx | 3 ++
src/cockpit/389-console/src/schema.html | 34 ++++++-------
src/cockpit/389-console/src/servers.html | 6 +--
src/cockpit/389-console/src/servers.js | 25 ++++++----
src/lib389/lib389/cli_conf/backend.py | 16 ++++--
12 files changed, 160 insertions(+), 56 deletions(-)
diff --git a/src/cockpit/389-console/src/database.jsx
b/src/cockpit/389-console/src/database.jsx
index b1c3953..697eb14 100644
--- a/src/cockpit/389-console/src/database.jsx
+++ b/src/cockpit/389-console/src/database.jsx
@@ -212,8 +212,8 @@ export class Database extends React.Component {
cockpit
.spawn(cmd, { superuser: true, err: "message" })
.done(content => {
- const config = JSON.parse(content);
- const availableOids = config.items.filter((el) =>
!this.state.chainingConfig.oidList.includes(el));
+ let config = JSON.parse(content);
+ let availableOids = config.items.filter((el) =>
!this.state.chainingConfig.oidList.includes(el));
this.setState((prevState) => (
{
chainingConfig: {
@@ -304,15 +304,19 @@ export class Database extends React.Component {
const config = JSON.parse(content);
let availableComps = config.attrs.nspossiblechainingcomponents;
let compList = [];
+ let oidList = [];
if ('nsactivechainingcomponents' in config.attrs) {
availableComps =
config.attrs.nspossiblechainingcomponents.filter((el) =>
!config.attrs.nsactivechainingcomponents.includes(el));
compList = config.attrs.nsactivechainingcomponents;
}
+ if ('nstransmittedcontrols' in config.attrs) {
+ oidList = config.attrs.nstransmittedcontrols;
+ }
this.setState(() => (
{
chainingConfig: {
...this.state.chainingConfig,
- oidList: config.attrs.nstransmittedcontrols,
+ oidList: oidList,
compList: compList,
availableComps: availableComps
}
diff --git a/src/cockpit/389-console/src/lib/database/chaining.jsx
b/src/cockpit/389-console/src/lib/database/chaining.jsx
index 749d414..63cf899 100644
--- a/src/cockpit/389-console/src/lib/database/chaining.jsx
+++ b/src/cockpit/389-console/src/lib/database/chaining.jsx
@@ -969,7 +969,13 @@ export class ChainingConfig extends React.Component {
<div>
<Row>
<Col sm={10} className="ds-word-wrap">
- <ControlLabel
className="ds-suffix-header"><Icon type="fa"
name="link" /> <b>{this.props.suffix}</b>
(<i>{this.props.bename}</i>)</ControlLabel>
+ <ControlLabel className="ds-suffix-header">
+ <Icon type="fa" name="link" />
<b>{this.props.suffix}</b> (<i>{this.props.bename}</i>)
+ <Icon className="ds-left-margin ds-refresh"
+ type="fa" name="refresh"
title="Refresh database link"
+ onClick={() => this.props.reload(this.props.suffix)}
+ />
+ </ControlLabel>
</Col>
<Col sm={2}>
<Button
diff --git a/src/cockpit/389-console/src/lib/database/suffix.jsx
b/src/cockpit/389-console/src/lib/database/suffix.jsx
index 9be54a8..12c2565 100644
--- a/src/cockpit/389-console/src/lib/database/suffix.jsx
+++ b/src/cockpit/389-console/src/lib/database/suffix.jsx
@@ -760,7 +760,13 @@ export class Suffix extends React.Component {
<div id="suffix-page">
<Row>
<Col sm={10} className="ds-word-wrap">
- <ControlLabel
className="ds-suffix-header"><Icon type="fa" name={suffixIcon}
/> <b>{this.props.suffix}</b>
(<i>{this.props.bename}</i>)</ControlLabel>
+ <ControlLabel className="ds-suffix-header">
+ <Icon type="fa" name={suffixIcon} />
{this.props.suffix} (<i>{this.props.bename}</i>)
+ <Icon className="ds-left-margin ds-refresh"
+ type="fa" name="refresh"
title="Refresh suffix"
+ onClick={() => this.props.reload(this.props.suffix)}
+ />
+ </ControlLabel>
</Col>
<Col sm={2}>
<div>
diff --git a/src/cockpit/389-console/src/lib/monitor/serverMonitor.jsx
b/src/cockpit/389-console/src/lib/monitor/serverMonitor.jsx
index f87fb00..e330f82 100644
--- a/src/cockpit/389-console/src/lib/monitor/serverMonitor.jsx
+++ b/src/cockpit/389-console/src/lib/monitor/serverMonitor.jsx
@@ -148,7 +148,7 @@ export class ServerMonitor extends React.Component {
</Row>
<Row className="ds-margin-top">
<Col componentClass={ControlLabel} sm={4}>
- Current Conections
+ Current Connections
</Col>
<Col sm={8}>
<input type="text"
className="ds-input-auto" id="monitor-server-currentconnections"
value={this.props.data.currentconnections} readOnly />
diff --git a/src/cockpit/389-console/src/lib/replication/replModals.jsx
b/src/cockpit/389-console/src/lib/replication/replModals.jsx
index 0e7a0d9..4c15d71 100644
--- a/src/cockpit/389-console/src/lib/replication/replModals.jsx
+++ b/src/cockpit/389-console/src/lib/replication/replModals.jsx
@@ -1279,11 +1279,10 @@ export class EnableReplModal extends React.Component {
Choose the replication role for this suffix. If it
is a Master replica then you must pick a unique ID
to identify it among the other Master replicas in your
- environment. You can optionally define the
authentication
- information for this replicated suffix, either a Bind DN
and
- Password, or a Group DN. The replication changelog will
- also automatically be created if it does not exist.
+ environment. The replication changelog will also
+ automatically be created if it does not exist.
</p>
+
<hr />
<Row className="ds-margin-top-lg">
<Col sm={3} componentClass={ControlLabel}>
@@ -1298,8 +1297,18 @@ export class EnableReplModal extends React.Component {
</Col>
</Row>
{replicaIDRow}
+ <p className="ds-margin-top-xxlg">
+ You can optionally define the authentication information
+ for this replicated suffix. Either a Manager DN and
Password,
+ a Bind Group DN, or both, can be provideed. The Manager
DN should
+ be an entry under "cn=config" and if it does
not exist it will
+ be created, while the Bind Group DN is usually an
existing
+ group located in the database suffix. Typically, just
the
+ Manager DN and Password are used when enabling
replication
+ for a suffix.
+ </p>
<hr />
- <Row className="ds-margin-top" title="The
DN of the replication manager. If you supply a password the entry will be created in the
server (it will also overwrite the entry is it already exists).">
+ <Row className="ds-margin-top-lg"
title="The DN of the replication manager. If you supply a password the entry will be
created in the server (it will also overwrite the entry is it already exists).">
<Col componentClass={ControlLabel} sm={4}>
Replication Manager DN
</Col>
@@ -1339,6 +1348,7 @@ export class EnableReplModal extends React.Component {
/>
</Col>
</Row>
+ <hr />
<Row className="ds-margin-top" title="The
DN of a group that contains users that can perform replication updates">
<Col componentClass={ControlLabel} sm={4}>
Bind Group DN
@@ -1366,6 +1376,7 @@ export class EnableReplModal extends React.Component {
<Button
bsStyle="primary"
onClick={saveHandler}
+ disabled={this.props.disabled}
Enable Replication
</Button>
@@ -1463,6 +1474,7 @@ EnableReplModal.propTypes = {
handleChange: PropTypes.func,
saveHandler: PropTypes.func,
spinning: PropTypes.bool,
+ disabled: PropTypes.bool,
error: PropTypes.object,
};
@@ -1472,6 +1484,7 @@ EnableReplModal.defaultProps = {
handleChange: noop,
saveHandler: noop,
spinning: false,
+ disabled: false,
error: {},
};
diff --git a/src/cockpit/389-console/src/lib/replication/replSuffix.jsx
b/src/cockpit/389-console/src/lib/replication/replSuffix.jsx
index 0978c0c..a83ca37 100644
--- a/src/cockpit/389-console/src/lib/replication/replSuffix.jsx
+++ b/src/cockpit/389-console/src/lib/replication/replSuffix.jsx
@@ -42,6 +42,7 @@ export class ReplSuffix extends React.Component {
enableBindPW: "",
enableBindPWConfirm: "",
enableBindGroupDN: "",
+ disabled: false, // Disable repl enable button
// Disable replication
showDisableReplModal: false,
disableChecked: false,
@@ -104,11 +105,12 @@ export class ReplSuffix extends React.Component {
let attr = e.target.id;
let valueErr = false;
let errObj = this.state.errObj;
+ let disable = false;
- if (attr == "enableBindDN" && value != "" &&
!valid_dn(value)) {
+ if (attr == "enableBindDN" && value != "" &&
(!valid_dn(value) || !value.includes(','))) {
valueErr = true;
}
- if (attr == "enableBindGroupDN" && value != ""
&& !valid_dn(value)) {
+ if (attr == "enableBindGroupDN" && value != ""
&& (!valid_dn(value) || !value.includes(','))) {
valueErr = true;
}
if (attr == "enableBindPW") {
@@ -127,10 +129,24 @@ export class ReplSuffix extends React.Component {
errObj.enableBindPWConfirm = false;
}
}
+
+ // Validate form and disable enable button if something is wrong.
+ if (valueErr) {
+ disable = true;
+ } else {
+ if ((attr != "enableBindPW" && attr !=
"enableBindPWConfirm" && this.state.enableBindPW !=
this.state.enableBindPWConfirm) ||
+ (this.state.enableBindDN != "" && attr !=
"enableBindDN" && (!valid_dn(this.state.enableBindDN) ||
+
!this.state.enableBindDN.includes(','))) ||
+ (this.state.enableBindGroupDN != "" && attr !=
"enableBindGroupDN" && (!valid_dn(this.state.enableBindGroupDN) ||
+
!this.state.enableBindGroupDN.includes(',')))) {
+ disable = true;
+ }
+ }
errObj[attr] = valueErr;
this.setState({
[attr]: value,
- errObj: errObj
+ errObj: errObj,
+ disabled: disable
});
}
@@ -395,6 +411,7 @@ export class ReplSuffix extends React.Component {
saveHandler={this.enableReplication}
spinning={this.state.addManagerSpinning}
role={this.state.enableRole}
+ disabled={this.state.disabled}
error={this.state.errObj}
/>
<DoubleConfirmModal
diff --git a/src/cockpit/389-console/src/lib/security/ciphers.jsx
b/src/cockpit/389-console/src/lib/security/ciphers.jsx
index c07c0dc..c187586 100644
--- a/src/cockpit/389-console/src/lib/security/ciphers.jsx
+++ b/src/cockpit/389-console/src/lib/security/ciphers.jsx
@@ -22,16 +22,19 @@ export class Ciphers extends React.Component {
cipherPref: "default",
prefs: this.props.cipherPref,
saving: false,
+ availableCiphers: this.props.supportedCiphers,
};
this.handlePrefChange = this.handlePrefChange.bind(this);
this.saveCipherPref = this.saveCipherPref.bind(this);
+ this.handleCipherChange = this.handleCipherChange.bind(this);
}
componentWillMount () {
let cipherPref = "default";
let allowedCiphers = [];
let deniedCiphers = [];
+ let availableCiphers = this.props.supportedCiphers.slice(0); // Copy array
// Parse SSL cipher attributes (nsSSL3Ciphers)
if (this.props.cipherPref != "") {
@@ -57,12 +60,31 @@ export class Ciphers extends React.Component {
deniedCiphers.push(cipher.substring(1));
}
}
+
+ // Now modify the available list
+ for (let i = 0; i < availableCiphers.length; i++) {
+ for (let ii = 0; ii < allowedCiphers.length; ii++) {
+ if (availableCiphers[i] === allowedCiphers[ii]) {
+ availableCiphers.splice(i, 1);
+ i--;
+ break;
+ }
+ }
+ for (let ii = 0; ii < deniedCiphers.length; ii++) {
+ if (availableCiphers[i] === deniedCiphers[ii]) {
+ availableCiphers.splice(i, 1);
+ i--;
+ break;
+ }
+ }
+ }
}
this.setState({
cipherPref: cipherPref,
allowCiphers: allowedCiphers,
denyCiphers: deniedCiphers,
+ availableCiphers: availableCiphers,
});
}
@@ -117,6 +139,30 @@ export class Ciphers extends React.Component {
});
}
+ handleCipherChange (type, values) {
+ let availableCiphers = this.props.supportedCiphers.slice(0); // Copy array
+ for (let i = 0; i < availableCiphers.length; i++) {
+ for (let ci = 0; ci < values.length; ci++) {
+ if (availableCiphers[i] === values[ci]) {
+ availableCiphers.splice(i, 1);
+ i--;
+ break;
+ }
+ }
+ }
+ if (type == "allow") {
+ this.setState({
+ allowCiphers: values,
+ availableCiphers: availableCiphers
+ });
+ } else {
+ this.setState({
+ denyCiphers: values,
+ availableCiphers: availableCiphers
+ });
+ }
+ }
+
render () {
let supportedCiphers = [];
let enabledCiphers = [];
@@ -200,12 +246,10 @@ export class Ciphers extends React.Component {
<Typeahead
multiple
onChange={value => {
- this.setState({
- allowCiphers: value
- });
+ this.handleCipherChange("allow", value);
}}
selected={this.state.allowCiphers}
- options={this.props.supportedCiphers}
+ options={this.state.availableCiphers}
newSelectionPrefix="Add a cipher: "
placeholder="Type a cipher..."
id="allowCipher"
@@ -220,12 +264,10 @@ export class Ciphers extends React.Component {
<Typeahead
multiple
onChange={value => {
- this.setState({
- denyCiphers: value
- });
+ this.handleCipherChange("deny", value);
}}
selected={this.state.denyCiphers}
- options={this.props.supportedCiphers}
+ options={this.state.availableCiphers}
newSelectionPrefix="Add a cipher: "
placeholder="Type a cipher..."
id="denyCipher"
diff --git a/src/cockpit/389-console/src/lib/tools.jsx
b/src/cockpit/389-console/src/lib/tools.jsx
index ca402f5..b37dd86 100644
--- a/src/cockpit/389-console/src/lib/tools.jsx
+++ b/src/cockpit/389-console/src/lib/tools.jsx
@@ -125,6 +125,9 @@ export function valid_port (val) {
export function valid_dn (dn) {
// Validate value is a valid DN (sanity validation)
+ if (dn.endsWith(',')) {
+ return false;
+ }
let dn_regex = new RegExp("^([A-Za-z]+=.*)");
let result = dn_regex.test(dn);
return result;
diff --git a/src/cockpit/389-console/src/schema.html
b/src/cockpit/389-console/src/schema.html
index 36f61be..cb6baf9 100644
--- a/src/cockpit/389-console/src/schema.html
+++ b/src/cockpit/389-console/src/schema.html
@@ -79,27 +79,27 @@
<div class="ds-inline">
<div>
<label for="attr-name-view"
class="ds-config-label-lrg" title="The attribute name"><b
- >Attribute Name</b></label><input
class="ds-input" type="text" id="attr-name-view"
size="40" readonly />
+ >Attribute Name</b></label><input
class="ds-input" type="text" id="attr-name-view"
size="40" disabled />
</div>
<div>
<label for="attr-desc-view"
class="ds-config-label-lrg" title="The attribute
description"><b
- >Description</b></label><input
class="ds-input" type="text" id="attr-desc-view"
size="40" readonly />
+ >Description</b></label><input
class="ds-input" type="text" id="attr-desc-view"
size="40" disabled />
</div>
<div>
<label for="attr-oid-view"
class="ds-config-label-lrg" title="The attribute name"><b
- >OID</b></label><input
class="ds-input" type="text" id="attr-oid-view"
size="40" readonly />
+ >OID</b></label><input
class="ds-input" type="text" id="attr-oid-view"
size="40" disabled />
</div>
<div>
<label for="attr-parent-view"
class="ds-config-label-lrg" title="The parent
attribute"><b>Parent Attribute</b></label><input
- class="ds-input" type="text"
id="attr-parent-view" size="40" readonly />
+ class="ds-input" type="text"
id="attr-parent-view" size="40" disabled />
</div>
<div>
<label for="attr-syntax-view"
class="ds-config-label-lrg" title="The attribute
syntax"><b>Attribute Syntax</b></label><input
- class="ds-input" type="text"
id="attr-syntax-view" size="40" readonly />
+ class="ds-input" type="text"
id="attr-syntax-view" size="40" disabled />
</div>
<div>
<label for="attr-usage-view"
class="ds-config-label-lrg" title="The parent
attribute"><b>Attribute Usage</b></label><input
- class="ds-input" type="text"
id="attr-usage-view" size="40" readonly />
+ class="ds-input" type="text"
id="attr-usage-view" size="40" disabled />
</div>
<div>
<input type="checkbox"
class="ds-config-checkbox" id="attr-multivalued-view"
disabled="disabled" /><label
@@ -111,22 +111,22 @@
</div>
<div>
<label for="attr-alias-view"
class="ds-config-label-lrg" title="The attribute alias list separated by
space"><b
- >Attribute Aliases</b></label><input
class="ds-input" type="text" id="attr-alias-view"
size="40" readonly />
+ >Attribute Aliases</b></label><input
class="ds-input" type="text" id="attr-alias-view"
size="40" disabled />
</div>
<div class="panel panel-default ds-margin-top">
<div
class="panel-heading"><strong>Matching
rules</strong></div>
<div class="panel-body">
<div>
<label for="attr-eq-mr-select-view"
class="ds-config-label-lrg"><b>Equality</b></label><input
- class="ds-input"
type="text" id="attr-eq-mr-select-view" size="35" readonly
/>
+ class="ds-input"
type="text" id="attr-eq-mr-select-view" size="35" disabled
/>
</div>
<div>
<label for="attr-order-mr-select-view"
class="ds-config-label-lrg"><b>Ordering</b></label><input
- class="ds-input" type="text"
id="attr-order-mr-select-view" size="35" readonly />
+ class="ds-input" type="text"
id="attr-order-mr-select-view" size="35" disabled />
</div>
<div>
<label for="attr-sub-mr-select-view"
class="ds-config-label-lrg"><b>Substring</b></label><input
- class="ds-input" type="text"
id="attr-sub-mr-select-view" size="35" readonly />
+ class="ds-input" type="text"
id="attr-sub-mr-select-view" size="35" disabled />
</div>
</div>
</div>
@@ -246,37 +246,37 @@
<div class="ds-inline">
<div>
<label for="oc-name-view"
class="ds-config-label-lrg" title="The objectclass name"><b
- >Objectclass Name</b></label><input
class="ds-input" type="text" id="oc-name-view"
size="40" readonly />
+ >Objectclass Name</b></label><input
class="ds-input" type="text" id="oc-name-view"
size="40" disabled />
</div>
<div>
<label for="oc-desc-view"
class="ds-config-label-lrg" title="The objectClass
description"><b
- >Description</b></label><input
class="ds-input" type="text" id="oc-desc-view"
size="40" readonly/>
+ >Description</b></label><input
class="ds-input" type="text" id="oc-desc-view"
size="40" disabled/>
</div>
<div>
<label for="oc-oid-view"
class="ds-config-label-lrg" title="Objectclass OID
(optional)"><b
- >OID (optional)</b></label><input
class="ds-input" value="" type="text"
id="oc-oid-view" size="40" readonly/>
+ >OID (optional)</b></label><input
class="ds-input" value="" type="text"
id="oc-oid-view" size="40" disabled/>
</div>
<div>
<label for="oc-parent-view"
class="ds-config-label-lrg" title="The parent
objectclass"><b>Parent Objectclass</b></label><input
- class="ds-input" value=""
type="text" id="oc-parent-view" size="40" readonly />
+ class="ds-input" value=""
type="text" id="oc-parent-view" size="40" disabled />
</div>
<div>
<label for="oc-kind-view"
class="ds-config-label-lrg" title="The parent
objectclass"><b>Objectclass Kind</b></label><input
- class="ds-input" value=""
type="text" id="oc-kind-view" size="40" readonly />
+ class="ds-input" value=""
type="text" id="oc-kind-view" size="40" disabled />
</div>
<hr>
<div class="ds-container">
<div>
<label class="ds-config-label"
for="oc-required-list-view" title=
"Attributes allowed by the
objectclass"><b>Required Attributes</b></label>
- <select id="oc-required-list-view"
class="ds-may-must-list" multiple>
+ <select id="oc-required-list-view"
class="ds-may-must-list" multiple disabled>
</select>
</div>
<div class="ds-divider"></div>
<div>
<label class="ds-config-label"
for="oc-allowed-list-view" title=
"Attributes allowed by the
objectclass"><b>Allowed Attributes</b></label>
- <select id="oc-allowed-list-view"
class="ds-may-must-list" multiple>
+ <select id="oc-allowed-list-view"
class="ds-may-must-list" multiple disabled>
</select>
</div>
</div>
diff --git a/src/cockpit/389-console/src/servers.html
b/src/cockpit/389-console/src/servers.html
index f60bd5d..5df11cd 100644
--- a/src/cockpit/389-console/src/servers.html
+++ b/src/cockpit/389-console/src/servers.html
@@ -136,7 +136,7 @@
<form>
<div>
<label for="nsslapd-rootdn" class="ds-config-label"
title="The DN of the unrestricted directory manager
(nsslapd-rootdn).">Directory Manager DN</label><input
- class="ds-input" type="text" readonly
id="nsslapd-rootdn" value="cn=Directory Manager"
size="40"/>
+ class="ds-input" type="text" disabled
id="nsslapd-rootdn" value="cn=Directory Manager"
size="40"/>
</div>
<div>
<label for="nsslapd-rootpw" class="ds-config-label"
title="The Directory Manager password (nsslapd-rootpw).">Directory Manager
Password</label><input
@@ -951,13 +951,13 @@
<div class="ldapi-attrs ds-inline" hidden>
<div>
<label for="nsslapd-ldapifilepath" class="ds-config-label"
title="The Unix socket file (nsslapd-ldapifilepath). The UI requires this exact path
so it is a read-only setting.">LDAPI Socket File Path</label><input
- class="ds-input" type="text"
id="nsslapd-ldapifilepath" size="35" readonly/>
+ class="ds-input" type="text"
id="nsslapd-ldapifilepath" size="35" disabled/>
</div>
<div class="ds-inline">
<div class="autobind-attrs">
<div>
<label for="nsslapd-ldapimaprootdn"
class="ds-config-label" title="Map the Unix root entry to this Directory
Manager DN (nsslapd-ldapimaprootdn). The UI requires this to be set to the current root
DN so it is a read-only setting">DN to map "root"
To</label><input
- class="ds-input" type="text"
id="nsslapd-ldapimaprootdn" readonly size="35"/>
+ class="ds-input" type="text"
id="nsslapd-ldapimaprootdn" disabled size="35"/>
</div>
<div>
<p></p>
diff --git a/src/cockpit/389-console/src/servers.js
b/src/cockpit/389-console/src/servers.js
index 7e34a5a..9423a5d 100644
--- a/src/cockpit/389-console/src/servers.js
+++ b/src/cockpit/389-console/src/servers.js
@@ -318,19 +318,21 @@ function apply_mods(mods) {
}
let cmd = [DSCONF, '-j', 'ldapi://%2fvar%2frun%2f' + server_id +
'.socket', 'config', 'replace'];
cmd.push(mod.attr + "=" + mod.val);
- cockpit.spawn(cmd, { superuser: true, "err": "message",
"environ": [ENV]}).then(function() {
+ cockpit.spawn(cmd, { superuser: true, "err": "message",
"environ": [ENV]}).done(function() {
config_values[mod.attr] = mod.val;
// Continue with next mods (if any))
apply_mods(mods);
- }, function(ex, data) {
- popup_err("Failed to update attribute: " + mod.attr, data);
- // Reset HTML for remaining values that have not been processed
- $("#" + mod.attr).val(config_values[mod.attr]);
- for (remaining in mods) {
- $("#" + remaining.attr).val(config_values[remaining.attr]);
- }
- check_inst_alive(0);
- return -1; // Stop on error
+ })
+ .fail(function(err) {
+ var err_obj = JSON.parse(err);
+ popup_err("Failed to update attribute: " + mod.attr, err_obj.info);
+ // Reset HTML for remaining values that have not been processed
+ $("#" + mod.attr).val(config_values[mod.attr]);
+ for (remaining in mods) {
+ $("#" + remaining.attr).val(config_values[remaining.attr]);
+ }
+ check_inst_alive(0);
+ return -1; // Stop on error
});
}
@@ -346,7 +348,8 @@ function delete_mods(mods) {
// Continue with next mods (if any))
delete_mods(mods);
}, function(ex, data) {
- popup_err("Failed to delete attribute: " + mod.attr, data);
+ var err_obj = JSON.parse(data);
+ popup_err("Failed to delete attribute: " + mod.attr, err_obj.info);
// Reset HTML for remaining values that have not been processed
$("#" + mod.attr).val(config_values[mod.attr]);
for (remaining in mods) {
diff --git a/src/lib389/lib389/cli_conf/backend.py
b/src/lib389/lib389/cli_conf/backend.py
index 93bf044..dc482f4 100644
--- a/src/lib389/lib389/cli_conf/backend.py
+++ b/src/lib389/lib389/cli_conf/backend.py
@@ -508,6 +508,16 @@ def db_config_set(inst, basedn, log, args):
print("Successfully updated database configuration")
+def _format_status(log, mtype, json=False):
+ if json:
+ print(mtype.get_status_json())
+ else:
+ status_dict = mtype.get_status()
+ log.info('dn: ' + mtype._dn)
+ for k, v in list(status_dict.items()):
+ # For each value in the multivalue attr
+ for vi in v:
+ log.info('{}: {}'.format(k, vi))
def get_monitor(inst, basedn, log, args):
if args.suffix is not None:
@@ -515,13 +525,13 @@ def get_monitor(inst, basedn, log, args):
be = _get_backend(inst, args.suffix)
monitor = be.get_monitor()
if monitor is not None:
- monitor.get_status(use_json=args.json)
+ _format_status(log, monitor, args.json)
return
raise ValueError("There was no monitor found for suffix
'{}'".format(args.suffix))
else:
# Get the global database monitor entry
- db_mon = MonitorLDBM(inst)
- db_mon.get_status(use_json=args.json)
+ monitor = MonitorLDBM(inst)
+ _format_status(log, monitor, args.json)
def backend_add_index(inst, basedn, log, args):
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.