From 04f92184c203deb44e50efdb0936462d8671515c Mon Sep 17 00:00:00 2001 From: Nicole Rappe Date: Mon, 29 Sep 2025 02:25:23 -0600 Subject: [PATCH] Fixed Script Editor --- .../Workflows/{ => Examples/API Requests}/Value Parser.json | 0 Data/Server/WebUI/src/Assemblies/Script_Editor.jsx | 6 ++++-- 2 files changed, 4 insertions(+), 2 deletions(-) rename Assemblies/Workflows/{ => Examples/API Requests}/Value Parser.json (100%) diff --git a/Assemblies/Workflows/Value Parser.json b/Assemblies/Workflows/Examples/API Requests/Value Parser.json similarity index 100% rename from Assemblies/Workflows/Value Parser.json rename to Assemblies/Workflows/Examples/API Requests/Value Parser.json diff --git a/Data/Server/WebUI/src/Assemblies/Script_Editor.jsx b/Data/Server/WebUI/src/Assemblies/Script_Editor.jsx index bc4b894..7384b95 100644 --- a/Data/Server/WebUI/src/Assemblies/Script_Editor.jsx +++ b/Data/Server/WebUI/src/Assemblies/Script_Editor.jsx @@ -101,11 +101,13 @@ export default function ScriptEditor({ mode = "scripts", initialPath = "", onCon const [newType, setNewType] = useState(isAnsible ? "ansible" : "powershell"); const [deleteOpen, setDeleteOpen] = useState(false); + const island = useMemo(() => (isAnsible ? 'ansible' : 'scripts'), [isAnsible]); + useEffect(() => { (async () => { if (!initialPath) return; try { - const resp = await fetch(`${baseApi}/load?path=${encodeURIComponent(initialPath)}`); + const resp = await fetch(`/api/assembly/load?island=${encodeURIComponent(island)}&path=${encodeURIComponent(initialPath)}`); if (resp.ok) { const data = await resp.json(); setCurrentPath(data.rel_path || initialPath); @@ -118,7 +120,7 @@ export default function ScriptEditor({ mode = "scripts", initialPath = "", onCon if (onConsumedInitialPath) onConsumedInitialPath(); })(); // eslint-disable-next-line react-hooks/exhaustive-deps - }, [initialPath, baseApi]); + }, [initialPath, island]); const saveFile = async () => { if (!currentPath && !fileName) {