window.Redirect = class { static routes = { "home": "/", "dash": "/dash", "consoleAuthorization": "consoleAuthorization", "cliLogin": "cliLogin", "doLogin": "/do/login", "logout": "/logout", "login": "/door", "404": "/404", "routes": "/routes.js", "initializeDb": "/do/initializeDb", "test_universal": "test_universal", "test_init_db": "test_init_db", "test_menu_debug": "test_menu_debug", "testExcelParser": "test-excel-parser", "getScript": "/script/${idFile}.js", "webhookDeploy": "/webhook/deploy", "getFile": "/file/${token}/${size}", "saveTable": "/do/saveTable", "dbCacheRebuild": "dbCacheRebuild", "dbCacheClear": "dbCacheClear", "groupsTable": "/groupsTable", "doRemoveUser": "/do/doRemoveUser", "usersEditTable": "/get/usersEditTable", "doUnserialize": "/do/unserialize", "clearCache": "clearCache", "modalFileUpload": "/modalFileUpload", "modalImageSelector": "/modalImageSelector", "backupRestoreRun": "/backup/restore/run", "backupManualRun": "/backup/manual/run", "backupCronRun": "/backup/cron/run", "scheduledTasksTick": "/scheduledTasks/tick", "scheduledTasksCronCompatibility": "/cron/tasks/execute", "testRedis": "test-redis" }; static route(name, parameters = {}) { if (!this.routes[name]) { console.error(`Route "${name}" not found.`); return null; } let path = this.routes[name]; for (const [key, value] of Object.entries(parameters)) { path = path.replace(new RegExp(`\\$\\{${key}\\}`, "g"), value); } return path; } };