rbac crud
This commit is contained in:
46
public/javascript/rbacAPI.js
Normal file
46
public/javascript/rbacAPI.js
Normal file
@@ -0,0 +1,46 @@
|
||||
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
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user