Commit f210bfef authored by gxx's avatar gxx

some change

parent f7dc69e9
...@@ -46,8 +46,8 @@ class FileController extends Controller ...@@ -46,8 +46,8 @@ class FileController extends Controller
{ {
$result = $this->mFile->ossSpace(); $result = $this->mFile->ossSpace();
$gbyte = $result/1073741824; $gbyte = ceil($result/1073741824);
$space = 40-$gbyte; $space = ceil(40-$gbyte);
$finalspace = array(["value"=>$space,"name"=>"剩余空间"],["value"=>$gbyte,"name"=>"已用空间"]); $finalspace = array(["value"=>$space,"name"=>"剩余空间"],["value"=>$gbyte,"name"=>"已用空间"]);
return $finalspace; return $finalspace;
} }
...@@ -58,4 +58,10 @@ class FileController extends Controller ...@@ -58,4 +58,10 @@ class FileController extends Controller
$result = $this->mFile->countFile($group_id); $result = $this->mFile->countFile($group_id);
return $result; return $result;
} }
public function ossStatistics()
{
return view('admin/file/oss');
}
} }
@extends('admin/dashboard')
@section('content')
<!-- Content Header (Page header) -->
<section class="content-header">
<h1>
团队列表
{{--<small>advanced tables</small>--}}
</h1>
<ol class="breadcrumb">
<li><a href="#"><i class="fa fa-dashboard"></i> Home</a></li>
<li><a href="#">Tables</a></li>
<li class="active">Data tables</li>
</ol>
</section>
<!-- Main content -->
<section class="content">
<div class="row">
<div class="col-xs-12">
<div class="box">
<div class="box-header">
{{--<h3 class="box-title">Hover Data Table</h3>--}}
</div>
<!-- /.box-header -->
<div class="box-body">
<form action="#">
<div class="row">
<div class="col-lg-6">
<div class="input-group">
<input type="text" class="form-control" placeholder="文件名称" name="search">
<span class="input-group-btn">
<button class="btn btn-default" > 搜索 </button>
</span>
</div><!-- /input-group -->
</div><!-- /.col-lg-6 -->
</div><!-- /.row -->
</form>
<br>
<table id="example2" class="table table-bordered table-hover">
<thead>
<tr>
<th>ID</th>
<th>文件名</th>
<th>类型</th>
<th>size</th>
<th>状态</th>
<th>操作</th>
</tr>
</thead>
{{--@if($groups == null)--}}
<tbody>
<tr>
<td colspan="8" style="text-align: center;color: red"> 数据暂无 </td>
</tr>
</tbody>
</table>
{{--@else--}}
{{--@foreach($groups as $group)--}}
<tbody>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td>
</td>
</tr>
</tbody>
</table>
{{--{{ $result->appends(['search' => $params])->links() }}--}}
</div>
<!-- /.box-body -->
</div>
<!-- /.box -->
</div>
<!-- /.col -->
</div>
<!-- /.row -->
</section>
@endsection
\ No newline at end of file
@extends('admin/dashboard')
@section('content')
<div>
<div style="float: left">
<div id="main" style="width: 500px;height:400px;"></div>
</div>
</div>
<script src="{{url('js/echarts.js')}}"></script>
<script src="{{url('js/jquery-3.2.1.min.js')}}"> </script>
<script>
// 基于准备好的dom,初始化echarts实例
var myChart = echarts.init(document.getElementById('main'));
// ------------------ ajax ---------------//
groupSpance();
function groupSpance(){
$.ajax({
type:'get',
url:'{{route('file.ossSpace')}}',
data:{ group_id:'120' },
success:function(data){
option['series'][0]['data']=data;
myChart.setOption(option);
},
error:function(data){
console.log('错误');
}
});
}
option = {
title : {
text: 'OSS存储使用情况',
subtext: '单位:GB',
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, 0, 0.5)'
}
}
}
]
};
</script>
@endsection
\ No newline at end of file
...@@ -107,7 +107,7 @@ ...@@ -107,7 +107,7 @@
<div class="inner" style="background-color: #ebccd1"> <div class="inner" style="background-color: #ebccd1">
<h3> 0 </h3> <h3> 0 </h3>
<p>全部日程</p> <p>全部团队</p>
</div> </div>
<div class="icon"> <div class="icon">
<i class="ion ion-person-add"></i> <i class="ion ion-person-add"></i>
...@@ -245,7 +245,7 @@ ...@@ -245,7 +245,7 @@
optiona['legend']['data'] = data[0]; optiona['legend']['data'] = data[0];
optiona['series'][0]['data']= data[1]; optiona['series'][0]['data']= data[1];
console.log(optiona['series']); //console.log(optiona['series']);
myChart.setOption(optiona); myChart.setOption(optiona);
}, },
......
...@@ -88,7 +88,7 @@ ...@@ -88,7 +88,7 @@
</span> </span>
</a> </a>
<ul class="treeview-menu"> <ul class="treeview-menu">
<li><a href="">文件列表</a></li> <li><a href="{{route('file.ossStatistics')}}">OSS 使用统计</a></li>
{{--<li><a href="#">Link in level 2</a></li>--}} {{--<li><a href="#">Link in level 2</a></li>--}}
</ul> </ul>
......
...@@ -118,6 +118,7 @@ Route::get('/',function (){return view('login');})->name('admin.login'); ...@@ -118,6 +118,7 @@ Route::get('/',function (){return view('login');})->name('admin.login');
Route::get('group_space','FileController@groupSpace')->name('file.groupSpace'); Route::get('group_space','FileController@groupSpace')->name('file.groupSpace');
Route::get('oss_space','FileController@ossSpace')->name('file.ossSpace'); Route::get('oss_space','FileController@ossSpace')->name('file.ossSpace');
Route::get('count_file','FileController@countFile')->name('file.countFile'); Route::get('count_file','FileController@countFile')->name('file.countFile');
Route::get('oss_statistics','FileController@ossStatistics')->name('file.ossStatistics');
}); });
......
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