aboutsummaryrefslogtreecommitdiff
path: root/lava_scheduler_app/templates/lava_scheduler_app/job_submit.html
blob: 7068e68b54a7b5d418e69a8bb7e4f948b08be040 (plain)
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
{% extends "layouts/content.html" %}

{% block styles %}
<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}lava_scheduler_app/css/jquery-linedtextarea.css"/>
<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}lava_scheduler_app/css/scheduler.css"/>
{% endblock %}

{% block content %}

{% if error %}
<div class="alert alert-warning alert-dismissable">
  <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
  <strong>Job submission error:</strong> {{ error }}
</div>
{% endif %}

{% if resubmit_warning %}
<div class="alert alert-warning alert-dismissable">
  <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
  <strong>Job submission warning:</strong> {{ resubmit_warning }}
</div>
{% endif %}
<h2>Submit Job</h2>

{% if is_authorized %}

{% if job_id %}

{% url 'lava.scheduler.job.detail' job_id as detail_url %}
{% url 'lava.scheduler.job.list' as list_url %}

<p>Job submission successfull!</p>
<p>Job with ID <a href="{{ detail_url }}">{{ job_id }}</a> has been created.</p>
<p>To view the full job list click <a href="{{ list_url }}">here</a>.</p>

{% elif job_list %}
{% url 'lava.scheduler.job.list' as list_url %}
<p>Multinode Job submission successfull!</p>
<p>Jobs have been created with the IDs:</p>
<ul>
{% for job in job_list %}
  <li><a href="{% url 'lava.scheduler.job.detail' job %}">{{ job }}</a></li>
{% endfor %}
</ul>
<p>To view the full job list click <a href="{{ list_url }}">here</a>.</p>

{% else %}
<p>Paste your job definition here. Alternatively, you can paste a URL to your job definition file.</p>

<form action="" method="post">
  {% csrf_token %}
  <div>
    <textarea id="definition-input" name="definition-input" placeholder="Enter your job definition or link to a job definition here.">{{ definition_input }}</textarea>
    <div id="busyIndicator"></div>
    <div>
      <div id="valid_container">
      </div>
      <div>
        <input type="checkbox" name="is_favorite" id="is_favorite" {% if is_favorite %} checked {% endif %} />
        Add to my favorite jobs
      </div>
      <div id="submit-container">
        <input type="hidden" name="is_resubmit" value="true">
        <button class="btn btn-primary" id="validate" type="button">Validate</button>
        <button class="btn btn-success" id="submit" type="submit" value="Submit">Submit</button>
        <span id="validation_note">(Note: Please validate definition before job submission.)</span>
      </div>
    </div>
  </div>
</form>
{% endif %}

{% else %}
<h3>Error:</h3>
<p>Permission denied. You not have the required permissions to submit new jobs.</p>
<p>Please contact the administrators.</p>
{% endif %}

{% endblock %}

{% block scripts %}
<script type="text/javascript" src="{{ STATIC_URL }}lava_scheduler_app/js/jquery-linedtextarea.min.js"></script>
<script type="text/javascript">
  var remote_definition_url = '{% url 'lava.scheduler.get_remote_definition' %}';
</script>
{% if not job_id %}
<script type="text/javascript" src="{{ STATIC_URL }}lava_scheduler_app/js/job-submit.min.js"></script>
{% endif %}
{% endblock %}