mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
update tuners
This commit is contained in:
parent
a2ac684553
commit
7a37be78a6
6 changed files with 269 additions and 47 deletions
|
@ -58,40 +58,6 @@
|
|||
<div class="servicesList">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="noLiveTvServices" style="display: none;">
|
||||
|
||||
<p>${LiveTvPluginRequired}</p>
|
||||
|
||||
<p><a href="plugincatalog.html">${LiveTvPluginRequiredHelp}</a></p>
|
||||
</div>
|
||||
|
||||
<paper-dialog class="dlgAddDevice" entry-animation="fade-in-animation" exit-animation="fade-out-animation" style="height:500px;width:300px;" with-backdrop>
|
||||
<h2>${HeaderAddDevice}</h2>
|
||||
|
||||
<form class="formAddDevice">
|
||||
<div>
|
||||
<div>
|
||||
<label for="selectTunerDeviceType">${LabelType}</label>
|
||||
<select id="selectTunerDeviceType" data-mini="true">
|
||||
<option value="hdhomerun">HD Homerun</option>
|
||||
<option value="m3u">M3U</option>
|
||||
</select>
|
||||
<div class="fieldDescription">${MessageTunerDeviceNotListed}</div>
|
||||
<div class="fieldDescription"><a href="appservices.html?context=livetv">${TabExternalServices}</a></div>
|
||||
</div>
|
||||
<div>
|
||||
<br />
|
||||
<label for="txtDevicePath">${LabelIpAddressPath}</label>
|
||||
<input type="text" id="txtDevicePath" required="required" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="buttons">
|
||||
<paper-button dialog-dismiss>${ButtonCancel}</paper-button>
|
||||
<button data-role="none" type="submit" class="clearButton"><paper-button><span>${ButtonOk}</span></paper-button></button>
|
||||
</div>
|
||||
</form>
|
||||
</paper-dialog>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
49
dashboard-ui/livetvtunerprovider-hdhomerun.html
Normal file
49
dashboard-ui/livetvtunerprovider-hdhomerun.html
Normal file
|
@ -0,0 +1,49 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>${TitleLiveTV}</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="liveTvTunerProviderHdHomerunPage" data-role="page" class="page type-interior liveTvSettingsPage" data-helpurl="https://github.com/MediaBrowser/Wiki/wiki/Live%20TV" data-require="scripts/livetvtunerprovider-hdhomerun">
|
||||
|
||||
<div data-role="content">
|
||||
<div class="content-primary">
|
||||
|
||||
<div data-role="controlgroup" data-type="horizontal" class="localnav" data-mini="true">
|
||||
<a href="livetvstatus.html" data-role="button" class="ui-btn-active">${TabTuners}</a>
|
||||
<a href="livetvsettings.html" data-role="button">${TabSettings}</a>
|
||||
<a href="appservices.html?context=livetv" data-role="button">${TabExternalServices}</a>
|
||||
</div>
|
||||
|
||||
<div class="readOnlyContent" style="margin-top: 2em;">
|
||||
|
||||
<h1>HD Homerun Setup</h1>
|
||||
|
||||
<form>
|
||||
<div>
|
||||
<div>
|
||||
<br />
|
||||
<label for="txtDevicePath">${LabelTunerIpAddress}</label>
|
||||
<input type="text" id="txtDevicePath" required="required" />
|
||||
</div>
|
||||
<div>
|
||||
<br />
|
||||
<label for="chkFavorite">${LabelImportOnlyFavoriteChannels}</label>
|
||||
<input type="checkbox" id="chkFavorite" data-mini="true" />
|
||||
<div class="fieldDescription">${ImportFavoriteChannelsHelp}</div>
|
||||
</div>
|
||||
<br />
|
||||
<div>
|
||||
<button type="submit" data-role="none" class="clearButton">
|
||||
<paper-button raised class="submit block"><iron-icon icon="check"></iron-icon><span>${ButtonSave}</span></paper-button>
|
||||
</button>
|
||||
<paper-button raised class="cancel block btnCancel" onclick="history.back();"><iron-icon icon="close"></iron-icon><span>${ButtonCancel}</span></paper-button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
43
dashboard-ui/livetvtunerprovider-m3u.html
Normal file
43
dashboard-ui/livetvtunerprovider-m3u.html
Normal file
|
@ -0,0 +1,43 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>${TitleLiveTV}</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="liveTvTunerProviderM3UPage" data-role="page" class="page type-interior liveTvSettingsPage" data-helpurl="https://github.com/MediaBrowser/Wiki/wiki/Live%20TV" data-require="scripts/livetvtunerprovider-m3u">
|
||||
|
||||
<div data-role="content">
|
||||
<div class="content-primary">
|
||||
|
||||
<div data-role="controlgroup" data-type="horizontal" class="localnav" data-mini="true">
|
||||
<a href="livetvstatus.html" data-role="button" class="ui-btn-active">${TabTuners}</a>
|
||||
<a href="livetvsettings.html" data-role="button">${TabSettings}</a>
|
||||
<a href="appservices.html?context=livetv" data-role="button">${TabExternalServices}</a>
|
||||
</div>
|
||||
|
||||
<div class="readOnlyContent" style="margin-top: 2em;">
|
||||
|
||||
<h1>M3U Setup</h1>
|
||||
|
||||
<form>
|
||||
<div>
|
||||
<div>
|
||||
<br />
|
||||
<label for="txtDevicePath">${LabelPath}</label>
|
||||
<input type="text" id="txtDevicePath" required="required" />
|
||||
</div>
|
||||
<br />
|
||||
<div>
|
||||
<button type="submit" data-role="none" class="clearButton">
|
||||
<paper-button raised class="submit block"><iron-icon icon="check"></iron-icon><span>${ButtonSave}</span></paper-button>
|
||||
</button>
|
||||
<paper-button raised class="cancel block btnCancel" onclick="history.back();"><iron-icon icon="close"></iron-icon><span>${ButtonCancel}</span></paper-button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
|
@ -143,11 +143,9 @@
|
|||
if (liveTvInfo.IsEnabled) {
|
||||
|
||||
$('.liveTvStatusContent', page).show();
|
||||
$('.noLiveTvServices', page).hide();
|
||||
|
||||
} else {
|
||||
$('.liveTvStatusContent', page).hide();
|
||||
$('.noLiveTvServices', page).show();
|
||||
}
|
||||
|
||||
var servicesToDisplay = liveTvInfo.Services.filter(function (s) {
|
||||
|
@ -192,18 +190,14 @@
|
|||
for (var i = 0, length = devices.length; i < length; i++) {
|
||||
|
||||
var device = devices[i];
|
||||
|
||||
var href = 'livetvtunerprovider-' + device.Type + '.html?id=' + device.Id;
|
||||
|
||||
html += '<li>';
|
||||
html += '<a href="#">';
|
||||
html += '<a href="' + href + '">';
|
||||
|
||||
html += '<h3>';
|
||||
if (device.Type == 'm3u') {
|
||||
html += "M3U";
|
||||
}
|
||||
else if (device.Type == 'hdhomerun') {
|
||||
html += "HD Homerun";
|
||||
} else {
|
||||
html += device.Type;
|
||||
}
|
||||
html += '</h3>';
|
||||
|
||||
html += '<p>';
|
||||
|
@ -396,13 +390,40 @@
|
|||
});
|
||||
}
|
||||
|
||||
function addDevice(button) {
|
||||
|
||||
var menuItems = [];
|
||||
|
||||
menuItems.push({
|
||||
name: 'HD Homerun',
|
||||
id: 'hdhomerun'
|
||||
});
|
||||
|
||||
menuItems.push({
|
||||
name: 'M3U',
|
||||
id: 'm3u'
|
||||
});
|
||||
|
||||
require(['actionsheet'], function () {
|
||||
|
||||
ActionSheetElement.show({
|
||||
items: menuItems,
|
||||
positionTo: button,
|
||||
callback: function (id) {
|
||||
|
||||
Dashboard.navigate('livetvtunerprovider-' + id + '.html');
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
$(document).on('pageinitdepends', "#liveTvStatusPage", function () {
|
||||
|
||||
var page = this;
|
||||
|
||||
$('.btnAddDevice', page).on('click', function () {
|
||||
$('#txtDevicePath', page).val('');
|
||||
page.querySelector('.dlgAddDevice').open();
|
||||
addDevice(this);
|
||||
});
|
||||
|
||||
$('.formAddDevice', page).on('submit', function () {
|
||||
|
|
73
dashboard-ui/scripts/livetvtunerprovider-hdhomerun.js
Normal file
73
dashboard-ui/scripts/livetvtunerprovider-hdhomerun.js
Normal file
|
@ -0,0 +1,73 @@
|
|||
(function ($, document, window) {
|
||||
|
||||
function reload(page, providerId) {
|
||||
|
||||
$('#txtDevicePath', page).val('');
|
||||
$('#chkFavorite', page).checked(false).checkboxradio('refresh');
|
||||
|
||||
if (providerId) {
|
||||
ApiClient.getNamedConfiguration("livetv").done(function (config) {
|
||||
|
||||
var info = config.TunerHosts.filter(function (i) {
|
||||
return i.Id == providerId;
|
||||
})[0];
|
||||
|
||||
$('#txtDevicePath', page).val(info.Url || '');
|
||||
$('#chkFavorite', page).checked(info.ImportFavoritesOnly).checkboxradio('refresh');
|
||||
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function submitForm(page) {
|
||||
|
||||
Dashboard.showLoadingMsg();
|
||||
|
||||
var info = {
|
||||
Type: 'hdhomerun',
|
||||
Url: $('#txtDevicePath', page).val(),
|
||||
ImportFavoritesOnly: $('#chkFavorite', page).checked()
|
||||
};
|
||||
|
||||
var id = getParameterByName('id');
|
||||
|
||||
if (id) {
|
||||
info.Id = id;
|
||||
}
|
||||
|
||||
ApiClient.ajax({
|
||||
type: "POST",
|
||||
url: ApiClient.getUrl('LiveTv/TunerHosts'),
|
||||
data: JSON.stringify(info),
|
||||
contentType: "application/json"
|
||||
|
||||
}).done(function (result) {
|
||||
|
||||
Dashboard.processServerConfigurationUpdateResult();
|
||||
Dashboard.navigate('livetvstatus.html');
|
||||
|
||||
}).fail(function () {
|
||||
Dashboard.alert({
|
||||
message: Globalize.translate('ErrorSavingTvProvider')
|
||||
});
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
$(document).on('pageinitdepends', "#liveTvTunerProviderHdHomerunPage", function () {
|
||||
|
||||
var page = this;
|
||||
|
||||
$('form', page).on('submit', function () {
|
||||
submitForm(page);
|
||||
return false;
|
||||
});
|
||||
|
||||
}).on('pageshowready', "#liveTvTunerProviderHdHomerunPage", function () {
|
||||
|
||||
var providerId = getParameterByName('id');
|
||||
var page = this;
|
||||
reload(page, providerId);
|
||||
});
|
||||
|
||||
})(jQuery, document, window);
|
70
dashboard-ui/scripts/livetvtunerprovider-m3u.js
Normal file
70
dashboard-ui/scripts/livetvtunerprovider-m3u.js
Normal file
|
@ -0,0 +1,70 @@
|
|||
(function ($, document, window) {
|
||||
|
||||
function reload(page, providerId) {
|
||||
|
||||
$('#txtDevicePath', page).val('');
|
||||
|
||||
if (providerId) {
|
||||
ApiClient.getNamedConfiguration("livetv").done(function (config) {
|
||||
|
||||
var info = config.TunerHosts.filter(function (i) {
|
||||
return i.Id == providerId;
|
||||
})[0];
|
||||
|
||||
$('#txtDevicePath', page).val(info.Url || '');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function submitForm(page) {
|
||||
|
||||
Dashboard.showLoadingMsg();
|
||||
|
||||
var info = {
|
||||
Type: 'm3u',
|
||||
Url: $('#txtDevicePath', page).val(),
|
||||
ImportFavoritesOnly: $('#chkFavorite', page).checked()
|
||||
};
|
||||
|
||||
var id = getParameterByName('id');
|
||||
|
||||
if (id) {
|
||||
info.Id = id;
|
||||
}
|
||||
|
||||
ApiClient.ajax({
|
||||
type: "POST",
|
||||
url: ApiClient.getUrl('LiveTv/TunerHosts'),
|
||||
data: JSON.stringify(info),
|
||||
contentType: "application/json"
|
||||
|
||||
}).done(function (result) {
|
||||
|
||||
Dashboard.processServerConfigurationUpdateResult();
|
||||
Dashboard.navigate('livetvstatus.html');
|
||||
|
||||
}).fail(function () {
|
||||
Dashboard.alert({
|
||||
message: Globalize.translate('ErrorSavingTvProvider')
|
||||
});
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
$(document).on('pageinitdepends', "#liveTvTunerProviderM3UPage", function () {
|
||||
|
||||
var page = this;
|
||||
|
||||
$('form', page).on('submit', function () {
|
||||
submitForm(page);
|
||||
return false;
|
||||
});
|
||||
|
||||
}).on('pageshowready', "#liveTvTunerProviderM3UPage", function () {
|
||||
|
||||
var providerId = getParameterByName('id');
|
||||
var page = this;
|
||||
reload(page, providerId);
|
||||
});
|
||||
|
||||
})(jQuery, document, window);
|
Loading…
Add table
Add a link
Reference in a new issue