初始化项目:云下飞个人网站
功能: - 精美欢迎页面 - 用户登录/注册 - 主题切换(明/暗模式) - 快捷导航栏(思源/Gitea/NocoDB) 技术栈:Python 3.12 + Flask 3.0 + SQLite
This commit is contained in:
39
templates/index.html
Normal file
39
templates/index.html
Normal file
@@ -0,0 +1,39 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>欢迎 - 云下飞</title>
|
||||
<link rel="stylesheet" href="{{ url_for('static', filename='css/style.css') }}">
|
||||
</head>
|
||||
<body>
|
||||
<!-- 快捷导航栏 -->
|
||||
<div class="quick-nav">
|
||||
<a href="http://1.14.58.157:6806" target="_blank" class="nav-btn" title="思源笔记">📝 思源</a>
|
||||
<a href="http://1.14.58.157:3000" target="_blank" class="nav-btn" title="Gitea">📦 Gitea</a>
|
||||
<a href="http://1.14.58.157:8080" target="_blank" class="nav-btn" title="NocoDB">📊 NocoDB</a>
|
||||
<button class="theme-toggle" aria-label="切换主题">🌙</button>
|
||||
</div>
|
||||
|
||||
<div class="container">
|
||||
<div class="avatar">
|
||||
<span class="sparkle">👋</span>
|
||||
</div>
|
||||
<h1>欢迎</h1>
|
||||
<p class="welcome">Welcome!</p>
|
||||
<p class="message">
|
||||
这是您的个人服务器<br>
|
||||
由 <strong>小白</strong> 🐶 为您精心打造<br>
|
||||
祝您使用愉快!
|
||||
</p>
|
||||
<div class="auth-buttons">
|
||||
<a href="{{ url_for('login') }}" class="btn btn-primary">登录</a>
|
||||
<a href="{{ url_for('register') }}" class="btn btn-secondary">注册</a>
|
||||
</div>
|
||||
<div class="footer">
|
||||
Powered by <span>Flask</span> & <span>OpenClaw</span>
|
||||
</div>
|
||||
</div>
|
||||
<script src="{{ url_for('static', filename='js/theme.js') }}"></script>
|
||||
</body>
|
||||
</html>
|
||||
55
templates/login.html
Normal file
55
templates/login.html
Normal file
@@ -0,0 +1,55 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>登录 - 云下飞</title>
|
||||
<link rel="stylesheet" href="{{ url_for('static', filename='css/style.css') }}">
|
||||
</head>
|
||||
<body>
|
||||
<!-- 快捷导航栏 -->
|
||||
<div class="quick-nav">
|
||||
<a href="http://1.14.58.157:6806" target="_blank" class="nav-btn" title="思源笔记">📝 思源</a>
|
||||
<a href="http://1.14.58.157:3000" target="_blank" class="nav-btn" title="Gitea">📦 Gitea</a>
|
||||
<a href="http://1.14.58.157:8080" target="_blank" class="nav-btn" title="NocoDB">📊 NocoDB</a>
|
||||
<button class="theme-toggle" aria-label="切换主题">🌙</button>
|
||||
</div>
|
||||
|
||||
<div class="container auth-container">
|
||||
<div class="avatar">
|
||||
<span>🔐</span>
|
||||
</div>
|
||||
<h1>用户登录</h1>
|
||||
|
||||
{% with messages = get_flashed_messages(with_categories=true) %}
|
||||
{% if messages %}
|
||||
{% for category, message in messages %}
|
||||
<div class="flash-{{ category }}">{{ message }}</div>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% endwith %}
|
||||
|
||||
<form method="POST" action="{{ url_for('login') }}">
|
||||
<div class="form-group">
|
||||
<input type="text" name="username" placeholder="用户名" required>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="password" name="password" placeholder="密码" required>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary btn-full">登录</button>
|
||||
</form>
|
||||
|
||||
<p class="auth-link">
|
||||
还没有账户?<a href="{{ url_for('register') }}">立即注册</a>
|
||||
</p>
|
||||
<p class="auth-link">
|
||||
<a href="{{ url_for('index') }}">返回首页</a>
|
||||
</p>
|
||||
|
||||
<div class="footer">
|
||||
Powered by <span>Flask</span> & <span>OpenClaw</span>
|
||||
</div>
|
||||
</div>
|
||||
<script src="{{ url_for('static', filename='js/theme.js') }}"></script>
|
||||
</body>
|
||||
</html>
|
||||
58
templates/register.html
Normal file
58
templates/register.html
Normal file
@@ -0,0 +1,58 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>注册 - 云下飞</title>
|
||||
<link rel="stylesheet" href="{{ url_for('static', filename='css/style.css') }}">
|
||||
</head>
|
||||
<body>
|
||||
<!-- 快捷导航栏 -->
|
||||
<div class="quick-nav">
|
||||
<a href="http://1.14.58.157:6806" target="_blank" class="nav-btn" title="思源笔记">📝 思源</a>
|
||||
<a href="http://1.14.58.157:3000" target="_blank" class="nav-btn" title="Gitea">📦 Gitea</a>
|
||||
<a href="http://1.14.58.157:8080" target="_blank" class="nav-btn" title="NocoDB">📊 NocoDB</a>
|
||||
<button class="theme-toggle" aria-label="切换主题">🌙</button>
|
||||
</div>
|
||||
|
||||
<div class="container auth-container">
|
||||
<div class="avatar">
|
||||
<span>📝</span>
|
||||
</div>
|
||||
<h1>用户注册</h1>
|
||||
|
||||
{% with messages = get_flashed_messages(with_categories=true) %}
|
||||
{% if messages %}
|
||||
{% for category, message in messages %}
|
||||
<div class="flash-{{ category }}">{{ message }}</div>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% endwith %}
|
||||
|
||||
<form method="POST" action="{{ url_for('register') }}">
|
||||
<div class="form-group">
|
||||
<input type="text" name="username" placeholder="用户名(至少3个字符)" required>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="password" name="password" placeholder="密码(至少6个字符)" required>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="password" name="confirm_password" placeholder="确认密码" required>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary btn-full">注册</button>
|
||||
</form>
|
||||
|
||||
<p class="auth-link">
|
||||
已有账户?<a href="{{ url_for('login') }}">立即登录</a>
|
||||
</p>
|
||||
<p class="auth-link">
|
||||
<a href="{{ url_for('index') }}">返回首页</a>
|
||||
</p>
|
||||
|
||||
<div class="footer">
|
||||
Powered by <span>Flask</span> & <span>OpenClaw</span>
|
||||
</div>
|
||||
</div>
|
||||
<script src="{{ url_for('static', filename='js/theme.js') }}"></script>
|
||||
</body>
|
||||
</html>
|
||||
42
templates/welcome.html
Normal file
42
templates/welcome.html
Normal file
@@ -0,0 +1,42 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>欢迎回来 - {{ username }}</title>
|
||||
<link rel="stylesheet" href="{{ url_for('static', filename='css/style.css') }}">
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<button class="theme-toggle" aria-label="切换主题">🌙</button>
|
||||
<div class="avatar">
|
||||
<span class="sparkle">🎉</span>
|
||||
</div>
|
||||
<h1>欢迎回来,{{ username }}!</h1>
|
||||
<p class="welcome">Welcome Back!</p>
|
||||
<p class="message">
|
||||
您已成功登录<br>
|
||||
这是您的专属空间<br>
|
||||
小白一直陪伴着您 🐶
|
||||
</p>
|
||||
<div class="auth-buttons">
|
||||
<a href="{{ url_for('logout') }}" class="btn btn-danger">退出登录</a>
|
||||
</div>
|
||||
<div class="footer">
|
||||
Powered by <span>Flask</span> & <span>OpenClaw</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% with messages = get_flashed_messages(with_categories=true) %}
|
||||
{% if messages %}
|
||||
<div class="flash-messages">
|
||||
{% for category, message in messages %}
|
||||
<div class="flash-{{ category }}">{{ message }}</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endwith %}
|
||||
|
||||
<script src="{{ url_for('static', filename='js/theme.js') }}"></script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user