wip download
This commit is contained in:
parent
994219f47e
commit
317d46abea
|
@ -284,7 +284,7 @@
|
||||||
<div class="col-md-10">
|
<div class="col-md-10">
|
||||||
<div class="box box-primary">
|
<div class="box box-primary">
|
||||||
<div class="box-header with-border">
|
<div class="box-header with-border">
|
||||||
<a href="{{ route('dcat-log-viewer.download', ['dir' => $dir, 'file' => $fileName]) }}" class="btn btn-primary btn-sm download" style="color: #fff"><i class="fa-download fa"></i> {{ trans('Download') }}</a>
|
<a href="{{ route('dcat-log-viewer.download', ['dir' => $dir, 'file' => $fileName, 'filename' => app('request')->get('filename')]) }}" class="btn btn-primary btn-sm download" style="color: #fff"><i class="fa-download fa"></i> {{ trans('Download') }}</a>
|
||||||
|
|
||||||
{{-- <button class="btn btn-default btn-sm download"><i class="fa-trash-o fa"></i> {{ trans('Delete') }}</button>--}}
|
{{-- <button class="btn btn-default btn-sm download"><i class="fa-trash-o fa"></i> {{ trans('Delete') }}</button>--}}
|
||||||
|
|
||||||
|
|
|
@ -37,7 +37,16 @@ class LogController
|
||||||
|
|
||||||
public function download($file = null)
|
public function download($file = null)
|
||||||
{
|
{
|
||||||
$viewer = new LogViewer($this->getDirectory(), request('dir'), $file);
|
$request = app('request');
|
||||||
|
|
||||||
|
$dir = trim($request->get('dir'));
|
||||||
|
$filename = trim($request->get('filename'));
|
||||||
|
$keyword = trim($request->get('keyword'));
|
||||||
|
|
||||||
|
$viewer = new LogViewer($this->getDirectory(), $dir, $file);
|
||||||
|
|
||||||
|
$viewer->setKeyword($keyword);
|
||||||
|
$viewer->setFilename($filename);
|
||||||
|
|
||||||
return response()->download($viewer->getFilePath());
|
return response()->download($viewer->getFilePath());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user