Fix minor issues when saving settings

Page was not reloading correctly
Devices were not restarting (returning too soon)
This commit is contained in:
stevenA 2022-01-10 11:31:26 +01:00
parent 6681a07c96
commit 34d6e976f2
2 changed files with 2 additions and 7 deletions

View file

@ -106,7 +106,7 @@ $(document).ready(function () {
var toastDelay = (data.toastFlag == 'success') ? 500 : 1500;
if (data.reload === true) {
//Need setTimout or reload will kill Toast
setTimeout(function(){location.replace(newLocation);},toastDelay);
setTimeout(function(){location.replace(newLocation);location.reload()},toastDelay);
}
}
} else {

View file

@ -56,10 +56,7 @@ trait ajaxHelper {
// TODO: Need to be more specific on reload and only reload if critical settings changed.
$res = $this->aminterface->core_sccp_reload();
$msg [] = array ("Config Saved: {$res['Response']}", "Info : {$res['data']}");
// !TODO!: It is necessary in the future to check, and replace all server responses on correct messages. Use _(msg)
return array('status' => true, 'message' => $msg, 'reload' => true);
return true;
break;
case 'save_sip_device':
case 'save_device':
@ -527,8 +524,6 @@ trait ajaxHelper {
echo json_encode(array('status' => true, 'message' => $msg, 'reload' => true, 'toastFlag' => $toastFlag, 'search' => $search, 'hash' => $hash)). ";#;" ;
ob_flush();
flush();
return $true;
}
public function getMyConfig($var = null, $id = "noid") {