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.
This commit is contained in:
Franco Fichtner 2024-09-11 16:55:18 +02:00
parent 5ff5294340
commit c86e31a0d0
2 changed files with 9 additions and 3 deletions

View file

@ -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

View file

@ -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");