Skip to content

Commit bc3e8e9

Browse files
feat(jmanus): add restore to default in general configuration (alibaba#2065)
* feat(playwright): integrate Playwright for browser automation with Spring Boot support - Added Playwright dependency versioning in pom.xml. - Enhanced ChromeDriverService to support Playwright initialization in Spring Boot environments. - Implemented browser type detection and configuration options for headless mode. - Improved error handling and logging for Playwright instance creation. * feat(playwright): enhance logging and directory checks during Playwright initialization - Added detailed logging for class loader switching and Playwright instance creation. - Implemented checks for browser and temporary directories post-creation. - Enhanced environment setup with additional logging for system properties related to Playwright. * update * remove reset to default for group * style * build(spring-ai-alibaba-jmanus): 更新项目版本并优化静态资源 - 将项目版本从 3.0.3-SNAPSHOT 升级到 3.0.4-SNAPSHOT --------- Co-authored-by: rainerWJY <answeropensource@alibabacloud.com>
1 parent d5fbe8f commit bc3e8e9

36 files changed

+295
-284
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<groupId>com.alibaba.cloud.ai</groupId>
88
<name>Spring AI Alibaba JManus</name>
99
<artifactId>spring-ai-alibaba-jmanus</artifactId>
10-
<version>3.0.3-SNAPSHOT</version>
10+
<version>3.0.4-SNAPSHOT</version>
1111

1212
<!-- The required dependencies are maintained separately by the JManus module -->
1313
<properties>

src/main/java/com/alibaba/cloud/ai/example/manus/config/ConfigController.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,12 @@ public ResponseEntity<Void> batchUpdateConfigs(@RequestBody List<ConfigEntity> c
5454
return ResponseEntity.ok().build();
5555
}
5656

57+
@PostMapping("/reset-all-defaults")
58+
public ResponseEntity<Void> resetAllConfigsToDefaults() {
59+
configService.resetAllConfigsToDefaults();
60+
return ResponseEntity.ok().build();
61+
}
62+
5763
@GetMapping("/available-models")
5864
public ResponseEntity<Map<String, Object>> getAvailableModels() {
5965
List<DynamicModelEntity> models = dynamicModelRepository.findAll();

src/main/java/com/alibaba/cloud/ai/example/manus/config/ConfigService.java

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,4 +292,25 @@ public void batchUpdateConfigs(List<ConfigEntity> configs) {
292292
}
293293
}
294294

295+
/**
296+
* Reset all configurations to their default values
297+
*/
298+
@Transactional
299+
public void resetAllConfigsToDefaults() {
300+
List<ConfigEntity> allConfigs = configRepository.findAll();
301+
302+
for (ConfigEntity config : allConfigs) {
303+
if (config.getDefaultValue() != null && !config.getDefaultValue().equals(config.getConfigValue())) {
304+
config.setConfigValue(config.getDefaultValue());
305+
configRepository.save(config);
306+
307+
// Update all beans using this configuration
308+
Map<String, Object> configBeans = applicationContext
309+
.getBeansWithAnnotation(ConfigurationProperties.class);
310+
configBeans.values()
311+
.forEach(bean -> updateBeanConfig(bean, config.getConfigPath(), config.getDefaultValue()));
312+
}
313+
}
314+
}
315+
295316
}

src/main/java/com/alibaba/cloud/ai/example/manus/config/IConfigService.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,4 +72,9 @@ public interface IConfigService {
7272
*/
7373
void batchUpdateConfigs(List<ConfigEntity> configs);
7474

75+
/**
76+
* Reset all configurations to their default values
77+
*/
78+
void resetAllConfigsToDefaults();
79+
7580
}

src/main/resources/static/ui/assets/_plugin-vue_export-helper-DnlHi3PC.js renamed to src/main/resources/static/ui/assets/_plugin-vue_export-helper-MruFI4HI.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/main/resources/static/ui/assets/cssMode-Cs0roytO.js renamed to src/main/resources/static/ui/assets/cssMode-wNmdXgJd.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/main/resources/static/ui/assets/freemarker2-bNMjfQx6.js renamed to src/main/resources/static/ui/assets/freemarker2-PBPUGn4u.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/main/resources/static/ui/assets/handlebars-HMrJBQHh.js renamed to src/main/resources/static/ui/assets/handlebars-DfF58kvI.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/main/resources/static/ui/assets/html-BcFigaeS.js renamed to src/main/resources/static/ui/assets/html-yGZVUWd1.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/main/resources/static/ui/assets/htmlMode-DmNjaFEx.js renamed to src/main/resources/static/ui/assets/htmlMode-H8hidXPj.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)