Skip to content

Commit

Permalink
feat: Added info about the used weasyprint service version
Browse files Browse the repository at this point in the history
Refs: #104
  • Loading branch information
pbezliapovich committed Jul 31, 2024
1 parent cd471fe commit 3f43754
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,4 @@ public class ConfigurationInternalController {
public @NotNull ConfigurationStatus checkWeasyPrint() {
return ConfigurationStatusUtils.getWeasyPrintStatus();
}

@GET
@Produces(MediaType.APPLICATION_JSON)
@Path("/configuration/weasyprint-service-version")
@Operation(summary = "Checks WeasyPrint Service configuration")
public @NotNull ConfigurationStatus checkWeasyPrintServiceVersion() {
return ConfigurationStatusUtils.getWeasyPrintStatus();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ public class ConfigurationStatusUtils {
try {
HtmlToPdfConverter htmlToPdfConverter = new HtmlToPdfConverter();
WeasyPrintConverter weasyPrintConverter = htmlToPdfConverter.getWeasyPrintConverter();
if (weasyPrintConverter instanceof WeasyPrintServiceConnector) {
ModuleDescriptor.Version weasyPrintServiceVersion = ((WeasyPrintServiceConnector) weasyPrintConverter).getWeasyPrintServiceVersion();
if (weasyPrintConverter instanceof WeasyPrintServiceConnector weasyPrintServiceConnector) {
ModuleDescriptor.Version weasyPrintServiceVersion = weasyPrintServiceConnector.getWeasyPrintServiceVersion();
return new ConfigurationStatus(Status.OK, "Version: %s".formatted(weasyPrintServiceVersion.toString()));
} else {
return new ConfigurationStatus(Status.WARNING, "WeasyPrint Service not configured");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public ModuleDescriptor.Version getWeasyPrintVersion() {
}

public ModuleDescriptor.Version getWeasyPrintServiceVersion() {
return ModuleDescriptor.Version.parse(getWeasyPrintInfo().getWeasyprintServiceVersion());
return ModuleDescriptor.Version.parse(getWeasyPrintInfo().getWeasyprintService());
}

private WeasyPrintServiceInfo getWeasyPrintInfo() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
public class WeasyPrintServiceInfo {
private String python;
private String weasyprint;
private String weasyprintServiceVersion;
private String weasyprintService;
}

0 comments on commit 3f43754

Please sign in to comment.