Skip to content

Commit

Permalink
Merge pull request #198 from Kometa-Team/187-webhook-validation-butto…
Browse files Browse the repository at this point in the history
…n-does-nothing

187 webhook validation button does nothing
  • Loading branch information
bullmoose20 authored Jan 19, 2025
2 parents e448a5e + 62d2735 commit c91970d
Show file tree
Hide file tree
Showing 4 changed files with 1,283 additions and 451 deletions.
27 changes: 27 additions & 0 deletions static/css/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -219,3 +219,30 @@ div#loading {
.tooltip.show {
opacity: 1.0 !important;
}

.mt-4 {
margin-top: 0 !important;


.nav-button {
background-color: #00bc8c !important;
color: white !important;
border-color: #00bc8c !important;
}
.nav-button:hover {
background-color: #019c75 !important;
border-color: #019c75 !important;
}}

.form-check-input:checked {
background-color: #00bc8c;
border-color: #0f5132;
}

.accordion-button:not(.collapsed) {
background-color: transparent;
}

a {
color: rgb(255 255 255 / 70%);
}
8 changes: 4 additions & 4 deletions static/local-js/090-webhooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ function validateWebhook (webhookType) {
const validateButton = inputGroup.find('.validate-button')
const webhookTypeFormatted = webhookType.replace(/_/g, ' ').replace(/\b\w/g, function (l) { return l.toUpperCase() })

showSpinner2(webhookType)
showSpinner(webhookType)
validationMessage.html('<div class="alert alert-info" role="alert">Validating...</div>')
validationMessage.show()

Expand All @@ -98,19 +98,19 @@ function validateWebhook (webhookType) {
.then(response => response.json())
.then(data => {
if (data.success) {
hideSpinner2(webhookType)
hideSpinner(webhookType)
validationMessage.html('<div class="alert alert-success" role="alert">' + data.success + '</div>')
validateButton.prop('disabled', true)
validatedWebhooks['webhooks_' + webhookType] = true
} else {
hideSpinner2(webhookType)
hideSpinner(webhookType)
validationMessage.html('<div class="alert alert-danger" role="alert">' + data.error + '</div>')
validatedWebhooks['webhooks_' + webhookType] = false
}
updateValidationState()
})
.catch((error) => {
hideSpinner2(webhookType)
hideSpinner(webhookType)
console.error('Error:', error)
validationMessage.html('<div class="alert alert-danger" role="alert">An error occurred. Please try again.</div>')
validatedWebhooks['webhooks_' + webhookType] = false
Expand Down
12 changes: 6 additions & 6 deletions templates/000-base.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@
<script src="https://code.jquery.com/jquery-3.7.1.js" integrity="sha256-eKhayi8LEQwp4NKxN+CfCh+3qOVUtJn3QNZ0TciWLP4=" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script>
<script>
// Initialize Bootstrap tooltips
document.addEventListener("DOMContentLoaded", function () {
const tooltipTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="tooltip"]'));
tooltipTriggerList.map(function (tooltipTriggerEl) {
return new bootstrap.Tooltip(tooltipTriggerEl);
});
// Initialize Bootstrap tooltips
document.addEventListener("DOMContentLoaded", function () {
const tooltipTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="tooltip"]'));
tooltipTriggerList.map(function (tooltipTriggerEl) {
return new bootstrap.Tooltip(tooltipTriggerEl);
});
});
</script>
<link rel="icon" href="{{ url_for('static', filename='favicon.png') }}" />
<link
Expand Down
Loading

0 comments on commit c91970d

Please sign in to comment.