Logic Machine Forum
Clear the Alert page from the visualization - Printable Version

+- Logic Machine Forum (https://forum.logicmachine.net)
+-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1)
+--- Forum: Visualization (https://forum.logicmachine.net/forumdisplay.php?fid=9)
+--- Thread: Clear the Alert page from the visualization (/showthread.php?tid=509)



Clear the Alert page from the visualization - cekca - 13.12.2016

there is a way to clear the alert page from visualization...??? 
maybe with a POST method..???

Thanks


RE: Clear the Alert page from the visualization - Erwin van der Zwart - 13.12.2016

Hi Cekca,

Here is a post command to clear the alerts, it sends same command when pushing the button on the backend.

Code:
require('json')
require('socket.url')
require('socket.http')

fields = {
 alerts = true,
}

data = json.encode(fields)
post = 'data=' .. socket.url.escape(data)

ip = '127.0.0.1'
username = 'admin'
password = 'admin'

res, err = socket.http.request('http://' .. username .. ':' .. password .. '@' .. ip .. '/scada-main/general/reset', post)
log(res, err)

BR,

Erwin


RE: Clear the Alert page from the visualization - cekca - 14.12.2016

Thank you Erwin...
After the reset is possible to force the reload of the alerts page...??? i don't want to wait the refresh of the frame.

Marco


RE: Clear the Alert page from the visualization - Erwin van der Zwart - 14.12.2016

Hi Marco,

Yes can be done but not simple..

Refresh is client side, so you must attach a listener to your button with custom javascript and make a function to find your iframe and perform the reload in that frame.

Can you do that?

BR,

Erwin


RE: Clear the Alert page from the visualization - cekca - 14.12.2016

no problem, i'll reduce the refresh time of the frame...


RE: Clear the Alert page from the visualization - PassivPluss - 01.02.2017

I tried this script earlier but it was not working. Can anyone of you post a picture of how the page will look when it is made. I need to use an alert page in a project and it would be nice to see it Smile


RE: Clear the Alert page from the visualization - CHOUAIBOU - 02.02.2017

(01.02.2017, 21:26)PassivPluss Wrote: I tried this script earlier but it was not working. Can anyone of you post a picture of how the page will look when it is made. I need to use an alert page in a project and it would be nice to see it Smile

Hi PassivPluss,

The page will be blank (without any alert message)


RE: Clear the Alert page from the visualization - Erwin van der Zwart - 02.02.2017

Hi,

I have created a alert app for this, and send it to EMBS for appstore. I have no idea what the status is for publishing and if they are planning to publish it..

See screenshot (:

BR,

Erwin


RE: Clear the Alert page from the visualization - buuuudzik - 02.02.2017

Nice screen and for sure nice appWink


RE: Clear the Alert page from the visualization - cekca - 02.02.2017

AMAZING..!!! When will be available...??? Tongue


RE: Clear the Alert page from the visualization - edgars - 02.02.2017

we will adjust and place the app in the store very soon.


RE: Clear the Alert page from the visualization - edgars - 03.02.2017

Alerts Manager can be already downloaded from app store.


RE: Clear the Alert page from the visualization - Erwin van der Zwart - 03.02.2017

(03.02.2017, 13:11)edgars Wrote: Alerts Manager can be already downloaded from app store.

Please wait or update again later, Edgars used a old version (oeps i probably never send latest version sorry) 

New version is on it's way!

BR,

Erwin


RE: Clear the Alert page from the visualization - emdolivier - 05.07.2019

Is there a script that we can sent a acknowledge


RE: Clear the Alert page from the visualization - Erwin van der Zwart - 05.07.2019

Hi,

Yes you can do that with custom JS (in this sample by bit object with address 1/1/1) and used in a iframe:
Code:
$(function(){
 $(document).ready(function() {      
   var f= $('iframe');
   f.load(function(){
     if (typeof grp != 'undefined') {
          grp.listen('1/1/1', function(object, state) {
            if (state == 'value' && object.value == true ){
               f.contents().find('#AcknowledgeButton').click();
            }
         }, true);
     }
     });
  });
});
BR,

Erwin