Hikari pool add data
This commit is contained in:
@ -1091,7 +1091,7 @@ public class AcceptASDCController implements ServletContextAware {
|
||||
@RequestMapping(value = "/get/",method = { RequestMethod.GET, RequestMethod.POST },produces = "application/xml; charset=utf-8")
|
||||
@ResponseBody
|
||||
public Object uploadXML(HttpServletResponse response, @RequestHeader(required=false,name="Content-Type") String contentType, @RequestBody(required=false) byte[] reqData) {
|
||||
|
||||
|
||||
if(contentType!=null)
|
||||
logger.info("Content-Type = " + contentType); //INFO : kz.locust.CCALM.AcceptASDC - Content-Type = multipart/form-data; boundary=kTwyQRMc7R9JvmcYlXyvMEwX6B08jb
|
||||
|
||||
|
||||
@ -2,11 +2,8 @@ package org.ccalm.main;
|
||||
|
||||
import java.io.FileInputStream;
|
||||
import java.io.IOException;
|
||||
import java.sql.Connection;
|
||||
import java.sql.DriverManager;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.sql.Statement;
|
||||
import java.sql.*;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Properties;
|
||||
import java.util.Set;
|
||||
@ -21,13 +18,20 @@ import org.json.JSONArray;
|
||||
import org.json.JSONObject;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.dao.DataAccessException;
|
||||
import org.springframework.http.CacheControl;
|
||||
import org.springframework.jdbc.core.JdbcTemplate;
|
||||
import org.springframework.jdbc.core.namedparam.MapSqlParameterSource;
|
||||
import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.context.ServletContextAware;
|
||||
|
||||
|
||||
import org.ccalm.main.TranslationUtils;
|
||||
import tools.DBTools;
|
||||
import tools.User;
|
||||
|
||||
/**
|
||||
@ -46,26 +50,13 @@ public class MainController implements ServletContextAware {
|
||||
this.context=context;
|
||||
}
|
||||
|
||||
//If not created object "user", create him.
|
||||
//@ModelAttribute("user")
|
||||
//public User populatePerson() {
|
||||
// return new User("none");
|
||||
//}
|
||||
private final NamedParameterJdbcTemplate jdbcTemplate;
|
||||
|
||||
/**
|
||||
* Simply selects the home view to render by returning its name.
|
||||
*/
|
||||
/*@RequestMapping(value = "/test", method = RequestMethod.GET)
|
||||
public String home(Locale locale, Model model) {
|
||||
logger.info("Welcome home! The client locale is {}.", locale);
|
||||
|
||||
//Date date = new Date();
|
||||
//DateFormat dateFormat = DateFormat.getDateTimeInstance(DateFormat.LONG, DateFormat.LONG, locale);
|
||||
//String formattedDate = dateFormat.format(date);
|
||||
//model.addAttribute("serverTime", formattedDate );
|
||||
|
||||
return "index";
|
||||
}*/
|
||||
@Autowired
|
||||
public MainController(NamedParameterJdbcTemplate jdbcTemplate) {
|
||||
this.jdbcTemplate = jdbcTemplate;
|
||||
this.m_props = new Properties();
|
||||
}
|
||||
|
||||
/**
|
||||
* Simply selects the home view to render by returning its name.
|
||||
@ -114,125 +105,20 @@ public class MainController implements ServletContextAware {
|
||||
* Testing new main index page
|
||||
*/
|
||||
@RequestMapping(value = "/", method = RequestMethod.GET)
|
||||
public String home2(@ModelAttribute User user, Model model,@CookieValue(value = "lng", defaultValue = "1") String language_id) {
|
||||
//logger.info("Welcome home! The client locale is {}.", locale);
|
||||
|
||||
if(language_id!=null && !language_id.equals("")) user.language_id=language_id;
|
||||
logger.info("user.id="+user.id+" user.name="+user.name+" user.language_id="+user.language_id);
|
||||
|
||||
String db_url="";
|
||||
String db_login="";
|
||||
String db_password="";
|
||||
Properties prop = new Properties();
|
||||
public String home2(Model model,@CookieValue(value = "lng", defaultValue = "1") String language_id_str) {
|
||||
int language_id;
|
||||
try {
|
||||
prop.load(new FileInputStream("org_ccalm_main.properties")); // load a properties file
|
||||
db_url = prop.getProperty("spring.datasource.url");
|
||||
db_login = prop.getProperty("spring.datasource.username");
|
||||
db_password = prop.getProperty("spring.datasource.password");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
logger.error("Error load org_ccalm_main.properties",e);
|
||||
}
|
||||
|
||||
//Get language from database
|
||||
Connection conn = null;
|
||||
try{
|
||||
Class.forName("org.postgresql.Driver");
|
||||
conn = DriverManager.getConnection(db_url,db_login,db_password);
|
||||
if(conn!=null)
|
||||
{
|
||||
System.out.println("Connect is OK!");
|
||||
}else
|
||||
{
|
||||
System.out.println("<br>Connect is ERROR<br>");
|
||||
}
|
||||
}catch(Exception e)
|
||||
{
|
||||
System.out.println("<br>Connect Exception:"+e.getMessage()+"<br>");
|
||||
language_id = Integer.parseInt(language_id_str);
|
||||
} catch (NumberFormatException e) {
|
||||
language_id = 1; // Значение по умолчанию в случае ошибки
|
||||
}
|
||||
|
||||
try {
|
||||
Statement st = conn.createStatement();
|
||||
ResultSet rs=null;
|
||||
if(user.id!=null){
|
||||
|
||||
if(language_id!=null && !language_id.equals(""))
|
||||
{
|
||||
//Set the language for the current user if it is transferred.
|
||||
user.language_id=language_id;
|
||||
try {
|
||||
st.execute("update main._users set language_id='"+user.language_id+"' where id="+user.id);
|
||||
} catch( SQLException ex )
|
||||
{
|
||||
System.out.println("<br>SQLException:"+ex.getMessage()+"<br>");
|
||||
}
|
||||
}
|
||||
|
||||
//Select language for current user
|
||||
try {
|
||||
String sql="select language_id,country_id from main._users u where u.id="+String.valueOf(user.id)+";";
|
||||
rs = st.executeQuery(sql);
|
||||
} catch( SQLException ex )
|
||||
{
|
||||
System.out.println("<br>SQLException:"+ex.getMessage()+"<br>");
|
||||
}
|
||||
|
||||
if(rs!=null)
|
||||
{
|
||||
while (rs.next())
|
||||
{
|
||||
user.language_id = rs.getString("language_id");
|
||||
user.country_id = rs.getString("country_id");
|
||||
}
|
||||
}
|
||||
}
|
||||
st.close();
|
||||
} catch( SQLException ex )
|
||||
{
|
||||
System.out.println("<br>SQLException:"+ex.getMessage()+"<br>");
|
||||
}
|
||||
|
||||
//Send user name and role
|
||||
model.addAttribute("uName",user.name+" ("+user.role+")");
|
||||
model.addAttribute("m_locale",user.language_id);
|
||||
model.addAttribute("country_id",user.country_id);
|
||||
//model.addAttribute("uName",user.name+" ("+user.role+")");
|
||||
model.addAttribute("m_locale",language_id);
|
||||
//model.addAttribute("country_id",user.country_id);
|
||||
|
||||
//Для перевода выбираю всё что под номером 1 в переводе
|
||||
try {
|
||||
m_props = new Properties();
|
||||
Statement stt = conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_READ_ONLY);
|
||||
String sql_query = "select identifier,case when '"+user.language_id+"'='666' then translation||'''\"' else translation end as translation from main._translations t where t.del=false and (t.language_id='"+user.language_id+"' or ('"+user.language_id+"'='666' and t.language_id=1)) and translation_type_id=1;";
|
||||
ResultSet rs = stt.executeQuery(sql_query);
|
||||
if (rs != null) {
|
||||
while (rs.next())
|
||||
{
|
||||
String identifier = rs.getString("identifier");
|
||||
String translation = rs.getString("translation");
|
||||
m_props.setProperty(identifier, translation);
|
||||
}
|
||||
rs.close();
|
||||
}
|
||||
stt.close();
|
||||
} catch (SQLException ex) {
|
||||
logger.info(ex.getMessage());
|
||||
}
|
||||
Set<Object> keys = m_props.keySet();
|
||||
for(Object k:keys){
|
||||
String key = (String)k;
|
||||
String val="";
|
||||
if(val.equals(""))
|
||||
{
|
||||
val = m_props.getProperty(key,"");
|
||||
if(val.equals(""))
|
||||
{
|
||||
val = val.replaceAll("_", " ");
|
||||
}
|
||||
}
|
||||
model.addAttribute(key,val);
|
||||
}
|
||||
|
||||
|
||||
try{ conn.close(); }catch(Exception e){}
|
||||
TranslationUtils.loadTranslations(jdbcTemplate, language_id, model);
|
||||
|
||||
//return "index";
|
||||
return "test";
|
||||
@ -248,77 +134,33 @@ public class MainController implements ServletContextAware {
|
||||
JSONObject result = new JSONObject();
|
||||
JSONArray array=new JSONArray();
|
||||
|
||||
String db_url="";
|
||||
String db_login="";
|
||||
String db_password="";
|
||||
//String data_dir = "";
|
||||
Properties prop = new Properties();
|
||||
try {
|
||||
prop.load(new FileInputStream("org_ccalm_main.properties")); // load a properties file
|
||||
db_url = prop.getProperty("spring.datasource.url");
|
||||
db_login = prop.getProperty("spring.datasource.username");
|
||||
db_password = prop.getProperty("spring.datasource.password");
|
||||
//data_dir = prop.getProperty("data.dir");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
logger.error("Error load org_ccalm_main.properties",e);
|
||||
}
|
||||
|
||||
//Connect to database
|
||||
Connection conn = null;
|
||||
try{
|
||||
Class.forName("org.postgresql.Driver");
|
||||
conn = DriverManager.getConnection(db_url,db_login,db_password);
|
||||
if(conn!=null)
|
||||
{
|
||||
System.out.println("Connect is OK!");
|
||||
}else
|
||||
{
|
||||
System.out.println("<br>Connect is ERROR<br>");
|
||||
}
|
||||
}catch(Exception e)
|
||||
{
|
||||
System.out.println("<br>Connect Exception:"+e.getMessage()+"<br>");
|
||||
}
|
||||
|
||||
String sql;
|
||||
sql = "select * from main.p_dataindex(to_timestamp("+date_start+")::timestamp without time zone,to_timestamp("+date_end+")::timestamp without time zone);";
|
||||
ResultSet rs = null;
|
||||
try {
|
||||
Statement stmt = conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_READ_ONLY);
|
||||
rs = stmt.executeQuery(sql);
|
||||
} catch (SQLException ex) {
|
||||
logger.info(ex.getMessage());
|
||||
ex.printStackTrace();
|
||||
}
|
||||
|
||||
try {
|
||||
while (rs.next()) {
|
||||
JSONObject rsRez = new JSONObject();
|
||||
rsRez.put("id",rs.getInt("id"));
|
||||
rsRez.put("lon",rs.getDouble("lon"));
|
||||
rsRez.put("lat",rs.getDouble("lat"));
|
||||
rsRez.put("type",rs.getInt("type"));
|
||||
rsRez.put("terrain",rs.getString("terrain"));
|
||||
String sql="""
|
||||
select
|
||||
id,
|
||||
lon,
|
||||
lat,
|
||||
type,
|
||||
terrain
|
||||
from main.p_dataindex(to_timestamp(:date_start)::timestamp without time zone,to_timestamp(:date_end)::timestamp without time zone);
|
||||
""";
|
||||
MapSqlParameterSource parameters = new MapSqlParameterSource();
|
||||
parameters.addValue("date_start", date_start, Types.INTEGER);
|
||||
parameters.addValue("date_end", date_end, Types.INTEGER);
|
||||
List<String> ret = jdbcTemplate.query(sql, parameters, new DBTools.JsonRowMapper());
|
||||
for (int i = 0; i < ret.size(); i++) {
|
||||
JSONObject rsRez = new JSONObject(ret.get(i));
|
||||
array.put(rsRez);
|
||||
}
|
||||
} catch (SQLException ex) {
|
||||
logger.info(ex.getMessage());
|
||||
ex.printStackTrace();
|
||||
} catch( DataAccessException ex )
|
||||
{
|
||||
logger.error("Error",ex);
|
||||
}
|
||||
|
||||
result.put("Error_code", "0");
|
||||
result.put("Error_message", "");
|
||||
|
||||
result.put("data", array);
|
||||
|
||||
if(conn!=null)
|
||||
{
|
||||
try {
|
||||
conn.close();
|
||||
} catch (SQLException e) {
|
||||
}
|
||||
}
|
||||
|
||||
return result.toString();
|
||||
}
|
||||
|
||||
|
||||
@ -1,13 +1,8 @@
|
||||
package org.ccalm.main;
|
||||
|
||||
import java.io.FileInputStream;
|
||||
import java.sql.Connection;
|
||||
import java.sql.DriverManager;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.sql.Statement;
|
||||
import java.util.Properties;
|
||||
import java.util.Set;
|
||||
import java.sql.*;
|
||||
import java.util.*;
|
||||
|
||||
//import javax.servlet.ServletContext;
|
||||
|
||||
@ -15,11 +10,16 @@ import jakarta.servlet.ServletContext;
|
||||
import org.json.JSONObject;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.dao.DataAccessException;
|
||||
import org.springframework.jdbc.core.namedparam.MapSqlParameterSource;
|
||||
import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.context.ServletContextAware;
|
||||
|
||||
import tools.DBTools;
|
||||
import tools.User;
|
||||
|
||||
/**
|
||||
@ -32,117 +32,103 @@ public class TranslationController implements ServletContextAware {
|
||||
private static final Logger logger = LoggerFactory.getLogger(TranslationController.class);
|
||||
private ServletContext context;
|
||||
|
||||
/*@Value("${spring.datasource.url}")
|
||||
private String dbUrl;
|
||||
@Value("${spring.datasource.username}")
|
||||
private String dbUsername;
|
||||
@Value("${spring.datasource.password}")
|
||||
private String dbPassword;*/
|
||||
private final NamedParameterJdbcTemplate jdbcTemplate;
|
||||
|
||||
//If not created object "user", create him.
|
||||
//@ModelAttribute("user")
|
||||
//public User populatePerson() {
|
||||
// return new User("none");
|
||||
//}
|
||||
@Autowired
|
||||
public TranslationController(NamedParameterJdbcTemplate jdbcTemplate) {
|
||||
this.jdbcTemplate = jdbcTemplate;
|
||||
}
|
||||
|
||||
/**
|
||||
* Simply selects the home view to render by returning its name.
|
||||
*/
|
||||
@RequestMapping(value = "/translation", method = RequestMethod.GET)
|
||||
@ResponseBody
|
||||
public String home(@ModelAttribute User user/*, Locale locale*/, Model model) {
|
||||
|
||||
String db_url="";
|
||||
String db_login="";
|
||||
String db_password="";
|
||||
//String data_dir = "";
|
||||
Properties prop = new Properties();
|
||||
try {
|
||||
prop.load(new FileInputStream("org_ccalm_main.properties")); // load a properties file
|
||||
db_url = prop.getProperty("spring.datasource.url");
|
||||
db_login = prop.getProperty("spring.datasource.username");
|
||||
db_password = prop.getProperty("spring.datasource.password");
|
||||
//data_dir = prop.getProperty("data.dir");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
logger.error("Error load org_ccalm_main.properties",e);
|
||||
}
|
||||
|
||||
//Get language from database
|
||||
Connection conn = null;
|
||||
try{
|
||||
Class.forName("org.postgresql.Driver");
|
||||
conn = DriverManager.getConnection(db_url,db_login,db_password);
|
||||
if(conn!=null)
|
||||
{
|
||||
System.out.println("Connect is OK!");
|
||||
}else
|
||||
{
|
||||
System.out.println("<br>Connect is ERROR<br>");
|
||||
}
|
||||
}catch(Exception e)
|
||||
{
|
||||
System.out.println("<br>Connect Exception:"+e.getMessage()+"<br>");
|
||||
}
|
||||
public String home(
|
||||
Model model,
|
||||
@CookieValue(value = "lng", defaultValue = "1") String language_id
|
||||
) {
|
||||
|
||||
Properties props = new Properties();
|
||||
try {
|
||||
Statement st = conn.createStatement();
|
||||
ResultSet rs=null;
|
||||
try {
|
||||
String sql_query = "select identifier,case when '"+user.language_id+"'='666' then translation||'''\"' else translation end as translation from main._translations t where t.del=false and (t.language_id='"+user.language_id+"' or ('"+user.language_id+"'='666' and t.language_id=1)) and translation_type_id=1 order by identifier;";
|
||||
rs = st.executeQuery(sql_query);
|
||||
} catch( SQLException ex )
|
||||
{
|
||||
System.out.println("<br>SQLException:"+ex.getMessage()+"<br>");
|
||||
}
|
||||
|
||||
if(rs!=null)
|
||||
{
|
||||
while (rs.next())
|
||||
{
|
||||
if(rs.getString("translation")!=null)
|
||||
props.setProperty(rs.getString("identifier"), rs.getString("translation"));
|
||||
}
|
||||
}
|
||||
st.close();
|
||||
} catch( SQLException ex )
|
||||
String sql="""
|
||||
select
|
||||
identifier,
|
||||
translation
|
||||
from
|
||||
main._translations t
|
||||
where
|
||||
t.del=false and
|
||||
t.language_id=:language_id and
|
||||
translation_type_id=1
|
||||
order by
|
||||
identifier
|
||||
""";
|
||||
MapSqlParameterSource parameters = new MapSqlParameterSource();
|
||||
parameters.addValue("language_id", language_id, Types.INTEGER);
|
||||
List<String> ret = jdbcTemplate.query(sql, parameters, new DBTools.JsonRowMapper());
|
||||
for (String str : ret) {
|
||||
JSONObject obj = new JSONObject(str);
|
||||
props.setProperty(obj.getString("identifier"), obj.getString("translation"));
|
||||
}
|
||||
} catch( DataAccessException ex )
|
||||
{
|
||||
System.out.println("<br>SQLException:"+ex.getMessage()+"<br>");
|
||||
logger.info(ex.getMessage());
|
||||
}
|
||||
try{ conn.close(); }catch(Exception e){}
|
||||
|
||||
//Create JavaScript text
|
||||
/*
|
||||
InputStream utf8in = getClass().getClassLoader().getResourceAsStream("messages_"+user.lng+".properties");
|
||||
Reader reader;
|
||||
try {
|
||||
reader = new InputStreamReader(utf8in, "UTF-8");
|
||||
props.load(reader);
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
}catch (IOException e) {
|
||||
}*/
|
||||
|
||||
//Переписываю в JavaScript код
|
||||
//JSONArray data = new JSONArray();
|
||||
JSONObject data = new JSONObject();
|
||||
String result="";
|
||||
Set<Object> keys = props.keySet();
|
||||
for(Object k:keys){
|
||||
String key = ((String)k).trim();
|
||||
String val = props.getProperty(key,"");
|
||||
|
||||
data.put(key,val);
|
||||
//JSONObject obj = new JSONObject();
|
||||
//obj.put(key,val);
|
||||
//data.put(obj);
|
||||
}
|
||||
|
||||
//model.addAttribute("keys",result);
|
||||
//return "translation";
|
||||
return "var g_translations = "+data.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Функция для получения переводов в формате JSON.
|
||||
*/
|
||||
@GetMapping(value = "/api/translation", produces = "application/json")
|
||||
@ResponseBody
|
||||
public Map<String, String> getTranslations(
|
||||
@CookieValue(value = "lng", defaultValue = "1") String language_id
|
||||
) {
|
||||
|
||||
Map<String, String> translations = new HashMap<>();
|
||||
|
||||
try {
|
||||
String sql = """
|
||||
select
|
||||
identifier,
|
||||
translation
|
||||
from
|
||||
main._translations t
|
||||
where
|
||||
t.del = false
|
||||
and t.language_id = :language_id
|
||||
and translation_type_id = 1
|
||||
order by identifier
|
||||
""";
|
||||
|
||||
MapSqlParameterSource parameters = new MapSqlParameterSource();
|
||||
parameters.addValue("language_id", language_id, Types.INTEGER);
|
||||
List<Map<String, Object>> rows = jdbcTemplate.queryForList(sql, parameters);
|
||||
|
||||
for (Map<String, Object> row : rows) {
|
||||
String identifier = (String) row.get("identifier");
|
||||
String translation = (String) row.get("translation");
|
||||
translations.put(identifier, translation);
|
||||
}
|
||||
} catch (DataAccessException ex) {
|
||||
logger.info("Error fetching translations: " + ex.getMessage());
|
||||
}
|
||||
|
||||
return translations;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setServletContext(ServletContext servletContext) {
|
||||
this.context=servletContext;
|
||||
|
||||
45
src/main/java/org/ccalm/main/TranslationUtils.java
Normal file
45
src/main/java/org/ccalm/main/TranslationUtils.java
Normal file
@ -0,0 +1,45 @@
|
||||
package org.ccalm.main;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.jdbc.core.namedparam.MapSqlParameterSource;
|
||||
import org.springframework.dao.DataAccessException;
|
||||
import org.springframework.jdbc.core.JdbcTemplate;
|
||||
import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate;
|
||||
import org.springframework.ui.Model;
|
||||
import org.json.JSONObject;
|
||||
import tools.DBTools;
|
||||
|
||||
import java.sql.Types;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.Properties;
|
||||
|
||||
public class TranslationUtils {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(TranslationUtils.class);
|
||||
|
||||
public static void loadTranslations(NamedParameterJdbcTemplate jdbcTemplate, int language_id, Model model) {
|
||||
// Для перевода выбираю всё что под номером 1 в переводе
|
||||
try {
|
||||
String sql = """
|
||||
select identifier, translation from main._translations t
|
||||
where t.del = false and t.language_id = :language_id and translation_type_id = 1;
|
||||
""";
|
||||
MapSqlParameterSource parameters = new MapSqlParameterSource();
|
||||
parameters.addValue("language_id", language_id, Types.INTEGER);
|
||||
List<String> ret = jdbcTemplate.query(sql, parameters, new DBTools.JsonRowMapper());
|
||||
for (String jsonString : ret) {
|
||||
JSONObject obj = new JSONObject(jsonString);
|
||||
String key = obj.getString("identifier");
|
||||
String val = obj.getString("translation");
|
||||
if (val.equals("")) {
|
||||
val = val.replaceAll("_", " ");
|
||||
}
|
||||
model.addAttribute(key, val);
|
||||
}
|
||||
} catch (DataAccessException ex) {
|
||||
logger.error("Error loading translations for language_id: {}", language_id, ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -19,6 +19,7 @@ import io.jsonwebtoken.Claims;
|
||||
import io.jsonwebtoken.Jws;
|
||||
import io.jsonwebtoken.Jwts;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.ccalm.main.TranslationUtils;
|
||||
import org.json.JSONObject;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
@ -85,7 +86,7 @@ public class EngineController implements ServletContextAware {
|
||||
Model model,
|
||||
HttpServletResponse response,
|
||||
@CookieValue(value = "jwt_a", defaultValue = "") String jwt_a,
|
||||
@CookieValue(value = "lng", defaultValue = "1") String language_id
|
||||
@CookieValue(value = "lng", defaultValue = "1") int language_id
|
||||
) {
|
||||
if (jwt_a.equals("") || Tools.countOccurrences(jwt_a, '.') != 2) {
|
||||
String redirectUrl = "/login/login?msg=Please_log_in";
|
||||
@ -131,8 +132,7 @@ public class EngineController implements ServletContextAware {
|
||||
model.addAttribute("uName",claims.getBody().get("sub").toString()/*+" ("+user.role+")"*/);
|
||||
model.addAttribute("m_locale",language_id);
|
||||
model.addAttribute("country_id",country_id);
|
||||
|
||||
|
||||
|
||||
//Send translation to user
|
||||
/*InputStream utf8in = getClass().getClassLoader().getResourceAsStream("messages_"+user.lng+".properties");
|
||||
if(utf8in!=null)
|
||||
@ -351,39 +351,8 @@ public class EngineController implements ServletContextAware {
|
||||
}*/
|
||||
|
||||
//Для перевода выбираю всё что под номером 1 в переводе
|
||||
TranslationUtils.loadTranslations(jdbcTemplate, language_id, model);
|
||||
|
||||
try {
|
||||
String sql="""
|
||||
select identifier,translation from main._translations t where t.del=false and t.language_id=:language_id and translation_type_id=1;
|
||||
""";
|
||||
MapSqlParameterSource parameters = new MapSqlParameterSource();
|
||||
parameters.addValue("language_id", language_id, Types.INTEGER);
|
||||
List<String> ret = jdbcTemplate.query(sql, parameters, new DBTools.JsonRowMapper());
|
||||
for (int i = 0; i < ret.size(); i++) {
|
||||
JSONObject obj = new JSONObject(ret.get(i));
|
||||
m_props.setProperty(obj.getString("identifier"), obj.getString("translation"));
|
||||
}
|
||||
} catch( DataAccessException ex )
|
||||
{
|
||||
logger.info(ex.getMessage());
|
||||
}
|
||||
|
||||
Set<Object> keys = m_props.keySet();
|
||||
for(Object k:keys){
|
||||
String key = (String)k;
|
||||
String val="";
|
||||
if(val.equals(""))
|
||||
{
|
||||
val = m_props.getProperty(key,"");
|
||||
if(val.equals(""))
|
||||
{
|
||||
val = val.replaceAll("_", " ");
|
||||
}
|
||||
}
|
||||
model.addAttribute(key,val);
|
||||
}
|
||||
|
||||
|
||||
//Подложка Substrate_head Substrate_tail
|
||||
String Substrate_head="";
|
||||
String Substrate_tail="";
|
||||
|
||||
@ -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>
|
||||
|
||||
@ -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>
|
||||
|
||||
Reference in New Issue
Block a user