Skip to content

Issue 6429 - UI - clicking on a database suffix under the Monitor tab crashes UI - #6610

Merged
jchapma merged 2 commits into
389ds:mainfrom
jchapma:ui-db-mon
Mar 6, 2025
Merged

Issue 6429 - UI - clicking on a database suffix under the Monitor tab crashes UI#6610
jchapma merged 2 commits into
389ds:mainfrom
jchapma:ui-db-mon

Conversation

@jchapma

@jchapma jchapma commented Feb 14, 2025

Copy link
Copy Markdown
Contributor

Bug description:
Clicking on a db suffix under the Monitor tab causes the UI to crash when the instance is configured with the mdb db engine.

Fix description:
Introduced separate database and suffix monitor classes tailored for mdb. Parent class detects the configured db engine and calls the appropriate monitor class.

Fixes: #6429

Reviewed by:

@mreynolds389

mreynolds389 commented Mar 3, 2025

Copy link
Copy Markdown
Contributor

@jchapma can you rebase with main so I can test this? Thanks!

… crashes UI

Bug description:
Clicking on a db suffix under the MOnitor tab causes the UI to crash when
the instance is configured with the mdb db engine.

Fix description:
Introduced separate database and suffix monitor classes tailored for mdb. Parent
class detects the configured db engine and calls the appropriate monitor class.

Fixes: 389ds#6429

Reviewed by:

@droideck droideck left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couple of issues, otherwise, looks good!

Comment on lines -1261 to -1269

// Check if have any errors on our attributes
for (const config_attr of check_attrs) {
if (config_attr in this.state.error && this.state.error[config_attr]) {
saveBtnDisabled = true;
break;
}
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why remove the code? The removal is not mentioned in the commit message and, IIUC, the code has a purpose.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This section was removed in the rebase,I will add it back.

Comment on lines +592 to +610
getDBEngine () {
const cmd = [
"dsconf", "-j", "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
"backend", "config", "get"
];
log_cmd("getDBEngine", "Get DB Implementation", cmd);
cockpit
.spawn(cmd, { superuser: true, err: "message" })
.done(content => {
const config = JSON.parse(content);
const attrs = config.attrs;
if ('nsslapd-backend-implement' in attrs) {
this.setState({
dbEngine: attrs['nsslapd-backend-implement'][0],
});
}
});
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this function fails, I think, we need to report an error in a .fail(error section.

@droideck droideck left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@jchapma
jchapma merged commit 1f48f63 into 389ds:main Mar 6, 2025
jchapma added a commit that referenced this pull request Mar 6, 2025
… crashes UI (#6610)

Bug description:
Clicking on a db suffix under the Monitor tab causes the UI to crash when
the instance is configured with the mdb db engine.

Fix description:
Introduced separate database and suffix monitor classes tailored for mdb. Parent
class detects the configured db engine and calls the appropriate monitor class.

Fixes: #6429

Reviewed by: @mreynolds389, @droideck (Thank you)
jchapma added a commit that referenced this pull request Mar 6, 2025
… crashes UI (#6610)

Bug description:
Clicking on a db suffix under the Monitor tab causes the UI to crash when
the instance is configured with the mdb db engine.

Fix description:
Introduced separate database and suffix monitor classes tailored for mdb. Parent
class detects the configured db engine and calls the appropriate monitor class.

Fixes: #6429

Reviewed by: @mreynolds389, @droideck (Thank you)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

UI - clicking on a database suffix under the Monitor tab crashes UI

3 participants