Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

Loki log drain update & ui fix (#30080)

Jordi Enric0c041e63888f
diff --git a/apps/studio/components/interfaces/LogDrains/LogDrainDestinationSheetForm.tsx b/apps/studio/components/interfaces/LogDrains/LogDrainDestinationSheetForm.tsx
index 51b183dc3fc..eb49a069446 100644
--- a/apps/studio/components/interfaces/LogDrains/LogDrainDestinationSheetForm.tsx
+++ b/apps/studio/components/interfaces/LogDrains/LogDrainDestinationSheetForm.tsx
@@ -68,6 +68,8 @@ const formUnion = z.discriminatedUnion('type', [
type: z.literal('loki'),
url: z.string().min(1, { message: 'Loki URL is required' }),
headers: z.record(z.string(), z.string()),
+ username: z.string().optional(),
+ password: z.string().optional(),
}),
])
@@ -162,6 +164,8 @@ export function LogDrainDestinationSheetForm({
url: defaultValues?.config?.url || '',
api_key: defaultValues?.config?.api_key || '',
region: defaultValues?.config?.region || '',
+ username: defaultValues?.config?.username || '',
+ password: defaultValues?.config?.password || '',
},
})
@@ -422,10 +426,24 @@ export function LogDrainDestinationSheetForm({
<LogDrainFormItem
type="url"
value="url"
+ placeholder="https://my-logs-endpoint.grafana.net/loki/api/v1/push"
label="Loki URL"
formControl={form.control}
description="The Loki HTTP(S) endpoint to send events."
/>
+ <LogDrainFormItem
+ value="username"
+ label="Username"
+ placeholder="123456789"
+ formControl={form.control}
+ />
+ <LogDrainFormItem
+ type="password"
+ value="password"
+ label="Password"
+ placeholder="glc_ABCD1234567890"
+ formControl={form.control}
+ />
</div>
)}
<FormMessage_Shadcn_ />
diff --git a/apps/studio/components/interfaces/LogDrains/LogDrains.tsx b/apps/studio/components/interfaces/LogDrains/LogDrains.tsx
index 894832547f7..acd9d90ec13 100644
--- a/apps/studio/components/interfaces/LogDrains/LogDrains.tsx
+++ b/apps/studio/components/interfaces/LogDrains/LogDrains.tsx
@@ -131,8 +131,15 @@ export function LogDrains({
<TableBody>
{logDrains?.map((drain) => (
<TableRow key={drain.id}>
- <TableCell className="font-medium">{drain.name}</TableCell>
- <TableCell>{drain.description}</TableCell>
+ <TableCell className="font-medium truncate max-w-72" title={drain.name}>
+ {drain.name}
+ </TableCell>
+ <TableCell
+ className="text-foreground-light truncate max-w-72"
+ title={drain.description}
+ >
+ {drain.description}
+ </TableCell>
<TableCell className="text-right font-mono">{drain.type}</TableCell>
<TableCell className="text-right">
<DropdownMenu>
@@ -180,7 +187,7 @@ export function LogDrains({
}}
onCancel={() => setIsDeleteModalOpen(false)}
>
- <div className="text-foreground-light">
+ <div className="text-foreground-light text-sm">
<p>
Are you sure you want to delete{' '}
<span className="text-foreground">{selectedLogDrain?.name}</span>?