新增: 多工程管理(编辑/删除确认/记忆选中/自动扫描子仓库)
- 工程编辑入口:工具栏编辑按钮+弹窗(名称/路径/Git地址) - 工程删除二次确认:防误删 - 记住上次选中工程:localStorage 持久化 - 自动扫描子仓库:下拉菜单加扫描入口,发现 .git 子目录自动建工程
This commit is contained in:
@@ -87,6 +87,11 @@ export const moduleApi = {
|
||||
return invoke('add_project_module', { input })
|
||||
},
|
||||
|
||||
/** 扫描项目绑定目录下的子仓库,自动创建工程记录(幂等)。返回新创建数量。 */
|
||||
scanProjectModules(projectId: string): Promise<number> {
|
||||
return invoke('scan_project_modules', { projectId })
|
||||
},
|
||||
|
||||
/** 列出项目全部工程(按 sort_order ASC)。 */
|
||||
listProjectModules(projectId: string): Promise<ProjectModuleRecord[]> {
|
||||
return invoke('list_project_modules', { projectId })
|
||||
@@ -128,6 +133,22 @@ export const moduleApi = {
|
||||
return invoke('get_module_file_diff', { moduleId, filePath })
|
||||
},
|
||||
|
||||
/** 更新工程记录。 */
|
||||
updateProjectModule(input: {
|
||||
id: string
|
||||
name?: string
|
||||
path?: string
|
||||
gitUrl?: string | null
|
||||
stack?: string | null
|
||||
}): Promise<ProjectModuleRecord> {
|
||||
return invoke('update_project_module', { input })
|
||||
},
|
||||
|
||||
/** 删除工程记录。 */
|
||||
removeProjectModule(moduleId: string): Promise<void> {
|
||||
return invoke('remove_project_module', { id: moduleId })
|
||||
},
|
||||
|
||||
/** 分页查询工程 Git 提交历史。返回 { commits, has_more }。 */
|
||||
getModuleCommits(moduleId: string, skip?: number, limit?: number): Promise<{
|
||||
commits: { hash: string; subject: string; timestamp: number }[]
|
||||
|
||||
Reference in New Issue
Block a user