rbac crud
This commit is contained in:
@@ -147,25 +147,25 @@ function slideOutMessage(message) {
|
||||
//#region Feedbox
|
||||
|
||||
/**
|
||||
* feedbox({
|
||||
* title: `<span style="color:#f44336">⚠ Upload abbrechen?</span>`,
|
||||
* message: `
|
||||
* <p>Es laufen noch <b>aktive Uploads</b>.</p>
|
||||
* <p>Möchtest du wirklich <u>alle abbrechen</u>?</p>
|
||||
* `,
|
||||
* buttons: {
|
||||
* yes: {
|
||||
* text: '<b>Ja</b>, abbrechen',
|
||||
* onClick: () => stopUploadQueue()
|
||||
* },
|
||||
* no: {
|
||||
* text: 'Weiter hochladen'
|
||||
* },
|
||||
* cancel: {
|
||||
* text: 'Zurück'
|
||||
* }
|
||||
* }
|
||||
*});
|
||||
feedbox({
|
||||
title: `<span style="color:#f44336">⚠ Upload abbrechen?</span>`,
|
||||
message: `
|
||||
<p>Es laufen noch <b>aktive Uploads</b>.</p>
|
||||
<p>Möchtest du wirklich <u>alle abbrechen</u>?</p>
|
||||
`,
|
||||
buttons: {
|
||||
yes: {
|
||||
text: '<b>Ja</b>, abbrechen',
|
||||
onClick: () => stopUploadQueue()
|
||||
},
|
||||
no: {
|
||||
text: 'Weiter hochladen'
|
||||
},
|
||||
cancel: {
|
||||
text: 'Zurück'
|
||||
}
|
||||
}
|
||||
});
|
||||
*/
|
||||
function feedbox({
|
||||
title = '',
|
||||
|
||||
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
|
||||
});
|
||||
}
|
||||
@@ -235,7 +235,7 @@ table .cb input:checked + .cb-box::after { transform:scale(1) translate(1px, 1px
|
||||
|
||||
/* #region Feebox */
|
||||
.feedbox-overlay { position:fixed; top:0; left:0; width:100vw; height:100vh; display:flex; align-items:center; justify-content:center; z-index:999; }
|
||||
.feedbox { border-radius:8px; max-width:50vw; width:100%; padding:20px; animation:feedboxFadeIn 0.2s ease-out; max-height:80vh; display:flex; flex-direction:column; overflow:hidden; }
|
||||
.feedbox { border-radius:8px; max-width:50vw; max-width:100%; padding:20px; animation:feedboxFadeIn 0.2s ease-out; max-height:80vh; display:flex; flex-direction:column; overflow:hidden; }
|
||||
.feedbox h3 { margin:0 0 10px 0; }
|
||||
.feedbox-message { margin-bottom:20px; line-height:1.4; flex:1; overflow-y: auto; /* font-size:1rem; */ }
|
||||
.feedbox-actions { display:flex; justify-content:flex-end; gap:10px; flex-wrap:wrap; flex-shrink:0; }
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Document</title>
|
||||
</head>
|
||||
<body>
|
||||
<div class="container grid" style="height:100vh; grid-template-columns: 1fr 1fr;">
|
||||
<div class="card static" id="rbacEntities">
|
||||
|
||||
</div>
|
||||
|
||||
<div class="card static" id="rbacEntityContent">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="static" style="pointer-events:none;position:absolute; bottom:20px;right:0px;">
|
||||
<button id="rbacCreateAuthentication" class="yellowbutton" onclick="test()" style="pointer-events:auto">Neuer Benutzer</button>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
reloadPluginScript('/javascript/rbacAPI.js');
|
||||
|
||||
|
||||
fetch('/api/rbac/getEntities', { method: 'POST' })
|
||||
.then(res => res.json())
|
||||
.then(json => {
|
||||
|
||||
});
|
||||
</script>
|
||||
</html>
|
||||
Reference in New Issue
Block a user