Merge pull request 'api/machines: move configuration data into subattribute' (#5048) from api-list-machines into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/5048
This commit is contained in:
@@ -136,7 +136,7 @@ export const SidebarBody = (props: SidebarProps) => {
|
||||
<MachineRoute
|
||||
clanURI={clanURI}
|
||||
machineID={id}
|
||||
name={machine.name || id}
|
||||
name={machine.data.name || id}
|
||||
serviceCount={0}
|
||||
/>
|
||||
)}
|
||||
|
||||
@@ -26,13 +26,19 @@ const mockFetcher: Fetcher = <K extends OperationNames>(
|
||||
const resultData: Partial<ResultDataMap> = {
|
||||
list_machines: {
|
||||
pandora: {
|
||||
name: "pandora",
|
||||
data: {
|
||||
name: "pandora",
|
||||
},
|
||||
},
|
||||
enceladus: {
|
||||
name: "enceladus",
|
||||
data: {
|
||||
name: "enceladus",
|
||||
},
|
||||
},
|
||||
dione: {
|
||||
name: "dione",
|
||||
data: {
|
||||
name: "dione",
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
@@ -62,20 +62,28 @@ const mockFetcher: Fetcher = <K extends OperationNames>(
|
||||
},
|
||||
list_machines: {
|
||||
jon: {
|
||||
name: "jon",
|
||||
tags: ["all", "nixos", "tag1"],
|
||||
data: {
|
||||
name: "jon",
|
||||
tags: ["all", "nixos", "tag1"],
|
||||
},
|
||||
},
|
||||
sara: {
|
||||
name: "sara",
|
||||
tags: ["all", "darwin", "tag2"],
|
||||
data: {
|
||||
name: "sara",
|
||||
tags: ["all", "darwin", "tag2"],
|
||||
},
|
||||
},
|
||||
kyra: {
|
||||
name: "kyra",
|
||||
tags: ["all", "darwin", "tag2"],
|
||||
data: {
|
||||
name: "kyra",
|
||||
tags: ["all", "darwin", "tag2"],
|
||||
},
|
||||
},
|
||||
leila: {
|
||||
name: "leila",
|
||||
tags: ["all", "darwin", "tag2"],
|
||||
data: {
|
||||
name: "leila",
|
||||
tags: ["all", "darwin", "tag2"],
|
||||
},
|
||||
},
|
||||
},
|
||||
list_tags: {
|
||||
|
||||
@@ -120,7 +120,7 @@ const SelectService = () => {
|
||||
label: t,
|
||||
type: "tag" as const,
|
||||
members: Object.entries(machinesQuery.data || {})
|
||||
.filter(([_, m]) => m.tags?.includes(t))
|
||||
.filter(([_, m]) => m.data.tags?.includes(t))
|
||||
.map(([k]) => k),
|
||||
};
|
||||
});
|
||||
@@ -206,7 +206,7 @@ const useOptions = (tagsQuery: TagsQuery, machinesQuery: MachinesQuery) =>
|
||||
label: tag,
|
||||
value: "t_" + tag,
|
||||
members: Object.entries(machines)
|
||||
.filter(([_, v]) => v.tags?.includes(tag))
|
||||
.filter(([_, v]) => v.data.tags?.includes(tag))
|
||||
.map(([k]) => k),
|
||||
}));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user