diff --git a/station/config.py b/station/config.py index 29d7882..4dae005 100644 --- a/station/config.py +++ b/station/config.py @@ -1,4 +1,4 @@ masterUrl = "http://10.0.0.8" -apiKey = "783439f5-be14-4877-a396-6d8bc4783c3c" +apiKey = "a22c1e54-d35c-4058-993d-9f34c0fba428" pullInterval = 120 # in sec planInterval = 1200 # in sec \ No newline at end of file diff --git a/web/CONTROLLERS/targets.php b/web/CONTROLLERS/targets.php index 68edaa4..f6efe3b 100644 --- a/web/CONTROLLERS/targets.php +++ b/web/CONTROLLERS/targets.php @@ -12,14 +12,18 @@ $targets = (new \wsos\database\core\table(\DAL\target::class))->getAll(); + // create planed template observations + $ob = new \DAL\observation(); + foreach ($targets->values as $target) { - $last = (new \wsos\database\core\table(\DAL\observation::class))->query("transmitter.target.id = ?", [$target->id->get()], "DESC end", 1); + $last = (new \wsos\database\core\table(\DAL\observation::class))->query("transmitter.target.id == ? && status == ?", [$target->id->get(), $ob->status->getVal("success")], "DESC end", 1); $last = $last->len() > 0 ? "ago " . $last->values[0]->end->strDelta() : "never"; - $observations = (new \wsos\database\core\table(\DAL\observation::class))->count("transmitter.target.id = ?", [$target->id->get()]); + $observations = (new \wsos\database\core\table(\DAL\observation::class))->count("transmitter.target.id == ?", [$target->id->get()]); $context["targets"]->append([ + "id" => $target->id->get(), "name" => $target->name->get(), "orbit" => $target->orbit->get(), "type" => $target->type->get()->name->get(),