1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00
jellyfin-web/src/controllers/dashboard/streaming.js

49 lines
1.6 KiB
JavaScript
Raw Normal View History

import $ from 'jQuery';
import libraryMenu from 'libraryMenu';
import loading from 'loading';
import globalize from 'globalize';
/* eslint-disable indent */
2018-10-23 01:05:09 +03:00
function loadPage(page, config) {
2020-05-04 12:44:12 +02:00
$('#txtRemoteClientBitrateLimit', page).val(config.RemoteClientBitrateLimit / 1e6 || '');
loading.hide();
2018-10-23 01:05:09 +03:00
}
function onSubmit() {
loading.show();
2020-07-16 11:25:17 +01:00
const form = this;
ApiClient.getServerConfiguration().then(function (config) {
2020-05-04 12:44:12 +02:00
config.RemoteClientBitrateLimit = parseInt(1e6 * parseFloat($('#txtRemoteClientBitrateLimit', form).val() || '0'));
ApiClient.updateServerConfiguration(config).then(Dashboard.processServerConfigurationUpdateResult);
});
return false;
2018-10-23 01:05:09 +03:00
}
function getTabs() {
return [{
2020-05-04 12:44:12 +02:00
href: 'encodingsettings.html',
name: globalize.translate('Transcoding')
2019-08-16 00:25:31 -07:00
}, {
2020-05-04 12:44:12 +02:00
href: 'playbackconfiguration.html',
2020-08-16 20:34:39 +09:00
name: globalize.translate('ButtonResume')
2018-10-23 01:05:09 +03:00
}, {
2020-05-04 12:44:12 +02:00
href: 'streamingsettings.html',
name: globalize.translate('TabStreaming')
}];
2018-10-23 01:05:09 +03:00
}
2019-08-16 00:25:31 -07:00
2020-05-04 12:44:12 +02:00
$(document).on('pageinit', '#streamingSettingsPage', function () {
$('.streamingSettingsForm').off('submit', onSubmit).on('submit', onSubmit);
}).on('pageshow', '#streamingSettingsPage', function () {
2019-08-16 00:25:31 -07:00
loading.show();
2020-05-04 12:44:12 +02:00
libraryMenu.setTabs('playback', 2, getTabs);
2020-07-16 11:25:17 +01:00
const page = this;
ApiClient.getServerConfiguration().then(function (config) {
loadPage(page, config);
});
});
/* eslint-enable indent */