diff --git a/striker-ui-api/src/lib/request_handlers/host/buildQueryHostDetail.ts b/striker-ui-api/src/lib/request_handlers/host/buildQueryHostDetail.ts index 7f4307af..c7458264 100644 --- a/striker-ui-api/src/lib/request_handlers/host/buildQueryHostDetail.ts +++ b/striker-ui-api/src/lib/request_handlers/host/buildQueryHostDetail.ts @@ -1,6 +1,7 @@ import { buildKnownIDCondition } from '../../buildCondition'; import { buildQueryResultModifier } from '../../buildQueryResultModifier'; import { cap } from '../../cap'; +import { getShortHostName } from '../../getShortHostName'; import { stdout } from '../../shell'; type ExtractVariableKeyFunction = (parts: string[]) => string; @@ -14,7 +15,7 @@ const MAP_TO_EXTRACTOR: { [prefix: string]: ExtractVariableKeyFunction } = { head, ); }, - 'install-target': () => 'installTargetEnable', + 'install-target': () => 'installTarget', }; export const buildQueryHostDetail: BuildQueryDetailFunction = ({ @@ -42,9 +43,13 @@ export const buildQueryHostDetail: BuildQueryDetailFunction = ({ const afterQueryReturn: QueryResultModifierFunction = buildQueryResultModifier((output) => { const [hostName, hostUUID] = output[0]; + const shortHostName = getShortHostName(hostName); return output.reduce< - { hostName: string; hostUUID: string } & Record + { hostName: string; hostUUID: string; shortHostName: string } & Record< + string, + string + > >( (previous, [, , variableName, variableValue]) => { const [variablePrefix, ...restVariableParts] = @@ -55,7 +60,7 @@ export const buildQueryHostDetail: BuildQueryDetailFunction = ({ return previous; }, - { hostName, hostUUID }, + { hostName, hostUUID, shortHostName }, ); });