Added expert settings mode

This commit is contained in:
Pax1601
2024-01-30 17:45:25 +01:00
parent be625fdca9
commit 21040da195
10 changed files with 341 additions and 161 deletions

View File

@@ -1,31 +1,5 @@
<style>
#connections-page .success,
#connections-page .error {
position: absolute;
left: 320px;
display: flex;
width: 150px;
column-gap: 8px;
}
#connections-page .success {
content: url("./icons/check-solid-green.svg");
height: 20px;
width: 20px;
}
#connections-page .error img {
content: url("./icons/triangle-exclamation-solid.svg");
height: 20px;
width: 20px;
}
#connections-page .error span {
font-weight: 600;
font-size: var(--small);
color: var(--red);
height: fit-content;
}
</style>
<div id="connections-page">
<div class="instructions">
@@ -42,7 +16,7 @@
</div>
</div>
<div class="wizard-inputs">
<div class="input-group client-port">
<div class="input-group client-port port-input">
<span>Client port
<img src="./icons/circle-info-solid.svg"
title="This port is used to allow access to Olympus. Be sure to allow this port through your firewall if you want people to connect remotely">
@@ -56,7 +30,7 @@
</div>
</div>
</div>
<div class="input-group backend-port">
<div class="input-group backend-port port-input">
<span>Backend port
<img src="./icons/circle-info-solid.svg"
title="This port is used by Olympus to communicate with DCS. You only need to allow it through your firewall if you enable direct API connection">

View File

@@ -0,0 +1,78 @@
<style>
#expert-settings .content {
display: flex;
}
</style>
<div id="expert-settings">
<div class="instructions">
<div class="title">
Edit Olympus instance
</div>
<div class="description">
Please note: you may be required to allow these ports through your firewall and modem/router via port forwarding. <br>
Otherwise, others may not be able to connect to Olympus.
</div>
</div>
<div class="content">
<div class="wizard-inputs">
<div class="input-group game-master">
<span>Game Master Password<img src="./icons/circle-info-solid.svg"
title="This password is used to access Olympus as Game Master with full privileges.">
</span>
<input type="password" minlength="8" onchange="signal('onGameMasterPasswordChanged', this.value)">
</div>
<div class="input-group blue-commander">
<span>Blue Commander Password<img src="./icons/circle-info-solid.svg"
title="This password is used to access Olympus as blue coalition Commander.">
</span>
<input type="password" minlength="8" onchange="signal('onBlueCommanderPasswordChanged', this.value)">
</div>
<div class="input-group red-commander">
<span>Red Commander Password<img src="./icons/circle-info-solid.svg"
title="This password is used to access Olympus as red coalition Commander.">
</span>
<input type="password" minlength="8" onchange="signal('onRedCommanderPasswordChanged', this.value)">
</div>
<div class="<%= activeInstance["installed"]? '': 'hide' %>" style="color: var(--offwhite); font-size: var(--normal); color: var(--lightgray);">
Note: to keep the old passwords, click <b>Next</b> without editing any value.
</div>
</div>
<div class="wizard-inputs">
<div class="input-group client-port port-input">
<span>Client port
<img src="./icons/circle-info-solid.svg"
title="This port is used to allow access to Olympus. Be sure to allow this port through your firewall if you want people to connect remotely">
</span>
<div>
<input type="number" min="1024" max="65535" value="<%= activeInstance["clientPort"] %>"
onchange="signal('onClientPortChanged', this.value)">
<img class="success hide">
<div class="error hide">
<img> <span>Port already in use</span>
</div>
</div>
</div>
<div class="input-group backend-port port-input">
<span>Backend port
<img src="./icons/circle-info-solid.svg"
title="This port is used by Olympus to communicate with DCS. You only need to allow it through your firewall if you enable direct API connection">
</span>
<div>
<input type="number" min="1024" max="65535" value="<%= activeInstance["backendPort"] %>"
onchange="signal('onBackendPortChanged', this.value)">
<img class="success hide">
<div class="error hide">
<img> <span>Port already in use</span>
</div>
</div>
</div>
<div class="input-group backend-address">
<span onclick="signal('onEnableAPIClicked')">
<div class="checkbox"></div> Enable direct backend API connection
<img src="./icons/circle-info-solid.svg"
title="Allows services to connect to Olympus directly. This is NOT NEEDED for normal Olympus operation, even for dedicated servers. Leave it unchecked if in doubt.">
</span>
</div>
</div>
</div>
</div>

View File

@@ -3,12 +3,35 @@
</style>
<div class="dashboard">
<div class="result-summary success <%= (typeof activeInstance !== 'undefined' && !activeInstance["error"])? "": "hide" %>">
<div class="title"><img src="./icons/check-solid-background.svg">Olympus settings updated for <i style="margin-left: 3px"><%= typeof activeInstance !== 'undefined'? activeInstance["name"]: "" %></i>!</div>
</div>
<div class="result-summary error <%= (typeof activeInstance !== 'undefined' && activeInstance["error"])? "": "hide" %>">
<div class="title"><img src="./icons/triangle-exclamation-solid-background.svg">An error occurred while updating Olympus settings for <i><%= typeof activeInstance !== 'undefined'? activeInstance["name"]: "" %></i></div>
</div>
<% if (operation === 'INSTALL') { %>
<div class="result-summary success <%= (typeof activeInstance !== 'undefined' && !activeInstance["error"] && activeInstance["installed"])? "": "hide" %>">
<div class="title"><img src="./icons/check-solid-background.svg">Olympus installed successfully in
<i style="margin-left: 3px"><%= typeof activeInstance !== 'undefined'? activeInstance["name"]: "" %></i>!</div>
</div>
<div class="result-summary error <%= (typeof activeInstance !== 'undefined' && (activeInstance["error"] || !activeInstance["installed"]))? "": "hide" %>">
<div class="title"><img src="./icons/triangle-exclamation-solid-background.svg">An error occurred while installing Olympus in
<i style="margin-left: 3px"><%= typeof activeInstance !== 'undefined'? activeInstance["name"]: "" %></i></div>
</div>
<% } else if (operation === 'EDIT') {%>
<div class="result-summary success <%= (typeof activeInstance !== 'undefined' && !activeInstance["error"])? "": "hide" %>">
<div class="title"><img src="./icons/check-solid-background.svg">Olympus settings updated for
<i style="margin-left: 3px"><%= typeof activeInstance !== 'undefined'? activeInstance["name"]: "" %></i>!</div>
</div>
<div class="result-summary error <%= (typeof activeInstance !== 'undefined' && activeInstance["error"])? "": "hide" %>">
<div class="title"><img src="./icons/triangle-exclamation-solid-background.svg">An error occurred while updating Olympus settings for
<i style="margin-left: 3px"><%= typeof activeInstance !== 'undefined'? activeInstance["name"]: "" %></i></div>
</div>
<% } else {%>
<div class="result-summary success <%= (typeof activeInstance !== 'undefined' && !activeInstance["installed"])? "": "hide" %>">
<div class="title"><img src="./icons/check-solid-background.svg">Olympus removed successfully from
<i style="margin-left: 3px"><%= typeof activeInstance !== 'undefined'? activeInstance["name"]: "" %></i>!</div>
</div>
<div class="result-summary error <%= (typeof activeInstance !== 'undefined' && activeInstance["installed"])? "": "hide" %>">
<div class="title"><img src="./icons/triangle-exclamation-solid-background.svg">An error occurred while removing Olympus settings from
<i style="margin-left: 3px"><%= typeof activeInstance !== 'undefined'? activeInstance["name"]: "" %></i></div>
</div>
<% } %>
<div class="content">
<div class="instructions">
<span class="title">

View File

@@ -19,19 +19,19 @@
<span>Game Master Password<img src="./icons/circle-info-solid.svg"
title="This password is used to access Olympus as Game Master with full privileges.">
</span>
<input type="password" minlength="8" onchange="signal('onGameMasterPasswordChanged', this.value)" value="<%= activeInstance["installed"]? 'This is a long string so that users know this is not actually their password. Hi Tony!': '' %>">
<input type="password" minlength="8" onchange="signal('onGameMasterPasswordChanged', this.value)">
</div>
<div class="input-group blue-commander">
<span>Blue Commander Password<img src="./icons/circle-info-solid.svg"
title="This password is used to access Olympus as blue coalition Commander.">
</span>
<input type="password" minlength="8" onchange="signal('onBlueCommanderPasswordChanged', this.value)" value="<%= activeInstance["installed"]? 'This is a long string so that users know this is not actually their password. Hi Tony!': '' %>">
<input type="password" minlength="8" onchange="signal('onBlueCommanderPasswordChanged', this.value)">
</div>
<div class="input-group red-commander">
<span>Red Commander Password<img src="./icons/circle-info-solid.svg"
title="This password is used to access Olympus as red coalition Commander.">
</span>
<input type="password" minlength="8" onchange="signal('onRedCommanderPasswordChanged', this.value)" value="<%= activeInstance["installed"]? 'This is a long string so that users know this is not actually their password. Hi Tony!': '' %>">
<input type="password" minlength="8" onchange="signal('onRedCommanderPasswordChanged', this.value)">
</div>
<div class="<%= activeInstance["installed"]? '': 'hide' %>" style="color: var(--offwhite); font-size: var(--normal); color: var(--lightgray);">
Note: to keep the old passwords, click <b>Next</b> without editing any value.

View File

@@ -5,12 +5,25 @@
<div class="cancel" style="font-size: var(--normal); font-weight: 600; color: var(--offwhite); display: flex; align-items: center; column-gap: 10px; cursor: pointer; text-decoration: underline; " onclick="signal('onCancelClicked')">
<img src="./icons/chevron-left-solid.svg" style=" height: 14px;">Back to menu
</div>
<div class="result-summary success <%= (typeof activeInstance !== 'undefined' && !activeInstance["error"])? "": "hide" %>">
<div class="title"><img src="./icons/check-solid-background.svg">Olympus settings updated for <i style="margin-left: 3px"><%= typeof activeInstance !== 'undefined'? activeInstance["name"]: "" %></i>!</div>
</div>
<div class="result-summary error <%= (typeof activeInstance !== 'undefined' && activeInstance["error"])? "": "hide" %>">
<div class="title"><img src="./icons/triangle-exclamation-solid-background.svg">An error occurred while updating Olympus settings for <i><%= typeof activeInstance !== 'undefined'? activeInstance["name"]: "" %></i></div>
</div>
<% if (operation === 'EDIT') {%>
<div class="result-summary success <%= (typeof activeInstance !== 'undefined' && !activeInstance["error"])? "": "hide" %>">
<div class="title"><img src="./icons/check-solid-background.svg">Olympus settings updated for
<i style="margin-left: 3px"><%= typeof activeInstance !== 'undefined'? activeInstance["name"]: "" %></i>!</div>
</div>
<div class="result-summary error <%= (typeof activeInstance !== 'undefined' && activeInstance["error"])? "": "hide" %>">
<div class="title"><img src="./icons/triangle-exclamation-solid-background.svg">An error occurred while updating Olympus settings for
<i style="margin-left: 3px"><%= typeof activeInstance !== 'undefined'? activeInstance["name"]: "" %></i></div>
</div>
<% } else {%>
<div class="result-summary success <%= (typeof activeInstance !== 'undefined' && !activeInstance["installed"])? "": "hide" %>">
<div class="title"><img src="./icons/check-solid-background.svg">Olympus removed successfully from
<i style="margin-left: 3px"><%= typeof activeInstance !== 'undefined'? activeInstance["name"]: "" %></i>!</div>
</div>
<div class="result-summary error <%= (typeof activeInstance !== 'undefined' && activeInstance["installed"])? "": "hide" %>">
<div class="title"><img src="./icons/triangle-exclamation-solid-background.svg">An error occurred while removing Olympus settings from
<i style="margin-left: 3px"><%= typeof activeInstance !== 'undefined'? activeInstance["name"]: "" %></i></div>
</div>
<% } %>
<div class="content">
<div class="instructions">
<span class="title">

View File

@@ -71,7 +71,7 @@
</style>
<div class="wizard-page">
<div class="cancel" style="font-size: var(--normal); font-weight: 600; color: var(--offwhite); display: flex; align-items: center; column-gap: 10px; cursor: pointer; text-decoration: underline;" onclick="signal('onCancelClicked')">
<img src="./icons/chevron-left-solid.svg" style=" height: 14px;">Cancel install
<img src="./icons/chevron-left-solid.svg" style=" height: 14px;"><%= operation === 'INSTALL'? "Cancel install": "Cancel editing" %>
</div>
<div class="content">