(text: any)
| 338 | throw new Error("Failed to decrypt credentials. The key file may have been changed/deleted."); |
| 339 | } |
| 340 | } |
| 341 | |
| 342 | // Fixed htmlEscape function |
| 343 | async function unitConvert(bytes: number, isBytes: boolean = false): Promise<string> { |
| 344 | const power = 1000; |
| 345 | let value = bytes; |
| 346 | let unitIndex = 0; |
| 347 | const units = isBytes |
| 348 | ? ["B", "KB", "MB", "GB", "TB"] |
| 349 | : ["bps", "Kbps", "Mbps", "Gbps", "Tbps"]; |