diff --git a/org_ccalm_main.yml b/org_ccalm_main.yml index 64acc6c..b87324a 100644 --- a/org_ccalm_main.yml +++ b/org_ccalm_main.yml @@ -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 diff --git a/pom.xml b/pom.xml index 3acb5b1..f734ce0 100644 --- a/pom.xml +++ b/pom.xml @@ -57,8 +57,7 @@ org.postgresql postgresql - 42.7.4 - runtime + 42.7.5 org.json diff --git a/src/main/java/org/ccalm/main/SendWarning.java b/src/main/java/org/ccalm/main/SendWarning.java index f38234a..16d0045 100644 --- a/src/main/java/org/ccalm/main/SendWarning.java +++ b/src/main/java/org/ccalm/main/SendWarning.java @@ -43,7 +43,8 @@ public class SendWarning { HttpHeaders headers = new HttpHeaders(); headers.setContentType(MediaType.APPLICATION_JSON); HttpEntity> 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 response = restTemplate.exchange(url, HttpMethod.POST, entity, Map.class); if (response.getStatusCode() == HttpStatus.OK && response.getBody() != null) { diff --git a/src/main/resources/templates/index.html b/src/main/resources/templates/index.html index 9cf49ed..fdc8c78 100644 --- a/src/main/resources/templates/index.html +++ b/src/main/resources/templates/index.html @@ -4,6 +4,9 @@ Automated system of data collection + + + @@ -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); + } + }); diff --git a/src/main/resources/templates/login/login.html b/src/main/resources/templates/login/login.html index d29eb78..7a19049 100644 --- a/src/main/resources/templates/login/login.html +++ b/src/main/resources/templates/login/login.html @@ -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.')); diff --git a/src/main/resources/templates/test.html b/src/main/resources/templates/test.html index 5f1ac54..a24c415 100644 --- a/src/main/resources/templates/test.html +++ b/src/main/resources/templates/test.html @@ -9,7 +9,10 @@ + + + @@ -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='
From date
To date
'; - html+=''; - - 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='
From date
To date
'; + html+=''; + + 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); } + });