找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
广告投放联系QQ68610888
查看: 4659|回复: 4

luci超时退出的问题

[复制链接]
发表于 2017-11-20 18:18 | 显示全部楼层 |阅读模式
1.luci的配置文件里面有一个sessiontime,用来配置页面超时时间,如下图
  1. cat /etc/config/luci

  2. config core 'main'
  3.         option lang 'zh_cn'
  4.         option mediaurlbase '/luci-static/bootstrap'
  5.         option resourcebase '/luci-static/resources'

  6. config extern 'flash_keep'
  7.         option uci '/etc/config/'
  8.         option dropbear '/etc/dropbear/'
  9.         option openvirtual** '/etc/openvirtual**/'
  10.         option passwd '/etc/passwd'
  11.         option opkg '/etc/opkg.conf'
  12.         option firewall '/etc/firewall.user'
  13.         option uploads '/lib/uci/upload/'

  14. config internal 'languages'
  15.         option zh_cn 'chinese'
  16.         option en 'English'

  17. config internal 'sauth'
  18.         option sessionpath '/tmp/luci-sessions'
  19.         option sessiontime '1200'

  20. config internal 'ccache'
  21.         option enable '1'

  22. config internal 'themes'
  23.         option OpenWrt '/luci-static/openwrt.org'
  24.     option Bootstrap '/luci-static/bootstrap'
复制代码


问题是有些页面像实时信息,状态页面,以及网络接口,无线页面,这些页面会一直从刷新数据,超时到了也不会退出?
问下:这个有没有其他解决办法啊。
我的恩山、我的无线 The best wifi forum is right here.
发表于 2017-11-20 18:24 | 显示全部楼层
有时候确实感觉反应有些慢。用chrome好点儿。

点评

不是浏览器的问题,是有些页面超时了一直不会退出  详情 回复 发表于 2017-11-20 20:39
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| 发表于 2017-11-20 20:39 | 显示全部楼层
xfbktc 发表于 2017-11-20 18:24
有时候确实感觉反应有些慢。用chrome好点儿。

不是浏览器的问题,是有些页面超时了一直不会退出
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| 发表于 2018-1-29 16:07 | 显示全部楼层
修改themes/bootstrap/luasrc/view/themes/bootstrap/header.htm文件,在里面添加一个js函数解决问题

  1. <script>
  2.         var lastTime = new Date().getTime();
  3.         var currentTime = new Date().getTime();
  4.         var timeOut = 20 * 60 * 1000;

  5.         window.onload=function (){
  6.                 window.document.onmousemove=function(){
  7.                         lastTime = new Date().getTime();
  8.                 }
  9.         };
  10.         function testTime(){
  11.                 currentTime = new Date().getTime();
  12.                 if(currentTime - lastTime > timeOut){
  13.                         console.log("TimeOut");
  14.                         var tmp = 0;
  15.                         document.onmousedown=function(event){
  16.                                 if (tmp == 0){
  17.                                         alert("操作超时,请重新登录!");
  18.                                         window.location.href="/cgi-bin/luci";
  19.                                         tmp = 1;
  20.                                 }
  21.                         }
  22.                         document.onkeydown=function(event){
  23.                                 if (tmp == 0){
  24.                                         alert("操作超时,请重新登录!");
  25.                                         window.location.href="/cgi-bin/luci";
  26.                                         tmp = 1;
  27.                                 }
  28.                         }
  29.                 }
  30.         }

  31.         window.setInterval(testTime, 1000);
  32. </script>
复制代码
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2018-6-2 14:20 | 显示全部楼层
很好地解决了我的问题
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

有疑问请添加管理员QQ86788181|手机版|小黑屋|Archiver|恩山无线论坛(常州市恩山计算机开发有限公司版权所有) ( 苏ICP备05084872号 )

GMT+8, 2024-3-29 00:17

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

| 江苏省互联网有害信息举报中心 举报信箱:js12377 | @jischina.com.cn 举报电话:025-88802724 本站不良内容举报信箱:68610888@qq.com 举报电话:0519-86695797

快速回复 返回顶部 返回列表