Skip to content

Commit b6b1b6d

Browse files
adityathebemoshloop
authored andcommitted
feat: Show agent in config details
1 parent 49e4131 commit b6b1b6d

2 files changed

Lines changed: 27 additions & 3 deletions

File tree

src/api/services/configs.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,12 @@ export const getAllChanges = (
143143
);
144144
};
145145

146+
type ConfigDetail = ConfigItem & {
147+
agent_name: string;
148+
};
149+
146150
export const getConfig = (id: string) =>
147-
resolvePostGrestRequestWithPagination<ConfigItem[]>(
151+
resolvePostGrestRequestWithPagination<ConfigDetail[]>(
148152
ConfigDB.get(`/config_detail?id=eq.${id}&select=*,config_scrapers(id,name)`)
149153
);
150154

src/components/Configs/Sidebar/ConfigDetails.tsx

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import { DisplayGroupedProperties } from "../../Utils/DisplayGroupedProperties";
1414
import ConfigCostValue from "../ConfigCosts/ConfigCostValue";
1515
import ConfigsTypeIcon from "../ConfigsTypeIcon";
1616
import { formatConfigLabels } from "./Utils/formatConfigLabels";
17+
import { MdOutlineSupportAgent } from "react-icons/md";
1718

1819
type Props = {
1920
configId: string;
@@ -151,7 +152,6 @@ export function ConfigDetails({ configId }: Props) {
151152
]}
152153
/>
153154
)}
154-
155155
<DisplayDetailsRow
156156
items={[
157157
{
@@ -178,7 +178,6 @@ export function ConfigDetails({ configId }: Props) {
178178
}
179179
]}
180180
/>
181-
182181
<DisplayDetailsRow
183182
items={[
184183
{
@@ -204,6 +203,27 @@ export function ConfigDetails({ configId }: Props) {
204203
]}
205204
/>
206205

206+
<DisplayDetailsRow
207+
items={[
208+
{
209+
label: "Agent",
210+
value: (
211+
<div className="flex items-center">
212+
<Link
213+
to={`/settings/agents?id=${configDetails.agent_id}`}
214+
className="flex items-center text-blue-500 hover:underline"
215+
target="_blank"
216+
rel="noopener noreferrer"
217+
>
218+
<MdOutlineSupportAgent className="mr-1 text-gray-600" />
219+
{configDetails.agent_name}
220+
</Link>
221+
</div>
222+
)
223+
}
224+
]}
225+
/>
226+
207227
<DisplayDetailsRow items={types} />
208228

209229
<DisplayGroupedProperties items={properties} />

0 commit comments

Comments
 (0)