feat: move stream stats status to pref table

This commit is contained in:
jo 2022-08-06 23:56:58 +02:00 committed by Kyle Robbertze
parent 2b533d4724
commit 406d42323a
7 changed files with 57 additions and 35 deletions

View file

@ -1389,8 +1389,8 @@ class ApiController extends Zend_Controller_Action
return;
}
foreach ($data as $k => $v) {
Application_Model_StreamSetting::SetListenerStatError($k, $v);
foreach ($data as $stream_id => $status) {
Application_Model_Preference::SetListenerStatError($stream_id, $status);
}
}

View file

@ -41,15 +41,15 @@ class ListenerstatController extends Zend_Controller_Action
'his_time_end' => $endsDT->format('H:i'),
]);
$errorStatus = Application_Model_StreamSetting::GetAllListenerStatErrors();
$errorStatus = Application_Model_Preference::GetAllListenerStatErrors();
Logging::info($errorStatus);
$out = [];
foreach ($errorStatus as $v) {
$key = explode('_listener_stat_error', $v['keyname']);
if ($v['value'] != 'OK') {
$v['value'] = _('Please make sure admin user/password is correct on Settings->Streams page.');
$key = explode(':', $v['keystr']);
if ($v['valstr'] != 'OK') {
$v['valstr'] = _('Please make sure admin user/password is correct on Settings->Streams page.');
}
$out[$key[0]] = $v['value'];
$out['stream ' . $key[1]] = $v['valstr'];
}
$this->view->errorStatus = $out;