| 599 | |
| 600 | |
| 601 | def build_setup_success_page() -> str: |
| 602 | return """<!doctype html> |
| 603 | <html lang="zh-CN"> |
| 604 | <head> |
| 605 | <meta charset="utf-8"> |
| 606 | <meta name="viewport" content="width=device-width, initial-scale=1"> |
| 607 | <meta http-equiv="refresh" content="2;url=/#/admin"> |
| 608 | <title>初始化完成</title> |
| 609 | <style> |
| 610 | body { |
| 611 | margin: 0; |
| 612 | min-height: 100vh; |
| 613 | display: grid; |
| 614 | place-items: center; |
| 615 | padding: 24px; |
| 616 | font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; |
| 617 | background: #f6f8fb; |
| 618 | color: #172033; |
| 619 | } |
| 620 | main { |
| 621 | width: min(100%, 420px); |
| 622 | padding: 28px; |
| 623 | border: 1px solid #d9e1ec; |
| 624 | border-radius: 8px; |
| 625 | background: #fff; |
| 626 | text-align: center; |
| 627 | box-shadow: 0 18px 50px rgba(23, 32, 51, .08); |
| 628 | } |
| 629 | h1 { margin: 0 0 10px; font-size: 24px; letter-spacing: 0; } |
| 630 | p { margin: 0 0 22px; color: #60708a; line-height: 1.65; } |
| 631 | a { |
| 632 | display: inline-flex; |
| 633 | align-items: center; |
| 634 | justify-content: center; |
| 635 | min-height: 42px; |
| 636 | padding: 0 18px; |
| 637 | border-radius: 6px; |
| 638 | background: #2563eb; |
| 639 | color: white; |
| 640 | text-decoration: none; |
| 641 | font-weight: 700; |
| 642 | } |
| 643 | </style> |
| 644 | </head> |
| 645 | <body> |
| 646 | <main> |
| 647 | <h1>初始化完成</h1> |
| 648 | <p>管理员密码已设置,请使用刚才的密码登录后台。</p> |
| 649 | <a href="/#/admin">进入后台</a> |
| 650 | </main> |
| 651 | </body> |
| 652 | </html>""" |
| 653 | |
| 654 | |
| 655 | def setup_response(content: str, status_code: int = 200) -> HTMLResponse: |