diff --git a/runner/src/server/plugins/router.ts b/runner/src/server/plugins/router.ts index 6b7bd57ad..90ad7b627 100644 --- a/runner/src/server/plugins/router.ts +++ b/runner/src/server/plugins/router.ts @@ -145,18 +145,23 @@ export default { } let startPage = "/"; + let name = ""; const { referer } = request.headers; + console.log("🚀 ~ referer", referer) if (referer) { - const match = referer.match(/https?:\/\/[^/]+\/([^/]+).*/); + const match = referer.match(/https?:\/\/[^/]+\/([^/]+)(\/([^/]+))?.*/); if (match && match.length > 1) { startPage = `/${match[1]}`; + name = (match[1].split(/(?=[A-Z])/)).toString() + name = (name[0]+name.slice(1).toLowerCase()).replaceAll(",", " ") } } - + return h.view("timeout", { startPage, + name }); }, }); diff --git a/runner/tsconfig.json b/runner/tsconfig.json index 878beb1d5..ae227afe0 100644 --- a/runner/tsconfig.json +++ b/runner/tsconfig.json @@ -15,7 +15,8 @@ "dom", "ES2020.Promise", "ES2019.Object", - "ES2019.Array" + "ES2019.Array", + "ES2021.String" ], "skipLibCheck": true },