|
|
@ -1,5 +1,7 @@ |
|
|
|
import { RequestHandler } from 'express'; |
|
|
|
import { RequestHandler } from 'express'; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import { DELETED } from '../../consts'; |
|
|
|
|
|
|
|
|
|
|
|
import { query } from '../../accessModule'; |
|
|
|
import { query } from '../../accessModule'; |
|
|
|
import { getShortHostName } from '../../disassembleHostName'; |
|
|
|
import { getShortHostName } from '../../disassembleHostName'; |
|
|
|
import { stderr } from '../../shell'; |
|
|
|
import { stderr } from '../../shell'; |
|
|
@ -72,7 +74,8 @@ export const getAnvilCpu: RequestHandler<AnvilDetailParamsDictionary> = async ( |
|
|
|
FROM servers AS a |
|
|
|
FROM servers AS a |
|
|
|
JOIN server_definitions AS b |
|
|
|
JOIN server_definitions AS b |
|
|
|
ON a.server_uuid = b.server_definition_server_uuid |
|
|
|
ON a.server_uuid = b.server_definition_server_uuid |
|
|
|
WHERE a.server_anvil_uuid = '${anvilUuid}';`,
|
|
|
|
WHERE a.server_state != '${DELETED}' |
|
|
|
|
|
|
|
AND a.server_anvil_uuid = '${anvilUuid}';`,
|
|
|
|
); |
|
|
|
); |
|
|
|
} catch (error) { |
|
|
|
} catch (error) { |
|
|
|
stderr(`Failed to get anvil ${anvilUuid} server cpu info; CAUSE: ${error}`); |
|
|
|
stderr(`Failed to get anvil ${anvilUuid} server cpu info; CAUSE: ${error}`); |
|
|
@ -99,7 +102,8 @@ export const getAnvilCpu: RequestHandler<AnvilDetailParamsDictionary> = async ( |
|
|
|
|
|
|
|
|
|
|
|
const cores = Number(rCores); |
|
|
|
const cores = Number(rCores); |
|
|
|
const threads = Number(rThreads); |
|
|
|
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] = { |
|
|
|
previous.hosts[uuid] = { |
|
|
|
cores, |
|
|
|
cores, |
|
|
|