feat(web): unify web entry, preset config, SSE streaming and dual-pane live logs
This commit is contained in:
@@ -17,7 +17,7 @@ public class SettingsService {
|
||||
public SettingsService(OutputFileService outputFileService, SvnPresetService svnPresetService) {
|
||||
this.outputFileService = outputFileService;
|
||||
this.svnPresetService = svnPresetService;
|
||||
this.defaultSvnPresetId = svnPresetService.firstPresetId();
|
||||
this.defaultSvnPresetId = svnPresetService.configuredDefaultPresetId();
|
||||
}
|
||||
|
||||
public Map<String, Object> getSettings() throws IOException {
|
||||
@@ -26,7 +26,7 @@ public class SettingsService {
|
||||
final String activeKey = pickActiveKey(null);
|
||||
|
||||
result.put("apiKeyConfigured", activeKey != null && !activeKey.trim().isEmpty());
|
||||
result.put("apiKeySource", runtimeApiKey != null ? "runtime" : (envKey != null ? "env" : "none"));
|
||||
result.put("apiKeySource", detectApiKeySource(envKey));
|
||||
result.put("outputDir", outputFileService.getOutputRoot().toString());
|
||||
result.put("defaultSvnPresetId", getDefaultSvnPresetId());
|
||||
return result;
|
||||
@@ -58,6 +58,16 @@ public class SettingsService {
|
||||
return null;
|
||||
}
|
||||
|
||||
private String detectApiKeySource(String envKey) {
|
||||
if (runtimeApiKey != null && !runtimeApiKey.trim().isEmpty()) {
|
||||
return "runtime";
|
||||
}
|
||||
if (envKey != null && !envKey.trim().isEmpty()) {
|
||||
return "env";
|
||||
}
|
||||
return "none";
|
||||
}
|
||||
|
||||
public String getDefaultSvnPresetId() {
|
||||
if (svnPresetService.containsPresetId(defaultSvnPresetId)) {
|
||||
return defaultSvnPresetId;
|
||||
|
||||
Reference in New Issue
Block a user