Create login_auto.html
Browse files- login_auto.html +72 -0
login_auto.html
ADDED
@@ -0,0 +1,72 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{% extends "page.html" %}
|
2 |
+
|
3 |
+
{% block stylesheet %}
|
4 |
+
{% endblock %}
|
5 |
+
|
6 |
+
{% block site %}
|
7 |
+
<div id="jupyter-main-app" class="container">
|
8 |
+
<img src="https://huggingface.co/front/assets/huggingface_logo-noborder.svg" alt="Hugging Face Logo">
|
9 |
+
<h4>You can just run here or duplicate this Space to run it private.</h4>
|
10 |
+
<br>
|
11 |
+
<a class="duplicate-button" style="display:inline-block" target="_blank" href="https://huggingface.co/spaces/DockerTemplates/jupyterlab?duplicate=true">
|
12 |
+
<img style="margin: 0" src="https://img.shields.io/badge/-Duplicate%20Space-blue?labelColor=white&style=flat&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAP5JREFUOE+lk7FqAkEURY+ltunEgFXS2sZGIbXfEPdLlnxJyDdYB62sbbUKpLbVNhyYFzbrrA74YJlh9r079973psed0cvUD4A+4HoCjsA85X0Dfn/RBLBgBDxnQPfAEJgBY+A9gALA4tcbamSzS4xq4FOQAJgCDwV2CPKV8tZAJcAjMMkUe1vX+U+SMhfAJEHasQIWmXNN3abzDwHUrgcRGmYcgKe0bxrblHEB4E/pndMazNpSZGcsZdBlYJcEL9Afo75molJyM2FxmPgmgPqlWNLGfwZGG6UiyEvLzHYDmoPkDDiNm9JR9uboiONcBXrpY1qmgs21x1QwyZcpvxt9NS09PlsPAAAAAElFTkSuQmCC&logoWidth=14" alt="Duplicate Space">
|
13 |
+
</a>
|
14 |
+
<br><br>
|
15 |
+
<h4>The default token is <span style="color:orange;">huggingface</span></h4>
|
16 |
+
<h4>You can keep all settings default</h4>
|
17 |
+
|
18 |
+
{% if login_available %}
|
19 |
+
<div class="row">
|
20 |
+
<div class="navbar col-sm-8">
|
21 |
+
<div class="navbar-inner">
|
22 |
+
<div class="container">
|
23 |
+
<div class="center-nav">
|
24 |
+
<form action="{{base_url}}login?next={{next}}" method="post" class="navbar-form pull-left">
|
25 |
+
{{ xsrf_form_html() | safe }}
|
26 |
+
{% if token_available %}
|
27 |
+
<label for="password_input"><strong>Token:</strong></label>
|
28 |
+
{% else %}
|
29 |
+
<label for="password_input"><strong>Password:</strong></label>
|
30 |
+
{% endif %}
|
31 |
+
<input type="password" name="password" id="password_input" class="form-control">
|
32 |
+
<button type="submit" class="btn btn-default" id="login_submit">Log in</button>
|
33 |
+
</form>
|
34 |
+
</div>
|
35 |
+
</div>
|
36 |
+
</div>
|
37 |
+
</div>
|
38 |
+
</div>
|
39 |
+
{% else %}
|
40 |
+
<p>No login available, you shouldn't be seeing this page.</p>
|
41 |
+
{% endif %}
|
42 |
+
|
43 |
+
<p>This template was created by <a href="https://twitter.com/camenduru" target="_blank">camenduru</a> and others.</p>
|
44 |
+
|
45 |
+
{% if message %}
|
46 |
+
<div class="row">
|
47 |
+
{% for key in message %}
|
48 |
+
<div class="message {{key}}">
|
49 |
+
{{message[key]}}
|
50 |
+
</div>
|
51 |
+
{% endfor %}
|
52 |
+
</div>
|
53 |
+
{% endif %}
|
54 |
+
</div>
|
55 |
+
{% endblock %}
|
56 |
+
|
57 |
+
//{% block script %}
|
58 |
+
//<script>
|
59 |
+
// 自动填入 token 并自动登录
|
60 |
+
window.onload = function () {
|
61 |
+
const token = "GeoAgent"; // 你可以改成自己的 token
|
62 |
+
const input = document.getElementById("password_input");
|
63 |
+
const button = document.getElementById("login_submit");
|
64 |
+
if (input && button) {
|
65 |
+
input.value = token;
|
66 |
+
setTimeout(() => {
|
67 |
+
button.click();
|
68 |
+
}, 500); // 等页面渲染后再点击
|
69 |
+
}
|
70 |
+
};
|
71 |
+
</script>
|
72 |
+
{% endblock %}
|