Opens popup window. Requires bootstrap css included There may be only 1 popup opened. If the page want to open another popup, the current one will be overwritten unless it’s class is higher than a new one.

btn2a function(arg) to run if button 2 (or escape) is pressed. arg is true if the button was pressed, false if escape key or auto close.

va validate function which runs before btn1a. if the function return true, the popup is closed and btn1a function is executed. otherwise the popup is kept and the function btn1a is not executed. va function is used to validate an input, if popup contains any input fields.

An important moment of the web interface chosen for automation systems is
reliability of the connection.

Common problems which may arise:

SFA server reboot and loss of session data.

Breaking the WebSocket connection due to front-end reboot or another reason.

To control the session, SFA Framework requests SFA API test
every eva_sfa_heartbeat_interval (5 seconds by default). WebSocket is
additionally controlled by the framework using { ‘s’: ‘ping’ } packet, whereto
the server should send a response { ‘s’: ‘pong’ }. If there is no response
within the time exceeding heartbeat interval, the connection is considered
broken.

In case of short-term problems with the server, it will be enough to set the
default value

eva_sfa_heartbeat_error=eva_sfa_restart;

and keep login/password in eva_sfa_login and eva_sfa_password
variables, or API key in eva_sfa_apikey. If an error occurs,
heartbeat will attempt to restart the framework once. If it fails or the
variable data has been deleted after the initial authorization, the function
specified in eva_sfa_cb_login_error will be called.

If your interface cleans up the authorization data, eva_sfa_heartbeat_error
should do the following:

eva_sfa_heartbeat_error=function(){// stop framework, make another attempt to log out// if the login/password were usedeva_sfa_stop(// your function that displays the authorization formshow_login_form);}

eva_sfa_cb_login_error=function(code,msg,data){if(code==2){// if the server returned error 2 (authentication failed// due to invalid auth data), the user should get a login formshow_login_form();}else{// in case of other errors - try to restart framework in 3 seconds// and attempt to connect againsetTimeout(eva_sfa_start,3*1000);}}