From c86e31a0d03bb385ae70143a3f72af5e7a407cfe Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Wed, 11 Sep 2024 16:55:18 +0200 Subject: [PATCH] sysutils/smart: widget needs a rework I'd rather emulate the old network which used the detailed list backend call. Funnel this through the API on request but no time to do this now. --- sysutils/smart/Makefile | 3 ++- .../controllers/OPNsense/Smart/Api/ServiceController.php | 9 +++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/sysutils/smart/Makefile b/sysutils/smart/Makefile index 2afa17e45..bdacbc9e0 100644 --- a/sysutils/smart/Makefile +++ b/sysutils/smart/Makefile @@ -1,5 +1,6 @@ PLUGIN_NAME= smart -PLUGIN_VERSION= 2.3 +PLUGIN_VERSION= 2.2 +PLUGIN_REVISION= 6 PLUGIN_COMMENT= SMART tools PLUGIN_DEPENDS= smartmontools PLUGIN_MAINTAINER= franco@opnsense.org diff --git a/sysutils/smart/src/opnsense/mvc/app/controllers/OPNsense/Smart/Api/ServiceController.php b/sysutils/smart/src/opnsense/mvc/app/controllers/OPNsense/Smart/Api/ServiceController.php index 874ba272f..d35feb29b 100644 --- a/sysutils/smart/src/opnsense/mvc/app/controllers/OPNsense/Smart/Api/ServiceController.php +++ b/sysutils/smart/src/opnsense/mvc/app/controllers/OPNsense/Smart/Api/ServiceController.php @@ -43,10 +43,15 @@ class ServiceController extends ApiControllerBase return $devices; } - public function listAction() + public function listAction($details = null) { if ($this->request->isPost()) { - return array("devices" => $this->getDevices()); + $backend = new Backend(); + + $devices = empty($details) ? $this->getDevices() : + json_decode(trim($backend->configdRun('smart detailed list')), true); + + return ['devices' => $devices]; } return array("message" => "Unable to run list action");