-
Notifications
You must be signed in to change notification settings - Fork 1
/
dashboard.html.twig
155 lines (138 loc) · 5.79 KB
/
dashboard.html.twig
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
{% extends 'NetvliesPublishBundle::layout.html.twig' %}
{% block messages %}
{{ parent() }}
{% if application.id is not checkedout %}
<div class="alert alert-warning">
<button type="button" class="close" data-dismiss="alert">×</button>
<strong>Warning!</strong> Application isn't checked out yet. <a href="{{ path('netvlies_publish_application_checkoutrepository', {'application': application.id}) }}" class="alert-link">Click here</a> to checkout repository.
</div>
{% endif %}
{% for overlap in usercontentoverlap(application.id) %}
<div class="alert alert-warning">
<button type="button" class="close" data-dismiss="alert">×</button>
<strong>Warning!</strong> User content also in repository for "{{ overlap }}". Please remove from <a href="{{ path('netvlies_publish_application_edit', {'application': application.id}) }}" class="alert-link">settings</a> or from repository
</div>
{% endfor %}
{% endblock %}
{% block content %}
<h3>{{application.name}}</h3>
<hr />
<h4>Details</h4>
<dl class="dl-horizontal">
<dt>Customer</dt> <dd>{{application.customer}}</dd>
<dt>Name</dt> <dd>{{application.name}}</dd>
<dt>Repository type</dt> <dd>{{application.scmService}}</dd>
<dt>Repository url</dt> <dd>{{application.scmUrl}}</dd>
<dt>Applicationtype</dt> <dd>{{application.applicationtype|apptypelabel}}</dd>
</dl>
{% if application.buildStatusBadge1 %}
<img src="{{ application.buildStatusBadge1 }}" border="0">
{% endif %}
{% if application.buildStatusBadge2 %}
<img src="{{ application.buildStatusBadge2 }}" border="0">
{% endif %}
<br><br>
{% if application.targets | length > 0%}
<h4>Currently deployed versions</h4>
<div class="table-responsive">
<table class="table table-bordered">
<thead>
<tr>
<th>D</th>
<th>T</th>
<th>A</th>
<th>P</th>
</tr>
</thead>
<tr>
{% set types = ['D', 'T', 'A', 'P'] %}
{% for type in types %}
<td>
{% for target in application.targets if target.environment.type == type and target.inactive is empty %}
{% if not loop.first %}
<hr>
{%endif%}
<a href="{{ path('netvlies_publish_target_detail', { 'target': target.id}) }}">{{target.label}}</a><br>
{%if target.lastDeployedTag is not empty%}
{{ target.lastDeployedTag }}<br>
{%elseif target.lastDeployedBranch is not empty%}
{{ target.lastDeployedBranch }}<br>
({{ target.lastDeployedRevision }})<br>
{% else %}
Not yet deployed<br>
{%endif%}
{% else %}
-
{% endfor %}
</td>
{%endfor%}
</table>
</div>
<div class="visible-xs"><span class="label label-info">Info</span> Table can be scrolled horizontally</div>
<br><br>
{%endif%}
{% if logs|length == 0 %}
<div class="alert alert-warning">
Hmmmm, no logs yet, you probably want to <a href="{{ path('netvlies_publish_target_createstep1', {'application': application.id}) }}" class="alert-link">add a target</a> and start deploying so we can create some logs!
</div>
{% else %}
<h4>Last executed deployments</h4>
<div class="table-responsive">
<table class="table table-bordered table-hover">
<thead>
<tr>
<th>Date</th>
<th>Command type</th>
<th>Target</th>
<th>User</th>
<th>Status</th>
<th>Log</th>
</tr>
</thead>
{% for log in logs %}
<tr
{% if log.exitcode is null %}
class="warning"
{% elseif log.exitcode == 0 %}
class="success"
{% else %}
class="danger"
{% endif %}
>
<td>
{{ log.datetimestart.format('d-m-Y H:i') }}
</td>
<td>{{ log.commandLabel }}</td>
<td>
{% if log.target is not null %}
{{ log.target.label }}
{% else %}
{{ log.host }}
{% endif %}
</td>
<td>
{{ log.user }}
</td>
<td>
{% if log.exitcode is null %}
<img src="{{ asset('bundles/netvliespublish/img/ajax-loader.gif') }}">
{% elseif log.exitcode == 0 %}
success
{% else %}
failed
{% endif %}
</td>
<td>
<a href="{{ path('netvlies_publish_command_viewlog', {'commandlog': log.id }) }}">View log</a>
</td>
</tr>
{% endfor %}
<tr>
<td colspan="5" align="right"> </td>
<td><a href="{{ path('netvlies_publish_command_listlogs', {'application': application.id}) }}">View all logs</a></td>
</tr>
</table>
</div>
<div class="visible-xs"><span class="label label-info">Info</span> Table can be scrolled horizontally</div>
{% endif %}
{% endblock %}