mirror of
https://github.com/linuxserver/Heimdall.git
synced 2025-10-26 02:33:53 +09:00
Add current background maxsize #1501
This commit is contained in:
@@ -27,6 +27,17 @@ function format_bytes($bytes, bool $is_drive_size = true, string $beforeunit = '
|
||||
}
|
||||
}
|
||||
|
||||
function parse_size($size) {
|
||||
$unit = strtolower(substr($size, -1));
|
||||
$bytes = (int)$size;
|
||||
switch($unit) {
|
||||
case 'g': $bytes *= 1024 * 1024 * 1024; break;
|
||||
case 'm': $bytes *= 1024 * 1024; break;
|
||||
case 'k': $bytes *= 1024; break;
|
||||
}
|
||||
return $bytes;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $title
|
||||
* @param string $separator
|
||||
|
||||
@@ -1,7 +1,18 @@
|
||||
<section class="module-container">
|
||||
@if($enable_auth_admin_controls)
|
||||
|
||||
<header>
|
||||
<div class="section-title">{{ __($setting->label) }}</div>
|
||||
<div class="section-title">
|
||||
{{ __($setting->label) }}
|
||||
@if($setting->type === 'image')
|
||||
@php
|
||||
$max_upload = ini_get('upload_max_filesize');
|
||||
$max_upload_bytes = parse_size($max_upload);
|
||||
@endphp
|
||||
<a class="settinglink" target="_blank" rel="nofollow noreferer" href="https://github.com/linuxserver/Heimdall?tab=readme-ov-file#new-background-image-not-being-set">({{ format_bytes($max_upload_bytes, false) }})</a>
|
||||
@endif
|
||||
|
||||
</div>
|
||||
<div class="module-actions">
|
||||
<button type="submit"class="button"><i class="fa fa-save"></i><span>{{ __('app.buttons.save') }}</span></button>
|
||||
<a href="{{ route('settings.index', []) }}" class="button"><i class="fa fa-ban"></i><span>{{ __('app.buttons.cancel') }}</span></a>
|
||||
|
||||
Reference in New Issue
Block a user