show rendered image
added loading icon image is scaled to available space
This commit is contained in:
@@ -1,14 +1,27 @@
|
||||
package org.lucares.pdbui;
|
||||
|
||||
import java.nio.file.Paths;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
|
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
|
||||
|
||||
@Configuration
|
||||
public class WebConfiguration extends WebMvcConfigurerAdapter {
|
||||
public class WebConfiguration extends WebMvcConfigurerAdapter implements HardcodedValues, PropertyKeys {
|
||||
|
||||
private final String outputDir;
|
||||
|
||||
public WebConfiguration(@Value("${" + PATH_GENERATED_IMAGES + "}") final String outputDir) {
|
||||
this.outputDir = outputDir;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addResourceHandlers(final ResourceHandlerRegistry registry) {
|
||||
registry.addResourceHandler("/img/**").addResourceLocations("file:" + MyWebapp.IMAGE_DIR);
|
||||
|
||||
final String pathPattern = "/" + WEB_IMAGE_OUTPUT_PATH + "/**";
|
||||
final String resourceLocation = "file:" + Paths.get(outputDir).toAbsolutePath() + "/";
|
||||
|
||||
registry.addResourceHandler(pathPattern).addResourceLocations(resourceLocation);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user