diff --git a/core/core-backend/src/main/java/io/dataease/datasource/type/CK.java b/core/core-backend/src/main/java/io/dataease/datasource/type/CK.java index f21243614e..e02ffb1cac 100644 --- a/core/core-backend/src/main/java/io/dataease/datasource/type/CK.java +++ b/core/core-backend/src/main/java/io/dataease/datasource/type/CK.java @@ -14,6 +14,8 @@ import java.nio.file.Paths; import java.nio.file.StandardOpenOption; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; +import java.util.Arrays; +import java.util.List; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; import java.util.regex.Pattern; @@ -29,6 +31,9 @@ public class CK extends DatasourceConfiguration { private String sslCert; private String sslKey; + private List ILLEGAL_PARAMETERS = Arrays.asList("jndi:", "rmi:", "ldap:", "ldaps:", "dns:", "nis:", "corba:", + "java.naming.factory.initial", "java.naming.provider.url"); + public String getJdbc() { String jdbcUrl; if (StringUtils.isNotEmpty(getUrlType()) && !getUrlType().equalsIgnoreCase("hostName")) { @@ -69,6 +74,7 @@ public class CK extends DatasourceConfiguration { jdbcUrl = appendCertParam(jdbcUrl, "sslCert", sslCert, "cert"); jdbcUrl = appendCertParam(jdbcUrl, "sslKey", sslKey, "key"); } + checkIllegalParameters(jdbcUrl); return jdbcUrl; } @@ -127,4 +133,14 @@ public class CK extends DatasourceConfiguration { private boolean containsParam(String jdbcUrl, String paramName) { return Pattern.compile("(?i)([?&])" + Pattern.quote(paramName) + "=").matcher(jdbcUrl).find(); } + + private void checkIllegalParameters(String jdbcUrl) { + String lowerUrl = jdbcUrl.toLowerCase(); + for (String illegalParam : ILLEGAL_PARAMETERS) { + if (lowerUrl.contains(illegalParam.toLowerCase())) { + throw new SecurityException("Illegal parameter detected in JDBC URL: " + illegalParam); + } + } + } + } diff --git a/core/core-backend/src/main/java/io/dataease/datasource/type/Sqlserver.java b/core/core-backend/src/main/java/io/dataease/datasource/type/Sqlserver.java index 16d7939e95..778b1168a0 100644 --- a/core/core-backend/src/main/java/io/dataease/datasource/type/Sqlserver.java +++ b/core/core-backend/src/main/java/io/dataease/datasource/type/Sqlserver.java @@ -16,11 +16,11 @@ import java.util.regex.Pattern; public class Sqlserver extends DatasourceConfiguration { private String driver = "com.microsoft.sqlserver.jdbc.SQLServerDriver"; private String extraParams = ""; - private List illegalParameters = Arrays.asList("autoDeserialize", "queryInterceptors", "statementInterceptors", "detectCustomCollations"); + private List illegalParameters = Arrays.asList("autoDeserialize", "queryInterceptors", "statementInterceptors", "detectCustomCollations", "jndi:", "rmi:", "ldap:", "ldaps:", "java.naming.factory.initial"); private List showTableSqls = Arrays.asList("show tables"); public String getJdbc() { - if(StringUtils.isNoneEmpty(getUrlType()) && !getUrlType().equalsIgnoreCase("hostName")){ + if (StringUtils.isNoneEmpty(getUrlType()) && !getUrlType().equalsIgnoreCase("hostName")) { if (!getJdbcUrl().startsWith("jdbc:sqlserver")) { DEException.throwException("Illegal jdbcUrl: " + getJdbcUrl()); } @@ -28,12 +28,12 @@ public class Sqlserver extends DatasourceConfiguration { } String jdbcUrl = ""; if (StringUtils.isEmpty(extraParams.trim())) { - jdbcUrl = "jdbc:sqlserver://HOSTNAME:PORT;DatabaseName=DATABASE" + jdbcUrl = "jdbc:sqlserver://HOSTNAME:PORT;DatabaseName=DATABASE" .replace("HOSTNAME", getLHost().trim()) .replace("PORT", getLPort().toString().trim()) .replace("DATABASE", getDataBase().trim()); } else { - jdbcUrl = "jdbc:sqlserver://HOSTNAME:PORT;DatabaseName=DATABASE;EXTRA_PARAMS" + jdbcUrl = "jdbc:sqlserver://HOSTNAME:PORT;DatabaseName=DATABASE;EXTRA_PARAMS" .replace("HOSTNAME", getLHost().trim()) .replace("PORT", getLPort().toString().trim()) .replace("DATABASE", getDataBase().trim()) @@ -53,4 +53,5 @@ public class Sqlserver extends DatasourceConfiguration { protected Pattern getDatabasePattern() { return DB_NAME_PATTERN; } + } diff --git a/core/core-frontend/package.json b/core/core-frontend/package.json index db4cd1563b..3d13191659 100644 --- a/core/core-frontend/package.json +++ b/core/core-frontend/package.json @@ -16,8 +16,8 @@ }, "dependencies": { "@antv/g2plot": "^2.4.29", - "@antv/l7": "^2.22.0", - "@antv/l7plot": "^0.5.5", + "@antv/l7": "2.23.1", + "@antv/l7plot": "0.5.11", "@antv/s2": "^1.49.0", "@babel/runtime": "^7.5.5", "@codemirror/lang-sql": "^6.4.0", diff --git a/core/core-frontend/src/custom-component/v-query/Time.vue b/core/core-frontend/src/custom-component/v-query/Time.vue index 5a9dbe9561..373aca7805 100644 --- a/core/core-frontend/src/custom-component/v-query/Time.vue +++ b/core/core-frontend/src/custom-component/v-query/Time.vue @@ -146,6 +146,10 @@ watch( ) const handleValueChange = () => { + if (selectValue.value === null) { + selectValue.value = multiple.value ? [] : undefined + } + selectValue.value = Array.isArray(selectValue.value) ? selectValue.value.map(ele => ele && dayjs(ele).format('YYYY/MM/DD HH:mm:ss')) : selectValue.value && dayjs(selectValue.value).format('YYYY/MM/DD HH:mm:ss') diff --git a/core/core-frontend/src/views/chart/components/editor/editor-style/components/CustomColorStyleSelect.vue b/core/core-frontend/src/views/chart/components/editor/editor-style/components/CustomColorStyleSelect.vue index e3fc846c1d..1c17834f03 100644 --- a/core/core-frontend/src/views/chart/components/editor/editor-style/components/CustomColorStyleSelect.vue +++ b/core/core-frontend/src/views/chart/components/editor/editor-style/components/CustomColorStyleSelect.vue @@ -234,10 +234,10 @@ const changeColorOption = (option?) => { } } const resetCustomColor = () => { - const { type } = props.chart + const type = props.chart?.type const { basicStyleForm } = state.value - if (type.includes('map')) { + if (type?.includes('map')) { changeColorOption() } else { basicStyleForm[seriesColorName.value] = [] diff --git a/core/core-frontend/src/views/chart/components/js/panel/charts/map/map.ts b/core/core-frontend/src/views/chart/components/js/panel/charts/map/map.ts index 4170d0e2dd..554c0315d1 100644 --- a/core/core-frontend/src/views/chart/components/js/panel/charts/map/map.ts +++ b/core/core-frontend/src/views/chart/components/js/panel/charts/map/map.ts @@ -422,13 +422,15 @@ export class Map extends L7PlotChartView { value = Number.isNaN(tmp) || tmp === 'NaN' ? 'NaN' : parseFloat(tmp).toFixed(0) } } - const substituteObj = { ...item, value } + if (value && value !== '') { + const substituteObj = { ...item, value } - const domStr = substitute(ITEM_TPL, substituteObj) - const itemDom = createDom(domStr) - // 给 legend 形状用的 - itemDom.style.setProperty('--bgColor', item.color) - listDom.appendChild(itemDom) + const domStr = substitute(ITEM_TPL, substituteObj) + const itemDom = createDom(domStr) + // 给 legend 形状用的 + itemDom.style.setProperty('--bgColor', item.color) + listDom.appendChild(itemDom) + } }) return listDom } diff --git a/de-xpack b/de-xpack index 9e5779488a..5cde86ad03 160000 --- a/de-xpack +++ b/de-xpack @@ -1 +1 @@ -Subproject commit 9e5779488a29ea07ce4848971cf50b8ab007a7df +Subproject commit 5cde86ad039828003003b5bfd7fcdff5e6bacc26 diff --git a/installer/dataease/docker-compose-playwright.yml b/installer/dataease/docker-compose-playwright.yml new file mode 100644 index 0000000000..8ad8002e33 --- /dev/null +++ b/installer/dataease/docker-compose-playwright.yml @@ -0,0 +1,23 @@ +version: '3.8' + +services: + api: + image: registry.cn-qingdao.aliyuncs.com/dataease/de-playwright-api:v1.58.2-noble + container_name: de-playwright-api + privileged: true + environment: + - CONCURRENCY=${DE_PLAYWRIGHT_CONCURRENCY} + volumes: + - ${DE_BASE}/dataease2.0/logs:/opt/app/logs + restart: unless-stopped + init: true + ipc: host + shm_size: ${DE_PLAYWRIGHT_SHM_SIZE} + healthcheck: + test: ["CMD", "curl", "-f", "http://localhost:3000/health"] + interval: 30s + timeout: 5s + retries: 3 + start_period: 10s + networks: + - dataease-network diff --git a/installer/dataease/docker-compose-selenium.yml b/installer/dataease/docker-compose-selenium.yml deleted file mode 100644 index 5f41ec96e1..0000000000 --- a/installer/dataease/docker-compose-selenium.yml +++ /dev/null @@ -1,19 +0,0 @@ -version: '3' -services: - de-selenium: - image: registry.cn-qingdao.aliyuncs.com/dataease/standalone-chromium:123.0 - container_name: de-selenium - shm_size: 2gb - privileged: true - deploy: - resources: - limits: - cpus: ${DE_SELENIUM_CPU_LIMIT} - memory: ${DE_SELENIUM_MEM_LIMIT} - environment: - - SE_ENABLE_BROWSER_LEFTOVERS_CLEANUP=true - - SE_NODE_OVERRIDE_MAX_SESSIONS=true - - SE_NODE_MAX_SESSIONS=5 - - TZ=Asia/Shanghai - networks: - - dataease-network diff --git a/installer/dataease/templates/application.yml b/installer/dataease/templates/application.yml index b766e8a448..5039250bd9 100644 --- a/installer/dataease/templates/application.yml +++ b/installer/dataease/templates/application.yml @@ -23,8 +23,8 @@ dataease: limit: ${DE_EXPORT_DATASET_LIMIT} origin-list: ${DE_ORIGIN_LIST} login_timeout: ${DE_LOGIN_TIMEOUT} - selenium-server: ${DE_SELENIUM_SERVER} dataease-servers: ${DE_SERVERS} + playwright-server: ${DE_PLAYWRIGHT_SERVER} task: executor: address: http://sync-task-actuator:9001 diff --git a/installer/dectl b/installer/dectl index aaba299690..792d2a6f95 100644 --- a/installer/dectl +++ b/installer/dectl @@ -58,8 +58,8 @@ function _generate_compose_file_args() { compose_files="${compose_files} -f docker-compose-task.yml" fi - if [[ -f $DE_RUNNING_BASE/docker-compose-selenium.yml ]] && [[ "$DE_EXTERNAL_SELENIUM" != "true" ]];then - compose_files="${compose_files} -f docker-compose-selenium.yml" + if [[ -f $DE_RUNNING_BASE/docker-compose-playwright.yml ]] && [[ "$DE_EXTERNAL_PLAYWRIGHT" != "true" ]];then + compose_files="${compose_files} -f docker-compose-playwright.yml" fi fi } diff --git a/installer/install.conf b/installer/install.conf index 9991015295..952323f761 100644 --- a/installer/install.conf +++ b/installer/install.conf @@ -27,14 +27,11 @@ DE_MYSQL_PASSWORD=Password123@mysql DE_MYSQL_PARAMS="autoReconnect=false&useUnicode=true&characterEncoding=UTF-8&characterSetResults=UTF-8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true" # 定时报告镜像配置 -## 是否使用外部 Selenium,若使用外部 Selenium,则限制参数无效 -DE_EXTERNAL_SELENIUM=false -## Selenium 服务地址 -DE_SELENIUM_SERVER=http://de-selenium:4444/wd/hub -## selenium 镜像 CPU 限制 -DE_SELENIUM_CPU_LIMIT='1' -## selenium 镜像 内存 限制 -DE_SELENIUM_MEM_LIMIT=2g +## 是否使用外部 Playwright,若使用外部 Playwright,则限制参数无效 +DE_EXTERNAL_PLAYWRIGHT=false +DE_PLAYWRIGHT_SERVER=http://de-playwright-api:3000/screenshot +DE_PLAYWRIGHT_CONCURRENCY=4 +DE_PLAYWRIGHT_SHM_SIZE=2gb # APISIX配置 ## 是否使用外部 APISIX diff --git a/sdk/api/api-base/src/main/java/io/dataease/api/report/bo/TableSysVariable.java b/sdk/api/api-base/src/main/java/io/dataease/api/report/bo/TableSysVariable.java index 7af112262a..51e6ada733 100644 --- a/sdk/api/api-base/src/main/java/io/dataease/api/report/bo/TableSysVariable.java +++ b/sdk/api/api-base/src/main/java/io/dataease/api/report/bo/TableSysVariable.java @@ -4,12 +4,13 @@ import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; +import java.io.Serializable; import java.util.List; @NoArgsConstructor @AllArgsConstructor @Data -public class TableSysVariable { +public class TableSysVariable implements Serializable { private Long tableId;