diff options
author | Simon Rettberg | 2016-07-15 19:05:43 +0200 |
---|---|---|
committer | Simon Rettberg | 2016-07-15 19:05:43 +0200 |
commit | 6cb497bc2778eb4ebc8fd5ef87f7b2cb0949cab5 (patch) | |
tree | 4f2ee9b0ef7dddab27bcac9e864b23e1da4f7230 /modules-available/dozmod | |
parent | Merging some refactoring + new filter functionality. (diff) | |
download | slx-admin-6cb497bc2778eb4ebc8fd5ef87f7b2cb0949cab5.tar.gz slx-admin-6cb497bc2778eb4ebc8fd5ef87f7b2cb0949cab5.tar.xz slx-admin-6cb497bc2778eb4ebc8fd5ef87f7b2cb0949cab5.zip |
[dozmod] Error feedback on mailtest; check-all for image-delete; longer timeouts for dozmod calls
Diffstat (limited to 'modules-available/dozmod')
-rw-r--r-- | modules-available/dozmod/page.inc.php | 10 | ||||
-rw-r--r-- | modules-available/dozmod/templates/images-delete.html | 37 |
2 files changed, 42 insertions, 5 deletions
diff --git a/modules-available/dozmod/page.inc.php b/modules-available/dozmod/page.inc.php index f0cbe3f4..60c6c24a 100644 --- a/modules-available/dozmod/page.inc.php +++ b/modules-available/dozmod/page.inc.php @@ -60,6 +60,7 @@ class Page_DozMod extends Page while ($row = $res->fetch(PDO::FETCH_ASSOC)) { if ($row['latexptime'] > $NOW && $row['latdelstate'] === 'KEEP') { $row['hasNewerClass'] = 'glyphicon-ok green'; + $row['checked'] = 'checked'; } else { $row['hasNewerClass'] = 'glyphicon-remove red'; } @@ -119,7 +120,7 @@ class Page_DozMod extends Page )); } if (!empty($images)) { - $ret = Download::asStringPost('http://127.0.0.1:9080/do/delete-images', false, 2, $code); + $ret = Download::asStringPost('http://127.0.0.1:9080/do/delete-images', false, 10, $code); if ($code == 999) { $ret .= "\nConnection to DMSD failed."; } @@ -140,7 +141,12 @@ class Page_DozMod extends Page if (!preg_match('/.+@.+\..+/', $data['recipient'])) { $result = 'No recipient given!'; } else { - $result = Download::asStringPost('http://127.0.0.1:9080/do/mailtest', $data, 2, $code); + $result = Download::asStringPost('http://127.0.0.1:9080/do/mailtest', $data, 10, $code); + if ($code == 999) { + $result .= "\nTimeout."; + } elseif ($code != 200) { + $result .= "\nReturn code $code"; + } } die($result); } diff --git a/modules-available/dozmod/templates/images-delete.html b/modules-available/dozmod/templates/images-delete.html index c4cbfd34..99ffb85d 100644 --- a/modules-available/dozmod/templates/images-delete.html +++ b/modules-available/dozmod/templates/images-delete.html @@ -16,9 +16,12 @@ <th>{{lang_image}}</th> <th>{{lang_version}}</th> <th>{{lang_owner}}</th> - <th><span class="glyphicon glyphicon-upload" title="{{lang_hasNewer}}"></th> + <th><span class="glyphicon glyphicon-upload" title="{{lang_hasNewer}}"></span></th> <th>{{lang_size}}</th> - <th><span class="glyphicon glyphicon-trash" title="{{lang_delete}}"></span></th> + <th> + <input id="del-all" type="checkbox" onclick="slxChangeAll()"> + <span class="glyphicon glyphicon-trash" title="{{lang_delete}}"></span> + </th> </tr> </thead> <tbody> @@ -29,7 +32,7 @@ <td class="text-left slx-nowrap"><a href="mailto:{{email}}">{{lastname}}, {{firstname}}</a></td> <td class="text-left slx-nowrap"><span class="glyphicon {{hasNewerClass}}"></span></td> <td class="text-right slx-nowrap">{{filesize}}</td> - <td><input name="images[{{imageversionid}}]" type="checkbox" checked="checked"></td> + <td><input class="del-check" name="images[{{imageversionid}}]" type="checkbox" {{checked}}></td> </tr> {{/images}} </tbody> @@ -54,4 +57,32 @@ function slxPostdel() { return false; } +function slxChangeAll() +{ + if ($('#del-all').is(':checked')) { + $('.del-check').prop('checked', true); + } else { + $('.del-check').prop('checked', false); + } +} + +function slxChangeSingle() +{ + var ons = 0; + var offs = 0; + $('.del-check').each(function(idx, elem) { + if (elem.checked) { + ons++; + } else { + offs++; + } + }); + $('#del-all').prop('checked', offs === 0).prop('indeterminate', ons > 0 && offs > 0); +} + +document.addEventListener("DOMContentLoaded", function() { + $('.del-check').click(slxChangeSingle); + slxChangeSingle(); +}, false); + --> </script>
\ No newline at end of file |