aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael DÜrre <michael.duerre@highstreet-technologies.com>2021-09-23 10:03:55 +0200
committerKAPIL SINGAL <ks220y@att.com>2021-09-23 15:37:50 +0000
commit7026ae7ee48c51e2a53d00dc7b82c41eba6b0ad2 (patch)
tree34feff14a5bb93b923c0d4ca5dcab5ed8caa0e0e
parentafdde68bee53e76c79641ed1cdca4eb0b50b8f2a (diff)
fix odlux logo loading
add override for logo load Issue-ID: CCSDK-3442 Signed-off-by: Michael DÜrre <michael.duerre@highstreet-technologies.com> Change-Id: Ie1f130459ac72f16ebcc3227fad122b5ac418651 Signed-off-by: Michael DÜrre <michael.duerre@highstreet-technologies.com>
-rw-r--r--sdnr/wt/odlux/core/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/odlux/IndexOdluxBundle.java7
-rw-r--r--sdnr/wt/odlux/core/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/odlux/ResFilesServlet.java16
-rw-r--r--sdnr/wt/odlux/framework/webpack.config.js5
3 files changed, 20 insertions, 8 deletions
diff --git a/sdnr/wt/odlux/core/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/odlux/IndexOdluxBundle.java b/sdnr/wt/odlux/core/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/odlux/IndexOdluxBundle.java
index 82df2f0cd..c58259c87 100644
--- a/sdnr/wt/odlux/core/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/odlux/IndexOdluxBundle.java
+++ b/sdnr/wt/odlux/core/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/odlux/IndexOdluxBundle.java
@@ -141,11 +141,10 @@ public class IndexOdluxBundle extends OdluxBundle implements OdluxBundleResource
StringBuilder sb = new StringBuilder();
sb.append(String.format("{\"authentication\":\"%s\",\"enablePolicy\":%s", this.oauthEnabled ? "oauth" : "basic",
String.valueOf(this.policyEnabled)));
- if (this.transportPceGuiUrl != null && this.transportPceGuiUrl.length() > 0) {
- sb.append(String.format(",\"transportpceUrl\":\"%s\"}", this.transportPceGuiUrl));
- } else {
- sb.append("}");
+ if (this.transportPceGuiUrl != null && !this.transportPceGuiUrl.isBlank()) {
+ sb.append(String.format(",\"transportpceUrl\":\"%s\"", this.transportPceGuiUrl));
}
+ sb.append("}");
return sb.toString();
}
diff --git a/sdnr/wt/odlux/core/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/odlux/ResFilesServlet.java b/sdnr/wt/odlux/core/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/odlux/ResFilesServlet.java
index 62e73ef1d..a3f8dd7f6 100644
--- a/sdnr/wt/odlux/core/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/odlux/ResFilesServlet.java
+++ b/sdnr/wt/odlux/core/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/odlux/ResFilesServlet.java
@@ -17,6 +17,8 @@
*/
package org.onap.ccsdk.features.sdnr.wt.odlux;
+import com.google.common.io.Files;
+import java.io.File;
import java.io.IOException;
import java.io.OutputStream;
import java.net.HttpURLConnection;
@@ -31,8 +33,9 @@ import org.slf4j.LoggerFactory;
public class ResFilesServlet extends HttpServlet {
private static final long serialVersionUID = -6807215213921798293L;
- private static Logger LOG = LoggerFactory.getLogger(ResFilesServlet.class);
-
+ private static final Logger LOG = LoggerFactory.getLogger(ResFilesServlet.class);
+ private static final String LOGO_OVERWRITE_FILENAME = "etc/logo.gif";
+ private static final String LOGO_URL="/odlux/images/onapLogo.gif";
private final IndexOdluxBundle indexBundle;
@@ -47,6 +50,15 @@ public class ResFilesServlet extends HttpServlet {
final String fn = req.getRequestURI();
LOG.debug("Get request with for URI: {}", fn);
+ if(LOGO_URL.equals(fn)) {
+ File f = new File(LOGO_OVERWRITE_FILENAME);
+ if(f.exists()) {
+ resp.setStatus(HttpURLConnection.HTTP_OK);
+ resp.setContentType("image/gif");
+ Files.copy(f, resp.getOutputStream());
+ return;
+ }
+ }
OdluxBundleLoader odluxBundleLoader = OdluxBundleLoaderImpl.getInstance();
if (odluxBundleLoader != null) {
String fileContent = odluxBundleLoader.getResourceContent(fn, indexBundle);
diff --git a/sdnr/wt/odlux/framework/webpack.config.js b/sdnr/wt/odlux/framework/webpack.config.js
index b5d31c262..cef310136 100644
--- a/sdnr/wt/odlux/framework/webpack.config.js
+++ b/sdnr/wt/odlux/framework/webpack.config.js
@@ -83,12 +83,13 @@ module.exports = (env) => {
loader: "babel-loader"
}]
}, {
+ //don't minify images
test: /\.(png|gif|jpg|svg)$/,
use: [{
loader: 'url-loader',
options: {
- limit: 10000,
- name: './images/[hash].[ext]'
+ limit: 10,
+ name: './images/[name].[ext]'
}
}]
}]