From 6fce2258ba2b1e1b4686504428dd0073df87e73b Mon Sep 17 00:00:00 2001 From: Tsu-ba-me Date: Mon, 16 Oct 2023 04:51:32 -0400 Subject: [PATCH] fix(striker-ui-api): find pre-def cpu vendor before extract first word --- striker-ui-api/src/lib/request_handlers/anvil/getAnvilCpu.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/striker-ui-api/src/lib/request_handlers/anvil/getAnvilCpu.ts b/striker-ui-api/src/lib/request_handlers/anvil/getAnvilCpu.ts index 1c28d9e0..ba152df2 100644 --- a/striker-ui-api/src/lib/request_handlers/anvil/getAnvilCpu.ts +++ b/striker-ui-api/src/lib/request_handlers/anvil/getAnvilCpu.ts @@ -102,7 +102,8 @@ export const getAnvilCpu: RequestHandler = async ( const cores = Number(rCores); const threads = Number(rThreads); - const vendor = model.replace(/^(\w+).*$/, '$1'); + const matched = model.match(/amd|arm|intel|powerpc/i); + const vendor = matched ? matched[0] : model.replace(/^(\w+).*$/, '$1'); previous.hosts[uuid] = { cores,