mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
added live tv settings page
This commit is contained in:
parent
e36d514368
commit
8d9823e7a9
3 changed files with 124 additions and 0 deletions
61
dashboard-ui/livetvsettings.html
Normal file
61
dashboard-ui/livetvsettings.html
Normal file
|
@ -0,0 +1,61 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>Live TV</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="liveTvSettingsPage" data-role="page" class="page type-interior liveTvSettingsPage">
|
||||||
|
|
||||||
|
<div data-role="content">
|
||||||
|
<div class="content-primary">
|
||||||
|
<form class="liveTvSettingsForm" style="display: none;">
|
||||||
|
|
||||||
|
<ul data-role="listview" class="ulForm">
|
||||||
|
<li>
|
||||||
|
<label for="selectGuideDays">Number of days of guide data to download: </label>
|
||||||
|
<select id="selectGuideDays">
|
||||||
|
<option value="">Auto</option>
|
||||||
|
<option value="1">1</option>
|
||||||
|
<option value="2">2</option>
|
||||||
|
<option value="3">3</option>
|
||||||
|
<option value="4">4</option>
|
||||||
|
<option value="5">5</option>
|
||||||
|
<option value="6">6</option>
|
||||||
|
<option value="7">7</option>
|
||||||
|
<option value="8">8</option>
|
||||||
|
<option value="9">9</option>
|
||||||
|
<option value="10">10</option>
|
||||||
|
<option value="11">11</option>
|
||||||
|
<option value="12">12</option>
|
||||||
|
<option value="13">13</option>
|
||||||
|
<option value="14">14</option>
|
||||||
|
</select>
|
||||||
|
<div class="fieldDescription">Downloading more days worth of guide data provides the ability to schedule out further in advance and view more listings, but it will also take longer to download. Auto will choose based on the number of channels.</div>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<button type="submit" data-theme="b" data-icon="check">
|
||||||
|
Save
|
||||||
|
</button>
|
||||||
|
<button type="button" onclick="Dashboard.navigate('dashboard.html');" data-icon="delete">
|
||||||
|
Cancel
|
||||||
|
</button>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
</form>
|
||||||
|
<div class="noLiveTvServices" style="display: none;">
|
||||||
|
<div class="readOnlyContent" style="margin-top: 2em;">
|
||||||
|
<p>A Live TV service provider plugin is required in order to continue.</p>
|
||||||
|
|
||||||
|
<p>Please <a href="plugincatalog.html">install</a> one of our available plugins, such as ServerWmc.</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
$('.liveTvSettingsForm').off('submit', LiveTvSettingsPage.onSubmit).on('submit', LiveTvSettingsPage.onSubmit);
|
||||||
|
</script>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
59
dashboard-ui/scripts/livetvsettings.js
Normal file
59
dashboard-ui/scripts/livetvsettings.js
Normal file
|
@ -0,0 +1,59 @@
|
||||||
|
(function ($, document, window) {
|
||||||
|
|
||||||
|
function loadPage(page, config, tvServices) {
|
||||||
|
|
||||||
|
if (tvServices.length) {
|
||||||
|
|
||||||
|
$('.liveTvSettingsForm', page).show();
|
||||||
|
$('.noLiveTvServices', page).hide();
|
||||||
|
|
||||||
|
} else {
|
||||||
|
$('.liveTvSettingsForm', page).hide();
|
||||||
|
$('.noLiveTvServices', page).show();
|
||||||
|
}
|
||||||
|
|
||||||
|
$('#selectGuideDays', page).val(config.LiveTvOptions.GuideDays || '').selectmenu('refresh');
|
||||||
|
|
||||||
|
Dashboard.hideLoadingMsg();
|
||||||
|
}
|
||||||
|
|
||||||
|
$(document).on('pageshow', "#liveTvSettingsPage", function () {
|
||||||
|
|
||||||
|
Dashboard.showLoadingMsg();
|
||||||
|
|
||||||
|
var page = this;
|
||||||
|
|
||||||
|
var promise1 = ApiClient.getServerConfiguration();
|
||||||
|
|
||||||
|
var promise2 = ApiClient.getLiveTvServices();
|
||||||
|
|
||||||
|
$.when(promise1, promise2).done(function (response1, response2) {
|
||||||
|
|
||||||
|
loadPage(page, response1[0], response2[0]);
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
window.LiveTvSettingsPage = {
|
||||||
|
|
||||||
|
onSubmit: function() {
|
||||||
|
|
||||||
|
Dashboard.showLoadingMsg();
|
||||||
|
|
||||||
|
var form = this;
|
||||||
|
|
||||||
|
ApiClient.getServerConfiguration().done(function (config) {
|
||||||
|
|
||||||
|
|
||||||
|
config.LiveTvOptions.GuideDays = $('#selectGuideDays', form).val() || null;
|
||||||
|
|
||||||
|
ApiClient.updateServerConfiguration(config).done(Dashboard.processServerConfigurationUpdateResult);
|
||||||
|
});
|
||||||
|
|
||||||
|
// Disable default form submission
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
})(jQuery, document, window);
|
|
@ -753,6 +753,10 @@ var Dashboard = {
|
||||||
name: "Plugins",
|
name: "Plugins",
|
||||||
href: "plugins.html",
|
href: "plugins.html",
|
||||||
selected: page.hasClass("pluginConfigurationPage")
|
selected: page.hasClass("pluginConfigurationPage")
|
||||||
|
}, {
|
||||||
|
name: "Live TV",
|
||||||
|
href: "livetvsettings.html",
|
||||||
|
selected: page.hasClass("liveTvSettingsPage")
|
||||||
}, {
|
}, {
|
||||||
name: "Users",
|
name: "Users",
|
||||||
divider: true,
|
divider: true,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue