diff --git a/.gitignore b/.gitignore index 44efcc46..0a8e93ca 100644 --- a/.gitignore +++ b/.gitignore @@ -27,6 +27,7 @@ hgt L.Path.Drag.js leaflet-gesture-handling.css leaflet.nauticscale.js +leaflet.css package-lock.json -!client/bin \ No newline at end of file +!client/bin diff --git a/client/@types/olympus/index.d.ts b/client/@types/olympus/index.d.ts index 61fac735..30f2d79e 100644 --- a/client/@types/olympus/index.d.ts +++ b/client/@types/olympus/index.d.ts @@ -105,6 +105,10 @@ declare module "constants/constants" { export const ROEs: string[]; export const reactionsToThreat: string[]; export const emissionsCountermeasures: string[]; + export const ERAS: { + name: string; + chronologicalOrder: number; + }[]; export const ROEDescriptions: string[]; export const reactionsToThreatDescriptions: string[]; export const emissionsCountermeasuresDescriptions: string[]; @@ -837,6 +841,7 @@ declare module "other/utils" { }): UnitBlueprint | null; export function getMarkerCategoryByName(name: string): "aircraft" | "helicopter" | "groundunit-sam" | "navyunit" | "groundunit-other"; export function getUnitDatabaseByCategory(category: string): import("unit/databases/aircraftdatabase").AircraftDatabase | import("unit/databases/helicopterdatabase").HelicopterDatabase | import("unit/databases/groundunitdatabase").GroundUnitDatabase | import("unit/databases/navyunitdatabase").NavyUnitDatabase | null; + export function getCategoryBlueprintIconSVG(category: string, unitName: string): string | false; export function base64ToBytes(base64: string): ArrayBufferLike; export function enumToState(state: number): string; export function enumToROE(ROE: number): string; @@ -1602,6 +1607,7 @@ declare module "map/map" { import { CoalitionAreaContextMenu } from "contextmenus/coalitionareacontextmenu"; import { AirbaseSpawnContextMenu } from "contextmenus/airbasespawnmenu"; export type MapMarkerVisibilityControl = { + "category"?: string; "image": string; "isProtected"?: boolean; "name": string; @@ -1999,6 +2005,25 @@ declare module "unit/importexport/unitdatafileexport" { showForm(units: Unit[]): void; } } +declare module "schemas/schema" { + import Ajv from "ajv"; + import { AnySchemaObject } from "ajv/dist/core"; + abstract class JSONSchemaValidator { + #private; + constructor(schema: AnySchemaObject); + getAjv(): Ajv; + getCompiledValidator(): any; + getErrors(): any; + getSchema(): AnySchemaObject; + validate(data: any): any; + } + export class AirbasesJSONSchemaValidator extends JSONSchemaValidator { + constructor(); + } + export class ImportFileJSONSchemaValidator extends JSONSchemaValidator { + constructor(); + } +} declare module "unit/importexport/unitdatafileimport" { import { Dialog } from "dialog/dialog"; import { UnitDataFile } from "unit/importexport/unitdatafile"; diff --git a/client/public/stylesheets/leaflet/leaflet.css b/client/public/stylesheets/leaflet/leaflet.css index 1981009f..9ade8dc4 100644 --- a/client/public/stylesheets/leaflet/leaflet.css +++ b/client/public/stylesheets/leaflet/leaflet.css @@ -60,6 +60,11 @@ padding: 0; } +.leaflet-container img.leaflet-tile { + /* See: https://bugs.chromium.org/p/chromium/issues/detail?id=600120 */ + mix-blend-mode: plus-lighter; +} + .leaflet-container.leaflet-touch-zoom { -ms-touch-action: pan-x pan-y; touch-action: pan-x pan-y; @@ -646,7 +651,7 @@ svg.leaflet-image-layer.leaflet-interactive path { } /* Printing */ - + @media print { /* Prevent printers from removing background-images of controls. */ .leaflet-control { diff --git a/client/views/index.ejs b/client/views/index.ejs index 774e38e6..661892bf 100644 --- a/client/views/index.ejs +++ b/client/views/index.ejs @@ -27,6 +27,7 @@ + diff --git a/manager/.vscode/tasks.json b/manager/.vscode/tasks.json index 9732cc95..7e89e91f 100644 --- a/manager/.vscode/tasks.json +++ b/manager/.vscode/tasks.json @@ -6,7 +6,7 @@ { "label": "mirror-package", "type": "shell", - "command": "call ./scripts/mirror-package.bat", + "command": "./scripts/mirror-package.bat", "isBackground": true } ] diff --git a/manager/ejs/connections.ejs b/manager/ejs/connections.ejs index 80fe1869..b4c5aecc 100644 --- a/manager/ejs/connections.ejs +++ b/manager/ejs/connections.ejs @@ -1,67 +1,43 @@ -
-
-
User path
-
Ports and address
-
Passwords
-
<%= install? 'Install': 'Update' %>
-
-
-
- - Accept or modify port settings (optional) - - - If you are installing Olympus locally for Single player use, it's recommended you leave these as default and continue. - If you are installing a dedicated server, then follow the instructions available on the DCS Olympus Wiki. - +
+
+
+ Step <%= instances.length === 1? "3": "4" %> of <%= instances.length === 1? "4": "5" %>
-
+
+ Manually set Olympus port and address settings +
+
+ Please note: you may be required to allow these ports through your firewall and modem/router via port + forwarding.
+ Otherwise, others may not be able to connect to Olympus. +
+
+
+
Client port - +
- "> + " + onchange="signal('onClientPortChanged', this.value)">
Port already in use
-
+
Backend port - +
- "> + " + onchange="signal('onBackendPortChanged', this.value)">
Port already in use @@ -69,25 +45,16 @@
- Backend address - + +
Enable direct backend API connection +
- ">
-
\ No newline at end of file diff --git a/manager/ejs/connectionsType.ejs b/manager/ejs/connectionsType.ejs new file mode 100644 index 00000000..73724f1a --- /dev/null +++ b/manager/ejs/connectionsType.ejs @@ -0,0 +1,25 @@ + +
+
+
+ Step <%= instances.length === 1? "2": "3" %> of <%= instances.length === 1? "4": "5" %> +
+
+ Do you want to set port and address settings? +
+
+ We can automatically set port and address settings for you, or you can set them manually.
+ If you don't have a good understanding of how Olympus works, we recommend the auto apply settings option. +
+
+
+
+ Auto apply settings +
+
+ Manually set +
+
+
diff --git a/manager/ejs/expertsettings.ejs b/manager/ejs/expertsettings.ejs new file mode 100644 index 00000000..ac6e3d0c --- /dev/null +++ b/manager/ejs/expertsettings.ejs @@ -0,0 +1,78 @@ + +
+
+
+ Edit Olympus instance +
+
+ Please note: you may be required to allow these ports through your firewall and modem/router via port forwarding.
+ Otherwise, others may not be able to connect to Olympus. +
+
+
+
+
+ Game Master Password + + "> +
+
+ Blue Commander Password + + "> +
+
+ Red Commander Password + + "> +
+
" style="color: var(--offwhite); font-size: var(--normal); color: var(--lightgray);"> + Note: to keep the old passwords, click Next without editing any value. +
+
+
+
+ Client port + + +
+ " + onchange="signal('onClientPortChanged', this.value)"> + +
+ Port already in use +
+
+
+
+ Backend port + + +
+ " + onchange="signal('onBackendPortChanged', this.value)"> + +
+ Port already in use +
+
+
+
+ +
Enable direct backend API connection + +
+
+
+
+
diff --git a/manager/ejs/folder.ejs b/manager/ejs/folder.ejs new file mode 100644 index 00000000..51f24901 --- /dev/null +++ b/manager/ejs/folder.ejs @@ -0,0 +1,36 @@ + +
+
+ <% if (instances.length > 0) { %> +
+ Step 1 of <%= instances.length === 1? "4": "5" %> +
+
+ Which DCS instance you want to add Olympus to? +
+
+ Olympus is added to DCS instances individually, and will only work for that specific instance.
+ You can have Olympus installed across multiple DCS instances. Re-run in the install wizard to add Olympus to another DCS install. +
+ <% } else { %> + + No DCS installs detected + + + Please ensure you have DCS installed correctly.
+ Olympus cannot be added unless there is a DCS Saved Games folder on your computer.

+ If you are still having issues, try re-installing DCS and Olympus

+ If DCS is installed but Olympus is failing to detect it, you can add it manually.
See the troubleshooting guide for more info.
+
+ <% } %> +
+
+ <% for (var i = 0; i < instances.length; i++) { %> +
+ <%= instances[i].name %> +
+ <% } %> +
+
diff --git a/manager/ejs/installations.ejs b/manager/ejs/installations.ejs deleted file mode 100644 index 550dbc10..00000000 --- a/manager/ejs/installations.ejs +++ /dev/null @@ -1,126 +0,0 @@ - -
-
-
User path
-
Ports and address
-
Passwords
-
Install
-
-
-
- - Select a DCS path to install Olympus to. - - - We have automatically detected the following DCS installations under your Saved Games / DCS folder. - - - Please select which DCS installations you want to add Olympus to. - -
-
-
- <% for (let i = 0; i < instances.length; i++) {%> -
- <%= instances[i].name %> - <%= instances[i].folder %> - - <%= instances[i].installed? (instances[i].error? 'Corrupted/outdated Olympus installation': 'Olympus installed'): 'Olympus not installed' %> - -
- <% } %> -
-
- -
- Cancel installation -
-
-
\ No newline at end of file diff --git a/manager/ejs/instances.ejs b/manager/ejs/instances.ejs index e059c725..a02dae06 100644 --- a/manager/ejs/instances.ejs +++ b/manager/ejs/instances.ejs @@ -1,274 +1,121 @@ -
+
+ <% if (state === 'INSTALL') { %> +
"> +
Olympus installed successfully in + <%= activeInstance !== undefined? activeInstance["name"]: "" %>!
+
+
"> +
An error occurred while installing Olympus in + <%= activeInstance !== undefined? activeInstance["name"]: "" %>
+
+ <% } else if (state === 'EDIT') {%> +
"> +
Olympus settings updated for + <%= activeInstance !== undefined? activeInstance["name"]: "" %>!
+
+
"> +
An error occurred while updating Olympus settings for + <%= activeInstance !== undefined? activeInstance["name"]: "" %>
+
+ <% } else {%> +
"> +
Olympus removed successfully from + <%= activeInstance !== undefined? activeInstance["name"]: "" %>!
+
+
"> +
An error occurred while removing Olympus settings from + <%= activeInstance !== undefined? activeInstance["name"]: "" %>
+
+ <% } %> +
-
- Return to menu -
- - View and manage installs - - - The following Oympus installs have been identified.
You can start an Olympus server, modify settings and uninstall below. -
+ <% if (instances.length > 0) { %> + + View and manage installs + + + The following DCS installations have been identified.
You can start an Olympus server, modify settings and uninstall below. +
+ <% } else { %> + + No DCS installs detected + + + Please ensure you have DCS installed correctly.
+ Olympus cannot be added unless there is a DCS Saved Games folder on your computer.

+ If you are still having issues, try re-installing DCS and Olympus

+ If DCS is installed but Olympus is failing to detect it, you can add it manually.
See the troubleshooting guide for more info.
+
+ <% } %>
-
-
- <% for (let i = 0; i < instances.length; i++) {%> -
-
- <%= instances[i].name %> - - <%= instances[i].installed? (instances[i].error? 'Corrupted/outdated Olympus installation': ''): '' %> - - <%= instances[i].folder %> -
-
ACTIVE
-
OFFLINE
-
CONNECTED
-
DISCONNECTED
-
FPS: 0
-
Load: 0
-
-
-
-
-
Client port
-
<%= instances[i].clientPort %>
-
-
-
Backend port
-
<%= instances[i].backendPort %>
-
-
-
Backend address
-
<%= instances[i].backendAddress %>
-
-
-
-
- Start Olympus -
-
Start server
-
Start client
+ +
+
+ <% for (let i = 0; i < instances.length; i++) {%> +
+
+ <%= instances[i].name %> + + <%= instances[i].folder %> + +
+
ACTIVE
+
OFFLINE
+
CONNECTED
+
DISCONNECTED
+
FPS: 0
+
Load: 0
+
+
+ +
+ + + <%= instances[i].installed? (instances[i].error? 'Corrupted/outdated Olympus installation': 'Olympus installed'): 'Olympus not installed' %> + + +
+
+
Client port
+
<%= instances[i].installed? instances[i].clientPort: "N/A" %>
+
+
+
Backend port
+
<%= instances[i].installed? instances[i].backendPort: "N/A" %>
+
+
+
Backend address
+
<%= instances[i].installed? instances[i].backendAddress: "N/A" %>
+
+
+
+ Start Olympus +
+
Start server
+
Start client
+
+
-
Edit settings
-
Uninstall Olympus
-
Open in browser
-
Stop Olympus
+
Edit settings
+
Install Olympus
+
Uninstall Olympus
+
Open in browser
+
Stop Olympus
+
+
-
- <% } %> + <% } %> +
diff --git a/manager/ejs/menu.ejs b/manager/ejs/menu.ejs index 412c0b15..999fb28c 100644 --- a/manager/ejs/menu.ejs +++ b/manager/ejs/menu.ejs @@ -1,62 +1,55 @@
-
-
DCS OLYMPUS
-
INSTALL WIZARD AND MANAGER
-
Using this manager, you can install Olympus, update settings, and view and manage instances
-
-