summaryrefslogtreecommitdiff
path: root/pages/jobs.inc
diff options
context:
space:
mode:
authorRaindropsSys <contact@minteck.org>2023-04-13 22:07:44 +0200
committerRaindropsSys <contact@minteck.org>2023-04-13 22:07:44 +0200
commiteb7405f92bd01ab59a056ff5df6d2f1d6b30f0ce (patch)
treec15e12e96e0e83b665e4931df50bc034620fde3e /pages/jobs.inc
parenteafc2b02a66838fdadb2da70d5b1a9aa04051de6 (diff)
downloadpluralconnect-eb7405f92bd01ab59a056ff5df6d2f1d6b30f0ce.tar.gz
pluralconnect-eb7405f92bd01ab59a056ff5df6d2f1d6b30f0ce.tar.bz2
pluralconnect-eb7405f92bd01ab59a056ff5df6d2f1d6b30f0ce.zip
Updated 13 files and added 2 files (automated)
Diffstat (limited to 'pages/jobs.inc')
-rw-r--r--pages/jobs.inc18
1 files changed, 15 insertions, 3 deletions
diff --git a/pages/jobs.inc b/pages/jobs.inc
index 109b484..6723175 100644
--- a/pages/jobs.inc
+++ b/pages/jobs.inc
@@ -1,10 +1,18 @@
<?php
require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/init.inc"; global $title; global $isLoggedIn; global $lang; global $pages;
-require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/components/header.inc';
+require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/util/functions.inc';
$history = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/history.json"), true);
+if (isset($_GET["enqueue"]) && isset($history[(int)$_GET["enqueue"]])) {
+ createJob(explode("(", $history[(int)$_GET["enqueue"]]["name"])[0], $history[(int)$_GET["enqueue"]]["options"]);
+ header("Location: /-/jobs/?enqueued");
+ die();
+}
+
+require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/components/header.inc';
+
?>
<style>
@@ -60,8 +68,12 @@ $history = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/
<div id="page-content">
<h2>Jobs history</h2>
+ <?php if (isset($_GET["enqueued"])): ?>
+ <div class="alert alert-success">Successfully enqueued a new job, it will be run shortly and appear on this page once it has finished.</div>
+ <?php endif; ?>
+
<div class="list-group">
- <?php foreach ($history as $item): ?>
+ <?php foreach ($history as $index => $item): ?>
<details class="list-group-item">
<summary style="list-style: none; display: grid; grid-template-columns: 3fr repeat(2, 1fr);">
<div><?= $item["name"] ?></div>
@@ -72,7 +84,7 @@ $history = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/
<div class="list-group" style="margin-top: 10px;">
<div class="list-group-item">
<p>
- <b>Duration:</b> <?= $item["time"] ?>ms
+ <b>Duration:</b> <?= $item["time"] ?>ms ยท <a href="/-/jobs/?enqueue=<?= $index ?>">Enqueue again</a>
<b></b>
</p>