From f320cb122cf54335772ccb1983e2088a75048412 Mon Sep 17 00:00:00 2001 From: Pax1601 Date: Wed, 31 Jan 2024 12:59:46 +0100 Subject: [PATCH] Finished manager bugfix --- manager/ejs/connections.ejs | 2 +- manager/ejs/connectionsType.ejs | 2 +- manager/ejs/expertsettings.ejs | 6 +- manager/ejs/folder.ejs | 32 +- manager/ejs/instances.ejs | 56 ++-- manager/ejs/menu.ejs | 4 +- manager/ejs/passwords.ejs | 8 +- manager/ejs/result.ejs | 2 +- manager/ejs/settings.ejs | 31 +- manager/ejs/type.ejs | 2 +- manager/ejs/wizard.ejs | 2 +- manager/javascripts/dcsinstance.js | 46 ++- manager/javascripts/manager.js | 460 +++++++++++++++++------------ 13 files changed, 397 insertions(+), 256 deletions(-) diff --git a/manager/ejs/connections.ejs b/manager/ejs/connections.ejs index da915406..b4c5aecc 100644 --- a/manager/ejs/connections.ejs +++ b/manager/ejs/connections.ejs @@ -4,7 +4,7 @@
- Step <%= singleInstance? "3": "4" %> of <%= singleInstance? "4": "5" %> + Step <%= instances.length === 1? "3": "4" %> of <%= instances.length === 1? "4": "5" %>
Manually set Olympus port and address settings diff --git a/manager/ejs/connectionsType.ejs b/manager/ejs/connectionsType.ejs index 9ae0425c..73724f1a 100644 --- a/manager/ejs/connectionsType.ejs +++ b/manager/ejs/connectionsType.ejs @@ -4,7 +4,7 @@
- Step <%= singleInstance? "2": "3" %> of <%= singleInstance? "4": "5" %> + Step <%= instances.length === 1? "2": "3" %> of <%= instances.length === 1? "4": "5" %>
Do you want to set port and address settings? diff --git a/manager/ejs/expertsettings.ejs b/manager/ejs/expertsettings.ejs index 40c50302..ac6e3d0c 100644 --- a/manager/ejs/expertsettings.ejs +++ b/manager/ejs/expertsettings.ejs @@ -19,19 +19,19 @@ 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. diff --git a/manager/ejs/folder.ejs b/manager/ejs/folder.ejs index 714c2d2a..51f24901 100644 --- a/manager/ejs/folder.ejs +++ b/manager/ejs/folder.ejs @@ -3,16 +3,28 @@
-
- Step 1 of <%= singleInstance? "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. -
+ <% 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++) { %> diff --git a/manager/ejs/instances.ejs b/manager/ejs/instances.ejs index ab7a6b45..a02dae06 100644 --- a/manager/ejs/instances.ejs +++ b/manager/ejs/instances.ejs @@ -3,47 +3,57 @@
- <% if (operation === 'INSTALL') { %> -
"> + <% if (state === 'INSTALL') { %> +
">
Olympus installed successfully in - <%= typeof activeInstance !== 'undefined'? activeInstance["name"]: "" %>!
+ <%= activeInstance !== undefined? activeInstance["name"]: "" %>!
-
"> +
">
An error occurred while installing Olympus in - <%= typeof activeInstance !== 'undefined'? activeInstance["name"]: "" %>
+ <%= activeInstance !== undefined? activeInstance["name"]: "" %>
- <% } else if (operation === 'EDIT') {%> -
"> + <% } else if (state === 'EDIT') {%> +
">
Olympus settings updated for - <%= typeof activeInstance !== 'undefined'? activeInstance["name"]: "" %>!
+ <%= activeInstance !== undefined? activeInstance["name"]: "" %>!
-
"> +
">
An error occurred while updating Olympus settings for - <%= typeof activeInstance !== 'undefined'? activeInstance["name"]: "" %>
+ <%= activeInstance !== undefined? activeInstance["name"]: "" %>
<% } else {%> -
"> +
">
Olympus removed successfully from - <%= typeof activeInstance !== 'undefined'? activeInstance["name"]: "" %>!
+ <%= activeInstance !== undefined? activeInstance["name"]: "" %>!
-
"> +
">
An error occurred while removing Olympus settings from - <%= typeof activeInstance !== 'undefined'? activeInstance["name"]: "" %>
+ <%= activeInstance !== undefined? activeInstance["name"]: "" %>
<% } %>
- - View and manage installs - - - The following DCS installations have been identified.
You can start an Olympus server, modify settings and uninstall below. -
-
-
"> - No instances detected! + <% 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++) {%> diff --git a/manager/ejs/menu.ejs b/manager/ejs/menu.ejs index 5c7e444a..999fb28c 100644 --- a/manager/ejs/menu.ejs +++ b/manager/ejs/menu.ejs @@ -84,13 +84,13 @@