Add trigger time to notification and newsletter tables

This commit is contained in:
JonnyWong16 2023-10-09 11:37:56 -07:00
parent 62be48df9c
commit fdc1dd3525
No known key found for this signature in database
GPG key ID: B1F1F9807184697A
5 changed files with 60 additions and 15 deletions

View file

@ -20,13 +20,28 @@ DOCUMENTATION :: END
% else:
${newsletter['agent_label']} &nbsp;<span class="friendly_name">(${newsletter['id']})</span>
% endif
<span class="toggle-right"><i class="fa fa-lg fa-fw fa-cog"></i></span>
<span class="toggle-right friendly_name" id="newsletter-next_run-${newsletter['id']}">
<span class="toggle-right friendly_name">
% if newsletter_handler.NEWSLETTER_SCHED.get_job('newsletter-{}'.format(newsletter['id'])):
<% job = newsletter_handler.NEWSLETTER_SCHED.get_job('newsletter-{}'.format(newsletter['id'])) %>
<script>
$("#newsletter-next_run-${newsletter['id']}").text(moment("${job.next_run_time}", "YYYY-MM-DD HH:mm:ssZ").fromNow())
</script>
<span id="newsletter-next_run-${newsletter['id']}">
<script>
$("#newsletter-next_run-${newsletter['id']}").text(
"Next: " + moment("${job.next_run_time}", "YYYY-MM-DD HH:mm:ssZ").fromNow() + " | ")
</script>
</span>
% endif
% if newsletter['last_triggered']:
<% icon, icon_tooltip = ('fa-check', 'Success') if newsletter['last_success'] else ('fa-times', 'Failed') %>
<span id="newsletter-last_triggered-${newsletter['id']}">
<script>
$("#newsletter-last_triggered-${newsletter['id']}").html(
"Last: " + moment("${newsletter['last_triggered']}", "X").fromNow() + ' <i class="fa fa-lg fa-fw ${icon}" data-toggle="tooltip" data-placement="top" title="${icon_tooltip}"></i>'
)
</script>
</span>
% else:
Last: never
<i class="fa fa-lg fa-fw fa-minus"></i>
% endif
</span>
</span>

View file

@ -19,7 +19,20 @@ DOCUMENTATION :: END
% else:
${notifier['agent_label']} &nbsp;<span class="friendly_name">(${notifier['id']})</span>
% endif
<span class="toggle-right"><i class="fa fa-lg fa-fw fa-cog"></i></span>
<span class="toggle-right friendly_name">
% if notifier['last_triggered']:
<% icon, icon_tooltip = ('fa-check', 'Success') if notifier['last_success'] else ('fa-times', 'Failed') %>
<span id="notifier-last_triggered-${notifier['id']}">
<script>
$("#notifier-last_triggered-${notifier['id']}").html(
moment("${notifier['last_triggered']}", "X").fromNow() + ' <i class="fa fa-lg fa-fw ${icon}" data-toggle="tooltip" data-placement="top" title="${icon_tooltip}"></i>'
)
</script>
</span>
% else:
never
<i class="fa fa-lg fa-fw fa-minus"></i>
% endif
</span>
</li>
% endfor

View file

@ -1278,7 +1278,7 @@
</div>
<p class="help-block">
Add a new notification agent, or configure an existing notification agent by clicking the settings icon on the right.
Add a new notification agent, or configure an existing notification agent by clicking on the item below.
</p>
<p class="help-block">
Please see the <a href="${anon_url('https://github.com/%s/%s/wiki/Notification-Agents-Guide' % (plexpy.CONFIG.GIT_USER, plexpy.CONFIG.GIT_REPO))}" target="_blank" rel="noreferrer">Notification Agents Guide</a> for instructions on setting up each notification agent.
@ -1298,7 +1298,7 @@
</div>
<p class="help-block">
Add a new newsletter agent, or configure an existing newsletter agent by clicking the settings icon on the right.
Add a new newsletter agent, or configure an existing newsletter agent by clicking on the item below.
</p>
<p class="help-block settings-warning" id="newsletter_upload_warning">
Warning: The <a data-tab-destination="3rd_party_apis" data-target="notify_upload_posters">Image Hosting</a> setting must be enabled for images to display on the newsletter.</span>
@ -1630,7 +1630,7 @@
</div>
<div class="form-group">
<label>Registered Devices</label>
<p class="help-block">Register a new device using a QR code, or configure an existing device by clicking the settings icon on the right.</p>
<p class="help-block">Register a new device using a QR code, or configure an existing device by clicking on the item below.</p>
<p id="app_api_msg" style="color: #eb8600;">Warning: The API must be enabled under <a data-tab-destination="web_interface" data-target="api_enabled">Web Interface</a> to use the app.</p>
<br />
<div class="row">