@datalayer/core
Version:
[](https://datalayer.io)
35 lines (34 loc) • 1.28 kB
JavaScript
/*
* Copyright (c) 2023-2025 Datalayer, Inc.
* Distributed under the terms of the Modified BSD License.
*/
import { requestJupyterKernelsExtension } from '../stateful/jupyter/kernelsHandler';
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;