[Web] IAM - add delete option & fix test connection

This commit is contained in:
FreddleSpl0it
2023-03-31 14:55:05 +02:00
parent cb6c2cd662
commit 960f232a7d
3 changed files with 52 additions and 29 deletions

View File

@@ -752,14 +752,22 @@ jQuery(function($){
// IAM test connection
$('#iam_test_connection').click(async function(e){
e.preventDefault();
var res = await fetch("/api/v1/get/status/identity-provider", { method:'GET', cache:'no-cache' });
var data = { attr: $('form[data-id="iam_sso"]').serializeObject() };
var res = await fetch("/api/v1/edit/identity-provider-test", {
headers: {
"Content-Type": "application/json",
},
method:'POST',
cache:'no-cache',
body: JSON.stringify(data)
});
res = await res.json();
console.log(res);
if (res.type === 'success'){
return mailcow_alert_box(lang_success.iam_test_connection, 'success');
}
return mailcow_alert_box(lang_danger.iam_test_connection, 'danger');
});
$('#iam_rolemap_add').click(async function(e){
e.preventDefault();