mirror of
https://github.com/Pax1601/DCSOlympus.git
synced 2025-10-29 16:56:34 +00:00
Added automatic removal of vite proxy
This commit is contained in:
parent
36478f26d5
commit
b3f8eb96ad
@ -158,7 +158,7 @@ export class OlympusApp {
|
||||
this.#weaponsManager = new WeaponsManager();
|
||||
|
||||
/* Set the address of the server */
|
||||
this.getServerManager().setAddress(window.location.href.split('?')[0]);
|
||||
this.getServerManager().setAddress(window.location.href.split('?')[0].replace("vite/", ""));
|
||||
|
||||
/* Setup all global events */
|
||||
this.#setupEvents();
|
||||
@ -181,7 +181,7 @@ export class OlympusApp {
|
||||
})
|
||||
|
||||
/* Load the config file from the server */
|
||||
const configRequest = new Request(window.location.href.split('?')[0] + "resources/config");
|
||||
const configRequest = new Request(window.location.href.split('?')[0].replace("vite/", "") + "resources/config");
|
||||
fetch(configRequest).then((response) => {
|
||||
if (response.status === 200) {
|
||||
return response.json();
|
||||
|
||||
@ -117,7 +117,7 @@ export class ServerManager {
|
||||
|
||||
getConfig(callback: CallableFunction) {
|
||||
var xmlHttp = new XMLHttpRequest();
|
||||
xmlHttp.open("GET", window.location.href.split('?')[0] + "config", true);
|
||||
xmlHttp.open("GET", window.location.href.split('?')[0].replace("vite/", "") + "config", true);
|
||||
xmlHttp.onload = function (e) {
|
||||
var data = JSON.parse(xmlHttp.responseText);
|
||||
callback(data);
|
||||
|
||||
@ -4,7 +4,7 @@ import { UnitDatabase } from "./unitdatabase"
|
||||
|
||||
export class AircraftDatabase extends UnitDatabase {
|
||||
constructor() {
|
||||
super(window.location.href.split('?')[0] + 'api/databases/units/aircraftdatabase');
|
||||
super(window.location.href.split('?')[0].replace("vite/", "") + 'api/databases/units/aircraftdatabase');
|
||||
}
|
||||
|
||||
getCategory() {
|
||||
|
||||
@ -4,7 +4,7 @@ import { UnitDatabase } from "./unitdatabase"
|
||||
|
||||
export class GroundUnitDatabase extends UnitDatabase {
|
||||
constructor() {
|
||||
super(window.location.href.split('?')[0] + 'api/databases/units/groundunitdatabase');
|
||||
super(window.location.href.split('?')[0].replace("vite/", "") + 'api/databases/units/groundunitdatabase');
|
||||
}
|
||||
|
||||
getSpawnPointsByName(name: string) {
|
||||
|
||||
@ -4,7 +4,7 @@ import { UnitDatabase } from "./unitdatabase"
|
||||
|
||||
export class HelicopterDatabase extends UnitDatabase {
|
||||
constructor() {
|
||||
super(window.location.href.split('?')[0] + 'api/databases/units/helicopterdatabase');
|
||||
super(window.location.href.split('?')[0].replace("vite/", "") + 'api/databases/units/helicopterdatabase');
|
||||
}
|
||||
|
||||
getSpawnPointsByName(name: string) {
|
||||
|
||||
@ -4,7 +4,7 @@ import { UnitDatabase } from "./unitdatabase"
|
||||
|
||||
export class NavyUnitDatabase extends UnitDatabase {
|
||||
constructor() {
|
||||
super(window.location.href.split('?')[0] + 'api/databases/units/navyunitdatabase');
|
||||
super(window.location.href.split('?')[0].replace("vite/", "") + 'api/databases/units/navyunitdatabase');
|
||||
}
|
||||
|
||||
getSpawnPointsByName(name: string) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user