Record notification count and show in [stats] tab (#2150)

pull/2152/head
dgtlmoon 11 months ago committed by GitHub
parent 4ee9fa79e1
commit 3b16b19a94
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -45,6 +45,7 @@ base_config = {
'last_error': False, 'last_error': False,
'last_viewed': 0, # history key value of the last viewed via the [diff] link 'last_viewed': 0, # history key value of the last viewed via the [diff] link
'method': 'GET', 'method': 'GET',
'notification_alert_count': 0,
# Custom notification content # Custom notification content
'notification_body': None, 'notification_body': None,
'notification_format': default_notification_format_for_watch, 'notification_format': default_notification_format_for_watch,

@ -483,6 +483,10 @@ Unavailable") }}
<td>Last fetch time</td> <td>Last fetch time</td>
<td>{{ watch.fetch_time }}s</td> <td>{{ watch.fetch_time }}s</td>
</tr> </tr>
<tr>
<td>Notification alert count</td>
<td>{{ watch.notification_alert_count }}</td>
</tr>
</tbody> </tbody>
</table> </table>
</div> </div>

@ -150,6 +150,10 @@ class update_worker(threading.Thread):
queued = False queued = False
if n_object and n_object.get('notification_urls'): if n_object and n_object.get('notification_urls'):
queued = True queued = True
count = watch.get('notification_alert_count', 0) + 1
self.datastore.update_watch(uuid=watch_uuid, update_obj={'notification_alert_count': count})
self.queue_notification_for_watch(notification_q=self.notification_q, n_object=n_object, watch=watch) self.queue_notification_for_watch(notification_q=self.notification_q, n_object=n_object, watch=watch)
return queued return queued

Loading…
Cancel
Save