diff --git a/web/src/components/tree.tsx b/web/src/components/tree.tsx index a76b4ae..382cef6 100644 --- a/web/src/components/tree.tsx +++ b/web/src/components/tree.tsx @@ -63,6 +63,7 @@ const TreeViewNode = ({ rename, defaultExpanded }: Props) => { + // const appContext = useContext(AppContext) const [deleteConfirmationModalOpen, setDeleteConfirmationModalOpen] = useState(false) const [deleteConfirmationModalMessage, setDeleteConfirmationModalMessage] = @@ -78,6 +79,23 @@ const TreeViewNode = ({ mouseY: number } | null>(null) + // const isFileLaunchable = (filename: string) => { + // const availableRuntimes = Object.values(appContext.runTimes) + + // } + + const launchProgram = () => { + const baseUrl = window.location.origin + window.open(`${baseUrl}/SASjsApi/stp/execute?_program=${node.relativePath}`) + } + + const launchProgramWithDebug = () => { + const baseUrl = window.location.origin + window.open( + `${baseUrl}/SASjsApi/stp/execute?_program=${node.relativePath}&_debug=131` + ) + } + const handleContextMenu = (event: React.MouseEvent) => { event.preventDefault() event.stopPropagation() @@ -224,8 +242,8 @@ const TreeViewNode = ({ : undefined } > - {node.isFolder && ( -
+ {node.isFolder ? ( + <> Add Folder Add File -
+ + ) : ( + <> + Launch + + Launch and Debug + + + )} + {!!node.relativePath && ( + <> + Rename + Delete + )} - - Rename - - - Delete - )