46 lines
1.6 KiB
JavaScript
46 lines
1.6 KiB
JavaScript
function test() {
|
|
function createInput({ id, placeholder }) {
|
|
const input = document.createElement('input');
|
|
input.type = 'text';
|
|
input.id = id;
|
|
input.style.width = 'calc(100% - 30px)';
|
|
input.placeholder = placeholder;
|
|
input.required = true;
|
|
return input;
|
|
}
|
|
|
|
const container = document.createElement('div');
|
|
container.id = 'rbacAuthCreation';
|
|
|
|
container.append(
|
|
createInput({ id: 'rbacAuthsAMAccountName', placeholder: 'sAMAccountName <Vorname.Nachname>' }),
|
|
createInput({ id: 'rbacAuthsMail', placeholder: 'E-Mail' }),
|
|
createInput({ id: 'rbacAuthsSn', placeholder: 'Vorname' }),
|
|
createInput({ id: 'rbacAuthsGivenName', placeholder: 'Nachname' })
|
|
);
|
|
|
|
feedbox({
|
|
title: `<span>Erstelle eine neue Authentifizierung</span>`,
|
|
message: container.outerHTML,
|
|
buttons: {
|
|
cancel: {
|
|
text: 'Abbrechen'
|
|
},
|
|
yes: {
|
|
text: '<b>Erstellen</b>',
|
|
onClick: () => {
|
|
fetch('/api/rbac/auths/create', {
|
|
method: 'POST',
|
|
body: JSON.stringify({
|
|
sAMAccountName: document.getElementById('rbacAuthsAMAccountName').value,
|
|
mail: document.getElementById('rbacAuthsMail').value,
|
|
sn: document.getElementById('rbacAuthsSn').value,
|
|
givenName: document.getElementById('rbacAuthsGivenName').value
|
|
})
|
|
})
|
|
}
|
|
}
|
|
},
|
|
lock: true
|
|
});
|
|
} |