From ec4f445b8d438dcf38a6203ded9c6ea387eef7bf Mon Sep 17 00:00:00 2001 From: Andreas Huber Date: Thu, 12 Mar 2020 19:54:13 +0100 Subject: [PATCH] use port 17333 by default Not sure how this is supposed to work. To be able to support Angular's development server and Spring as a standalone application I had to hardcode the port Spring uses. The problem is, that Angular runs on port 4200. Angular is compiled to static files. So I cannot dynamically add the port that is configured for Spring. But Angular has to be able to talk to the Spring application. I chose port 17333, because it does not collide with the standard Tomcat port (8080). --- pdb-js/src/app/gallery-view/gallery-view.component.ts | 4 ++-- pdb-js/src/app/plot.service.ts | 8 ++++---- .../visualization-page/visualization-page.component.ts | 2 +- pdb-ui/src/main/resources/application-prod.properties | 1 - pdb-ui/src/main/resources/application.properties | 8 +++++++- 5 files changed, 14 insertions(+), 9 deletions(-) diff --git a/pdb-js/src/app/gallery-view/gallery-view.component.ts b/pdb-js/src/app/gallery-view/gallery-view.component.ts index 9c4a80e..c316cd2 100644 --- a/pdb-js/src/app/gallery-view/gallery-view.component.ts +++ b/pdb-js/src/app/gallery-view/gallery-view.component.ts @@ -266,8 +266,8 @@ export class GalleryViewComponent implements OnInit { that.progress = 100 * (that.totalNumberImages - that.splitByValuesQueue.length) / that.totalNumberImages; - plotResponse.thumbnailUrl = "http://"+window.location.hostname+':8080/'+plotResponse.thumbnailUrl; - plotResponse.imageUrl = "http://"+window.location.hostname+':8080/'+plotResponse.imageUrl; + plotResponse.thumbnailUrl = "http://"+window.location.hostname+':17333/'+plotResponse.thumbnailUrl; + plotResponse.imageUrl = "http://"+window.location.hostname+':17333/'+plotResponse.imageUrl; let galleryItem = new GalleryItem(splitByValue, plotResponse); that.galleryItems.push(galleryItem); that.sortAndFilterGallery(); diff --git a/pdb-js/src/app/plot.service.ts b/pdb-js/src/app/plot.service.ts index 3fc2774..82646c9 100644 --- a/pdb-js/src/app/plot.service.ts +++ b/pdb-js/src/app/plot.service.ts @@ -40,7 +40,7 @@ export class PlotService { } getTagFields(): Observable> { - return this.http.get>('//'+window.location.hostname+':8080/fields'); + return this.http.get>('//'+window.location.hostname+':17333/fields'); } autocomplete(query: string, caretIndex: number, resultMode: ResultMode): Observable @@ -51,17 +51,17 @@ export class PlotService { .set('query', query) .set('resultMode', resultMode) }; - return this.http.get('//'+window.location.hostname+':8080/autocomplete', options); + return this.http.get('//'+window.location.hostname+':17333/autocomplete', options); } sendPlotRequest(plotRequest: PlotRequest): Observable{ //console.log("send plot request: "+ JSON.stringify(plotRequest)); - return this.http.post('//'+window.location.hostname+':8080/plots', plotRequest); + return this.http.post('//'+window.location.hostname+':17333/plots', plotRequest); } getFilterDefaults(): Observable{ - return this.http.get('//'+window.location.hostname+':8080/filters/defaults') + return this.http.get('//'+window.location.hostname+':17333/filters/defaults') } splitQuery(query: string, splitBy:string) : Observable>{ diff --git a/pdb-js/src/app/visualization-page/visualization-page.component.ts b/pdb-js/src/app/visualization-page/visualization-page.component.ts index e22d03d..e655b84 100644 --- a/pdb-js/src/app/visualization-page/visualization-page.component.ts +++ b/pdb-js/src/app/visualization-page/visualization-page.component.ts @@ -133,7 +133,7 @@ export class VisualizationPageComponent implements OnInit { this.plotService.sendPlotRequest(request).subscribe(function(plotResponse){ console.log("response: " + JSON.stringify(plotResponse)); - that.plotView.imageUrl = "http://"+window.location.hostname+':8080/'+plotResponse.imageUrl; + that.plotView.imageUrl = "http://"+window.location.hostname+':17333/'+plotResponse.imageUrl; document.dispatchEvent(new Event("invadersPause", {})); }, error => { diff --git a/pdb-ui/src/main/resources/application-prod.properties b/pdb-ui/src/main/resources/application-prod.properties index 1e419c9..05342d3 100644 --- a/pdb-ui/src/main/resources/application-prod.properties +++ b/pdb-ui/src/main/resources/application-prod.properties @@ -1,5 +1,4 @@ #db.base=D:/ws/pdb/dataNew db.base=C:/pdb/dataNew -server.port=17333 gnuplot.home=D:/ws/pdb/gnuplot-5.2 cache.images.duration.seconds=86400 \ No newline at end of file diff --git a/pdb-ui/src/main/resources/application.properties b/pdb-ui/src/main/resources/application.properties index 41f8de7..72e2f75 100644 --- a/pdb-ui/src/main/resources/application.properties +++ b/pdb-ui/src/main/resources/application.properties @@ -6,7 +6,13 @@ path.output=${base.dir}/out logging.config=classpath:log4j2.xml - +server.port=17333 spring.servlet.multipart.max-file-size=3000MB spring.servlet.multipart.max-request-size=3000MB + + +#spring.resources.cache.cachecontrol.cache-private=true +#spring.resources.cache.cachecontrol.must-revalidate=true +#spring.resources.cache.cachecontrol.max-age=31536000 +#spring.resources.static-locations=classpath:/static/ \ No newline at end of file