shinken-monitoring / mod-webui

Shinken Web User Interface
GNU Affero General Public License v3.0
79 stars 71 forks source link

Notes display in the problems view #677

Closed mohierf closed 4 years ago

mohierf commented 5 years ago

When an host has some notes defined, their display in the problems view is not really nice rendered ...

image

mohierf commented 5 years ago

This is mainly due to the notes encoding format ... I will fix this 😉

mohierf commented 5 years ago

The same problem exist in the element view: image

Furthermore, there is no more tags in the element view whereas tags are really useful as search criteria ... find all hosts base on a specific template 😉

mohierf commented 5 years ago

The rendering may be this in the element view: image

mohierf commented 5 years ago

And this in the problems view: image

maethor commented 5 years ago

@mohierf So it does not manage URL anymore ? I agree we could find a way to manage HTML, but I don't agree with what you did, I'm reverting the PR.

Moreover, I don't know how you configured what you are showing here, but notes and notes_url are not lists of notes and urls. You should only define one note and one URL (and one action url), as documented here : https://shinken.readthedocs.io/en/latest/08_configobjects/host.html

maethor commented 5 years ago

I reverted your commits. We need to discuss it because it is adding a lot of complexity, both in the UI and the code, and as I understand it in the documentation you are not supposed to declare multiple notes and URLs like what you are doing here. So I prefer to keep it simple.

If you want to improve and manage multiple notes and URL, why not, but it needs to be way simpler in the UI.

mohierf commented 5 years ago

Indeed, it is very simple as I did it ... and it is documented in the project Wiki. The solution I implemented still existed since a long time and it is quite commonly used in the Nagios configuration files ...

Sure that your are not supposed to declare list in notes (and you are not obliged indeed...) but if you want to declare some, the implementation I did allows to do it. And if you do not use any list in notes, notes_url or actions_url, you are not obliged to do so ...

If they are not lists:

mohierf commented 5 years ago

As an example:

   notes                This is a MongoDB host!
   notes_url            http://www.my-KB.fr?host=$HOSTADDRESS$
   action_url           http://google.fr

is rendered as: image

maethor commented 5 years ago

This is the display since I reverted your commits. But it didn't displayed like this before. Cf your own screenshots in this issue 14 days ago.

mohierf commented 5 years ago

The screenshot I posted 14 days ago are rendering when you define some lists as explained in the wiki ... not for a Nagios-like configuration without any list.

If I revert your revert 😉 I get this with the same configuration:

   notes                This is a MongoDB host!
   notes_url            http://www.my-KB.fr?host=$HOSTADDRESS$
   action_url           http://google.fr

image

The only differences are:

What is the point with this ?

maethor commented 5 years ago

And what about the note in a ugly and useless box which seem clickable when I over with the mouse?

Also, I want to keep url notes as links instead of buttons, at least in /problems view. I find it cleaner.

mohierf commented 5 years ago

Ok. I clean this and send a new PR

maethor commented 5 years ago

My mistake : https://shinken.readthedocs.io/en/latest/07_advanced/multiple-urls.html

mohierf commented 5 years ago

@maethor: I will refactor my initial PR with the Shinken doc described format. I will make it also available for notes and notes_url.

Note that my initial PR is the same implementation as the one that did existed in older Shinken UI versions. We will be able to restore if some users compalin about this...

mohierf commented 5 years ago

In the element view:

image

  1. one note with HTML content
  2. several notes_url. If a title is set it will be rendered as a button with/without an icon. If no title nor icon, it is rendered as the 1st link...
  3. same for the actions url

In the problems view:

image

In the custom host view:

image

maethor commented 5 years ago

@mohierf can we close?