增加了sock的站点配置文件修改按钮
增加了下拉站点配置文件按钮 增加了静态文件的配置内容,写入到站点配置文件的按钮
This commit is contained in:
Binary file not shown.
19
app.log
19
app.log
@@ -5014,3 +5014,22 @@ Sep 07 12:20:19 statuspage systemd[1]: Started nginx.service - A high performanc
|
||||
2025-09-07 12:38:33.241 | INFO | nginx_tab:run:171 - 开始执行Nginx服务操作: status
|
||||
2025-09-07 12:38:33.272 | INFO | nginx_tab:run:196 - Nginx status 操作成功
|
||||
2025-09-07 12:38:33.274 | INFO | nginx_tab:on_control_result:963 - Nginx服务控制成功: Nginx status 操作成功
|
||||
● nginx.service - A high performance web server and a reverse proxy server
|
||||
Loaded: loaded (/usr/lib/systemd/system/nginx.service; enabled; preset: enabled)
|
||||
Active: active (running) since Sun 2025-09-07 12:20:19 CST; 18min ago
|
||||
Invocation: c4f06a4c2b114a538d3ac675f9778381
|
||||
Docs: man:nginx(8)
|
||||
Process: 2868 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
|
||||
Process: 2870 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
|
||||
Main PID: 2871 (nginx)
|
||||
Tasks: 3 (limit: 1844)
|
||||
Memory: 2.8M (peak: 3.2M)
|
||||
CPU: 26ms
|
||||
CGroup: /system.slice/nginx.service
|
||||
├─2871 "nginx: master process /usr/sbin/nginx -g daemon on; master_process on;"
|
||||
├─2872 "nginx: worker process"
|
||||
└─2873 "nginx: worker process"
|
||||
|
||||
Sep 07 12:20:19 statuspage systemd[1]: Starting nginx.service - A high performance web server and a reverse proxy server...
|
||||
Sep 07 12:20:19 statuspage systemd[1]: Started nginx.service - A high performance web server and a reverse proxy server.
|
||||
|
||||
|
||||
10
nginx_tab.py
10
nginx_tab.py
@@ -860,7 +860,11 @@ http {
|
||||
project_name = server_config.get('project', '')
|
||||
remote_dir = server_config.get('remote_dir', '')
|
||||
|
||||
# 构建静态文件路径
|
||||
# 根据要求构建静态文件路径
|
||||
# BASE_DIR = Path(__file__).resolve().parent.parent
|
||||
# STATIC_ROOT = BASE_DIR / "static"
|
||||
# MEDIA_ROOT = BASE_DIR / "media"
|
||||
# 在实际路径中,这对应于项目目录下的static和media文件夹
|
||||
static_path = f"{remote_dir}/{project_name}/static"
|
||||
media_path = f"{remote_dir}/{project_name}/media"
|
||||
|
||||
@@ -870,14 +874,14 @@ http {
|
||||
# 检查是否已经包含静态文件映射
|
||||
if "location /static/" not in current_config:
|
||||
# 添加静态文件映射配置
|
||||
static_mapping = f"\n # 静态文件映射\n"
|
||||
static_mapping = f"\n # 静态文件映射 (STATIC_ROOT = BASE_DIR / \"static\")\n"
|
||||
static_mapping += f" location /static/ {{\n"
|
||||
static_mapping += f" alias {static_path}/;\n"
|
||||
static_mapping += f" expires 30d;\n"
|
||||
static_mapping += f" }}\n"
|
||||
|
||||
# 添加媒体文件映射配置
|
||||
static_mapping += f"\n # 媒体文件映射\n"
|
||||
static_mapping += f"\n # 媒体文件映射 (MEDIA_ROOT = BASE_DIR / \"media\")\n"
|
||||
static_mapping += f" location /media/ {{\n"
|
||||
static_mapping += f" alias {media_path}/;\n"
|
||||
static_mapping += f" expires 30d;\n"
|
||||
|
||||
Reference in New Issue
Block a user