Skip to main content

Fancy Profile UI for jupyterhub-kubespawner

Project description

jupyterhub-fancy-profiles

A react based, fancy implementation of user selectable profiles for use with jupyterhub-kubespawner.

Screenshot showing an image selector

Features

  1. Interpret a profileList given to kubespawner, and render a better looking and more featureful selector. This includes descriptions for various options, as well as better descriptions for allowing users to 'write-in' a choice.

  2. If enabled, interact with a binderhub deployed as a JupyterHub service to allow users to dynamically build images they want to use, without requiring it to be pre-built.

Limitations

  1. While multiple profile_options are supported, only a single profile is supported.

  2. The forms values don't remember their previous state upon refresh

How to use

Once installed, you can have kubespawner use the templates shipped with this package to provide appropriate UI, by adding the following snippet to your jupyterhub_config.py file:

from jupyterhub_fancy_profiles import setup_ui
setup_ui(c)

The setup_ui function will setup all the appropriate config as needed. Currently, it will:

  1. Setup extra templates to be made available to kubespawner, to render the base HTML for profile_list.
  2. Setup extra HTTP handlers, primarily for serving our static assets.

What is in here?

The primary contents are:

  1. jupyterhub_fancy_profiles/templates contains jinja2 templates, primarily HTML for constructing the form itself. This can contain multiple templates that are composed together using all of jinja2's composition features (like include)
  2. src/ contains JS and CSS that are packaged via standard frontend bundling tools (webpack and babel), outputing assets into jupyterhub_fancy_profiles/static/. This allows us to use standard frontend tooling to write JS & CSS - for example, xterm.js can be used without many complications.

Why React?

/* If this file gets over 200 lines of code long (not counting docs / comments), start using a framework

(from the BinderHub JS Source Code)

Dear Reader, the file did get more than 200 lines long, but alas there was no time to start using a framework. Lesson learnt from that is we should use a very lightweight framework right from the start, something mainstream that can attract frontend devs without being so fancy that nobody else can work on it. Given the size and complexity of this - a complex UI but only a single page - plain react without typescript seems the correct choice. We will not make this into a super-heavy, complex application - just a fairly simple one that uses react.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

jupyterhub-fancy-profiles-0.2.0.tar.gz (956.6 kB view details)

Uploaded Source

Built Distribution

jupyterhub_fancy_profiles-0.2.0-py3-none-any.whl (959.3 kB view details)

Uploaded Python 3

File details

Details for the file jupyterhub-fancy-profiles-0.2.0.tar.gz.

File metadata

File hashes

Hashes for jupyterhub-fancy-profiles-0.2.0.tar.gz
Algorithm Hash digest
SHA256 4c4aa866e0c1c4df32a387015c69de8fd9be88cf6a87ba34f96ffd788647cd75
MD5 aa942b4b3e99b4f05bb5e985b9fcd04e
BLAKE2b-256 0169472454fb46f94967ce1cd470942c9623e60ed9588b2b8eaa7583561f357f

See more details on using hashes here.

File details

Details for the file jupyterhub_fancy_profiles-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for jupyterhub_fancy_profiles-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7b1bced30fe4662d0c4b6e52e77804a2783f42a8a8dc5b1f996e809cc3e15253
MD5 820f21a156f284f7a14b1c919ed1783a
BLAKE2b-256 ea4d1f914a331dc86f5910a832948998f12032a0584436d88121eceab9e829ef

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page