OpenWrt超时检测
2024-08-31 02:46:52
参考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>
最新文章
- C#图像处理笔记
- java-集合1
- iOS 模仿微信的照片选择器
- BZOJ 2287: 【POJ Challenge】消失之物( 背包dp )
- xamarin跨平台iOS、Android 与Windows
- webkit的几个属性
- Android之XListView下拉刷新,更新网络美女图
- 【转】JavaScript中使用ActiveXObject操作本地文件夹的方法
- #include、#import与@class的使用与头文件循环引用问题
- mysql修改连接数
- gcc编译参数详解一(-ffunction-sections -fdata-sections)
- Asp.net 获取访问者IP
- 设计模式之备忘录模式(Memento )
- 8 -- 深入使用Spring -- 6...3 使用@Transactional
- mybatis源码解析2---SqlSessionFactoryBuilder、SqlSessionFactory解析
- php优秀框架codeigniter学习系列——index.php
- CentOS7系统更换YUM Repo源
- HTML 之前未接触过的标签
- 【整理】STL中的bitset(二进制华丽解决假五维偏序题)
- 【ZZ】浅谈大型web系统架构 | 菜鸟教程