bnhf/openvpn-admin-plus

Messages about the results on the certificates page

karabelnikov opened this issue · 5 comments

@bnhf

Scott, there are no notifications on the page that the user's certificate has been successfully created, revoked or deleted. On the settings page or OpenVPN Config there is a message about the result after clicking on the Save and Apply button. I think for clarity and informativeness, we need to implement messages and on the certificates page so that it is visible about the resolution of the problem after clicking the Create, Revoke and Remove buttons. I also think that it is necessary to make a check and display a message when a user with a valid certificate already exists. If you try to create a user with the same name who has a valid certificate, then pages a just update and nothing is clear. When there are a lot of certificates, it will be easier to track.

A screenshot as an example of what I wrote.

Снимок экрана 2022-12-11 022519

bnhf commented

@karabelnikov

Yet another excellent idea. Have you already done some work on this?

@bnhf

In the file certificates.html as in the file settings.html and config.html there is a code {{template "common/alert.html " .}}. As I understand it, he is responsible for the output of such events. But I don't quite understand how it binds and works. I think we need to work in this direction.

bnhf commented

@karabelnikov

I've been successful in adding "alert banners" to certificate revoke and remove. After some testing, I decided to add the name of certificate being acted upon to the banner, and match the banner color to the corresponding button. I.E. a yellow banner for revoke and a red banner for remove. The banners can be cleared using the "x" on the righthand side, or if there's a new alert it'll replace the previous banner.

I'm going to build a new beta container with this feature, plus your additional PR from today.

@bnhf

Scott, great, I've already tested your changes and everything works, however:

Why is there no banner when creating a certificate? I think it would be logical to make it green, as evidenced by the fact that the user has been created.

I also suggest making a standard wording of messages in this format:
Certificate for the name "director" created
Certificate for the name "director" revoked
Certificate for the name "director" removed

where the name of the certificate with which the actions were performed will be indicated in quotation marks.

bnhf commented

@karabelnikov

Done! Built a new multi-arch container with both beta and latest tags.