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';
|
2020-07-09 08:54:12 +01:00
|
|
|
|
2023-04-19 01:56:05 -04:00
|
|
|
function loadPage(page, config) {
|
2025-01-14 01:12:37 +03:00
|
|
|
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) {
|
2025-01-14 01:12:37 +03:00
|
|
|
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);
|
|
|
|
});
|
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
|
|
|
$(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);
|
2019-11-06 13:43:39 +03:00
|
|
|
});
|
2023-04-19 01:56:05 -04:00
|
|
|
});
|
2020-07-09 08:54:12 +01:00
|
|
|
|