mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
add tuner setup to startup wizard
This commit is contained in:
parent
5f0a0abec5
commit
c51d10dbc6
7 changed files with 147 additions and 15 deletions
86
dashboard-ui/scripts/wizardlivetvtuner.js
Normal file
86
dashboard-ui/scripts/wizardlivetvtuner.js
Normal file
|
@ -0,0 +1,86 @@
|
|||
(function ($, document) {
|
||||
|
||||
function save(page) {
|
||||
|
||||
Dashboard.showLoadingMsg();
|
||||
|
||||
var apiClient = ApiClient;
|
||||
|
||||
// After saving chapter task, now save server config
|
||||
apiClient.getJSON(apiClient.getUrl('Startup/Configuration')).done(function (config) {
|
||||
|
||||
config.LiveTvTunerType = $('#selectTunerType', page).val();
|
||||
config.LiveTvTunerPath = $('.txtDevicePath', page).val();
|
||||
|
||||
apiClient.ajax({
|
||||
|
||||
type: 'POST',
|
||||
data: config,
|
||||
url: apiClient.getUrl('Startup/Configuration')
|
||||
|
||||
}).done(function () {
|
||||
|
||||
Dashboard.hideLoadingMsg();
|
||||
navigateToNextPage();
|
||||
});
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
function reload(page) {
|
||||
|
||||
Dashboard.showLoadingMsg();
|
||||
|
||||
var apiClient = ApiClient;
|
||||
|
||||
apiClient.getJSON(apiClient.getUrl('Startup/Configuration')).done(function (config) {
|
||||
|
||||
$('#selectTunerType', page).val(config.LiveTvTunerType || '').selectmenu("refresh");
|
||||
page.querySelector('.txtDevicePath').value = config.LiveTvTunerPath || '';
|
||||
|
||||
Dashboard.hideLoadingMsg();
|
||||
});
|
||||
}
|
||||
|
||||
function navigateToNextPage() {
|
||||
skip();
|
||||
}
|
||||
|
||||
function skip() {
|
||||
var apiClient = ApiClient;
|
||||
|
||||
apiClient.getJSON(apiClient.getUrl('Startup/Info')).done(function (info) {
|
||||
|
||||
if (info.SupportsRunningAsService) {
|
||||
Dashboard.navigate('wizardservice.html');
|
||||
|
||||
} else {
|
||||
Dashboard.navigate('wizardagreement.html');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function onSubmit() {
|
||||
var form = this;
|
||||
|
||||
save(form);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
$(document).on('pageinitdepends', "#wizardTunerPage", function () {
|
||||
|
||||
var page = this;
|
||||
|
||||
$('form', page).off('submit', onSubmit).on('submit', onSubmit);
|
||||
|
||||
$('.btnSkip', page).on('click', skip);
|
||||
|
||||
}).on('pageshowready', "#wizardTunerPage", function () {
|
||||
|
||||
var page = this;
|
||||
|
||||
reload(page);
|
||||
});
|
||||
|
||||
})(jQuery, document, window);
|
|
@ -59,17 +59,7 @@
|
|||
|
||||
function navigateToNextPage() {
|
||||
|
||||
var apiClient = ApiClient;
|
||||
|
||||
apiClient.getJSON(apiClient.getUrl('Startup/Info')).done(function (info) {
|
||||
|
||||
if (info.SupportsRunningAsService) {
|
||||
Dashboard.navigate('wizardservice.html');
|
||||
|
||||
} else {
|
||||
Dashboard.navigate('wizardagreement.html');
|
||||
}
|
||||
});
|
||||
Dashboard.navigate('wizardlivetvtuner.html');
|
||||
}
|
||||
|
||||
function onSubmit() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue