mirror of
https://github.com/pelican-dev/panel.git
synced 2025-05-19 23:24:46 +02:00
Fix file download link (#959)
* fix mount of DownloadFiles * fix path in download url
This commit is contained in:
parent
dde5305b3f
commit
d5b8a4c501
@ -23,14 +23,21 @@ class DownloadFiles extends Page
|
||||
#[Locked]
|
||||
public string $path;
|
||||
|
||||
public function mount(string $path, NodeJWTService $service): void
|
||||
private NodeJWTService $nodeJWTService;
|
||||
|
||||
public function boot(NodeJWTService $nodeJWTService): void
|
||||
{
|
||||
$this->nodeJWTService = $nodeJWTService;
|
||||
}
|
||||
|
||||
public function mount(string $path): void
|
||||
{
|
||||
$this->authorizeAccess();
|
||||
|
||||
/** @var Server $server */
|
||||
$server = Filament::getTenant();
|
||||
|
||||
$token = $service
|
||||
$token = $this->nodeJWTService
|
||||
->setExpiresAt(CarbonImmutable::now()->addMinutes(15))
|
||||
->setUser(auth()->user())
|
||||
->setClaims([
|
||||
|
@ -174,7 +174,7 @@ class ListFiles extends ListRecords
|
||||
->label('Download')
|
||||
->icon('tabler-download')
|
||||
->visible(fn (File $file) => $file->is_file)
|
||||
->url(fn () => DownloadFiles::getUrl(['path' => $this->path]), true),
|
||||
->url(fn (File $file) => DownloadFiles::getUrl(['path' => join_paths($this->path, $file->name)]), true),
|
||||
Action::make('move')
|
||||
->authorize(fn () => auth()->user()->can(Permission::ACTION_FILE_UPDATE, $server))
|
||||
->label('Move')
|
||||
|
Loading…
x
Reference in New Issue
Block a user