Files
RuoYi/ruoyi-admin/src/main/resources/templates/monitor/online/online.html

148 lines
4.7 KiB
HTML
Raw Normal View History

2018-07-09 08:44:52 +08:00
<!DOCTYPE html>
2019-03-31 12:56:04 +08:00
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
<th:block th:include="include :: header('在线用户列表')" />
</head>
2018-07-09 08:44:52 +08:00
<body class="gray-bg">
<div class="container-div">
<div class="row">
2018-10-01 21:32:01 +08:00
<div class="col-sm-12 search-collapse">
2018-07-15 20:39:59 +08:00
<form id="online-form">
2018-08-01 10:07:28 +08:00
<div class="select-list">
2018-07-09 08:44:52 +08:00
<ul>
<li>
登录地址:<input type="text" name="ipaddr"/>
</li>
<li>
登录名称:<input type="text" name="loginName"/>
2018-07-09 08:44:52 +08:00
</li>
<li>
2018-07-27 21:56:08 +08:00
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
2018-08-25 10:42:10 +08:00
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
2018-07-09 08:44:52 +08:00
</li>
</ul>
</div>
</form>
</div>
2019-02-28 20:52:07 +08:00
<div class="btn-group-sm" id="toolbar" role="group">
<a class="btn btn-danger multiple disabled" onclick="javascript:batchForceLogout()" shiro:hasPermission="monitor:online:batchForceLogout">
2018-10-05 18:43:41 +08:00
<i class="fa fa-sign-out"></i> 强退
2018-07-09 08:44:52 +08:00
</a>
</div>
2018-08-23 17:06:31 +08:00
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table"></table>
2018-07-09 08:44:52 +08:00
</div>
</div>
</div>
2019-03-31 12:56:04 +08:00
<th:block th:include="include :: footer" />
2018-07-09 08:44:52 +08:00
<script th:inline="javascript">
2018-07-22 23:05:50 +08:00
var forceFlag = [[${@permission.hasPermi('monitor:online:forceLogout')}]];
2018-10-05 19:27:24 +08:00
var prefix = ctx + "monitor/online";
2018-07-09 08:44:52 +08:00
$(function() {
var options = {
2019-06-10 17:21:53 +08:00
uniqueId: "sessionId",
2018-07-09 08:44:52 +08:00
url: prefix + "/list",
exportUrl: prefix + "/export",
sortName: "lastAccessTime",
sortOrder: "desc",
showExport: true,
2018-12-01 16:14:19 +08:00
escape: true,
2018-07-09 08:44:52 +08:00
columns: [{
checkbox: true
},
2018-12-28 17:33:15 +08:00
{
title: "序号",
formatter: function (value, row, index) {
return $.table.serialNumber(index);
}
},
2018-07-09 08:44:52 +08:00
{
field: 'sessionId',
title: '会话编号'
},
{
field: 'loginName',
2018-07-19 21:17:17 +08:00
title: '登录名称',
sortable: true
2018-07-09 08:44:52 +08:00
},
{
field: 'deptName',
title: '部门名称'
},
{
field: 'ipaddr',
title: '主机'
},
{
2019-02-15 17:49:34 +08:00
field: 'loginLocation',
2018-07-09 08:44:52 +08:00
title: '登录地点'
},
{
field: 'browser',
title: '浏览器'
},
{
field: 'os',
title: '操作系统'
},
{
field: 'status',
title: '会话状态',
align: 'center',
formatter: function(value, row, index) {
if (value == 'on_line') {
return '<span class="badge badge-primary">在线</span>';
} else if (value == 'off_line') {
return '<span class="badge badge-danger">离线</span>';
}
}
},
{
field: 'startTimestamp',
2018-07-19 21:17:17 +08:00
title: '登录时间',
sortable: true
2018-07-09 08:44:52 +08:00
},
{
field: 'lastAccessTime',
2018-07-19 21:17:17 +08:00
title: '最后访问时间',
sortable: true
2018-07-09 08:44:52 +08:00
},
{
title: '操作',
align: 'center',
formatter: function(value, row, index) {
2019-05-13 19:03:32 +08:00
var msg = '<a class="btn btn-danger btn-xs ' + forceFlag + '" href="javascript:void(0)" onclick="forceLogout(\'' + row.sessionId + '\')"><i class="fa fa-sign-out"></i>强退</a> ';
2018-07-09 08:44:52 +08:00
return msg;
}
}]
};
$.table.init(options);
});
// 单条强退
function forceLogout(sessionId) {
$.modal.confirm("确定要强制选中用户下线吗?", function() {
var data = { "sessionId": sessionId };
$.operate.post(prefix + "/forceLogout", data);
})
}
// 批量强退
function batchForceLogout() {
var rows = $.table.selectColumns("sessionId");
if (rows.length == 0) {
$.modal.alertWarning("请选择要强退的用户");
return;
}
$.modal.confirm("确认要强退选中的" + rows.length + "条数据吗?", function() {
var url = prefix + "/batchForceLogout";
var data = { "ids": rows };
$.operate.post(url, data);
});
}
</script>
</body>
</html>