finishing it
This commit is contained in:
325
templates/add.html
Normal file
325
templates/add.html
Normal file
@ -0,0 +1,325 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<!-- Mirrored from demo.ninjateam.org/html/my-admin/light/page-starter.html by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 03 Jan 2018 03:48:56 GMT -->
|
||||
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
|
||||
<meta name="description" content="">
|
||||
<meta name="author" content="">
|
||||
|
||||
<title>Pengenalan Wajah - Halaman Utama</title>
|
||||
|
||||
<!-- Main Styles -->
|
||||
<link rel="stylesheet" href="static/styles/style.min.css">
|
||||
|
||||
<!-- Material Design Icon -->
|
||||
<link rel="stylesheet" href="static/fonts/material-design/css/materialdesignicons.css">
|
||||
|
||||
<!-- mCustomScrollbar -->
|
||||
<link rel="stylesheet" href="static/plugin/mCustomScrollbar/jquery.mCustomScrollbar.min.css">
|
||||
|
||||
<!-- Waves Effect -->
|
||||
<link rel="stylesheet" href="static/plugin/waves/waves.min.css">
|
||||
|
||||
<!-- Sweet Alert -->
|
||||
<link rel="stylesheet" href="static/plugin/sweet-alert/sweetalert.css">
|
||||
<style>
|
||||
table {
|
||||
border: 1px;
|
||||
font-family: arial, sans-serif;
|
||||
border-collapse: collapse;
|
||||
width: 86%;
|
||||
margin: auto;
|
||||
}
|
||||
|
||||
td,
|
||||
th {
|
||||
border: 1px solid black !important;
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
tr:nth-child(even) {
|
||||
background-color: #dddddd;
|
||||
}
|
||||
</style>
|
||||
|
||||
</head>
|
||||
|
||||
<div class="modal fade" id="ini_modalnya" tabindex="-1" role="dialog" aria-labelledby="myModalLabel-1">
|
||||
<div class="modal-dialog modal-lg" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
|
||||
aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title" id="myModalLabel-1">Tambah Pose</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="form-group text-center" id="sini_image">
|
||||
<!-- create iframe -->
|
||||
<!-- <iframe src="http://localhost:5000/images_add" width="480" height="360"></iframe> -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<body>
|
||||
<div class="main-menu">
|
||||
<header class="header">
|
||||
<a href="" class="logo"><i class="ico mdi mdi-account-box"></i>Face Reg</a>
|
||||
<button type="button" class="button-close fa fa-times js__menu_close"></button>
|
||||
<div class="user">
|
||||
<a href="#" class="avatar"><img src="static/images/avatar-sm-5.jpg" alt=""><span
|
||||
class="status online"></span></a>
|
||||
<h5 class="name"><a href="">Pengguna</a></h5>
|
||||
<h5 class="position">User</h5>
|
||||
<!-- /.name -->
|
||||
<!-- /.control-wrap -->
|
||||
</div>
|
||||
<!-- /.user -->
|
||||
</header>
|
||||
<!-- /.header -->
|
||||
<div class="content">
|
||||
|
||||
<div class="navigation">
|
||||
<h5 class="title">Navigation</h5>
|
||||
<!-- /.title -->
|
||||
<ul class="menu js__accordion">
|
||||
<li >
|
||||
<a class="waves-effect ac" href="http://localhost:5000"><i class="menu-icon mdi mdi-account-box"></i><span>Deteksi Pose</span></a>
|
||||
</li>
|
||||
<li class="current">
|
||||
<a class="waves-effect ac" href="{{url_for('add')}}"><i class="menu-icon mdi mdi-account-card-details"></i><span>Penambahan Pose</span></a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
<!-- /.navigation -->
|
||||
</div>
|
||||
<!-- /.content -->
|
||||
</div>
|
||||
<!-- /.main-menu -->
|
||||
|
||||
<div class="fixed-navbar">
|
||||
<div class="pull-left">
|
||||
<button type="button"
|
||||
class="menu-mobile-button glyphicon glyphicon-menu-hamburger js__menu_mobile"></button>
|
||||
<h1 class="page-title">Halaman Pose Tubuh</h1>
|
||||
<!-- /.page-title -->
|
||||
</div>
|
||||
<!-- /.pull-left -->
|
||||
<div class="pull-right">
|
||||
|
||||
</div>
|
||||
<!-- /.pull-right -->
|
||||
</div>
|
||||
<!-- /.fixed-navbar -->
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- /#message-popup -->
|
||||
<div id="wrapper">
|
||||
<div class="main-content">
|
||||
<div class="row small-spacing">
|
||||
<div class="col-xs-2 col-md-2"></div>
|
||||
<div class="col-xs-8 col-md-8">
|
||||
<div class="box-content card">
|
||||
<h4 class="box-title">Form Penambahan Pose Tubuh</h4>
|
||||
<div class="card-content">
|
||||
<div class="form-group">
|
||||
<label for="nama">Nama Pose</label>
|
||||
<input type="text" class="form-control" id="nama" placeholder="Masukkan Nama Pose"
|
||||
name="nama" onkeyup="cekNama(this.value)">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="pose">Keterangan</label>
|
||||
<textarea class="form-control" id="pose" rows="3" placeholder="Masukkan Keterangan Pose"
|
||||
name="pose" style="resize: none;" onkeyup="cekKet(this.value)"></textarea>
|
||||
</div>
|
||||
|
||||
<div class="form-group text-center">
|
||||
<button onclick="tambah_pose()" type="button" class="btn btn-primary btn-xs"
|
||||
id="button_add" disabled>Klik Untuk Tambah Pose</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-2 col-md-2"></div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<div class="row small-spacing">
|
||||
<div class="col-xs-2 col-md-2"></div>
|
||||
<div class="col-xs-8 col-md-8">
|
||||
<div class="box-content card">
|
||||
<h4 class="box-title">Keterangan Hari Ini</h4>
|
||||
<div class="card-content">
|
||||
<div class="form-group">
|
||||
<table style="background-color: white;">
|
||||
<tr>
|
||||
<td><b>No</b></td>
|
||||
<td><b>Pose</b></td>
|
||||
<td><b>Keterangan</b></td>
|
||||
<td><b>Aksi</b></td>
|
||||
|
||||
</tr>
|
||||
{% if l %}
|
||||
|
||||
{% for i in range(l) %}
|
||||
<tr>
|
||||
<td>{{ i+1 }}</td>
|
||||
<td>{{ nama[i] }}</td>
|
||||
<td>{{ ket[i] }}</td>
|
||||
<!-- create a button -->
|
||||
<td>
|
||||
|
||||
<button type="button" class="btn btn-danger btn-xs" onclick="hapus_pose({{ i }})">Hapus</button>
|
||||
|
||||
</tr>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% if not l %}
|
||||
<tr>
|
||||
<td colspan="4" style="text-align: center;">No Data Found</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-2 col-md-2"></div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<footer class="footer">
|
||||
<ul class="list-inline">
|
||||
<li>2022 © Emil.</li>
|
||||
<li><a href="#">Website</a></li>
|
||||
<li><a href="#">Facebook</a></li>
|
||||
<!-- <li><a href="#">Help</a></li> -->
|
||||
</ul>
|
||||
</footer>
|
||||
</div>
|
||||
<!-- /.main-content -->
|
||||
</div><!--/#wrapper -->
|
||||
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
|
||||
<!--[if lt IE 9]>
|
||||
<script src="static/script/html5shiv.min.js"></script>
|
||||
<script src="static/script/respond.min.js"></script>
|
||||
<![endif]-->
|
||||
<!--
|
||||
================================================== -->
|
||||
<!-- Placed at the end of the document so the pages load faster -->
|
||||
<script src="static/scripts/jquery.min.js"></script>
|
||||
<script src="static/scripts/modernizr.min.js"></script>
|
||||
<script src="static/plugin/bootstrap/js/bootstrap.min.js"></script>
|
||||
<script src="static/plugin/mCustomScrollbar/jquery.mCustomScrollbar.concat.min.js"></script>
|
||||
<script src="static/plugin/nprogress/nprogress.js"></script>
|
||||
<script src="static/plugin/sweet-alert/sweetalert.min.js"></script>
|
||||
<script src="static/plugin/waves/waves.min.js"></script>
|
||||
|
||||
<script src="static/scripts/main.min.js"></script>
|
||||
<script>
|
||||
var nama = '';
|
||||
var ket = '';
|
||||
|
||||
cekNama = function (value) {
|
||||
console.log(value);
|
||||
nama = value;
|
||||
if (nama != '' && ket != '') {
|
||||
$('#button_add').removeAttr('disabled');
|
||||
} else {
|
||||
$('#button_add').attr('disabled', 'disabled');
|
||||
}
|
||||
}
|
||||
|
||||
cekKet = function (value) {
|
||||
console.log(value);
|
||||
ket = value;
|
||||
if (nama != '' && ket != '') {
|
||||
$('#button_add').removeAttr('disabled');
|
||||
} else {
|
||||
$('#button_add').attr('disabled', 'disabled');
|
||||
}
|
||||
}
|
||||
|
||||
tambah_pose = function () {
|
||||
|
||||
$.ajax({
|
||||
url: 'http://localhost:5000/add',
|
||||
type: 'POST',
|
||||
data: {
|
||||
nama: nama,
|
||||
ket: ket
|
||||
},
|
||||
success: function (data) {
|
||||
console.log(data);
|
||||
// open modal
|
||||
$('#ini_modalnya').modal('show');
|
||||
// create iframe with width and height 480x360
|
||||
html = '<iframe src="http://localhost:5000/images_add" width="480" height="360"></iframe>';
|
||||
$('#sini_image').html(null);
|
||||
$('#sini_image').html(html);
|
||||
// after 6 seconds, remove the iframe
|
||||
setTimeout(function () {
|
||||
$('#sini_image').html(null);
|
||||
// close modal
|
||||
$('#ini_modalnya').modal('hide');
|
||||
// clear the form
|
||||
$('#nama').val('');
|
||||
$('#pose').val('');
|
||||
// reload the page
|
||||
location.reload();
|
||||
}, 12000);
|
||||
|
||||
|
||||
},
|
||||
// error: function (data) {
|
||||
// console.log(data);
|
||||
// // clear the form
|
||||
// $('#nama').val('');
|
||||
// $('#pose').val('');
|
||||
// }
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function hapus_pose(index){
|
||||
// create a yes no alert
|
||||
if (confirm('Apakah Anda Yakin Ingin Menghapus Data Ini?')) {
|
||||
// if yes, then delete the data
|
||||
$.ajax({
|
||||
url: 'http://localhost:5000/add?index=' + index,
|
||||
type: 'DELETE',
|
||||
data: {
|
||||
index: index
|
||||
},
|
||||
success: function (data) {
|
||||
console.log(data);
|
||||
// reload the page
|
||||
location.reload();
|
||||
},
|
||||
error: function (data) {
|
||||
console.log(data);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
</body>
|
||||
|
||||
<!-- Mirrored from demo.ninjateam.org/html/my-admin/light/page-starter.html by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 03 Jan 2018 03:48:56 GMT -->
|
||||
|
||||
</html>
|
||||
1
templates/images_add.html
Normal file
1
templates/images_add.html
Normal file
@ -0,0 +1 @@
|
||||
<img src="{{ url_for('video_feed_add') }}" style="width:100%; height:100%;"></img>
|
||||
@ -1,10 +1,196 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Pose Detection</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Pose Detection</h1>
|
||||
<img src="{{ url_for('video_feed') }}" width="640" height="480">
|
||||
</body>
|
||||
<html lang="en">
|
||||
|
||||
<!-- Mirrored from demo.ninjateam.org/html/my-admin/light/page-starter.html by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 03 Jan 2018 03:48:56 GMT -->
|
||||
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
|
||||
<meta name="description" content="">
|
||||
<meta name="author" content="">
|
||||
|
||||
<title>Pengenalan Wajah - Halaman Utama</title>
|
||||
|
||||
<!-- Main Styles -->
|
||||
<link rel="stylesheet" href="static/styles/style.min.css">
|
||||
|
||||
<!-- Material Design Icon -->
|
||||
<link rel="stylesheet" href="static/fonts/material-design/css/materialdesignicons.css">
|
||||
|
||||
<!-- mCustomScrollbar -->
|
||||
<link rel="stylesheet" href="static/plugin/mCustomScrollbar/jquery.mCustomScrollbar.min.css">
|
||||
|
||||
<!-- Waves Effect -->
|
||||
<link rel="stylesheet" href="static/plugin/waves/waves.min.css">
|
||||
|
||||
<!-- Sweet Alert -->
|
||||
<link rel="stylesheet" href="static/plugin/sweet-alert/sweetalert.css">
|
||||
<style>
|
||||
table {
|
||||
border: 1px;
|
||||
font-family: arial, sans-serif;
|
||||
border-collapse: collapse;
|
||||
width: 86%;
|
||||
margin: auto;
|
||||
}
|
||||
|
||||
td,
|
||||
th {
|
||||
border: 1px solid black !important;
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
tr:nth-child(even) {
|
||||
background-color: #dddddd;
|
||||
}
|
||||
</style>
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="main-menu">
|
||||
<header class="header">
|
||||
<a href="" class="logo"><i class="ico mdi mdi-account-box"></i>Face Reg</a>
|
||||
<button type="button" class="button-close fa fa-times js__menu_close"></button>
|
||||
<div class="user">
|
||||
<a href="#" class="avatar"><img src="static/images/avatar-sm-5.jpg" alt=""><span
|
||||
class="status online"></span></a>
|
||||
<h5 class="name"><a href="">Pengguna</a></h5>
|
||||
<h5 class="position">User</h5>
|
||||
<!-- /.name -->
|
||||
<!-- /.control-wrap -->
|
||||
</div>
|
||||
<!-- /.user -->
|
||||
</header>
|
||||
<!-- /.header -->
|
||||
<div class="content">
|
||||
|
||||
<div class="navigation">
|
||||
<h5 class="title">Navigation</h5>
|
||||
<!-- /.title -->
|
||||
<ul class="menu js__accordion">
|
||||
<li class="current">
|
||||
<a class="waves-effect ac" href=""><i class="menu-icon mdi mdi-account-box"></i><span>Deteksi Pose</span></a>
|
||||
</li>
|
||||
<li>
|
||||
<a class="waves-effect ac" href="{{url_for('add')}}"><i class="menu-icon mdi mdi-account-card-details"></i><span>Penambahan Pose</span></a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
<!-- /.navigation -->
|
||||
</div>
|
||||
<!-- /.content -->
|
||||
</div>
|
||||
<!-- /.main-menu -->
|
||||
|
||||
<div class="fixed-navbar">
|
||||
<div class="pull-left">
|
||||
<button type="button" class="menu-mobile-button glyphicon glyphicon-menu-hamburger js__menu_mobile"></button>
|
||||
<h1 class="page-title">{{ datetoday2 }} | <span id="clock"></span></h1>
|
||||
<!-- /.page-title -->
|
||||
</div>
|
||||
<!-- /.pull-left -->
|
||||
<div class="pull-right">
|
||||
|
||||
</div>
|
||||
<!-- /.pull-right -->
|
||||
</div>
|
||||
<!-- /.fixed-navbar -->
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- /#message-popup -->
|
||||
<div id="wrapper">
|
||||
<div class="main-content">
|
||||
<div class="row small-spacing">
|
||||
<div class="col-xs-2 col-md-2"></div>
|
||||
<div class="col-xs-8 col-md-8">
|
||||
<div class="box-content card">
|
||||
<h4 class="box-title">Deteksi Pose Tubuh</h4>
|
||||
<div class="card-content">
|
||||
<img src="{{ url_for('video_feed') }}" style="width:100%; height:480px;"></img>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-2 col-md-2"></div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<div class="row small-spacing">
|
||||
<div class="col-xs-2 col-md-2"></div>
|
||||
<div class="col-xs-8 col-md-8">
|
||||
<div class="box-content card">
|
||||
<h4 class="box-title">Keterangan</h4>
|
||||
<p id="keterangan" style="text-align: center; font-size: 20px; font-weight: bold;"></p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-2 col-md-2"></div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<footer class="footer">
|
||||
<ul class="list-inline">
|
||||
<li>2022 © Emil.</li>
|
||||
<li><a href="#">Website</a></li>
|
||||
<li><a href="#">Facebook</a></li>
|
||||
<!-- <li><a href="#">Help</a></li> -->
|
||||
</ul>
|
||||
</footer>
|
||||
</div>
|
||||
<!-- /.main-content -->
|
||||
</div><!--/#wrapper -->
|
||||
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
|
||||
<!--[if lt IE 9]>
|
||||
<script src="static/script/html5shiv.min.js"></script>
|
||||
<script src="static/script/respond.min.js"></script>
|
||||
<![endif]-->
|
||||
<!--
|
||||
================================================== -->
|
||||
<!-- Placed at the end of the document so the pages load faster -->
|
||||
<script src="static/scripts/jquery.min.js"></script>
|
||||
<script src="static/scripts/modernizr.min.js"></script>
|
||||
<script src="static/plugin/bootstrap/js/bootstrap.min.js"></script>
|
||||
<script src="static/plugin/mCustomScrollbar/jquery.mCustomScrollbar.concat.min.js"></script>
|
||||
<script src="static/plugin/nprogress/nprogress.js"></script>
|
||||
<script src="static/plugin/sweet-alert/sweetalert.min.js"></script>
|
||||
<script src="static/plugin/waves/waves.min.js"></script>
|
||||
|
||||
<script src="static/scripts/main.min.js"></script>
|
||||
<script>
|
||||
|
||||
var clockElement = document.getElementById('clock');
|
||||
|
||||
function clock() {
|
||||
clockElement.textContent = new Date().toString().slice(15, 24);
|
||||
}
|
||||
|
||||
setInterval(clock, 1000);
|
||||
|
||||
// check data every 2 seconds
|
||||
setInterval(function () {
|
||||
$.ajax({
|
||||
url: 'http://localhost:5000/cari',
|
||||
type: 'GET',
|
||||
success: function (data) {
|
||||
console.log(data);
|
||||
if(data['ket'] == null){
|
||||
$('#keterangan').html('Tidak ada pose yang terdeteksi');
|
||||
}else{
|
||||
$('#keterangan').html(data['ket']);
|
||||
}
|
||||
}
|
||||
});
|
||||
}, 2000);
|
||||
</script>
|
||||
</body>
|
||||
|
||||
<!-- Mirrored from demo.ninjateam.org/html/my-admin/light/page-starter.html by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 03 Jan 2018 03:48:56 GMT -->
|
||||
|
||||
</html>
|
||||
Reference in New Issue
Block a user