sheng #1
@ -4,6 +4,9 @@ def create_app():
|
||||
app = Flask(__name__)
|
||||
|
||||
from app.routes.main import main_bp
|
||||
from app.routes.settings import settings_bp
|
||||
|
||||
app.register_blueprint(main_bp)
|
||||
app.register_blueprint(settings_bp)
|
||||
|
||||
return app
|
||||
|
7
app/routes/settings.py
Normal file
7
app/routes/settings.py
Normal file
@ -0,0 +1,7 @@
|
||||
from flask import render_template, Blueprint
|
||||
|
||||
settings_bp = Blueprint('settings', __name__)
|
||||
|
||||
@settings_bp.route('/settings', methods=['GET', 'POST'])
|
||||
def settings():
|
||||
return render_template('/settings.html', title='設定')
|
@ -19,6 +19,15 @@
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<ul class="navbar-nav ms-auto">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link px-3 {% if request.endpoint == 'settings.settings' %}fw-medium text-primary{% endif %}"
|
||||
href="{{ url_for('settings.settings') }}">
|
||||
<i class="bi bi-gear"></i> 設定
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
|
83
app/templates/settings.html
Normal file
83
app/templates/settings.html
Normal file
@ -0,0 +1,83 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block content %}
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-3">
|
||||
<!-- 設定導航側邊欄 -->
|
||||
<div class="card shadow-sm mb-4">
|
||||
<div class="list-group list-group-flush">
|
||||
<a href="#overview" class="list-group-item list-group-item-action active"
|
||||
data-bs-toggle="list">
|
||||
<i class="bi bi-speedometer2 me-2"></i>總覽
|
||||
</a>
|
||||
<a href="#data" class="list-group-item list-group-item-action"
|
||||
data-bs-toggle="list">
|
||||
<i class="bi bi-database me-2"></i>數據管理
|
||||
</a>
|
||||
<a href="#about" class="list-group-item list-group-item-action"
|
||||
data-bs-toggle="list">
|
||||
<i class="bi bi-info-circle me-2"></i>關於系統
|
||||
</a>
|
||||
<!-- 未來可以在這裡添加更多設定分類 -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-7">
|
||||
<!-- 設定內容區域 -->
|
||||
<div class="tab-content">
|
||||
<!-- 總覽 -->
|
||||
<div class="tab-pane fade show active" id="overview">
|
||||
<div class="card shadow-sm mb-4">
|
||||
<div class="card-header bg-primary text-white">
|
||||
<h5 class="card-title mb-0">系統總覽</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="row g-4">
|
||||
<div class="col-sm-6">
|
||||
<div class="border rounded p-3 text-center">
|
||||
<h3 class="mb-0">00</h3>
|
||||
<small class="text-muted">條記錄</small>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<div class="border rounded p-3 text-center">
|
||||
<h3 class="mb-0">00</h3>
|
||||
<small class="text-muted">條記錄</small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 關於系統 -->
|
||||
<div class="tab-pane fade" id="about">
|
||||
<div class="card shadow-sm mb-4">
|
||||
<div class="card-header bg-primary text-white">
|
||||
<h5 class="card-title mb-0">關於系統</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="mb-4">
|
||||
<h6 class="fw-bold">系統資訊</h6>
|
||||
<table class="table table-sm">
|
||||
<tr>
|
||||
<td class="text-muted" style="width: 120px;">版本</td>
|
||||
<td>1.0.0</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="text-muted">最後更新</td>
|
||||
<td>2024-10-26</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="text-muted">安全性</td>
|
||||
<td><i class="bi bi-shield-check text-success"></i> CSRF 保護已啟用</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
Loading…
Reference in New Issue
Block a user