UNPKG

@datalayer/core

Version:
35 lines (34 loc) 1.25 kB
/* * Copyright (c) 2023-2025 Datalayer, Inc. * Distributed under the terms of the Modified BSD License. */ import { requestJupyterKernelsExtension } from '../api'; export const useRuntimes = () => { // Folder Mounting ---------------------------------------------------------- const mountLocalFolder = (kernelId) => { requestJupyterKernelsExtension(`jump/${kernelId}`) .then(data => { // console.log('--- Mount Local Folder', data); }) .catch(reason => { console.error(`Error while accessing the jupyter server jupyter_kernels extension.\n${reason}`); }); }; const unmountLocalFolder = (kernelId) => { requestJupyterKernelsExtension(`jump/${kernelId}`, { method: 'DELETE' }) .then(data => { // console.log('--- Unmount Local Folder', data); }) .catch(reason => { console.error(`Error while accessing the jupyter server jupyter_kernels extension.\n${reason}`); }); }; // -------------------------------------------------------------------------- return { mountLocalFolder, unmountLocalFolder }; }; export default useRuntimes;