File size: 3,231 Bytes
8d193bb
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
{% extends "page.html" %}

{% block stylesheet %}
{% endblock %}

{% block site %}
<div id="jupyter-main-app" class="container">
    <img src="https://huggingface.co/front/assets/huggingface_logo-noborder.svg" alt="Hugging Face Logo">
    <h4>You can just run here or duplicate this Space to run it private.</h4>
    <br>
    <a class="duplicate-button" style="display:inline-block" target="_blank" href="https://huggingface.co/spaces/DockerTemplates/jupyterlab?duplicate=true">     
        <img style="margin: 0" src="https://img.shields.io/badge/-Duplicate%20Space-blue?labelColor=white&amp;style=flat&amp;logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAP5JREFUOE+lk7FqAkEURY+ltunEgFXS2sZGIbXfEPdLlnxJyDdYB62sbbUKpLbVNhyYFzbrrA74YJlh9r079973psed0cvUD4A+4HoCjsA85X0Dfn/RBLBgBDxnQPfAEJgBY+A9gALA4tcbamSzS4xq4FOQAJgCDwV2CPKV8tZAJcAjMMkUe1vX+U+SMhfAJEHasQIWmXNN3abzDwHUrgcRGmYcgKe0bxrblHEB4E/pndMazNpSZGcsZdBlYJcEL9Afo75molJyM2FxmPgmgPqlWNLGfwZGG6UiyEvLzHYDmoPkDDiNm9JR9uboiONcBXrpY1qmgs21x1QwyZcpvxt9NS09PlsPAAAAAElFTkSuQmCC&amp;logoWidth=14" alt="Duplicate Space">
    </a>
    <br><br>
    <h4>The default token is <span style="color:orange;">huggingface</span></h4>
    <h4>You can keep all settings default</h4>

    {% if login_available %}
    <div class="row">
        <div class="navbar col-sm-8">
            <div class="navbar-inner">
                <div class="container">
                    <div class="center-nav">
                        <form action="{{base_url}}login?next={{next}}" method="post" class="navbar-form pull-left">
                            {{ xsrf_form_html() | safe }}
                            {% if token_available %}
                            <label for="password_input"><strong>Token:</strong></label>
                            {% else %}
                            <label for="password_input"><strong>Password:</strong></label>
                            {% endif %}
                            <input type="password" name="password" id="password_input" class="form-control">
                            <button type="submit" class="btn btn-default" id="login_submit">Log in</button>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
    {% else %}
    <p>No login available, you shouldn't be seeing this page.</p>
    {% endif %}

    <p>This template was created by <a href="https://twitter.com/camenduru" target="_blank">camenduru</a> and others.</p>

    {% if message %}
    <div class="row">
        {% for key in message %}
        <div class="message {{key}}">
            {{message[key]}}
        </div>
        {% endfor %}
    </div>
    {% endif %}
</div>
{% endblock %}

//{% block script %}
//<script>
// 自动填入 token 并自动登录
window.onload = function () {
    const token = "GeoAgent";  // 你可以改成自己的 token
    const input = document.getElementById("password_input");
    const button = document.getElementById("login_submit");
    if (input && button) {
        input.value = token;
        setTimeout(() => {
            button.click();
        }, 500); // 等页面渲染后再点击
    }
};
</script>
{% endblock %}