Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
workbiu-admin
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gxx
workbiu-admin
Commits
6a7526e0
Commit
6a7526e0
authored
Dec 14, 2017
by
gxx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
用户存储空间
parent
0615e625
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
225 additions
and
60 deletions
+225
-60
FileController.php
app/Http/Controllers/FileController.php
+2
-2
UserController.php
app/Http/Controllers/UserController.php
+1
-1
FileService.php
app/Services/FileService.php
+1
-0
userinformation.blade.php
resources/views/admin/userinformation.blade.php
+216
-54
web.php
routes/web.php
+5
-3
No files found.
app/Http/Controllers/FileController.php
View file @
6a7526e0
...
...
@@ -74,8 +74,8 @@ class FileController extends Controller
public
function
userOssSpace
(
Request
$request
)
{
$
group
_id
=
$request
->
user_id
;
$result
=
$this
->
mFile
->
userOssSpace
(
$
group
_id
);
$
user
_id
=
$request
->
user_id
;
$result
=
$this
->
mFile
->
userOssSpace
(
$
user
_id
);
$mbyte
=
$result
/
1048576
;
$space
=
10
-
$mbyte
;
$finalspace
=
array
([
"value"
=>
$space
,
"name"
=>
"剩余空间"
],[
"value"
=>
$mbyte
,
"name"
=>
"已用空间"
]);
...
...
app/Http/Controllers/UserController.php
View file @
6a7526e0
...
...
@@ -83,7 +83,7 @@ class UserController extends Controller
{
$result
=
$this
->
mUser
->
get
(
$id
);
if
(
$result
){
return
view
(
'admin/userinformation'
,
compact
(
'result'
));
return
view
(
'admin/userinformation'
,
compact
(
'result'
,
'id'
));
}
else
{
return
Message
::
makeError
(
'无次用户'
);
}
...
...
app/Services/FileService.php
View file @
6a7526e0
...
...
@@ -78,6 +78,7 @@ class FileService implements FileServiceContract
public
function
userSpace
(
$user_id
)
{
$files
=
File
::
where
([
"group_id"
=>
"0"
,
"creator_id"
=>
$user_id
])
->
get
();
if
(
$files
->
isEmpty
()){
return
null
;
}
...
...
resources/views/admin/userinformation.blade.php
View file @
6a7526e0
...
...
@@ -145,60 +145,24 @@
</
div
>
<!--
/.
tab
-
pane
-->
<
div
class
=
"tab-pane"
id
=
"settings"
>
<
h3
>
啥都没有
耿星星还没写到这里嘞
!
</
h3
>
{{
--<
form
class
=
"form-horizontal"
>--
}}
{{
--<
div
class
=
"form-group"
>--
}}
{{
--<
label
for
=
"inputName"
class
=
"col-sm-2 control-label"
>
Name
</
label
>--
}}
{{
--<
div
class
=
"col-sm-10"
>--
}}
{{
--<
input
type
=
"email"
class
=
"form-control"
id
=
"inputName"
placeholder
=
"Name"
>--
}}
{{
--</
div
>--
}}
{{
--</
div
>--
}}
{{
--<
div
class
=
"form-group"
>--
}}
{{
--<
label
for
=
"inputEmail"
class
=
"col-sm-2 control-label"
>
Email
</
label
>--
}}
{{
--<
div
class
=
"col-sm-10"
>--
}}
{{
--<
input
type
=
"email"
class
=
"form-control"
id
=
"inputEmail"
placeholder
=
"Email"
>--
}}
{{
--</
div
>--
}}
{{
--</
div
>--
}}
{{
--<
div
class
=
"form-group"
>--
}}
{{
--<
label
for
=
"inputName"
class
=
"col-sm-2 control-label"
>
Name
</
label
>--
}}
{{
--<
div
class
=
"col-sm-10"
>--
}}
{{
--<
input
type
=
"text"
class
=
"form-control"
id
=
"inputName"
placeholder
=
"Name"
>--
}}
{{
--</
div
>--
}}
{{
--</
div
>--
}}
{{
--<
div
class
=
"form-group"
>--
}}
{{
--<
label
for
=
"inputExperience"
class
=
"col-sm-2 control-label"
>
Experience
</
label
>--
}}
{{
--<
div
class
=
"col-sm-10"
>--
}}
{{
--<
textarea
class
=
"form-control"
id
=
"inputExperience"
placeholder
=
"Experience"
></
textarea
>--
}}
{{
--</
div
>--
}}
{{
--</
div
>--
}}
{{
--<
div
class
=
"form-group"
>--
}}
{{
--<
label
for
=
"inputSkills"
class
=
"col-sm-2 control-label"
>
Skills
</
label
>--
}}
{{
--<
div
class
=
"col-sm-10"
>--
}}
{{
--<
input
type
=
"text"
class
=
"form-control"
id
=
"inputSkills"
placeholder
=
"Skills"
>--
}}
{{
--</
div
>--
}}
{{
--</
div
>--
}}
{{
--<
div
class
=
"form-group"
>--
}}
{{
--<
div
class
=
"col-sm-offset-2 col-sm-10"
>--
}}
{{
--<
div
class
=
"checkbox"
>--
}}
{{
--<
label
>--
}}
{{
--<
input
type
=
"checkbox"
>
I
agree
to
the
<
a
href
=
"#"
>
terms
and
conditions
</
a
>--
}}
{{
--</
label
>--
}}
{{
--</
div
>--
}}
{{
--</
div
>--
}}
{{
--</
div
>--
}}
{{
--<
div
class
=
"form-group"
>--
}}
{{
--<
div
class
=
"col-sm-offset-2 col-sm-10"
>--
}}
{{
--<
button
type
=
"submit"
class
=
"btn btn-danger"
>
Submit
</
button
>--
}}
{{
--</
div
>--
}}
{{
--</
div
>--
}}
{{
--</
form
>--
}}
<
div
class
=
"tab-pane"
id
=
"settings"
style
=
"height: 1000px;"
>
<
h3
>
</
h3
>
<
div
style
=
"float: left"
>
<
div
id
=
"main"
style
=
"width: 500px;height:400px;"
></
div
>
<
input
type
=
"hidden"
value
=
"
{
{$id}
}
"
id
=
"id"
>
</
div
>
<
div
style
=
"float: left"
>
<
div
id
=
"type"
style
=
"width: 500px;height:400px;"
></
div
>
</
div
>
<
div
style
=
"float: left"
>
<
div
id
=
"oss"
style
=
"width: 500px;height:400px;"
></
div
>
</
div
>
</
div
>
<!--
/.
tab
-
pane
-->
</
div
>
...
...
@@ -212,4 +176,202 @@
</
section
>
<
script
src
=
"
{
{url('js/echarts.js')}
}
"
></
script
>
<
script
src
=
"
{
{url('js/jquery-3.2.1.min.js')}
}
"
>
</
script
>
<!--
引入
echarts
.
js
-->
<
script
>
// 基于准备好的dom,初始化echarts实例
var
myChart
=
echarts
.
init
(
document
.
getElementById
(
'main'
));
var
myChartType
=
echarts
.
init
(
document
.
getElementById
(
'type'
));
var
myChartOss
=
echarts
.
init
(
document
.
getElementById
(
'oss'
));
// ------------------ ajax ---------------//
userSpance
();
function
userSpance
(){
var
id
=
document
.
getElementById
(
'id'
)
.
value
;
$
.
ajax
({
type
:
'get'
,
url
:
'{{route('
user
.
userSpace
')}}'
,
data
:
{
user_id
:
id
},
success
:
function
(
data
){
option
[
'series'
][
0
][
'data'
]
=
data
;
myChart
.
setOption
(
option
);
},
error
:
function
(
data
){
console
.
log
(
'错误'
);
}
});
}
userFileOSS
();
function
userFileOSS
(){
var
id
=
document
.
getElementById
(
'id'
)
.
value
;
$
.
ajax
({
type
:
'get'
,
url
:
'{{route('
user
.
userSpaceOss
')}}'
,
data
:
{
user_id
:
id
},
success
:
function
(
data
){
if
(
data
==
''
){
alert
(
1
);
}
else
{
optionOss
[
'series'
][
0
][
'data'
]
=
data
;
myChartOss
.
setOption
(
optionOss
);
}
},
error
:
function
(
data
){
console
.
log
(
'错误'
);
}
});
}
userFileType
();
function
userFileType
(){
var
id
=
document
.
getElementById
(
'id'
)
.
value
;
$
.
ajax
({
type
:
'get'
,
url
:
'{{route('
file
.
countFile
')}}'
,
data
:
{
group_id
:
id
},
success
:
function
(
data
){
if
(
data
==
''
){
}
else
{
optionType
[
'series'
][
0
][
'data'
]
=
data
;
myChartType
.
setOption
(
optionType
);
}
},
error
:
function
(
data
){
console
.
log
(
'错误'
);
}
});
}
option
=
{
title
:
{
text
:
'用户存储空间使用情况'
,
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, 0, 0.5)'
}
}
}
]
};
optionType
=
{
title
:
{
text
:
'文件类型占比情况'
,
subtext
:
'单位:百分比'
,
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)'
}
}
}
]
};
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)'
}
}
}
]
};
</
script
>
@
endsection
\ No newline at end of file
routes/web.php
View file @
6a7526e0
...
...
@@ -14,7 +14,6 @@
// 登陆页面
Route
::
get
(
'/'
,
function
(){
return
view
(
'login'
);})
->
name
(
'admin.login'
);
Route
::
group
([
'prefix'
=>
'error'
,
'middleware'
=>
'loginCheck'
],
function
(){
Route
::
get
(
'500'
,
function
(){
return
view
(
'admin/error/500'
);
...
...
@@ -30,7 +29,6 @@ Route::get('/',function (){return view('login');})->name('admin.login');
Route
::
get
(
'login/{email}/{password}'
,
'AdminController@login'
)
->
name
(
'login'
);
Route
::
get
(
'logout'
,
'AdminController@logout'
)
->
name
(
'logout'
);
//admin
Route
::
group
([
'prefix'
=>
'admin'
,
'middleware'
=>
'loginCheck'
,
'middleware'
=>
'admin'
],
function
(){
route
::
get
(
'add_page'
,
'AdminController@addPage'
)
->
name
(
'admin.addPage'
);
...
...
@@ -48,6 +46,11 @@ Route::get('/',function (){return view('login');})->name('admin.login');
Route
::
get
(
'updatePage/{id}'
,
'UserController@updatePage'
)
->
name
(
'user.updatePage'
);
Route
::
post
(
'update'
,
'UserController@update'
)
->
name
(
'user.update'
);
Route
::
get
(
'search'
,
'UserController@simpleSearch'
)
->
name
(
'user.search'
);
Route
::
get
(
'user_space'
,
'FileController@userSpace'
)
->
name
(
'user.userSpace'
);
Route
::
get
(
'user_oss_space'
,
'FileController@userOssSpace'
)
->
name
(
'user.userSpaceOss'
);
});
...
...
@@ -94,7 +97,6 @@ Route::get('/',function (){return view('login');})->name('admin.login');
// 短信
Route
::
get
(
'sms'
,
'SMSController@surplus'
)
->
name
(
'sms'
);
Route
::
get
(
'logs'
,
'\Rap2hpoutre\LaravelLogViewer\LogViewerController@index'
)
->
name
(
'statistics.logs'
);
});
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment