window.Redirect = class { static routes = { "dash": "/dash", "consoleAuthorization": "consoleAuthorization", "cliLogin": "cliLogin", "doLogin": "/do/login", "logout": "/do/logout", "login": "/door", "404": "/404", "routes": "/routes.js", "install": "/install", "initializeDb": "/do/initializeDb", "getScript": "/script/${idFile}.js", "getFile": "/file/${token}", "saveTable": "/do/saveTable", "preLoginUser": "/do/preLoginUser", "groupsTable": "/groupsTable", "doSaveProfile": "/do/doSaveProfile", "doRemoveUser": "/do/doRemoveUser", "usersEditTable": "/get/usersEditTable", "editProfile": "/api/editProfile/${users_id}", "doUnserialize": "/do/unserialize", "financeIncomeTable": "/finance/income/table" }; 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; } };