The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.
TypeScript aialternativeauthdatabasedenoembeddingsexamplefirebasenextjsoauth2pgvectorpostgispostgrespostgresqlpostgrestrealtimesupabasevectorswebsockets
Clean up unused logs selection renderers (#35116)
Joshen Limf183ba2c6884
diff --git a/apps/studio/components/interfaces/Settings/Logs/LogSelectionRenderers/AuthSelectionRenderer.tsx b/apps/studio/components/interfaces/Settings/Logs/LogSelectionRenderers/AuthSelectionRenderer.tsxdeleted file mode 100644index c6d18724f4e..00000000000--- a/apps/studio/components/interfaces/Settings/Logs/LogSelectionRenderers/AuthSelectionRenderer.tsx+++ /dev/null@@ -1,56 +0,0 @@-import { LOGS_TAILWIND_CLASSES } from '../Logs.constants'-import type { PreviewLogData } from '../Logs.types'-import {- jsonSyntaxHighlight,- ResponseCodeFormatter,- SelectionDetailedRow,- SelectionDetailedTimestampRow,- SeverityFormatter,-} from '../LogsFormatters'--const AuthSelectionRenderer = ({ log }: { log: PreviewLogData }) => {- return (- <div className={`${LOGS_TAILWIND_CLASSES.log_selection_x_padding} space-y-6`}>- <div className="flex flex-col gap-3">- <h3 className="text-foreground-lighter text-sm">Event Message</h3>- <div className="text-xs text-wrap font-mono text-foreground whitespace-pre-wrap overflow-x-auto">- {log.metadata?.msg || log.event_message}- </div>- </div>-- <SelectionDetailedTimestampRow value={log.timestamp} />- {log.metadata?.status && (- <SelectionDetailedRow- label="Status"- value={String(log.metadata?.status)}- valueRender={<ResponseCodeFormatter value={log.metadata?.status} />}- />- )}- {log.metadata?.level && (- <SelectionDetailedRow- label="Severity"- value={log.metadata?.level}- valueRender={<SeverityFormatter value={log.metadata?.level} />}- />- )}- {log.metadata?.path && (- <SelectionDetailedRow label="Request Path" value={log.metadata?.path} />- )}- {log.metadata?.error && (- <SelectionDetailedRow label="Error Message" value={log.metadata?.error} />- )}-- <div className="flex flex-col gap-3">- <h3 className="text-foreground-lighter text-sm">Metadata</h3>- <pre- className=" className={`text-foreground text-sm col-span-8 overflow-x-auto text-xs font-mono`}"- dangerouslySetInnerHTML={{- __html: jsonSyntaxHighlight(log.metadata!),- }}- />- </div>- </div>- )-}--export default AuthSelectionRendererdiff --git a/apps/studio/components/interfaces/Settings/Logs/LogSelectionRenderers/DatabaseApiSelectionRender.tsx b/apps/studio/components/interfaces/Settings/Logs/LogSelectionRenderers/DatabaseApiSelectionRender.tsxdeleted file mode 100644index 055552e3e7a..00000000000--- a/apps/studio/components/interfaces/Settings/Logs/LogSelectionRenderers/DatabaseApiSelectionRender.tsx+++ /dev/null@@ -1,69 +0,0 @@-import React from 'react'-import { LOGS_TAILWIND_CLASSES } from '../Logs.constants'-import LogsDivider from '../Logs.Divider'-import {- jsonSyntaxHighlight,- ResponseCodeFormatter,- SelectionDetailedRow,- SelectionDetailedTimestampRow,-} from '../LogsFormatters'--const DatabaseApiSelectionRender = ({ log }: any) => {- const request = log?.metadata[0]?.request?.[0]- const response = log?.metadata[0]?.response?.[0]- const method = request?.method- const status = response?.status_code- const ipAddress = request?.headers?.[0]?.cf_connecting_ip- const countryOrigin = request?.headers?.[0]?.cf_ipcountry- const clientInfo = request?.headers?.[0]?.x_client_info- const referer = request?.headers?.[0]?.referer- const redirectIdentifier = log?.metadata[0]?.load_balancer_redirect_identifier-- return (- <>- <div className={`${LOGS_TAILWIND_CLASSES.log_selection_x_padding} space-y-2`}>- <SelectionDetailedRow- label="Status"- value={status}- valueRender={<ResponseCodeFormatter value={status} />}- />- <SelectionDetailedRow label="Method" value={method} />- <SelectionDetailedTimestampRow value={log.timestamp} />- <SelectionDetailedRow label="IP Address" value={ipAddress} />- <SelectionDetailedRow label="Origin Country" value={countryOrigin} />- {clientInfo && <SelectionDetailedRow label="Client" value={clientInfo} />}- {referer && <SelectionDetailedRow label="Referer" value={referer} />}- {redirectIdentifier && (- <SelectionDetailedRow label="Redirect Identifier" value={redirectIdentifier} />- )}- </div>- <LogsDivider />- <div className={`${LOGS_TAILWIND_CLASSES.log_selection_x_padding}`}>- <h3 className="text-foreground-light mb-4 font-mono text-sm uppercase">Request Metadata</h3>- <pre className="text-sm syntax-highlight overflow-x-auto mb-4">- <div- className="text-wrap"- dangerouslySetInnerHTML={{- __html: request ? jsonSyntaxHighlight(log.metadata[0].request[0]) : '',- }}- />- </pre>- </div>- <LogsDivider />- <div className={`${LOGS_TAILWIND_CLASSES.log_selection_x_padding}`}>- <h3 className="text-foreground-light mb-4 font-mono text-sm uppercase">- Response Metadata- </h3>- <pre className="text-sm syntax-highlight overflow-x-auto mb-4">- <div- dangerouslySetInnerHTML={{- __html: response ? jsonSyntaxHighlight(log.metadata[0].response[0]) : '',- }}- />- </pre>- </div>- </>- )-}--export default DatabaseApiSelectionRenderdiff --git a/apps/studio/components/interfaces/Settings/Logs/LogSelectionRenderers/DatabasePostgresSelectionRender.tsx b/apps/studio/components/interfaces/Settings/Logs/LogSelectionRenderers/DatabasePostgresSelectionRender.tsxdeleted file mode 100644index ff4cf03666f..00000000000--- a/apps/studio/components/interfaces/Settings/Logs/LogSelectionRenderers/DatabasePostgresSelectionRender.tsx+++ /dev/null@@ -1,65 +0,0 @@-import { Alert } from 'ui'-import { LOGS_TAILWIND_CLASSES } from '../Logs.constants'-import LogsDivider from '../Logs.Divider'-import {- jsonSyntaxHighlight,- SelectionDetailedRow,- SelectionDetailedTimestampRow,- SeverityFormatter,-} from '../LogsFormatters'--const DatabasePostgresSelectionRender = ({ log }: any) => {- const postgresUsername = log?.metadata[0]?.parsed[0]?.user_name- const sessionId = log?.metadata[0]?.parsed[0]?.session_id- const hint = log?.metadata[0]?.parsed[0]?.hint- const errorSeverity = log?.metadata[0]?.parsed[0]?.error_severity-- return (- <>- <div className={LOGS_TAILWIND_CLASSES.log_selection_x_padding}>- <span className="col-span-4 text-sm text-foreground-lighter">Event message</span>-- <div className="text-wrap mt-2 overflow-x-auto whitespace-pre-wrap font-mono text-xs text-foreground">- {log.event_message}- </div>- </div>- <LogsDivider />- <div className={`${LOGS_TAILWIND_CLASSES.log_selection_x_padding} space-y-2`}>- <SelectionDetailedRow- label="Severity"- value={errorSeverity}- valueRender={<SeverityFormatter value={errorSeverity} />}- />- <SelectionDetailedTimestampRow value={log.timestamp} />- <SelectionDetailedRow label="Postgres Username" value={postgresUsername} />- <SelectionDetailedRow label="Session ID" value={sessionId} />- </div>- {hint && (- <div className={`mt-4 ${LOGS_TAILWIND_CLASSES.log_selection_x_padding}`}>- <Alert variant="warning" withIcon title={hint} />- </div>- )}- <LogsDivider />- <div className={LOGS_TAILWIND_CLASSES.log_selection_x_padding}>- <h3 className="mb-4 text-lg text-foreground">Metadata</h3>- <pre className="syntax-highlight overflow-x-auto text-sm">- <div- className="text-wrap"- dangerouslySetInnerHTML={{- __html: log.metadata ? jsonSyntaxHighlight(log.metadata[0]) : '',- }}- />- </pre>- </div>- </>- )-}--export const DatabaseApiSelectionHeaderRender = (log: any) => {- const method = log?.metadata[0]?.request[0]?.method- const path = log?.metadata[0]?.request[0]?.path-- return `${method} ${path}`-}--export default DatabasePostgresSelectionRenderdiff --git a/apps/studio/components/interfaces/Settings/Logs/LogSelectionRenderers/FunctionInvocationSelectionRender.tsx b/apps/studio/components/interfaces/Settings/Logs/LogSelectionRenderers/FunctionInvocationSelectionRender.tsxdeleted file mode 100644index 1035b3b7007..00000000000--- a/apps/studio/components/interfaces/Settings/Logs/LogSelectionRenderers/FunctionInvocationSelectionRender.tsx+++ /dev/null@@ -1,69 +0,0 @@-import { filterFunctionsRequestResponse } from 'lib/logs'-import { LOGS_TAILWIND_CLASSES } from '../Logs.constants'-import type { PreviewLogData } from '../Logs.types'-import {- jsonSyntaxHighlight,- ResponseCodeFormatter,- SelectionDetailedRow,- SelectionDetailedTimestampRow,-} from '../LogsFormatters'--const FunctionInvocationSelectionRender = ({ log }: { log: PreviewLogData }) => {- const metadata = log.metadata?.[0]- const request = metadata?.request?.[0]- const response = metadata?.response?.[0]- const method = request?.method- const status = response?.status_code- const requestUrl = request?.url !== undefined ? new URL(request?.url) : undefined- const executionTimeMs = metadata.execution_time_ms- const deploymentId = metadata.deployment_id-- return (- <>- <div className={`${LOGS_TAILWIND_CLASSES.log_selection_x_padding} space-y-2`}>- <SelectionDetailedRow- label="Status"- value={status}- valueRender={<ResponseCodeFormatter value={status} />}- />- <SelectionDetailedRow label="Method" value={method} />- <SelectionDetailedTimestampRow value={log.timestamp} />- <SelectionDetailedRow label="Execution Time" value={`${executionTimeMs}ms`} />- <SelectionDetailedRow label="Execution ID" value={metadata.execution_id} />- <SelectionDetailedRow label="Deployment ID" value={deploymentId} />- <SelectionDetailedRow label="Log ID" value={log.id} />- {requestUrl !== undefined && (- <SelectionDetailedRow- label="Request Path"- value={requestUrl.pathname + requestUrl.search}- />- )}- </div>- <div className={`${LOGS_TAILWIND_CLASSES.log_selection_x_padding}`}>- <h3 className="text-foreground-light mb-4 font-mono text-sm uppercase">Request Metadata</h3>- <pre className="text-sm syntax-highlight overflow-x-auto mb-4">- <div- className="text-wrap"- dangerouslySetInnerHTML={{- __html: request ? jsonSyntaxHighlight(filterFunctionsRequestResponse(request)) : '',- }}- />- </pre>- </div>- <div className={`${LOGS_TAILWIND_CLASSES.log_selection_x_padding}`}>- <h3 className="text-foreground-light mb-4 font-mono text-sm uppercase">- Response Metadata- </h3>- <pre className="text-sm syntax-highlight overflow-x-auto mb-4">- <div- dangerouslySetInnerHTML={{- __html: response ? jsonSyntaxHighlight(filterFunctionsRequestResponse(response)) : '',- }}- />- </pre>- </div>- </>- )-}--export default FunctionInvocationSelectionRenderdiff --git a/apps/studio/components/interfaces/Settings/Logs/LogSelectionRenderers/FunctionLogsSelectionRender.tsx b/apps/studio/components/interfaces/Settings/Logs/LogSelectionRenderers/FunctionLogsSelectionRender.tsxdeleted file mode 100644index d9e4ff82f68..00000000000--- a/apps/studio/components/interfaces/Settings/Logs/LogSelectionRenderers/FunctionLogsSelectionRender.tsx+++ /dev/null@@ -1,47 +0,0 @@-import { LOGS_TAILWIND_CLASSES } from '../Logs.constants'-import {- jsonSyntaxHighlight,- SelectionDetailedRow,- SelectionDetailedTimestampRow,- SeverityFormatter,-} from '../LogsFormatters'--const FunctionLogsSelectionRender = ({ log }: any) => {- const metadata = log.metadata[0]-- return (- <>- <div className={`${LOGS_TAILWIND_CLASSES.log_selection_x_padding}`}>- <span className="text-foreground-lighter text-sm col-span-4">Event message</span>- <div className="text-xs text-wrap font-mono text-foreground mt-2 whitespace-pre-wrap overflow-x-auto">- {log.event_message}- </div>- </div>- <div className="h-px w-full bg-panel-border-interior-light [[data-theme*=dark]_&]:bg-panel-border-interior-dark"></div>- <div className={`${LOGS_TAILWIND_CLASSES.log_selection_x_padding} space-y-2`}>- <SelectionDetailedRow- label="Severity"- value={metadata.level}- valueRender={<SeverityFormatter value={metadata.level} />}- />- <SelectionDetailedRow label="Deployment version" value={metadata.version} />- <SelectionDetailedTimestampRow value={log.timestamp} />- <SelectionDetailedRow label="Execution ID" value={metadata.execution_id} />- <SelectionDetailedRow label="Deployment ID" value={metadata.deployment_id} />- </div>- <div className={`${LOGS_TAILWIND_CLASSES.log_selection_x_padding}`}>- <h3 className="text-lg text-foreground mb-4">Metadata</h3>- <pre className="text-sm syntax-highlight overflow-x-auto">- <div- className="text-wrap"- dangerouslySetInnerHTML={{- __html: metadata ? jsonSyntaxHighlight(metadata) : '',- }}- />- </pre>- </div>- </>- )-}--export default FunctionLogsSelectionRender