Results 1 to 1 of 1

Thread: How to update the client's object properties in <div>?

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2003
    Posts
    782

    How to update the client's object properties in <div>?

    I'm developing a dashboard web app (ASP MVC Net Core 3.1), like the common dashboard app, some info will be processed at the backend and will update the dashboard periodically.

    example: Monitoring CPU usage %

    Code:
    <div class="text-uppercase mb-1"><small><b>CPU Usage</b></small></div>
         <div class="progress progress-xs">
              <div class="progress-bar bg-info" role="progressbar" style="width: 25%" aria-valuenow="25" aria-valuemin="0" aria-valuemax="100"></div>
              </div><small class="text-muted">Current Process % ${cpuUsage}.</small>

    e use WebSocket to communicate with the clients, so if for example, the client receives a string 'UPDATE_CPU_USAGE;30' then the dashboard value should be updated to 30 (in this case aria-valuenow must be updated to 30). Currently the client is already able to receive the strings from websocket, but I don't have an idea on how to update the client's object properties in a '<div>'

    the websocket listener is on the main page, how to update the '<div>' and the aria-valuenow of the other page in that located in javascript?



    need an idea.
    Last edited by Winanjaya; Jul 29th, 2021 at 06:47 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width