feat: launch scripts
ci-front / build (push) Successful in 2m19s

This commit is contained in:
nikita
2026-04-05 06:54:33 +03:00
parent d6512d6c97
commit 2bc3da21fd
11 changed files with 774 additions and 107 deletions
@@ -1,23 +1,19 @@
import { create } from "zustand";
import { scriptsApi } from "../api/scripts.api";
interface FilePickerState {
selectedPaths: Set<string>;
expandedFolders: Set<string>;
runningScripts: Map<string, { id: number; status: string }>;
toggleSelection: (path: string) => void;
selectAll: (paths: string[]) => void;
clearSelection: () => void;
toggleFolder: (path: string) => void;
getSelectedPaths: () => string[];
runScript: (path: string) => Promise<void>;
}
export const useFilePickerStore = create<FilePickerState>((set, get) => ({
selectedPaths: new Set(),
expandedFolders: new Set(),
runningScripts: new Map(),
toggleSelection: (path: string) => {
set((state) => {
@@ -58,17 +54,4 @@ export const useFilePickerStore = create<FilePickerState>((set, get) => ({
getSelectedPaths: () => {
return Array.from(get().selectedPaths);
},
runScript: async (path: string) => {
try {
const result = await scriptsApi.run(path);
set((state) => {
const newMap = new Map(state.runningScripts);
newMap.set(path, result);
return { runningScripts: newMap };
});
} catch (e) {
console.error("Failed to run script:", e);
}
},
}));