News:

  • October 14, 2025, 10:37:47 AM

Login with username, password and session length

Author Topic: UserPages Example  (Read 2159 times)

RBPLC

  • Hero Member
  • *****
  • Posts: 585
UserPages Example
« on: December 09, 2020, 05:26:41 PM »
franji,
Do you think it would be possible to work up an example file to help me get going with the UserPages feature? I'm but a lowly simpleton and haven't done much web programming. This for me was one feature I was very interested in but don't really know how to get started. Maybe something that showed the status of X0 and Y0?

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6126
  • Yes Pinky, Do-more will control the world!
Re: UserPages Example
« Reply #1 on: December 10, 2020, 10:01:25 AM »
The full plan is to have an instruction that generates pages for the user. We were not able to get that done, but decided to leave the user page access in for any who might be sufficiently skilled as to make use of it.

The pages are probably still too complex to your liking, but you can see what goes into the pages the PLC is generating by viewing the page source. From your browser, right click on the page. Depending on browser, the menu item will be different, but it should be pretty clear which one you want. On anything derived from Chrome (including Brave) it's View Page Source. Inspect opens the developer tools that let you really dig in.

Hopefully in the next release we'll have that instruction.
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO

ATU

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 2126
  • YKPAIHA
    • ATU, Inc.
Re: UserPages Example
« Reply #2 on: December 10, 2020, 02:16:04 PM »
Sea Monkey has a nice simple low level composer and easy to use. My wife can even use it.

Bolt

  • Hero Member
  • *****
  • Posts: 591
Re: UserPages Example
« Reply #3 on: December 11, 2020, 09:49:31 AM »
The pages are probably still too complex to your liking, but you can see what goes into the pages the PLC is generating by viewing the page source. From your browser, right click on the page. Depending on browser, the menu item will be different, but it should be pretty clear which one you want. On anything derived from Chrome (including Brave) it's View Page Source. Inspect opens the developer tools that let you really dig in.

That doesn't really show the "magic", as most of that seems to be preformed server side, so it doesn't show how it's pulling the data into these tables.  Just the HTML tables, along with a script that does the refresh interval.

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6126
  • Yes Pinky, Do-more will control the world!
Re: UserPages Example
« Reply #4 on: December 11, 2020, 09:52:14 AM »
The pages are probably still too complex to your liking, but you can see what goes into the pages the PLC is generating by viewing the page source. From your browser, right click on the page. Depending on browser, the menu item will be different, but it should be pretty clear which one you want. On anything derived from Chrome (including Brave) it's View Page Source. Inspect opens the developer tools that let you really dig in.

That doesn't really show the "magic", as most of that seems to be preformed server side, so it doesn't show how it's pulling the data into these tables.  Just the HTML tables, along with a script that does the refresh interval.

It's all there. Data comes in via the JavaScript code at the bottom of the page. In many cases it uses the REST API. In few there is some server side magic, but not for things you care about.
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO

Bolt

  • Hero Member
  • *****
  • Posts: 591
Re: UserPages Example
« Reply #5 on: December 11, 2020, 05:07:02 PM »
The pages are probably still too complex to your liking, but you can see what goes into the pages the PLC is generating by viewing the page source. From your browser, right click on the page. Depending on browser, the menu item will be different, but it should be pretty clear which one you want. On anything derived from Chrome (including Brave) it's View Page Source. Inspect opens the developer tools that let you really dig in.

That doesn't really show the "magic", as most of that seems to be preformed server side, so it doesn't show how it's pulling the data into these tables.  Just the HTML tables, along with a script that does the refresh interval.

It's all there. Data comes in via the JavaScript code at the bottom of the page. In many cases it uses the REST API. In few there is some server side magic, but not for things you care about.

Doh, wouldn't you know it, it's all there.  I first glanced at the SysLog page, and found it underwhelming.  But, it does show a fetch("/data/sess"). The other pages have much more to look at.

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6126
  • Yes Pinky, Do-more will control the world!
Re: UserPages Example
« Reply #6 on: December 11, 2020, 11:42:47 PM »
Doh, wouldn't you know it, it's all there.  I first glanced at the SysLog page, and found it underwhelming.  But, it does show a fetch("/data/sess"). The other pages have much more to look at.

SysLog data isn't in image register memory, so it needs magic. There are one or two other areas where, for efficiency, the server preps the data, but most things use the same API available to you.

Still not easy for amateurs, but doable with effort. The instruction coming later will be the easy button.
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO