-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
pieterjan.eilers
committed
Aug 19, 2024
1 parent
4b3bd8d
commit c099919
Showing
27 changed files
with
240 additions
and
173 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
100 changes: 53 additions & 47 deletions
100
modules/registrars/realtimeregister/src/Assets/Js/checkCredentials.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,51 +1,57 @@ | ||
$(document).ready(function () { | ||
const moduleName = 'realtimeregister'; | ||
// Container | ||
const config_container = $('#' + moduleName + 'config'); | ||
$(document).ready( | ||
function () { | ||
const moduleName = 'realtimeregister'; | ||
// Container | ||
const config_container = $('#' + moduleName + 'config'); | ||
|
||
// Credentials | ||
const handleField = config_container.find('[name="customer_handle"]'); | ||
const apiField = config_container.find('[name="rtr_api_key"]'); | ||
const oteField = config_container.find('[type="checkbox"][name="test_mode"]'); | ||
const ignoreSslField = config_container.find('[type="checkbox"][name="ignore_ssl"]'); | ||
// Credentials | ||
const handleField = config_container.find('[name="customer_handle"]'); | ||
const apiField = config_container.find('[name="rtr_api_key"]'); | ||
const oteField = config_container.find('[type="checkbox"][name="test_mode"]'); | ||
const ignoreSslField = config_container.find('[type="checkbox"][name="ignore_ssl"]'); | ||
|
||
config_container.on('click', '.check-connection', function (e) { | ||
e.preventDefault(); | ||
config_container.on( | ||
'click', '.check-connection', function (e) { | ||
e.preventDefault(); | ||
|
||
const btn = $(this); | ||
const text = btn.html(); | ||
const result = config_container.find('.credentials-result'); | ||
const btn = $(this); | ||
const text = btn.html(); | ||
const result = config_container.find('.credentials-result'); | ||
|
||
btn.css({'width': btn.outerWidth()}); | ||
btn.html("<i class=\"fa fa-spin fa-spinner\"></i>"); | ||
btn.addClass("disabled"); | ||
btn.attr("disabled", "disabled"); | ||
$.post( | ||
window.location.href, | ||
{ | ||
action: 'checkConnection', | ||
module: moduleName, | ||
handle: handleField.val(), | ||
apiKey: apiField.val(), | ||
ote: oteField.is(":checked"), | ||
ignore_ssl: ignoreSslField.is(":checked"), | ||
}, | ||
function (response) { | ||
btn.html(text); | ||
btn.removeClass("disabled"); | ||
if (response.connection === "true") { | ||
result.html('<span class="status success">SUCCESSFUL</span>'); | ||
} else { | ||
result.html('<span class="status error"><strong>FAILED:</strong> ' + response.msg + '</span>'); | ||
} | ||
btn.attr("disabled", false); | ||
}, | ||
"json" | ||
).fail(function (e) { | ||
btn.html(text); | ||
btn.removeClass("disabled"); | ||
btn.attr("disabled", false); | ||
result.html('<span class="status error"><strong>FAILED:</strong> Something went wrong!</span>'); | ||
}); | ||
}); | ||
}); | ||
btn.css({'width': btn.outerWidth()}); | ||
btn.html("<i class=\"fa fa-spin fa-spinner\"></i>"); | ||
btn.addClass("disabled"); | ||
btn.attr("disabled", "disabled"); | ||
$.post( | ||
window.location.href, | ||
{ | ||
action: 'checkConnection', | ||
module: moduleName, | ||
handle: handleField.val(), | ||
apiKey: apiField.val(), | ||
ote: oteField.is(":checked"), | ||
ignore_ssl: ignoreSslField.is(":checked"), | ||
}, | ||
function (response) { | ||
btn.html(text); | ||
btn.removeClass("disabled"); | ||
if (response.connection === "true") { | ||
result.html('<span class="status success">SUCCESSFUL</span>'); | ||
} else { | ||
result.html('<span class="status error"><strong>FAILED:</strong> ' + response.msg + '</span>'); | ||
} | ||
btn.attr("disabled", false); | ||
}, | ||
"json" | ||
).fail( | ||
function (e) { | ||
btn.html(text); | ||
btn.removeClass("disabled"); | ||
btn.attr("disabled", false); | ||
result.html('<span class="status error"><strong>FAILED:</strong> Something went wrong!</span>'); | ||
} | ||
); | ||
} | ||
); | ||
} | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.