fix(striker-ui-api): sort hosts by name

main
Tsu-ba-me 1 year ago
parent 2dc0fd3835
commit df7b5fa397
  1. 3
      striker-ui-api/src/lib/request_handlers/host/buildQueryHostDetail.ts
  2. 3
      striker-ui-api/src/lib/request_handlers/host/getHost.ts

@ -75,7 +75,8 @@ export const buildQueryHostDetail: BuildQueryDetailFunction = ({
AND b.variable_value = c.network_interface_mac_address AND b.variable_value = c.network_interface_mac_address
AND a.host_uuid = c.network_interface_host_uuid AND a.host_uuid = c.network_interface_host_uuid
WHERE ${condHostUUIDs} WHERE ${condHostUUIDs}
ORDER BY cvar_name ASC, ORDER BY a.host_name ASC,
cvar_name ASC,
b.variable_name ASC;`; b.variable_name ASC;`;
const afterQueryReturn: QueryResultModifierFunction = const afterQueryReturn: QueryResultModifierFunction =

@ -29,7 +29,8 @@ export const getHost = buildGetRequestHandler((request, buildQueryOptions) => {
hos.host_type, hos.host_type,
hos.host_uuid hos.host_uuid
FROM hosts AS hos FROM hosts AS hos
${condition};`; ${condition}
ORDER BY hos.host_name ASC;`;
let afterQueryReturn: QueryResultModifierFunction | undefined = let afterQueryReturn: QueryResultModifierFunction | undefined =
buildQueryResultReducer<{ [hostUUID: string]: HostOverview }>( buildQueryResultReducer<{ [hostUUID: string]: HostOverview }>(
(previous, [hostName, hostType, hostUUID]) => { (previous, [hostName, hostType, hostUUID]) => {

Loading…
Cancel
Save