0
0

删除了数据保存中的内容项

This commit is contained in:
xubing
2025-12-04 10:16:57 +08:00
parent 5aae34ea36
commit 7688c54d4a
11 changed files with 95 additions and 55 deletions

View File

@@ -181,7 +181,6 @@ class ProjectService {
id: newId,
name: name,
fileName: name.toLowerCase().replace(/\s+/g, '_'),
content: `# ${name} 配置文件\n# 创建时间: ${new Date().toLocaleString()}\n# 您可以在此编辑配置内容\n\n`,
containerId: containerId
};
this.configs.push(newConfig);
@@ -301,14 +300,12 @@ class ProjectService {
id: this.generateUniqueId('cfg', this.configs),
name: '配置1',
fileName: 'dockerfile',
content: `# ${container.name} 的 Dockerfile\nFROM ubuntu:20.04\n\n# 设置工作目录\nWORKDIR /app\n\n# 复制文件\nCOPY . .\n\n# 安装依赖\nRUN apt-get update && apt-get install -y \\\n python3 \\\n python3-pip\n\n# 暴露端口\nEXPOSE 8080\n\n# 启动命令\nCMD ["python3", "app.py"]`,
containerId: container.id
});
this.configs.push({
id: this.generateUniqueId('cfg', this.configs),
name: '配置2',
fileName: 'docker-compose.yml',
content: `# ${container.name} 的 Docker Compose 配置\nversion: '3.8'\n\nservices:\n ${container.name.toLowerCase().replace(/\s+/g, '-')}:\n build: .\n container_name: ${container.name}\n ports:\n - "8080:8080"\n environment:\n - NODE_ENV=production\n volumes:\n - ./data:/app/data\n restart: unless-stopped`,
containerId: container.id
});
}