Skip to content

Commit

Permalink
chore: add icon for linking to agent
Browse files Browse the repository at this point in the history
  • Loading branch information
mainawycliffe authored and moshloop committed Sep 2, 2024
1 parent 5fd5415 commit 88a9645
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 17 additions & 1 deletion src/components/Integrations/Table/IntegrationsTableColumns.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import AgentBadge from "@flanksource-ui/components/Agents/AgentBadge";
import JobHistoryStatusColumn from "@flanksource-ui/components/JobsHistory/JobHistoryStatusColumn";
import { JobsHistoryDetails } from "@flanksource-ui/components/JobsHistory/JobsHistoryDetails";
import { JobHistoryStatus } from "@flanksource-ui/components/JobsHistory/JobsHistoryTable";
import ResourceSettingsSourceLink from "@flanksource-ui/components/Settings/ResourceSettingsSourceLink";
import { Age } from "@flanksource-ui/ui/Age";
import { Avatar } from "@flanksource-ui/ui/Avatar";
import { LogsIcon } from "@flanksource-ui/ui/Icons/LogsIcon";
Expand Down Expand Up @@ -90,7 +91,22 @@ export const integrationsTableColumns: MRT_ColumnDef<SchemaResourceWithJobStatus
{
id: "source",
header: "Source",
accessorKey: "source"
accessorKey: "source",
Cell: ({ row }) => {
const { source, id, name, namespace, agent } = row.original;

return (
<ResourceSettingsSourceLink
source={source}
id={id}
name={name}
namespace={namespace}
agentName={agent?.name}
agentId={agent?.id}
showMinimal
/>
);
}
},
{
id: "job_status",
Expand Down
3 changes: 3 additions & 0 deletions src/components/Settings/ResourceSettingsSourceLink.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { RiRobot2Fill } from "react-icons/ri";
import { Link } from "react-router-dom";
import CRDSource from "./CRDSource";
import { CatalogResourceSource } from "./CatalogResourceSource";
Expand Down Expand Up @@ -32,6 +33,7 @@ export default function ResourceSettingsSourceLink({
to={`/settings/agents?id=${agentId}`}
className="cursor-pointer text-blue-500 underline"
>
<RiRobot2Fill className="mr-1 inline" />
<span>link</span>
</Link>
) : (
Expand All @@ -41,6 +43,7 @@ export default function ResourceSettingsSourceLink({
to={`/settings/agents?id=${agentId}`}
className="cursor-pointer text-blue-500 underline"
>
<RiRobot2Fill className="mr-1 inline" />
<span>{agentName}</span>
</Link>
</>
Expand Down

0 comments on commit 88a9645

Please sign in to comment.