Spaces:
Running
Running
Update index.html
Browse files- index.html +388 -398
index.html
CHANGED
|
@@ -1,540 +1,530 @@
|
|
| 1 |
<!DOCTYPE html>
|
| 2 |
-
<html lang="zh-
|
| 3 |
|
| 4 |
<head>
|
| 5 |
-
<title>LLM+ 系統登入</title>
|
| 6 |
<meta charset="UTF-8">
|
| 7 |
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 8 |
-
<
|
| 9 |
-
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
| 10 |
-
<link href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600&display=swap" rel="stylesheet">
|
| 11 |
<style>
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
--background-color: #1a202c;
|
| 16 |
-
--sidebar-bg-color: rgba(45, 55, 72, 0.7);
|
| 17 |
-
--content-bg-color: #2d3748;
|
| 18 |
-
--text-color: #e2e8f0;
|
| 19 |
-
--text-muted-color: #a0aec0;
|
| 20 |
-
--border-color: rgba(255, 255, 255, 0.1);
|
| 21 |
-
--hover-bg-color: rgba(0, 170, 255, 0.1);
|
| 22 |
-
--border-radius: 12px;
|
| 23 |
-
--error-color: #f56565;
|
| 24 |
-
--success-color: #48bb78;
|
| 25 |
-
}
|
| 26 |
-
|
| 27 |
-
* {
|
| 28 |
-
box-sizing: border-box;
|
| 29 |
margin: 0;
|
| 30 |
padding: 0;
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
body {
|
| 34 |
-
font-family: 'Poppins', 'Noto Sans TC', sans-serif;
|
| 35 |
-
background-color: var(--background-color);
|
| 36 |
-
color: var(--text-color);
|
| 37 |
height: 100vh;
|
| 38 |
overflow: hidden;
|
| 39 |
}
|
| 40 |
|
| 41 |
-
/*
|
| 42 |
-
|
|
|
|
|
|
|
| 43 |
display: flex;
|
| 44 |
-
align-items: center;
|
| 45 |
justify-content: center;
|
| 46 |
-
|
| 47 |
-
|
| 48 |
}
|
| 49 |
|
| 50 |
-
.login-
|
| 51 |
-
background:
|
| 52 |
-
backdrop-filter: blur(
|
| 53 |
-
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
}
|
| 61 |
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
|
|
|
|
|
|
| 70 |
}
|
| 71 |
|
| 72 |
-
.login-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
font-size: 0.9rem;
|
| 77 |
}
|
| 78 |
|
| 79 |
-
.
|
| 80 |
-
margin-bottom:
|
|
|
|
| 81 |
}
|
| 82 |
|
| 83 |
-
label {
|
|
|
|
|
|
|
| 84 |
display: block;
|
| 85 |
-
margin-bottom:
|
| 86 |
-
color: var(--text-color);
|
| 87 |
-
font-weight: 500;
|
| 88 |
}
|
| 89 |
|
| 90 |
-
input
|
| 91 |
width: 100%;
|
| 92 |
-
padding:
|
| 93 |
-
border: 1px solid
|
| 94 |
-
border-radius:
|
| 95 |
-
background
|
| 96 |
-
color:
|
| 97 |
-
font-size:
|
|
|
|
| 98 |
transition: all 0.3s ease;
|
|
|
|
| 99 |
}
|
| 100 |
|
| 101 |
-
input
|
| 102 |
-
|
| 103 |
-
border-color: var(--accent-color);
|
| 104 |
-
box-shadow: 0 0 0 3px rgba(0, 170, 255, 0.1);
|
| 105 |
}
|
| 106 |
|
| 107 |
-
.
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
|
| 111 |
}
|
| 112 |
|
| 113 |
-
.captcha-
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
text-align: center;
|
| 119 |
-
font-size: 1.2rem;
|
| 120 |
-
font-weight: 600;
|
| 121 |
-
letter-spacing: 2px;
|
| 122 |
-
color: var(--accent-color);
|
| 123 |
-
min-width: 100px;
|
| 124 |
-
cursor: pointer;
|
| 125 |
-
transition: all 0.3s ease;
|
| 126 |
}
|
| 127 |
|
| 128 |
-
|
| 129 |
-
|
|
|
|
| 130 |
}
|
| 131 |
|
| 132 |
-
|
| 133 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 134 |
}
|
| 135 |
|
| 136 |
-
.
|
| 137 |
width: 100%;
|
| 138 |
-
padding:
|
| 139 |
-
background: linear-gradient(45deg, var(--accent-color), #0099dd);
|
| 140 |
-
color: white;
|
| 141 |
border: none;
|
| 142 |
-
border-radius:
|
| 143 |
-
|
| 144 |
-
|
|
|
|
|
|
|
| 145 |
cursor: pointer;
|
| 146 |
transition: all 0.3s ease;
|
|
|
|
| 147 |
}
|
| 148 |
|
| 149 |
-
.
|
| 150 |
-
transform:
|
| 151 |
-
box-shadow: 0
|
|
|
|
| 152 |
}
|
| 153 |
|
| 154 |
-
.
|
| 155 |
-
|
| 156 |
-
|
| 157 |
-
|
|
|
|
|
|
|
| 158 |
}
|
| 159 |
|
| 160 |
-
.error
|
| 161 |
-
color:
|
| 162 |
-
font-size: 0.85rem;
|
| 163 |
-
margin-top: 0.5rem;
|
| 164 |
-
text-align: center;
|
| 165 |
}
|
| 166 |
|
| 167 |
-
/*
|
| 168 |
-
|
| 169 |
-
display:
|
| 170 |
-
grid-template-columns: var(--sidebar-width) 1fr;
|
| 171 |
height: 100vh;
|
|
|
|
|
|
|
| 172 |
}
|
| 173 |
|
| 174 |
-
.
|
| 175 |
-
|
| 176 |
-
|
| 177 |
-
|
| 178 |
-
border-right: 1px solid var(--border-color);
|
| 179 |
display: flex;
|
| 180 |
flex-direction: column;
|
| 181 |
-
padding:
|
| 182 |
-
|
| 183 |
-
|
| 184 |
-
}
|
| 185 |
-
|
| 186 |
-
.logout-section {
|
| 187 |
-
margin-top: auto;
|
| 188 |
-
padding: 1.5rem;
|
| 189 |
-
border-top: 1px solid var(--border-color);
|
| 190 |
}
|
| 191 |
|
| 192 |
-
.
|
| 193 |
-
|
| 194 |
-
|
| 195 |
-
|
| 196 |
-
|
| 197 |
-
border: 1px solid
|
| 198 |
-
|
| 199 |
-
font-size: 0.9rem;
|
| 200 |
-
font-weight: 500;
|
| 201 |
-
cursor: pointer;
|
| 202 |
-
transition: all 0.3s ease;
|
| 203 |
}
|
| 204 |
|
| 205 |
-
.
|
| 206 |
-
|
| 207 |
-
color: white;
|
| 208 |
}
|
| 209 |
|
| 210 |
.tab-button {
|
| 211 |
-
|
| 212 |
-
|
| 213 |
border: none;
|
| 214 |
-
|
| 215 |
-
|
| 216 |
-
|
| 217 |
-
outline: none;
|
| 218 |
transition: all 0.3s ease;
|
| 219 |
-
font-size:
|
| 220 |
-
|
| 221 |
-
|
|
|
|
| 222 |
}
|
| 223 |
|
| 224 |
-
.tab-button
|
| 225 |
-
background-color:
|
| 226 |
-
|
| 227 |
}
|
| 228 |
|
| 229 |
-
.tab-button.active {
|
| 230 |
-
background-color:
|
| 231 |
-
|
| 232 |
-
border-left: 4px solid var(--accent-color);
|
| 233 |
}
|
| 234 |
|
| 235 |
-
|
| 236 |
-
padding:
|
| 237 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 238 |
display: flex;
|
| 239 |
-
|
| 240 |
-
|
|
|
|
| 241 |
}
|
| 242 |
|
| 243 |
-
|
| 244 |
-
|
| 245 |
-
|
| 246 |
-
margin-bottom: 0.5rem;
|
| 247 |
-
background: linear-gradient(45deg, var(--accent-color), #fff);
|
| 248 |
-
-webkit-background-clip: text;
|
| 249 |
-
-webkit-text-fill-color: transparent;
|
| 250 |
}
|
| 251 |
|
| 252 |
-
|
| 253 |
-
|
| 254 |
-
|
| 255 |
-
|
| 256 |
-
margin-bottom: 2rem;
|
| 257 |
-
border-bottom: 1px solid var(--border-color);
|
| 258 |
-
padding-bottom: 1.5rem;
|
| 259 |
}
|
| 260 |
|
| 261 |
.tab-content {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 262 |
display: none;
|
| 263 |
-
flex-grow: 1;
|
| 264 |
-
animation: fadeIn 0.5s ease;
|
| 265 |
}
|
| 266 |
|
| 267 |
-
|
| 268 |
-
|
| 269 |
-
|
| 270 |
-
transform: translateY(10px);
|
| 271 |
-
}
|
| 272 |
-
to {
|
| 273 |
-
opacity: 1;
|
| 274 |
-
transform: translateY(0);
|
| 275 |
-
}
|
| 276 |
}
|
| 277 |
|
| 278 |
-
iframe {
|
| 279 |
width: 100%;
|
| 280 |
height: 100%;
|
| 281 |
-
border:
|
| 282 |
-
border-radius: var(--border-radius);
|
| 283 |
-
background-color: #fff;
|
| 284 |
}
|
| 285 |
|
| 286 |
-
/*
|
| 287 |
-
|
| 288 |
-
|
| 289 |
-
|
| 290 |
-
|
| 291 |
-
}
|
| 292 |
-
|
| 293 |
-
.main-system {
|
| 294 |
-
grid-template-columns: 1fr;
|
| 295 |
-
grid-template-rows: auto 1fr;
|
| 296 |
-
height: 100%;
|
| 297 |
-
}
|
| 298 |
-
|
| 299 |
-
.tabs {
|
| 300 |
-
width: 100%;
|
| 301 |
-
flex-direction: row;
|
| 302 |
-
justify-content: space-around;
|
| 303 |
-
padding: 0.5rem 0;
|
| 304 |
-
border-right: none;
|
| 305 |
-
border-bottom: 1px solid var(--border-color);
|
| 306 |
-
}
|
| 307 |
-
|
| 308 |
-
.logout-section {
|
| 309 |
-
margin-top: 0;
|
| 310 |
-
padding: 0.5rem;
|
| 311 |
-
border-top: none;
|
| 312 |
-
border-left: 1px solid var(--border-color);
|
| 313 |
-
}
|
| 314 |
-
|
| 315 |
-
.tab-button {
|
| 316 |
-
border-left: none;
|
| 317 |
-
border-bottom: 4px solid transparent;
|
| 318 |
-
padding: 1rem;
|
| 319 |
-
flex-grow: 1;
|
| 320 |
-
text-align: center;
|
| 321 |
-
}
|
| 322 |
-
|
| 323 |
-
.tab-button.active {
|
| 324 |
-
border-left: none;
|
| 325 |
-
border-bottom: 4px solid var(--accent-color);
|
| 326 |
-
}
|
| 327 |
-
|
| 328 |
-
.content {
|
| 329 |
-
padding: 1.5rem;
|
| 330 |
-
}
|
| 331 |
-
|
| 332 |
-
h1 {
|
| 333 |
-
font-size: 1.8rem;
|
| 334 |
-
}
|
| 335 |
|
| 336 |
-
|
| 337 |
-
|
| 338 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 339 |
}
|
| 340 |
</style>
|
| 341 |
</head>
|
| 342 |
|
| 343 |
<body>
|
| 344 |
-
|
| 345 |
-
<
|
| 346 |
-
<div class="login-
|
| 347 |
-
<
|
| 348 |
-
<
|
| 349 |
-
|
| 350 |
-
|
| 351 |
-
|
| 352 |
-
<label for="username">帳號</label>
|
| 353 |
-
<input type="text" id="username" name="username" required>
|
| 354 |
</div>
|
| 355 |
-
|
| 356 |
-
|
| 357 |
-
<
|
| 358 |
-
<input type="password" id="password" name="password" required>
|
| 359 |
</div>
|
| 360 |
-
|
| 361 |
-
|
| 362 |
-
<label>驗證碼</label>
|
| 363 |
<div class="captcha-container">
|
| 364 |
-
<
|
| 365 |
-
<
|
| 366 |
</div>
|
| 367 |
</div>
|
| 368 |
-
|
| 369 |
-
<
|
| 370 |
-
<div id="errorMessage" class="error-message"></div>
|
| 371 |
</form>
|
| 372 |
</div>
|
| 373 |
-
</
|
| 374 |
-
|
| 375 |
-
|
| 376 |
-
|
| 377 |
-
|
| 378 |
-
<
|
| 379 |
-
|
| 380 |
-
|
| 381 |
-
|
| 382 |
-
|
| 383 |
-
<button class="logout-button" onclick="logout()">登出系統</button>
|
| 384 |
</div>
|
|
|
|
| 385 |
</div>
|
| 386 |
-
|
| 387 |
-
|
| 388 |
-
<h1>LLM+ Web scraping Application</h1>
|
| 389 |
-
<h2>elliot hsu@2025copyright</h2>
|
| 390 |
-
|
| 391 |
-
<div id="iframe01" class="tab-content">
|
| 392 |
<iframe src="https://z9760405-steamlit.hf.space" frameborder="0"></iframe>
|
| 393 |
</div>
|
| 394 |
|
| 395 |
<div id="iframe02" class="tab-content">
|
| 396 |
<iframe src="https://cjian2025-groq-api-gradio.hf.space" frameborder="0"></iframe>
|
| 397 |
</div>
|
| 398 |
-
|
| 399 |
<div id="iframe03" class="tab-content">
|
| 400 |
<iframe src="https://z9760405-webcam-groq-linebot-application.hf.space" frameborder="0"
|
| 401 |
allow="camera; microphone"></iframe>
|
| 402 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
| 403 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 404 |
</div>
|
| 405 |
|
| 406 |
<script>
|
| 407 |
-
|
| 408 |
-
|
| 409 |
-
|
| 410 |
-
|
| 411 |
-
|
| 412 |
-
|
| 413 |
-
|
| 414 |
-
const
|
| 415 |
-
const
|
| 416 |
-
const
|
| 417 |
-
const
|
| 418 |
-
const
|
| 419 |
-
|
| 420 |
-
|
| 421 |
-
|
| 422 |
-
|
| 423 |
-
|
| 424 |
-
|
| 425 |
-
|
| 426 |
-
|
| 427 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 428 |
}
|
| 429 |
-
|
| 430 |
-
}
|
| 431 |
|
| 432 |
-
|
| 433 |
-
|
| 434 |
-
const
|
| 435 |
-
|
|
|
|
| 436 |
|
| 437 |
-
|
| 438 |
-
const usernameHash = await sha256(username);
|
| 439 |
-
const passwordHash = await sha256(password);
|
| 440 |
|
| 441 |
-
|
| 442 |
-
|
| 443 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 444 |
}
|
| 445 |
|
| 446 |
-
|
| 447 |
-
|
| 448 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 449 |
}
|
| 450 |
|
| 451 |
-
|
| 452 |
-
|
| 453 |
-
|
| 454 |
-
|
| 455 |
-
return false;
|
| 456 |
}
|
| 457 |
|
| 458 |
-
|
| 459 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 460 |
|
| 461 |
-
|
| 462 |
-
|
| 463 |
-
|
| 464 |
-
|
| 465 |
-
|
| 466 |
-
|
| 467 |
-
|
| 468 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 469 |
}
|
| 470 |
-
}
|
| 471 |
-
|
| 472 |
-
// 登出,返回登入頁面
|
| 473 |
-
function logout() {
|
| 474 |
-
document.getElementById('mainSystem').style.display = 'none';
|
| 475 |
-
document.getElementById('loginPage').style.display = 'flex';
|
| 476 |
-
|
| 477 |
-
// 清空登入表單
|
| 478 |
-
document.getElementById('loginForm').reset();
|
| 479 |
-
document.getElementById('errorMessage').textContent = '';
|
| 480 |
-
generateCaptcha();
|
| 481 |
-
}
|
| 482 |
|
| 483 |
-
|
| 484 |
-
|
| 485 |
-
|
| 486 |
-
|
| 487 |
-
|
| 488 |
-
|
| 489 |
-
|
| 490 |
-
|
| 491 |
-
|
| 492 |
-
|
|
|
|
|
|
|
| 493 |
}
|
| 494 |
-
document.getElementById(tabName).style.display = "block";
|
| 495 |
-
evt.currentTarget.className += " active";
|
| 496 |
-
}
|
| 497 |
|
| 498 |
-
|
| 499 |
-
|
| 500 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 501 |
generateCaptcha();
|
|
|
|
| 502 |
|
| 503 |
-
//
|
| 504 |
-
|
| 505 |
-
|
| 506 |
-
|
| 507 |
-
|
| 508 |
-
|
| 509 |
-
|
|
|
|
| 510 |
|
| 511 |
-
|
| 512 |
-
|
| 513 |
-
|
| 514 |
-
loginButton.textContent = '驗證中...';
|
| 515 |
-
loginButton.disabled = true;
|
| 516 |
|
| 517 |
-
|
| 518 |
-
|
| 519 |
-
|
| 520 |
-
|
| 521 |
-
|
| 522 |
-
} catch (error) {
|
| 523 |
-
document.getElementById('errorMessage').textContent = '登入驗證失敗,請重試';
|
| 524 |
-
} finally {
|
| 525 |
-
// 恢復按鈕狀態
|
| 526 |
-
loginButton.textContent = originalText;
|
| 527 |
-
loginButton.disabled = false;
|
| 528 |
-
}
|
| 529 |
-
});
|
| 530 |
|
| 531 |
-
//
|
| 532 |
-
document.
|
| 533 |
-
|
| 534 |
-
|
| 535 |
-
|
| 536 |
-
|
| 537 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 538 |
</script>
|
| 539 |
|
| 540 |
</body>
|
|
|
|
| 1 |
<!DOCTYPE html>
|
| 2 |
+
<html lang="zh-Hant">
|
| 3 |
|
| 4 |
<head>
|
|
|
|
| 5 |
<meta charset="UTF-8">
|
| 6 |
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 7 |
+
<title>PKM_RAG 系統登入</title>
|
|
|
|
|
|
|
| 8 |
<style>
|
| 9 |
+
/* --- 基本與通用樣式 --- */
|
| 10 |
+
body,
|
| 11 |
+
html {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
margin: 0;
|
| 13 |
padding: 0;
|
| 14 |
+
font-family: 'Poppins', sans-serif, 'Microsoft JhengHei', sans-serif;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
height: 100vh;
|
| 16 |
overflow: hidden;
|
| 17 |
}
|
| 18 |
|
| 19 |
+
/* --- 登入頁面 (來自 HTML02) --- */
|
| 20 |
+
#login-section {
|
| 21 |
+
background: url("https://images.unsplash.com/photo-1503264116251-35a269479413") no-repeat center center/cover;
|
| 22 |
+
height: 100vh;
|
| 23 |
display: flex;
|
|
|
|
| 24 |
justify-content: center;
|
| 25 |
+
align-items: center;
|
| 26 |
+
transition: opacity 0.6s ease-out;
|
| 27 |
}
|
| 28 |
|
| 29 |
+
.login-container {
|
| 30 |
+
background: rgba(255, 255, 255, 0.1);
|
| 31 |
+
backdrop-filter: blur(15px);
|
| 32 |
+
border-radius: 20px;
|
| 33 |
+
padding: 40px;
|
| 34 |
+
width: 380px;
|
| 35 |
+
text-align: center;
|
| 36 |
+
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
|
| 37 |
+
animation: fadeIn 1.5s ease;
|
| 38 |
+
border: 1px solid rgba(255, 255, 255, 0.2);
|
| 39 |
}
|
| 40 |
|
| 41 |
+
@keyframes fadeIn {
|
| 42 |
+
from {
|
| 43 |
+
opacity: 0;
|
| 44 |
+
transform: translateY(-50px);
|
| 45 |
+
}
|
| 46 |
+
|
| 47 |
+
to {
|
| 48 |
+
opacity: 1;
|
| 49 |
+
transform: translateY(0);
|
| 50 |
+
}
|
| 51 |
}
|
| 52 |
|
| 53 |
+
.login-container h2 {
|
| 54 |
+
color: white;
|
| 55 |
+
margin-bottom: 25px;
|
| 56 |
+
font-size: 2em;
|
|
|
|
| 57 |
}
|
| 58 |
|
| 59 |
+
.input-box {
|
| 60 |
+
margin-bottom: 20px;
|
| 61 |
+
text-align: left;
|
| 62 |
}
|
| 63 |
|
| 64 |
+
.input-box label {
|
| 65 |
+
color: white;
|
| 66 |
+
font-weight: bold;
|
| 67 |
display: block;
|
| 68 |
+
margin-bottom: 8px;
|
|
|
|
|
|
|
| 69 |
}
|
| 70 |
|
| 71 |
+
.input-box input {
|
| 72 |
width: 100%;
|
| 73 |
+
padding: 12px;
|
| 74 |
+
border: 1px solid transparent;
|
| 75 |
+
border-radius: 10px;
|
| 76 |
+
background: rgba(255, 255, 255, 0.2);
|
| 77 |
+
color: white;
|
| 78 |
+
font-size: 16px;
|
| 79 |
+
outline: none;
|
| 80 |
transition: all 0.3s ease;
|
| 81 |
+
box-sizing: border-box;
|
| 82 |
}
|
| 83 |
|
| 84 |
+
.input-box input::placeholder {
|
| 85 |
+
color: rgba(255, 255, 255, 0.7);
|
|
|
|
|
|
|
| 86 |
}
|
| 87 |
|
| 88 |
+
.input-box input:focus {
|
| 89 |
+
background: rgba(255, 255, 255, 0.3);
|
| 90 |
+
box-shadow: 0 0 10px rgba(0, 242, 254, 0.5);
|
| 91 |
+
border-color: rgba(0, 242, 254, 0.7);
|
| 92 |
}
|
| 93 |
|
| 94 |
+
.captcha-container {
|
| 95 |
+
display: flex;
|
| 96 |
+
align-items: center;
|
| 97 |
+
justify-content: space-between;
|
| 98 |
+
margin-top: 5px;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 99 |
}
|
| 100 |
|
| 101 |
+
#captcha-input {
|
| 102 |
+
width: 55%;
|
| 103 |
+
margin: 0;
|
| 104 |
}
|
| 105 |
|
| 106 |
+
#captcha-display {
|
| 107 |
+
font-size: 24px;
|
| 108 |
+
font-weight: bold;
|
| 109 |
+
padding: 5px 15px;
|
| 110 |
+
border-radius: 10px;
|
| 111 |
+
background: rgba(0, 0, 0, 0.3);
|
| 112 |
+
color: #fff;
|
| 113 |
+
letter-spacing: 4px;
|
| 114 |
+
user-select: none;
|
| 115 |
+
cursor: pointer;
|
| 116 |
+
text-decoration: line-through;
|
| 117 |
+
border: 1px solid rgba(255, 255, 255, 0.2);
|
| 118 |
}
|
| 119 |
|
| 120 |
+
.btn {
|
| 121 |
width: 100%;
|
| 122 |
+
padding: 12px;
|
|
|
|
|
|
|
| 123 |
border: none;
|
| 124 |
+
border-radius: 10px;
|
| 125 |
+
background: linear-gradient(135deg, #4facfe, #00f2fe);
|
| 126 |
+
color: white;
|
| 127 |
+
font-size: 18px;
|
| 128 |
+
font-weight: bold;
|
| 129 |
cursor: pointer;
|
| 130 |
transition: all 0.3s ease;
|
| 131 |
+
margin-top: 15px;
|
| 132 |
}
|
| 133 |
|
| 134 |
+
.btn:hover {
|
| 135 |
+
transform: scale(1.05);
|
| 136 |
+
box-shadow: 0 0 15px rgba(0, 242, 254, 0.6);
|
| 137 |
+
background: linear-gradient(135deg, #00f2fe, #4facfe);
|
| 138 |
}
|
| 139 |
|
| 140 |
+
.msg {
|
| 141 |
+
margin-top: 15px;
|
| 142 |
+
font-size: 14px;
|
| 143 |
+
color: #ffc107;
|
| 144 |
+
font-weight: bold;
|
| 145 |
+
min-height: 20px;
|
| 146 |
}
|
| 147 |
|
| 148 |
+
.msg.error {
|
| 149 |
+
color: #ff4d4d;
|
|
|
|
|
|
|
|
|
|
| 150 |
}
|
| 151 |
|
| 152 |
+
/* --- 主系統頁面 --- */
|
| 153 |
+
#main-app-section {
|
| 154 |
+
display: flex;
|
|
|
|
| 155 |
height: 100vh;
|
| 156 |
+
opacity: 0;
|
| 157 |
+
transition: opacity 0.6s ease-in;
|
| 158 |
}
|
| 159 |
|
| 160 |
+
.sidebar {
|
| 161 |
+
width: 260px;
|
| 162 |
+
background-color: #1c2833;
|
| 163 |
+
color: white;
|
|
|
|
| 164 |
display: flex;
|
| 165 |
flex-direction: column;
|
| 166 |
+
padding: 20px;
|
| 167 |
+
box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
|
| 168 |
+
box-sizing: border-box;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 169 |
}
|
| 170 |
|
| 171 |
+
.sidebar h1 {
|
| 172 |
+
font-size: 24px;
|
| 173 |
+
text-align: center;
|
| 174 |
+
color: #ecf0f1;
|
| 175 |
+
margin: 0 0 30px 0;
|
| 176 |
+
border-bottom: 1px solid #2c3e50;
|
| 177 |
+
padding-bottom: 15px;
|
|
|
|
|
|
|
|
|
|
|
|
|
| 178 |
}
|
| 179 |
|
| 180 |
+
.tabs {
|
| 181 |
+
flex-grow: 1;
|
|
|
|
| 182 |
}
|
| 183 |
|
| 184 |
.tab-button {
|
| 185 |
+
width: 100%;
|
| 186 |
+
padding: 15px 20px;
|
| 187 |
border: none;
|
| 188 |
+
border-radius: 8px;
|
| 189 |
+
margin-bottom: 10px;
|
| 190 |
+
cursor: pointer;
|
|
|
|
| 191 |
transition: all 0.3s ease;
|
| 192 |
+
font-size: 16px;
|
| 193 |
+
text-align: left;
|
| 194 |
+
background-color: #2c3e50;
|
| 195 |
+
color: white;
|
| 196 |
}
|
| 197 |
|
| 198 |
+
.tab-button.active {
|
| 199 |
+
background-color: #3498db;
|
| 200 |
+
transform: translateX(5px);
|
| 201 |
}
|
| 202 |
|
| 203 |
+
.tab-button:not(.active):hover {
|
| 204 |
+
background-color: #34495e;
|
| 205 |
+
transform: translateX(2px);
|
|
|
|
| 206 |
}
|
| 207 |
|
| 208 |
+
#logout-button {
|
| 209 |
+
padding: 12px;
|
| 210 |
+
border: none;
|
| 211 |
+
border-radius: 10px;
|
| 212 |
+
background-color: #e74c3c;
|
| 213 |
+
color: white;
|
| 214 |
+
font-size: 16px;
|
| 215 |
+
cursor: pointer;
|
| 216 |
+
transition: all 0.3s ease;
|
| 217 |
display: flex;
|
| 218 |
+
align-items: center;
|
| 219 |
+
justify-content: center;
|
| 220 |
+
gap: 8px;
|
| 221 |
}
|
| 222 |
|
| 223 |
+
#logout-button:hover {
|
| 224 |
+
background-color: #c0392b;
|
| 225 |
+
transform: translateY(-2px);
|
|
|
|
|
|
|
|
|
|
|
|
|
| 226 |
}
|
| 227 |
|
| 228 |
+
.content-area {
|
| 229 |
+
flex-grow: 1;
|
| 230 |
+
background-color: #ecf0f1;
|
| 231 |
+
position: relative;
|
|
|
|
|
|
|
|
|
|
| 232 |
}
|
| 233 |
|
| 234 |
.tab-content {
|
| 235 |
+
width: 100%;
|
| 236 |
+
height: 100%;
|
| 237 |
+
position: absolute;
|
| 238 |
+
top: 0;
|
| 239 |
+
left: 0;
|
| 240 |
+
opacity: 0;
|
| 241 |
+
transition: opacity 0.3s ease;
|
| 242 |
display: none;
|
|
|
|
|
|
|
| 243 |
}
|
| 244 |
|
| 245 |
+
.tab-content.active {
|
| 246 |
+
opacity: 1;
|
| 247 |
+
display: block;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 248 |
}
|
| 249 |
|
| 250 |
+
.content-area iframe {
|
| 251 |
width: 100%;
|
| 252 |
height: 100%;
|
| 253 |
+
border: none;
|
|
|
|
|
|
|
| 254 |
}
|
| 255 |
|
| 256 |
+
/* --- 顯示/隱藏控制 --- */
|
| 257 |
+
.hidden {
|
| 258 |
+
display: none !important;
|
| 259 |
+
opacity: 0 !important;
|
| 260 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 261 |
|
| 262 |
+
/* 添加測試帳號顯示區域 */
|
| 263 |
+
.test-info {
|
| 264 |
+
position: fixed;
|
| 265 |
+
bottom: 20px;
|
| 266 |
+
right: 20px;
|
| 267 |
+
background: rgba(0, 0, 0, 0.8);
|
| 268 |
+
color: white;
|
| 269 |
+
padding: 15px;
|
| 270 |
+
border-radius: 10px;
|
| 271 |
+
font-size: 12px;
|
| 272 |
+
z-index: 1000;
|
| 273 |
}
|
| 274 |
</style>
|
| 275 |
</head>
|
| 276 |
|
| 277 |
<body>
|
| 278 |
+
|
| 279 |
+
<section id="login-section">
|
| 280 |
+
<div class="login-container">
|
| 281 |
+
<h2>PKM_RAG System</h2>
|
| 282 |
+
<form id="login-form" autocomplete="off">
|
| 283 |
+
<div class="input-box">
|
| 284 |
+
<label for="username">帳號 (Username)</label>
|
| 285 |
+
<input type="text" id="username" placeholder="請輸入帳號" required>
|
|
|
|
|
|
|
| 286 |
</div>
|
| 287 |
+
<div class="input-box">
|
| 288 |
+
<label for="password">密碼 (Password)</label>
|
| 289 |
+
<input type="password" id="password" placeholder="請輸入密碼" required>
|
|
|
|
| 290 |
</div>
|
| 291 |
+
<div class="input-box">
|
| 292 |
+
<label for="captcha-input">驗證碼 (Captcha)</label>
|
|
|
|
| 293 |
<div class="captcha-container">
|
| 294 |
+
<input type="text" id="captcha-input" placeholder="輸入右側文字" required>
|
| 295 |
+
<span id="captcha-display" title="點擊更換驗證碼"></span>
|
| 296 |
</div>
|
| 297 |
</div>
|
| 298 |
+
<button class="btn" type="submit">登入 (Login)</button>
|
| 299 |
+
<p class="msg" id="msg"></p>
|
|
|
|
| 300 |
</form>
|
| 301 |
</div>
|
| 302 |
+
</section>
|
| 303 |
+
|
| 304 |
+
<section id="main-app-section" class="hidden">
|
| 305 |
+
<div class="sidebar">
|
| 306 |
+
<h1>主選單</h1>
|
| 307 |
+
<div class="tabs">
|
| 308 |
+
<button class="tab-button active" onclick="openTab(event, 'iframe01')">ESG爬蟲</button>
|
| 309 |
+
<button class="tab-button" onclick="openTab(event, 'iframe02')">多模態API 應用</button>
|
| 310 |
+
<button class="tab-button" onclick="openTab(event, 'iframe03')">Grop+Linebot+Webcam</button>
|
| 311 |
+
<button class="tab-button" onclick="openTab(event, 'iframe04')">RAG知識庫</button>
|
|
|
|
| 312 |
</div>
|
| 313 |
+
<button id="logout-button">回到登入頁面</button>
|
| 314 |
</div>
|
| 315 |
+
<div class="content-area">
|
| 316 |
+
<div id="iframe01" class="tab-content active">
|
|
|
|
|
|
|
|
|
|
|
|
|
| 317 |
<iframe src="https://z9760405-steamlit.hf.space" frameborder="0"></iframe>
|
| 318 |
</div>
|
| 319 |
|
| 320 |
<div id="iframe02" class="tab-content">
|
| 321 |
<iframe src="https://cjian2025-groq-api-gradio.hf.space" frameborder="0"></iframe>
|
| 322 |
</div>
|
| 323 |
+
|
| 324 |
<div id="iframe03" class="tab-content">
|
| 325 |
<iframe src="https://z9760405-webcam-groq-linebot-application.hf.space" frameborder="0"
|
| 326 |
allow="camera; microphone"></iframe>
|
| 327 |
</div>
|
| 328 |
+
|
| 329 |
+
<div id="iframe04" class="tab-content">
|
| 330 |
+
<iframe src="https://z9760405-resendlangchain.hf.space" frameborder="0"></iframe>
|
| 331 |
+
</div>
|
| 332 |
</div>
|
| 333 |
+
</section>
|
| 334 |
+
|
| 335 |
+
<!-- 測試用帳號密碼顯示 -->
|
| 336 |
+
<div class="test-info">
|
| 337 |
+
<strong>測試帳號:</strong><br>
|
| 338 |
+
帳號: ROOT2025 (不區分大小寫)<br>
|
| 339 |
+
密碼: 123456<br>
|
| 340 |
+
驗證碼: 點擊右側文字更換
|
| 341 |
</div>
|
| 342 |
|
| 343 |
<script>
|
| 344 |
+
document.addEventListener('DOMContentLoaded', () => {
|
| 345 |
+
console.log('頁面載入完成,開始初始化...');
|
| 346 |
+
|
| 347 |
+
// --- DOM 元素 ---
|
| 348 |
+
const loginSection = document.getElementById('login-section');
|
| 349 |
+
const mainAppSection = document.getElementById('main-app-section');
|
| 350 |
+
const loginForm = document.getElementById('login-form');
|
| 351 |
+
const usernameInput = document.getElementById('username');
|
| 352 |
+
const passwordInput = document.getElementById('password');
|
| 353 |
+
const captchaInput = document.getElementById('captcha-input');
|
| 354 |
+
const captchaDisplay = document.getElementById('captcha-display');
|
| 355 |
+
const msg = document.getElementById('msg');
|
| 356 |
+
const logoutButton = document.getElementById('logout-button');
|
| 357 |
+
|
| 358 |
+
// 檢查所有 DOM 元素是否正確載入
|
| 359 |
+
const elements = {
|
| 360 |
+
loginSection, mainAppSection, loginForm, usernameInput,
|
| 361 |
+
passwordInput, captchaInput, captchaDisplay, msg, logoutButton
|
| 362 |
+
};
|
| 363 |
+
|
| 364 |
+
for (const [name, element] of Object.entries(elements)) {
|
| 365 |
+
if (!element) {
|
| 366 |
+
console.error(`錯誤: 找不到元素 ${name}`);
|
| 367 |
+
return;
|
| 368 |
+
}
|
| 369 |
}
|
| 370 |
+
console.log('所有 DOM 元素載入成功');
|
|
|
|
| 371 |
|
| 372 |
+
// --- 預先計算好的 SHA-256 HASH 值 ---
|
| 373 |
+
// 正確帳號: ROOT2025 -> sha256 -> d7113846e19051e6d5752f60dcb53329e9563b2c7655452fb9aea5f27969cc4f
|
| 374 |
+
const correctUserHash = 'd7113846e19051e6d5752f60dcb53329e9563b2c7655452fb9aea5f27969cc4f';
|
| 375 |
+
// 正確密碼: 123456 -> sha256 -> 8d969eef6ecad3c29a3a629280e686cf0c3f5d5a86aff3ca12020c923adc6c92
|
| 376 |
+
const correctPassHash = '8d969eef6ecad3c29a3a629280e686cf0c3f5d5a86aff3ca12020c923adc6c92';
|
| 377 |
|
| 378 |
+
let currentCaptcha = '';
|
|
|
|
|
|
|
| 379 |
|
| 380 |
+
// --- 功能函式 ---
|
| 381 |
+
async function sha256(str) {
|
| 382 |
+
try {
|
| 383 |
+
const textBuffer = new TextEncoder().encode(str);
|
| 384 |
+
const hashBuffer = await crypto.subtle.digest('SHA-256', textBuffer);
|
| 385 |
+
const hashArray = Array.from(new Uint8Array(hashBuffer));
|
| 386 |
+
const hash = hashArray.map(b => b.toString(16).padStart(2, '0')).join('');
|
| 387 |
+
console.log(`SHA256("${str}") = ${hash}`);
|
| 388 |
+
return hash;
|
| 389 |
+
} catch (error) {
|
| 390 |
+
console.error('SHA256 計算錯誤:', error);
|
| 391 |
+
throw error;
|
| 392 |
+
}
|
| 393 |
}
|
| 394 |
|
| 395 |
+
function generateCaptcha() {
|
| 396 |
+
const chars = 'AbCdEfGhIjKlMnOpQrStUvWxYz0123456789';
|
| 397 |
+
let captcha = '';
|
| 398 |
+
for (let i = 0; i < 5; i++) {
|
| 399 |
+
captcha += chars.charAt(Math.floor(Math.random() * chars.length));
|
| 400 |
+
}
|
| 401 |
+
currentCaptcha = captcha;
|
| 402 |
+
captchaDisplay.textContent = currentCaptcha;
|
| 403 |
+
console.log('新驗證碼生成:', currentCaptcha);
|
| 404 |
}
|
| 405 |
|
| 406 |
+
function showMessage(message, isError = true) {
|
| 407 |
+
msg.textContent = message;
|
| 408 |
+
msg.className = isError ? 'msg error' : 'msg';
|
| 409 |
+
console.log('顯示訊息:', message, '錯誤狀態:', isError);
|
|
|
|
| 410 |
}
|
| 411 |
|
| 412 |
+
async function handleLogin(e) {
|
| 413 |
+
e.preventDefault();
|
| 414 |
+
console.log('開始處理登入...');
|
| 415 |
+
showMessage('', false);
|
| 416 |
+
|
| 417 |
+
const username = usernameInput.value.trim();
|
| 418 |
+
const password = passwordInput.value;
|
| 419 |
+
const captcha = captchaInput.value.trim();
|
| 420 |
+
|
| 421 |
+
console.log('輸入資訊:');
|
| 422 |
+
console.log('- 帳號:', username);
|
| 423 |
+
console.log('- 密碼長度:', password.length);
|
| 424 |
+
console.log('- 驗證碼:', captcha);
|
| 425 |
+
console.log('- 當前驗證碼:', currentCaptcha);
|
| 426 |
+
|
| 427 |
+
// 步驟 1: 優先檢查驗證碼
|
| 428 |
+
if (captcha.toLowerCase() !== currentCaptcha.toLowerCase()) {
|
| 429 |
+
console.log('驗證碼錯誤');
|
| 430 |
+
showMessage('❌ 驗證碼錯誤!請重新輸入。');
|
| 431 |
+
generateCaptcha();
|
| 432 |
+
captchaInput.value = '';
|
| 433 |
+
return;
|
| 434 |
+
}
|
| 435 |
|
| 436 |
+
try {
|
| 437 |
+
// 步驟 2: 雜湊使用者輸入
|
| 438 |
+
const enteredUserHash = await sha256(username.toUpperCase());
|
| 439 |
+
const enteredPassHash = await sha256(password);
|
| 440 |
+
|
| 441 |
+
console.log('Hash 比對:');
|
| 442 |
+
console.log('- 輸入帳號 Hash:', enteredUserHash);
|
| 443 |
+
console.log('- 正確帳號 Hash:', correctUserHash);
|
| 444 |
+
console.log('- 輸入密碼 Hash:', enteredPassHash);
|
| 445 |
+
console.log('- 正確密碼 Hash:', correctPassHash);
|
| 446 |
+
|
| 447 |
+
// 步驟 3: 比對 HASH 值
|
| 448 |
+
if (enteredUserHash === correctUserHash && enteredPassHash === correctPassHash) {
|
| 449 |
+
// 登入成功
|
| 450 |
+
console.log('登入成功!');
|
| 451 |
+
showMessage('✅ 登入成功!正在載入系統...', false);
|
| 452 |
+
loginSection.style.opacity = '0';
|
| 453 |
+
setTimeout(() => {
|
| 454 |
+
loginSection.classList.add('hidden');
|
| 455 |
+
mainAppSection.classList.remove('hidden');
|
| 456 |
+
mainAppSection.style.opacity = '1';
|
| 457 |
+
console.log('切換到主頁面完成');
|
| 458 |
+
}, 600);
|
| 459 |
+
} else {
|
| 460 |
+
// 登入失敗
|
| 461 |
+
console.log('帳號或密碼錯誤');
|
| 462 |
+
showMessage('❌ 帳號或密碼錯誤!');
|
| 463 |
+
generateCaptcha();
|
| 464 |
+
passwordInput.value = '';
|
| 465 |
+
captchaInput.value = '';
|
| 466 |
+
}
|
| 467 |
+
} catch (error) {
|
| 468 |
+
console.error('登入處理錯誤:', error);
|
| 469 |
+
showMessage('❌ 系統錯誤,請重試!');
|
| 470 |
+
}
|
| 471 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 472 |
|
| 473 |
+
function handleLogout() {
|
| 474 |
+
console.log('處理登出...');
|
| 475 |
+
mainAppSection.style.opacity = '0';
|
| 476 |
+
setTimeout(() => {
|
| 477 |
+
mainAppSection.classList.add('hidden');
|
| 478 |
+
loginSection.classList.remove('hidden');
|
| 479 |
+
loginSection.style.opacity = '1';
|
| 480 |
+
loginForm.reset();
|
| 481 |
+
showMessage('');
|
| 482 |
+
generateCaptcha();
|
| 483 |
+
console.log('登出完成');
|
| 484 |
+
}, 600);
|
| 485 |
}
|
|
|
|
|
|
|
|
|
|
| 486 |
|
| 487 |
+
// --- 事件監聽 ---
|
| 488 |
+
loginForm.addEventListener('submit', handleLogin);
|
| 489 |
+
logoutButton.addEventListener('click', handleLogout);
|
| 490 |
+
captchaDisplay.addEventListener('click', generateCaptcha);
|
| 491 |
+
|
| 492 |
+
// --- 初始化 ---
|
| 493 |
+
console.log('開始初始化驗證碼...');
|
| 494 |
generateCaptcha();
|
| 495 |
+
console.log('系統初始化完成');
|
| 496 |
|
| 497 |
+
// 測試用途:10秒後隱藏測試資訊
|
| 498 |
+
setTimeout(() => {
|
| 499 |
+
const testInfo = document.querySelector('.test-info');
|
| 500 |
+
if (testInfo) {
|
| 501 |
+
testInfo.style.display = 'none';
|
| 502 |
+
}
|
| 503 |
+
}, 10000);
|
| 504 |
+
});
|
| 505 |
|
| 506 |
+
// --- 選單切換功能 ---
|
| 507 |
+
function openTab(evt, tabName) {
|
| 508 |
+
console.log('切換到頁籤:', tabName);
|
|
|
|
|
|
|
| 509 |
|
| 510 |
+
// 隱藏所有內容
|
| 511 |
+
var tabContents = document.getElementsByClassName("tab-content");
|
| 512 |
+
for (var i = 0; i < tabContents.length; i++) {
|
| 513 |
+
tabContents[i].classList.remove("active");
|
| 514 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 515 |
|
| 516 |
+
// 移除所有按鈕的 active 類別
|
| 517 |
+
var tabButtons = document.getElementsByClassName("tab-button");
|
| 518 |
+
for (var i = 0; i < tabButtons.length; i++) {
|
| 519 |
+
tabButtons[i].classList.remove("active");
|
| 520 |
+
}
|
| 521 |
+
|
| 522 |
+
// 顯示選中的內容並激活按鈕
|
| 523 |
+
document.getElementById(tabName).classList.add("active");
|
| 524 |
+
evt.currentTarget.classList.add("active");
|
| 525 |
+
|
| 526 |
+
console.log('頁籤切換完成:', tabName);
|
| 527 |
+
}
|
| 528 |
</script>
|
| 529 |
|
| 530 |
</body>
|