use whatever port the app is running on for ajax requests

This commit is contained in:
2020-04-05 15:25:27 +00:00
parent 7d1927bcbf
commit 03accc1828
3 changed files with 7 additions and 7 deletions

View File

@@ -266,8 +266,8 @@ export class GalleryViewComponent implements OnInit {
that.progress = 100 * (that.totalNumberImages - that.splitByValuesQueue.length) / that.totalNumberImages; that.progress = 100 * (that.totalNumberImages - that.splitByValuesQueue.length) / that.totalNumberImages;
plotResponse.thumbnailUrl = "http://"+window.location.hostname+':17333/'+plotResponse.thumbnailUrl; plotResponse.thumbnailUrl = "http://"+window.location.hostname+':'+window.location.port+'/'+plotResponse.thumbnailUrl;
plotResponse.imageUrl = "http://"+window.location.hostname+':17333/'+plotResponse.imageUrl; plotResponse.imageUrl = "http://"+window.location.hostname+':'+window.location.port+'/'+plotResponse.imageUrl;
let galleryItem = new GalleryItem(splitByValue, plotResponse); let galleryItem = new GalleryItem(splitByValue, plotResponse);
that.galleryItems.push(galleryItem); that.galleryItems.push(galleryItem);
that.sortAndFilterGallery(); that.sortAndFilterGallery();

View File

@@ -40,7 +40,7 @@ export class PlotService {
} }
getTagFields(): Observable<Array<string>> { getTagFields(): Observable<Array<string>> {
return this.http.get<Array<string>>('//'+window.location.hostname+':17333/fields'); return this.http.get<Array<string>>('//'+window.location.hostname+':'+window.location.port+'/fields');
} }
autocomplete(query: string, caretIndex: number, resultMode: ResultMode): Observable<AutocompleteResult> autocomplete(query: string, caretIndex: number, resultMode: ResultMode): Observable<AutocompleteResult>
@@ -51,17 +51,17 @@ export class PlotService {
.set('query', query) .set('query', query)
.set('resultMode', resultMode) .set('resultMode', resultMode)
}; };
return this.http.get<AutocompleteResult>('//'+window.location.hostname+':17333/autocomplete', options); return this.http.get<AutocompleteResult>('//'+window.location.hostname+':'+window.location.port+'/autocomplete', options);
} }
sendPlotRequest(plotRequest: PlotRequest): Observable<PlotResponse>{ sendPlotRequest(plotRequest: PlotRequest): Observable<PlotResponse>{
//console.log("send plot request: "+ JSON.stringify(plotRequest)); //console.log("send plot request: "+ JSON.stringify(plotRequest));
return this.http.post<PlotResponse>('//'+window.location.hostname+':17333/plots', plotRequest); return this.http.post<PlotResponse>('//'+window.location.hostname+':'+window.location.port+'/plots', plotRequest);
} }
getFilterDefaults(): Observable<FilterDefaults>{ getFilterDefaults(): Observable<FilterDefaults>{
return this.http.get<FilterDefaults>('//'+window.location.hostname+':17333/filters/defaults') return this.http.get<FilterDefaults>('//'+window.location.hostname+':'+window.location.port+'/filters/defaults')
} }
splitQuery(query: string, splitBy:string) : Observable<Array<string>>{ splitQuery(query: string, splitBy:string) : Observable<Array<string>>{

View File

@@ -140,7 +140,7 @@ export class VisualizationPageComponent implements OnInit {
this.plotService.sendPlotRequest(request).subscribe(function(plotResponse){ this.plotService.sendPlotRequest(request).subscribe(function(plotResponse){
console.log("response: " + JSON.stringify(plotResponse)); console.log("response: " + JSON.stringify(plotResponse));
that.plotView.imageUrl = "http://"+window.location.hostname+':17333/'+plotResponse.imageUrl; that.plotView.imageUrl = "http://"+window.location.hostname+':'+window.location.port+'/'+plotResponse.imageUrl;
document.dispatchEvent(new Event("invadersPause", {})); document.dispatchEvent(new Event("invadersPause", {}));
}, },
error => { error => {