|
1 {% extends "admin/base_site.html" %} |
|
2 {% load i18n static %} |
|
3 |
|
4 {% block extrahead %} |
|
5 {{ block.super }} |
|
6 <script type="text/javascript" src="{% static 'p4l/lib/jquery-1.9.1.js' %}"></script> |
|
7 <link rel="stylesheet" href="{% static 'p4l/css/p4l_admin.css' %}"> |
|
8 {% endblock %} |
|
9 |
|
10 {% if not is_popup %} |
|
11 {% block breadcrumbs %} |
|
12 <div class="breadcrumbs"> |
|
13 <a href="{% url 'admin:index' %}">{% trans 'Home' %}</a> |
|
14 › {% trans 'Run script' %} |
|
15 </div> |
|
16 {% endblock %} |
|
17 {% endif %} |
|
18 |
|
19 {% block content %} |
|
20 <h1>{% trans 'Are you sure ?' %}</h1> |
|
21 {% if not command_line %} |
|
22 <p>{% blocktrans %}The ADMIN_SCRIPT setting is not correctly configured. Please configure it to launch commands.{% endblocktrans %} |
|
23 {% else %} |
|
24 <p>{% blocktrans %}Are you sure you want to run the script{% endblocktrans %} <span class="literal">{{ command_line }}</span> ?</p> |
|
25 <p>( {% trans 'cwd:' %} <span class="literal">{{ pwd }}</span>, {% trans 'env:' %} <span class="literal">{{ env }}</span> )</p> |
|
26 <div> |
|
27 <form method="get" id="confirm-form" action="{% url 'admin:run_script' %}" target="script-output"> |
|
28 <div class="script-control" id="script-submit"><input type="submit" id="confirm-form-submit" value="{% trans "Yes, I'm sure" %}" /></div> |
|
29 </form> |
|
30 <div class="script-control" id="kill-button-div"><button id="kill-button" class="button" title="{% trans 'Click to stop process (sends SIGINT then SIGKILL)' %}">Control-C</button></div> |
|
31 <div class="script-control" id="done"><h1>{% trans 'Done' %}</h1></div> |
|
32 </div> |
|
33 <div class="clear" id="kill-result"> </div> |
|
34 <iframe name="script-output" class="terminal" scrolling="auto"></iframe> |
|
35 <script type="text/javascript"> |
|
36 function launch_script() { |
|
37 $("#confirm-form-submit").attr("disabled","disabled"); |
|
38 $("#kill-button").removeAttr("disabled"); |
|
39 $('.terminal').show(); |
|
40 }; |
|
41 |
|
42 function done() { |
|
43 $('#done').show(); |
|
44 $('#kill-button').attr("disabled","disabled"); |
|
45 }; |
|
46 $(function() { |
|
47 $('#confirm-form').submit(function(e) { |
|
48 launch_script(); |
|
49 }); |
|
50 $('#kill-button').attr("disabled","disabled").click(function(e) { |
|
51 $("#kill-result").load("{% url 'admin:kill_script' %}"); |
|
52 }); |
|
53 |
|
54 }); |
|
55 </script> |
|
56 {% endif %} |
|
57 {% endblock %} |
|
58 |
|
59 |