index.html
3.84 KB
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
156
157
158
159
160
{% if not qs.ajax %}
{% extends "starter-template.html" %}
{% endif %}
{% block content %}
{% if not qs.ajax %}
{% include "trx.index.activeconditions.html" %}
<a class="btn btn-primary" role="button" data-toggle="collapse" href="#collapseFilterForm" aria-expanded="false" aria-controls="collapseFilterForm">
Change Filters
</a>
<br>
<br>
<div class="collapse panel panel-default" id="collapseFilterForm">
<div class="panel-body">
{% include "trx.index.filterform.html" %}
</div>
</div>
<br>
<a id="btnAutoRefresh" href="{{ autorefreshLink }}" class="btn btn-default btn-xs pull-right {% if qs.autorefresh == "1" %} btn-primary {% endif %}" role="button">
AUTO REFRESH
</a>
<br>
<br>
<div id="transactions">
{% endif %}
<table class="table table-striped table-hover">
<tr>
<th class="hidden-xs shrink">Time</th>
<th class="hidden-xs shrink">Member</th>
<th>Destination</th>
<th>Product</th>
<th class="hidden-xs shrink">Supplier</th>
<th class="shrink">RC</th>
<th class="message hidden-xs">
Message
</th>
</tr>
{% for trx in trxs %}
{% if trx.responses %}
{% endif %}
<tr>
<td class="hidden-xs shrink">
{{ trx.ts | replace('-', '/') | replace(' ', '<br>') | safe }}
{% if trx.lastResponse %}
<br>
({{ trx.lastResponse.ts | replace(r/.* /, '') }})
{% endif %}
</td>
<td class="hidden-xs shrink">{{ trx.member }}</td>
<td>
<a href="/trx/view/{{ trx.requestId }}">
<strong>{{ trx.destination }}</strong>
</a>
<div class="visible-xs small">
by
{{ trx.member }}
on
{{ trx.ts | replace(r/.* /, '') }}
{% if trx.lastResponse %}
({{ trx.lastResponse.ts | replace(r/.* /, '') }})
{% endif %}
</div>
</td>
<td>
<strong>{{ trx.product }}</strong>
<div class="visible-xs small">
({{ trx.supplier }})
</div>
</td>
<td class="supplier hidden-xs shrink">
{% if trx.supplier %}
{{ trx.supplier }}
{% else %}
-
{% endif %}
</td>
<td class="rc shrink">
{% set rcClass = "label label-danger" %}
{% if trx.rc == "00" %}
{% set rcClass = "label label-success" %}
{% elif trx.rc == "68" %}
{% set rcClass = "label label-default" %}
{% endif %}
<span class="{{ rcClass }}">
{{ trx.rc }}
</span>
</td>
<td class="message hidden-xs">
{% if (trx.lastResponse.parsed.ciwaru.msg) %}
{{ trx.lastResponse.parsed.ciwaru.msg }}
{% elif (trx.lastResponse.parsed.MESSAGE) %}
{{ trx.lastResponse.parsed.MESSAGE }}
{% else %}
<img src="/loading-fb.gif" height=14 alt="-">
{% endif %}
</td>
</tr>
{% endfor %}
</table>
<p>
<ul class="pagination">
{% for page in paginator %}
<li
{% if page.active %}
class="active"
{% endif %}
>
<a href="{{ page.link | safe }}">
{{ page.number }}
</a>
</li>
{% endfor %}
</ul>
</p>
<p>
Total {{ trxcount }} transactions available in {{ pagecount }} pages.
</p>
{% if not qs.ajax %}
</div>
{% if qs.autorefresh == "1" %}
<script>
function loadTransactions() {
$("#transactions").load("{{ url | safe }}" + "&ajax=1" );
}
setInterval(function(){loadTransactions()}, 2000);
</script>
{% endif %}
{% endif %}
{% endblock %}