87 lines
3.5 KiB
Smarty
87 lines
3.5 KiB
Smarty
<!DOCTYPE html>
|
||
<html lang="zh-CN">
|
||
<head>
|
||
<meta charset="UTF-8">
|
||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||
<title>在线设备 - 统一认证中心</title>
|
||
<style>
|
||
* { box-sizing: border-box; margin: 0; padding: 0; }
|
||
body {
|
||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
|
||
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
||
min-height: 100vh; display: flex; align-items: center; justify-content: center;
|
||
padding: 20px 0;
|
||
}
|
||
.card {
|
||
background: #fff; border-radius: 12px; box-shadow: 0 20px 60px rgba(0,0,0,.2);
|
||
width: 560px; max-width: 92vw; padding: 36px 32px;
|
||
}
|
||
h1 { font-size: 20px; color: #1a1a2e; margin-bottom: 6px; }
|
||
.sub { font-size: 13px; color: #8a8fa3; margin-bottom: 20px; }
|
||
.msg { padding: 10px 12px; border-radius: 6px; font-size: 13px; margin-bottom: 16px; }
|
||
.msg.ok { background: #f0fff4; border: 1px solid #b7ebc8; color: #189a4a; }
|
||
.msg.err { background: #fff2f0; border: 1px solid #ffccc7; color: #cf1322; }
|
||
.item {
|
||
display: flex; align-items: center; justify-content: space-between;
|
||
padding: 14px 16px; border: 1px solid #e4e7ee; border-radius: 8px; margin-bottom: 10px;
|
||
}
|
||
.item.current { border-color: #667eea; background: #f7f8ff; }
|
||
.device { font-size: 15px; color: #1a1a2e; font-weight: 500; }
|
||
.meta { font-size: 12px; color: #8a8fa3; margin-top: 4px; line-height: 1.6; }
|
||
.tag {
|
||
display: inline-block; font-size: 11px; padding: 1px 8px; border-radius: 10px;
|
||
background: #eef1ff; color: #667eea; margin-left: 6px;
|
||
}
|
||
.btn {
|
||
padding: 7px 14px; border-radius: 6px; border: 1px solid #dcdfe8;
|
||
background: #fff; color: #8a8fa3; font-size: 13px; cursor: pointer; text-decoration: none;
|
||
white-space: nowrap;
|
||
}
|
||
.btn:hover { border-color: #cf1322; color: #cf1322; }
|
||
.empty { text-align: center; color: #8a8fa3; font-size: 13px; padding: 30px 0; }
|
||
.footer { text-align: center; margin-top: 18px; display: flex; gap: 18px; justify-content: center; }
|
||
.footer a { font-size: 13px; color: #667eea; text-decoration: none; cursor: pointer; }
|
||
</style>
|
||
</head>
|
||
<body>
|
||
<div class="card">
|
||
<h1>在线设备</h1>
|
||
<div class="sub">这里是当前账号的登录设备,发现异常可立即下线</div>
|
||
|
||
{{if .Success}}<div class="msg ok">{{.Success}}</div>{{end}}
|
||
{{if .Error}}<div class="msg err">{{.Error}}</div>{{end}}
|
||
|
||
{{if .Sessions}}
|
||
{{range .Sessions}}
|
||
<div class="item {{if .Current}}current{{end}}">
|
||
<div>
|
||
<div class="device">
|
||
{{.Device}}
|
||
{{if .Current}}<span class="tag">当前设备</span>{{end}}
|
||
{{if .Expired}}<span class="tag">已过期</span>{{end}}
|
||
</div>
|
||
<div class="meta">
|
||
应用:{{.Client}} · IP:{{.IP}}<br>
|
||
登录:{{.LoginAt}} · 最近活跃:{{.LastAt}}
|
||
</div>
|
||
</div>
|
||
{{if .Current}}
|
||
<span class="btn" style="opacity:.5;cursor:default">使用中</span>
|
||
{{else}}
|
||
<a class="btn" href="/auth/devices/kick?sid={{.Sid}}"
|
||
onclick="return confirm('确定将该设备下线吗?')">下线</a>
|
||
{{end}}
|
||
</div>
|
||
{{end}}
|
||
{{else}}
|
||
<div class="empty">暂无在线设备</div>
|
||
{{end}}
|
||
|
||
<div class="footer">
|
||
<a href="/auth/bind">第三方账号</a>
|
||
<a href="/auth/logout">退出登录</a>
|
||
</div>
|
||
</div>
|
||
</body>
|
||
</html>
|