{"version":3,"sources":["dashboard.js"],"names":["const","lsKeys","token","viewType","uploads","uploadsAll","selected","albums","albumsAll","users","originalNames","page","section","dom","localStorage","username","permissions","menusContainer","menus","currentView","views","type","album","pageNum","filters","all","checkboxes","lastSelected","selectAlbumContainer","cache","clipboardJS","lazyLoad","imageExts","videoExts","isSomethingLoading","fadingIn","albumTitleMaxLength","albumDescMaxLength","unhide","document","querySelector","classList","add","remove","onError","error","console","content","createElement","innerHTML","toString","swal","title","icon","onAxiosError","statusText","520","521","522","523","524","525","526","527","530","response","status","description","data","preparePage","verifyToken","window","location","checkClientVersion","apiVersion","match","src","text","buttons","confirm","closeModal","then","reload","reloadOnError","axios","post","success","removeItem","defaults","headers","common","version","prepareDashboard","catch","addEventListener","domClick","event","target","contains","preventDefault","itemMenus","selector","onclick","getUploads","deleteUploadsByNames","getAlbums","changeToken","changePassword","logout","params","group","getStatistics","getUsers","loop","i","item","warnSomethingLoading","call","Object","assign","trigger","currentTarget","push","length","moderator","getAlbumsSidebar","prepareShareX","updateTrigger","timer","newState","parentNode","tagName","let","getItemID","element","parent","parseInt","dataset","id","includes","action","hasAttribute","stopPropagation","setUploadsView","toggleOriginalNames","addToAlbum","deleteUpload","addSelectedUploadsToAlbum","bulkDeleteUploads","displayPreview","uploadFiltersHelp","filterUploads","submitAlbum","editAlbum","disableAlbum","viewAlbumUploads","createUser","editUser","disableUser","deleteUser","viewUserUploads","getNewToken","clearSelection","select","selectAll","focusJumpToPage","switchPage","fadeAndScroll","disableFading","clearTimeout","setTimeout","scrollIntoView","behavior","block","inline","getByView","view","get","func","goto","jumpToPage","jumpid","checkValidity","parsed","value","isNaN","focus","url","undefined","test","minoffset","Date","getTimezoneOffset","pages","Math","ceil","count","files","autoPage","basedomain","max","pagination","paginate","extraControls","escape","controls","bottomExtraControls","replace","bottomPagination","unselected","showOriginalNames","hasExpiryDateColumn","some","file","expirydate","thumb","exec","extname","toLowerCase","name","original","prettyBytes","getPrettyBytes","size","prettyDate","getPrettyDate","timestamp","prettyExpiryDate","appendix","userid","albumid","table","upload","div","className","appendChild","querySelectorAll","allAlbums","tr","ip","checked","update","isimage","isvideo","onload","body","onerror","video","autoplay","insertAdjacentElement","splice","indexOf","JSON","stringify","selectInBetween","lastElement","thisIndex","index","lastIndex","abs","shiftKey","suffix","substring","proceed","Boolean","style","trim","filtersid","user","postBulkDeleteUploads","field","values","cb","failed","filter","textArea","seen","names","split","map","trimmed","prototype","hasOwnProperty","join","objective","dangerMode","cancel","fields","Array","isArray","addUploadsToAlbum","ids","callback","choose","added","list","getElementsByTagName","removeAttribute","homeDomain","createNewAlbum","albumUrl","enabled","download","public","requestLink","identifier","purge","sidebar","albumsContainer","oldAlbums","li","a","sendNewPassword","pass","password","admin","displayGroup","groups","keys","registration","prettyTokenUpdate","usage","groupOptions","g","resetPassword","autoClose","displayName","totalItems","itemsPerPage","currentPage","numPages","template","start","end","elementsToShow","step","stats","rows","types","_types","valKeys","j","number","toLocaleString","byte","byteUsage","used","total","round","s","toUpperCase","defineProperty","varArgs","arguments$1","arguments","TypeError","to","nextSource","nextKey","writable","configurable","documentElement","selectedKeys","ls","parse","ClipboardJS","on","LazyLoad"],"mappings":"AAEAA,IAAMC,OAAS,CACbC,MAAO,QACPC,SAAU,CACRC,QAAS,kBACTC,WAAY,sBAEdC,SAAU,CACRF,QAAS,kBACTC,WAAY,qBACZE,OAAQ,iBACRC,UAAW,oBACXC,MAAO,iBAETC,cAAe,CACbN,QAAS,gBACTC,WAAY,qBAIVM,KAAO,CAEXC,QAAS,KAETC,IAAK,KAGLX,MAAOY,aAAab,OAAOC,OAG3Ba,SAAU,KACVC,YAAa,KAGbC,eAAgB,KAChBC,MAAO,GAEPC,YAAa,KACbC,MAAO,CAELhB,QAAS,CACPiB,KAAMP,aAAab,OAAOE,SAASC,SACnCM,cAA8D,MAA/CI,aAAab,OAAOS,cAAcN,SACjDkB,MAAO,KACPC,QAAS,MAGXlB,WAAY,CACVgB,KAAMP,aAAab,OAAOE,SAASE,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IAAMqW,EAAaH,EAAUhP,GAC7B,GAAImP,MAAAA,EACF,IAAKrW,IAAMsW,KAAWD,EAEhB/O,OAAOmK,UAAUC,eAAerK,KAAKgP,EAAYC,KACnDF,EAAGE,GAAWD,EAAWC,IAEjC,OAAOF,GAETG,UAAU,EACVC,cAAc,IAIZ,iBAAkBjU,SAASkU,iBAC/BlU,SAASkU,gBAAgBhU,UAAUC,IAAI,YAGzC,IADA1C,IAAM0W,EAAe,CAAC,UAAW,aAAc,SAAU,YAAa,SAC7DxP,EAAI,EAAGA,EAAIwP,EAAa/O,OAAQT,IAAK,CAC5ClH,IAAM2W,EAAK7V,aAAab,OAAOK,SAASoW,EAAaxP,KACjDyP,IAAIhW,KAAKL,SAASoW,EAAaxP,IAAM0I,KAAKgH,MAAMD,IAGtDhW,KAAK0D,cAEL1D,KAAKmB,YAAc,IAAI+U,YAAY,iBAEnClW,KAAKmB,YAAYgV,GAAG,WAAS,WAC3B,OAAO3T,KAAK,GAAI,yCAA0C,UAAW,CACnE2B,SAAS,EACTkD,MAAO,UAIXrH,KAAKmB,YAAYgV,GAAG,QAASnW,KAAKiC,SAElCjC,KAAKoB,SAAW,IAAIgV","file":"dashboard.js","sourcesContent":["/* global swal, axios, ClipboardJS, LazyLoad */\n\nconst lsKeys = {\n token: 'token',\n viewType: {\n uploads: 'viewTypeUploads',\n uploadsAll: 'viewTypeUploadsAll'\n },\n selected: {\n uploads: 'selectedUploads',\n uploadsAll: 'selectedUploadsAll',\n albums: 'selectedAlbums',\n albumsAll: 'selectedAlbumsAll',\n users: 'selectedUsers'\n },\n originalNames: {\n uploads: 'originalNames',\n uploadsAll: 'originalNamesAll'\n }\n}\n\nconst page = {\n // #dashboard\n section: null,\n // #page\n dom: null,\n\n // user token\n token: localStorage[lsKeys.token],\n\n // from api/tokens/verify\n username: null,\n permissions: null,\n\n // sidebar menus\n menusContainer: null,\n menus: [],\n\n currentView: null,\n views: {\n // params of uploads view\n uploads: {\n type: localStorage[lsKeys.viewType.uploads],\n originalNames: localStorage[lsKeys.originalNames.uploads] === '1',\n album: null, // album's id\n pageNum: null\n },\n // params of uploads view (all)\n uploadsAll: {\n type: localStorage[lsKeys.viewType.uploadsAll],\n originalNames: localStorage[lsKeys.originalNames.uploadsAll] === '1',\n filters: null,\n pageNum: null,\n all: true\n },\n // params of albums view\n albums: {\n filters: null,\n pageNum: null\n },\n // params of albums view (all)\n albumsAll: {\n filters: null,\n pageNum: null,\n all: true\n },\n // params of users view\n users: {\n filters: null,\n pageNum: null\n }\n },\n\n // ids of selected items (shared across pages and will be synced with localStorage)\n selected: {\n uploads: [],\n uploadsAll: [],\n albums: [],\n albumsAll: [],\n users: []\n },\n checkboxes: [],\n lastSelected: [],\n\n // select album dom for dialogs/modals\n selectAlbumContainer: null,\n\n // cache for dialogs/modals\n cache: {},\n\n clipboardJS: null,\n lazyLoad: null,\n\n imageExts: ['.webp', '.jpg', '.jpeg', '.gif', '.png', '.tiff', '.tif', '.svg'],\n // TODO: Disable \"Load original\" button with non-streamable extensions\n videoExts: ['.webm', '.mp4', '.wmv', '.avi', '.mov', '.mkv', '.m4v', '.m2ts'],\n\n isSomethingLoading: false,\n fadingIn: null,\n\n albumTitleMaxLength: 70,\n albumDescMaxLength: 4000\n}\n\npage.unhide = () => {\n document.querySelector('#loader').classList.add('is-hidden')\n page.section.classList.remove('is-hidden')\n}\n\n// Handler for regular JS errors\npage.onError = error => {\n console.error(error)\n\n const content = document.createElement('div')\n content.innerHTML = `${error.toString()}
`\n return swal({\n title: 'An error occurred!',\n icon: 'error',\n content\n })\n}\n\n// Handler for Axios errors\npage.onAxiosError = error => {\n console.error(error)\n\n // Better Cloudflare errors\n const cloudflareErrors = {\n 520: 'Unknown Error',\n 521: 'Web Server Is Down',\n 522: 'Connection Timed Out',\n 523: 'Origin Is Unreachable',\n 524: 'A Timeout Occurred',\n 525: 'SSL Handshake Failed',\n 526: 'Invalid SSL Certificate',\n 527: 'Railgun Error',\n 530: 'Origin DNS Error'\n }\n\n const statusText = cloudflareErrors[error.response.status] || error.response.statusText\n const description = error.response.data && error.response.data.description\n ? error.response.data.description\n : 'There was an error with the request, please check the console for more information.'\n\n return swal(`${error.response.status} ${statusText}`, description, 'error')\n}\n\npage.preparePage = () => {\n if (page.token)\n page.verifyToken(page.token, true)\n else\n window.location = 'auth'\n}\n\npage.checkClientVersion = apiVersion => {\n const self = document.querySelector('#mainScript')\n const match = self.src.match(/\\?_=(\\d+)$/)\n if (match && match[1] && match[1] !== apiVersion)\n return swal({\n title: 'Updated detected!',\n text: 'Client assets have been updated. Reload to display the latest version?',\n icon: 'info',\n buttons: {\n confirm: {\n text: 'Reload',\n closeModal: false\n }\n }\n }).then(() => {\n window.location.reload()\n })\n}\n\npage.verifyToken = (token, reloadOnError) => {\n axios.post('api/tokens/verify', { token }).then(response => {\n if (response.data.success === false)\n return swal({\n title: 'An error occurred!',\n text: response.data.description,\n icon: 'error'\n }).then(() => {\n if (!reloadOnError) return\n localStorage.removeItem(lsKeys.token)\n window.location = 'auth'\n })\n\n axios.defaults.headers.common.token = token\n localStorage[lsKeys.token] = token\n\n if (response.data.version)\n page.checkClientVersion(response.data.version)\n\n page.token = token\n page.username = response.data.username\n page.permissions = response.data.permissions\n page.prepareDashboard()\n }).catch(page.onAxiosError)\n}\n\npage.prepareDashboard = () => {\n page.section = document.querySelector('#dashboard')\n page.dom = page.section.querySelector('#page')\n\n // Capture all click events\n page.dom.addEventListener('click', page.domClick, true)\n\n // Capture all submit events\n page.dom.addEventListener('submit', event => {\n // Prevent default if necessary\n if (event.target && event.target.classList.contains('prevent-default'))\n return event.preventDefault()\n }, true)\n\n page.menusContainer = document.querySelector('#menu')\n\n // All item menus in the sidebar\n const itemMenus = [\n { selector: '#itemUploads', onclick: page.getUploads },\n { selector: '#itemDeleteUploadsByNames', onclick: page.deleteUploadsByNames },\n { selector: '#itemManageYourAlbums', onclick: page.getAlbums },\n { selector: '#itemManageToken', onclick: page.changeToken },\n { selector: '#itemChangePassword', onclick: page.changePassword },\n { selector: '#itemLogout', onclick: page.logout },\n { selector: '#itemManageUploads', onclick: page.getUploads, params: { all: true }, group: 'moderator' },\n { selector: '#itemManageAlbums', onclick: page.getAlbums, params: { all: true }, group: 'moderator' },\n { selector: '#itemStatistics', onclick: page.getStatistics, group: 'admin' },\n { selector: '#itemManageUsers', onclick: page.getUsers, group: 'admin' }\n ]\n\n for (let i = 0; i < itemMenus.length; i++) {\n // Skip item menu if not enough permission\n if (itemMenus[i].group && !page.permissions[itemMenus[i].group])\n continue\n\n // Add onclick event listener\n const item = document.querySelector(itemMenus[i].selector)\n item.addEventListener('click', event => {\n if (page.isSomethingLoading)\n return page.warnSomethingLoading()\n\n // eslint-disable-next-line compat/compat\n itemMenus[i].onclick.call(null, Object.assign(itemMenus[i].params || {}, {\n trigger: event.currentTarget\n }))\n })\n\n item.classList.remove('is-hidden')\n page.menus.push(item)\n }\n\n // If at least a moderator, show administration section\n if (page.permissions.moderator) {\n document.querySelector('#itemLabelAdmin').classList.remove('is-hidden')\n document.querySelector('#itemListAdmin').classList.remove('is-hidden')\n }\n\n // Update text of logout button\n document.querySelector('#itemLogout').innerHTML = `Logout ( ${page.username} )`\n\n // Finally display dashboard\n page.unhide()\n\n // Load albums sidebar\n page.getAlbumsSidebar()\n\n if (typeof page.prepareShareX === 'function')\n page.prepareShareX()\n}\n\npage.logout = params => {\n page.updateTrigger(params.trigger, 'active')\n localStorage.removeItem(lsKeys.token)\n window.location = 'auth'\n}\n\npage.warnSomethingLoading = () => {\n swal('Please wait!', 'Something else is still loading\\u2026', 'warning', {\n buttons: false,\n timer: 3000\n })\n}\n\npage.updateTrigger = (trigger, newState) => {\n if (!trigger) return\n\n // Disable menus container and pagination when loading\n if (newState === 'loading') {\n page.isSomethingLoading = true\n page.section.classList.add('is-loading')\n } else {\n page.section.classList.remove('is-loading')\n page.isSomethingLoading = false\n }\n\n if (newState === 'loading') {\n trigger.classList.add('is-loading')\n } else if (newState === 'active') {\n if (trigger.parentNode.tagName !== 'LI')\n return\n for (let i = 0; i < page.menus.length; i++)\n page.menus[i].classList.remove('is-active')\n trigger.classList.remove('is-loading')\n trigger.classList.add('is-active')\n } else {\n trigger.classList.remove('is-loading')\n trigger.classList.remove('is-active')\n }\n}\n\npage.getItemID = element => {\n // This expects the item's parent to have the item's ID\n let parent = element.parentNode\n // If the element is part of a set of controls, use the container's parent instead\n if (element.parentNode.classList.contains('controls')) parent = parent.parentNode\n return parseInt(parent.dataset.id)\n}\n\npage.domClick = event => {\n // We are processing clicks this way to avoid using \"onclick\" attribute\n // Apparently we will need to use \"unsafe-inline\" for \"script-src\" directive\n // of Content Security Policy (CSP), if we want to use \"onclick\" attribute\n // Though I think that only applies to some browsers (?)\n // Of course it wouldn't have mattered if we didn't use CSP to begin with\n // Anyway, I personally would rather not use \"onclick\" attribute\n let element = event.target\n if (!element) return\n\n // Delegate click events to their A or BUTTON parents\n if (['I'].includes(element.tagName) && ['SPAN'].includes(element.parentNode.tagName))\n element = element.parentNode\n if (['SPAN'].includes(element.tagName) && ['A', 'BUTTON'].includes(element.parentNode.tagName))\n element = element.parentNode\n\n // Skip elements that have no action data\n if (!element.dataset || !element.dataset.action) return\n\n // Skip disabled elements\n if (element.hasAttribute('disabled')) return\n\n event.stopPropagation() // maybe necessary\n const id = page.getItemID(element)\n const action = element.dataset.action\n\n switch (action) {\n // Uploads\n case 'view-list':\n return page.setUploadsView('list', element)\n case 'view-thumbs':\n return page.setUploadsView('thumbs', element)\n case 'toggle-original-names':\n return page.toggleOriginalNames(element)\n case 'add-to-album':\n return page.addToAlbum(id)\n case 'delete-upload':\n return page.deleteUpload(id)\n case 'add-selected-uploads-to-album':\n return page.addSelectedUploadsToAlbum()\n case 'bulk-delete-uploads':\n return page.bulkDeleteUploads()\n case 'display-preview':\n return page.displayPreview(id)\n // Manage uploads\n case 'upload-filters-help':\n return page.uploadFiltersHelp(element)\n case 'filter-uploads':\n return page.filterUploads(element)\n // Manage your albums\n case 'submit-album':\n return page.submitAlbum(element)\n case 'edit-album':\n return page.editAlbum(id)\n case 'disable-album':\n return page.disableAlbum(id)\n case 'view-album-uploads':\n return page.viewAlbumUploads(id, element)\n // Manage users\n case 'create-user':\n return page.createUser()\n case 'edit-user':\n return page.editUser(id)\n case 'disable-user':\n return page.disableUser(id)\n case 'delete-user':\n return page.deleteUser(id)\n case 'view-user-uploads':\n return page.viewUserUploads(id, element)\n // Others\n case 'get-new-token':\n return page.getNewToken(element)\n // Uploads & Users\n case 'clear-selection':\n return page.clearSelection()\n case 'select':\n return page.select(element, event)\n case 'select-all':\n return page.selectAll(element)\n case 'page-ellipsis':\n return page.focusJumpToPage(element)\n case 'page-prev':\n case 'page-next':\n case 'page-goto':\n case 'jump-to-page':\n return page.switchPage(action, element)\n }\n}\n\npage.fadeAndScroll = disableFading => {\n if (page.fadingIn) {\n clearTimeout(page.fadingIn)\n page.dom.classList.remove('fade-in')\n }\n\n if (!disableFading) {\n page.dom.classList.add('fade-in')\n page.fadingIn = setTimeout(() => {\n page.dom.classList.remove('fade-in')\n }, 500)\n }\n\n page.dom.scrollIntoView({\n behavior: disableFading ? 'auto' : 'smooth',\n block: 'start',\n inline: 'nearest'\n })\n}\n\npage.getByView = (view, get) => {\n switch (view) {\n case 'uploads':\n case 'uploadsAll':\n return {\n type: 'uploads',\n func: page.getUploads\n }[get]\n case 'albums':\n case 'albumsAll':\n return {\n type: 'albums',\n func: page.getAlbums\n }[get]\n case 'users':\n return {\n type: 'users',\n func: page.getUsers\n }[get]\n default:\n return null\n }\n}\n\npage.switchPage = (action, element) => {\n if (page.isSomethingLoading)\n return page.warnSomethingLoading()\n\n // eslint-disable-next-line compat/compat\n const params = Object.assign(page.views[page.currentView], {\n trigger: element\n })\n\n const func = page.getByView(page.currentView, 'func')\n\n switch (action) {\n case 'page-prev':\n params.pageNum = page.views[page.currentView].pageNum - 1\n if (params.pageNum < 0)\n return swal('An error occurred!', 'This is already the first page.', 'error')\n return func(params)\n case 'page-next':\n params.pageNum = page.views[page.currentView].pageNum + 1\n return func(params)\n case 'page-goto':\n params.pageNum = parseInt(element.dataset.goto)\n return func(params)\n case 'jump-to-page': {\n const jumpToPage = document.querySelector(`#${element.dataset.jumpid || 'jumpToPage'}`)\n if (!jumpToPage.checkValidity()) return\n const parsed = parseInt(jumpToPage.value)\n params.pageNum = isNaN(parsed) ? 0 : (parsed - 1)\n if (params.pageNum < 0) params.pageNum = 0\n return func(params)\n }\n }\n}\n\npage.focusJumpToPage = element => {\n const jumpToPage = document.querySelector(`#${element.dataset.jumpid || 'jumpToPage'}`)\n if (!jumpToPage) return\n jumpToPage.focus()\n jumpToPage.select()\n}\n\npage.getUploads = (params = {}) => {\n if (params && params.all && !page.permissions.moderator)\n return swal('An error occurred!', 'You cannot do this!', 'error')\n\n if (page.isSomethingLoading)\n return page.warnSomethingLoading()\n\n page.updateTrigger(params.trigger, 'loading')\n\n if (typeof params.pageNum !== 'number' || params.pageNum < 0)\n params.pageNum = 0\n\n const url = params.album !== undefined\n ? `api/album/${params.album}/${params.pageNum}`\n : `api/uploads/${params.pageNum}`\n\n const headers = {}\n\n if (params.all)\n headers.all = '1'\n\n if (params.filters) {\n headers.filters = params.filters\n\n // Send client timezone offset if properly using date: and/or :expiry filters\n // Server will pretend client is on UTC if unset\n if (/(^|\\s)(date|expiry):[\\d\"]/.test(params.filters))\n headers.minoffset = new Date().getTimezoneOffset()\n }\n\n axios.get(url, { headers }).then(response => {\n if (response.data.success === false)\n if (response.data.description === 'No token provided') {\n return page.verifyToken(page.token)\n } else {\n page.updateTrigger(params.trigger)\n return swal('An error occurred!', response.data.description, 'error')\n }\n\n const pages = Math.ceil(response.data.count / 25)\n const files = response.data.files\n if (params.pageNum && (files.length === 0)) {\n page.updateTrigger(params.trigger)\n if (params.autoPage) {\n params.pageNum = pages - 1\n return page.getUploads(params)\n } else {\n return swal('An error occurred!', `There are no more uploads to populate page ${params.pageNum + 1}.`, 'error')\n }\n }\n\n page.currentView = params.all ? 'uploadsAll' : 'uploads'\n page.cache = {}\n\n const albums = response.data.albums\n const users = response.data.users\n const basedomain = response.data.basedomain\n\n if (params.pageNum < 0) params.pageNum = Math.max(0, pages + params.pageNum)\n const pagination = page.paginate(response.data.count, 25, params.pageNum)\n\n const filter = `\n
${upload.name}
\n ${showOriginalNames ? `${upload.original}
` : ''}\n${upload.appendix ? `${upload.appendix} – ` : ''}${upload.prettyBytes}
\n ${hasExpiryDateColumn && upload.prettyExpiryDate ? `\nEXP: ${upload.prettyExpiryDate}
` : ''}\n\n | File name | \n ${showOriginalNames ? 'Original name | ' : ''}\n ${params.album === undefined ? `User' : 'albumid\">Album'} | ` : ''}\n ${allAlbums ? 'Album | ' : ''}\nSize | \n ${params.all ? 'IP | ' : ''}\nUpload date | \n ${hasExpiryDateColumn ? 'Expiry date | ' : ''}\n\n |
---|
\n
\n \n
\n\"
).\n Special cases such as uploads by non-registered users or have no IPs respectively, use user:-
or ip:-
.\n\n To exclude certain users/ips while still listing every other uploads, add negation sign (-
) before the keys.\n Negation sign can also be used to exclude the special cases mentioned above (i.e. -user:-
or -ip:-
).\n\n If you know the ID of a user's album, you can list its uploads with albumid key.\n Negation sign works for this key as well.\n ` : `\n There is only 1 filter key, namely albumid.\n This key can be specified more than once.\n Special case such as uploads with no albums, use albumid:-
.\n\n To exclude certain albums while still listing every other uploads, add negation sign (-
) before the keys.\n Negation sign can also be used to exclude the special case mentioned above (i.e. -albumid:-
).\n `}\n There are 2 range keys: date (upload date) and expiry (expiry date).\n Their format is: \"YYYY/MM/DD HH:MM:SS-YYYY/MM/DD HH:MM:SS\"
(\"from\" date and \"to\" date respectively).\n You may specify only one of the dates.\n If \"to\" date is missing, 'now' will be used. If \"from\" date is missing, 'beginning of time' will be used.\n If any of the subsequent date or time units are not specified, their first value will be used (e.g. January for month, 1 for day, and so on).\n If only time is specified, today's date will be used.\n If you do not need to specify both date and time, you may omit the double quotes.\n In conclusion, the following examples are all valid: date:\"2020/01/01 01:23-2018/01/01 06\"
, expiry:-2020/05
, date:12:34:56
.\n These keys can only be specified once each.\n\n Timezone? Feel free to query the dates with your own timezone.\n API requests to the filter endpoint will attach your browser's timezone offset, so the server will automatically calculate timezone differences.\n\n Matches can also be sorted with sort keys.\n Their formats are: sort:columnName[:d[escending]]
, where :d[escending]
is an optional tag to set the direction to descending.\n This key must be used with internal column names used in the database (id
, ${all ? 'userid' : 'albumid'}
, and so on),\n but there are 2 shortcuts available: date for timestamp
column and expiry for expirydate
column.\n This key can also be specified more than once, where their order will decide the sorting steps.\n\n Finally, there are type-is keys to refine by types.\n You can use is:image
and is:video
to list images and videos respectively.\n This will only use image/video extensions whose thumbnails can be generated by the safe.\n Negation sign works for this key as well.\n Mixing inclusion and exclusion is not allowed (i.e. is:image -is:video
, since the second key is redundant).\n\n Any leftover keywords which do not use keys (non-keyed keywords) will be matched against the matches' file names.\n Excluding certain keywords is also supported by adding negation sign before the keywords.\n\n Internal steps:\n ${all ? `- Query uploads passing ALL exclusion filter keys OR matching ANY filter keys, if any.\n - Refine matches` : '- Filter uploads'} using date key, if any.\n - Refine matches using expiry key, if any.\n - Refine matches using type-is keys, if any.\n - Refine matches using ANY non-keyed keywords, if any.\n - Filter matches using ALL exclusion non-keyed keywords, if any.\n - Sort matches using sorting keys, if any.\n\n Examples:\n ${all ? `- Uploads from users named \"demo\" AND/OR \"John Doe\" AND/OR non-registered users:\n user:demo user:\"John Doe\" user:-
\n - ALL uploads, but NOT the ones from user named \"demo\" AND \"John Doe\":\n -user:demo -user:\"John Doe\"
\n - Uploads from IP \"127.0.0.1\" AND which file names match \"*.rar\" OR \"*.zip\":\n ip:127.0.0.1 *.rar *.zip
\n ` : ''}- Uploads without albums:\n albumid:-
\n - ALL uploads, but NOT the ones from album with ID 69:\n -albumid:69
\n - Uploads uploaded since \"1 June 2019 00:00:00\":\n date:2019/06
\n - Uploads uploaded between \"7 April 2020 12:00:00\" and \"7 April 2020 23:59:59\":\n date:\"2020/04/07 12-2020/04/07 23:59:59\"
\n - Uploads uploaded before \"5 February 2020 00:00:00\":\n date:-2020/02/05
\n - Uploads which file names match \"*.gz\" but NOT \"*.tar.gz\":\n *.gz -*.tar.gz
\n - Sort matches by \"size\" column in ascending and descending order respectively:\n ${all ? 'user:\"John Doe\"' : '*.txt'} sort:size
\n *.mp4 ${all ? 'user:- ' : ''}sort:size:d
\n ${!page.permissions.moderator ? `\n Notice: Regular users may face some limitations in the amount of keys that can be used at a time.\n ` : ''}\n Friendly reminder: This window can be scrolled up!\n `.trim().replace(/^\\s*/g, '').replace(/\\n/g, 'You won't be able to recover ${boldObjective}!
`\n\n if (params.all) {\n const obj1 = count === 1 ? 'an upload' : 'some uploads'\n const obj2 = count === 1 ? 'another user' : 'other users'\n text += `\\nWarning: You may be nuking ${obj1} by ${obj2}!
`\n }\n\n const content = document.createElement('div')\n content.innerHTML = text\n\n swal({\n title: 'Are you sure?',\n content,\n icon: 'warning',\n dangerMode: true,\n buttons: {\n cancel: true,\n confirm: {\n text: `Yes, nuke ${params.values.length === 1 ? 'it' : 'them'}!`,\n closeModal: false\n }\n }\n }).then(proceed => {\n if (!proceed) return\n\n axios.post('api/upload/bulkdelete', {\n field: params.fields,\n values: params.values\n }).then(response => {\n if (!response) return\n\n if (response.data.success === false)\n if (response.data.description === 'No token provided') {\n return page.verifyToken(page.token)\n } else {\n return swal('An error occurred!', response.data.description, 'error')\n }\n\n const failed = Array.isArray(response.data.failed) ? response.data.failed : []\n if (failed.length === params.values.length)\n swal('An error occurred!', `Unable to delete any of the ${objective}.`, 'error')\n else if (failed.length && failed.length < params.values.length)\n swal('Warning!', `From ${objective}, unable to delete ${failed.length} of them.`, 'warning')\n else\n swal('Deleted!', `${objective} ${count === 1 ? 'has' : 'have'} been deleted.`, 'success', {\n buttons: false,\n timer: 1500\n })\n\n if (typeof params.cb === 'function')\n params.cb(failed)\n }).catch(page.onAxiosError)\n })\n}\n\npage.addSelectedUploadsToAlbum = () => {\n if (page.currentView !== 'uploads')\n return\n\n const count = page.selected[page.currentView].length\n if (!count)\n return swal('An error occurred!', 'You have not selected any uploads.', 'error')\n\n page.addUploadsToAlbum(page.selected[page.currentView], failed => {\n if (!failed) return\n if (failed.length)\n page.selected[page.currentView] = page.selected[page.currentView].filter(id => {\n return failed.includes(id)\n })\n else\n page.selected[page.currentView] = []\n\n localStorage[lsKeys.selected[page.currentView]] = JSON.stringify(page.selected[page.currentView])\n page.getUploads(page.views[page.currentView])\n })\n}\n\npage.addToAlbum = id => {\n page.addUploadsToAlbum([id], failed => {\n if (!failed) return\n page.getUploads(page.views[page.currentView])\n })\n}\n\npage.addUploadsToAlbum = (ids, callback) => {\n const count = ids.length\n\n const content = document.createElement('div')\n content.innerHTML = `\nYou are about to add ${count} upload${count === 1 ? '' : 's'} to an album.
\nIf an upload is already in an album, it will be moved.
\n\n | ID | \nName | \n ${params.all ? 'User | ' : ''}\nUploads | \nCreated at | \nPublic link | \n\n |
---|
Max length is ${page.albumTitleMaxLength} characters.
\nMax length is ${page.albumDescMaxLength} characters.
\n\n | Username | \nUploads | \nUsage | \nGroup | \nRegistration date | \nLast token update | \n\n |
---|
Username: ${response.data.username}
\nPassword: ${response.data.password}
User group: ${response.data.group}
\n `\n swal({\n title: 'Created a new user!',\n icon: 'success',\n content: div\n })\n\n // Load last page of users list\n // eslint-disable-next-line compat/compat\n page.getUsers(Object.assign(page.views.users, {\n pageNum: -1\n }))\n }).catch(page.onAxiosError)\n })\n}\n\npage.editUser = id => {\n const user = page.cache[id]\n if (!user) return\n\n const groupOptions = Object.keys(page.permissions).map((g, i, a) => {\n const selected = g === user.displayGroup\n const disabled = !(a[i + 1] && page.permissions[a[i + 1]])\n return ``\n }).join('\\n')\n\n const div = document.createElement('div')\n div.innerHTML = `\nUser ID: ${id}
\n${user.username} was renamed into: ${response.data.update.username}.
`\n autoClose = false\n displayName = response.data.update.username\n }\n\n if (response.data.update.password) {\n div.innerHTML += `\n${displayName}'s new password is:
\n${response.data.update.password}
${displayName} has been ${response.data.update.enabled ? 'enabled' : 'disabled'}!
`\n\n if (!div.innerHTML)\n div.innerHTML = `${displayName} was edited!
`\n\n swal({\n title: 'Success!',\n icon: 'success',\n content: div,\n buttons: !autoClose,\n timer: autoClose ? 1500 : null\n })\n page.getUsers(page.views.users)\n }).catch(page.onAxiosError)\n })\n}\n\npage.disableUser = id => {\n const user = page.cache[id]\n if (!user || !user.enabled) return\n\n const content = document.createElement('div')\n content.innerHTML = `\nYou will be disabling a user named ${page.cache[id].username}.
\nTheir files will remain.
\n `\n\n swal({\n title: 'Are you sure?',\n icon: 'warning',\n content,\n dangerMode: true,\n buttons: {\n cancel: true,\n confirm: {\n text: 'Yes, disable them!',\n closeModal: false\n }\n }\n }).then(proceed => {\n if (!proceed) return\n\n axios.post('api/users/disable', { id }).then(response => {\n if (!response) return\n\n if (response.data.success === false)\n if (response.data.description === 'No token provided')\n return page.verifyToken(page.token)\n else\n return swal('An error occurred!', response.data.description, 'error')\n\n swal('Success!', `${page.cache[id].username} has been disabled.`, 'success', {\n buttons: false,\n timer: 1500\n })\n page.getUsers(page.views.users)\n }).catch(page.onAxiosError)\n })\n}\n\npage.deleteUser = id => {\n const user = page.cache[id]\n if (!user) return\n\n const content = document.createElement('div')\n content.innerHTML = `\nYou will be deleting a user named ${page.cache[id].username}.
\n
Their files will remain, unless you choose otherwise.
\n `\n\n swal({\n title: 'Are you sure?',\n icon: 'warning',\n content,\n dangerMode: true,\n buttons: {\n cancel: true,\n confirm: {\n text: 'Yes, delete it!',\n closeModal: false\n },\n purge: {\n text: 'Yes, and the uploads too!',\n value: 'purge',\n className: 'swal-button--danger',\n closeModal: false\n }\n }\n }).then(proceed => {\n if (!proceed) return\n\n axios.post('api/users/delete', {\n id,\n purge: proceed === 'purge'\n }).then(response => {\n if (!response) return\n\n if (response.data.success === false) {\n const failed = Array.isArray(response.data.failed)\n ? response.data.failed\n : []\n\n if (response.data.description === 'No token provided')\n return page.verifyToken(page.token)\n else if (failed.length)\n return swal('An error occurred!', `Unable to delete ${failed.length} of the user's upload${failed.length === 1 ? '' : 's'}.`, 'error')\n else\n return swal('An error occurred!', response.data.description, 'error')\n }\n\n swal('Success!', `${page.cache[id].username} has been deleted.`, 'success', {\n buttons: false,\n timer: 1500\n })\n\n // Reload users list\n // eslint-disable-next-line compat/compat\n page.getUsers(Object.assign(page.views.users, {\n autoPage: true\n }))\n }).catch(page.onAxiosError)\n })\n}\n\n// Roughly based on https://github.com/mayuska/pagination/blob/master/index.js\npage.paginate = (totalItems, itemsPerPage, currentPage) => {\n currentPage = currentPage + 1\n const step = 3\n const numPages = Math.ceil(totalItems / itemsPerPage)\n\n let template = ''\n const elementsToShow = step * 2\n const add = {\n pageNum (start, end) {\n for (let i = start; i <= end; ++i)\n template += `${keys[i]} | \n\n |
---|