summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfangshunjian <[email protected]>2024-01-26 11:08:53 +0800
committerfangshunjian <[email protected]>2024-01-26 11:08:53 +0800
commitff59ce614f3b711511bbc22876f0fcbf8348359a (patch)
tree3c7bd46961f3d8d24981acd78b74198baa39f34a
parent547e2385c966aa227eb6871f32183fed09a70ffb (diff)
perf: 新增 dashboard.snapshot.chrome.option 和rel-24.01.04
dashboard.snapshot.chrome.path 配置项
-rw-r--r--nz-admin/.classpath10
-rw-r--r--nz-admin/.settings/org.eclipse.core.resources.prefs1
-rw-r--r--nz-admin/.settings/org.eclipse.jdt.core.prefs8
-rw-r--r--nz-admin/src/main/java/com/nis/modules/dashboard/service/impl/VisualServiceImpl.java20
-rw-r--r--nz-common/.classpath15
5 files changed, 37 insertions, 17 deletions
diff --git a/nz-admin/.classpath b/nz-admin/.classpath
index cab3585c..f3bce312 100644
--- a/nz-admin/.classpath
+++ b/nz-admin/.classpath
@@ -9,6 +9,7 @@
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
+ <attribute name="optional" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
@@ -18,7 +19,7 @@
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-21">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
@@ -28,5 +29,12 @@
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
+ <classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
+ <attributes>
+ <attribute name="maven.pomderived" value="true"/>
+ <attribute name="test" value="true"/>
+ <attribute name="optional" value="true"/>
+ </attributes>
+ </classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>
diff --git a/nz-admin/.settings/org.eclipse.core.resources.prefs b/nz-admin/.settings/org.eclipse.core.resources.prefs
index 869dcb74..50858577 100644
--- a/nz-admin/.settings/org.eclipse.core.resources.prefs
+++ b/nz-admin/.settings/org.eclipse.core.resources.prefs
@@ -3,4 +3,5 @@ encoding//src/main/java=UTF-8
encoding//src/main/resources=UTF-8
encoding//src/main/resources/config/nezha.properties=UTF-8
encoding//src/test/java=UTF-8
+encoding//src/test/resources=UTF-8
encoding/<project>=UTF-8
diff --git a/nz-admin/.settings/org.eclipse.jdt.core.prefs b/nz-admin/.settings/org.eclipse.jdt.core.prefs
index ebb47b74..6730d556 100644
--- a/nz-admin/.settings/org.eclipse.jdt.core.prefs
+++ b/nz-admin/.settings/org.eclipse.jdt.core.prefs
@@ -1,9 +1,9 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.methodParameters=generate
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=21
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.8
+org.eclipse.jdt.core.compiler.compliance=21
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
@@ -12,5 +12,5 @@ org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore
-org.eclipse.jdt.core.compiler.release=disabled
-org.eclipse.jdt.core.compiler.source=1.8
+org.eclipse.jdt.core.compiler.release=enabled
+org.eclipse.jdt.core.compiler.source=21
diff --git a/nz-admin/src/main/java/com/nis/modules/dashboard/service/impl/VisualServiceImpl.java b/nz-admin/src/main/java/com/nis/modules/dashboard/service/impl/VisualServiceImpl.java
index fb711188..baea1510 100644
--- a/nz-admin/src/main/java/com/nis/modules/dashboard/service/impl/VisualServiceImpl.java
+++ b/nz-admin/src/main/java/com/nis/modules/dashboard/service/impl/VisualServiceImpl.java
@@ -77,7 +77,12 @@ public class VisualServiceImpl implements VisualService {
*/
@Value("${dashboard.snapshot.timeout:300000}")
private Integer timeout;
-
+
+ @Value("${dashboard.snapshot.chrome.option:--headless,--disable-cache,--disable-dev-shm-usage,--no-sandbox,--window-size=1920x1080,--lang=zh-CN.UTF-8}")
+ private String[] chromeOption;
+
+ @Value("${dashboard.snapshot.chrome.path:./lib/chrome-linux64/chrome}")
+ private String chromePath;
@Autowired
private SysI18nService sysI18nService;
@@ -656,17 +661,10 @@ public class VisualServiceImpl implements VisualService {
*/
private ChromeDriver createChromeDriver() {
final var chromeOptions = new ChromeOptions();
- chromeOptions.addArguments(
- "--headless",
- "--disable-cache",
- "--disable-dev-shm-usage",
- "--no-sandbox",
- "--window-size=1920x1080",
- "--lang=zh-CN.UTF-8"
- );
- chromeOptions.setBinary("./lib/chrome-linux64/chrome");
-
+ chromeOptions.addArguments(chromeOption);
+ chromeOptions.setBinary(chromePath);
ChromeDriver chromeDriver = new ChromeDriver(chromeOptions);
+ log.info("chrome options: {}", chromeOptions.toString());
return chromeDriver;
}
diff --git a/nz-common/.classpath b/nz-common/.classpath
index 5e8a55fe..47418c14 100644
--- a/nz-common/.classpath
+++ b/nz-common/.classpath
@@ -13,7 +13,7 @@
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-21">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
@@ -23,5 +23,18 @@
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
+ <classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
+ <attributes>
+ <attribute name="maven.pomderived" value="true"/>
+ <attribute name="optional" value="true"/>
+ </attributes>
+ </classpathentry>
+ <classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
+ <attributes>
+ <attribute name="maven.pomderived" value="true"/>
+ <attribute name="test" value="true"/>
+ <attribute name="optional" value="true"/>
+ </attributes>
+ </classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>