import { BaseView } from './BaseView'; import { ContainerConfigData, ConfigViewData } from '../types/ViewTypes'; // Git 分支接口 interface GitBranch { name: string; isCurrent: boolean; isRemote: boolean; selected?: boolean; } // Git 文件树接口 interface GitFileTree { name: string; type: 'file' | 'folder'; path: string; children?: GitFileTree[]; } // Git 仓库接口 interface GitRepo { id: string; name: string; url: string; localPath: string; branch: string; lastSync: string; containerId: string; } export class ConfigView extends BaseView { render(data?: ContainerConfigData & { gitRepos?: GitRepo[]; currentGitRepo?: GitRepo; gitFileTree?: GitFileTree[]; gitLoading?: boolean; gitBranches?: GitBranch[]; gitRepoUrl?: string; }): string { const container = data?.container; const configs = data?.configs || []; const gitRepos = data?.gitRepos || []; const currentGitRepo = data?.currentGitRepo; const gitFileTree = data?.gitFileTree || []; const gitLoading = data?.gitLoading || false; const gitBranches = data?.gitBranches || []; const gitRepoUrl = data?.gitRepoUrl || ''; // 生成配置列表的 HTML - 包含配置文件和 Git 仓库 const configsHtml = configs.map((config: ConfigViewData) => `
| 配置 | 文件 | 操作 |
|---|---|---|