Сообщение на главной странице

This commit is contained in:
2025-03-13 19:49:52 +05:00
parent ff82f35c3a
commit f9f0da3d2e
6 changed files with 99 additions and 74 deletions

View File

@ -10,20 +10,20 @@ spring:
application:
name: org.ccalm.main
datasource:
#url: jdbc:postgresql://91.201.214.156:5432/CCALM?ApplicationName=org_ccalm_main&ssl=true&sslmode=require&connectTimeout=10000&socketTimeout=10000
url: jdbc:postgresql://91.201.214.156:5432/CCALM?ApplicationName=org_ccalm_main
url: jdbc:postgresql://91.201.214.156:5432/CCALM?ApplicationName=org_ccalm_main&ssl=true&sslmode=require&connectTimeout=10000&socketTimeout=10000
username: postgres
password: 309A86FF65A78FB428F4E38DFE35F730
driver-class-name: org.postgresql.Driver
hikari:
maximum-pool-size: 10
minimum-idle: 5
max-lifetime: 600000
max-lifetime: 1740000
idle-timeout: 300000
connection-timeout: 30000
connection-test-query: SELECT 1
validation-timeout: 5000
validation-interval: 60000
leak-detection-threshold: 30000
keepalive-time: 60000
redis:
host: 127.0.0.1
port: 6379

View File

@ -57,8 +57,7 @@
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>42.7.4</version>
<scope>runtime</scope>
<version>42.7.5</version>
</dependency>
<dependency>
<groupId>org.json</groupId>

View File

@ -43,7 +43,8 @@ public class SendWarning {
HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.APPLICATION_JSON);
HttpEntity<Map<String, Object>> entity = new HttpEntity<>(request, headers);
String url = "https://geoserver2.ccalm.org/geodatalist/getAirTemperature";
//String url = "https://geoserver2.ccalm.org/geodatalist/getAirTemperature";
String url = "https://geoserver.ccalm.org/geodatalist/getAirTemperature";
try {
ResponseEntity<Map> response = restTemplate.exchange(url, HttpMethod.POST, entity, Map.class);
if (response.getStatusCode() == HttpStatus.OK && response.getBody() != null) {

View File

@ -4,6 +4,9 @@
<link rel="shortcut icon" href="./resources/favicon.ico" />
<title>Automated system of data collection</title>
<meta name="yandex-verification" content="2cb5374be0668fe9" />
<script src="../resources/metadata/dbms/tools.js?v=9"></script>
<script src="../resources/metadata/dbms/window.js?v=10"></script>
<meta name="description" content="According to the implementation of the Road Map program to improve national and regional locust control in the Caucasus and Central Asia (CCA) developed a system of monitoring and analysis designed to control locusts in the CCA using a geographic information system and remote sensing technology">
@ -46,6 +49,15 @@
window.location.href = "ccalm.org";
}
document.addEventListener('DOMContentLoaded', () => {
const url = new URL(window.location.href);
const message = url.searchParams.get('msg');
if (message) {
alert2(trt('Alert'),trt(message));
url.searchParams.delete('msg');
window.history.replaceState({}, document.title, url);
}
});
</script>
</head>

View File

@ -323,7 +323,7 @@
if (data.error_code == 0) {
window.location.href = "/engine";
} else {
alert2(trt('Alert'), trt(data.error_message));
errorDialog(data)
}
} else {
alert2(trt('Alert'), trt('Error: Unable to authorize.'));
@ -340,7 +340,7 @@
if (data.error_code == 0) {
window.location.href = "/engine";
} else {
alert2(trt('Alert'), trt(data.error_message));
errorDialog(data)
}
} else {
alert2(trt('Alert'), trt('Error: Unable to authorize.'));
@ -357,7 +357,7 @@
if (data.error_code == 0) {
window.location.href = "/engine";
} else {
alert2(trt('Alert'), trt(data.error_message));
errorDialog(data)
}
} else {
alert2(trt('Alert'), trt('Error: Unable to authorize.'));
@ -374,7 +374,7 @@
if (data.error_code == 0) {
window.location.href = "/engine";
} else {
alert2(trt('Alert'), trt(data.error_message));
errorDialog(data)
}
} else {
alert2(trt('Alert'), trt('Error: Unable to authorize.'));

View File

@ -9,7 +9,10 @@
<script type="text/javascript" src="./resources/metadata/jquery.js"></script>
<script type="text/javascript" src="./translation?v=7"></script>
<script src="./resources/metadata/dbms/tools.js?v=9"></script>
<script src="./resources/metadata/dbms/window.js?v=10"></script>
<link rel="stylesheet" href="./resources/engine/css/buttons.css?v=7">
<link rel="stylesheet" href="./resources/engine/normalize.css?v=7">
<link rel="stylesheet" href="./resources/metadata/dbms/dbms.css?v=7"/>
@ -94,71 +97,81 @@
if(date_start=='') date_start=(Date.now()/1000)-2592000;
if(date_end=='') date_end=Date.now()/1000;
function setCookie (name, value, expires, path, domain, secure)
{
var exdate=new Date();
exdate.setDate(exdate.getDate() + expires);
expires=exdate.toUTCString()
function setCookie (name, value, expires, path, domain, secure)
{
var exdate=new Date();
exdate.setDate(exdate.getDate() + expires);
expires=exdate.toUTCString()
document.cookie = name + "=" + escape(value) +
((expires) ? "; expires=" + expires : "") +
((path) ? "; path=" + path : "") +
((domain) ? "; domain=" + domain : "") +
((secure) ? "; secure" : "");
}
if(window.location.host.indexOf('locust.kz')>=0){
window.location.href = "https://ccalm.org";
}
if(window.location.host.indexOf('ccalm.org')>=0 && location.protocol == 'http:'){
location.href = location.href.replace(/^http:/, 'https:')
}
var g_lng = [[${m_locale}]];
var g_map=null;
var m_winPP=null;
function Configure(){
let win=new TWin(false,'./resources');
win.BuildGUI(pageX-100,pageY-100);
win.setSize(300,20);
win.setCaption(trt('Configure'));
//win.showProgressBar();
win.shadow = true;
let html='<table width="100%" border="0"><tbody><tr><td style="padding: 1px; white-space: nowrap;" width="1%">From date </td><td style="padding: 1px;"><table style="width: 100%; table-layout: fixed; border-spacing: 0px; border-collapse: collapse;" border="0"><tbody><tr><td style="width: 100%;"><input style="width: 100%;" name="date_start" value="" id="filter_first_date_start" type="text"></td><td style="width: 25px;"><img id="filter_first_date_start_trigger" src="../resources/engine/images/datepicker.jpg" style="margin-left: 1px; cursor: pointer;"></td></tr></tbody></table></td><td style="padding: 1px; white-space: nowrap;" width="1%">To date</td><td style="padding: 1px;"><table style="width: 100%; table-layout: fixed; border-spacing: 0px; border-collapse: collapse;" border="0"><tbody><tr><td style="width: 100%;"><input style="width: 100%;" name="date_end" value="" id="filter_first_date_end" type="text"></td><td style="width: 25px;"><img id="filter_first_date_end_trigger" src="../resources/engine/images/datepicker.jpg" style="cursor: pointer; margin-left: 1px;"></td></tr></tbody></table></td></tr></tbody></table>';
html+='<input class="button-secondary" id="btnApply" type="button" value="'+trt('Apply')+'" style="margin: 0px 1px 0px 0px;float:right;">';
win.setContent(html);
win.setCenter();
win.hide(false);
$("#btnApply").click(function() {
let date_start="";
let input = document.getElementById('filter_first_date_start');
if(input!=null)
{
let date = new Date(input.value.replace(/-/g, "/"));
date_start=date.getTime()/1000;// - date.getTimezoneOffset()*60;
if(isNaN(date_start)) date_start='';
}
let date_end="";
input = document.getElementById('filter_first_date_end');
if(input!=null)
{
let date = new Date(input.value.replace(/-/g, "/"));
date_end=date.getTime()/1000;// - date.getTimezoneOffset()*60;
if(isNaN(date_end)) date_end='';
}
let path="./?date_start="+date_start+"&date_end="+date_end;
window.open(path, "_self");
});
document.cookie = name + "=" + escape(value) +
((expires) ? "; expires=" + expires : "") +
((path) ? "; path=" + path : "") +
((domain) ? "; domain=" + domain : "") +
((secure) ? "; secure" : "");
}
if(window.location.host.indexOf('locust.kz')>=0){
window.location.href = "https://ccalm.org";
}
if(window.location.host.indexOf('ccalm.org')>=0 && location.protocol == 'http:'){
location.href = location.href.replace(/^http:/, 'https:')
}
var g_lng = [[${m_locale}]];
var g_map=null;
var m_winPP=null;
function Configure(){
let win=new TWin(false,'./resources');
win.BuildGUI(pageX-100,pageY-100);
win.setSize(300,20);
win.setCaption(trt('Configure'));
//win.showProgressBar();
win.shadow = true;
let html='<table width="100%" border="0"><tbody><tr><td style="padding: 1px; white-space: nowrap;" width="1%">From date </td><td style="padding: 1px;"><table style="width: 100%; table-layout: fixed; border-spacing: 0px; border-collapse: collapse;" border="0"><tbody><tr><td style="width: 100%;"><input style="width: 100%;" name="date_start" value="" id="filter_first_date_start" type="text"></td><td style="width: 25px;"><img id="filter_first_date_start_trigger" src="../resources/engine/images/datepicker.jpg" style="margin-left: 1px; cursor: pointer;"></td></tr></tbody></table></td><td style="padding: 1px; white-space: nowrap;" width="1%">To date</td><td style="padding: 1px;"><table style="width: 100%; table-layout: fixed; border-spacing: 0px; border-collapse: collapse;" border="0"><tbody><tr><td style="width: 100%;"><input style="width: 100%;" name="date_end" value="" id="filter_first_date_end" type="text"></td><td style="width: 25px;"><img id="filter_first_date_end_trigger" src="../resources/engine/images/datepicker.jpg" style="cursor: pointer; margin-left: 1px;"></td></tr></tbody></table></td></tr></tbody></table>';
html+='<input class="button-secondary" id="btnApply" type="button" value="'+trt('Apply')+'" style="margin: 0px 1px 0px 0px;float:right;">';
win.setContent(html);
win.setCenter();
win.hide(false);
$("#btnApply").click(function() {
let date_start="";
let input = document.getElementById('filter_first_date_start');
if(input!=null)
{
let date = new Date(input.value.replace(/-/g, "/"));
date_start=date.getTime()/1000;// - date.getTimezoneOffset()*60;
if(isNaN(date_start)) date_start='';
}
let date_end="";
input = document.getElementById('filter_first_date_end');
if(input!=null)
{
let date = new Date(input.value.replace(/-/g, "/"));
date_end=date.getTime()/1000;// - date.getTimezoneOffset()*60;
if(isNaN(date_end)) date_end='';
}
let path="./?date_start="+date_start+"&date_end="+date_end;
window.open(path, "_self");
});
}
document.addEventListener('DOMContentLoaded', () => {
const url = new URL(window.location.href);
const message = url.searchParams.get('msg');
if (message) {
alert2(trt('Alert'),trt(message));
url.searchParams.delete('msg');
window.history.replaceState({}, document.title, url);
}
});
</script>
</head>