+
+
+ {getImage(image, isGroup)}
+
+
+ {getServiceLink(id, name, isGroup, isFiltered)}
+ {getOpenInNewWindowLink(webUrl)}
+
+
+
+ );
+ }
+);
+
export function nameRenderer(
isFiltered: boolean,
service: Service | Pod | ServiceTree
): React.ReactNode {
- const id: string = encodeURIComponent(service.getId().toString());
- const isGroup = service instanceof ServiceTree;
- const serviceLink = isGroup
- ? `/services/overview/${id}`
- : `/services/detail/${id}`;
+ // These do not work with instanceof ServiceTree due to TS
+ const image =
+ service instanceof Pod || service instanceof Service
+ ? service.getImages()["icon-small"]
+ : null;
+ const webUrl =
+ service instanceof Pod || (service instanceof Service && hasWebUI(service))
+ ? service.getWebURL()
+ : null;
return (
-