generated from kevisual/vite-react-template
feat: 更新停止工作区逻辑以接受工作区参数
This commit is contained in:
@@ -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"
|
||||
>
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user