Logic Machine Forum
Screen timeout/log out - 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: Screen timeout/log out (/showthread.php?tid=3458)



Screen timeout/log out - MarcusH - 02.07.2021

Hi

I've been searching the forum, but can't find a solution to my problem.

It might be a out of the box feature in visu, but I can't seem to find it. 
I've set a pin code on the plan for the visu, and when I restart the panel which the customer is using they have to enter the pin which is how it's supposed to be working, but the problem is that it never logsout/timeout. 

I can't use the logout feature in link since it logs it out of the visu application (/apps). I only want it to "lock" the screen so the customer has to reenter the pincode to access the screen again.

-Marcus H


RE: Screen timeout/log out - admin - 02.07.2021

Try changing $(location).attr("href", "/logout"); to window.location.reload(); in your script.


RE: Screen timeout/log out - MarcusH - 05.07.2021

(02.07.2021, 15:30)admin Wrote: Try changing $(location).attr("href", "/logout"); to window.location.reload(); in your script.

Hi

Sorry, but im not sure where I should do this? In javascript?


RE: Screen timeout/log out - Daniel - 05.07.2021

Admin is refereeing to the logout script available in the forum.

Code:
$(function() {
 
  // Back to Start after x seconds (in miliseconds)
  var SE_Timeout = 9000; // adjust this timer value if needed (90 seconds in miliseconds)
  var SE_Startpage = currentPlanId; // First page that is loaded
  var eventlist = 'vclick vmousedown vmouseout touchend';
 
  // Timer function no usage detected
  function No_Usage_Detected(callback, timeout, _this) {
    var timer;
    return function(e) {
        var _that = this;
        if (timer)
            clearTimeout(timer);
        timer = setTimeout(function() {
            callback.call(_this || _that, e);
        }, timeout);
    }
  }

  // Back to start function when timer elapsed
    var SE_Goto_Startpage = No_Usage_Detected(function(e) {
    if ( currentPlanId != SE_Startpage ) {
    showPlan(SE_Startpage);
    window.location.reload();
    }
  }, SE_Timeout);
 
  // Add event listener to document to detect user input
  $(document)
  .on(eventlist, function() {
    SE_Goto_Startpage();
  });

  // Add event listener to all iframes to detect user input inside iframes
  $('iframe').load(function() {
    var iframe = $('iframe').contents().find('html');
    iframe.on(eventlist, function(event) {
     SE_Goto_Startpage();
    });
  });

});



RE: Screen timeout/log out - MarcusH - 05.07.2021

(05.07.2021, 09:31)Daniel. Wrote: Admin is refereeing to the logout script available in the forum.

Code:
$(function() {
 
  // Back to Start after x seconds (in miliseconds)
  var SE_Timeout = 9000; // adjust this timer value if needed (90 seconds in miliseconds)
  var SE_Startpage = currentPlanId; // First page that is loaded
  var eventlist = 'vclick vmousedown vmouseout touchend';
 
  // Timer function no usage detected
  function No_Usage_Detected(callback, timeout, _this) {
    var timer;
    return function(e) {
        var _that = this;
        if (timer)
            clearTimeout(timer);
        timer = setTimeout(function() {
            callback.call(_this || _that, e);
        }, timeout);
    }
  }

  // Back to start function when timer elapsed
    var SE_Goto_Startpage = No_Usage_Detected(function(e) {
    if ( currentPlanId != SE_Startpage ) {
    showPlan(SE_Startpage);
    window.location.reload();
    }
  }, SE_Timeout);
 
  // Add event listener to document to detect user input
  $(document)
  .on(eventlist, function() {
    SE_Goto_Startpage();
  });

  // Add event listener to all iframes to detect user input inside iframes
  $('iframe').load(function() {
    var iframe = $('iframe').contents().find('html');
    iframe.on(eventlist, function(event) {
     SE_Goto_Startpage();
    });
  });

});

I see, i'll try this then. Thanks Smile

The script kinda works, it sets the page back to main page after elapsed time. 

But it doesn't lock it so you have to re-enter the pin code

(05.07.2021, 11:43)MarcusH Wrote:
(05.07.2021, 09:31)Daniel. Wrote: Admin is refereeing to the logout script available in the forum.

Code:
$(function() {
 
  // Back to Start after x seconds (in miliseconds)
  var SE_Timeout = 9000; // adjust this timer value if needed (90 seconds in miliseconds)
  var SE_Startpage = currentPlanId; // First page that is loaded
  var eventlist = 'vclick vmousedown vmouseout touchend';
 
  // Timer function no usage detected
  function No_Usage_Detected(callback, timeout, _this) {
    var timer;
    return function(e) {
        var _that = this;
        if (timer)
            clearTimeout(timer);
        timer = setTimeout(function() {
            callback.call(_this || _that, e);
        }, timeout);
    }
  }

  // Back to start function when timer elapsed
    var SE_Goto_Startpage = No_Usage_Detected(function(e) {
    if ( currentPlanId != SE_Startpage ) {
    showPlan(SE_Startpage);
    window.location.reload();
    }
  }, SE_Timeout);
 
  // Add event listener to document to detect user input
  $(document)
  .on(eventlist, function() {
    SE_Goto_Startpage();
  });

  // Add event listener to all iframes to detect user input inside iframes
  $('iframe').load(function() {
    var iframe = $('iframe').contents().find('html');
    iframe.on(eventlist, function(event) {
     SE_Goto_Startpage();
    });
  });

});

I see, i'll try this then. Thanks Smile

The script kinda works, it sets the page back to main page after elapsed time. 

But it doesn't lock it so you have to re-enter the pin code

My fault, i had set the pin on wrong plan. It works now Smile