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

31 lines
1 KiB
JavaScript
Raw Normal View History

2020-08-14 08:46:34 +02:00
import 'jquery';
import loading from '../../components/loading/loading';
2022-04-10 02:22:13 -04:00
import Dashboard from '../../utils/dashboard';
2023-04-19 01:56:05 -04:00
function loadPage(page, config) {
page.querySelector('#txtRemoteClientBitrateLimit').value = config.RemoteClientBitrateLimit / 1e6 || '';
2023-04-19 01:56:05 -04:00
loading.hide();
}
2018-10-23 01:05:09 +03:00
2023-04-19 01:56:05 -04:00
function onSubmit() {
loading.show();
const form = this;
ApiClient.getServerConfiguration().then(function (config) {
config.RemoteClientBitrateLimit = parseInt(1e6 * parseFloat(form.querySelector('#txtRemoteClientBitrateLimit').value || '0'), 10);
2023-04-19 01:56:05 -04:00
ApiClient.updateServerConfiguration(config).then(Dashboard.processServerConfigurationUpdateResult);
});
2023-04-19 01:56:05 -04:00
return false;
}
2018-10-23 01:05:09 +03:00
2023-04-19 01:56:05 -04:00
$(document).on('pageinit', '#streamingSettingsPage', function () {
$('.streamingSettingsForm').off('submit', onSubmit).on('submit', onSubmit);
}).on('pageshow', '#streamingSettingsPage', function () {
loading.show();
const page = this;
ApiClient.getServerConfiguration().then(function (config) {
loadPage(page, config);
});
2023-04-19 01:56:05 -04:00
});