Show configured and effective maximum file size in server info page.

This commit is contained in:
Jan Böhmer 2023-03-03 23:42:02 +01:00
parent 27de5ae387
commit f9fd015ecb
3 changed files with 10 additions and 2 deletions

View file

@ -1 +1 @@
1.0.3
1.0.4-dev

View file

@ -21,6 +21,7 @@
namespace App\Controller;
use App\Services\Attachments\AttachmentPathResolver;
use App\Services\Attachments\AttachmentSubmitHandler;
use App\Services\Attachments\AttachmentURLGenerator;
use App\Services\Attachments\BuiltinAttachmentsFinder;
use App\Services\Misc\GitVersionInfo;
@ -49,7 +50,8 @@ class ToolsController extends AbstractController
/**
* @Route("/server_infos", name="tools_server_infos")
*/
public function systemInfos(GitVersionInfo $versionInfo, DBInfoHelper $DBInfoHelper): Response
public function systemInfos(GitVersionInfo $versionInfo, DBInfoHelper $DBInfoHelper,
AttachmentSubmitHandler $attachmentSubmitHandler): Response
{
$this->denyAccessUnlessGranted('@system.server_infos');
@ -73,6 +75,8 @@ class ToolsController extends AbstractController
'allow_attachments_downloads' => $this->getParameter('partdb.attachments.allow_downloads'),
'detailed_error_pages' => $this->getParameter('partdb.error_pages.show_help'),
'error_page_admin_email' => $this->getParameter('partdb.error_pages.admin_email'),
'configured_max_file_size' => $this->getParameter('partdb.attachments.max_file_size'),
'effective_max_file_size' => $attachmentSubmitHandler->getMaximumAllowedUploadSize(),
//PHP section
'php_version' => PHP_VERSION,

View file

@ -62,5 +62,9 @@
<td>Detailed error pages enabled</td>
<td>{{ helper.boolean_badge(detailed_error_pages) }} (Admin Contact email: {{ error_page_admin_email }})</td>
</tr>
<tr>
<td>Maximum file size for attachments</td>
<td>{{ configured_max_file_size }} (Effective: {{ effective_max_file_size | format_bytes }})</td>
</tr>
</tbody>
</table>