- 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

View File

@@ -96,4 +96,4 @@ include(realpath(dirname(__FILE__) . "/../../$mfLayoutPackage") . "/header.php")
</div>
<script src="/js/pages/raspberryDisplay.js?<?=$git_merge_ts?>"></script>
<script src="<?=self::getResourcePath()?>js/pages/raspberryDisplay.js?<?=$git_merge_ts?>"></script>

View File

@@ -86,13 +86,24 @@ class RaspberryDisplayController extends mfBaseController
$this->redirect("dashboard");
}
$return = match ($do) {
"getDisplays" => $this->getDisplaysApi(),
"change" => $this->change(),
"reboot" => $this->restartRaspberryPi($this->request->displayID),
"getConfig" => $this->getConfig(),
default => false,
};
switch ($do) {
case "getDisplays":
$return = $this->getDisplaysApi();
break;
case "change":
$return = $this->change();
break;
case "reboot":
$return = $this->restartRaspberryPi($this->request->displayID);
break;
case "getConfig":
$return = $this->getConfig();
break;
default:
$return = false;
break;
}
$data = [];