Truncate outputs
This commit is contained in:
parent
66996f0c73
commit
cbba6e353e
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue