diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..17f8375 --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +cache/* +!cache/.gitkeep +nbproject/private/ +vendor/ +config.inc.php \ No newline at end of file diff --git a/addjob.php b/addjob.php new file mode 100644 index 0000000..4c01302 --- /dev/null +++ b/addjob.php @@ -0,0 +1,85 @@ +. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +require_once "include/initialize.inc.php"; + +if ($_SERVER["REQUEST_METHOD"] == "GET") { + $loader = new Twig_Loader_Filesystem('templates'); + $twig = new Twig_Environment($loader, array('cache' => 'cache', "debug" => true)); + + $error = ""; + if ($_GET["error"]) { + switch ($_GET["error"]) { + case "emptyfields": + $error = "Some fields were empty"; break; + case "invalidurl": + $error = "The URL is invalid"; break; + case "invaliddelay": + $error = "The delay is invalid"; break; + } + } + + $message = ""; + if ($_GET["message"]) { + switch ($_GET["message"]) { + case "added": + $message = "The cronjob has been added"; break; + } + } + + echo $twig->render('addjob.html.twig', array("message" => $message, "error" => $error)); +} +elseif ($_SERVER["REQUEST_METHOD"] == "POST") { + + if (empty($_POST['name']) || empty($_POST['url'] || empty($_POST['delay']))) { + header("location:addjob.php?error=emptyfields"); + exit; + } + + $url = $_POST['url']; + $name = $_POST['name']; + $delay = $_POST['delay']; + + if(filter_var($url, FILTER_VALIDATE_URL) === FALSE) { + header("location:addjob.php?error=invalidurl"); + exit; + } + + if(!is_numeric($delay)) { + header("location:addjob.php?error=invaliddelay"); + exit; + } + + + $stmt = $db->prepare("INSERT INTO jobs(user, name, url, delay, nextrun) VALUES(?, ?, ?, ?, ?)"); + $stmt->execute(array($_SESSION["userID"], $name, $url, $delay, time()+$delay)); + + header("location:addjob.php?message=added"); + exit; +} + + +require_once 'include/finalize.inc.php'; \ No newline at end of file diff --git a/cache/.gitkeep b/cache/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..1abbe5b --- /dev/null +++ b/composer.json @@ -0,0 +1,14 @@ +{ + "name": "jeroened/jeroen-e-d-web-dev-webcron", + "description": "Description of project JeroenED-WebDev-Webcron.", + "authors": [ + { + "name": "Jeroen De Meerleer", + "email": "me@jeroened.be" + } + ], + "require": { + "guzzlehttp/guzzle": "6.2.3", + "twig/twig": "v2.3.0" + } +} diff --git a/composer.lock b/composer.lock new file mode 100644 index 0000000..b8a769e --- /dev/null +++ b/composer.lock @@ -0,0 +1,369 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", + "This file is @generated automatically" + ], + "hash": "94673161c41195b4e13ab88bfb8b548e", + "content-hash": "59067e6b5fba936b8b1dbb117e2c3a0a", + "packages": [ + { + "name": "guzzlehttp/guzzle", + "version": "6.2.3", + "source": { + "type": "git", + "url": "https://github.com/guzzle/guzzle.git", + "reference": "8d6c6cc55186db87b7dc5009827429ba4e9dc006" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/8d6c6cc55186db87b7dc5009827429ba4e9dc006", + "reference": "8d6c6cc55186db87b7dc5009827429ba4e9dc006", + "shasum": "" + }, + "require": { + "guzzlehttp/promises": "^1.0", + "guzzlehttp/psr7": "^1.4", + "php": ">=5.5" + }, + "require-dev": { + "ext-curl": "*", + "phpunit/phpunit": "^4.0", + "psr/log": "^1.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "6.2-dev" + } + }, + "autoload": { + "files": [ + "src/functions_include.php" + ], + "psr-4": { + "GuzzleHttp\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + } + ], + "description": "Guzzle is a PHP HTTP client library", + "homepage": "http://guzzlephp.org/", + "keywords": [ + "client", + "curl", + "framework", + "http", + "http client", + "rest", + "web service" + ], + "time": "2017-02-28 22:50:30" + }, + { + "name": "guzzlehttp/promises", + "version": "v1.3.1", + "source": { + "type": "git", + "url": "https://github.com/guzzle/promises.git", + "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/promises/zipball/a59da6cf61d80060647ff4d3eb2c03a2bc694646", + "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646", + "shasum": "" + }, + "require": { + "php": ">=5.5.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4-dev" + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\Promise\\": "src/" + }, + "files": [ + "src/functions_include.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + } + ], + "description": "Guzzle promises library", + "keywords": [ + "promise" + ], + "time": "2016-12-20 10:07:11" + }, + { + "name": "guzzlehttp/psr7", + "version": "1.4.2", + "source": { + "type": "git", + "url": "https://github.com/guzzle/psr7.git", + "reference": "f5b8a8512e2b58b0071a7280e39f14f72e05d87c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/f5b8a8512e2b58b0071a7280e39f14f72e05d87c", + "reference": "f5b8a8512e2b58b0071a7280e39f14f72e05d87c", + "shasum": "" + }, + "require": { + "php": ">=5.4.0", + "psr/http-message": "~1.0" + }, + "provide": { + "psr/http-message-implementation": "1.0" + }, + "require-dev": { + "phpunit/phpunit": "~4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4-dev" + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\Psr7\\": "src/" + }, + "files": [ + "src/functions_include.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "Tobias Schultze", + "homepage": "https://github.com/Tobion" + } + ], + "description": "PSR-7 message implementation that also provides common utility methods", + "keywords": [ + "http", + "message", + "request", + "response", + "stream", + "uri", + "url" + ], + "time": "2017-03-20 17:10:46" + }, + { + "name": "psr/http-message", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-message.git", + "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363", + "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for HTTP messages", + "homepage": "https://github.com/php-fig/http-message", + "keywords": [ + "http", + "http-message", + "psr", + "psr-7", + "request", + "response" + ], + "time": "2016-08-06 14:39:51" + }, + { + "name": "symfony/polyfill-mbstring", + "version": "v1.3.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "e79d363049d1c2128f133a2667e4f4190904f7f4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/e79d363049d1c2128f133a2667e4f4190904f7f4", + "reference": "e79d363049d1c2128f133a2667e4f4190904f7f4", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for the Mbstring extension", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], + "time": "2016-11-14 01:06:16" + }, + { + "name": "twig/twig", + "version": "v2.3.0", + "source": { + "type": "git", + "url": "https://github.com/twigphp/Twig.git", + "reference": "9718186a5df85a4f7917e78d3ffcabc204c75d25" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/twigphp/Twig/zipball/9718186a5df85a4f7917e78d3ffcabc204c75d25", + "reference": "9718186a5df85a4f7917e78d3ffcabc204c75d25", + "shasum": "" + }, + "require": { + "php": "^7.0", + "symfony/polyfill-mbstring": "~1.0" + }, + "require-dev": { + "psr/container": "^1.0", + "symfony/debug": "~2.7", + "symfony/phpunit-bridge": "~3.3@dev" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.3-dev" + } + }, + "autoload": { + "psr-0": { + "Twig_": "lib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com", + "homepage": "http://fabien.potencier.org", + "role": "Lead Developer" + }, + { + "name": "Armin Ronacher", + "email": "armin.ronacher@active-4.com", + "role": "Project Founder" + }, + { + "name": "Twig Team", + "homepage": "http://twig.sensiolabs.org/contributors", + "role": "Contributors" + } + ], + "description": "Twig, the flexible, fast, and secure template language for PHP", + "homepage": "http://twig.sensiolabs.org", + "keywords": [ + "templating" + ], + "time": "2017-03-22 15:41:51" + } + ], + "packages-dev": [], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": [], + "prefer-stable": false, + "prefer-lowest": false, + "platform": [], + "platform-dev": [] +} diff --git a/css/site.css b/css/site.css new file mode 100644 index 0000000..0b8cc56 --- /dev/null +++ b/css/site.css @@ -0,0 +1,5 @@ +body{ + margin-left:auto; + margin-right:auto; + width:90%; +} \ No newline at end of file diff --git a/index.php b/index.php new file mode 100644 index 0000000..8614b75 --- /dev/null +++ b/index.php @@ -0,0 +1,73 @@ +. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +require_once "include/initialize.inc.php"; + +if ($_SERVER["REQUEST_METHOD"] == "GET") { + $loader = new Twig_Loader_Filesystem('templates'); + $twig = new Twig_Environment($loader, array('cache' => 'cache', "debug" => true)); + + $error = ""; + if ($_GET["error"]) { + switch ($_GET["error"]) { + case "emptyfields": + $error = "Some fields were empty"; break; + case "invalidcredentials": + $error = "The credentials were invalid"; break; + } + } + + + echo $twig->render('index.html.twig', array("message" => $message, "error" => $error)); +} +elseif ($_SERVER["REQUEST_METHOD"] == "POST") { + + if (empty($_POST['name']) || empty($_POST['passwd'])) { + header("location:index.php?error=emptyfields"); + exit; + } + + $passwd = $_POST['passwd']; + $name = $_POST['name']; + + + $userQry = $db->prepare("SELECT * FROM users WHERE name = ?"); + $userQry->execute(array($name)); + $user = $userQry->fetchAll(PDO::FETCH_ASSOC); + + if ( password_verify($passwd, $user[0]['password']) ) { + $_SESSION['userID'] = $user[0]['userID']; + header("location:overview.php"); + exit; + + } else { + header("location:index.php?error=invalidcredentials"); + exit; + } +} + + +require_once 'include/finalize.inc.php'; \ No newline at end of file diff --git a/js/site.js b/js/site.js new file mode 100644 index 0000000..be82f7d --- /dev/null +++ b/js/site.js @@ -0,0 +1,30 @@ +/* + * The MIT License + * + * Copyright 2017 Jeroen De Meerleer . + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + + +$(document).ready(function() { + $("body").on("change", "#patternDropdown", function() { + if(this.value != "custom") { $("input#delay").val($("option:selected", this).data("val")); } + }); +}); diff --git a/nbproject/project.properties b/nbproject/project.properties new file mode 100644 index 0000000..3b5ae6d --- /dev/null +++ b/nbproject/project.properties @@ -0,0 +1,9 @@ +browser.reload.on.save=true +include.path=${php.global.include.path} +php.version=PHP_70 +project.license=mit +source.encoding=UTF-8 +src.dir=. +tags.asp=false +tags.short=false +web.root=. diff --git a/nbproject/project.xml b/nbproject/project.xml new file mode 100644 index 0000000..fd25c26 --- /dev/null +++ b/nbproject/project.xml @@ -0,0 +1,9 @@ + + + org.netbeans.modules.php.project + + + JeroenED-WebDev-Webcron + + + diff --git a/overview.php b/overview.php new file mode 100644 index 0000000..84ca2f6 --- /dev/null +++ b/overview.php @@ -0,0 +1,71 @@ +. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +require_once "include/initialize.inc.php"; + +$allJobs = $db->prepare("SELECT * FROM jobs WHERE user = ?"); +$allJobs->execute(array($_SESSION["userID"])); +$allJobsResult = $allJobs->fetchAll(PDO::FETCH_ASSOC); + +$loader = new Twig_Loader_Filesystem('templates'); +$twig = new Twig_Environment($loader, array('cache' => 'cache', "debug" => true)); + +//var_dump($alljobsResult); +//exit; + +$allJobsRendered = array();$count = 0; +foreach($allJobsResult as $key=>$value) { + $allJobsRendered[$count]["jobID"] = $value["jobID"]; + $allJobsRendered[$count]["name"] = $value["name"]; + $allJobsRendered[$count]["nextrun"] = date("d/m/Y H:i:s", $value["nextrun"]); + $allJobsRendered[$count]["delay"] = secondsToInterval($value["delay"]); + + $count++; +} + +$twig_vars = array('jobs' => $allJobsRendered); + +//echo $twig->render('overview.html.twig', array('the' => 'variables', 'go' => 'here')); +echo $twig->render('overview.html.twig', $twig_vars); + + +require_once 'include/finalize.inc.php'; + +function secondsToInterval($time) { + $days = floor($time / (60 * 60 * 24)); + $time -= $days * (60 * 60 * 24); + + $hours = floor($time / (60 * 60)); + $time -= $hours * (60 * 60); + + $minutes = floor($time / 60); + $time -= $minutes * 60; + + $seconds = floor($time); + $time -= $seconds; + + return "{$days}d {$hours}h {$minutes}m {$seconds}s"; +} \ No newline at end of file diff --git a/runs.php b/runs.php new file mode 100644 index 0000000..cef4a6d --- /dev/null +++ b/runs.php @@ -0,0 +1,56 @@ +. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +require_once "include/initialize.inc.php"; + +$runsForJob = $db->prepare("SELECT runs.*, jobs.name FROM runs, jobs WHERE runs.job = jobs.jobID AND runs.job = ?"); +$runsForJob->execute(array($_GET['jobID'])); +$runsForJobResult = $runsForJob->fetchAll(PDO::FETCH_ASSOC); + +$loader = new Twig_Loader_Filesystem('templates'); +$twig = new Twig_Environment($loader, array('cache' => 'cache', "debug" => true)); + +//var_dump($alljobsResult); +//exit; + +$jobName = $runsForJobResult[0]['jobname']; +$runsForJobRendered = array();$count = 0; +foreach($runsForJobResult as $key=>$value) { + $runsForJobRendered[$count]["runID"] = $value["runID"]; + $runsForJobRendered[$count]["statuscode"] = $value["statuscode"]; + $runsForJobRendered[$count]["result"] = $value["result"]; + $runsForJobRendered[$count]["timestamp"] = date("d/m/Y H:i:s", $value["timestamp"]); + + $count++; +} + +$twig_vars = array('runs' => $runsForJobRendered, "title" => $jobName); + +//echo $twig->render('overview.html.twig', array('the' => 'variables', 'go' => 'here')); +echo $twig->render('runs.html.twig', $twig_vars); + + +require_once 'include/finalize.inc.php'; \ No newline at end of file diff --git a/templates/addjob.html.twig b/templates/addjob.html.twig new file mode 100644 index 0000000..e95e24b --- /dev/null +++ b/templates/addjob.html.twig @@ -0,0 +1,48 @@ +{% extends "base.html.twig" %} + +{% block content %} +
+ {% if not error == "" %} +
+ × + Error! {{ error }} +
+ {% endif %} + + {% if not message == "" %} +
+ × + {{ message }} +
+ {% endif %} + +
+ + +
+
+ + +
+ +
+
+ + +
+
+ + +
+
+ +
+ +{% endblock %} \ No newline at end of file diff --git a/templates/base.html.twig b/templates/base.html.twig new file mode 100644 index 0000000..882bad9 --- /dev/null +++ b/templates/base.html.twig @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + +
+
+
+ +
+
+
+
+ {% block content %}{% endblock %} +
+ + + diff --git a/templates/index.html.twig b/templates/index.html.twig new file mode 100644 index 0000000..0b1ba2b --- /dev/null +++ b/templates/index.html.twig @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + +
+

Webcron management

+
+ {% if not error == "" %} +
+ × + Error! {{ error }} +
+ {% endif %} + +
+ + +
+
+ + +
+ +
+
+ + \ No newline at end of file diff --git a/templates/overview.html.twig b/templates/overview.html.twig new file mode 100644 index 0000000..082b1ac --- /dev/null +++ b/templates/overview.html.twig @@ -0,0 +1,10 @@ +{% extends "base.html.twig" %} +{% block content %} +

Overview of your cronjobs

+ + +{% for job in jobs %} + +{% endfor %} +
IDNameDelayNext run
{{ job.jobID }}{{ job.name }}{{ job.delay }}{{ job.nextrun }}View runs
+{% endblock %} \ No newline at end of file diff --git a/templates/runs.html.twig b/templates/runs.html.twig new file mode 100644 index 0000000..c0e00e3 --- /dev/null +++ b/templates/runs.html.twig @@ -0,0 +1,20 @@ +{% extends "base.html.twig" %} +{% block content %} +

Overview of runs of {{ title }}

+
+{% for run in runs %} +
+ +
+
+ {{ run.result }} +
+
+
+{% endfor %} + +{% endblock %} \ No newline at end of file