- fixed getResourcePath in RaspberryDisplay/Index.php

- fixed php7 compatibility in RaspberryDisplayController.php
This commit is contained in:
2024-02-14 13:37:17 +01:00
parent 742a2c1495
commit cac0deeccc
2 changed files with 19 additions and 8 deletions
+1 -1
View File
@@ -96,4 +96,4 @@ include(realpath(dirname(__FILE__) . "/../../$mfLayoutPackage") . "/header.php")
</div> </div>
<script src="/js/pages/raspberryDisplay.js?<?=$git_merge_ts?>"></script> <script src="<?=self::getResourcePath()?>js/pages/raspberryDisplay.js?<?=$git_merge_ts?>"></script>
@@ -86,13 +86,24 @@ class RaspberryDisplayController extends mfBaseController
$this->redirect("dashboard"); $this->redirect("dashboard");
} }
$return = match ($do) { switch ($do) {
"getDisplays" => $this->getDisplaysApi(), case "getDisplays":
"change" => $this->change(), $return = $this->getDisplaysApi();
"reboot" => $this->restartRaspberryPi($this->request->displayID), break;
"getConfig" => $this->getConfig(), case "change":
default => false, $return = $this->change();
}; break;
case "reboot":
$return = $this->restartRaspberryPi($this->request->displayID);
break;
case "getConfig":
$return = $this->getConfig();
break;
default:
$return = false;
break;
}
$data = []; $data = [];