Dashboard Thermal Sensors use "unfriendly names" for Core >= 4



  • 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?



  • Thank you!


  • Administrator

    @Jason:

    Thank you!

    Did the fix work?



  • @Renato:

    @Jason:

    Thank you!

    Did the fix work?

    Hmmm…  Actually, no.  It still shows "dev.cpu.#.temperature" for cores 4-7.


  • Administrator

    Are you using the latest 2.1.1 snapshot? Did you clean browser's cache?



  • @Renato:

    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.


  • Administrator

    @Jason:

    @Renato:

    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.



  • 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?


  • Administrator

    I don't think so, it still shows correct zones <= 4?



  • 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?



  • 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:

    	//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 "\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:)


  • Administrator

    Fixed, only files that ends with .js will be considered.


Log in to reply