/
app.html
executable file
·76 lines (62 loc) · 2.01 KB
/
app.html
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
{% extends "base.html" %}
{% block html_head %}
<script type="text/javascript">
$(function() {
$('#deploy').click(function(){
$('#output').html('')
$('#status').html('DEPLOYING');
$('#output').load('{% url mgapp.views.deploy_app %}?app_id={{app.id}}&message=' + escape($('#message').val()) + '&env=' + $('#env').val(), function(){
$('#status').html('DEPLOYED');
$('#deploys').load('{% url mgapp.views.deploys %}?&count=5&partial=true&app_id='
+ $('#app_id').val())
});
})
$('#savegit').click(function(){
$('#output').html('')
$('#status').html('UPDATING');
$.post('{% url mgapp.views.save_git app.id %}',
{
remote: $('#remote').val(),
branch: $('#branch').val(),
csrfmiddlewaretoken: $('[name=csrfmiddlewaretoken]').val(),
},
function(data, textStatus, jqXHR) {
console.log(data);
$('#output').html(data);
});
$('#output').load('', function(){
$('#status').html('UPDATED');
});
});
});
</script>
{% endblock %}
{% block breadcrumbs %} / <a href="{% url mgapp.views.app app.id %}">{{ app.name }}</a>{% endblock %}
{% block content %}
<section>
<h1>{{ app.name }}</h1>
<a href="{{ app.config.url }}">{{ app.config.url }}</a>
<p>Working directory: {{ app.wd }}</p>
</section>
<div id="left-col">
{% include "gitinfo.html" %}
{% for env in envs %}
{% include "deployinfo.html" %}
{% endfor %}
</div>
<div id="right-col">
<section id="log">
<h3>Log</h3>
<strong id="status"></strong>
<pre id="output" style="font-family:'Inconsolata', Courier New, monospace; width:500px">
</pre>
</section>
<section id="deploys">
<h3>Previous Deployments for {{ app.name }}</h3>
<div id="deploys">
{% include "deploy_list.html" %}
</div>
<a href="{% url mgapp.views.deploys %}?app_id={{app.id}}">...more</a>
</section>
</div>
{% endblock %}