Project

General

Profile

Bug #9072

RRD graph mouseover information shows up as Mb when unit size is set to MB

Added by Luka Rojnica over 2 years ago. Updated 5 months ago.

Status:
Resolved
Priority:
Very Low
Assignee:
Jared Dillard
Category:
Dashboard
Target version:
Start date:
10/26/2018
Due date:
% Done:

100%

Estimated time:
Affected Version:
2.4.4
Affected Architecture:
Release Notes:
Default

Description

The dashboard traffic graph widget shows mouse over information in Mb when the unit size is set to MB

capture_001_26102018_173939.jpg (29 KB) capture_001_26102018_173939.jpg Luka Rojnica, 10/26/2018 10:40 AM

Associated revisions

Revision e5b43cf8 (diff)
Added by Jared Dillard about 2 years ago

type cast traffic graph inputs to fix #9072

History

#2 Updated by Joshua Sign about 2 years ago

i can confirm
the problem comes when you change from bytes to bits and then bits to bytes.

one temporary workaround :
change /usr/local/www/widgets/widgets/traffic_graphs.widget.php on line 280 :

    window.size = <?=json_encode($tg_size)?>;

by
    window.size = <?=json_encode($tg_size)?>*1;

This is because https://github.com/pfsense/pfsense/blob/master/src/usr/local/www/js/traffic-graphs.js#L203 strict check an integer.
And the values comning from post are strings.
Should be casted at first stage, but need more changes to be clean.

#3 Updated by Jim Thompson about 2 years ago

  • Assignee set to Jared Dillard

#4 Updated by Jared Dillard about 2 years ago

It looks like it was introduced in this commit (not that the code before it was perfect): https://github.com/pfsense/pfsense/commit/52229047e723241046a2641efc477a8b48b24dc8

I fixed it in this commit: https://github.com/pfsense/pfsense/commit/e5b43cf8b86586486d951ab1da35b6c45ad6edf6

You can test by toggling the Unit Size from Bits to Bytes and back again, or you can open the console and enter:

console.log(window.size);
and you will see it shows up in a blue color, versus the previous black color. You can also do the same for the following:
  • window.graph_backgroundupdate
  • window.interval
  • window.size
  • window.smoothing

#5 Updated by Jared Dillard about 2 years ago

  • Status changed from New to Feedback

#6 Updated by Jared Dillard about 2 years ago

  • % Done changed from 0 to 100

#7 Updated by Joshua Sign about 2 years ago

It Works! ;)

tested on :
2.4.4-RELEASE-p2 (amd64)
built on Wed Dec 12 07:40:18 EST 2018
FreeBSD 11.2-RELEASE-p6

#8 Updated by Jared Dillard about 2 years ago

  • Status changed from Feedback to Resolved

#9 Updated by Jared Dillard about 2 years ago

Thanks for digging into the problem and for testing the fix!

#10 Updated by Axel Taferner over 1 year ago

Jared Dillard wrote:

Thanks for digging into the problem and for testing the fix!

I'm running 2.4.4-RELEASE-p3 (amd64) and just noticed this same issue is still happening on my install. Do I need to do anything to fix it?

#11 Updated by Jim Pingle 5 months ago

  • Target version set to 2.5.0

#12 Updated by Jared Dillard 5 months ago

I can't reproduce, did you toggle the Unit Size from Bits to Bytes and back again (hitting Save each time) on the Traffic Graphs widget and the units not match up?

Also available in: Atom PDF