feat(project): add workspace directory configuration and management (#1)

- Add projectDir field to Project model for workspace directory management
- Implement workspace directory creation, validation and Git initialization
- Add workspace status query endpoint with directory info and Git status
- Create GitManager for Git repository operations (clone, branch, commit info)
- Add PathValidator for secure path validation and traversal attack prevention
- Implement execution queue with concurrency control for build tasks

- Refactor project list UI to remove edit/delete actions from cards
- Add project settings tab in detail page with edit/delete functionality
- Add icons to all tabs (History, Code, Settings)
- Implement time formatting with dayjs in YYYY-MM-DD HH:mm:ss format
- Display all timestamps using browser's local timezone

- Update PipelineRunner to use workspace directory for command execution
- Add workspace status card showing directory path, size, Git info
- Enhance CreateProjectModal with repository URL validation

Reviewed-on: #1
This commit was merged in pull request #1.
This commit is contained in:
2026-01-03 00:55:55 +08:00
parent 9897bd04c2
commit c40532c757
23 changed files with 1859 additions and 229 deletions

View File

@@ -192,6 +192,35 @@ class DetailService {
});
return data;
}
// 获取项目详情(包含工作目录状态)
async getProjectDetail(id: number) {
const { data } = await net.request<APIResponse<Project>>({
url: `/api/projects/${id}`,
});
return data;
}
// 更新项目
async updateProject(
id: number,
project: Partial<{ name: string; description: string; repository: string }>,
) {
const { data } = await net.request<APIResponse<Project>>({
url: `/api/projects/${id}`,
method: 'PUT',
data: project,
});
return data;
}
// 删除项目
async deleteProject(id: number) {
await net.request({
url: `/api/projects/${id}`,
method: 'DELETE',
});
}
}
export const detailService = new DetailService();