Commit d1295d80 authored by odlai's avatar odlai

no message

parent 408b015b
......@@ -8,52 +8,133 @@ use Illuminate\Http\Request;
class AttendanceController extends Controller
{
private $docker_ip="http://192.168.5.150:8086";
private $docker_ip="http://192.168.43.203:8086";
public function atten(Request $request)
{
//一開始顯示所有資料
$query = Path::all();
$main=Car::all();
$client = new \GuzzleHttp\Client();
$res = $client->get($this->docker_ip."/query?db=test&q=select%20*%20from%20people");
$res = $client->get($this->docker_ip."/query?db=test&q=select%20*%20from%20people2");
$response = json_decode($res->getBody()->__toString(), true);
$people_count=count($response['results'][0]['series'][0]['values']);
$result_content=array();
// dd($response[0]['Ports']);
for($i=0;$i<$people_count;$i++){
$dbname=$response['results'][0]['series'][0]['name'];
$time=$response['results'][0]['series'][0]['values'][$i][6];
$time=date('Y-m-d H:i:s',$time);
$come_back=$response['results'][0]['series'][0]['values'][$i][1];
$go_out=$response['results'][0]['series'][0]['values'][$i][2];
$name=$response['results'][0]['series'][0]['values'][$i][3];
$off_work=$response['results'][0]['series'][0]['values'][$i][4];
$on_work=$response['results'][0]['series'][0]['values'][$i][5];
// $array = Arr::add('Id',$response[$i]['Id']);
array_push($result_content,['Names'=>$dbname,'come_back'=>$come_back,'go_out'=>$go_out,
array_push($result_content,['Names'=>$dbname,'time'=>$time,'come_back'=>$come_back,'go_out'=>$go_out,
'name'=>$name,'off_work'=>$off_work,
'on_work'=>$on_work]);
}
return View('index',['page' => 'attendance','result'=>$query,'iresult'=>$main,'content'=>$result_content,'navbar_li'=>'layouts.navbar_li','title'=>'tt']);
}
public function attend(Request $request)
{
$start=$request->input('start_time');
$end=$request->input('end_time');
$start=strtotime("$start,now");
$end=strtotime("$end,now");
return $start.$end;
public function attend(Request $request)
{
//時間戳記轉換及接收姓名欄位
$start=$request->input('start_time');
$end=$request->input('end_time');
$people=$request->input('people');
$start=strtotime($start);
$end=strtotime($end."now");
//搜尋姓名及開始結束時間,有資料
$query = Path::all();
$main=Car::all();
$client = new \GuzzleHttp\Client();
$res = $client->get($this->docker_ip."/query?db=test&q=select%20*%20from%20people2%20WHERE \"name\" ='$people' AND timestamp>=$start AND timestamp<=$end ");
$response = json_decode($res->getBody()->__toString(), true);
if(count($response['results'][0])>1){
$people_count=count($response['results'][0]['series'][0]['values']);
$result_content=array();
for($i=0;$i<$people_count;$i++){
$dbname=$response['results'][0]['series'][0]['name'];
$time=$response['results'][0]['series'][0]['values'][$i][6];
$time=date('Y-m-d H:i:s',$time);
$come_back=$response['results'][0]['series'][0]['values'][$i][1];
$go_out=$response['results'][0]['series'][0]['values'][$i][2];
$name=$response['results'][0]['series'][0]['values'][$i][3];
$off_work=$response['results'][0]['series'][0]['values'][$i][4];
$on_work=$response['results'][0]['series'][0]['values'][$i][5];
// $array = Arr::add('Id',$response[$i]['Id']);
array_push($result_content,['Names'=>$dbname,'time'=>$time,'come_back'=>$come_back,'go_out'=>$go_out,
'name'=>$name,'off_work'=>$off_work,
'on_work'=>$on_work]);
}
return View('index',['page' => 'attendance','result'=>$query,'iresult'=>$main,'content'=>$result_content,'navbar_li'=>'layouts.navbar_li','title'=>'tt']);
}
else {
//查無資料,顯示全部資料列
$query = Path::all();
$main=Car::all();
$client = new \GuzzleHttp\Client();
$res = $client->get($this->docker_ip."/query?db=test&q=select%20*%20from%20people2");
$response = json_decode($res->getBody()->__toString(), true);
echo $time;
$people_count=count($response['results'][0]['series'][0]['values']);
$result_content=array();
// dd($response[0]['Ports']);
for($i=0;$i<$people_count;$i++){
$dbname=$response['results'][0]['series'][0]['name'];
$time=$response['results'][0]['series'][0]['values'][$i][6];
$time=date('Y-m-d H:i:s',$time);
$come_back=$response['results'][0]['series'][0]['values'][$i][1];
$go_out=$response['results'][0]['series'][0]['values'][$i][2];
$name=$response['results'][0]['series'][0]['values'][$i][3];
$off_work=$response['results'][0]['series'][0]['values'][$i][4];
$on_work=$response['results'][0]['series'][0]['values'][$i][5];
// $array = Arr::add('Id',$response[$i]['Id']);
array_push($result_content,['Names'=>$dbname,'time'=>$time,'come_back'=>$come_back,'go_out'=>$go_out,
'name'=>$name,'off_work'=>$off_work,
'on_work'=>$on_work]);
}
echo "<script>alert('查無此資料');</script>";
return View('index',['page' => 'attendance','result'=>$query,'iresult'=>$main,'content'=>$result_content,'navbar_li'=>'layouts.navbar_li','title'=>'tt']);
}
// dd($result_content);
}
}
public function user(Request $request)
{
$query = Path::all();
$main=Car::all();
$client = new \GuzzleHttp\Client();
$res = $client->get($this->docker_ip."/query?db=test&q=select%20*%20from%20people2%20 ");
$response = json_decode($res->getBody()->__toString(), true);
$people_count=count($response['results'][0]['series'][0]['values']);
$result_content=array();
for($i=0;$i<$people_count;$i++){
$name=$response['results'][0]['series'][0]['values'][$i][3];
array_push($result_content,['name'=>$name]);
return View('index',['page' => 'attendance','result'=>$query,'iresult'=>$main,'content'=>$result_content,'navbar_li'=>'layouts.navbar_li','title'=>'tt']);
}
}
}
\ No newline at end of file
......@@ -12,7 +12,7 @@ class DockerController extends Controller
{
//
private $docker_ip="http://192.168.43.203:2375";
private $docker_ip="http://192.168.5.222:2375";
public function init()
{
......@@ -32,7 +32,7 @@ class DockerController extends Controller
}
return View('index',['page' => 'service','result'=>$query,'iresult'=>$main,'contents'=>$result_content,'navbar_li'=>'layouts.navbar_li','title'=>'tt']);
}
public function test(Request $request){
public function ctrl_docker_service(Request $request){
$status=$request->input('btn');
$container_id=$request->input('id');
......@@ -42,12 +42,21 @@ class DockerController extends Controller
}
public function create(Request $request){
$rr=$request->input('origin_stream');
$dd=$request->input('identify_module');
$module_name=$request->input('module_name');
$origin_stream=$request->input('origin_stream');
$identify_module=$request->input('identify_module');
$client = new \GuzzleHttp\Client();
$res = $client->POST($this->docker_ip."/images/create",[
'fromImage'=>'c3b4ada4687bbaa170745b3e4dd8ac3f194ca95b2d0518b417fb47e5879d9b5f'
]);
$res = $client->POST($this->docker_ip."/containers/create?name=$module_name",[
"headers" => ["Content-Type" => "application/json"],
"json" => [
"Image" => $identify_module,
"Env" => array(
'origin_stream='.$origin_stream
)
]
]);
$response = json_decode($res->getBody()->__toString(), true);
return $response;
}
......
......@@ -30,15 +30,15 @@ class InsertController extends Controller {
return redirect()->back();
}
public function update (Request $request){
$id = $request->input('id');
$name = $request->input('name');
$age = $request->input('age');
$sex= $request->input('sex');
$work= $request->input('work');
$phone = $request->input('phone');
$data=array('id'=>$id,'name'=>$name,"age"=>$age,"sex"=>$sex,"work"=>$work,"phone"=>$phone);
People::where('id',$request->input('id'),'name',$request->input('name'),'age',$request->input('age')
,'sex',$_POST['sex'],'work',$_POST['work'],'phone',$request->input('phone'))->update();
$id = $request->input('id1');
$name = $request->input('name1');
$age = $request->input('age1');
$sex= $request->input('sex1');
$work= $request->input('work1');
$phone = $request->input('phone1');
People::where('id',$request->input('id1'))->update(['name' =>$name,'age' => $age,'sex' => $sex,'work' => $work,'phone' => $phone]);
return redirect()->back();
......
......@@ -3,6 +3,7 @@ namespace App\Http\Controllers;
use App\Path;
use App\Car;
use App\People;
use GuzzleHttp\Client;
use Illuminate\Support\Facades\Auth;
class PageController extends Controller
{
......@@ -47,7 +48,16 @@ class PageController extends Controller
$query = Path::all();
$main=Car::all();
return View('index',['page' => 'new','result'=>$query,'iresult'=>$main,'navbar_li'=>'layouts.navbar_li','title'=>'tt']);
$client = new \GuzzleHttp\Client();
$easy_darw="192.168.5.208:10008";
$res = $client->GET($easy_darw."/api/v1/players");
$response = json_decode($res->getBody()->__toString(), true);
$total_stream=$response['rows'];
$res = $client->GET("192.168.5.222:2375"."/images/json");
$response = json_decode($res->getBody()->__toString(), true);
$docker_tag=$response;
return View('index',['page' => 'new','result'=>$query,'iresult'=>$main,'navbar_li'=>'layouts.navbar_li','docker_tag'=>$docker_tag,'total_stream'=>$total_stream,'title'=>'tt']);
}
public function service()
{
......@@ -64,5 +74,12 @@ class PageController extends Controller
$people=People::all();
return View('index',['page' => 'people','result'=>$query,'iresult'=>$main,'people'=>$people,'navbar_li'=>'video_replay.layout.navbar_li','title'=>'tt']);
}
public function test()
{
$query = Path::all();
$main=Car::all();
$people=People::all();
return View('index',['page' => 'test','result'=>$query,'iresult'=>$main,'people'=>$people,'navbar_li'=>'video_replay.layout.navbar_li','title'=>'tt']);
}
}
\ No newline at end of file
......@@ -562,8 +562,8 @@ pre code {
.container {
width: 100%;
/* padding-right: 15px; */
/* padding-left: 15px; */
padding-right: 15px;
padding-left: 15px;
margin-top: 20px;
margin-right: auto;
margin-left: auto;
......@@ -589,7 +589,7 @@ pre code {
@media (min-width: 1200px) {
.container {
max-width: 1200px;
max-width: 1140px;
}
}
......@@ -4851,11 +4851,35 @@ input[type="button"].btn-block {
}
.pagination {
display: -ms-flexbox;
display: inline-block;
display: flex;
padding-left: 0;
list-style: none;
border-radius: 0.25rem;
margin:20px;
}
.pagination>li>a, .pagination>li>span {
position: relative;
float: left;
padding: 6px 12px;
margin-left: -1px;
line-height: 1.42857143;
color: #337ab7;
text-decoration: none;
background-color: #fff;
border: 1px solid #ddd;
}
.pagination>.active>a, .pagination>.active>a:focus, .pagination>.active>a:hover, .pagination>.active>span, .pagination>.active>span:focus, .pagination>.active>span:hover {
z-index: 3;
color: #fff;
cursor: default;
background-color: #337ab7;
border-color: #337ab7;
}
.pagination li:hover{
cursor: pointer;
}
.page-link {
......@@ -6380,7 +6404,7 @@ a.close.disabled {
right: 0;
bottom: 0;
left: 0;
z-index: 2;
z-index: 15;
display: -ms-flexbox;
display: flex;
-ms-flex-pack: center;
......@@ -6424,7 +6448,7 @@ a.close.disabled {
right: 15%;
bottom: 20px;
left: 15%;
z-index: 1;
z-index: 10;
padding-top: 20px;
padding-bottom: 20px;
color: #fff;
......@@ -10051,16 +10075,9 @@ a.text-dark:hover, a.text-dark:focus {
color: inherit;
border-color: #dee2e6;
}
/* Google Material icons */
@import "http://fonts.googleapis.com/icon?family=Material+Icons";
/* Propeller css */
@import "dist/css/propeller.min.css";
/* Bootstrap datetimepicker */
@import "datetimepicker/css/bootstrap-datetimepicker.css";
/* Propeller datetimepicker */
@import "datetimepicker/css/pmd-datetimepicker.css";
.form{
margin: 0 auto;
}
}
/*# sourceMappingURL=bootstrap.css.map */
/*# sourceMappingURL=bootstrap.css.map */
\ No newline at end of file
......@@ -6,6 +6,7 @@
<!-- 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
......@@ -13,14 +14,47 @@
<form id="send" action="/attend" method="GET">
<form id="send" action="/attend" method="POST">
{{ csrf_field() }}
<div class="row" >
<div class="thumbnail" style="text-align:center">
<!-- 姓名 開始結束時間input -->
<div style="margin:0px 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>
</div>
</div>
</div>
<div class="row" style="margin-left: 6%;position:relative">
<div class="col-xs-6 col-md-2">
<span id="arg">開始時間:</span>
<label class="control-label" style="margin: 2% ; margin-left : 50%" >開始時間
</div>
<div class="form-group" style="margin-left: 2%" >
<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">
......@@ -28,14 +62,10 @@
</div>
</div>
</div>
</div>
<div class="row"><div class="col-md-6" style="margin-left: 2%">到</div></div>
<div class="row">
<div class="col-xs-6 col-md-2">
<span id="arg">結束時間:</span>
<span id="arg" style="margin: 2% ; margin-left : 50%">結束時間:</span>
</div>
<div class="form-group" style="margin-left: 2%">
<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">
......@@ -44,13 +74,24 @@
</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 class="row">
<div class="col-md-6"></div><input id='sub_btn' style="margin: 2% ; margin-left : 80%" class="btn-lg btn-success btn" type="submit" value="送出"/>
</div>
<table class="table table-dark table-striped" style="text-align:center">
</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>
......@@ -58,17 +99,19 @@
<td>返回時間</td>
</tr>
@foreach($content as $contents)<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>
</tr>
@endforeach
</tbody>
</table>
......@@ -77,10 +120,10 @@
</form>
<span id='buttom'></span>
</div>
</div>
<span id='buttom'></span>
......@@ -123,5 +166,27 @@
});
</script>
<script>
$(document).ready(function()
{
$('ul.dropdown-menu li').click(function(e)
{
$("#people").val($.trim($(this).text()));
//trime => clear white spaces
});
});
$(document).ready(function(){
$("#myInput").on("keyup", function() {
var value = $(this).val().toLowerCase();
$("#myTable tr").filter(function() {
$(this).toggle($(this).text().toLowerCase().indexOf(value) > -1)
});
});
});
</script>
@endsection
<div class="thumbnail">
<h1>後台管理</h1>
<div class="row justify-content-center">
<form class="col-8" action="service_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>
<div class="col-sm-10">
<input name="module_name" pattern="^[a-zA-Z0-9]{3,}$" class="form-control" type="text" placeholder="請輸入英文或數字共3個字以上" class="input-large" required="">
</div>
</div>
<div class="form-group row">
<label for="inputEmail3" class="col-sm-2 col-form-label">來源串流</label>
<div class="col-sm-10">
<select class="form-control" id="exampleFormControlSelect1" name="origin_stream">
@foreach($total_stream as $stream)
<option>{{$stream['path']}}</option>
@endforeach
</select>
</div>
</div>
<div class="form-group row">
<label for="inputPassword3" class="col-sm-2 col-form-label">辨識模組</label>
<div class="col-sm-10">
<select class="form-control" id="exampleFormControlSelect1" name="identify_module">
@foreach($docker_tag as $tag)
<option>{{$tag['RepoTags'][0]}}</option>
@endforeach
</select>
</div>
</div>
<div class="form-group row">
<label for="inputPassword3" class="col-sm-2 col-form-label">辨識範圍</label>
<div class="col-sm-10">
<div class="custom-file">
<input type="file" class="custom-file-input" id="validatedCustomFile" name="identify_area" >
<label class="custom-file-label" for="validatedCustomFile">Choose file...</label>
<div class="invalid-feedback">Example invalid custom file feedback</div>
</div>
</div>
</div>
<div class="form-group row">
<label for="inputPassword3" class="col-sm-2 col-form-label">是否輸出</label>
<div class="col-sm-10">
<div class="form-check form-check-inline">
<div class="custom-control custom-radio custom-control-inline">
<input type="radio" class="custom-control-input" id="customRadio3" name="example">
<label class="custom-control-label" for="customRadio3"></label>
</div>
<div class="form-check form-check-inline">
<div class="custom-control custom-radio custom-control-inline">
<input type="radio" class="custom-control-input" id="customRadio4" name="example">
<label class="custom-control-label" for="customRadio4"></label>
</div>
</div>
</div>
</div>
</div>
<div class="form-group row">
<label for="inputPassword3" class="col-sm-2 col-form-label">辨識模組</label>
<div class="col-sm-10">
<div class="custom-file">
<input type="file" class="custom-file-input" id="validatedCustomFile">
<label class="custom-file-label" for="validatedCustomFile">Choose file...</label>
<div class="invalid-feedback">Example invalid custom file feedback</div>
</div>
</div>
</div>
<div class="form-group row">
<label for="inputPassword3" class="col-sm-2 col-form-label">是否重啟</label>
<div class="col-sm-10">
<div class="form-check form-check-inline">
<div class="custom-control custom-radio custom-control-inline">
<input type="radio" class="custom-control-input" id="customRadio" name="example1" value="customEx">
<label class="custom-control-label" for="customRadio"></label>
</div>
<div class="form-check form-check-inline">
<div class="custom-control custom-radio custom-control-inline">
<input type="radio" class="custom-control-input" id="customRadio1" name="example1" value="customEx">
<label class="custom-control-label" for="customRadio1"></label>
</div>
</div>
</div>
</div>
</div>
<div style="text-align:center">
<button type="submit" class="btn btn-primary">新增</button>
<button type="reset" class="btn btn-primary">取消</button>
</div>
</form>
</div>
</div>
\ No newline at end of file
<div class="thumbnail">
<h1>後台管理</h1>
<div class="row justify-content-center">
<form class="col-8" action="service_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>
<div class="col-sm-10">
<select class="form-control" id="exampleFormControlSelect1" name="origin_stream">
<option>rtsp://192.168.5.208/mm/in</option>
<option>人臉辨識</option>
<option>行為分析</option>
<option>禁區控管</option>
</select>
</div>
</div>
<div class="form-group row">
<label for="inputPassword3" class="col-sm-2 col-form-label">辨識模組</label>
<div class="col-sm-10">
<select class="form-control" id="exampleFormControlSelect1" name="identify_module">
<option>車牌辨識</option>
<option>人臉辨識</option>
<option>行為分析</option>
<option>禁區控管</option>
</select>
</div>
</div>
<div class="form-group row">
<label for="inputPassword3" class="col-sm-2 col-form-label">辨識範圍</label>
<div class="col-sm-10">
<div class="custom-file">
<input type="file" class="custom-file-input" id="validatedCustomFile" name="identify_area" >
<label class="custom-file-label" for="validatedCustomFile">Choose file...</label>
<div class="invalid-feedback">Example invalid custom file feedback</div>
</div>
</div>
</div>
<div class="form-group row">
<label for="inputPassword3" class="col-sm-2 col-form-label">是否輸出</label>
<div class="col-sm-10">
<div class="form-check form-check-inline">
<div class="custom-control custom-radio custom-control-inline">
<input type="radio" class="custom-control-input" id="customRadio3" name="example">
<label class="custom-control-label" for="customRadio3"></label>
</div>
<div class="form-check form-check-inline">
<div class="custom-control custom-radio custom-control-inline">
<input type="radio" class="custom-control-input" id="customRadio4" name="example">
<label class="custom-control-label" for="customRadio4"></label>
</div>
</div>
</div>
</div>
</div>
<div class="form-group row">
<label for="inputPassword3" class="col-sm-2 col-form-label">辨識模組</label>
<div class="col-sm-10">
<div class="custom-file">
<input type="file" class="custom-file-input" id="validatedCustomFile">
<label class="custom-file-label" for="validatedCustomFile">Choose file...</label>
<div class="invalid-feedback">Example invalid custom file feedback</div>
</div>
</div>
</div>
<div class="form-group row">
<label for="inputPassword3" class="col-sm-2 col-form-label">是否重啟</label>
<div class="col-sm-10">
<div class="form-check form-check-inline">
<div class="custom-control custom-radio custom-control-inline">
<input type="radio" class="custom-control-input" id="customRadio" name="example1" value="customEx">
<label class="custom-control-label" for="customRadio"></label>
</div>
<div class="form-check form-check-inline">
<div class="custom-control custom-radio custom-control-inline">
<input type="radio" class="custom-control-input" id="customRadio1" name="example1" value="customEx">
<label class="custom-control-label" for="customRadio1"></label>
</div>
</div>
</div>
</div>
</div>
<div style="text-align:center">
<button type="submit" class="btn btn-primary">新增</button>
<button type="submit" class="btn btn-primary">取消</button>
</div>
</form>
</div>
</div>
\ No newline at end of file
This diff is collapsed.
<h2>Filterable Table for Docker API</h2>
<p>Type something in the input field to search the table for first names, last names or emails:</p>
<input class="form-control" id="myInput" type="text" placeholder="Search..">
<br>
<!-- <form method="post" action="{{route('api')}}"> -->
<table class="table table-bordered" style="color:#fff">
<h2>Filterable Table for Docker API</h2>
<p>Type something in the input field to search the table for first names, last names or emails:</p>
<input class="form-control" id="myInput" type="text" placeholder="Search..">
<br>
<!-- <form method="post" action="{{route('api')}}"> -->
<table class="table table-bordered" style="color:#fff">
<thead>
<tr>
<th>Container</th>
<th>State</th>
<th>Published Ports</th>
<th>Status</th>
<th>Created</th>
<th>P.S</th>
</tr>
<tr>
<th>Container</th>
<th>State</th>
<th>Published Ports</th>
<th>Status</th>
<th>Created</th>
<th>P.S</th>
</tr>
</thead>
<tbody id="myTable">
@foreach($contents as $content)
<tr>
<form method="post" action="{{route('api')}}">
<input type = "hidden" name = "_token" value = "<?php echo csrf_token(); ?>">
<td>{{$content['Names'][0]}}</td>
<td>{{$content['State']}}</td>
@if(empty($content['Ports'][0]['PrivatePort']))
<td></td>
@else
<td>{{$content['Ports'][0]['PrivatePort']}}:{{$content['Ports'][0]['PublicPort']}}</td>
@endif
<td>{{$content['Status']}}</td>
<td>{{date('Y-m-d H:i:s',$content['Created'])}}</td><!--timestamp to date-->
<td>
<input type = "hidden" name = "id" value = "{{$content['Id']}}">
<button type="submit" class="btn btn-Success" name="btn" value="start">啟動</button>
<button type="submit" class="btn btn-Danger" name="btn" value="stop">停止</button>
<button type="submit" class="btn btn-Primary" name="btn" value="restart">重啟</button>
</td>
<form method="post" action="{{route('api')}}">
<input type = "hidden" name = "_token" value = "<?php echo csrf_token(); ?>">
<td>{{$content['Names'][0]}}</td>
<td>{{$content['State']}}</td>
@if(empty($content['Ports'][0]['PrivatePort']))
<td></td>
@else
<td>{{$content['Ports'][0]['PrivatePort']}}:{{$content['Ports'][0]['PublicPort']}}</td>
@endif
<td>{{$content['Status']}}</td>
<td>{{date('Y-m-d H:i:s',$content['Created'])}}</td><!--timestamp to date-->
<td>
<input type = "hidden" name = "id" value = "{{$content['Id']}}">
<button type="submit" class="btn btn-Success" name="btn" value="start">啟動</button>
<button type="submit" class="btn btn-Danger" name="btn" value="stop">停止</button>
<button type="submit" class="btn btn-Primary" name="btn" value="restart">重啟</button>
</td>
</form>
</tr>
@endforeach
</tbody>
</table>
<!-- </form> -->
<ul class="pagination justify-content-center" style="margin:20px 0">
<li class="page-item"><a class="page-link" href="#">Previous</a></li>
<li class="page-item"><a class="page-link" href="#">1</a></li>
<li class="page-item"><a class="page-link" href="#">2</a></li>
<li class="page-item"><a class="page-link" href="#">3</a></li>
<li class="page-item"><a class="page-link" href="#">Next</a></li>
</ul>
<p>Note that we start the search in tbody, to prevent filtering the table headers.</p>
</table>
<!-- </form>-->
<ul class="pagination justify-content-center" style="margin:20px 0">
<li class="page-item"><a class="page-link" href="#">Previous</a></li>
<li class="page-item"><a class="page-link" href="#">1</a></li>
<li class="page-item"><a class="page-link" href="#">2</a></li>
<li class="page-item"><a class="page-link" href="#">3</a></li>
<li class="page-item"><a class="page-link" href="#">Next</a></li>
</ul>
<p>Note that we start the search in tbody, to prevent filtering the table headers.</p>
<script>
//search bar
$(document).ready(function(){
$("#myInput").on("keyup", function() {
var value = $(this).val().toLowerCase();
......
<h2>Filterable Table for Docker API</h2>
<p>Type something in the input field to search the table for first names, last names or emails:</p>
<input class="form-control" id="myInput" type="text" placeholder="Search..">
<br>
<!-- <form method="post" action="{{route('api')}}"> -->
<table class="table table-bordered" style="color:#fff">
<thead>
<tr>
<th>Container</th>
<th>State</th>
<th>Published Ports</th>
</tr>
</thead>
<tbody id="myTable">
<tr>
<td>123</td>
<td>456</td>
<td>
<input type = "hidden" name = "id" value = "1">
<button type="submit" class="btn btn-Success" name="btn" value="start">啟動</button>
<button type="submit" class="btn btn-Danger" name="btn" value="stop">停止</button>
<button type="submit" class="btn btn-Primary" name="btn" value="restart">重啟</button>
</td>
</tr>
<tr>
<td>ddf</td>
<td>fff</td>
<td>
<input type = "hidden" name = "id" value = "1">
<button type="submit" class="btn btn-Success" name="btn" value="start">啟動</button>
<button type="submit" class="btn btn-Danger" name="btn" value="stop">停止</button>
<button type="submit" class="btn btn-Primary" name="btn" value="restart">重啟</button>
</td>
</tr>
<tr>
<td>ccv</td>
<td>ff</td>
<td>
<input type = "hidden" name = "id" value = "1">
<button type="submit" class="btn btn-Success" name="btn" value="start">啟動</button>
<button type="submit" class="btn btn-Danger" name="btn" value="stop">停止</button>
<button type="submit" class="btn btn-Primary" name="btn" value="restart">重啟</button>
</td>
</tr>
</tbody>
</table>
<!-- </form> -->
<ul class="pagination justify-content-center" style="margin:20px 0">
<li class="page-item"><a class="page-link" href="#">Previous</a></li>
<li class="page-item"><a class="page-link" href="#">1</a></li>
<li class="page-item"><a class="page-link" href="#">2</a></li>
<li class="page-item"><a class="page-link" href="#">3</a></li>
<li class="page-item"><a class="page-link" href="#">Next</a></li>
</ul>
<p>Note that we start the search in tbody, to prevent filtering the table headers.</p>
<script>
$(document).ready(function(){
$("#myInput").on("keyup", function() {
var value = $(this).val().toLowerCase();
$("#myTable tr").filter(function() {
$(this).toggle($(this).text().toLowerCase().indexOf(value) > -1)
});
});
});
$(document).ready(function(){
// code to read selected table row cell data (values).
$("#myTable").on('click','.btn',function(){
// get the current row
var currentRow=$(this).closest("tr");
var col1=currentRow.find("td:eq(0)").text(); // get current row 1st TD value
var col2=currentRow.find("td:eq(1)").text(); // get current row 2nd TD
var col3=currentRow.find("td:eq(2)").text(); // get current row 3rd TD
var data=col1+"\n"+col2+"\n"+col3;
alert(data);
});
});
</script>
\ No newline at end of file
......@@ -19,9 +19,11 @@ Route::get('video_replay','PageController@video_replay');
Route::get('new','PageController@new');
Route::get('smart_parking','Parking\IndexController@index');
Route::get('people','PageController@people');
Route::post('attendance','AttendanceController@atten');
Route::get('attendance','AttendanceController@atten');
Route::post('attend','AttendanceController@attend');
Route::post('user','AttendanceController@user');
Route::get('test','PageController@test');
// Route::get('HRM','PageController@HRM');
Route::post('reg','ProcessController@reg')->name('reg'); ;
Route::post('login','ProcessController@login')->name('login');
......@@ -91,9 +93,10 @@ Route::group(['prefix'=>'HRM'],function (){
});
Route::get('service','DockerController@init');
Route::post('api','DockerController@test')->name('api');
Route::post('api','DockerController@ctrl_docker_service')->name('api');
Route::post('service_create','DockerController@create')->name('service_create');
Route::post('insert','InsertController@insert');
Route::post('delete','InsertController@delete')->name('delete');
\ No newline at end of file
Route::post('delete','InsertController@delete')->name('delete');
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