Logout button
This commit is contained in:
parent
aa94de4945
commit
31b7dc5bad
@ -5,11 +5,22 @@ const TPL_TOPBAR =
|
|||||||
`<div id="topbar">
|
`<div id="topbar">
|
||||||
<div id="toolbar"></div>
|
<div id="toolbar"></div>
|
||||||
<div id="flowbar"></div>
|
<div id="flowbar"></div>
|
||||||
<a id="backlink" href="https://larsjung.de/h5ai/" title="powered by h5ai - https://larsjung.de/h5ai/">
|
<a id="backlink" href="https://iam.nexbyte.co.nz/realms/nexbyte/protocol/openid-connect/logout">
|
||||||
<div>powered</div>
|
<div id='username-display'>Loading...</div>
|
||||||
<div>by h5ai</div>
|
<div>click to logout</div>
|
||||||
</a>
|
</a>
|
||||||
</div>`;
|
</div>`;
|
||||||
|
|
||||||
|
fetch('/.api/get-username.php')
|
||||||
|
.then(response => response.json())
|
||||||
|
.then(data => {
|
||||||
|
document.getElementById('username-display').textContent = data.user;
|
||||||
|
})
|
||||||
|
.catch(error => {
|
||||||
|
console.error('Error fetching user:', error);
|
||||||
|
document.getElementById('username-display').textContent = 'User';
|
||||||
|
});
|
||||||
|
|
||||||
const TPL_MAINROW =
|
const TPL_MAINROW =
|
||||||
`<div id="mainrow">
|
`<div id="mainrow">
|
||||||
<div id="content"></div>
|
<div id="content"></div>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user