Commit 38a39465 authored by gxx's avatar gxx

添加了日志查看功能

parent 81ec8475
...@@ -56,8 +56,8 @@ class FileController extends Controller ...@@ -56,8 +56,8 @@ class FileController extends Controller
{ {
$group_id = $request->group_id; $group_id = $request->group_id;
$result = $this->mFile->groupOssSpace($group_id); $result = $this->mFile->groupOssSpace($group_id);
$mbyte = $result/1048576; $mbyte = round($result/1048576,2);
$space = 10-$mbyte; $space = round(10-$mbyte,2);
$finalspace = array(["value"=>$space,"name"=>"剩余空间"],["value"=>$mbyte,"name"=>"已用空间"]); $finalspace = array(["value"=>$space,"name"=>"剩余空间"],["value"=>$mbyte,"name"=>"已用空间"]);
return $finalspace; return $finalspace;
} }
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "3938a99a84ae9343efba462423a6a2d5", "content-hash": "e7692e7c489308fd0014889562e28d70",
"packages": [ "packages": [
{ {
"name": "aliyuncs/oss-sdk-php", "name": "aliyuncs/oss-sdk-php",
...@@ -1579,6 +1579,61 @@ ...@@ -1579,6 +1579,61 @@
], ],
"time": "2017-09-22T20:46:04+00:00" "time": "2017-09-22T20:46:04+00:00"
}, },
{
"name": "rap2hpoutre/laravel-log-viewer",
"version": "v0.11.0",
"source": {
"type": "git",
"url": "https://github.com/rap2hpoutre/laravel-log-viewer.git",
"reference": "2a557969a8a23d6b5320f1716748d9577f27f303"
},
"dist": {
"type": "zip",
"url": "https://files.phpcomposer.com/files/rap2hpoutre/laravel-log-viewer/2a557969a8a23d6b5320f1716748d9577f27f303.zip",
"reference": "2a557969a8a23d6b5320f1716748d9577f27f303",
"shasum": ""
},
"require": {
"illuminate/support": "4.2.*|5.*",
"php": ">=5.4.0"
},
"type": "library",
"extra": {
"laravel": {
"providers": [
"Rap2hpoutre\\LaravelLogViewer\\LaravelLogViewerServiceProvider"
]
}
},
"autoload": {
"classmap": [
"src/controllers"
],
"psr-0": {
"Rap2hpoutre\\LaravelLogViewer\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "rap2hpoutre",
"email": "raphaelht@gmail.com"
}
],
"description": "A Laravel log reader",
"keywords": [
"laravel",
"log",
"log-reader",
"log-viewer",
"logging",
"lumen"
],
"time": "2017-11-17T10:21:53+00:00"
},
{ {
"name": "react/promise", "name": "react/promise",
"version": "v2.5.1", "version": "v2.5.1",
......
...@@ -121,7 +121,7 @@ return [ ...@@ -121,7 +121,7 @@ return [
| |
*/ */
'log' => env('APP_LOG', 'single'), 'log' => env('APP_LOG', 'daily'),
'log_level' => env('APP_LOG_LEVEL', 'debug'), 'log_level' => env('APP_LOG_LEVEL', 'debug'),
...@@ -193,6 +193,7 @@ return [ ...@@ -193,6 +193,7 @@ return [
Zizaco\Entrust\EntrustServiceProvider::class, Zizaco\Entrust\EntrustServiceProvider::class,
Orangehill\Iseed\IseedServiceProvider::class, Orangehill\Iseed\IseedServiceProvider::class,
Rap2hpoutre\LaravelLogViewer\LaravelLogViewerServiceProvider::class,
......
<?php
return [
/*
|--------------------------------------------------------------------------
| Default Search Engine
|--------------------------------------------------------------------------
|
| This option controls the default search connection that gets used while
| using Laravel Scout. This connection is used when syncing all models
| to the search service. You should adjust this based on your needs.
|
| Supported: "algolia", "null"
|
*/
'driver' => env('SCOUT_DRIVER', 'algolia'),
/*
|--------------------------------------------------------------------------
| Index Prefix
|--------------------------------------------------------------------------
|
| Here you may specify a prefix that will be applied to all search index
| names used by Scout. This prefix may be useful if you have multiple
| "tenants" or applications sharing the same search infrastructure.
|
*/
'prefix' => env('SCOUT_PREFIX', ''),
/*
|--------------------------------------------------------------------------
| Queue Data Syncing
|--------------------------------------------------------------------------
|
| This option allows you to control if the operations that sync your data
| with your search engines are queued. When this is set to "true" then
| all automatic data syncing will get queued for better performance.
|
*/
'queue' => env('SCOUT_QUEUE', false),
/*
|--------------------------------------------------------------------------
| Chunk Sizes
|--------------------------------------------------------------------------
|
| These options allow you to control the maximum chunk size when you are
| mass importing data into the search engine. This allows you to fine
| tune these chunk sizes based on the capabilites of your machines.
|
*/
'chunk' => [
'searchable' => 500,
'unsearchable' => 500,
],
/*
|--------------------------------------------------------------------------
| Algolia Configuration
|--------------------------------------------------------------------------
|
| Here you may configure your Algolia settings. Algolia is a cloud hosted
| search engine which works great with Scout out of the box. Just plug
| in your application ID and admin API key to get started searching.
|
*/
'algolia' => [
'id' => env('ALGOLIA_APP_ID', ''),
'secret' => env('ALGOLIA_SECRET', ''),
],
];
...@@ -60,7 +60,7 @@ ...@@ -60,7 +60,7 @@
<li><a href="#settings" data-toggle="tab">云存储空间</a></li> <li><a href="#settings" data-toggle="tab">云存储空间</a></li>
<li><a href="{{route('group.invitePage',['group_id' => $groups->id])}}" > 邀请新成员</a></li> <li><a href="{{route('group.invitePage',['group_id' => $groups->id])}}" > 邀请新成员</a></li>
</ul> </ul>
<div class="tab-content" style="height: 740px"> <div class="tab-content" style="height: 1000px">
<div class="active tab-pane" id="activity" style="overflow: hidden"> <div class="active tab-pane" id="activity" style="overflow: hidden">
...@@ -137,7 +137,7 @@ ...@@ -137,7 +137,7 @@
</div> </div>
<!-- /.tab-pane --> <!-- /.tab-pane -->
<div class="tab-pane" id="settings"> <div class="tab-pane" id="settings" >
<div style="float: left"> <div style="float: left">
<div id="main" style="width: 500px;height:400px;"></div> <div id="main" style="width: 500px;height:400px;"></div>
<input type="hidden" value="{{$id}}" id="id"> <input type="hidden" value="{{$id}}" id="id">
...@@ -147,6 +147,10 @@ ...@@ -147,6 +147,10 @@
<div id="type" style="width: 500px;height:400px;"></div> <div id="type" style="width: 500px;height:400px;"></div>
</div> </div>
<div style="float: left">
<div id="oss" style="width: 500px;height:400px;"></div>
</div>
</div> </div>
<!-- /.tab-pane --> <!-- /.tab-pane -->
</div> </div>
...@@ -170,6 +174,7 @@ ...@@ -170,6 +174,7 @@
// 基于准备好的dom,初始化echarts实例 // 基于准备好的dom,初始化echarts实例
var myChart = echarts.init(document.getElementById('main')); var myChart = echarts.init(document.getElementById('main'));
var myChartType = echarts.init(document.getElementById('type')); var myChartType = echarts.init(document.getElementById('type'));
var myChartOss = echarts.init(document.getElementById('oss'));
// ------------------ ajax ---------------// // ------------------ ajax ---------------//
...@@ -195,6 +200,29 @@ ...@@ -195,6 +200,29 @@
} }
fileOSS();
function fileOSS(){
var id = document.getElementById('id').value;
$.ajax({
type:'get',
url:'{{route('file.groupOssSpace')}}',
data:{ group_id:id },
success:function(data){
if (data == ''){
alert(1);
}else {
optionOss['series'][0]['data']=data;
myChartOss.setOption(optionOss);
}
},
error:function(data){
console.log('错误');
}
});
}
fileType(); fileType();
function fileType(){ function fileType(){
var id = document.getElementById('id').value; var id = document.getElementById('id').value;
...@@ -203,7 +231,6 @@ ...@@ -203,7 +231,6 @@
url:'{{route('file.countFile')}}', url:'{{route('file.countFile')}}',
data:{ group_id:id }, data:{ group_id:id },
success:function(data){ success:function(data){
console.log(data)
if (data == ''){ if (data == ''){
}else { }else {
...@@ -294,7 +321,43 @@ ...@@ -294,7 +321,43 @@
] ]
}; };
//myChart.setOption(option);
optionOss = {
title : {
text: '实际使用OSS情况',
subtext: '单位:MB',
x:'center'
},
tooltip : {
trigger: 'item',
formatter: "{a} <br/>{b} : {c} ({d}%)"
},
legend: {
orient: 'vertical',
left: 'left',
data: ['全部空间','已经使用']
},
series : [
{
name: '文件类型',
type: 'pie',
radius : '55%',
center: ['50%', '60%'],
data:[
// {value:335, name:'全部空间'},
// {value:310, name:'已经使用'}
],
itemStyle: {
emphasis: {
shadowBlur: 10,
shadowOffsetX: 0,
shadowColor: 'rgba(0, 0, 255, 0.5)'
}
}
}
]
};
......
...@@ -107,6 +107,9 @@ ...@@ -107,6 +107,9 @@
<ul class="treeview-menu"> <ul class="treeview-menu">
<li><a href="{{route('sms')}}">短信通知余额</a></li> <li><a href="{{route('sms')}}">短信通知余额</a></li>
</ul> </ul>
<ul class="treeview-menu">
<li><a href="{{route('statistics.logs')}}">查看日志</a></li>
</ul>
</li> </li>
......
...@@ -93,6 +93,8 @@ Route::get('/',function (){return view('login');})->name('admin.login'); ...@@ -93,6 +93,8 @@ Route::get('/',function (){return view('login');})->name('admin.login');
Route::get('/','StatisticsController@newUser')->name('/'); Route::get('/','StatisticsController@newUser')->name('/');
// 短信 // 短信
Route::get('sms','SMSController@surplus')->name('sms'); Route::get('sms','SMSController@surplus')->name('sms');
Route::get('logs','\Rap2hpoutre\LaravelLogViewer\LogViewerController@index')->name('statistics.logs');
}); });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment