File size: 7,793 Bytes
a3e8661
 
 
 
 
2486ef7
 
 
a3e8661
 
2486ef7
 
 
 
 
 
 
 
a3e8661
2486ef7
 
 
 
 
 
 
 
 
 
 
 
a3e8661
 
2486ef7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
a3e8661
2486ef7
 
 
 
 
 
a3e8661
 
2486ef7
 
 
 
 
 
 
 
a3e8661
 
2486ef7
8c07d66
 
 
 
 
 
 
bcd7de5
2486ef7
8c07d66
2486ef7
bcd7de5
 
 
 
 
2486ef7
 
 
 
 
 
 
 
 
 
a3e8661
2486ef7
 
 
 
 
 
 
 
 
8c07d66
2486ef7
 
 
 
 
 
 
a3e8661
 
2486ef7
 
 
 
 
 
 
a3e8661
 
 
2486ef7
 
a3e8661
 
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
<!DOCTYPE html>
<html lang="he" dir="rtl">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="theme-color" content="#ffffff">
    <title>ืœื•ื— ื ื™ื”ื•ืœ โ€” ืื™ืžื•ืŸ ืงื•ืœื™</title>
    <link rel="stylesheet" href="style.css?v=11">
</head>
<body>
    <header class="topbar">
        <div class="topbar-inner">
            <div class="brand">
                <span class="brand-mark">๐Ÿ› </span>
                <span class="brand-text">
                    <span class="brand-title">ืœื•ื— ื ื™ื”ื•ืœ</span>
                    <span class="brand-sub">ืื™ืžื•ืŸ ืงื•ืœื™ โ€” ื ื™ื”ื•ืœ ืžืฉืชืžืฉื™ื</span>
                </span>
            </div>
            <div class="topbar-actions">
                <div id="user-bar" class="user-bar-inline" hidden>
                    <span id="my-class-code" class="tag" hidden></span>
                    <span id="joined-class-info" class="tag" hidden></span>
                    <span class="user-chip">
                        <span class="user-chip-avatar">โ€ข</span>
                        <span id="user-name" class="user-email-nav"></span>
                    </span>
                    <a href="/" class="btn btn-ghost btn-sm">ื—ื–ืจื” ืœืืคืœื™ืงืฆื™ื”</a>
                    <a href="/admin" id="admin-link" class="btn btn-ghost btn-sm" hidden>ืœื•ื— ื ื™ื”ื•ืœ</a>
                    <button id="logout-btn" class="btn btn-ghost btn-sm">ื”ืชื ืชืงื•ืช</button>
                </div>
            </div>
        </div>
    </header>

    <main class="app-shell">
        <!-- Signed out -->
        <div id="auth-bar" class="auth-screen admin-auth">
            <section class="auth-card">
                <h1 class="auth-heading">ื›ื ื™ืกืช ืžื ื”ืœ</h1>
                <p class="auth-sub">ื ื“ืจืฉืช ื”ืจืฉืืช ื ื™ื”ื•ืœ ื›ื“ื™ ืœืฆืคื•ืช ื‘ืžืฉืชืžืฉื™ื ื•ื‘ืชื•ืฆืื•ืช.</p>
                <div id="auth-forms" class="auth-form">
                    <label class="field">
                        <span class="field-label">ืื™ืžื™ื™ืœ</span>
                        <input type="text" id="auth-username" class="input auth-input" placeholder="name@example.com" autocomplete="username" />
                    </label>
                    <label class="field">
                        <span class="field-label">ืกื™ืกืžื”</span>
                        <input type="password" id="auth-password" class="input auth-input" placeholder="ืกื™ืกืžื”" autocomplete="current-password" />
                    </label>
                    <label class="field">
                        <span class="field-label">ืงื•ื“ ื›ื™ืชื” <span class="field-hint">(ืœื ื—ื•ื‘ื”)</span></span>
                        <input type="text" id="auth-class-code" class="input auth-input" placeholder="ืœืžืฉืœ ABC123" />
                    </label>
                    <label class="consent" id="auth-consent-wrap" style="display:none;">
                        <input type="checkbox" id="auth-consent" />
                        <span>ืงืจืืชื™ ื•ืื ื™ ืžืกื›ื™ื/ื” ืœ<a href="/terms.html" target="_blank">ืชื ืื™ ื”ืฉื™ืžื•ืฉ</a> ื•ืœ<a href="/privacy.html" target="_blank">ืžื“ื™ื ื™ื•ืช ื”ืคืจื˜ื™ื•ืช</a>.</span>
                    </label>
                    <div class="auth-actions">
                        <button id="login-btn" class="btn btn-primary btn-block">ื”ืชื—ื‘ืจื•ืช</button>
                        <button id="register-btn" class="btn btn-secondary btn-block">ื”ืจืฉืžื”</button>
                    </div>
                    <p id="auth-error" class="auth-error" role="alert"></p>
                </div>
            </section>
        </div>

        <!-- Access denied -->
        <section class="empty-card" id="admin-denied" hidden>
            <span class="empty-icon">๐Ÿ”’</span>
            <h2>ืื™ืŸ ื”ืจืฉืืช ื ื™ื”ื•ืœ</h2>
            <p>ื”ื—ืฉื‘ื•ืŸ ื”ืžื—ื•ื‘ืจ ืื™ื ื• ืžื ื”ืœ. ื”ืชื—ื‘ืจื• ืขื ื—ืฉื‘ื•ืŸ ืžื ื”ืœ ื›ื“ื™ ืœื”ืžืฉื™ืš.</p>
            <a href="/" class="btn btn-secondary">ื—ื–ืจื” ืœืืคืœื™ืงืฆื™ื”</a>
        </section>

        <!-- Admin content -->
        <section id="admin-content" hidden>
            <div class="admin-toolbar">
                <div id="admin-class-code-box" class="class-code-box" hidden>
                    <span class="class-code-caption">ืงื•ื“ ื”ื›ื™ืชื” ืฉืœืš</span>
                    <span id="admin-class-code-value" class="class-code-value"></span>
                    <button id="copy-class-code" class="small-btn" title="ื”ืขืชืง ืงื•ื“">๐Ÿ“‹</button>
                </div>
            </div>

            <div id="allowlist-box" class="card admin-section" hidden>
                <h2 class="card-title">ื”ื•ืกืคืช ืžืฉืชืžืฉื™ื</h2>
                <p class="subtitle">
                    ื”ื•ืกื™ืคื• ืื™ืžื™ื™ืœ ื›ื“ื™ ืœืชืช ื’ื™ืฉื” ืœืืคืœื™ืงืฆื™ื”. ื”ืžืฉืชืžืฉ ื ื›ื ืก ืขื ื”ืื™ืžื™ื™ืœ ืฉืœื•
                    ื•ื”ืกื™ืกืžื” <strong>qwertyui</strong> โ€” ื‘ื›ื ื™ืกื” ื”ืจืืฉื•ื ื” ื”ื•ื ืœื•ื—ืฅ
                    <strong>ื”ืจืฉืžื”</strong> ื•ืžืืฉืจ ืืช ืชื ืื™ ื”ืฉื™ืžื•ืฉ, ื•ืื– ื”ื•ื ืžืฉื•ื™ืš ืื•ื˜ื•ืžื˜ื™ืช ืœื›ื™ืชื” ืฉืœื›ื
                    ื•ื›ืœ ื”ื”ื™ืกื˜ื•ืจื™ื” ืฉืœื• ื ืฉืžืจืช ื›ืืŸ.
                </p>
                <div class="allowlist-add">
                    <input type="email" id="allow-email-input" class="input auth-input" placeholder="email@example.com" />
                    <input type="text" id="allow-name-input" class="input auth-input" placeholder="ืฉื ืžืœื (ืจืฉื•ืช)" />
                    <button id="allow-add-btn" class="btn btn-primary">ื”ื•ืกืฃ</button>
                    <span id="allow-msg" class="auth-error"></span>
                </div>
                <ul id="allowlist-list" class="allowlist-list"></ul>
            </div>

            <div class="card admin-section">
                <div class="card-head">
                    <h2 class="card-title" id="users-title">ืžืฉืชืžืฉื™ื</h2>
                </div>

                <div id="class-tabs" class="tabs class-tabs" hidden>
                    <button class="tab class-tab active" data-filter="all">ื›ืœ ื”ืžืฉืชืžืฉื™ื</button>
                    <button class="tab class-tab" data-filter="no-class">ืœืœื ื›ื™ืชื”</button>
                    <!-- dynamic tabs per class are inserted here -->
                </div>

                <div class="table-wrapper">
                    <table class="admin-table" id="users-table">
                        <thead>
                            <tr>
                                <th>ืฉื ืžืฉืชืžืฉ</th>
                                <th>ืฉื ืžืœื</th>
                                <th>ืชืคืงื™ื“</th>
                                <th>ื›ื™ืชื”</th>
                                <th>ืชืืจื™ืš ื”ืจืฉืžื”</th>
                                <th>ื ื™ืชื•ื—ื™ื</th>
                                <th>G</th><th>R</th><th>B</th><th>A</th><th>S</th>
                                <th>ืคืขื•ืœื•ืช</th>
                            </tr>
                        </thead>
                        <tbody id="users-tbody"></tbody>
                    </table>
                </div>
            </div>

            <section class="card admin-section" id="user-detail-panel" hidden>
                <div class="card-head">
                    <h2 class="card-title" id="detail-title">ื”ื™ืกื˜ื•ืจื™ื™ืช ื ื™ืชื•ื—ื™ื</h2>
                    <button class="btn btn-ghost btn-sm" id="detail-close-btn">ืกื’ื•ืจ</button>
                </div>
                <div id="user-detail-content"></div>
            </section>
        </section>
    </main>

    <script src="auth.js?v=11"></script>
    <script src="admin.js?v=11"></script>
</body>
</html>