200 lines
6.0 KiB
HTML
200 lines
6.0 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>个人帐户设置</title>
|
|
<link href="/lib/layui/css/layui.css" rel="stylesheet">
|
|
<script src="/lib/layui/layui.js"></script>
|
|
<script src="/assets/js/socket/socket.io.js"></script>
|
|
<link rel="stylesheet" href="/css/theme.css">
|
|
<style>
|
|
body {
|
|
font-family: Arial, sans-serif;
|
|
margin: 0;
|
|
padding: 0;
|
|
}
|
|
|
|
.container {
|
|
display: flex;
|
|
height: 100vh;
|
|
}
|
|
|
|
.sidebar {
|
|
width: 200px;
|
|
background-color: #f0f0f0;
|
|
padding: 20px;
|
|
position: relative;
|
|
overflow: hidden;
|
|
}
|
|
|
|
.sidebar ul {
|
|
list-style-type: none;
|
|
padding: 0;
|
|
margin: 0;
|
|
}
|
|
|
|
.sidebar li {
|
|
margin-bottom: 10px;
|
|
position: relative;
|
|
overflow: hidden;
|
|
}
|
|
|
|
.sidebar a {
|
|
text-decoration: none;
|
|
color: #333;
|
|
display: block;
|
|
padding: 10px;
|
|
border-radius: 5px;
|
|
position: relative;
|
|
transition: all 0.3s ease;
|
|
}
|
|
|
|
.sidebar a:hover {
|
|
background-color: #ddd;
|
|
}
|
|
|
|
.sidebar a.active {
|
|
background-color: #ddd;
|
|
}
|
|
|
|
.main-content {
|
|
flex: 1;
|
|
padding: 20px;
|
|
overflow-y: auto;
|
|
}
|
|
|
|
.profile-section {
|
|
display: flex;
|
|
align-items: center;
|
|
margin-bottom: 20px;
|
|
}
|
|
|
|
.profile-image {
|
|
width: 100px;
|
|
height: 100px;
|
|
border-radius: 50%;
|
|
background-color: #ccc;
|
|
margin-right: 20px;
|
|
display: flex;
|
|
justify-content: center;
|
|
align-items: center;
|
|
}
|
|
|
|
.profile-image img {
|
|
max-width: 80%;
|
|
max-height: 80%;
|
|
}
|
|
|
|
.profile-info {
|
|
flex: 1;
|
|
}
|
|
|
|
.profile-info p {
|
|
margin: 5px 0;
|
|
display: flex;
|
|
align-items: center;
|
|
}
|
|
|
|
.profile-info p strong {
|
|
width: 100px;
|
|
}
|
|
|
|
.edit-link {
|
|
color: blue;
|
|
cursor: pointer;
|
|
text-decoration: underline;
|
|
margin-left: 10px;
|
|
}
|
|
|
|
.form-section {
|
|
margin-top: 20px;
|
|
}
|
|
|
|
.form-section label {
|
|
display: block;
|
|
margin-bottom: 5px;
|
|
}
|
|
|
|
.form-section input[type="text"],
|
|
.form-section input[type="password"],
|
|
.form-section select {
|
|
width: 100%;
|
|
padding: 10px;
|
|
margin-bottom: 15px;
|
|
border: 1px solid #ccc;
|
|
border-radius: 5px;
|
|
}
|
|
|
|
.form-section input[type="radio"] {
|
|
margin-right: 5px;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<script>
|
|
var socket = io();
|
|
</script>
|
|
<div class="container">
|
|
<div class="sidebar">
|
|
<ul>
|
|
<li><a href="#ProgramSettings" class="active">程序设置</a></li>
|
|
<li><a href="#WindowSettings">窗口设置</a></li>
|
|
</ul>
|
|
</div>
|
|
<div class="main-content">
|
|
<div id="ProgramSettings" class="content-section">
|
|
<h2>程序设置</h2>
|
|
<div class="layui-card">
|
|
<div class="layui-card-body">
|
|
<div class="layui-form" wid100="" lay-filter="">
|
|
<div class="layui-row">
|
|
<div class="layui-col-md9">
|
|
<div class="layui-form-item">
|
|
<label class="layui-form-label">程序名称</label>
|
|
<div class="layui-input-block">
|
|
<input type="text" id="Program|Name" name="Program|Name" value="Loading..." class="layui-input">
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="layui-col-md3">
|
|
<div class="layui-form-item">
|
|
<div class="layui-input-block">
|
|
<button class="layui-btn" lay-submit="" lay-filter="set_website" onclick="socket.emit('WriteConfig', {'Program|Name': {'info':document.getElementById('Program|Name').value, 'type': 'str'}})">确认保存</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<script>
|
|
socket.on('CAPSettingLoad', function (data) {
|
|
for (key in data) {
|
|
document.getElementById(key).value=data[key];
|
|
}
|
|
});
|
|
const links = document.querySelectorAll('.sidebar a');
|
|
const sections = document.querySelectorAll('.content-section');
|
|
|
|
links.forEach((link, index) => {
|
|
link.addEventListener('click', (e) => {
|
|
e.preventDefault();
|
|
sections.forEach((section) => {
|
|
section.style.display = 'none';
|
|
});
|
|
sections[index].style.display = 'block';
|
|
// 移除所有链接的.active类
|
|
links.forEach((l) => {
|
|
l.classList.remove('active');
|
|
});
|
|
// 为当前点击的链接添加.active类
|
|
link.classList.add('active');
|
|
});
|
|
});
|
|
</script>
|
|
</body>
|
|
</html> |