2024-03-30 14:48:55 +08:00
|
|
|
$(document).ready(function () {
|
|
|
|
updateTableRowVisibility();
|
|
|
|
$('#siteconfig-verifyprovider').change(function () {
|
|
|
|
updateTableRowVisibility();
|
|
|
|
});
|
|
|
|
$('#siteconfig-enableipinfo').change(function () {
|
|
|
|
updateTableRowVisibility();
|
|
|
|
});
|
2024-04-01 14:08:01 +08:00
|
|
|
$('#siteconfig-clarityenabled').change(function () {
|
|
|
|
updateTableRowVisibility();
|
|
|
|
});
|
|
|
|
$('#siteconfig-gaenabled').change(function () {
|
|
|
|
updateTableRowVisibility();
|
|
|
|
});
|
2024-03-30 14:48:55 +08:00
|
|
|
});
|
|
|
|
|
|
|
|
function updateTableRowVisibility() {
|
|
|
|
let currentValue = $('#siteconfig-verifyprovider').val();
|
|
|
|
let ipinfoEnable = $('#siteconfig-enableipinfo').prop('checked');
|
2024-04-01 14:08:01 +08:00
|
|
|
let clarityEnable = $('#siteconfig-clarityenabled').prop('checked');
|
|
|
|
let gaEnable = $('#siteconfig-gaenabled').prop('checked');
|
|
|
|
$('#tr-recaptchaSiteKey, #tr-recaptchaSecret, #tr-hcaptchaSiteKey, #tr-hcaptchaSecret, #tr-turnstileSiteKey, #tr-turnstileSecret,#tr-ipinfoToken,#tr-clarityId,#tr-gaId').hide();
|
2024-03-30 14:48:55 +08:00
|
|
|
if (currentValue === 'reCAPTCHA') {
|
|
|
|
$('#tr-recaptchaSiteKey, #tr-recaptchaSecret').show();
|
|
|
|
} else if (currentValue === 'hCaptcha') {
|
|
|
|
$('#tr-hcaptchaSiteKey, #tr-hcaptchaSecret').show();
|
|
|
|
} else if (currentValue === 'Turnstile') {
|
|
|
|
$('#tr-turnstileSiteKey, #tr-turnstileSecret').show();
|
|
|
|
}
|
|
|
|
if (ipinfoEnable) {
|
|
|
|
$('#tr-ipinfoToken').show();
|
|
|
|
}
|
2024-04-01 14:08:01 +08:00
|
|
|
if (clarityEnable) {
|
|
|
|
$('#tr-clarityId').show();
|
|
|
|
}
|
|
|
|
if (gaEnable) {
|
|
|
|
$('#tr-gaId').show();
|
|
|
|
}
|
2024-03-30 14:48:55 +08:00
|
|
|
}
|