Truncate outputs

This commit is contained in:
Federico Vera 2019-06-05 19:44:12 -03:00
parent 66996f0c73
commit cbba6e353e
No known key found for this signature in database
GPG Key ID: E69ECE2FCCDE9566
1 changed files with 14 additions and 0 deletions

View File

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