Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
laravel_IS
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
odlai
laravel_IS
Commits
05c545c1
Commit
05c545c1
authored
Oct 29, 2019
by
odlai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no message
parent
d2a8ed43
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
95 additions
and
105 deletions
+95
-105
DockerController.php
app/Http/Controllers/DockerController.php
+28
-5
attendance.blade.php
resources/views/attendance.blade.php
+57
-98
new.blade.php
resources/views/new.blade.php
+7
-1
web.php
routes/web.php
+3
-1
No files found.
app/Http/Controllers/DockerController.php
View file @
05c545c1
...
...
@@ -4,6 +4,7 @@ namespace App\Http\Controllers;
use
App\Path
;
use
App\Car
;
// use App\Web_add_service;
use
GuzzleHttp\Client
;
use
Illuminate\Support\Arr
;
use
Illuminate\Http\Request
;
...
...
@@ -31,7 +32,16 @@ class DockerController extends Controller
'Created'
=>
$response
[
$i
][
'Created'
]]);
}
// dd($result_content);
return
View
(
'index'
,[
'page'
=>
'service'
,
'result'
=>
$query
,
'iresult'
=>
$main
,
'contents'
=>
$result_content
,
'navbar_li'
=>
'layouts.navbar_li'
,
'title'
=>
'tt'
]);
return
View
(
'index'
,[
'page'
=>
'service'
,
'result'
=>
$query
,
'iresult'
=>
$main
,
'contents'
=>
$result_content
,
'navbar_li'
=>
'layouts.navbar_li'
,
'title'
=>
'new'
]);
}
public
function
admin_service
(
Request
$request
){
$query
=
Path
::
all
();
$main
=
Car
::
all
();
$client
=
new
\GuzzleHttp\Client
();
$res
=
$client
->
get
(
$this
->
docker_ip
.
"/containers/json?all=1"
);
$response
=
json_decode
(
$res
->
getBody
()
->
__toString
(),
true
);
return
View
(
'index'
,[
'page'
=>
'admin_service'
,
'result'
=>
$query
,
'iresult'
=>
$main
,
'contents'
=>
$response
,
'navbar_li'
=>
'layouts.navbar_li'
,
'title'
=>
'admin_service'
]);
}
public
function
ctrl_docker_service
(
Request
$request
){
$status
=
$request
->
input
(
'btn'
);
...
...
@@ -42,9 +52,10 @@ class DockerController extends Controller
return
redirect
()
->
back
();
}
public
function
create
(
Request
$request
){
public
function
c
ontainer_c
reate
(
Request
$request
){
$module_name
=
$request
->
input
(
'module_name'
);
$origin_stream
=
$request
->
input
(
'origin_stream'
);
$dis_stream
=
$request
->
input
(
'dis_stream'
);
$identify_module
=
$request
->
input
(
'identify_module'
);
$client
=
new
\GuzzleHttp\Client
();
...
...
@@ -53,12 +64,24 @@ class DockerController extends Controller
"json"
=>
[
"Image"
=>
$identify_module
,
"Env"
=>
array
(
'origin_stream='
.
$origin_stream
'SOURCE='
.
$origin_stream
,
'DESTINATION='
.
$dis_stream
),
'Labels'
=>
array
(
'level'
=>
'admin'
)
]
]);
$response
=
json_decode
(
$res
->
getBody
()
->
__toString
(),
true
);
return
$response
;
// $response = json_decode($res->getBody()->__toString(), true);
// dd($response);
// $data=array(
// 'service_name'=>$request->input('module_name'),
// 'container_id'=>$response['Id']
// );
// Web_add_service::insert($data);
return
redirect
(
'service'
);
}
}
resources/views/attendance.blade.php
View file @
05c545c1
@
extends
(
'layouts.template'
)
@
section
(
'header'
)
<
script
type
=
"text/javascript"
src
=
"
{
{asset('bower_components/moment/moment.js')}
}
"
></
script
>
<
script
type
=
"text/javascript"
src
=
"
{
{asset('bower_components/moment/locale/zh-tw.js')}
}
"
></
script
>
<
script
src
=
"https://cdnjs.cloudflare.com/ajax/libs/video.js/6.0.0-RC.5/video.js"
></
script
>
<!--
PC
端浏览器不支持播放
hls
文件
(
m3u8
),
需要
videojs
-
contrib
-
hls
来给我们解码
-->
<
script
src
=
"https://cdnjs.cloudflare.com/ajax/libs/videojs-contrib-hls/5.3.3/videojs-contrib-hls.js"
></
script
>
<
script
src
=
"https://cdnjs.cloudflare.com/ajax/libs/videojs-hotkeys/0.2.25/videojs.hotkeys.min.js"
></
script
>
<
script
type
=
"text/javascript"
src
=
"https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.js"
></
script
>
<
link
rel
=
"stylesheet"
href
=
"
{
{asset('css/video_replay.css')}
}
"
>
@
stop
@
section
(
'content'
)
<
form
id
=
"send"
action
=
"/attend"
method
=
"POST"
>
{{
csrf_field
()
}}
<
div
class
="
thumbnail
" style="
text
-
align
:
center
">
<!-- 姓名 開始結束時間input -->
<div style="
margin
:
0
px
auto
;
position
:
relative
">
<div class="
row
" style="
margin
-
left
:
6
%
;
position
:
relative
" >
<form action="
user
" method="
GET
">
<div class="
col
-
xs
-
6
col
-
md
-
2
">
<label class="
control
-
label
" style="
margin
:
2
%
;
margin
-
left
:
50
%
">姓 名
</div>
<div class="
form
-
group
" >
<div class="
input
-
group
date
" data-target-input="
nearest
">
<input style="
text
-
align
:
center
" id="
people
" name="
people
" type="
text
" class="
form
-
control
peoplepicker
-
input
" required="" data-target="
#datetimepicker3">
<
div
class
="
input
-
group
-
append
" class="
dropdown
-
toggle
" data-toggle="
dropdown
">
<div class="
input
-
group
-
text
" id="
btnGetDetails
"><i class="
fa
fa
-
user
fa
-
lg
"></i></div>
<ul id="
target
" class="
dropdown
-
menu
">
@foreach(
$content
as
$contents
)
<li class="
nav
-
item
">
<a class="
nav
-
link
text
-
dark
">
{
{$contents['name']}
}
</a>
</li>
@endforeach
</ul>
<
div
class
="
thumbnail
">
<div class="
row
justify
-
content
-
center
">
<form class="
col
-
6
" id="
send
" action="
/
attend
" method="
POST
">
{{ csrf_field() }}
<!-- 姓名 開始結束時間input -->
<div class="
form
-
group
row
">
<label for="
text
" class="
col
-
sm
-
2
col
-
form
-
label
">姓名</label>
<div class="
col
-
sm
-
10
">
<div class="
input
-
group
date
" data-target-input="
nearest
">
<input type="
text
" class="
form
-
control
" id="
people
" name="
people
" value="">
<div class="
input
-
group
-
append
" class="
dropdown
-
toggle
" data-toggle="
dropdown
">
<div class="
input
-
group
-
text
" id="
btnGetDetails
"><i class="
fa
fa
-
user
fa
-
lg
"></i></div>
<ul id="
target
" class="
dropdown
-
menu
">
@foreach(
$content
as
$contents
)
<li class="
nav
-
item
">
<a class="
nav
-
link
text
-
dark
">
{
{$contents['name']}
}
</a>
</li>
@endforeach
</ul>
</div>
</div>
</div>
</div>
</div>
<div class="
row
" style="
margin
-
left
:
6
%
;
position
:
relative
">
<div class="
col
-
xs
-
6
col
-
md
-
2
">
<label class="
control
-
label
" style="
margin
:
2
%
;
margin
-
left
:
50
%
" >開始時間
</div>
<div class="
form
-
group
" >
<div class="
input
-
group
date
" id="
datetimepicker1
" data-target-input="
nearest
">
<input id='start_time' style="
text
-
align
:
center
" name="
start_time
" type="
text
" class="
form
-
control
datetimepicker
-
input
" data-target="
#datetimepicker1" required/>
<
div
class
="
input
-
group
-
append
" data-target="
#datetimepicker1" data-toggle="datetimepicker">
<
div
class
="
input
-
group
-
text
"><i class="
fa
fa
-
calendar
"></i></div>
<div class="
form
-
group
row
" >
<label for="
text
" class="
col
-
sm
-
2
col
-
form
-
label
">開始時間</label>
<div class="
col
-
sm
-
10
">
<div class="
input
-
group
date
" id="
datetimepicker1
" data-target-input="
nearest
">
<input id="
start_time
" name="
start_time
" type="
text
" class="
form
-
control
datetimepicker
-
input
" data-target="
#datetimepicker1" required="">
<
div
class
="
input
-
group
-
append
" data-target="
#datetimepicker1" data-toggle="datetimepicker">
<
div
class
="
input
-
group
-
text
"><i class="
fa
fa
-
calendar
"></i></div>
</div>
</div>
</div>
</div>
<div class="
col
-
xs
-
6
col
-
md
-
2
">
<span id="
arg
" style="
margin
:
2
%
;
margin
-
left
:
50
%
">結束時間:</span>
</div>
<div class="
form
-
group
" >
<div class="
input
-
group
date
" id="
datetimepicker2
" data-target-input="
nearest
">
<input id='end_time' style="
text
-
align
:
center
" name="
end_time
" type="
text
" class="
form
-
control
datetimepicker
-
input
" data-target="
#datetimepicker2" required/>
<
div
class
="
input
-
group
-
append
" data-target="
#datetimepicker2" data-toggle="datetimepicker">
<
div
class
="
input
-
group
-
text
"><i class="
fa
fa
-
calendar
"></i></div>
<div class="
form
-
group
row
" >
<label for="
text
" class="
col
-
sm
-
2
col
-
form
-
label
">結束時間</label>
<div class="
col
-
sm
-
10
">
<div class="
input
-
group
date
" id="
datetimepicker2
" data-target-input="
nearest
">
<input id="
end_time
" name="
end_time
" type="
text
" class="
form
-
control
datetimepicker
-
input
" data-target="
#datetimepicker2" required="">
<
div
class
="
input
-
group
-
append
" data-target="
#datetimepicker2" data-toggle="datetimepicker">
<
div
class
="
input
-
group
-
text
"><i class="
fa
fa
-
calendar
"></i></div>
</div>
</div>
</div>
</div>
</div>
<div class="
row
" style="
margin
-
left
:
30
%
;
position
:
relative
">
<div class="
col
-
md
-
6
">
<input id='sub_btn' class="
btn
-
lg
btn
-
success
btn
" type="
submit
" value="
送出
"/>
</div>
</div>
<div style="
text
-
align
:
center
">
<input id='sub_btn' class="
btn
-
lg
btn
-
success
btn
" type="
submit
" value="
送出
"/>
</div>
</
div
>
<input class="
form
-
control
" id="
myInput
" type="
text
" placeholder="
Search
..
"
>
<table class="
table
table
-
dark
table
-
striped
" style="
text
-
align
:
center
">
<tr>
</
form
>
</div
>
</div>
<input class="
form
-
control
" id="
myInput
" type="
text
" placeholder="
Search
..
">
<table class="
table
table
-
dark
table
-
striped
" style="
text
-
align
:
center
">
<tr>
<td>時間</td>
<td>姓名</td>
<td>上班時間</td>
<td>下班時間 </td>
<td>外出時間</td>
<td>返回時間</td>
</tr>
<tbody id="
myTable
">
@foreach(
$content
as
$contents
)
<tr >
<td>
{
{$contents['time']}
}
</td>
<td>
{
{$contents['name']}
}
</td>
<td>
{
{$contents['on_work']}
}
</td>
<td>
{
{$contents['off_work']}
}
</td>
<td>
{
{$contents['go_out']}
}
</td>
<td>
{
{$contents['come_back']}
}
</td>
</tr>
<tbody id="
myTable
">
@foreach(
$content
as
$contents
)
<tr >
<td>
{
{$contents['time']}
}
</td>
<td>
{
{$contents['name']}
}
</td>
<td>
{
{$contents['on_work']}
}
</td>
<td>
{
{$contents['off_work']}
}
</td>
<td>
{
{$contents['go_out']}
}
</td>
<td>
{
{$contents['come_back']}
}
</td>
</tr>
@endforeach
</tbody>
</table>
</form>
</tbody>
</table>
<span id='buttom'></span>
</div>
</div>
...
...
resources/views/new.blade.php
View file @
05c545c1
<div
class=
"thumbnail"
>
<h1>
後台管理
</h1>
<div
class=
"row justify-content-center"
>
<form
class=
"col-8"
action=
"
service_create
"
method=
"post"
>
<form
class=
"col-8"
action=
"
{{route('container_create')}}
"
method=
"post"
>
<input
type =
"hidden"
name =
"_token"
value =
"
<?php
echo
csrf_token
();
?>
"
>
<div
class=
"form-group row"
>
<label
for=
"inputEmail3"
class=
"col-sm-2 col-form-label"
>
模組名稱
</label>
...
...
@@ -19,6 +19,12 @@
</select>
</div>
</div>
<div
class=
"form-group row"
>
<label
for=
"inputEmail3"
class=
"col-sm-2 col-form-label"
>
目的串流
</label>
<div
class=
"col-sm-10"
>
<input
name=
"dis_stream"
class=
"form-control"
type=
"text"
placeholder=
"請輸入英文或數字共3個字以上"
class=
"input-large"
value=
"rsp://192.168.5.208:554/test"
required=
""
>
</div>
</div>
<div
class=
"form-group row"
>
<label
for=
"inputPassword3"
class=
"col-sm-2 col-form-label"
>
辨識模組
</label>
<div
class=
"col-sm-10"
>
...
...
routes/web.php
View file @
05c545c1
...
...
@@ -95,7 +95,9 @@ Route::group(['prefix'=>'HRM'],function (){
Route
::
get
(
'service'
,
'DockerController@init'
);
Route
::
post
(
'api'
,
'DockerController@ctrl_docker_service'
)
->
name
(
'api'
);
Route
::
post
(
'service_create'
,
'DockerController@create'
)
->
name
(
'service_create'
);
Route
::
post
(
'service_create'
,
'DockerController@container_create'
)
->
name
(
'container_create'
);
Route
::
get
(
'admin_service'
,
'DockerController@admin_service'
);
Route
::
post
(
'insert'
,
'InsertController@insert'
);
...
...
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