summaryrefslogtreecommitdiff
path: root/classes/Pref_System.php
diff options
context:
space:
mode:
authorAndrew Dolgov <fox@fakecake.org>2025-05-04 13:44:08 +0300
committerAndrew Dolgov <fox@fakecake.org>2025-05-04 13:44:08 +0300
commitfecab891fc2285e29d940a3185a61f80889f26e6 (patch)
treeebb4252690cf811e2a975bae7908ca252ac91f29 /classes/Pref_System.php
parentec12a514a28edb446a84d949ec7d1cda2bbcc349 (diff)
add a basic prefs panel for scheduled task records
Diffstat (limited to 'classes/Pref_System.php')
-rw-r--r--classes/Pref_System.php38
1 files changed, 35 insertions, 3 deletions
diff --git a/classes/Pref_System.php b/classes/Pref_System.php
index 43bc733f0..c5d7ab606 100644
--- a/classes/Pref_System.php
+++ b/classes/Pref_System.php
@@ -28,6 +28,38 @@ class Pref_System extends Handler_Administrative {
print json_encode(['rc' => $rc, 'error' => $mailer->error()]);
}
+ function getscheduledtasks(): void {
+ ?>
+ <table width='100%' class='event-log'>
+ <tr>
+ <th><?= __("Task name") ?></th>
+ <th><?= __("Last executed") ?></th>
+ <th><?= __("Duration (seconds)") ?></th>
+ <th><?= __("Return code") ?></th>
+ </tr>
+ <?php
+
+ $task_records = ORM::for_table('ttrss_scheduled_tasks')
+ ->find_many();
+
+ foreach ($task_records as $task) {
+ $row_style = $task->last_rc === 0 ? 'text-success' : 'text-error';
+
+ ?>
+ <tr>
+ <td class="<?= $row_style ?>"><?= $task->task_name ?></td>
+ <td><?= TimeHelper::make_local_datetime($task->last_run) ?></td>
+ <td><?= $task->last_duration ?></td>
+ <td><?= $task->last_rc ?></td>
+ </tr>
+ <?php
+ }
+
+ ?>
+ </table>
+ <?php
+ }
+
function getphpinfo(): void {
ob_start();
phpinfo();
@@ -205,18 +237,18 @@ class Pref_System extends Handler_Administrative {
</form>
</div>
</div>
- <div dojoType='dijit.layout.AccordionPane' title='<i class="material-icons">info</i> <?= __('PHP Information') ?>'>
+ <div dojoType='dijit.layout.AccordionPane' title='<i class="material-icons">alarm</i> <?= __('Scheduled tasks') ?>'>
<script type='dojo/method' event='onSelected' args='evt'>
if (this.domNode.querySelector('.loading'))
window.setTimeout(() => {
- xhr.post("backend.php", {op: 'Pref_System', method: 'getphpinfo'}, (reply) => {
+ xhr.post("backend.php", {op: 'Pref_System', method: 'getscheduledtasks'}, (reply) => {
this.attr('content', `<div class='phpinfo'>${reply}</div>`);
});
}, 200);
</script>
<span class='loading'><?= __("Loading, please wait...") ?></span>
</div>
- <div dojoType='dijit.layout.AccordionPane' title='<i class="material-icons">info</i> <?= __('Scheduled tasks') ?>'>
+ <div dojoType='dijit.layout.AccordionPane' title='<i class="material-icons">info</i> <?= __('PHP Information') ?>'>
<script type='dojo/method' event='onSelected' args='evt'>
if (this.domNode.querySelector('.loading'))
window.setTimeout(() => {