diff --git a/src/psm/Module/Server/Controller/ServerController.php b/src/psm/Module/Server/Controller/ServerController.php index 974bf201..3a9eed8d 100644 --- a/src/psm/Module/Server/Controller/ServerController.php +++ b/src/psm/Module/Server/Controller/ServerController.php @@ -453,6 +453,20 @@ class ServerController extends AbstractServerController { 'label' => $server_available['label'], ); } + + $tpl_data['last_output_truncated'] = $tpl_data['last_output']; + $tpl_data['last_error_output_truncated'] = $tpl_data['last_error_output']; + + if (strlen($tpl_data['last_output']) > 255) { + $tpl_data['last_output_truncated'] = substr($tpl_data['last_output'], 0, 255) . '...'; + $tpl_data['last_output'] = nl2br($tpl_data['last_output']); + } + + if (strlen($tpl_data['last_error_output']) > 255) { + $tpl_data['last_error_output_truncated'] = nl2br(substr($tpl_data['last_error_output'], 0, 255) . '...'); + $tpl_data['last_error_output'] = nl2br($tpl_data['last_error_output']); + } + return $this->twig->render('module/server/server/view.tpl.html', $tpl_data); }