This commit is contained in:
MCHost
2025-07-09 17:46:31 -04:00
parent f8632ade7e
commit 1ef09e5015
2 changed files with 10 additions and 14 deletions

View File

@@ -92,15 +92,16 @@ document.getElementById('serverForm').addEventListener('submit', async (e) => {
`).join('')}
`;
// Determine port for widget: use SRV-resolved port if available, else user-provided or default
let widgetPort = port;
if (result.srvPort) {
widgetPort = result.srvPort;
// Use SRV-resolved host and port if available, else user-provided or default
if (host.includes("my-mc.link")){
host = "my-mc.link"
}
let widgetHost = host;
let widgetPort = result.srvPort || port;
// Show widget section and set widget code with static my-mc.link hostname
// Show widget section and set widget code
widgetSection.classList.remove('hidden');
const widgetIframe = `<iframe src="https://my-mc.link/widget/${edition}/my-mc.link/${widgetPort}" width="280" height="145" frameborder="0" scrolling="no"></iframe>`;
const widgetIframe = `<iframe src="https://my-mc.link/widget/${edition}/${widgetHost}/${widgetPort}" width="280" height="145" frameborder="0" scrolling="no"></iframe>`;
widgetCode.textContent = widgetIframe;
} else {
statusContent.innerHTML = `