zoukankan      html  css  js  c++  java
  • OpenWrt超时检测

    参考http://www.right.com.cn/forum/thread-261702-1-1.html

    vim /home/ihid/chaos_calmer/feeds/luci/modules/luci-base/root/etc/config/luci
    

    修改sessiontime为自定义数值:

    config internal sauth
    	option sessionpath "/tmp/luci-sessions"
    	option sessiontime 3600
    

    修改/home/ihid/chaos_calmer/feeds/luci/themes/luci-theme-violet/luasrc/view/themes/violet/header.htm文件(取决于你用的是哪个主题),在里面添加一个js函数解决问题 :

    <script>
            var lastTime = new Date().getTime();
            var currentTime = new Date().getTime();
            var timeOut = 20 * 60 * 1000;
    
            window.onload=function (){
                    window.document.onmousemove=function(){
                            lastTime = new Date().getTime();
                    }
            };
            function testTime(){
                    currentTime = new Date().getTime(); 
                    if(currentTime - lastTime > timeOut){
                            console.log("TimeOut");
                            var tmp = 0;
                            document.onmousedown=function(event){ 
                                    if (tmp == 0){
                                            alert("操作超时,请重新登录!");
                                            window.location.href="/cgi-bin/luci";
                                            tmp = 1;
                                    }
                            }
                            document.onkeydown=function(event){
                                    if (tmp == 0){
                                            alert("操作超时,请重新登录!");
                                            window.location.href="/cgi-bin/luci";
                                            tmp = 1;
                                    }
                            }
                    }
            }
    
            window.setInterval(testTime, 1000);
    </script>
    
  • 相关阅读:
    postman使用
    web应用服务器性能监控及调优
    软件测试的相关网站
    web测试点梳理
    HTTP协议详解
    Fidder详解之get和post请求
    浅谈HTTPS协议
    APP测试基本流程
    Python 拷贝对象(深拷贝deepcopy与浅拷贝copy)
    为学日益,为道日损
  • 原文地址:https://www.cnblogs.com/ihid/p/9458541.html
Copyright © 2011-2022 走看看