Hikari pool add data

This commit is contained in:
2024-12-26 21:31:09 +06:00
parent 5abfd87c06
commit 3e1723f705
7 changed files with 405 additions and 431 deletions

View File

@ -112,110 +112,188 @@
.centered-text a:hover {
text-decoration: underline;
}
/* Header styles */
.header {
width: 100%;
background-color: var(--back-color2);
color: white;
padding: 10px;
text-align: center;
position: fixed;
top: 0;
left: 0;
z-index: 100;
}
</style>
</head>
<body>
<!-- Форма авторизации -->
<div class="login-container" id="loginForm">
<h2 th:text="${Authorization}">Authorization</h2>
<div>
<div class="form-group">
<label for="login0"><span th:text="${Login}">Login</span> (E-mail):</label>
<input type="text" id="login0" name="login" maxlength="50" placeholder="Введите логин или email">
</div>
<div class="form-group">
<label for="password0">Пароль:</label>
<input type="password" id="password0" name="password" maxlength="33" placeholder="Введите пароль">
</div>
<div class="form-group">
<a href="#" onclick="showRestoreForm();">Восстановление пароля</a>
</div>
<div class="form-group">
<button id="loginBtn" class="button">Войти</button>
</div>
<div class="progress-bar" id="progressBar">
<span>Загрузка...</span>
</div>
</div>
<div class="header">
<span>Username</span>
</div>
<!-- Форма регистрации -->
<div class="login-container" style="display: none;" id="registrationForm">
<h2 th:text="${Registration}">Registration</h2>
<div>
<div class="form-group">
<label for="3_country_id"><span th:text="${Country}">Country</span> *</label>
<input type="text" id="3_country_id" name="country" maxlength="50" placeholder="Country">
</div>
<!-- Блок ниже должен быть по центру вертикали и горизонтали -->
<div>
<div class="form-group">
<label for="3_lastname"><span th:text="${Surname}">Surname</span></label>
<input type="text" id="3_lastname" name="lastname" maxlength="50" placeholder="Surname">
</div>
<div class="form-group">
<label for="3_firstname"><span th:text="${Name}">Name</span> *</label>
<input type="text" id="3_firstname" name="firstname" maxlength="50" placeholder="Name">
</div>
<div class="form-group">
<label for="3_company"><span th:text="${Company}">Company</span></label>
<input type="text" id="3_company" name="company" maxlength="50" placeholder="Company">
</div>
<div class="form-group">
<label for="3_position"><span th:text="${Position}">Position</span></label>
<input type="text" id="3_position" name="position" maxlength="50" placeholder="Position">
</div>
<div class="form-group">
<label for="3_phone"><span th:text="${Phone}">Phone</span></label>
<input type="text" id="3_phone" name="phone" maxlength="50" placeholder="Phone">
</div>
<div class="form-group">
<label for="3_email"><span th:text="${E_mail}">Email</span> *</label>
<input type="text" id="3_email" name="email" maxlength="50" placeholder="E-mail">
</div>
<!-- Checkbox for Privacy Policy -->
<div class="form-group checkbox-group">
<input type="checkbox" id="privacyPolicy" onclick="toggleRegisterButton()">
<label for="privacyPolicy">
Я согласен с <a href="#">политикой конфиденциальности</a>
</label>
</div>
<div class="form-group">
<button id="registerBtn" class="button" th:text="${Registration}" disabled>Registration</button>
</div>
<div class="progress-bar" id="progressBar2">
<span>Загрузка...</span>
<div class="login-container" id="loginForm">
<h2 th:text="${Authorization}">Authorization</h2>
<div>
<div class="form-group">
<label for="1_login"><span th:text="${Login}">Login</span> (E-mail):</label>
<input type="text" id="1_login" name="1_login" maxlength="50" th:placeholder="${Enter_login_or_email}">
</div>
<div class="form-group">
<label for="1_password" th:text="${Password}">Password:</label>
<input type="password" id="1_password" name="password" maxlength="33" th:placeholder="${Enter_password}">
</div>
<div class="form-group">
<button id="loginBtn" class="button" th:text="${Log_in}" onclick="authorizeUser()">Log in</button>
</div>
</div>
</div>
</div>
<!-- Password recovery -->
<div class="login-container" style="display: none;" id="registrationForm">
<h2 th:text="${Password_recovery}">Password_recovery</h2>
<div>
<div class="login-container" style="display: none;" id="registrationForm">
<h2 th:text="${Registration}">Registration</h2>
<div>
<div class="form-group">
<label for="3_country_id"><span th:text="${Country}">Country</span> *</label>
<input type="text" id="3_country_id" name="country" maxlength="50" placeholder="Country">
</div>
<div class="form-group">
<label for="3_lastname"><span th:text="${Surname}">Surname</span></label>
<input type="text" id="3_lastname" name="lastname" maxlength="50" placeholder="Surname">
</div>
<div class="form-group">
<label for="3_firstname"><span th:text="${Name}">Name</span> *</label>
<input type="text" id="3_firstname" name="firstname" maxlength="50" placeholder="Name">
</div>
<div class="form-group">
<label for="3_company"><span th:text="${Company}">Company</span></label>
<input type="text" id="3_company" name="company" maxlength="50" placeholder="Company">
</div>
<div class="form-group">
<label for="3_position"><span th:text="${Position}">Position</span></label>
<input type="text" id="3_position" name="position" maxlength="50" placeholder="Position">
</div>
<div class="form-group">
<label for="3_phone"><span th:text="${Phone}">Phone</span></label>
<input type="text" id="3_phone" name="phone" maxlength="50" placeholder="Phone">
</div>
<div class="form-group">
<label for="3_email"><span th:text="${E_mail}">Email</span> *</label>
<input type="text" id="3_email" name="email" maxlength="50" placeholder="E-mail">
</div>
<div class="form-group checkbox-group">
<input type="checkbox" id="privacyPolicy" onclick="toggleRegisterButton()">
<label for="privacyPolicy">
Я согласен с <a href="#">политикой конфиденциальности</a>
</label>
</div>
<div class="form-group">
<button id="registerBtn" class="button" th:text="${Registration}" disabled onclick="registrationUser()">Registration</button>
</div>
</div>
</div>
</div>
<!-- Ссылки для переключения -->
<div class="centered-text">
<p><a href="#" onclick="showForm(1);" th:text="${Authorization}">Authorization</a></p>
<p><a href="#" onclick="showForm(2);" th:text="${Create_a_new_user}">Create a new user</a></p>
<p><a href="#" onclick="showForm(3);" th:text="${Password_recovery}">Password recovery</a></p>
<p><a href="#" onclick="showForm(4);" th:text="${Change_password}">Change password</a></p>
<p><a href="#" onclick="showForm(5);" th:text="${Get_new_TOTP_key}">Get new TOTP key</a></p>
<div class="login-container" style="display: none;" id="recoveryForm">
<h2 th:text="${Password_recovery}">Password_recovery</h2>
<div>
<div class="form-group">
<label for="3_email"><span th:text="${E_mail}">Email</span> *</label>
<input type="text" id="3_email" name="email" maxlength="50" placeholder="E-mail">
</div>
<div class="form-group">
<button id="nextBtn" class="button" th:text="${Next}">Next</button>
</div>
<div class="progress-bar" id="progressBar2">
<span>Загрузка...</span>
</div>
</div>
</div>
<div class="login-container" style="display: none;" id="changeForm">
<h2 th:text="${Password_recovery}">Password_recovery</h2>
<div>
<div class="form-group">
<label for="3_email"><span th:text="${Login}">Login</span> <span th:text="${E_mail}">Email</span></label>
<input type="text" id="3_email" name="email" maxlength="50" placeholder="E-mail">
</div>
<div class="form-group">
<label for="4_oldPassword"><span th:text="${Old_password}">Old_password</span></label>
<input type="text" id="4_oldPassword" name="old_password" maxlength="50" placeholder="E-mail">
</div>
<div class="form-group">
<label for="4_newPassword"><span th:text="${New_password}">New_password</span></label>
<input type="text" id="4_newPassword" name="new_password" maxlength="50" placeholder="E-mail">
</div>
<div class="form-group">
<label for="4_repeatPassword"><span th:text="${Repeat_password}">New_password</span></label>
<input type="text" id="4_repeatPassword" name="repeat_password" maxlength="50" placeholder="Password">
</div>
<div class="form-group">
<button id="4_btn" class="button" th:text="${Change_password}" onclick="changePassword()">Change_password</button>
</div>
</div>
</div>
<div class="login-container" style="display: none;" id="totpForm">
<h2 th:text="${New_totp_key}">New_totp_key</h2>
<div>
<div class="form-group">
<label for="5_email"><span th:text="${Login}">Login</span> (E-mail)</label>
<input type="text" id="5_email" name="email" maxlength="50" placeholder="E-mail">
</div>
<div class="form-group">
<label for="5_password"><span th:text="${Password}">Password</span></label>
<input type="text" id="5_password" name="password" maxlength="50" placeholder="E-mail">
</div>
<div class="form-group">
<label for="5_oldTotp"><span th:text="${Old_totp}">Old_totp</span></label>
<input type="text" id="5_oldTotp" name="Old_totp" maxlength="50" placeholder="E-mail">
</div>
<div class="form-group">
<label for="5_repeatPassword"><span th:text="${New_totp_code}">New_password</span></label>
<input type="text" id="5_repeatPassword" name="repeat_password" maxlength="50" placeholder="Password">
</div>
<div class="form-group">
<button id="5_btn" class="button" th:text="${New_totp_key}" onclick="newTotp()">New_totp_key</button>
</div>
</div>
</div>
<div class="centered-text">
<p><a href="#" onclick="showForm(1);" th:text="${Authorization}">Authorization</a></p>
<p><a href="#" onclick="showForm(2);" th:text="${Create_a_new_user}">Create a new user</a></p>
<p><a href="#" onclick="showForm(3);" th:text="${Password_recovery}">Password recovery</a></p>
<p><a href="#" onclick="showForm(4);" th:text="${Change_password}">Change password</a></p>
<p><a href="#" onclick="showForm(5);" th:text="${Get_new_TOTP_key}">Get new TOTP key</a></p>
</div>
</div>
<script>
@ -223,9 +301,11 @@
function showForm(num) {
document.getElementById('loginForm').style.display = num === 1 ? 'block' : 'none';
document.getElementById('registrationForm').style.display = num === 2 ? 'block' : 'none';
document.getElementById('recoveryForm').style.display = num === 3 ? 'block' : 'none';
document.getElementById('changeForm').style.display = num === 4 ? 'block' : 'none';
document.getElementById('totpForm').style.display = num === 5 ? 'block' : 'none';
}
// Функция для включения/выключения кнопки регистрации в зависимости от состояния галочки
function toggleRegisterButton() {
const checkbox = document.getElementById('privacyPolicy');
@ -235,9 +315,9 @@
// Функция для обработки авторизации
function authorizeUser() {
const login = document.getElementById('login0').value;
const password = document.getElementById('password0').value;
const obj = { login, password, appid: 'ccalm' };
const login = document.getElementById('1_login').value;
const password = document.getElementById('1_password').value;
const obj = {login, password, appid: 'ccalm'};
postJsonData('/api/authorization/v02/login', obj, (ok, data) => {
if (ok) {
if (data.error_code == 0) {
@ -251,8 +331,60 @@
});
}
function registrationUser() {
const login = document.getElementById('1_login').value;
const password = document.getElementById('1_password').value;
const obj = {login, password, appid: 'ccalm'};
postJsonData('/api/authorization/v02/login', obj, (ok, data) => {
if (ok) {
if (data.error_code == 0) {
window.location.href = "/engine";
} else {
alert2(trt('Alert'), trt(data.error_message));
}
} else {
alert2(trt('Alert'), trt('Error: Unable to authorize.'));
}
});
}
function changePassword() {
const login = document.getElementById('1_login').value;
const password = document.getElementById('1_password').value;
const obj = {login, password, appid: 'ccalm'};
postJsonData('/api/authorization/v02/login', obj, (ok, data) => {
if (ok) {
if (data.error_code == 0) {
window.location.href = "/engine";
} else {
alert2(trt('Alert'), trt(data.error_message));
}
} else {
alert2(trt('Alert'), trt('Error: Unable to authorize.'));
}
});
}
function newTotp() {
const login = document.getElementById('1_login').value;
const password = document.getElementById('1_password').value;
const obj = {login, password, appid: 'ccalm'};
postJsonData('/api/authorization/v02/login', obj, (ok, data) => {
if (ok) {
if (data.error_code == 0) {
window.location.href = "/engine";
} else {
alert2(trt('Alert'), trt(data.error_message));
}
} else {
alert2(trt('Alert'), trt('Error: Unable to authorize.'));
}
});
}
// Изначально показываем форму авторизации
showLoginForm();
//showLoginForm();
</script>
</body>

View File

@ -115,7 +115,7 @@
location.href = location.href.replace(/^http:/, 'https:')
}
var g_lng = /*[[${m_locale}]]*/ '';
var g_lng = [[${m_locale}]];
var g_map=null;
var m_winPP=null;
@ -540,21 +540,21 @@ if(g_lng=="1")
<div style="cursor:pointer; height: 210px; background-color: #ffffff;margin-top:5px;margin-bottom:5px;box-shadow: 0 0 10px rgba(0,0,0,0.5);border-radius: 10px;" onclick="showPopUpNDVI();">
<div style="border-radius: 10px 10px 0px 0px; background-color: #aaa9a9; background-image: url('./resources/images/ndvi400.jpg'); background-repeat: no-repeat; background-position: center; width: 100%; height: 150px;"></div>
<div style="border-radius: 0px 0px 10px 10px; background-color: #ffffff; width: 100%; height: 60px;position:relative;"><div style="position:absolute;top:50%;left:50%;-ms-transform: translate(-50%, -50%);transform: translate(-50%, -50%);width:100%;"><strong>NDVI</strong> <span th="${Normalized_difference_vegetation_index}">Normalized_difference_vegetation_index</span></div></div>
<div style="border-radius: 0px 0px 10px 10px; background-color: #ffffff; width: 100%; height: 60px;position:relative;"><div style="position:absolute;top:50%;left:50%;-ms-transform: translate(-50%, -50%);transform: translate(-50%, -50%);width:100%;"><strong>NDVI</strong> <span th:text="${Normalized_difference_vegetation_index}">Normalized_difference_vegetation_index</span></div></div>
</div>
<div style="cursor:pointer; height: 210px; background-color: #ffffff;margin-top:5px;margin-bottom:5px;box-shadow: 0 0 10px rgba(0,0,0,0.5);border-radius: 10px;" onclick="showPopUpIVI();">
<div style="border-radius: 10px 10px 0px 0px; background-color: #aaa9a9; background-image: url('./resources/images/ivi400.jpg'); background-repeat: no-repeat; background-position: center; width: 100%; height: 150px;"></div>
<div style="border-radius: 0px 0px 10px 10px; background-color: #ffffff; width: 100%; height: 60px;position:relative;"><div style="position:absolute;top:50%;left:50%;-ms-transform: translate(-50%, -50%);transform: translate(-50%, -50%);width:100%;"><strong>IVI</strong> <span th="${Integral_vegetation_index}">Integral_vegetation_index</span></div></div>
<div style="border-radius: 0px 0px 10px 10px; background-color: #ffffff; width: 100%; height: 60px;position:relative;"><div style="position:absolute;top:50%;left:50%;-ms-transform: translate(-50%, -50%);transform: translate(-50%, -50%);width:100%;"><strong>IVI</strong> <span th:text="${Integral_vegetation_index}">Integral_vegetation_index</span></div></div>
</div>
<div style="cursor:pointer; height: 210px; background-color: #ffffff;margin-top:5px;margin-bottom:5px;box-shadow: 0 0 10px rgba(0,0,0,0.5);border-radius: 10px;" onclick="showPopUpNDWI();">
<div style="border-radius: 10px 10px 0px 0px; background-color: #aaa9a9; background-image: url('./resources/images/ndwi400.jpg'); background-repeat: no-repeat; background-position: center; width: 100%; height: 150px;"></div>
<div style="border-radius: 0px 0px 10px 10px; background-color: #ffffff; width: 100%; height: 60px;position:relative;"><div style="position:absolute;top:50%;left:50%;-ms-transform: translate(-50%, -50%);transform: translate(-50%, -50%);width:100%;"><strong>NDWI</strong> <span th="${Normalized_difference_water_index}">Normalized_difference_water_index</span></div></div>
<div style="border-radius: 0px 0px 10px 10px; background-color: #ffffff; width: 100%; height: 60px;position:relative;"><div style="position:absolute;top:50%;left:50%;-ms-transform: translate(-50%, -50%);transform: translate(-50%, -50%);width:100%;"><strong>NDWI</strong> <span th:text="${Normalized_difference_water_index}">Normalized_difference_water_index</span></div></div>
</div>
<div style="cursor:pointer; height: 210px; background-color: #ffffff;margin-top:5px;margin-bottom:5px;box-shadow: 0 0 10px rgba(0,0,0,0.5);border-radius: 10px;" onclick="showPopUpNDSI();">
<div style="border-radius: 10px 10px 0px 0px; background-color: #aaa9a9; background-image: url('./resources/images/ndsi400.jpg'); background-repeat: no-repeat; background-position: center; width: 100%; height: 150px;"></div>
<div style="border-radius: 0px 0px 10px 10px; background-color: #ffffff; width: 100%; height: 60px;position:relative;"><div style="position:absolute;top:50%;left:50%;-ms-transform: translate(-50%, -50%);transform: translate(-50%, -50%);width:100%;"><strong>NDSI</strong> <span th="${Normalised_difference_snow_index}">Normalised_difference_snow_index</span></div></div>
<div style="border-radius: 0px 0px 10px 10px; background-color: #ffffff; width: 100%; height: 60px;position:relative;"><div style="position:absolute;top:50%;left:50%;-ms-transform: translate(-50%, -50%);transform: translate(-50%, -50%);width:100%;"><strong>NDSI</strong> <span th:text="${Normalised_difference_snow_index}">Normalised_difference_snow_index</span></div></div>
</div>
</div>