add and run djlint formatter

This commit is contained in:
Min RK
2024-04-18 17:49:07 +02:00
parent fb1614e20a
commit d9ce1b917f
20 changed files with 740 additions and 842 deletions

View File

@@ -33,6 +33,15 @@ repos:
rev: v4.0.0-alpha.8
hooks:
- id: prettier
exclude: .*/templates/.*
# autoformat HTML templates
- repo: https://github.com/djlint/djLint
rev: v1.34.1
hooks:
- id: djlint-reformat-jinja
files: ".*templates/.*.html"
types_or: ["html"]
# Autoformat and linting, misc. details
- repo: https://github.com/pre-commit/pre-commit-hooks

View File

@@ -1,23 +1,21 @@
{%- extends "!layout.html" %}
{# not sure why, but theme CSS prevents scrolling within redoc content
# If this were fixed, we could keep the navbar and footer
#}
{%- block css %}{%- endblock %}
{%- block docs_navbar %}{%- endblock %}
{%- block footer %}{% endblock %}
{%- block body_tag %}
<body>
{%- endblock %}
{% block css %}
{% endblock css %}
{% block docs_navbar %}
{% endblock docs_navbar %}
{% block footer %}
{% endblock footer %}
{# djlint: off #}
{%- block body_tag -%}<body>{%- endblock body_tag %}
{# djlint: on #}
{%- block extrahead %}
{{ super() }}
<link href="{{ pathto('_static/redoc-fonts.css', 1) }}"
rel="stylesheet"
/>
<link href="{{ pathto('_static/redoc-fonts.css', 1) }}" rel="stylesheet" />
<script src="{{ pathto('_static/redoc.js', 1) }}"></script>
{%- endblock %}
{%- endblock extrahead %}
{%- block content %}
<redoc id="redoc-spec"></redoc>
<script>
@@ -31,4 +29,4 @@
);
}
</script>
{%- endblock %}
{%- endblock content %}

View File

@@ -1,6 +1,7 @@
{% extends "templates/page.html" %} {% block announcement %}
<div class="container text-center announcement"></div>
{% endblock %} {% block script %} {{ super() }}
{% extends "templates/page.html" %}
{% block announcement %}<div class="container text-center announcement"></div>{% endblock %}
{% block script %}
{{ super() }}
<script>
$.get("/services/announcement/", function (data) {
$(".announcement").html(data["announcement"]);

View File

@@ -2,11 +2,9 @@
<html lang="en">
<head>
<meta charset="utf-8" />
<title>JupyterHub</title>
<meta http-equiv="X-UA-Compatible" content="chrome=1" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="/static/css/style.min.css" type="text/css" />
</head>
<body>

View File

@@ -7,27 +7,20 @@ It makes the following modifications:
- update logo url to jupyterhub
- remove `?redirects` url param that may be added by jupyterhub
#}
{% extends "templates/page.html" %}
{% block header_buttons %}
{{ super() }}
<span>
<a
href="{{hub_control_panel_url}}"
<a href="{{ hub_control_panel_url }}"
id="jupyterhub-control-panel-link"
class="btn btn-default btn-sm navbar-btn pull-right"
style="margin-right: 4px; margin-left: 2px"
>
Control Panel
</a>
style="margin-right: 4px;
margin-left: 2px">Control Panel</a>
</span>
{% endblock %}
{% block logo %}
<img src="{{ logo_url }}" alt="Jupyter Notebook" />
{% endblock logo %}
{% block script %}
{{ super() }}
<script type="text/javascript">

View File

@@ -120,6 +120,11 @@ select = [
"F", # flake8
]
# djlint lints/formats our jinja templates
# https://djlint.com/docs/configuration/
[tool.djlint]
indent = 2
# tbump is used to simplify and standardize the release process when updating
# the version, making a git commit and tag, and pushing changes.
#

View File

@@ -1,5 +1,2 @@
{% extends "error.html" %}
{% block error_detail %}
<p>Jupyter has lots of moons, but this is not one...</p>
{% endblock %}
{% block error_detail %}<p>Jupyter has lots of moons, but this is not one...</p>{% endblock %}

View File

@@ -1,7 +1,5 @@
{% extends "page.html" %}
{% block login_widget %}
{% endblock %}
{% block login_widget %}{% endblock %}
{% block main %}
<div class="container">
<div class="row justify-content-center">
@@ -11,7 +9,6 @@
You ({{ user.name }}) have been invited to access {{ owner.name }}'s server
{%- if spawner.name %}({{ spawner.name }}){%- endif %} at <a href="{{ spawner_url | safe }}">{{ spawner_url }}</a>
</p>
{% if not spawner_ready %}
<p class="alert alert-danger">
The server at {{ spawner_url }} is not currently running.
@@ -19,7 +16,6 @@
to start the server before you can access it.
</p>
{% endif %}
<form method="POST" action="">
<div class="card">
<div class="card-header">
@@ -35,8 +31,7 @@
<label>
<span>
{{ scope_info['description'] }}
{% if scope_info['filter'] %}
Applies to {{ scope_info['filter'] }}. {% endif %}
{% if scope_info['filter'] %}Applies to {{ scope_info['filter'] }}.{% endif %}
</span>
</label>
</div>
@@ -50,6 +45,7 @@
</div>
</div>
</form>
</div></div></div>
</div>
</div>
</div>
{% endblock %}

View File

@@ -1,5 +1,4 @@
{% extends "page.html" %}
{% block main %}
<div id="react-admin-hook">
<script id="jupyterhub-admin-config">
@@ -9,9 +8,6 @@
<script src={{ static_url("js/admin-react.js") }}></script>
</div>
{% endblock %}
{% block footer %}
<div class="py-2 px-4 bg-body-tertiary small version_footer">
JupyterHub {{ server_version }}
</div>
<div class="py-2 px-4 bg-body-tertiary small version_footer">JupyterHub {{ server_version }}</div>
{% endblock %}

View File

@@ -1,40 +1,19 @@
{% extends "page.html" %}
{% block login_widget %}
{% endblock %}
{% block login_widget %}{% endblock %}
{% block main %}
<div class="error">
{% block h1_error %}
<h1>
{{status_code}} : {{status_message}}
</h1>
<h1>{{ status_code }} : {{ status_message }}</h1>
{% endblock h1_error %}
{% block error_detail %}
{% if message %}
<p>
{{message}}
</p>
{% endif %}
{% if message_html %}
<p>
{{message_html | safe}}
</p>
{% endif %}
{% if extra_error_html %}
<p>
{{extra_error_html | safe}}
</p>
{% endif %}
{% if message %}<p>{{ message }}</p>{% endif %}
{% if message_html %}<p>{{ message_html | safe }}</p>{% endif %}
{% if extra_error_html %}<p>{{ extra_error_html | safe }}</p>{% endif %}
{% endblock error_detail %}
</div>
{% endblock %}
{% block script %}
{{ super() }}
<script type="text/javascript">
function _remove_redirects_from_url() {
if (window.location.search.length <= 1) {

View File

@@ -2,36 +2,31 @@
{% if announcement_home is string %}
{% set announcement = announcement_home %}
{% endif %}
{% block main %}
<div class="container">
<h1 class="sr-only">JupyterHub home page</h1>
<div class="row">
<div class="text-center">
{% if default_server.active %}
<a id="stop" role="button" class="btn btn-lg btn-danger">
Stop My Server
</a>
{% endif %}
<a id="start" role="button" class="btn btn-lg btn-primary" href="{{ url }}">
{% if default_server.active %}<a id="stop" role="button" class="btn btn-lg btn-danger">Stop My Server</a>{% endif %}
<a id="start"
role="button"
class="btn btn-lg btn-primary"
href="{{ url }}">
{% if not default_server.active %}Start{% endif %}
My Server
</a>
</div>
</div>
{% if allow_named_servers %}
<h2>
Named Servers
</h2>
<h2>Named Servers</h2>
<p>
In addition to your default server,
you may have additional {% if named_server_limit_per_user > 0 %}{{ named_server_limit_per_user }} {% endif %}server(s) with names.
you may have additional
{% if named_server_limit_per_user > 0 %}{{ named_server_limit_per_user }}{% endif %}
server(s) with names.
This allows you to have more than one server running at the same time.
</p>
{% set named_spawners = user.all_spawners(include_default=False)|list %}
<table class="server-table table table-striped">
<thead>
<tr>
@@ -44,10 +39,12 @@
<tbody>
<tr class="home-server-row add-server-row">
<td colspan="4">
<input class="new-server-name" aria-label="server name" placeholder="name-your-server">
<button role="button" type="button" class="new-server-btn btn btn-xs btn-primary">
Add New Server
</button>
<input class="new-server-name"
aria-label="server name"
placeholder="name-your-server">
<button role="button"
type="button"
class="new-server-btn btn btn-xs btn-primary">Add New Server</button>
</td>
</tr>
{% for spawner in named_spawners %}
@@ -56,9 +53,8 @@
<td>{{ spawner.name }}</td>
{# url #}
<td>
<a class="server-link {% if not spawner.ready %}hidden{% endif %}" href="{{ user.server_url(spawner.name) }}">
{{ user.server_url(spawner.name) }}
</a>
<a class="server-link {% if not spawner.ready %}hidden{% endif %}"
href="{{ user.server_url(spawner.name) }}">{{ user.server_url(spawner.name) }}</a>
</td>
{# activity #}
<td class='time-col'>
@@ -70,13 +66,16 @@
</td>
{# actions #}
<td>
<a role="button" class="stop-server btn btn-xs btn-danger{% if not spawner.active %} hidden{% endif %}" id="stop-{{ spawner.name }}">stop</a>
<a role="button" class="start-server btn btn-xs btn-primary {% if spawner.active %} hidden{% endif %}" id="start-{{ spawner.name }}"
href="{{ base_url }}spawn/{{ user.name }}/{{ spawner.name }}"
>
start
</a>
<button role="button" class="delete-server btn btn-xs btn-danger{% if spawner.active %} hidden{% endif %}" id="delete-{{ spawner.name }}">delete</button>
<a role="button"
class="stop-server btn btn-xs btn-danger{% if not spawner.active %} hidden{% endif %}"
id="stop-{{ spawner.name }}">stop</a>
<a role="button"
class="start-server btn btn-xs btn-primary {% if spawner.active %}hidden{% endif %}"
id="start-{{ spawner.name }}"
href="{{ base_url }}spawn/{{ user.name }}/{{ spawner.name }}">start</a>
<button role="button"
class="delete-server btn btn-xs btn-danger{% if spawner.active %} hidden{% endif %}"
id="delete-{{ spawner.name }}">delete</button>
</td>
</tr>
{% endfor %}
@@ -85,10 +84,7 @@
{% endif %}
</div>
{% endblock main %}
{% block script %}
{{ super() }}
<script type="text/javascript">
require(["home"]);
</script>
<script type="text/javascript">require(["home"]);</script>
{% endblock %}

View File

@@ -2,12 +2,8 @@
{% if announcement_login is string %}
{% set announcement = announcement_login %}
{% endif %}
{% block login_widget %}
{% endblock %}
{% block login_widget %}{% endblock %}
{% block main %}
{% block login %}
<div id="login-main" class="container">
{% block login_container %}
@@ -19,32 +15,26 @@
Warning: JupyterHub seems to be served over an unsecured HTTP connection.
We strongly recommend enabling HTTPS for JupyterHub.
</p>
<a role="button" class='btn btn-jupyter btn-lg' href='{{ authenticator_login_url | safe }}'>
Sign in with {{login_service}}
</a>
<a role="button"
class='btn btn-jupyter btn-lg'
href='{{ authenticator_login_url | safe }}'>Sign in with {{ login_service }}</a>
</div>
{% else %}
<form action="{{ authenticator_login_url | safe }}" method="post" role="form">
<form action="{{ authenticator_login_url | safe }}"
method="post"
role="form">
<div class="auth-form-header">
<h1>Sign in</h1>
</div>
<div class='auth-form-body m-auto'>
<p id='insecure-login-warning' class='hidden'>
Warning: JupyterHub seems to be served over an unsecured HTTP connection.
We strongly recommend enabling HTTPS for JupyterHub.
</p>
{% if login_error %}
<p class="login_error">
{{login_error}}
</p>
{% endif %}
{% if login_error %}<p class="login_error">{{ login_error }}</p>{% endif %}
<input type="hidden" name="_xsrf" value="{{ xsrf }}" />
<label for="username_input">Username:</label>
<input
id="username_input"
<input id="username_input"
type="text"
autocapitalize="off"
autocorrect="off"
@@ -52,59 +42,51 @@
class="form-control"
name="username"
val="{{ username }}"
autofocus="autofocus"
/>
autofocus="autofocus" />
<label for='password_input'>Password:</label>
<input
type="password"
<input type="password"
class="form-control"
autocomplete="current-password"
name="password"
id="password_input"
/>
id="password_input" />
{% if authenticator.request_otp %}
<label for='otp_input'>{{ authenticator.otp_prompt }}</label>
<input
class="form-control"
<input class="form-control"
autocomplete="one-time-password"
name="otp"
id="otp_input"
/>
id="otp_input" />
{% endif %}
<div class="feedback-container">
<input
id="login_submit"
<input id="login_submit"
type="submit"
class='btn btn-jupyter form-control'
value='Sign in'
tabindex="3"
/>
tabindex="3" />
<div class="feedback-widget hidden">
<i class="fa fa-spinner"></i>
</div>
</div>
{% block login_terms %}
{% if login_term_url %}
<div id="login_terms" class="login_terms">
<input type="checkbox" id="login_terms_checkbox" name="login_terms_checkbox" required />
{% block login_terms_text %} {# allow overriding the text #}
<input type="checkbox"
id="login_terms_checkbox"
name="login_terms_checkbox"
required />
{% block login_terms_text %}
{# allow overriding the text #}
By logging into the platform you accept the <a href="{{ login_term_url }}">terms and conditions</a>.
{% endblock login_terms_text %}
</div>
{% endif %}
{% endblock login_terms %}
</div>
</form>
{% endif %}
{% endblock login_container %}
</div>
{% endblock login %}
{% endblock %}
{% block script %}
{{ super() }}
<script>

View File

@@ -2,13 +2,8 @@
{% if announcement_logout is string %}
{% set announcement = announcement_logout %}
{% endif %}
{% block main %}
<div id="logout-main" class="container">
<p>
Successfully logged out.
</p>
<p>Successfully logged out.</p>
</div>
{% endblock %}

View File

@@ -1,7 +1,5 @@
{% extends "page.html" %}
{% block main %}
<div class="container">
<div class="row">
<div class="text-center">
@@ -19,9 +17,11 @@
{% if failed %}
The latest attempt to start your server {{ server_name }} has failed.
{% if failed_html_message %}
</p><p>{{ failed_html_message | safe }}</p><p>
{% elif failed_message %}
</p><p>{{ failed_message }}</p><p>
</p>
<p>{{ failed_html_message | safe }}</p>
<p>{% elif failed_message %}</p>
<p>{{ failed_message }}</p>
<p>
{% endif %}
Would you like to retry starting it?
{% else %}
@@ -37,7 +37,10 @@
</p>
{% endblock %}
{% block start_button %}
<a id="start" role="button" class="btn btn-lg btn-primary" href="{{ spawn_url }}">
<a id="start"
role="button"
class="btn btn-lg btn-primary"
href="{{ spawn_url }}">
{% if failed %}
Relaunch
{% else %}
@@ -49,7 +52,6 @@
</div>
</div>
</div>
{% endblock %}
{% block script %}
{{ super () }}
@@ -65,7 +67,5 @@
);
</script>
{% endif %}
<script type="text/javascript">
require(["not_running"]);
</script>
<script type="text/javascript">require(["not_running"]);</script>
{% endblock script %}

View File

@@ -1,16 +1,11 @@
{% extends "page.html" %}
{% block login_widget %}
{% endblock %}
{% block login_widget %}{% endblock %}
{% block main %}
<div class="container">
<div class="row justify-content-center">
<div class="col-md-8">
<h1 class="text-center">Authorize access</h1>
<p class="lead">
An application is requesting authorization to access data associated with your JupyterHub account
</p>
<p class="lead">An application is requesting authorization to access data associated with your JupyterHub account</p>
<p>
{{ oauth_client.description }} (oauth URL: {{ oauth_client.redirect_uri }})
would like permission to identify you.
@@ -19,20 +14,15 @@
your behalf.
{% endif %}
</p>
<form method="POST" action="">
<div class="card">
<div class="card-header">
<p class="h5">This will grant the application permission to:
</p>
<p class="h5">This will grant the application permission to:</p>
</div>
<div class="card-body">
<input type="hidden" name="_xsrf" value="{{ xsrf }}" />
{# these are the 'real' inputs to the form -#}
{% for scope in allowed_scopes %}
<input type="hidden" name="scopes" value="{{ scope }}"/>
{% endfor %}
{% for scope in allowed_scopes %}<input type="hidden" name="scopes" value="{{ scope }}" />{% endfor %}
{% for scope_info in scope_descriptions %}
<div class="checkbox input-group">
<label>
@@ -41,9 +31,7 @@
{# disabled because it's required #} />
<span>
{{ scope_info['description'] }}
{% if scope_info['filter'] %}
Applies to {{ scope_info['filter'] }}.
{% endif %}
{% if scope_info['filter'] %}Applies to {{ scope_info['filter'] }}.{% endif %}
</span>
</label>
</div>
@@ -56,5 +44,4 @@
</form>
</div>
</div>
{% endblock %}

View File

@@ -1,41 +1,47 @@
{% macro modal(title, btn_label=None, btn_class="btn-primary") %}
{% set key = title.replace(' ', '-').lower() %}
{% set btn_label = btn_label or title %}
<div class="modal fade" id="{{key}}-dialog" tabindex="-1" role="dialog" aria-labelledby="{{key}}-label" aria-hidden="true">
<div class="modal fade"
id="{{ key }}-dialog"
tabindex="-1"
role="dialog"
aria-labelledby="{{ key }}-label"
aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h2 class="modal-title" id="{{key}}-label">{{title}}</h1>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
{{ caller() }}
<h2 class="modal-title" id="{{ key }}-label">
{{ title }}
</h1>
<button type="button"
class="btn-close"
data-bs-dismiss="modal"
aria-label="Close"></button>
</div>
<div class="modal-body">{{ caller() }}</div>
<div class="modal-footer">
<button type="button" class="btn {{btn_class}}" data-bs-dismiss="modal" data-dismiss="modal">{{btn_label}}</button>
<button type="button"
class="btn {{ btn_class }}"
data-bs-dismiss="modal"
data-dismiss="modal">{{ btn_label }}</button>
</div>
</div>
</div>
</div>
{% endmacro %}
<!DOCTYPE HTML>
<html lang="en">
<head>
<meta charset="utf-8">
<title>{% block title %}JupyterHub{% endblock %}</title>
<title>
{% block title %}JupyterHub{% endblock %}
</title>
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
{% block stylesheet %}
<link rel="stylesheet" href="{{ static_url("css/style.min.css") }}" type="text/css" />
{% endblock %}
{% block favicon %}
<link rel="icon" href="{{ static_url("favicon.ico") }}" type="image/x-icon">
{% endblock %}
{% block favicon %}<link rel="icon" href="{{ static_url("favicon.ico") }}" type="image/x-icon">{% endblock %}
{% block scripts %}
<script src="{{static_url("components/bootstrap/dist/js/bootstrap.bundle.min.js") }}" type="text/javascript" charset="utf-8"></script>
<script src="{{static_url("components/requirejs/require.js") }}" type="text/javascript" charset="utf-8"></script>
@@ -43,9 +49,7 @@
{% endblock %}
<script>
require.config({
{% if version_hash %}
urlArgs: "v={{version_hash}}",
{% endif %}
{% if version_hash %}urlArgs: "v={{version_hash}}",{% endif %}
baseUrl: '{{static_url("js", include_version=False)}}',
paths: {
components: '../components',
@@ -54,7 +58,6 @@
},
});
</script>
<script type="text/javascript">
window.jhdata = {
base_url: "{{base_url}}",
@@ -80,27 +83,25 @@
xsrf_token: "{{ xsrf_token }}",
}
</script>
{% block meta %}
{% endblock %}
</head>
<body>
<noscript>
<div id='noscript'>
JupyterHub requires JavaScript.<br>
JupyterHub requires JavaScript.
<br>
Please enable it to proceed.
</div>
</noscript>
{% block nav_bar %}
<nav class="navbar navbar-expand-sm bg-body-tertiary mb-4">
<div class="container-fluid">
{% block logo %}
<span id="jupyterhub-logo" class="navbar-brand">
<a href="{{logo_url or base_url}}"><img src='{{base_url}}logo' alt='JupyterHub logo' class='jpy-logo' title='Home'/></a>
<a href="{{ logo_url or base_url }}">
<img src='{{ base_url }}logo' alt='JupyterHub logo' class='jpy-logo' title='Home' />
</a>
</span>
{% endblock %}
{% if user %}
@@ -108,15 +109,20 @@
<span class="navbar-toggler-icon"></span>
</button>
{% endif %}
<div class="collapse navbar-collapse" id="thenavbar">
{% if user %}
<ul class="navbar-nav me-auto mb-0">
{% block nav_bar_left_items %}
<li class="nav-item"><a class="nav-link" href="{{base_url}}home">Home</a></li>
<li class="nav-item"><a class="nav-link" href="{{base_url}}token">Token</a></li>
<li class="nav-item">
<a class="nav-link" href="{{ base_url }}home">Home</a>
</li>
<li class="nav-item">
<a class="nav-link" href="{{ base_url }}token">Token</a>
</li>
{% if 'admin-ui' in parsed_scopes %}
<li class="nav-item"><a class="nav-link" href="{{base_url}}admin">Admin</a></li>
<li class="nav-item">
<a class="nav-link" href="{{ base_url }}admin">Admin</a>
</li>
{% endif %}
{% if services %}
<li class="nav-item dropdown">
@@ -124,7 +130,9 @@
<ul class="dropdown-menu">
{% for service in services %}
{% block service scoped %}
<li><a class="dropdown-item" href="{{service.href}}">{{service.name}}</a></li>
<li>
<a class="dropdown-item" href="{{ service.href }}">{{ service.name }}</a>
</li>
{% endblock %}
{% endfor %}
</ul>
@@ -150,38 +158,20 @@
{% endblock %}
</ul>
</div>
{% block header %}
{% endblock %}
{% block header %}{% endblock %}
</div>
</nav>
{% endblock %}
{% block announcement %}
{% if announcement %}
<div class="container text-center announcement alert alert-warning">
{{ announcement | safe }}
</div>
<div class="container text-center announcement alert alert-warning">{{ announcement | safe }}</div>
{% endif %}
{% endblock %}
{% block main %}
{% endblock %}
{% block footer %}
{% endblock %}
{% block main %}{% endblock %}
{% block footer %}{% endblock %}
{% call modal('Error', btn_label='OK') %}
<div class="ajax-error alert-danger">
The error
</div>
<div class="ajax-error alert-danger">The error</div>
{% endcall %}
{% block script %}
{% endblock %}
{% block script %}{% endblock %}
</body>
</html>

View File

@@ -2,9 +2,7 @@
{% if announcement_spawn is string %}
{% set announcement = announcement_spawn %}
{% endif %}
{% block main %}
<div class="container">
{% block heading %}
<div class="row text-center">
@@ -16,12 +14,12 @@
{% if for_user and user.name != for_user.name -%}
<p>Spawning server for {{ for_user.name }}</p>
{% endif -%}
{% if error_message -%}
<p class="spawn-error-msg alert alert-danger">
Error: {{error_message}}
</p>
{% endif %}
<form enctype="multipart/form-data" id="spawn_form" action="{{ url | safe }}" method="post" role="form">
{% if error_message -%}<p class="spawn-error-msg alert alert-danger">Error: {{ error_message }}</p>{% endif %}
<form enctype="multipart/form-data"
id="spawn_form"
action="{{ url | safe }}"
method="post"
role="form">
{{ spawner_options_form | safe }}
<br>
<div class="feedback-container">
@@ -33,9 +31,7 @@
</form>
</div>
</div>
{% endblock %}
{% block script %}
{{ super() }}
<script>

View File

@@ -1,7 +1,5 @@
{% extends "page.html" %}
{% block main %}
<div class="container">
<div class="row">
<div class="text-center">
@@ -10,7 +8,13 @@
<p>You will be redirected automatically when it's ready for you.</p>
{% endblock %}
<div class="progress">
<div id="progress-bar" class="progress-bar" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width: 0%;">
<div id="progress-bar"
class="progress-bar"
role="progressbar"
aria-valuenow="0"
aria-valuemin="0"
aria-valuemax="100"
style="width: 0%">
<span class="sr-only"><span id="sr-progress">0%</span> Complete</span>
</div>
</div>
@@ -26,9 +30,7 @@
</div>
</div>
</div>
{% endblock %}
{% block script %}
{{ super() }}
<script type="text/javascript">

View File

@@ -1,7 +1,5 @@
{% extends "page.html" %}
{% block main %}
<div class="container">
<div class="row">
<div class="text-center">
@@ -9,14 +7,14 @@
<p>Your server is stopping.</p>
<p>You will be able to start it again once it has finished stopping.</p>
{% endblock message %}
<p><i class="fa fa-spinner fa-pulse fa-fw fa-3x" aria-hidden="true"></i></p>
<p>
<i class="fa fa-spinner fa-pulse fa-fw fa-3x" aria-hidden="true"></i>
</p>
<a role="button" id="refresh" class="btn btn-lg btn-primary" href="#">refresh</a>
</div>
</div>
</div>
{% endblock %}
{% block script %}
{{ super() }}
<script type="text/javascript">

View File

@@ -1,25 +1,19 @@
{% extends "page.html" %}
{% block main %}
<div class="container">
<h1 class="sr-only">Manage JupyterHub Tokens</h1>
<div class="row justify-content-center">
<form id="request-token-form" class="col-lg-6">
<div class="form-group">
<label for="token-note" class="form-label">Note</label>
<input
id="token-note"
<input id="token-note"
class="form-control"
placeholder="note to identify your new token">
<small id="note-note" class="form-text">
This note will help you keep track of what your tokens are for.
</small>
<small id="note-note" class="form-text">This note will help you keep track of what your tokens are for.</small>
<br />
<label for="token-expiration-seconds" class="form-label">Token expires in</label>
{% block expiration_options %}
<select id="token-expiration-seconds"
class="form-select">
<select id="token-expiration-seconds" class="form-select">
<!-- unit used for each value is `seconds` -->
<option value="3600">1 Hour</option>
<option value="86400">1 Day</option>
@@ -27,12 +21,12 @@
<option value="" selected="selected">Never</option>
</select>
{% endblock expiration_options %}
<small id="note-expires-at" class="form-text">
You can configure when your token will expire.
</small>
<small id="note-expires-at" class="form-text">You can configure when your token will expire.</small>
<br />
<label for="token-scopes" class="form-label">Permissions</label>
<input id="token-scopes" class="form-control" placeholder="list of scopes for the token to have, separated by space">
<input id="token-scopes"
class="form-control"
placeholder="list of scopes for the token to have, separated by space">
<small id="note-token-scopes" class="form-text">
You can limit the permissions of the token so it can only do what you want it to.
If none are specified, the token will have permission to do everything you can do.
@@ -40,19 +34,14 @@
</small>
</div>
<div class="text-center m-4">
<button type="submit" class="btn btn-lg btn-jupyter">
Request new API token
</button>
<button type="submit" class="btn btn-lg btn-jupyter">Request new API token</button>
</div>
</form>
</div>
<div class="row justify-content-center">
<div id="token-area" class="col-lg-6" style="display: none;">
<div class="card">
<div class="card-header">
Your new API Token
</div>
<div class="card-header">Your new API Token</div>
<div class="card-body">
<p class="card-title text-center">
<span id="token-result"></span>
@@ -65,7 +54,6 @@
</div>
</div>
</div>
{% if api_tokens %}
<div class="row" id="api-tokens-section">
<div class="col">
@@ -93,9 +81,7 @@
<td class="scope-col col">
<details>
<summary>scopes</summary>
{% for scope in token.scopes %}
<pre class="token-scope">{{ scope }}</pre>
{% endfor %}
{% for scope in token.scopes %}<pre class="token-scope">{{ scope }}</pre>{% endfor %}
</details>
</td>
<td class="time-col col">
@@ -130,14 +116,12 @@
</div>
</div>
{% endif %}
{% if oauth_clients %}
<div class="row" id="oauth-clients-section">
<h2>Authorized Applications</h2>
<p>
These are applications that use OAuth with JupyterHub
to identify users (mostly notebook servers).
OAuth tokens can generally only be used to identify you,
not take actions on your behalf.
</p>
@@ -152,8 +136,7 @@
</thead>
<tbody>
{% for client in oauth_clients %}
<tr class="token-row"
data-token-id="{{ client['token_id'] }}">
<tr class="token-row" data-token-id="{{ client['token_id'] }}">
{% block client_row scoped %}
<td class="note-col col-sm-4">{{ client['description'] }}</td>
<td class="scope-col col-sm-1">
@@ -192,10 +175,7 @@
{% endif %}
</div>
{% endblock main %}
{% block script %}
{{ super() }}
<script type="text/javascript">
require(["token"]);
</script>
<script type="text/javascript">require(["token"]);</script>
{% endblock script %}