aboutsummaryrefslogtreecommitdiffstats
path: root/templates/web/base/dashboard/status.html
diff options
context:
space:
mode:
authorMarius Halden <marius.h@lden.org>2021-10-07 13:32:40 +0200
committerMarius Halden <marius.h@lden.org>2021-10-07 13:32:40 +0200
commit09dacfc6b8bf62addeee16c20b1d90c2a256da96 (patch)
tree7caa2bf9e92227ab74448f9b746dd28bbcb81b2a /templates/web/base/dashboard/status.html
parent585e57484f9c6332668bf1ac0a6a3b39dbe32223 (diff)
parentcea89fb87a96943708a1db0f646492fbfaaf000f (diff)
Merge tag 'v3.1' into fiksgatami-devfiksgatami-dev
Diffstat (limited to 'templates/web/base/dashboard/status.html')
-rw-r--r--templates/web/base/dashboard/status.html68
1 files changed, 68 insertions, 0 deletions
diff --git a/templates/web/base/dashboard/status.html b/templates/web/base/dashboard/status.html
new file mode 100644
index 000000000..734bb9ad3
--- /dev/null
+++ b/templates/web/base/dashboard/status.html
@@ -0,0 +1,68 @@
+[% USE date %]
+[% IF NOT c.get_param('ajax') %]
+[% INCLUDE 'header.html'
+ title = loc('Dashboard')
+ robots = 'noindex, nofollow'
+ bodyclass = 'fullwidthpage';
+%]
+
+[% IF body %]
+<hgroup>
+ [% tprintf(loc('<h2>Reports, Statistics and Actions for</h2> <h1>%s</h1>'), body_name) %]
+</hgroup>
+[% ELSE %]
+<h1>[% loc('Summary statistics') %]</h1>
+[% END %]
+
+<p><a href="[% c.uri_for_action('dashboard/index') %]">[% loc('Back') %]</a></p>
+
+[% END %]
+
+<table id="overview" cellpadding=8 cellspacing=0>
+ <tr>
+ <th scope="col">[% loc('Created') %]</th>
+ <th scope="col">[% loc('CSV File') %]</th>
+ </tr>
+ [% in_progress = 0 %]
+ [% FOR file IN rows %]
+ <tr>
+ <td>[% date.format(file.ctime, format = '%Y-%m-%d %H:%M') %]</td>
+ <td>
+ [% IF file.finished %]
+ <a href="/dashboard/csv/[% file.name %]">[% file.name %]</a>
+ <br>[% file.size div 1024 %]KB
+ [% ELSE %]
+ [% file.name %]
+ <br>[% file.size div 1024 %]KB
+ <i>[% loc('In progress') %]</i>
+ [% in_progress = 1 %]
+ [% END %]
+ </td>
+ </tr>
+ [% END %]
+</table>
+
+[% IF NOT c.get_param('ajax') %]
+
+[% IF in_progress %]
+<script nonce="[% csp_nonce %]">
+(function() {
+ var wait = 1;
+ setTimeout(function refresh() {
+ $('#overview').load('[% c.uri_for_action('dashboard/status') %]?ajax=1', function() {
+ if ($(this).html().indexOf('<i>[% loc('In progress', "JS") %]</i>') === -1) {
+ return;
+ }
+ wait += 1;
+ if (wait > 10) {
+ wait = 10;
+ }
+ setTimeout(refresh, wait * 1000);
+ });
+ }, wait * 1000);
+})();
+</script>
+[% END %]
+
+[% INCLUDE 'footer.html' %]
+[% END %]