Apply the auto-resize feature for the timeline charts

Description

It would be nice, specially for readability purposes, to auto-resize the timeline displayed on the Availability Box for nodes pages, interfaces pages and services pages, using a similar algorithm like the graph results and/or KSC reports.

Acceptance / Success Criteria

None

Attachments

3

Lucidchart Diagrams

Activity

Show:

Alejandro Galue March 3, 2015 at 11:55 AM

I've chosen the second option, use jQuery to inject the HTML on the table cell (similar to the original solution).

The fix has been committed on revision 8479bf10280bd1166bf8c617f02033eaee69b94d for foundation (it will be eventually merged to Meridian and Develop).

Alejandro Galue March 3, 2015 at 9:23 AM

I think the above possibilities are not going to work because the content of this area tag relies on the width to calculate the correct position.

We have two options here:

1) Go back with the non-useful original solution with a fixed 250 pixels.
2) Use jQuery to asynchronously call /opennms/rest/timeline/html and write the content after knowing the size and rendering the final image.
3) Use jQuery to show a modal window when you click on the timeline, to show a greater time line. This greater timeline is going to be built with your original code and a bigger width. Then, the area links should work, and are going to be more "visible and easy to click".

I prefer the last option for several reasons:

1) With 250 pixels (original solution) and lots of outages (which is very common on certain environments), it is almost impossible to click on the section you want.
2) I didn't know this was a feature
3) We are going to have the benefits of showing a greater timeline by default, and if you want to see the details of it (which I'm not sure that lot of people knows about it), use the original solution on a different window.

Makes sense ?

Alejandro Galue March 3, 2015 at 8:57 AM

Christian,

I think I know what's missing.

Let me explain you what I did, analyzing the following example taken from:

http://demo.opennms.org/opennms/element/node.jsp?node=9

Basically, I've replaced the "script" tag with the actual HTML content; I mean, this used to look like this:

where timelineUrl used to be:

Now, if I navigate that link (in other words, http://demo.opennms.org/opennms/rest/timeline/html/9/172.20.1.10/FTP/1425303971/1425390371/250), it produces:

Hmmm, it used to be just something like this:

So, there is a new "area" tag inside the "map" tag that I just saw, but I never did before (which makes me think that this "HTML" section is dynamic and explain why you did this hack).

There are two options here:

Create the HTML link with just the "map/area" section without the "img" tag ... or, provide a parameter to /opennms/rest/timeline/image to put the link on a parameter called "data-imgsrc" instead of "src" and an empty link (i.e. #) on the "src" tag like the current code.

What do you think ?

Because of the jQuery code to perform the "resize", I'm not sure if going back to a solution based on the script tag will work considering how the page is rendered, but I can give it try.

Christian Pape March 3, 2015 at 5:02 AM
Edited

Is it possible that the links are not working anymore with your fix applied?
It was possible to click on red areas in the graph to bring up the outage
page. For this the rest call to "html/nodeId/ipAddress/serviceName/start/end/width"
was made to create the image map.

Alejandro Galue February 10, 2015 at 2:39 PM

The fix has been pushed to foundation and cherry-picked on release-15.0.1:

Fixed

Details

Assignee

Reporter

Components

Fix versions

Affects versions

Priority

PagerDuty

Created February 9, 2015 at 2:50 PM
Updated March 3, 2015 at 4:59 PM
Resolved February 10, 2015 at 2:39 PM