From aa7227c1375a567ca04e465e182b676997cc493a Mon Sep 17 00:00:00 2001 From: fly Date: Sat, 19 Jun 2021 00:06:46 +0200 Subject: [PATCH] Use updated, faster packaging Signed-off-by: fly --- managment/www/api.php | 24 ++++++++++++++++++++++-- packager/Dockerfile | 2 +- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/managment/www/api.php b/managment/www/api.php index e404d21..e31e979 100644 --- a/managment/www/api.php +++ b/managment/www/api.php @@ -132,7 +132,7 @@ if ($action == "set") else if ($action == "get-job" && isset($_POST["status"]) && $_POST["status"] != "" && isset($_POST["new-status"]) && $_POST["new-status"] != "") { get_lock($con); - $sql = "SELECT id FROM tile WHERE status_id = (SELECT id FROM status WHERE name = ?) ORDER BY parent_id LIMIT 1"; + $sql = "SELECT id, parent_id FROM tile WHERE status_id = (SELECT id FROM status WHERE name = ?) ORDER BY parent_id LIMIT 1"; $stmt = $con->prepare($sql); $stmt->bind_param("s", $_POST["status"]); $stmt->execute(); @@ -142,7 +142,8 @@ else if ($action == "get-job" && isset($_POST["status"]) && $_POST["status"] != { quit(); } - $ret->job = $result->fetch_array()[0]; + $res = $result->fetch_array(); // TODO check + $ret->job = $res["id"]; if ($ret->job == Null) { $ret->job = "None"; @@ -150,6 +151,25 @@ else if ($action == "get-job" && isset($_POST["status"]) && $_POST["status"] != else { set_status($con, $ret->job, $_POST["new-status"], "tile"); + if (isset($_POST["all-in-parent"]) && $_POST["all-in-parent"] == 1) + { + $ret->jobs = []; + $ret->jobs[] = $ret->job; + $sql = "SELECT id FROM tile WHERE parent_id = ? AND status_id = (SELECT id FROM status WHERE name = ?)"; + $stmt = $con->prepare($sql); + $stmt->bind_param("ss", $res["parent_id"], $_POST["status"]); + $stmt->execute(); + $result = $stmt->get_result(); + $stmt->close(); + if ($result != False) + { + while ($row = $result->fetch_array()) + { + set_status($con, $row["id"], $_POST["new-status"], "tile"); + $ret->jobs[] = $row["id"]; + } + } + } } rel_lock($con); } diff --git a/packager/Dockerfile b/packager/Dockerfile index 2c4d3af..6d1bb1a 100644 --- a/packager/Dockerfile +++ b/packager/Dockerfile @@ -4,7 +4,7 @@ RUN apt-get -y update && apt-get install -y git python3-pip curl vim wget RUN pip3 install requests -ENV EASY_O2C_SCRIPTS_COMMIT f872846244434e85aa07059f7b7a85747585d43c +ENV EASY_O2C_SCRIPTS_COMMIT 75ff8d8ba1dd727e6b3fd7dca962bfe637fd9faf RUN git clone https://gitlab.com/merspieler/osm2city-scripts.git scripts