Skip to content

Commit d817ad0

Browse files
committed
feat(insights): add summary column and fix badge image rendering
1 parent 64968f0 commit d817ad0

3 files changed

Lines changed: 20 additions & 6 deletions

File tree

src/api/services/configs.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -862,7 +862,7 @@ export const getAllConfigInsights = async (
862862

863863
return resolvePostGrestRequestWithPagination(
864864
ConfigDB.get<ConfigAnalysis[] | null>(
865-
`/config_analysis_items?select=id,analysis_type,analyzer,severity,status,source,first_observed,last_observed,config:configs(id,name,config_class,type)${pagingParams}${queryParamsString}${sortString}`,
865+
`/config_analysis_items?select=id,analysis_type,analyzer,summary,severity,status,source,first_observed,last_observed,config:configs(id,name,config_class,type)${pagingParams}${queryParamsString}${sortString}`,
866866
{
867867
headers: {
868868
Prefer: "count=exact"

src/components/Configs/Insights/ConfigInsightsColumns.tsx

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export const ConfigInsightsColumns: MRT_ColumnDef<
3434
header: "Type",
3535
id: "analysis_type",
3636
accessorKey: "analysis_type",
37-
size: 50,
37+
size: 80,
3838
Cell: ({ cell }) => {
3939
const data = cell.row.original;
4040

@@ -78,6 +78,22 @@ export const ConfigInsightsColumns: MRT_ColumnDef<
7878
},
7979
enableSorting: false
8080
},
81+
{
82+
header: "Summary",
83+
id: "summary",
84+
accessorKey: "summary",
85+
size: 300,
86+
enableSorting: false,
87+
Cell: ({ cell }) => {
88+
const value = cell.getValue<string>();
89+
if (!value) return null;
90+
return (
91+
<span className="overflow-hidden overflow-ellipsis text-gray-600">
92+
{value.charAt(0).toUpperCase() + value.slice(1)}
93+
</span>
94+
);
95+
}
96+
},
8197
{
8298
header: "Severity",
8399
id: "severity",

src/components/Topology/TopologyCard/FormatProperty.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { Property as PropertyD } from "@flanksource-ui/api/types/topology";
22
import { Age } from "@flanksource-ui/ui/Age";
3-
import Image from "next/image";
43
import { FiExternalLink } from "react-icons/fi";
54
import {
65
FormatPropertyCPUMemory,
@@ -43,11 +42,10 @@ export function FormatProperty({
4342

4443
if (property.type === "badge") {
4544
return (
46-
<Image
45+
// eslint-disable-next-line @next/next/no-img-element
46+
<img
4747
src={property.text!}
4848
alt={property.label || property.name}
49-
height={20}
50-
width={80}
5149
className="inline-block h-5 w-auto"
5250
/>
5351
);

0 commit comments

Comments
 (0)