pfSense Gold Subscription

Author Topic: Dashboard Thermal Sensors use "unfriendly names" for Core >= 4  (Read 2623 times)

0 Members and 1 Guest are viewing this topic.

Offline Jason Litka

  • Hero Member
  • *****
  • Posts: 1294
  • Karma: +53/-1
    • View Profile
    • Utter Ramblings
I reported this in redmine (#3337, https://redmine.pfsense.org/issues/3337) 4 months back and it slipped my mind until today when I spun up a new box with 8 cores.

Is there any chance that this bug could be fixed for 2.1.1?
I can break anything.

Offline Jason Litka

  • Hero Member
  • *****
  • Posts: 1294
  • Karma: +53/-1
    • View Profile
    • Utter Ramblings
Re: Dashboard Thermal Sensors use "unfriendly names" for Core >= 4
« Reply #1 on: March 22, 2014, 08:44:06 am »
Thank you!
I can break anything.

Offline Renato Botelho

  • Administrator
  • Full Member
  • *****
  • Posts: 261
  • Karma: +43/-0
    • View Profile
Renato Botelho

Offline Jason Litka

  • Hero Member
  • *****
  • Posts: 1294
  • Karma: +53/-1
    • View Profile
    • Utter Ramblings
Re: Dashboard Thermal Sensors use "unfriendly names" for Core >= 4
« Reply #3 on: March 24, 2014, 10:04:28 am »
Thank you!

Did the fix work?

Hmmm...  Actually, no.  It still shows "dev.cpu.#.temperature" for cores 4-7.
I can break anything.

Offline Renato Botelho

  • Administrator
  • Full Member
  • *****
  • Posts: 261
  • Karma: +43/-0
    • View Profile
Re: Dashboard Thermal Sensors use "unfriendly names" for Core >= 4
« Reply #4 on: March 24, 2014, 10:24:08 am »
Are you using the latest 2.1.1 snapshot? Did you clean browser's cache?
Renato Botelho

Offline Jason Litka

  • Hero Member
  • *****
  • Posts: 1294
  • Karma: +53/-1
    • View Profile
    • Utter Ramblings
Re: Dashboard Thermal Sensors use "unfriendly names" for Core >= 4
« Reply #5 on: March 24, 2014, 10:51:29 am »
Are you using the latest 2.1.1 snapshot? Did you clean browser's cache?

Yes (Sun Mar 23 12:34:36 EDT 2014) and yes.  I also checked the JS file and your changes are in there.
I can break anything.

Offline Renato Botelho

  • Administrator
  • Full Member
  • *****
  • Posts: 261
  • Karma: +43/-0
    • View Profile
Re: Dashboard Thermal Sensors use "unfriendly names" for Core >= 4
« Reply #6 on: March 24, 2014, 01:50:53 pm »
Are you using the latest 2.1.1 snapshot? Did you clean browser's cache?

Yes (Sun Mar 23 12:34:36 EDT 2014) and yes.  I also checked the JS file and your changes are in there.

The odd thing is, the new code do not make any distinction for zones less or greater than 4, so, if this code is wrong, you should see the unfriendly name for all Cores instead of seeing it only for Cores > 4. It sounds to me like something is still cached. It works fine on my tests here.
Renato Botelho

Offline Jason Litka

  • Hero Member
  • *****
  • Posts: 1294
  • Karma: +53/-1
    • View Profile
    • Utter Ramblings
Re: Dashboard Thermal Sensors use "unfriendly names" for Core >= 4
« Reply #7 on: March 25, 2014, 09:33:53 am »
I just updated to (Mon Mar 24 14:54:23 EDT 2014) and still no joy.  I've tried clearing the cache on Chrome, switching to IE, and even using another computer which has never accessed pfSense.

Is there another section of code that needs to change?
« Last Edit: March 25, 2014, 09:41:08 am by Jason Litka »
I can break anything.

Offline Renato Botelho

  • Administrator
  • Full Member
  • *****
  • Posts: 261
  • Karma: +43/-0
    • View Profile
Re: Dashboard Thermal Sensors use "unfriendly names" for Core >= 4
« Reply #8 on: March 25, 2014, 09:39:01 am »
I don't think so, it still shows correct zones <= 4?
Renato Botelho

Offline Jason Litka

  • Hero Member
  • *****
  • Posts: 1294
  • Karma: +53/-1
    • View Profile
    • Utter Ramblings
Re: Dashboard Thermal Sensors use "unfriendly names" for Core >= 4
« Reply #9 on: March 25, 2014, 09:41:30 am »
I figured it out.  Before I installed the updated snapshot I had applied the patch manually using "System > Patches".  This apparently left a thermal_sensors.js.orig file sitting around with the original code in it and was, for some reason, being included on the page.  Since it was loaded after the updated one it overrode the fixed function with the old one.  Once I deleted the .orig file the names started displaying properly.

I guess the question now is, why was a .orig file being included?
I can break anything.

Offline phil.davis

  • Hero Member
  • *****
  • Posts: 4612
  • Karma: +550/-3
    • View Profile
    • International Nepal Fellowship
Re: Dashboard Thermal Sensors use "unfriendly names" for Core >= 4
« Reply #10 on: March 25, 2014, 09:58:17 am »
Yes, I noticed this also when I had a little play. I had copied the original to thermal_sensors.save.js and had the same issue wondering why changed code in thermal_sensors.js did not do anything.
/usr/local/www/index.php has this code:
Code: [Select]
//build list of javascript include files
$jsincludefiles = array();
$directory = "widgets/javascript/";
$dirhandle = opendir($directory);
$filename = "";
while (false !== ($filename = readdir($dirhandle))) {
$jsincludefiles[] = $filename;
}
foreach($jsincludefiles as $jsincludename) {
if(!stristr($jsincludename, ".js"))
continue;
echo "<script src='{$directory}{$jsincludename}' type='text/javascript'></script>\n";
}
which includes all the files in that directory that have ".js" anywhere in the name.
Lesson is that when fiddling with the system, put backup copies of stuff you are messing with into some other directory well away from where any run-time code will ever look for it. (Or be the hacker from hell and just dump the new code over the top of what you had:)
As the Greek philosopher Isosceles used to say, "There are 3 sides to every triangle."
If I helped you, then help someone else - buy someone a gift from the INF catalog http://secure.inf.org/gifts/usd/

Offline Renato Botelho

  • Administrator
  • Full Member
  • *****
  • Posts: 261
  • Karma: +43/-0
    • View Profile
Re: Dashboard Thermal Sensors use "unfriendly names" for Core >= 4
« Reply #11 on: March 25, 2014, 10:29:38 am »
Fixed, only files that ends with .js will be considered.
Renato Botelho