feat: paste compression & verification enforcement settings; enforce 2fa on admins setting; increase paste validation; anonymous uploads

fix: minor styling issue on main elements; resolve lint issue
refactor: remove 2FA badge on user pages; enhance paste creation flow; body background color always neutral-950; improve paste creation paste info (lines, cchars etc) for mobile
This commit is contained in:
2026-01-08 15:25:42 -05:00
parent fabef95159
commit 9f55aa1b22
16 changed files with 186 additions and 75 deletions
+8 -8
View File
@@ -1,16 +1,16 @@
export function formatBytes(bytes: number, decimals = 2): string {
if (bytes === 0) return '0 Bytes';
if (bytes === 0) return '0 Bytes';
const unit = 1024;
const units = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
const unit = 1024;
const units = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
const exponent = Math.floor(Math.log(bytes) / Math.log(unit));
const value = bytes / Math.pow(unit, exponent);
const exponent = Math.floor(Math.log(bytes) / Math.log(unit));
const value = bytes / Math.pow(unit, exponent);
const unitLabel = value === 1 && exponent === 0 ? 'Byte' : units[exponent];
const formattedValue = Number.isInteger(value) ? value : value.toFixed(decimals);
const unitLabel = value === 1 && exponent === 0 ? 'Byte' : units[exponent];
const formattedValue = Number.isInteger(value) ? value : value.toFixed(decimals);
return `${formattedValue} ${unitLabel}`;
return `${formattedValue} ${unitLabel}`;
}
export function formatNumber(num: number): string {