Page 13 of 17

Re: Reworked default websites

Posted: Fri 12 Jan 2024 9:52 am
by flort
bumpy wrote: Wed 10 Jan 2024 3:41 pm In view of the suggestion that possibly not all files etc are on the server. I have reloaded the webfiles folder to the server but this has made no difference. The Default website continues to update correctly with the exception of the lack of data on the Reports tag. The page itself continues to load as shown in the first line above.

I am now at a loss what to do as I am clearly not IT conversant with progamming terms and suchlike!
Hi Tony,

Where are you up to with this? I notice that the pages with file extension html no longer exist and your site using htm extensions is not reporting any data.

Regards,
Trevor

Re: Reworked default websites

Posted: Fri 12 Jan 2024 11:00 am
by NeilThomas
griffo42 wrote: Thu 11 Jan 2024 6:32 am Could someone please tell me the javascript file that I have to edit to get the highlighted entry in the attachment which shows data for the Month of January 2024.

Screenshot 2024-01-11 161711.png

My Dashboard shows the data (highlighted) as:
Screenshot 2024-01-11 162749.png


Best wishes
Hi
The file you need to examine is 'js/records.js'. It should read:

Code: Select all

$("[data-cmxdata='RainRateHT']").html(cmxData.YearRainRateHT + ' on ' + cmxData.YearRainRateHD);
You should only make changes to the content of the .html(...) code. This accesses the required web tag data. The first part of the line accesses the correct element on the web page.

Neil

Re: Reworked default websites

Posted: Fri 12 Jan 2024 11:31 am
by NeilThomas
flort wrote: Fri 12 Jan 2024 9:52 am
bumpy wrote: Wed 10 Jan 2024 3:41 pm In view of the suggestion that possibly not all files etc are on the server. I have reloaded the webfiles folder to the server but this has made no difference. The Default website continues to update correctly with the exception of the lack of data on the Reports tag. The page itself continues to load as shown in the first line above.

I am now at a loss what to do as I am clearly not IT conversant with progamming terms and suchlike!
Hi Tony,

Where are you up to with this? I notice that the pages with file extension html no longer exist and your site using htm extensions is not reporting any data.

Regards,
Trevor
Hi Tony

I have taken a look at your published site it looks as if you are expecting the website data to be in the default location - i.e., in the same location as the pages. The data is obviously not there. There are no html files as used by the alternative website. Can I therefore suggest the following course of action:
  • Copy ALL the files and folders in the CumulusMX/webfiles/ folder to your public_html folder on your website.
  • Copy ALL your reports from the CumulusMX/Reports folder to your Reports folder on your web host.
  • Make sure that the moon image is being uploaded to the Images folder on your web host.
  • Under 'Internet Settings ~ Web/Upload Site' on the default Interface make sure that the remote FTP Directory is sending to the public html folder where your HTM pages have been copied above.
  • Initiate an FTP/Upload on the Utilities menu of the Interface. (This may take time if you have a lot of data)
  • Upload the alternative default website zip file TO THE SAME place as the default website
  • Extract it to the current folder- it will not overwrite any of the existing pages or data.
  • Edit the 'ws-extra.js' file line 13: It should read:

    Code: Select all

    let dataPath = '';
Let me know how you get on. If required, I'll email you a new copy of the alternative website zip file just in case yours is corrupted.

Neil.

Re: Reworked default websites

Posted: Fri 12 Jan 2024 1:35 pm
by ConligWX
unfortunately websitedata.json isn't on the website hence the lack of weather data values being shown.

Capture.PNG

Re: Reworked default websites

Posted: Fri 12 Jan 2024 4:06 pm
by NeilThomas
ConligWX wrote: Fri 12 Jan 2024 1:35 pm unfortunately websitedata.json isn't on the website hence the lack of weather data values being shown.


Capture.PNG
Can you confirm that the option 'I want to use the default web site' is checked under 'Internet Options ~ Interval Configuration'. This will ensure that all the available data files are uploaded. It will be worth doing an FTP upload before you visit the site. It seems as though CumulusMX is not uploading the required data files.

Also make sure that both 'Normal Interval settings' checkboxes are checked and that the interval is what you want it to be. Under 'Standard File Settings' make sure that the website data.json option is checked for uploads.

Neil

Re: Reworked default websites

Posted: Sat 13 Jan 2024 5:20 am
by griffo42
Thank you, Trevor. Fixed.

Best wishes,

Re: Reworked default websites

Posted: Wed 21 Feb 2024 9:54 am
by HAT
Hello,

thanks first of all to Neil for the great new template.
This is exactly what I was looking for.

But I have a small problem:
I need a "divider" in the dropdown menus, i.e. a horizontal, thin line from the far left to the far right.

In the file "menu.js" the menus are defined.
Unfortunately, I have very, very little knowledge of Javascript.
In the CSS file "main.css" there is the class ".ow-divider".

But how do I call this class in Javascript?
Or is there another way for a "divider" or "separator"?

I hope someone can help me.
Thanks a lot!


Greetings to all
HAT

Re: Reworked default websites

Posted: Wed 21 Feb 2024 11:46 am
by NeilThomas
HAT wrote: Wed 21 Feb 2024 9:54 am Hello,

thanks first of all to Neil for the great new template.
This is exactly what I was looking for.

But I have a small problem:
I need a "divider" in the dropdown menus, i.e. a horizontal, thin line from the far left to the far right.

In the file "menu.js" the menus are defined.
Unfortunately, I have very, very little knowledge of Javascript.
In the CSS file "main.css" there is the class ".ow-divider".

But how do I call this class in Javascript?
Or is there another way for a "divider" or "separator"?

I hope someone can help me.
Thanks a lot!


Greetings to all
HAT
Hi

Right this can be done but it will require you to edit both the menu.js and the ws-extra.js files. First of all the menu which I assume is the default menu.js rather than the my-menu.js with I shipped with the website template. It won't matter which but do check line 16 of the ws-extra.js file to see which javascript to edit.

To add a divider to your menu simply add the following between the menu entries that need to be divided:

Code: Select all

{title: "",	 menu: "b",  url: "#"},
This adds a blank menu item.

Now for the ws-extra.js edits. (I would strongly recommend making a backup copy of the file before you start making changes so that if all goes pear shaped you can simply restore the backup). You need to edit the 'else' section of the 'if...else' block starting on line 131

Code: Select all

} else {
    if (itm.url == "#") {
        menu += '<div class="ow-divider"></div>';
    } else {
        menu += '<a href="' + itm.url + '"' + infill + ' class="' + (submenu ? classMainSub : classMain) + '">' + itm.title + '</a>\n';
    }
}
You also need to change the code starting at line 182 as well so that the divider is usable on mobile menus.

Its the first bit starting 'if ( its.url=="#) {...' that checks to see if the url is a # symbol, if it is then it inserts the required html rather than a menu entry. This starts on line 139 on my system.

To make the divider go all the way across the menu panel you may want to add 'margin:0 -1.3em; to the style .ow-divider in the main.css stylesheet. You can experiment with the actual value.

Hope that makes sense. Let me know if you have any difficulties.

Neil.

Re: Reworked default websites

Posted: Thu 22 Feb 2024 12:28 pm
by HAT
Neil, thanks for the quick and competent reply.
Everything is working fine. (see attachments)

The only thing I have changed:
"'margin: 0 -1.2em"
and I made the color of the divider a little lighter.

Great!

Best regards

HAT

Re: Reworked default websites

Posted: Thu 22 Feb 2024 2:24 pm
by NeilThomas
HAT wrote: Thu 22 Feb 2024 12:28 pm Neil, thanks for the quick and competent reply.
Everything is working fine. (see attachments)

The only thing I have changed:
"'margin: 0 -1.2em"
and I made the color of the divider a little lighter.

Great!

Best regards

HAT
Hi

Glad to have helped. I will probably adopt this for the next release as I am sure many others might like to do the same. One point I checked after my response was the the margin - I used 'vw' units for the padding in the menu so used '-1vw' as the margin for the divider. This should ensure that the divider correctly resizes on various screens.

Neil.

Re: Reworked default websites

Posted: Sun 25 Feb 2024 1:13 pm
by HAT
Hallo

Unfortunately, I rejoiced too soon...
Yesterday evening I changed the code for the mobile menus. Unfortunately no success. No "Divider" appears on the cell phone.
What did I do wrong?

Code: Select all

let createMobileMenu = function(src, submenu) {
    let classMobile = 'w3-bar-item w3-btn ow-theme-hvr';
    let styleMobile = submenu ? 'padding-left: 30px !important;' : '';

    src.forEach(function(itm) {
        if (itm.menu !== 'w') { // wanted in narrow menu
        // mobile menu
            if (itm.submenu) {
                mobileMenu += '<div class="w3-dropdown-click">\t<button id="' + itm.title + '" class="';
                mobileMenu += 'w3-btn w3-left-align ow-theme-hvr" onClick="toggleMenu(this)" style="width:100%;">' + 
                    itm.title + '&nbsp;<i class="fa-solid fa-caret-down fa-2xs ow-caret w3-left-align"></i></button>\n';

                mobileMenu += '<div class="w3-dropdown-content ow-card ow-theme-add4 w3-hide" id="menu' + itm.title + '">';

                createMobileMenu(itm.items, true);
                mobileMenu += '</div>\n</div>\n';
            } else {
                infill = (itm.new_window ? " target='_blank'" : "");
                if (itm.forum && cmxData.forumurl != '') {
                    mobileMenu += '<a href="' +  cmxData.forumurl + '"' + infill + ' class="' + classMobile + '" style= "' + styleMobile + '"> ' + itm.title + '</a>\n';
                } else if (itm.webcam && cmxData.webcamurl != '') {
                    mobileMenu += '<a href="' +  cmxData.webcamurl + '"' + infill + ' class="' + classMobile + '" style= "' + styleMobile + '">' + itm.title + '</a>\n';
                } else {
					if (itm.url == "#") {
						menu += '<div class="ow-divider"></div>';
					} else { 
                   mobileMenu += '<a href="' +  itm.url + '"' + infill + ' class="' + classMobile + '" style= "' + styleMobile + '">' + itm.title + '</a>\n';
					}
				}
            }
        }
 });
Then I noticed something else with the mobile menu:
When I open a menu item with submenus, the previously opened menu does not close.
This leads to unsightly overlapping effects. (See attachment)

Greetings to all
HAT

Re: Reworked default websites

Posted: Sun 25 Feb 2024 1:17 pm
by NeilThomas
HAT wrote: Sun 25 Feb 2024 1:13 pm Hallo

Unfortunately, I rejoiced too soon...
Yesterday evening I changed the code for the mobile menus. Unfortunately no success. No "Divider" appears on the cell phone.
What did I do wrong?

Code: Select all

let createMobileMenu = function(src, submenu) {
    let classMobile = 'w3-bar-item w3-btn ow-theme-hvr';
    let styleMobile = submenu ? 'padding-left: 30px !important;' : '';

    src.forEach(function(itm) {
        if (itm.menu !== 'w') { // wanted in narrow menu
        // mobile menu
            if (itm.submenu) {
                mobileMenu += '<div class="w3-dropdown-click">\t<button id="' + itm.title + '" class="';
                mobileMenu += 'w3-btn w3-left-align ow-theme-hvr" onClick="toggleMenu(this)" style="width:100%;">' + 
                    itm.title + '&nbsp;<i class="fa-solid fa-caret-down fa-2xs ow-caret w3-left-align"></i></button>\n';

                mobileMenu += '<div class="w3-dropdown-content ow-card ow-theme-add4 w3-hide" id="menu' + itm.title + '">';

                createMobileMenu(itm.items, true);
                mobileMenu += '</div>\n</div>\n';
            } else {
                infill = (itm.new_window ? " target='_blank'" : "");
                if (itm.forum && cmxData.forumurl != '') {
                    mobileMenu += '<a href="' +  cmxData.forumurl + '"' + infill + ' class="' + classMobile + '" style= "' + styleMobile + '"> ' + itm.title + '</a>\n';
                } else if (itm.webcam && cmxData.webcamurl != '') {
                    mobileMenu += '<a href="' +  cmxData.webcamurl + '"' + infill + ' class="' + classMobile + '" style= "' + styleMobile + '">' + itm.title + '</a>\n';
                } else {
					if (itm.url == "#") {
						menu += '<div class="ow-divider"></div>';
					} else { 
                   mobileMenu += '<a href="' +  itm.url + '"' + infill + ' class="' + classMobile + '" style= "' + styleMobile + '">' + itm.title + '</a>\n';
					}
				}
            }
        }
 });
Then I noticed something else with the mobile menu:
When I open a menu item with submenus, the previously opened menu does not close.
This leads to unsightly overlapping effects. (See attachment)

Greetings to all
HAT
Hi

At the moment you have to close a menu before you open another one. They don't automatically close just because you open another one. I will work on that in the near future.

Neil.

Re: Reworked default websites

Posted: Tue 27 Feb 2024 10:10 am
by HAT
Hello,

thanks for the reply.
I found the mistake. Now everything works.
For the mobile menu: "mobileMenu += '<div class="ow-divider"></div>';"

Stupid mistake on my part...

Best regards
HAT

Re: Reworked default websites

Posted: Sun 10 Mar 2024 9:58 pm
by ConligWX
Neil

I noticed on my site that the airquality values were not loading in chartstrends.html,

when I check charts.js is showed Line 1494:

Code: Select all

		url: dataPath + 'airqualitydata.json',
however I have airquality.json as the Daily Graph File Settings for airquality values in cumulusmx, and as soon as I changed Line 1494 to:

Code: Select all

		url: dataPath + 'airquality.json',
and the chart then worked. not sure how this was not noticed before now but I hadn't changed mine at all before now.

Re: Reworked default websites

Posted: Sat 16 Mar 2024 9:22 am
by The PIT
bumpy wrote: Tue 09 Jan 2024 11:21 am Good morning
I am having continuing problems in getting the Noaa reports to load to my website: www.farleighmeadows.co.uk. The website is working OK with all pages, except Reports, updating regularly. I did have a problem with the Records page but resolved this and it's now working well.

I have checked that in the server folder public_html there is a sub-folder Reports. This contains individual Noaa files from 2010 until now. When I open the individual files, the tabular data is there for the individual months and years. I am assuming that the data path to access these files is simply /Reports/ and this is the path that is shown in the CumulusMX webfiles folder and also the js folder. I have also tried the paths Reports/ and /public_html/Reports but this makes no difference.

The Noaa reports pages can be accessed and are uptodate on the basic dashboard and the Alternative Interface dashboard pages. This being so I am puzzled why the Default website doesn't show the data. When I look at the default website page it clearly shows that it is trying to access the data because at the bottom of the page it shows that the page data was updated within the last few minutes.

I am obviously missing something - can anyone suggest how to get over this problem.

Many thanks,

Tony
Just noticed your gauges web page isn't displaying properly. Resizes properly for a mobile but anything else the gauges are too large.