Added setting for 'address' and 'port'

This commit is contained in:
nutty
2026-07-01 09:43:29 +10:00
parent 2a7c1f3dbd
commit 15e5f91f01
2 changed files with 20 additions and 1 deletions
+4 -1
View File
@@ -22,6 +22,9 @@ const mainContainer = document.getElementById('main-container');
// OPTIONS // // OPTIONS //
///////////// /////////////
const smtcBridgeAddress = urlParams.get('smtcBridgeAddress') || '127.0.0.1';
const smtcBridgePort = urlParams.get('smtcBridgePort') || '5000';
const theme = urlParams.get('theme') || 'standard'; const theme = urlParams.get('theme') || 'standard';
const font = urlParams.get("font") || ""; const font = urlParams.get("font") || "";
const fontSize = GetIntParam("fontSize", 20); const fontSize = GetIntParam("fontSize", 20);
@@ -147,7 +150,7 @@ LoadTheme();
async function FetchMedia() { async function FetchMedia() {
try { try {
const response = await fetch('http://localhost:5000/now-playing'); const response = await fetch(`http://${smtcBridgeAddress}:${smtcBridgePort}/now-playing`);
const data = await response.json(); const data = await response.json();
// Remove the SMTC Bridge popup if it's on screen // Remove the SMTC Bridge popup if it's on screen
+16
View File
@@ -221,6 +221,22 @@
], ],
"defaultValue": "slide-out-bottom", "defaultValue": "slide-out-bottom",
"group": "General" "group": "General"
},
{
"id": "smtcBridgeAddress",
"label": "Address",
"description": "",
"type": "text",
"defaultValue": "127.0.0.1",
"group": "SMTC Bridge"
},
{
"id": "smtcBridgePort",
"label": "Port",
"description": "",
"type": "text",
"defaultValue": "5000",
"group": "SMTC Bridge"
} }
] ]
} }