-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathindex.html
More file actions
680 lines (626 loc) · 26.7 KB
/
index.html
File metadata and controls
680 lines (626 loc) · 26.7 KB
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
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover">
<meta name="theme-color" content="#4A7C6F" id="meta-theme-color">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="default" id="meta-status-bar">
<meta name="format-detection" content="telephone=no">
<meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self' 'unsafe-inline'; style-src 'self' 'unsafe-inline'; img-src 'self' data: blob: https:; font-src 'self' data:; connect-src 'self' https:; base-uri 'self'; form-action 'self';">
<title>SLTE</title>
<!-- Favicon -->
<link rel="icon" type="image/svg+xml" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'><rect width='32' height='32' rx='8' fill='%234A7C6F'/><text x='50%25' y='50%25' dominant-baseline='central' text-anchor='middle' fill='white' font-size='18' font-weight='800' font-family='system-ui'>S</text></svg>">
<script>
(function(){
var saved = localStorage.getItem('slte_dark');
var dark = saved !== null
? saved === '1'
: window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches;
if (dark) document.documentElement.setAttribute('data-dark-init', '1');
var tc = document.getElementById('meta-theme-color');
if (tc) tc.setAttribute('content', dark ? '#1A1D27' : '#4A7C6F');
})();
</script>
<style>html[data-dark-init="1"] body { background: #0F1117 !important; }</style>
<!-- Styles -->
<link rel="stylesheet" href="assets/css/design-system.css?v=1773900200">
<link rel="stylesheet" href="assets/css/layout.css?v=1773900200">
<script src="assets/js/vendor/iconify.min.js"></script>
<script src="assets/js/vendor/lottie.min.js"></script>
<script src="assets/js/vendor/qrcode.min.js"></script>
<script src="assets/js/vendor/purify.min.js"></script>
<script src="env.js" onerror="window.settings=window.settings||{}"></script>
<style>
/* Auth Page */
.auth-page {
min-height: 100vh;
min-height: 100dvh;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
-webkit-box-pack: center;
-ms-flex-pack: center;
justify-content: center;
background: var(--color-bg);
padding: 24px 16px;
-webkit-overflow-scrolling: touch;
}
.auth-card {
width: 100%;
max-width: 420px;
background: var(--color-surface);
border-radius: var(--radius-xl);
-webkit-box-shadow: var(--shadow-lg);
box-shadow: var(--shadow-lg);
border: 1px solid var(--color-border-light);
padding: 40px 36px;
}
@media (max-width: 480px) {
.auth-card {
padding: 28px 20px;
border-radius: var(--radius-lg);
}
}
.auth-logo-wrap {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
gap: 10px;
margin-bottom: 28px;
}
.auth-logo-icon {
width: 40px;
height: 40px;
border-radius: 10px;
background: var(--color-primary);
color: #fff;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
-webkit-box-pack: center;
-ms-flex-pack: center;
justify-content: center;
font-size: 18px;
font-weight: 800;
-ms-flex-negative: 0;
flex-shrink: 0;
overflow: hidden;
}
.auth-logo-icon img {
width: 100%;
height: 100%;
object-fit: contain;
}
.auth-logo-name {
font-size: 18px;
font-weight: 700;
color: var(--color-text-primary);
}
.auth-title {
font-size: 22px;
font-weight: 700;
color: var(--color-text-primary);
margin: 0 0 6px;
letter-spacing: -0.3px;
}
.auth-subtitle {
font-size: 14px;
color: var(--color-text-muted);
margin: 0 0 24px;
line-height: 1.5;
}
.auth-form {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-orient: vertical;
-webkit-box-direction: normal;
-ms-flex-direction: column;
flex-direction: column;
gap: 16px;
}
.auth-form .form-group { margin: 0; }
.auth-footer {
margin-top: 20px;
text-align: center;
font-size: 13px;
color: var(--color-text-muted);
}
.auth-footer a {
color: var(--color-primary);
cursor: pointer;
font-weight: 500;
text-decoration: none;
}
.auth-footer a:hover { text-decoration: underline; }
.pwd-input-wrap { position: relative; }
.pwd-input-wrap .form-input { padding-right: 44px; }
.pwd-toggle-btn {
position: absolute;
right: 12px;
top: 50%;
-webkit-transform: translateY(-50%);
transform: translateY(-50%);
background: none;
border: none;
cursor: pointer;
padding: 4px;
color: var(--color-text-muted);
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
-webkit-box-pack: center;
-ms-flex-pack: center;
justify-content: center;
border-radius: 4px;
-webkit-transition: color var(--duration-fast);
transition: color var(--duration-fast);
z-index: 2;
}
.pwd-toggle-btn:hover { color: var(--color-text-primary); }
.auth-closed {
text-align: center;
padding: 16px 0 8px;
}
.auth-closed-icon {
width: 72px;
height: 72px;
border-radius: 50%;
background: var(--color-surface-2);
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
-webkit-box-pack: center;
-ms-flex-pack: center;
justify-content: center;
margin: 0 auto 20px;
color: var(--color-text-muted);
}
.auth-closed-title {
font-size: 18px;
font-weight: 600;
color: var(--color-text-primary);
margin-bottom: 10px;
}
.auth-closed-desc {
font-size: 14px;
color: var(--color-text-muted);
line-height: 1.7;
margin-bottom: 28px;
}
.topbar-avatar-wrap { position: relative; }
.topbar-avatar {
width: 34px;
height: 34px;
border-radius: 50%;
background: var(--color-primary-bg);
color: var(--color-primary);
border: 1.5px solid var(--color-primary);
font-size: 13px;
font-weight: 700;
cursor: pointer;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
-webkit-box-pack: center;
-ms-flex-pack: center;
justify-content: center;
-webkit-transition: all var(--duration-fast) var(--ease-out);
transition: all var(--duration-fast) var(--ease-out);
-ms-flex-negative: 0;
flex-shrink: 0;
border: none;
outline: none;
}
.topbar-avatar:hover {
background: var(--color-primary);
color: #fff;
}
.user-dropdown {
position: absolute;
top: calc(100% + 8px);
right: 0;
min-width: 220px;
background: var(--color-surface);
border: 1px solid var(--color-border);
border-radius: var(--radius-lg);
-webkit-box-shadow: var(--shadow-lg);
box-shadow: var(--shadow-lg);
z-index: var(--z-dropdown);
overflow: hidden;
-webkit-animation: dropdown-in 150ms var(--ease-out) both;
animation: dropdown-in 150ms var(--ease-out) both;
}
@-webkit-keyframes dropdown-in {
from { opacity: 0; -webkit-transform: translateY(-6px) scale(0.97); transform: translateY(-6px) scale(0.97); }
to { opacity: 1; -webkit-transform: translateY(0) scale(1); transform: translateY(0) scale(1); }
}
@keyframes dropdown-in {
from { opacity: 0; -webkit-transform: translateY(-6px) scale(0.97); transform: translateY(-6px) scale(0.97); }
to { opacity: 1; -webkit-transform: translateY(0) scale(1); transform: translateY(0) scale(1); }
}
.user-dropdown-header {
padding: 14px 16px 12px;
border-bottom: 1px solid var(--color-divider);
}
.user-dropdown-email {
font-size: 13px;
font-weight: 600;
color: var(--color-text-primary);
word-break: break-all;
}
.user-dropdown-balance {
font-size: 12px;
color: var(--color-text-muted);
margin-top: 2px;
}
.user-dropdown-item {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
gap: 10px;
width: 100%;
padding: 11px 16px;
background: none;
border: none;
cursor: pointer;
font-size: 14px;
color: var(--color-text-primary);
text-align: left;
-webkit-transition: background var(--duration-fast);
transition: background var(--duration-fast);
}
.user-dropdown-item:hover { background: var(--color-surface-2); }
.user-dropdown-item-danger { color: #E05252; }
.user-dropdown-item-danger:hover { background: #FEF2F2; }
.profile-info-list {
margin-top: var(--space-2);
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-orient: vertical;
-webkit-box-direction: normal;
-ms-flex-direction: column;
flex-direction: column;
}
.profile-info-row {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-pack: justify;
-ms-flex-pack: justify;
justify-content: space-between;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
padding: 11px 0;
border-bottom: 1px solid var(--color-divider);
gap: 16px;
}
.profile-info-row:last-child { border-bottom: none; }
.profile-info-label {
font-size: 14px;
color: var(--color-text-muted);
-ms-flex-negative: 0;
flex-shrink: 0;
}
.profile-info-value {
font-size: 14px;
color: var(--color-text-primary);
text-align: right;
word-break: break-all;
}
@media (min-width: 769px) {
#menu-toggle { display: none !important; }
.topbar { padding-left: var(--space-3) !important; }
body.sidebar-collapsed .sidebar { transform: none !important; width: var(--sidebar-width) !important; }
body.sidebar-collapsed .main-wrapper { margin-left: var(--sidebar-width) !important; }
body.sidebar-collapsed .sidebar-logo-text,
body.sidebar-collapsed .nav-label,
body.sidebar-collapsed .nav-badge,
body.sidebar-collapsed .nav-group-label,
body.sidebar-collapsed .sidebar-user-info { opacity: 1 !important; pointer-events: auto !important; }
body.sidebar-collapsed .sidebar-logo { justify-content: flex-start !important; padding: 0 var(--space-2) !important; }
body.sidebar-collapsed .sidebar-user { justify-content: flex-start !important; padding: 6px 8px !important; }
body.sidebar-collapsed .nav-item { justify-content: flex-start !important; padding: 9px 12px !important; margin: 1px var(--space-1) !important; }
}
</style>
</head>
<body>
<div id="toast-container"></div>
<div id="app">
<div id="view-login" class="view auth-page hidden">
<div class="auth-card">
<div class="auth-logo-wrap">
<div class="auth-logo-icon" id="auth-logo-login">S</div>
<span class="auth-logo-name" id="auth-name-login">SLTE</span>
</div>
<h1 class="auth-title">欢迎回来</h1>
<p class="auth-subtitle">登录您的账户继续使用</p>
<form class="auth-form" id="login-form" autocomplete="on" novalidate>
<div class="form-group">
<label class="form-label" for="login-email">邮箱地址</label>
<div class="form-input-group">
<span class="input-prefix">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z"/><polyline points="22,6 12,13 2,6"/></svg>
</span>
<input class="form-input has-prefix" type="email" id="login-email" name="email"
placeholder="your@email.com" autocomplete="email" inputmode="email">
</div>
</div>
<div class="form-group">
<div style="display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;-webkit-box-align:center;-ms-flex-align:center;align-items:center;margin-bottom:6px">
<label class="form-label" for="login-password" style="margin:0">密码</label>
<a class="auth-footer" style="margin:0;font-size:13px" onclick="Router.navigate('/forget')">忘记密码?</a>
</div>
<div class="pwd-input-wrap">
<input class="form-input" type="password" id="login-password" name="password"
placeholder="输入密码" autocomplete="current-password">
<button type="button" class="pwd-toggle-btn" id="login-pwd-toggle" tabindex="-1">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"/><circle cx="12" cy="12" r="3"/></svg>
</button>
</div>
</div>
<button type="submit" class="btn btn-primary btn-full btn-lg" style="margin-top:4px">
<span class="btn-text">登录</span>
</button>
</form>
<div class="auth-footer" id="login-register-link" style="display:none">
还没有账号?<a onclick="Router.navigate('/register')">立即注册</a>
</div>
</div>
</div>
<div id="view-register" class="view auth-page hidden">
<div class="auth-card">
<div class="auth-logo-wrap">
<div class="auth-logo-icon" id="auth-logo-register">S</div>
<span class="auth-logo-name" id="auth-name-register">SLTE</span>
</div>
<div id="register-closed">
<div id="register-loading" style="text-align:center;padding:32px 0">
<div style="width:32px;height:32px;border:3px solid var(--color-border);border-top-color:var(--color-primary);border-radius:50%;animation:spin 0.8s linear infinite;margin:0 auto 16px"></div>
<div style="font-size:14px;color:var(--color-text-muted)">正在加载...</div>
</div>
<div id="register-closed-content" style="display:none">
<div class="auth-closed">
<div class="auth-closed-icon">
<svg width="32" height="32" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.6">
<rect x="3" y="11" width="18" height="11" rx="2" ry="2"/>
<path d="M7 11V7a5 5 0 0110 0v4"/>
</svg>
</div>
<div class="auth-closed-title">注册暂未开放</div>
<div class="auth-closed-desc">管理员已关闭新用户注册。<br>如需使用,请联系管理员获取邀请或直接登录。</div>
<button class="btn btn-primary btn-full" onclick="Router.navigate('/login')">返回登录</button>
</div>
</div>
</div>
<div id="register-form-wrap" style="display:none">
<h1 class="auth-title">创建账户</h1>
<p class="auth-subtitle">加入我们,开始使用</p>
<form class="auth-form" id="register-form" autocomplete="on" novalidate>
<div class="form-group">
<label class="form-label" for="register-email">邮箱地址</label>
<div class="form-input-group">
<span class="input-prefix">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z"/><polyline points="22,6 12,13 2,6"/></svg>
</span>
<input class="form-input has-prefix" type="email" id="register-email"
placeholder="your@email.com" autocomplete="email" inputmode="email">
</div>
</div>
<div class="form-group" id="register-code-group" style="display:none">
<label class="form-label">邮箱验证码</label>
<div class="flex gap-1">
<input class="form-input flex-1" type="text" id="register-code"
placeholder="6位验证码" maxlength="6" inputmode="numeric">
<button type="button" class="btn btn-secondary" id="register-send-code"
style="white-space:nowrap;min-width:96px">发送验证码</button>
</div>
</div>
<div class="form-group">
<label class="form-label" for="register-password">密码</label>
<div class="pwd-input-wrap">
<input class="form-input" type="password" id="register-password"
placeholder="至少8位" autocomplete="new-password">
<button type="button" class="pwd-toggle-btn" id="reg-pwd-toggle" tabindex="-1">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"/><circle cx="12" cy="12" r="3"/></svg>
</button>
</div>
</div>
<div class="form-group">
<label class="form-label" for="register-password2">确认密码</label>
<div class="pwd-input-wrap">
<input class="form-input" type="password" id="register-password2"
placeholder="再次输入密码" autocomplete="new-password">
<button type="button" class="pwd-toggle-btn" id="reg-pwd2-toggle" tabindex="-1">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"/><circle cx="12" cy="12" r="3"/></svg>
</button>
</div>
</div>
<div class="form-group" id="register-invite-group">
<label class="form-label" for="register-invite">邀请码<span id="invite-optional" style="color:var(--color-text-muted);font-weight:400">(可选)</span></label>
<input class="form-input" type="text" id="register-invite" placeholder="输入邀请码">
</div>
<button type="submit" class="btn btn-primary btn-full btn-lg" style="margin-top:4px">
<span class="btn-text">注册</span>
</button>
</form>
<div class="auth-footer">
已有账号?<a onclick="Router.navigate('/login')">立即登录</a>
</div>
</div>
</div>
</div>
<div id="view-forget" class="view auth-page hidden">
<div class="auth-card">
<div class="auth-logo-wrap">
<div class="auth-logo-icon" id="auth-logo-forget">S</div>
<span class="auth-logo-name" id="auth-name-forget">SLTE</span>
</div>
<h1 class="auth-title">重置密码</h1>
<p class="auth-subtitle">通过邮箱验证重置您的密码</p>
<form class="auth-form" id="forget-form" novalidate>
<div class="form-group">
<label class="form-label" for="forget-email">邮箱地址</label>
<div class="form-input-group">
<span class="input-prefix">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z"/><polyline points="22,6 12,13 2,6"/></svg>
</span>
<input class="form-input has-prefix" type="email" id="forget-email"
placeholder="your@email.com" inputmode="email">
</div>
</div>
<div class="form-group">
<label class="form-label">邮箱验证码</label>
<div class="flex gap-1">
<input class="form-input flex-1" type="text" id="forget-code"
placeholder="6位验证码" maxlength="6" inputmode="numeric">
<button type="button" class="btn btn-secondary" id="forget-send-code"
style="white-space:nowrap;min-width:96px">发送验证码</button>
</div>
</div>
<div class="form-group">
<label class="form-label" for="forget-password">新密码</label>
<div class="pwd-input-wrap">
<input class="form-input" type="password" id="forget-password"
placeholder="至少8位" autocomplete="new-password">
<button type="button" class="pwd-toggle-btn" id="forget-pwd-toggle" tabindex="-1">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"/><circle cx="12" cy="12" r="3"/></svg>
</button>
</div>
</div>
<div class="form-group">
<label class="form-label" for="forget-password2">确认新密码</label>
<div class="pwd-input-wrap">
<input class="form-input" type="password" id="forget-password2"
placeholder="再次输入新密码" autocomplete="new-password">
<button type="button" class="pwd-toggle-btn" id="forget-pwd2-toggle" tabindex="-1">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"/><circle cx="12" cy="12" r="3"/></svg>
</button>
</div>
</div>
<button type="submit" class="btn btn-primary btn-full btn-lg" style="margin-top:4px">
<span class="btn-text">重置密码</span>
</button>
</form>
<div class="auth-footer">
<a onclick="Router.navigate('/login')">← 返回登录</a>
</div>
</div>
</div>
</div><!-- #app -->
<script src="assets/js/core.js?v=1773841136"></script>
<script src="assets/js/auth.js?v=1773841136"></script>
<script src="assets/js/dashboard.js?v=1773841136"></script>
<script src="assets/js/pages.js?v=1773841136"></script>
<script src="assets/js/pages2.js?v=1773841136"></script>
<script>
document.addEventListener('DOMContentLoaded', function() {
var siteName = (window.SETTINGS && SETTINGS.title) ? SETTINGS.title : 'SLTE';
var logo = window.SETTINGS && SETTINGS.logo;
document.title = siteName;
['login','register','forget'].forEach(function(p) {
var nameEl = document.getElementById('auth-name-' + p);
var iconEl = document.getElementById('auth-logo-' + p);
if (nameEl) nameEl.textContent = siteName;
if (iconEl) {
if (logo) {
var safeLogo = /^https?:\/\//i.test(logo.trim()) ? logo.trim() : '';
if (safeLogo) {
var img = document.createElement('img');
img.src = safeLogo;
img.alt = 'logo';
iconEl.innerHTML = '';
iconEl.appendChild(img);
iconEl.style.background = 'transparent';
iconEl.style.padding = '2px';
} else {
iconEl.textContent = (siteName[0] || 'S').toUpperCase();
}
} else {
iconEl.textContent = (siteName[0] || 'S').toUpperCase();
}
}
});
function bindPwdToggle(btnId, inputId) {
var btn = document.getElementById(btnId);
var inp = document.getElementById(inputId);
if (!btn || !inp) return;
btn.addEventListener('click', function() {
var isText = inp.type === 'text';
inp.type = isText ? 'password' : 'text';
btn.innerHTML = isText
? '<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"/><circle cx="12" cy="12" r="3"/></svg>'
: '<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M17.94 17.94A10.07 10.07 0 0112 20c-7 0-11-8-11-8a18.45 18.45 0 015.06-5.94M9.9 4.24A9.12 9.12 0 0112 4c7 0 11 8 11 8a18.5 18.5 0 01-2.16 3.19m-6.72-1.07a3 3 0 11-4.24-4.24"/><line x1="1" y1="1" x2="23" y2="23"/></svg>';
});
}
bindPwdToggle('login-pwd-toggle', 'login-password');
bindPwdToggle('reg-pwd-toggle', 'register-password');
bindPwdToggle('reg-pwd2-toggle', 'register-password2');
bindPwdToggle('forget-pwd-toggle', 'forget-password');
bindPwdToggle('forget-pwd2-toggle', 'forget-password2');
Router.register('/login', function() { return initLogin(); });
Router.register('/register', function() { return initRegister(); });
Router.register('/forget', function() { return initForget(); });
Router.register('/dashboard', async function() { ensureLayout(); await initDashboard(); });
Router.register('/plans', async function() { ensureLayout(); await initPlans(); });
Router.register('/orders', async function() { ensureLayout(); await initOrders(); });
Router.register('/deposit', async function() { ensureLayout(); await initDeposit(); });
Router.register('/giftcard', async function() { ensureLayout(); await initGiftcard(); });
Router.register('/invite', async function() { ensureLayout(); await initInvite(); });
Router.register('/tickets', async function() { ensureLayout(); await initTickets(); });
Router.register('/knowledge', async function() { ensureLayout(); await initKnowledge(); });
Router.register('/profile', async function() { ensureLayout(); await initProfile(); });
Router.register('/notices', async function() { ensureLayout(); await initNotices(); });
Router.register('/servers', async function() { ensureLayout(); await initServers(); });
Router.register('/traffic', async function() { ensureLayout(); await initTraffic(); });
Router.register('*', function() { Router.navigate('/dashboard', true); });
if (State.token) {
loadUserData();
}
Router.init();
});
var _layoutRendered = false;
function ensureLayout() {
var app = document.getElementById('app');
if (app) {
app.classList.remove('auth-mode');
app.classList.add('app-mode');
}
if (!_layoutRendered) {
renderLayout();
_layoutRendered = true;
if (typeof applyDarkMode === 'function') {
applyDarkMode(document.body.getAttribute('data-dark') === '1');
}
}
if (typeof closeSidebar === 'function') closeSidebar();
if (typeof updateActiveNav === 'function') updateActiveNav(Router.current);
}
</script>
</body>
</html>