跳转到主要内容

为jlab的novnc

项目描述

jupyterlab-novnc

Github Actions StatusBinder

jupyterlab-novnc viewer running

此软件包为JupyterLab添加了novnc查看器。这是一个简单的扩展,仅在iframe中运行noVNC。

您可以在设置面板中配置noVNC连接。您可能需要至少配置hostport。此外,您还可以添加一个名称到您的连接,以便更容易找到。

此扩展由一个名为jupyterlab-novnc的Python包(用于服务器扩展)和一个名为jupyterlab-novnc的NPM包(用于前端扩展)组成。

图标由Smartlinewww.flaticon.com制作

设置

您需要打开JupyterLab的高级设置菜单并配置jupyterlab-novnc。将所需配置作为列表添加到“configured_endpoints”设置中。

配置完成后,每个配置端点将有一个图标

Icons showing up in JupyterLab

您也可以从命令面板中打开noVNC面板。

例如

{
    "configured_endpoints": [
    {
        "name": "Robot",
        "host": "localhost",
        "port": 6080,
        "resize": "scale",
        "password": "mycrazycomplicatedpassword"
    },
    {
      ...
    }
}

每个项目的允许设置值

{
  name: string; // optional name, otherwise host is used
  // autoconnect - Automatically connect as soon as the page has finished loading.
  autoconnect: boolean;
  // reconnect - If noVNC should automatically reconnect if the connection is dropped.
  reconnect: boolean;
  // reconnect_delay - How long to wait in milliseconds before attempting to reconnect.
  reconnect_delay: number;
  // host - The WebSocket host to connect to.
  host: string;
  // port - The WebSocket port to connect to.
  port: number;
  // encrypt - If TLS should be used for the WebSocket connection.
  encrypt?: boolean;
  // path - The WebSocket path to use.
  path?: string;
  // password - The password sent to the server, if required.
  password?: string;
  // repeaterID - The repeater ID to use if a VNC repeater is detected.
  repeaterID?: string;
  // shared - If other VNC clients should be disconnected when noVNC connects.
  shared?: boolean;
  // bell - If the keyboard bell should be enabled or not.
  bell?: boolean;
  // view_only - If the remote session should be in non-interactive mode.
  view_only?: boolean;
  // view_clip - If the remote session should be clipped or use scrollbars if it cannot fit in the browser.
  view_clip?: boolean;
  // resize - How to resize the remote session if it is not the same size as the browser window. Can be one of off, scale and remote.
  resize?: "off" | "scale" | "remote";
  // quality - The session JPEG quality level. Can be 0 to 9.
  quality?: number;
  // compression - The session compression level. Can be 0 to 9.
  compression?: number;
  // show_dot - If a dot cursor should be shown when the remote server provides no local cursor, or provides a fully-transparent (invisible) cursor.
  show_dot?: boolean;
  // logging - The console log level. Can be one of error, warn, info or debug.
  logging?: "error" | "warn" | "info" | "debug";
}

需求

  • JupyterLab >= 3.0

安装

pip install jupyterlab-novnc

故障排除

如果您看到前端扩展,但它不起作用,请检查服务器扩展是否已启用

jupyter server extension list

如果服务器扩展已安装并启用,但您看不到前端扩展,请检查前端扩展是否已安装

jupyter labextension list

贡献

开发安装

注意:您将需要NodeJS来构建扩展包。

《jlpm》命令是JupyterLab预装版本的yarn,与JupyterLab一同安装。您可以在以下情况下使用yarnnpm代替jlpm

# Clone the repo to your local environment
# Change directory to the jupyterlab_novnc directory
# Install package in development mode
pip install -e .
# Link your development version of the extension with JupyterLab
jupyter labextension develop . --overwrite
# If using a server extension, it must be manually installed in develop mode
jupyter server extension enable <extension_name>
# Rebuild extension Typescript source after making changes
jlpm run build

您可以在不同的终端中同时监视源目录并运行JupyterLab,以监视扩展源代码的变化并自动重新构建扩展。

# Watch the source directory in one terminal, automatically rebuilding when needed
jlpm run watch
# Run JupyterLab in another terminal
jupyter lab

当监视命令运行时,每次保存的更改都会立即在本地构建并提供给正在运行的JupyterLab。刷新JupyterLab以在浏览器中加载更改(您可能需要等待几秒钟以重新构建扩展)。

默认情况下,jlpm run build命令为该扩展生成源映射,以便更容易使用浏览器开发工具进行调试。要同时为JupyterLab核心扩展生成源映射,可以运行以下命令

jupyter lab build --minimize=False

卸载

pip uninstall jupyterlab_novnc

项目详情


下载文件

下载适合您平台的文件。如果您不确定选择哪一个,请了解更多关于安装包的信息。

源分布

jupyterlab-novnc-0.2.1.tar.gz (1.4 MB 查看哈希值

上传时间

构建分布

jupyterlab_novnc-0.2.1-py3-none-any.whl (1.5 MB 查看哈希值

上传时间 Python 3

由以下机构支持

AWS AWS 云计算和安全赞助商 Datadog Datadog 监控 Fastly Fastly CDN Google Google 下载分析 Microsoft Microsoft PSF赞助商 Pingdom Pingdom 监控 Sentry Sentry 错误日志 StatusPage StatusPage 状态页面