added all info here
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
[
|
||||
{
|
||||
"username": "1",
|
||||
"password": "d4735e3a265e16eee03f59718b9b5d03019c07d8b6c51f90da3a666eec13ab35"
|
||||
},
|
||||
{
|
||||
"username": "1",
|
||||
"password": "d4735e3a265e16eee03f59718b9b5d03019c07d8b6c51f90da3a666eec13ab35"
|
||||
},
|
||||
{
|
||||
"username": "1",
|
||||
"password": "4e07408562bedb8b60ce05c1decfe3ad16b72230967de01f640b7e4729b49fce"
|
||||
},
|
||||
{
|
||||
"username": "2",
|
||||
"password": "d4735e3a265e16eee03f59718b9b5d03019c07d8b6c51f90da3a666eec13ab35"
|
||||
},
|
||||
{
|
||||
"username": "skillissue",
|
||||
"password": "a665a45920422f9d417e4867efdc4fb8a04a1f3fff1fa07e998e86f7f7a27ae3"
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,99 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Mashinka Control</title>
|
||||
|
||||
<!-- Font Awesome -->
|
||||
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css" rel="stylesheet">
|
||||
<!-- Google Fonts -->
|
||||
<link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap" rel="stylesheet">
|
||||
<!-- MDB -->
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-9ndCyUaIbzAi2FUVXJi0CjmCapSmO7SnpJef0486qhLnuZ2cdeRhO02iuK6FUUVM" crossorigin="anonymous">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<!-- Navbar -->
|
||||
<nav class="navbar navbar-expand-lg navbar-light bg-light">
|
||||
<div class="container">
|
||||
<a class="navbar-brand" href="#">Seal Team</a>
|
||||
<span class="navbar-text">
|
||||
Управление машинкой
|
||||
</span>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<div class=alertContainer id="alertcontainer"></div>
|
||||
<center><h1>Вы не авторизированы</h1></center>
|
||||
<div class="d-flex justify-content-center mt-5">
|
||||
<button class="btn btn-primary btn-lg mr-3" class="update_form" type="button" onclick="document.location.href = '/login'">Авторизация</button>
|
||||
|
||||
<button class="btn btn-primary btn-lg ml-3" class="update_form" type="button" onclick="document.location.href = '/register'">Регистрация</button>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<!-- MDB -->
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js" integrity="sha384-geWF76RCwLtnZ8qwWowPQNguL3RmwHVBC9FhGdlKrxdiJJigb/j/68SIy3Te4Bkz" crossorigin="anonymous"></script>
|
||||
<!--Script-->
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
|
||||
|
||||
<script>
|
||||
function callSOSCheckEndpoint() {
|
||||
setInterval(function() {
|
||||
$.ajax({
|
||||
url: '/sos_check',
|
||||
method: 'POST',
|
||||
success: function(data) {
|
||||
if (data) {
|
||||
data = JSON.parse(data);
|
||||
console.log(data);
|
||||
var alertHTML = '<div class="alert alert-success alert-dismissible fade show" role="alert">'
|
||||
var alertMessages = [];
|
||||
|
||||
// Iterate over the returned data
|
||||
data.forEach(function(alertt) {
|
||||
var statname = alertt["stationName"];
|
||||
var sosAlertType = alertt["alertType"];
|
||||
var alertMessage = 'SOS ALERT ON THIS STATIONS: ' + statname + ':' + sosAlertType;
|
||||
alertMessages.push(alertMessage);
|
||||
});
|
||||
alertMessages.forEach(function(alertMessage) {
|
||||
alertHTML += '<div class="alert alert-warning">' + alertMessage + '</div>';
|
||||
});
|
||||
alertHTML += '<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>'
|
||||
var x = document.getElementById("alertcontainer");
|
||||
x.innerHTML = alertHTML;
|
||||
}
|
||||
}
|
||||
});
|
||||
}, 10000);
|
||||
}
|
||||
callSOSCheckEndpoint();
|
||||
</script>
|
||||
|
||||
<script>
|
||||
// this is the id of the submit button
|
||||
$(".update_form").click(function() {
|
||||
var myform = $(this).closest("form"); //parent form
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "approve_test.php",
|
||||
data: myform.serialize(), // serializes the form's elements.
|
||||
success: function(data)
|
||||
{
|
||||
alert(data); // show response from the php script.
|
||||
}
|
||||
});
|
||||
|
||||
return false; // avoid to execute the actual submit of the form.
|
||||
});
|
||||
</script>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -0,0 +1,62 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Mashinka Control</title>
|
||||
|
||||
<!-- Font Awesome -->
|
||||
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css" rel="stylesheet">
|
||||
<!-- Google Fonts -->
|
||||
<link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap" rel="stylesheet">
|
||||
<!-- MDB -->
|
||||
<link href="https://cdnjs.cloudflare.com/ajax/libs/mdb-ui-kit/7.1.0/mdb.min.css" rel="stylesheet">
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<!-- Navbar -->
|
||||
<nav class="navbar navbar-expand-lg navbar-light bg-light">
|
||||
<div class="container">
|
||||
<a class="navbar-brand" href="#">Seal Team: Авторизация</a>
|
||||
<span class="navbar-buttons">
|
||||
<div class="d-flex align-items-center">
|
||||
<button data-mdb-ripple-init type="button" class="btn btn-primary me-3">
|
||||
Авторизация
|
||||
</button>
|
||||
</div>
|
||||
</span>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<div class="d-flex justify-content-center mt-5">
|
||||
<form class="mr-3" action="login" method="post">
|
||||
<div class="form-outline" data-mdb-input-init>
|
||||
<input required id="login" name="login" type="text" id="formControlLg" class="form-control form-control-lg" />
|
||||
<label class="form-label" for="formControlLg">Имя пользователя</label>
|
||||
</div>
|
||||
<p></p>
|
||||
<div class="form-outline" data-mdb-input-init>
|
||||
<input required id="password" name="password" type="password" id="formControlLg" class="form-control form-control-lg" />
|
||||
<label class="form-label" for="formControlLg">Пароль</label>
|
||||
</div>
|
||||
<p></p>
|
||||
<button type="submit" class="btn btn-primary btn-lg ml-3">Авторизация</button>
|
||||
</form>
|
||||
{% if err != '' %}
|
||||
<p><h3>{{err}}</h3></p>
|
||||
{% endif%}
|
||||
</div>
|
||||
|
||||
<!-- MDB -->
|
||||
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mdb-ui-kit/7.1.0/mdb.umd.min.js"></script>
|
||||
<!--Script-->
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<link rel ="stylesheet" href="style.css">
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>Mashinka controls</title>
|
||||
<!-- Font Awesome -->
|
||||
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css" rel="stylesheet" />
|
||||
<!-- Google Fonts -->
|
||||
<link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap" rel="stylesheet" />
|
||||
<!-- MDB -->
|
||||
<link href="https://cdnjs.cloudflare.com/ajax/libs/mdb-ui-kit/3.11.0/mdb.min.css" rel="stylesheet" />
|
||||
<meta charset="UTF-8">
|
||||
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Seal Team</title>
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
|
||||
<!-- Navbar -->
|
||||
</head>
|
||||
<body>
|
||||
<nav class="navbar navbar-expand-lg bg-body-tertiary">
|
||||
<div class="container-fluid">
|
||||
<a class="navbar-brand" href="">Seal Team</a>
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarText" aria-controls="navbarText" aria-expanded="false" aria-label="Toggle navigation">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
<span class="navbar-text">
|
||||
Управление машинкой
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
<div class="row justify-content-start">
|
||||
<div class="col-md-8 d-grid gap-2">
|
||||
<form method="post" action="/">
|
||||
<input id="slide" type="range" min="1" max="255" step="1" value="{{cur_speed}}" name="slide">
|
||||
<div id="sliderAmount"></div>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
<div class="d-grid gap-2 col-md-2" >
|
||||
<form action="mashinka_go" method="post">
|
||||
<button type="submit" class="btn btn-dark" data-mdb-ripple-init>Запуск</button>
|
||||
</form>
|
||||
</div>
|
||||
<div class="d-grid gap-2 col-md-2">
|
||||
<form action="mashinka_stop" method="post">
|
||||
<button type="submit" class="btn btn-dark" data-mdb-ripple-init>Стоп</button>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-C6RzsynM9kWDrMNeT87bh95OGNyZPhcTNXj1NW7RuBCsyN/o0jlpcV8Qyq46cDfL" crossorigin="anonymous"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -0,0 +1,187 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Mashinka Control</title>
|
||||
|
||||
<!-- Font Awesome -->
|
||||
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css" rel="stylesheet">
|
||||
<!-- Google Fonts -->
|
||||
<link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap" rel="stylesheet">
|
||||
<!-- MDB -->
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-9ndCyUaIbzAi2FUVXJi0CjmCapSmO7SnpJef0486qhLnuZ2cdeRhO02iuK6FUUVM" crossorigin="anonymous">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<!-- Navbar -->
|
||||
<nav class="navbar navbar-expand-lg navbar-light bg-light">
|
||||
<div class="container">
|
||||
<a class="navbar-brand" href="#">Seal Team</a>
|
||||
<span class="navbar-text">
|
||||
Управление машинкой
|
||||
</span>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<div class=alertContainer id="alertcontainer"></div>
|
||||
<!-- Centered Buttons -->
|
||||
<div class="d-flex justify-content-around mt-5">
|
||||
<button class="btn btn-primary btn-lg mr-3" type="button" onclick="document.getElementById('form1').submit();">Запуск</button>
|
||||
<p class="fw-medium fs-3" id="sliderAmount">{{cur_speed}}</p>
|
||||
<button class="btn btn-primary btn-lg ml-3" type="button" onclick="document.getElementById('form2').submit();">Остановка</button>
|
||||
</div>
|
||||
|
||||
<!-- Slider -->
|
||||
<div class="container mt2-5">
|
||||
<div class="row">
|
||||
<div class="col-md-3"></div>
|
||||
<div class="col-md-6">
|
||||
<form method="POST" action="/">
|
||||
<input type="range" class="form-range" value="{{cur_speed}}" min="1" max="255" step="1" name="slide" id="slide">
|
||||
</form>
|
||||
<canvas id="LastTemp"></canvas/>
|
||||
</div>
|
||||
|
||||
<div class="col-md-3"><canvas id="myChart" style="max-width: 500px;"></canvas></div>
|
||||
</div>
|
||||
|
||||
<!-- Forms -->
|
||||
<form id="form1" action="mashinka_go" method="POST" style="display: none;"></form>
|
||||
<form id="form2" action="mashinka_stop" method="POST" style="display: none;"></form>
|
||||
<!-- MDB -->
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js" integrity="sha384-geWF76RCwLtnZ8qwWowPQNguL3RmwHVBC9FhGdlKrxdiJJigb/j/68SIy3Te4Bkz" crossorigin="anonymous"></script>
|
||||
<!--Script-->
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
|
||||
<script>
|
||||
var slide = document.getElementById('slide'),
|
||||
sliderDiv = document.getElementById("sliderAmount");
|
||||
|
||||
slide.onchange = function() {
|
||||
sliderDiv.innerHTML = this.value;
|
||||
$.post({
|
||||
url: '/',
|
||||
data: $('form').serialize(),
|
||||
success: function(response){
|
||||
console.log(response);
|
||||
},
|
||||
error: function(error){
|
||||
console.log(error);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
</script>
|
||||
<script>
|
||||
(() => {
|
||||
'use strict'
|
||||
|
||||
// Graphs
|
||||
const ctx = document.getElementById('LastTemp')
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const myChart = new Chart(ctx, {
|
||||
type: 'line',
|
||||
data: {
|
||||
labels: [
|
||||
'Sunday',
|
||||
'Monday',
|
||||
'Tuesday',
|
||||
'Wednesday',
|
||||
'Thursday',
|
||||
'Friday',
|
||||
'Saturday'
|
||||
],
|
||||
datasets: [{
|
||||
data: [
|
||||
15339,
|
||||
21345,
|
||||
18483,
|
||||
24003,
|
||||
23489,
|
||||
24092,
|
||||
12034
|
||||
],
|
||||
lineTension: 0,
|
||||
backgroundColor: 'transparent',
|
||||
borderColor: '#007bff',
|
||||
borderWidth: 4,
|
||||
pointBackgroundColor: '#007bff'
|
||||
}]
|
||||
},
|
||||
options: {
|
||||
plugins: {
|
||||
legend: {
|
||||
display: false
|
||||
},
|
||||
tooltip: {
|
||||
boxPadding: 3
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
})()
|
||||
|
||||
</script>
|
||||
<script>
|
||||
function callSOSCheckEndpoint() {
|
||||
setInterval(function() {
|
||||
$.ajax({
|
||||
url: '/sos_check',
|
||||
method: 'POST',
|
||||
success: function(data) {
|
||||
if (data) {
|
||||
data = JSON.parse(data);
|
||||
console.log(data);
|
||||
var alertHTML = '<div class="alert alert-success alert-dismissible fade show" role="alert">'
|
||||
var alertMessages = [];
|
||||
|
||||
// Iterate over the returned data
|
||||
data.forEach(function(alertt) {
|
||||
var statname = alertt["stationName"];
|
||||
var sosAlertType = alertt["alertType"];
|
||||
var alertMessage = 'SOS ALERT ON THIS STATIONS: ' + statname + ':' + sosAlertType;
|
||||
alertMessages.push(alertMessage);
|
||||
});
|
||||
alertMessages.forEach(function(alertMessage) {
|
||||
alertHTML += '<div class="alert alert-warning">' + alertMessage + '</div>';
|
||||
});
|
||||
alertHTML += '<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>'
|
||||
var x = document.getElementById("alertcontainer");
|
||||
x.innerHTML = alertHTML;
|
||||
}
|
||||
}
|
||||
});
|
||||
}, 10000);
|
||||
}
|
||||
callSOSCheckEndpoint();
|
||||
</script>
|
||||
<script>
|
||||
$('form1').submit(function(e){
|
||||
e.preventDefault();
|
||||
$.ajax({
|
||||
url: '/mashinka_go',
|
||||
type: 'post',
|
||||
data:$('#myForm').serialize(),
|
||||
success:function(){
|
||||
// Whatever you want to do after the form is successfully submitted
|
||||
}
|
||||
});
|
||||
});
|
||||
$('form2').submit(function(e){
|
||||
e.preventDefault();
|
||||
$.ajax({
|
||||
url: '/mashinka_stop',
|
||||
type: 'post',
|
||||
data:$('#myForm').serialize(),
|
||||
success:function(){
|
||||
// Whatever you want to do after the form is successfully submitted
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -0,0 +1,57 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Mashinka Control</title>
|
||||
|
||||
<!-- Font Awesome -->
|
||||
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css" rel="stylesheet">
|
||||
<!-- Google Fonts -->
|
||||
<link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap" rel="stylesheet">
|
||||
<!-- MDB -->
|
||||
<link href="https://cdnjs.cloudflare.com/ajax/libs/mdb-ui-kit/7.1.0/mdb.min.css" rel="stylesheet">
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<!-- Navbar -->
|
||||
<nav class="navbar navbar-expand-lg navbar-light bg-light">
|
||||
<div class="container">
|
||||
<a class="navbar-brand" href="#">Seal Team: Регистрация</a>
|
||||
<span class="navbar-buttons">
|
||||
<div class="d-flex align-items-center">
|
||||
<button data-mdb-ripple-init type="button" class="btn btn-primary me-3">
|
||||
Авторизация
|
||||
</button>
|
||||
</div>
|
||||
</span>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<div class="d-flex justify-content-center mt-5">
|
||||
<form class="mr-3" action="register" method="post">
|
||||
<div class="form-outline" data-mdb-input-init>
|
||||
<input required id="login" name="login" type="text" id="formControlLg" class="form-control form-control-lg" />
|
||||
<label class="form-label" for="formControlLg">Имя пользователя</label>
|
||||
</div>
|
||||
<p></p>
|
||||
<div class="form-outline" data-mdb-input-init>
|
||||
<input required id="password" name="password" type="password" id="formControlLg" class="form-control form-control-lg" />
|
||||
<label class="form-label" for="formControlLg">Пароль</label>
|
||||
</div>
|
||||
<p></p>
|
||||
<button type="submit" class="btn btn-primary btn-lg ml-3">Регистрация</button>
|
||||
</form>
|
||||
{% if err != '' %}
|
||||
<p><h3>{{err}}</h3></p>
|
||||
{% endif%}
|
||||
</div>
|
||||
|
||||
<!-- MDB -->
|
||||
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mdb-ui-kit/7.1.0/mdb.umd.min.js"></script>
|
||||
<!--Script-->
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,4 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
no rights
|
||||
</html>
|
||||
Reference in New Issue
Block a user