Add support for external CDN references

This commit is contained in:
Paulo Gustavo Veiga 2022-01-12 16:09:28 -08:00
parent 451c181fd6
commit 75997b11b3
4 changed files with 13 additions and 10 deletions

View File

@ -36,6 +36,9 @@ public class RequestPropertiesInterceptor extends HandlerInterceptorAdapter {
@Value("${google.recaptcha2.enabled}")
private Boolean recaptcha2Enabled;
@Value("${site.static.js.url}")
private String siteStaticUrl;
@Value("${google.recaptcha2.siteKey}")
private String recaptcha2SiteKey;
@ -61,6 +64,8 @@ public class RequestPropertiesInterceptor extends HandlerInterceptorAdapter {
request.setAttribute("google.recaptcha2.siteKey", recaptcha2SiteKey);
request.setAttribute("site.homepage", siteHomepage);
request.setAttribute("site.static.js.url", siteStaticUrl);
request.setAttribute("security.type", securityType);
// If the property could not be resolved, try to infer one from the request...

View File

@ -98,6 +98,9 @@ admin.user = admin@wisemapping.org
# Site Homepage URL. This will be used as URL for homepage location.
site.homepage = c/home
# Font end static content can be deployed externally to the web app. Uncomment here and specify the url base location.
# site.static.js.url = http://www.example.com/
##################################################################################
# Google Analytics Settings
##################################################################################
@ -137,13 +140,6 @@ security.ldap.auth.attribute=mail
security.ldap.lastName.attribute=sn
security.ldap.firstName.attribute=givenName
# REST Documentation
#
# This properties are used for REST API Documentation( http://localhost:8080/wisemapping/doc/rest/index.html)
# Change the URL for proper documentation console setup.
documentation.services.basePath=http://localhost:8080/service
documentation.services.version=3.0.1

View File

@ -72,7 +72,8 @@
</div>
</c:if>
<script src="loader.js"></script>
<script type="text/javascript" src="<c:out value="${requestScope['site.static.js.url']}"/>loader.js"></script>
</body>
</html>

View File

@ -34,8 +34,9 @@
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<script src="vendors.bundle.js"></script>
<script src="app.bundle.js"></script>
<script type="text/javascript" src="<c:out value="${requestScope['site.static.js.url']}"/>vendors.bundle.js"></script>
<script type="text/javascript" src="<c:out value="${requestScope['site.static.js.url']}"/>app.bundle.js"></script>
</body>
</html>