feat: added ability to change and check SRS port in manager

This commit is contained in:
Davide Passoni
2025-03-07 16:14:42 +01:00
parent 42cfb36c04
commit be879e3660
6 changed files with 32 additions and 0 deletions

View File

@@ -150,6 +150,7 @@ class DCSInstance {
blueCommanderPasswordEdited = false;
redCommanderPasswordEdited = false;
autoconnectWhenLocal = false;
SRSPort = 5002;
constructor(folder) {
this.folder = folder;
@@ -186,6 +187,7 @@ class DCSInstance {
this.backendAddress = config["backend"]["address"];
this.gameMasterPasswordHash = config["authentication"]["gameMasterPassword"];
this.autoconnectWhenLocal = config["frontend"]["autoconnectWhenLocal"];
this.SRSPort = config["audio"]["SRSPort"];
this.gameMasterPasswordEdited = false;
this.blueCommanderPasswordEdited = false;

View File

@@ -164,6 +164,7 @@ async function applyConfiguration(folder, instance) {
config["frontend"]["autoconnectWhenLocal"] = instance.autoconnectWhenLocal;
config["backend"]["port"] = instance.backendPort;
config["backend"]["address"] = instance.backendAddress;
config["audio"]["SRSPort"] = instance.SRSPort;
if (instance.gameMasterPassword !== "")
config["authentication"]["gameMasterPassword"] = sha256(instance.gameMasterPassword);

View File

@@ -517,6 +517,11 @@ class Manager {
this.setPort('backend', Number(value));
}
/* When the srs port input value is changed */
async onSRSPortChanged(value) {
this.getActiveInstance().SRSPort = Number(value);
}
/* When the "Enable API connection" checkbox is clicked */
async onEnableAPIClicked() {
if (this.getActiveInstance()) {