bnhf / openvpn-admin-plus

Docker-based web interface (with golang backend) for monitoring and admin of an OpenVPN TAP/TUN server setup with PiVPN or other OpenVPN server installations. This project has been renamed from pivpn-tap-web-ui, to reflect its new broader scope.
MIT License
141 stars 23 forks source link

Messages about the results on the certificates page #19

Closed karabelnikov closed 1 year ago

karabelnikov commented 1 year ago

@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 1 year ago

@karabelnikov

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

karabelnikov commented 1 year ago

@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 1 year ago

@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.

karabelnikov commented 1 year ago

@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 1 year ago

@karabelnikov

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