feat: 更新停止工作区逻辑以接受工作区参数

This commit is contained in:
2026-02-20 16:25:39 +08:00
parent 6516bacbf4
commit eb1adbc100
2 changed files with 4 additions and 5 deletions

View File

@@ -106,8 +106,7 @@ export function RepoCard({ repo, onStartWorkspace, onEdit, onIssue, onSettings,
size="sm"
variant="outline"
onClick={() => {
// TODO: 实现停止工作区逻辑
stopWorkspace()
stopWorkspace(workspace)
}}
className="h-8 w-8 p-0 border-neutral-200 hover:border-red-600 hover:bg-red-600 hover:text-white transition-all cursor-pointer"
>

View File

@@ -71,7 +71,7 @@ type State = {
getWorkspaceList: () => Promise<any>;
refresh: (opts?: { message?: string, showTips?: boolean }) => Promise<any>;
startWorkspace: (data: Partial<Data>, params?: { open?: boolean, branch?: string }) => Promise<any>;
stopWorkspace: () => Promise<any>;
stopWorkspace: (workspace?: WorkspaceInfo) => Promise<any>;
getWorkspaceDetail: (data: WorkspaceInfo) => Promise<any>;
workspaceLink: Partial<WorkspaceOpen>;
selectWorkspace?: WorkspaceInfo,
@@ -299,8 +299,8 @@ export const useRepoStore = create<State>((set, get) => {
}
return res;
},
stopWorkspace: async () => {
const sn = get().selectWorkspace?.sn;
stopWorkspace: async (workspace?: WorkspaceInfo) => {
const sn = workspace?.sn || get().selectWorkspace?.sn;
if (!sn) {
toast.error('未选择工作区');
return;