2020-08-14 08:46:34 +02:00
|
|
|
import 'jquery';
|
|
|
|
import libraryMenu from '../../scripts/libraryMenu';
|
|
|
|
import loading from '../../components/loading/loading';
|
|
|
|
import globalize from '../../scripts/globalize';
|
2022-04-10 02:22:13 -04:00
|
|
|
import Dashboard from '../../utils/dashboard';
|
2020-07-09 08:54:12 +01:00
|
|
|
|
2023-04-19 01:56:05 -04:00
|
|
|
function loadPage(page, config) {
|
|
|
|
$('#txtRemoteClientBitrateLimit', page).val(config.RemoteClientBitrateLimit / 1e6 || '');
|
|
|
|
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($('#txtRemoteClientBitrateLimit', form).val() || '0'), 10);
|
|
|
|
ApiClient.updateServerConfiguration(config).then(Dashboard.processServerConfigurationUpdateResult);
|
|
|
|
});
|
2020-02-24 22:25:08 +09:00
|
|
|
|
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
|
|
|
function getTabs() {
|
|
|
|
return [{
|
2023-09-25 00:00:36 -04:00
|
|
|
href: '#/dashboard/playback/transcoding',
|
2023-04-19 01:56:05 -04:00
|
|
|
name: globalize.translate('Transcoding')
|
|
|
|
}, {
|
2023-09-25 00:00:36 -04:00
|
|
|
href: '#/dashboard/playback/resume',
|
2023-04-19 01:56:05 -04:00
|
|
|
name: globalize.translate('ButtonResume')
|
|
|
|
}, {
|
2023-09-25 00:00:36 -04:00
|
|
|
href: '#/dashboard/playback/streaming',
|
2023-04-19 01:56:05 -04:00
|
|
|
name: globalize.translate('TabStreaming')
|
|
|
|
}];
|
|
|
|
}
|
2019-08-16 00:25:31 -07: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();
|
|
|
|
libraryMenu.setTabs('playback', 2, getTabs);
|
|
|
|
const page = this;
|
|
|
|
ApiClient.getServerConfiguration().then(function (config) {
|
|
|
|
loadPage(page, config);
|
2019-11-06 13:43:39 +03:00
|
|
|
});
|
2023-04-19 01:56:05 -04:00
|
|
|
});
|
2020-07-09 08:54:12 +01:00
|
|
|
|