Belchertown Reports not showing inset file

48 views
Skip to first unread message

Mike Olness

unread,
Dec 29, 2019, 7:35:56 PM12/29/19
to weewx-user
Everything seems to be working with the Belchertown skin except the Reports page. When the page loads, it shows my 404 page rather than the preformatted NOAA text file. I have tried a variety of things to figure this out, but have come up blank.
I looked in the folder and see both a NOAA-2019.txt file and a NOAA-2019-12.txt file.
If I force load the url with "?yr=2019&mo12", it loads the page just fine and the links are intact.

When I look at the html for the page, this is what I see:
<script>       
        jQuery(document).ready(function() {
            var month = getURLvar("mo");
            var year = getURLvar("yr");
            if ( ( year !== undefined ) && ( month !== undefined ) ) {
                url = '../NOAA/NOAA-'+year+'-'+month+'.txt';
            } else if ( year !== undefined ) {
                url = '../NOAA/NOAA-'+year+'.txt';
            } else {
                url = '../NOAA/';
            }
           
            // Load the file into the pre
            //jQuery('#noaa_contents').load( url );
            populatePre( url );
           
            // Change the direct href link
            jQuery(".noaa_direct_link").attr( "href", url );
        });
       
        // Change the div to the right NOAA file
        // I normally use PHP for this, but JavaScript seems to work well for the skin
        // Source: https://stackoverflow.com/a/18933218/1177153
        function populatePre(url) {
            var xhr = new XMLHttpRequest();
            xhr.onload = function () {
                raw_content = this.responseText;
                updated_content = raw_content.replace('<sup>','').replace('</sup>','').replace('&deg;','');
                document.getElementById('noaa_contents').textContent = updated_content;
            };
            xhr.open('GET', url);
            xhr.send();
        }
    </script>

If you notice, the "else" statement shows url = '../NOAA/'; with no text file at the end as a default value.
In trying to figure out what is going on, I looked at https://belchertownweather.com/reports/. I even copied the basic html from view source and saw nothing that stands out.
About the only thing I see that is different is the version numbers on some of the JS code and the skin itself.
I'm using Belchertown Skin Version: 1.0.1. The main Belchertown site is using 1.1b8. I don't know if that makes a difference.

Is this a problem others have seen? Is there something I'm missing? I have skin loaded in:
I have set the weewx.conf with the following:
    [[Belchertown]]
        HTML_ROOT = /mywebroot/weewx/main
        skin = Belchertown
        forecast_enabled = 1
        enable = True

I like the skin, but am at a loss to sort out why the reports aren't working.
Any help would be great. If I missed a piece of information, please let me know.
Thank you!

Pat

unread,
Dec 31, 2019, 10:13:04 PM12/31/19
to weewx-user
Unsure what may be wrong from this distance. Can you provide a link to your site? I don't *think* I've made any changes on the reports page from 1.0.1 to the 1.1 betas

Mike O.

unread,
Dec 31, 2019, 10:51:54 PM12/31/19
to weewx-user
Hey Pat,
I'm not sure what happened, but I think I have it fixed at this point. I made some changes to the set up and moved things around so that the Belchertown skin was at the Weewx root. By uninstalling and reinstalling, everything is doing what is expected.
My guess is that since this was my first go around with skins, I changed something or had a duplicate file that was hosing me. The site is at https://rathouse.noip.me/weewx/

I appreciate your help.
Mike
Reply all
Reply to author
Forward
0 new messages