|
|
@ -55,7 +55,7 @@ document.addEventListener('DOMContentLoaded', () => {
|
|
|
|
ratelimitApiTime: document.querySelector('#ratelimit-api-time') as SlInput,
|
|
|
|
ratelimitApiTime: document.querySelector('#ratelimit-api-time') as SlInput,
|
|
|
|
ratelimitUploadRequests: document.querySelector('#ratelimit-upload-requests') as SlInput,
|
|
|
|
ratelimitUploadRequests: document.querySelector('#ratelimit-upload-requests') as SlInput,
|
|
|
|
ratelimitUploadTime: document.querySelector('#ratelimit-upload-time') as SlInput,
|
|
|
|
ratelimitUploadTime: document.querySelector('#ratelimit-upload-time') as SlInput,
|
|
|
|
|
|
|
|
|
|
|
|
submitButton: document.querySelector('#submit') as SlButton,
|
|
|
|
submitButton: document.querySelector('#submit') as SlButton,
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
@ -101,7 +101,7 @@ document.addEventListener('DOMContentLoaded', () => {
|
|
|
|
|
|
|
|
|
|
|
|
// append rate limit config, if specified
|
|
|
|
// append rate limit config, if specified
|
|
|
|
if ((
|
|
|
|
if ((
|
|
|
|
Elements.ratelimitLoginRequests.value
|
|
|
|
Elements.ratelimitLoginRequests.value
|
|
|
|
|| Elements.ratelimitLoginTime.value
|
|
|
|
|| Elements.ratelimitLoginTime.value
|
|
|
|
|| Elements.ratelimitUploadRequests.value
|
|
|
|
|| Elements.ratelimitUploadRequests.value
|
|
|
|
|| Elements.ratelimitUploadTime.value
|
|
|
|
|| Elements.ratelimitUploadTime.value
|
|
|
@ -110,11 +110,11 @@ document.addEventListener('DOMContentLoaded', () => {
|
|
|
|
) {
|
|
|
|
) {
|
|
|
|
if (!config.rateLimit) config.rateLimit = {};
|
|
|
|
if (!config.rateLimit) config.rateLimit = {};
|
|
|
|
|
|
|
|
|
|
|
|
if (
|
|
|
|
if (
|
|
|
|
genericRateLimit(config.rateLimit, 'login', Elements.submitButton, Elements.ratelimitLoginRequests, Elements.ratelimitLoginTime)
|
|
|
|
genericRateLimit(config.rateLimit, 'login', Elements.submitButton, Elements.ratelimitLoginRequests, Elements.ratelimitLoginTime)
|
|
|
|
|| genericRateLimit(config.rateLimit, 'api', Elements.submitButton, Elements.ratelimitApiRequests, Elements.ratelimitApiTime)
|
|
|
|
|| genericRateLimit(config.rateLimit, 'api', Elements.submitButton, Elements.ratelimitApiRequests, Elements.ratelimitApiTime)
|
|
|
|
|| genericRateLimit(config.rateLimit, 'upload', Elements.submitButton, Elements.ratelimitUploadRequests, Elements.ratelimitUploadTime)
|
|
|
|
|| genericRateLimit(config.rateLimit, 'upload', Elements.submitButton, Elements.ratelimitUploadRequests, Elements.ratelimitUploadTime)
|
|
|
|
) {
|
|
|
|
) {
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|