修改了Gunicorn标签内容

This commit is contained in:
2025-08-28 22:30:17 +08:00
parent d559a85feb
commit 59b1f0e92a
13 changed files with 752 additions and 128 deletions

View File

@@ -1,4 +1,5 @@
import os
import json
from loguru import logger
from PySide6.QtWidgets import (QWidget, QVBoxLayout, QHBoxLayout, QLabel, QLineEdit,
QPushButton, QComboBox, QMessageBox, QTextEdit,
@@ -15,6 +16,10 @@ class DjangoTab(QWidget):
self.parent = parent
self.init_ui()
# 连接服务器切换信号
if self.parent and hasattr(self.parent, 'server_changed'):
self.parent.server_changed.connect(self.on_server_changed)
logger.info("Django标签已连接到服务器切换信号")
def init_ui(self):
layout = QVBoxLayout()
@@ -100,9 +105,31 @@ class DjangoTab(QWidget):
self.load_django_path()
def load_django_path(self):
if self.parent and hasattr(self.parent, 'server_connection_tab'):
django_path = self.parent.server_connection_tab.django_path_input.text()
self.django_path_input.setText(django_path)
"""从当前服务器配置加载Django路径"""
try:
if self.parent and hasattr(self.parent, 'get_current_config'):
config = self.parent.get_current_config()
if config:
django_path = config.get('django_path', '')
self.django_path_input.setText(django_path)
logger.info(f"从当前服务器配置加载django路径: {django_path}")
else:
logger.warning("未找到当前服务器配置")
else:
# 兼容旧的加载方式
config_path = os.path.join(os.path.dirname(__file__), 'config.json')
with open(config_path, 'r', encoding='utf-8') as f:
config = json.load(f)
if config and 'servers' in config and len(config['servers']) > 0:
server_config = config['servers'][0]
django_path = server_config.get('django_path', '')
self.django_path_input.setText(django_path)
logger.info(f"从配置文件加载django路径: {django_path}")
except Exception as e:
logger.error(f"加载django路径失败: {str(e)}")
# 不显示警告,避免影响用户体验
QMessageBox.warning(self, "警告", f"加载django路径失败: {str(e)}")
def check_ssh_connection(self):
if not self.parent or not self.parent.ssh_client: