|
|
@ -22,13 +22,16 @@ export function initCompWebHookEditor() {
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const updateContentType = function () {
|
|
|
|
// some webhooks (like Gitea) allow to set the request method (GET/POST), and it would toggle the "Content Type" field
|
|
|
|
const visible = document.getElementById('http_method').value === 'POST';
|
|
|
|
const httpMethodInput = document.getElementById('http_method');
|
|
|
|
toggleElem(document.getElementById('content_type').parentNode.parentNode, visible);
|
|
|
|
if (httpMethodInput) {
|
|
|
|
};
|
|
|
|
const updateContentType = function () {
|
|
|
|
updateContentType();
|
|
|
|
const visible = httpMethodInput.value === 'POST';
|
|
|
|
|
|
|
|
toggleElem(document.getElementById('content_type').closest('.field'), visible);
|
|
|
|
document.getElementById('http_method').addEventListener('change', updateContentType);
|
|
|
|
};
|
|
|
|
|
|
|
|
updateContentType();
|
|
|
|
|
|
|
|
httpMethodInput.addEventListener('change', updateContentType);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Test delivery
|
|
|
|
// Test delivery
|
|
|
|
document.getElementById('test-delivery')?.addEventListener('click', async function () {
|
|
|
|
document.getElementById('test-delivery')?.addEventListener('click', async function () {
|
|
|
|