home-assistant-addons/snapcast/data/config.js

19 lines
652 B
JavaScript
Raw Permalink Normal View History

2023-08-08 17:29:03 +00:00
"use strict";
let base_url = window.location.pathname.replace(/\/$/, '');
let config = {
baseUrl: (window.location.protocol === 'https:' ? 'wss://' : 'ws://') + window.location.host + base_url,
};
window.addEventListener("DOMContentLoaded", (event) => {
let mopidy_link = document.createElement('a');
//mopidy_link.href = window.location.protocol + '//' + window.location.host + base_url + '/mobile/';
mopidy_link.href = window.location.protocol + '//' + window.location.hostname + ':6680/mobile/';
mopidy_link.target = '_blank';
mopidy_link.innerHTML = 'Mopidy';
document.getElementById('show').parentNode.appendChild(mopidy_link);
});