Added logout to dashboard

This commit is contained in:
Pitu 2017-01-21 19:04:14 -03:00
parent 4d83ff5a28
commit 8ee1540c82
2 changed files with 11 additions and 3 deletions

View File

@ -42,18 +42,19 @@
<p class="menu-label">General</p> <p class="menu-label">General</p>
<ul class="menu-list"> <ul class="menu-list">
<li><a href="/">Frontpage</a></li> <li><a href="/">Frontpage</a></li>
<li><a id='itemUploads'>Uploads</a></li> <li><a onclick="panel.getUploads()">Uploads</a></li>
</ul> </ul>
<p class="menu-label">Albums</p> <p class="menu-label">Albums</p>
<ul class="menu-list"> <ul class="menu-list">
<li><a id='itemManageGallery'>Manage your albums</a></li> <li><a onclick="panel.getAlbums()">Manage your albums</a></li>
<li> <li>
<ul id='albumsContainer'></ul> <ul id='albumsContainer'></ul>
</li> </li>
</ul> </ul>
<p class="menu-label">Administration</p> <p class="menu-label">Administration</p>
<ul class="menu-list"> <ul class="menu-list">
<li><a id="itemTokens">Change your tokens</a></li> <li><a onclick="panel.changeTokens()">Change your tokens</a></li>
<li><a onclick="panel.logout()">Logout</a></li>
</ul> </ul>
</aside> </aside>
</div> </div>

View File

@ -54,6 +54,7 @@ panel.prepareDashboard = function(){
document.getElementById('auth').style.display = 'none'; document.getElementById('auth').style.display = 'none';
document.getElementById('dashboard').style.display = 'block'; document.getElementById('dashboard').style.display = 'block';
/*
document.getElementById('itemUploads').addEventListener('click', function(){ document.getElementById('itemUploads').addEventListener('click', function(){
panel.getUploads(); panel.getUploads();
}); });
@ -65,10 +66,16 @@ panel.prepareDashboard = function(){
document.getElementById('itemTokens').addEventListener('click', function(){ document.getElementById('itemTokens').addEventListener('click', function(){
panel.changeTokens(); panel.changeTokens();
}); });
*/
panel.getAlbumsSidebar(); panel.getAlbumsSidebar();
} }
panel.logout = function(){
localStorage.removeItem("admintoken");
location.reload('/');
}
panel.getUploads = function(album = undefined, page = undefined){ panel.getUploads = function(album = undefined, page = undefined){
if(page === undefined) page = 0; if(page === undefined) page = 0;