增加查看Gunicorn的日志的按钮和功能

This commit is contained in:
2025-08-29 21:18:47 +08:00
parent 59b1f0e92a
commit 901b978cc8
10 changed files with 736 additions and 463 deletions

View File

@@ -105,14 +105,15 @@ class DjangoTab(QWidget):
self.load_django_path()
def load_django_path(self):
"""当前服务器配置加载Django路径"""
"""config.json加载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', '')
# 使用remote_directory而不是django_path
django_path = config.get('remote_directory', '')
self.django_path_input.setText(django_path)
logger.info(f"从当前服务器配置加载django路径: {django_path}")
logger.info(f"从当前服务器配置加载Django路径: {django_path}")
else:
logger.warning("未找到当前服务器配置")
else:
@@ -123,11 +124,12 @@ class DjangoTab(QWidget):
if config and 'servers' in config and len(config['servers']) > 0:
server_config = config['servers'][0]
django_path = server_config.get('django_path', '')
# 使用remote_directory
django_path = server_config.get('remote_directory', '')
self.django_path_input.setText(django_path)
logger.info(f"从配置文件加载django路径: {django_path}")
logger.info(f"从配置文件加载Django路径: {django_path}")
except Exception as e:
logger.error(f"加载django路径失败: {str(e)}")
logger.error(f"加载Django路径失败: {str(e)}")
# 不显示警告,避免影响用户体验
QMessageBox.warning(self, "警告", f"加载django路径失败: {str(e)}")