Enhance XEPG channel mapping and settings management
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -1052,6 +1052,30 @@ function PageReady() {
|
||||
}, 10000);
|
||||
return;
|
||||
}
|
||||
function isClientInfoHttpURL(value) {
|
||||
return /^https?:\/\//i.test(value);
|
||||
}
|
||||
function setClientInfoValue(key, value) {
|
||||
var element = document.getElementById(key);
|
||||
if (element == null) {
|
||||
return;
|
||||
}
|
||||
var textValue = "";
|
||||
if (value != undefined && value != null) {
|
||||
textValue = String(value);
|
||||
}
|
||||
if ((key == "m3u-url" || key == "xepg-url") && isClientInfoHttpURL(textValue)) {
|
||||
element.innerHTML = "";
|
||||
var anchor = document.createElement("A");
|
||||
anchor.href = textValue;
|
||||
anchor.target = "_blank";
|
||||
anchor.rel = "noopener noreferrer";
|
||||
anchor.textContent = textValue;
|
||||
element.appendChild(anchor);
|
||||
return;
|
||||
}
|
||||
element.innerHTML = textValue;
|
||||
}
|
||||
function createLayout() {
|
||||
var contentRegion = document.getElementById("content");
|
||||
if (contentRegion != null) {
|
||||
@@ -1061,9 +1085,7 @@ function createLayout() {
|
||||
var obj = SERVER["clientInfo"];
|
||||
var keys = getObjKeys(obj);
|
||||
for (var i = 0; i < keys.length; i++) {
|
||||
if (document.getElementById(keys[i])) {
|
||||
document.getElementById(keys[i]).innerHTML = obj[keys[i]];
|
||||
}
|
||||
setClientInfoValue(keys[i], obj[keys[i]]);
|
||||
}
|
||||
renderStatusCards();
|
||||
if (!document.getElementById("main-menu")) {
|
||||
|
||||
Reference in New Issue
Block a user