mirror of
https://github.com/pelican-dev/panel.git
synced 2025-05-20 01:44:45 +02:00
Fix File Upload
(#952)
* Log correct file name * Remove duplicated throws comment * Set maxSize * Add hints * Fix unit conversion * Add translations
This commit is contained in:
parent
09375df8a7
commit
b355830db4
@ -224,6 +224,9 @@ class CreateNode extends CreateRecord
|
||||
->columnSpan(2),
|
||||
TextInput::make('upload_size')
|
||||
->label(trans('admin/node.upload_limit'))
|
||||
->helperText(trans('admin/node.upload_limit_help.0'))
|
||||
->hintIcon('tabler-question-mark')
|
||||
->hintIconTooltip(trans('admin/node.upload_limit_help.1'))
|
||||
->columnSpan(1)
|
||||
->numeric()->required()
|
||||
->default(256)
|
||||
|
@ -271,6 +271,8 @@ class EditNode extends EditRecord
|
||||
'lg' => 1,
|
||||
])
|
||||
->label(trans('admin/node.upload_limit'))
|
||||
->hintIcon('tabler-question-mark')
|
||||
->hintIconTooltip(trans('admin/node.upload_limit_help.0') . trans('admin/node.upload_limit_help.1'))
|
||||
->numeric()->required()
|
||||
->minValue(1)
|
||||
->maxValue(1024)
|
||||
|
@ -474,7 +474,7 @@ class ListFiles extends ListRecords
|
||||
|
||||
Activity::event('server:file.uploaded')
|
||||
->property('directory', $this->path)
|
||||
->property('file', $file->getFilename())
|
||||
->property('file', $file->getClientOriginalName())
|
||||
->log();
|
||||
}
|
||||
} elseif ($data['url'] !== null) {
|
||||
@ -498,10 +498,10 @@ class ListFiles extends ListRecords
|
||||
->live()
|
||||
->schema([
|
||||
FileUpload::make('files')
|
||||
->label('File(s)')
|
||||
->storeFiles(false)
|
||||
->previewable(false)
|
||||
->preserveFilenames()
|
||||
->maxSize((int) round($server->node->upload_size * (config('panel.use_binary_prefix') ? 1.048576 * 1024 : 1000)))
|
||||
->multiple(),
|
||||
]),
|
||||
Tab::make('Upload From URL')
|
||||
|
@ -14,7 +14,6 @@ class DaemonFileRepository extends DaemonRepository
|
||||
*
|
||||
* @param int|null $notLargerThan the maximum content length in bytes
|
||||
*
|
||||
* @throws ConnectionException
|
||||
* @throws FileSizeTooLargeException
|
||||
* @throws ConnectionException
|
||||
* @throws FileNotFoundException
|
||||
|
@ -52,6 +52,10 @@ return [
|
||||
|
||||
'tags' => 'Tags',
|
||||
'upload_limit' => 'Upload Limit',
|
||||
'upload_limit_help' => [
|
||||
'Enter the maximum size of files that can be uploaded through the web-based file manager.',
|
||||
'Make sure your webserver supports file uploads of this size!',
|
||||
],
|
||||
'sftp_port' => 'SFTP Port',
|
||||
'sftp_alias' => 'SFTP Alias',
|
||||
'sftp_alias_help' => 'Display alias for the SFTP address. Leave empty to use the Node FQDN.',
|
||||
|
Loading…
x
Reference in New Issue
Block a user