mirror of
https://github.com/abhinavxd/libredesk.git
synced 2026-09-22 02:23:32 +00:00
f72f158cf0
- update file imports to use shared-ui utils and remove redundant file.js - Implement SignedURLStore interface for fs store
14 lines
363 B
JavaScript
14 lines
363 B
JavaScript
export function formatBytes (bytes) {
|
|
if (bytes < 1024 * 1024) {
|
|
return (bytes / 1024).toFixed(2) + ' KB'
|
|
} else {
|
|
return (bytes / (1024 * 1024)).toFixed(2) + ' MB'
|
|
}
|
|
}
|
|
|
|
export function getThumbFilepath (filepath) {
|
|
const urlParts = filepath.split('/')
|
|
const filename = urlParts.pop()
|
|
return `/uploads/thumb_${filename}`
|
|
}
|