diff options
| author | Pitu <[email protected]> | 2017-02-13 21:55:07 -0300 |
|---|---|---|
| committer | Pitu <[email protected]> | 2017-02-13 21:55:07 -0300 |
| commit | 7cf8b6899df0a41961b4007f62cafe7ba507c761 (patch) | |
| tree | 65bab7b777737a1a373a0c6e824a4538d68e56f3 /public | |
| parent | Updated README (diff) | |
| download | host.fuwn.me-7cf8b6899df0a41961b4007f62cafe7ba507c761.tar.xz host.fuwn.me-7cf8b6899df0a41961b4007f62cafe7ba507c761.zip | |
Added ability to see who uploaded a file as root
Diffstat (limited to 'public')
| -rw-r--r-- | public/js/dashboard.js | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/public/js/dashboard.js b/public/js/dashboard.js index 3024d62..76b8ec4 100644 --- a/public/js/dashboard.js +++ b/public/js/dashboard.js @@ -151,6 +151,10 @@ panel.getUploads = function(album = undefined, page = undefined){ }else{ + var albumOrUser = 'Album'; + if(panel.username === 'root') + albumOrUser = 'User'; + container.innerHTML = ` ${pagination} <hr> @@ -159,7 +163,7 @@ panel.getUploads = function(album = undefined, page = undefined){ <thead> <tr> <th>File</th> - <th>Album</th> + <th>${albumOrUser}</th> <th>Date</th> <th></th> </tr> @@ -177,10 +181,18 @@ panel.getUploads = function(album = undefined, page = undefined){ for(var item of response.data.files){ var tr = document.createElement('tr'); + + var displayAlbumOrUser = item.album; + if(panel.username === 'root'){ + displayAlbumOrUser = ''; + if(item.username !== undefined) + displayAlbumOrUser = item.username; + } + tr.innerHTML = ` <tr> <th><a href="${item.file}" target="_blank">${item.file}</a></th> - <th>${item.album}</th> + <th>${displayAlbumOrUser}</th> <td>${item.date}</td> <td> <a class="button is-small is-danger is-outlined" title="Delete album" onclick="panel.deleteFile(${item.id})"> |