UNPKG

@datalayer/core

Version:

[![Datalayer](https://assets.datalayer.tech/datalayer-25.svg)](https://datalayer.io)

35 lines (34 loc) 1.28 kB
/* * 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;