Compare commits
6 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
7e74ae6b0f | ||
|
c57f7ff2f9 | ||
|
d2a4f06b6a | ||
|
5c801cdb27 | ||
|
d8006be928 | ||
|
7995091b38 |
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
.idea
|
27
README.md
27
README.md
@ -1,20 +1,3 @@
|
|||||||
<div align="center">
|
|
||||||
|
|
||||||
# Dcat Laravel Log Viewer
|
|
||||||
|
|
||||||
<p>
|
|
||||||
<a href="https://github.com/jqhph/laravel-log-viewer/blob/master/LICENSE"><img src="https://img.shields.io/badge/license-MIT-7389D8.svg?style=flat" ></a>
|
|
||||||
<a href="https://styleci.io/repos/215738797">
|
|
||||||
<img src="https://github.styleci.io/repos/215738797/shield" alt="StyleCI">
|
|
||||||
</a>
|
|
||||||
<a href="https://github.com/jqhph/laravel-log-viewer/releases" ><img src="https://img.shields.io/github/release/jqhph/laravel-log-viewer.svg?color=4099DE" /></a>
|
|
||||||
</p>
|
|
||||||
|
|
||||||
`Dcat Log Viewer`是一个`Laravel`日志查看工具,支持大文件日志的查看和搜索功能,更改自[laravel-admin-extensions/log-viewer](https://github.com/laravel-admin-extensions/log-viewer)。
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
## 功能
|
## 功能
|
||||||
|
|
||||||
@ -36,16 +19,16 @@
|
|||||||
## 安装
|
## 安装
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
composer require dcat/laravel-log-viewer
|
composer require zyimm/laravel-log-viewer
|
||||||
```
|
```
|
||||||
|
|
||||||
发布配置文件,此步骤可省略
|
发布配置文件,此步骤可省略
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
php artisan vendor:publish --tag=dcat-log-viewer
|
php artisan vendor:publish --tag=zyimm-log-viewer
|
||||||
```
|
```
|
||||||
|
|
||||||
然后访问 `http://hostname/dcat-logs` 即可
|
然后访问 `http://hostname/zyimm-logs` 即可
|
||||||
|
|
||||||
配置文件
|
配置文件
|
||||||
|
|
||||||
@ -54,9 +37,9 @@ php artisan vendor:publish --tag=dcat-log-viewer
|
|||||||
return [
|
return [
|
||||||
'route' => [
|
'route' => [
|
||||||
// 路由前缀
|
// 路由前缀
|
||||||
'prefix' => 'dcat-logs',
|
'prefix' => 'zyimm-logs',
|
||||||
// 命名空间
|
// 命名空间
|
||||||
'namespace' => 'Dcat\LogViewer',
|
'namespace' => 'Zyimm\LogViewer',
|
||||||
// 中间件
|
// 中间件
|
||||||
'middleware' => [],
|
'middleware' => [],
|
||||||
],
|
],
|
||||||
|
@ -227,25 +227,25 @@
|
|||||||
|
|
||||||
<div class="col-md-2">
|
<div class="col-md-2">
|
||||||
<div class="logo">
|
<div class="logo">
|
||||||
Dcat Log Viewer
|
Zyimm Log Viewer
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="">
|
<div class="">
|
||||||
<div class="box-header with-border">
|
<div class="box-header with-border">
|
||||||
<h3 class="box-title"><i class="fa fa-folder-open-o"></i>
|
<h3 class="box-title"><i class="fa fa-folder-open-o"></i>
|
||||||
<a href="{{ route('dcat-log-viewer') }}">logs</a>
|
<a href="{{ route('zyimm-log-viewer') }}">logs</a>
|
||||||
@if($dir)
|
@if($dir)
|
||||||
@php($tmp = '')
|
@php($tmp = '')
|
||||||
@foreach(explode('/', $dir) as $v)
|
@foreach(explode('/', $dir) as $v)
|
||||||
@php($tmp .= '/'.$v)
|
@php($tmp .= '/'.$v)
|
||||||
/
|
/
|
||||||
<a href="{{ route('dcat-log-viewer', ['dir' => trim($tmp, '/')])}}">{{ $v }}</a>
|
<a href="{{ route('zyimm-log-viewer', ['dir' => trim($tmp, '/')])}}">{{ $v }}</a>
|
||||||
@endforeach
|
@endforeach
|
||||||
@endif
|
@endif
|
||||||
</h3>
|
</h3>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<form action="{{ route('dcat-log-viewer') }}" style="display: inline-block;width: 220px;padding-left: 15px">
|
<form action="{{ route('zyimm-log-viewer') }}" style="display: inline-block;width: 220px;padding-left: 15px">
|
||||||
<div class="input-group-sm" style="display: inline-block;width: 100%">
|
<div class="input-group-sm" style="display: inline-block;width: 100%">
|
||||||
<input name="filename" class="form-control" value="{{ app('request')->get('filename') }}" type="text" placeholder="Search..." />
|
<input name="filename" class="form-control" value="{{ app('request')->get('filename') }}" type="text" placeholder="Search..." />
|
||||||
</div>
|
</div>
|
||||||
@ -256,7 +256,7 @@
|
|||||||
@if(! app('request')->get('filename'))
|
@if(! app('request')->get('filename'))
|
||||||
@foreach($logDirs as $d)
|
@foreach($logDirs as $d)
|
||||||
<li @if($d === $fileName) class="active" @endif>
|
<li @if($d === $fileName) class="active" @endif>
|
||||||
<a class="dir" href="{{ route('dcat-log-viewer', ['dir' => $d]) }}">
|
<a class="dir" href="{{ route('zyimm-log-viewer', ['dir' => $d]) }}">
|
||||||
<i class="fa fa-folder-o"></i>{{ basename($d) }}
|
<i class="fa fa-folder-o"></i>{{ basename($d) }}
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
@ -283,9 +283,9 @@
|
|||||||
<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, 'filename' => app('request')->get('filename')]) }}" class="btn btn-primary btn-sm download" style="color: #fff"><i class="fa-download fa"></i> {{ trans('Download') }}</a>
|
<a href="{{ route('zyimm-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>--}}
|
||||||
|
|
||||||
<form action="{{ app('request')->fullUrlWithQuery(['keyword' => null,]) }}" style="display: inline-block;width: 180px">
|
<form action="{{ app('request')->fullUrlWithQuery(['keyword' => null,]) }}" style="display: inline-block;width: 180px">
|
||||||
<div class="input-group-sm" style="display: inline-block;width: 100%">
|
<div class="input-group-sm" style="display: inline-block;width: 100%">
|
||||||
@ -296,7 +296,7 @@
|
|||||||
</form>
|
</form>
|
||||||
<div class="float-right">
|
<div class="float-right">
|
||||||
<a class=""><strong>Size:</strong> {{ $size }} <strong>Updated at:</strong>
|
<a class=""><strong>Size:</strong> {{ $size }} <strong>Updated at:</strong>
|
||||||
{{ date('Y-m-d H:i:s', filectime($filePath)) }}</a>
|
{{ date('Y-m-d H:i:s', filectime($filePath)) }}</a>
|
||||||
|
|
||||||
<div class="btn-group">
|
<div class="btn-group">
|
||||||
@if ($prevUrl)
|
@if ($prevUrl)
|
||||||
@ -332,7 +332,7 @@
|
|||||||
@foreach($logs as $index => $log)
|
@foreach($logs as $index => $log)
|
||||||
<tr>
|
<tr>
|
||||||
<td>{{ $index + 1 }}</td>
|
<td>{{ $index + 1 }}</td>
|
||||||
<td><span class="label bg-{{\Dcat\LogViewer\LogViewer::$levelColors[$log['level']]}}">{{ $log['level'] }}</span></td>
|
<td><span class="label bg-{{\Zyimm\LogViewer\LogViewer::$levelColors[$log['level']]}}">{{ $log['level'] }}</span></td>
|
||||||
<td><strong>{{ $log['env'] }}</strong></td>
|
<td><strong>{{ $log['env'] }}</strong></td>
|
||||||
<td style="width:150px;">{{ $log['time'] }}</td>
|
<td style="width:150px;">{{ $log['time'] }}</td>
|
||||||
<td><pre>{{ $log['info'] }}</pre></td>
|
<td><pre>{{ $log['info'] }}</pre></td>
|
||||||
|
@ -236,7 +236,7 @@ class LogViewer
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return route('dcat-log-viewer.file', [
|
return route('zyimm-log-viewer.file', [
|
||||||
'file' => $this->getFile(),
|
'file' => $this->getFile(),
|
||||||
'offset' => $this->pageOffset['end'],
|
'offset' => $this->pageOffset['end'],
|
||||||
'keyword' => $this->keyword,
|
'keyword' => $this->keyword,
|
||||||
@ -260,7 +260,7 @@ class LogViewer
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return route('dcat-log-viewer.file', [
|
return route('zyimm-log-viewer.file', [
|
||||||
'file' => $this->getFile(),
|
'file' => $this->getFile(),
|
||||||
'offset' => -$this->pageOffset['start'],
|
'offset' => -$this->pageOffset['start'],
|
||||||
'keyword' => $this->keyword,
|
'keyword' => $this->keyword,
|
||||||
|
@ -21,7 +21,7 @@ class LogViewerServiceProvider extends ServiceProvider
|
|||||||
{
|
{
|
||||||
app('router')->group([
|
app('router')->group([
|
||||||
'prefix' => config('zyimm-log-viewer.route.prefix', 'zyimm-logs'),
|
'prefix' => config('zyimm-log-viewer.route.prefix', 'zyimm-logs'),
|
||||||
'namespace' => config('zyimm-log-viewer.route.namespace', 'zyimm\LogViewer'),
|
'namespace' => config('zyimm-log-viewer.route.namespace', 'Zyimm\LogViewer'),
|
||||||
'middleware' => config('zyimm-log-viewer.route.middleware'),
|
'middleware' => config('zyimm-log-viewer.route.middleware'),
|
||||||
], function ($router) {
|
], function ($router) {
|
||||||
$router->get('/', ['as' => 'zyimm-log-viewer', 'uses' => 'LogController@index',]);
|
$router->get('/', ['as' => 'zyimm-log-viewer', 'uses' => 'LogController@index',]);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user