From 9b791b556744212029e4307360ab529e2e53f20a Mon Sep 17 00:00:00 2001 From: liang-work Date: Sat, 13 Sep 2025 19:13:34 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AppMain.py | 2 +- core/SNAPI/CallServer.py | 2 +- core/WebApp.py | 23 +++++- webfile/Account.html | 46 ++++++++++++ webfile/chat.html | 46 ++++++++++++ webfile/index.html | 144 +++----------------------------------- webfile/realm.html | 46 ++++++++++++ webfile/static/styles.css | 121 ++++++++++++++++++++++++++++++++ 8 files changed, 292 insertions(+), 138 deletions(-) create mode 100644 webfile/Account.html create mode 100644 webfile/chat.html create mode 100644 webfile/realm.html create mode 100644 webfile/static/styles.css diff --git a/AppMain.py b/AppMain.py index 3d6030a..b0a220d 100644 --- a/AppMain.py +++ b/AppMain.py @@ -54,7 +54,7 @@ def main(): target=DBServices.DBStart, daemon=True ) - dbServices_thread.start() + #dbServices_thread.start() # 启动Webview try: WebViewWIndow.WebViewWIndow(#窗口配置 diff --git a/core/SNAPI/CallServer.py b/core/SNAPI/CallServer.py index 9da7b94..2c14f88 100644 --- a/core/SNAPI/CallServer.py +++ b/core/SNAPI/CallServer.py @@ -2,7 +2,7 @@ import requests import json from requests.exceptions import RequestException import platform -from . import PyWebPageAPI +from .. import PyWebPageAPI UA = f"SolianForPythonApp/0.0.1(A) ({PyWebPageAPI.GetDeviceInfo()})" diff --git a/core/WebApp.py b/core/WebApp.py index 5928a2e..8de7e76 100644 --- a/core/WebApp.py +++ b/core/WebApp.py @@ -1,6 +1,10 @@ import flask +from flask import Flask +import os -app = flask.Flask(__name__, template_folder='../webfile', static_folder='../webfile/static') +app = Flask(__name__) + +app = flask.Flask(__name__, template_folder='../webfile', static_folder='../webfile/static', static_url_path='/static') @app.errorhandler(500) def internal_server_error(error): @@ -19,11 +23,24 @@ def forbidden(error): @app.route('/') def index(): - return flask.render_template('index.html') + return flask.render_template('index.html',static_url_path='/static') + +@app.route('/Account') +def Account(): + return flask.render_template('Account.html') + +@app.route('/Realm') +def Realm(): + return flask.render_template('Realm.html') + + +@app.route('/Chat') +def Chat(): + return flask.render_template('Chat.html') def AppStart(host: str, port: int): """启动Flask应用""" app.run(host=host, port=port, debug=True, use_reloader=False) if __name__ == '__main__': - app.run(host="127.0.0.1", port=5000, debug=True) + app.run(host="127.0.0.1", port=5000, debug=True) \ No newline at end of file diff --git a/webfile/Account.html b/webfile/Account.html new file mode 100644 index 0000000..3ff7672 --- /dev/null +++ b/webfile/Account.html @@ -0,0 +1,46 @@ + + + + + + 账户设置 + + + +
+ +

Solsynth network

+
+ +
+ + +
+

账户设置

+
+

账户信息

+

这里是账户设置界面。

+
+
+
+ + + + \ No newline at end of file diff --git a/webfile/chat.html b/webfile/chat.html new file mode 100644 index 0000000..96175e9 --- /dev/null +++ b/webfile/chat.html @@ -0,0 +1,46 @@ + + + + + + 聊天管理 + + + +
+ +

Solsynth network

+
+ +
+ + +
+

聊天管理

+
+

聊天功能

+

这里是聊天管理界面。

+
+
+
+ + + + \ No newline at end of file diff --git a/webfile/index.html b/webfile/index.html index 228101b..1937c9c 100644 --- a/webfile/index.html +++ b/webfile/index.html @@ -4,134 +4,7 @@ Solsynth network - +
@@ -143,10 +16,10 @@ @@ -171,6 +44,11 @@ document.getElementById('menuToggle').addEventListener('click', function() { document.getElementById('sidebar').classList.toggle('open'); }); + + // 为侧边栏菜单项添加悬停效果 + document.querySelectorAll('.sidebar-menu li').forEach(item => { + item.style.cursor = 'pointer'; + }); - + \ No newline at end of file diff --git a/webfile/realm.html b/webfile/realm.html new file mode 100644 index 0000000..61bedc0 --- /dev/null +++ b/webfile/realm.html @@ -0,0 +1,46 @@ + + + + + + 领域管理 + + + +
+ +

Solsynth network

+
+ +
+ + +
+

领域管理

+
+

领域功能

+

这里是领域管理界面。

+
+
+
+ + + + \ No newline at end of file diff --git a/webfile/static/styles.css b/webfile/static/styles.css new file mode 100644 index 0000000..383d1f0 --- /dev/null +++ b/webfile/static/styles.css @@ -0,0 +1,121 @@ +* { + margin: 0; + padding: 0; + box-sizing: border-box; + font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif; +} + +body { + display: flex; + flex-direction: column; + height: 100vh; + background-color: #f3f3f3; + color: #333; +} + +.title-bar { + height: 48px; + background-color: #0078d7; + color: white; + display: flex; + align-items: center; + padding: 0 16px; + box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); + z-index: 10; +} + +.title-bar h1 { + font-size: 18px; + font-weight: 500; +} + +.menu-toggle { + display: none; + background: none; + border: none; + color: white; + font-size: 20px; + margin-right: 16px; + cursor: pointer; +} + +.main-container { + display: flex; + flex: 1; + overflow: hidden; +} + +.sidebar { + width: 220px; + background-color: white; + border-right: 1px solid #e1e1e1; + transition: transform 0.3s ease; + overflow-y: auto; + z-index: 5; +} + +.sidebar-header { + padding: 16px; + border-bottom: 1px solid #e1e1e1; + font-weight: 600; +} + +.sidebar-menu { + list-style: none; +} + +.sidebar-menu li { + padding: 12px 16px; + cursor: pointer; + transition: background-color 0.2s; +} + +.sidebar-menu li:hover { + background-color: #f5f5f5; +} + +.sidebar-menu li.active { + background-color: #e5f1fb; + color: #0078d7; + border-left: 3px solid #0078d7; +} + +.content { + flex: 1; + padding: 24px; + overflow-y: auto; + background-color: white; +} + +.content h2 { + margin-bottom: 16px; + font-weight: 500; +} + +.card { + background-color: #f9f9f9; + border-radius: 4px; + padding: 16px; + margin-bottom: 16px; + box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); +} + +@media (max-width: 768px) { + .menu-toggle { + display: block; + } + + .sidebar { + position: absolute; + height: calc(100vh - 48px); + transform: translateX(-100%); + } + + .sidebar.open { + transform: translateX(0); + } + + .content { + padding: 16px; + } +} \ No newline at end of file