-
Notifications
You must be signed in to change notification settings - Fork 0
/
banlist.html
301 lines (285 loc) · 15.9 KB
/
banlist.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
<!DOCTYPE html>
<html lang="en">
<script charset="UTF-8" id="LA_COLLECT" src="//sdk.51.la/js-sdk-pro.min.js"></script>
<script>LA.init({id:"3KHLjg97pxmoUlOB",ck:"3KHLjg97pxmoUlOB"})</script>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="referrer" content="no-referrer">
<title>封禁名单-KukeMC-我的世界服务器(Minecraft)</title>
<link href="static/css/bootstrap.css" rel="stylesheet">
<link href="static/css/styles.css" rel="stylesheet">
<link rel="icon" href="https://m.ccw.site/gandi_application/user_assets/2a6bb37880317d2bb5525ab560618e04.png">
</head>
<body data-spy="scroll" data-target=".fixed-top">
<!-- Preloader -->
<div class="spinner-wrapper">
<div class="spinner">
<div class="bounce1"></div>
<div class="bounce2"></div>
<div class="bounce3"></div>
</div>
</div>
<!-- end of preloader -->
<!-- Navbar -->
<div id="navbar"></div>
<!-- Header -->
<header id="header" class="ex-header">
<div class="container">
<div class="row">
<div class="col-lg-12">
<h1>KukeMC - 封禁列表</h1>
</div>
</div>
</div>
</header>
<!-- end of header -->
<!-- Breadcrumbs -->
<div class="ex-basic-1">
<div class="container">
<div class="row">
<div class="col-lg-12">
<div class="breadcrumbs">
<a href="index.html">首页</a><span> > 封禁名单</span>
</div>
</div>
</div>
</div>
</div>
<!-- end of breadcrumbs -->
<!-- Terms Content -->
<div class="ex-basic-2">
<div class="container">
<div class="row">
<div class="col-lg-12">
<div class="text-container">
<style>
@media (min-width: 1300px) {
.container {
max-width: 1300px;
}
}
table {
width: 100%;
border-collapse: separate;
border-spacing: 0 0px;
font-family: Arial, sans-serif;
}
th, td {
padding: 12px;
text-align: left;
}
th {
background-color: #fff;
font-weight: bold;
text-align: center;
font-size: 16px;
border-bottom: 2px solid #ddd;
}
td {
text-align: center;
padding: 18px;
}
.ban-type {
color: white;
background-color: red;
padding: 5px 10px;
border-radius: 5px;
font-weight: bold;
}
.avatar {
width: 30px;
height: 30px;
}
.highlight {
color: red;
font-weight: bold;
}
tbody tr + tr {
margin-top: 0;
}
tbody td {
border-bottom: 1px solid #ddd;
}
.pagination-container {
margin-top: 20px;
text-align: center;
position: absolute; /* 使用绝对定位 */
bottom: 140px; /* 定位到底部 */
width: 100%; /* 占满整个容器宽度 */
}
.pagination-container button {
padding: 10px 20px;
margin: 0 15px; /* 调整按钮之间的间距 */
color: #fff;
background-color: #007bff;
border: 1px solid #007bff;
border-radius: 5px;
font-weight: bold;
cursor: pointer;
transition: all 0.3s ease-in-out;
}
.pagination-container button:disabled {
background-color: #cccccc;
border-color: #cccccc;
cursor: not-allowed;
}
.pagination-container button:hover {
background-color: #0056b3;
border-color: #0056b3;
}
.pagination-container button:disabled:hover {
background-color: #cccccc;
border-color: #cccccc;
}
.ex-basic-2 {
display: flex;
flex-direction: column;
justify-content: space-between;
min-height: 0vh;
}
</style>
<h1>封禁名单</h1>
<p>以下为 KukeMC 服务器封禁名单,如有任何疑问请联系管理员。</p>
<div id="loadingIndicator" style="text-align: center; margin: 20px;">
<p>正在加载封禁列表,请稍候...</p>
</div>
<table id="banListTable" style="display: none;">
<thead>
<tr>
<th>类型</th>
<th>玩家</th>
<th>处理者</th>
<th>原因</th>
<th>处理日期</th>
<th>过期时间</th>
<th>处罚范围</th>
</tr>
</thead>
<tbody id="banListBody">
</tbody>
</table>
<div class="pagination-container">
<button id="prevPage" onclick="changePage(-1)" disabled>上一页</button>
<span id="pageInfo">1/1</span>
<button id="nextPage" onclick="changePage(1)">下一页</button>
</div>
<script>
let currentPage = 1;
const itemsPerPage = 10;
let totalItems = 0;
let data = []; // 存储从API获取的数据
// 格式化日期的函数
function formatDate(dateString) {
const cleanedString = dateString.replace(" +0800", "");
const date = new Date(cleanedString);
if (isNaN(date)) {
return "Invalid Date";
}
const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, '0');
const day = String(date.getDate()).padStart(2, '0');
const hours = String(date.getHours()).padStart(2, '0');
const minutes = String(date.getMinutes()).padStart(2, '0');
const seconds = String(date.getSeconds()).padStart(2, '0');
return `${year}-${month}-${day}<br>${hours}:${minutes}:${seconds}`;
}
// 页面加载完成后调用API
document.addEventListener('DOMContentLoaded', function() {
fetch('https://api.kuke.ink/api/banlist')
.then(response => response.json())
.then(jsonData => {
data = jsonData;
totalItems = data.length;
displayPage(currentPage);
// 隐藏加载提示,显示封禁列表
document.getElementById('loadingIndicator').style.display = 'none';
document.getElementById('banListTable').style.display = 'table';
})
.catch(error => {
console.error('Error:', error);
document.getElementById('loadingIndicator').textContent = '加载失败,请重试。';
});
});
function displayPage(page) {
const banListBody = document.getElementById('banListBody');
banListBody.innerHTML = ''; // 清空现有列表
const startIndex = (page - 1) * itemsPerPage;
const endIndex = startIndex + itemsPerPage;
const displayedItems = data.slice(startIndex, endIndex);
displayedItems.forEach(ban => {
let row = document.createElement('tr');
row.innerHTML = `
<td><span class="ban-type">封禁</span></td>
<td><img src="https://crafthead.net/avatar/${ban.name}" alt="${ban.name}'s avatar" class="avatar" style="margin-top: 3px; margin-bottom: 1px;"><br>${ban.name}</td>
<td>
${ban.source === '控制台'
? `<img src="https://m.ccw.site/gandi_application/user_assets/b23d1f215b69e9782b51a2a324b9469e.png" alt="${ban.source}" class="avatar" style="margin-top: 3px; margin-bottom: 1px;"></img><br>${ban.source}`
: `<img src="https://crafthead.net/avatar/${ban.source}" alt="${ban.source}" class="avatar" style="margin-top: 3px; margin-bottom: 1px;"></img><br>${ban.source}`
}
</td>
<td style="max-width: 400px;">KukeMC | ${ban.reason}</td>
<td>${formatDate(ban.created)}</td>
<td>
${ban.expires === "forever"
? (ban.active === 0
? '<span class="highlight">永久封禁 (已解封 | 处理者: ' + ban.removed_by_name + ')</span>'
: '<span class="highlight">永久封禁</span>')
: (ban.active === 0
? formatDate(ban.created) + ' (已解封 | 处理者: ' + ban.removed_by_name + ')'
: formatDate(ban.expires))
}
</td>
<td>${ban.server_scope}</td>
`;
banListBody.appendChild(row);
});
updatePagination(page);
}
function updatePagination(page) {
const prevButton = document.getElementById('prevPage');
const nextButton = document.getElementById('nextPage');
const pageInfo = document.getElementById('pageInfo');
const totalPages = Math.ceil(totalItems / itemsPerPage);
pageInfo.textContent = `${page}/${totalPages}`;
if (page === 1) {
prevButton.disabled = true;
} else {
prevButton.disabled = false;
}
if (page === totalPages) {
nextButton.disabled = true;
} else {
nextButton.disabled = false;
}
}
function changePage(direction) {
const newPage = currentPage + direction;
if (newPage >= 1 && newPage <= Math.ceil(totalItems / itemsPerPage)) {
currentPage = newPage;
displayPage(currentPage);
}
}
</script>
<br><br><br><br><br><br>
</div>
</div>
</div>
</div>
</div>
<!-- end of terms content -->
<!-- Footer -->
<div id="footer"></div>
<!-- end of copyright -->
<!-- Scripts -->
<script src="https://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script> <!-- jQuery for Bootstrap's JavaScript plugins -->
<script src="http://apps.bdimg.com/libs/bootstrap/3.2.0/js/bootstrap.min.js"></script>
<script src="https://lf3-cdn-tos.bytecdntp.com/cdn/expire-1-M/jquery-easing/1.4.1/jquery.easing.min.js"></script> <!-- jQuery Easing for smooth scrolling between anchors -->
<script src="https://lf26-cdn-tos.bytecdntp.com/cdn/expire-1-M/Swiper/8.0.6/swiper-bundle.min.js"></script> <!-- Swiper for image and text sliders -->
<script src="https://lf26-cdn-tos.bytecdntp.com/cdn/expire-1-M/magnific-popup.js/1.1.0/jquery.magnific-popup.min.js"></script> <!-- Magnific Popup for lightboxes -->
<script src="https://lf3-cdn-tos.bytecdntp.com/cdn/expire-1-M/Morphext/2.4.4/morphext.min.js"></script> <!-- Morphtext rotating text in the header -->
<script crossorigin="anonymous" integrity="sha384-8CYhPwYlLELodlcQV713V9ZikA3DlCVaXFDpjHfP8Z36gpddf/Vrt47XmKDsCttu" src="static/js/clipboard.min.js"></script>
<script src="static/js/js.js"></script>
<script src="static/js/scripts.js"></script> <!-- Custom scripts -->
</body>
</html>