Skip to content

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

fix: remove logs comma format

TzeYiing55c49c9d8e66
diff --git a/studio/components/interfaces/Functions/FunctionLogsItem.tsx b/studio/components/interfaces/Functions/FunctionLogsItem.tsx
deleted file mode 100644
index 88e17dc9ae9..00000000000
--- a/studio/components/interfaces/Functions/FunctionLogsItem.tsx
+++ /dev/null
@@ -1,44 +0,0 @@
-import dayjs from 'dayjs'
-import { FC } from 'react'
-import { observer } from 'mobx-react-lite'
-import { Badge, IconClipboard, IconExternalLink, IconGlobe } from 'ui'
-import Table from 'components/to-be-cleaned/Table'
-
-import SimpleCodeBlock from 'components/to-be-cleaned/SimpleCodeBlock'
-import router, { useRouter } from 'next/router'
-// import logDropdown from './logDropdown'
-
-interface Props {
- log: any
- onClick: () => void
-}
-
-const FunctionLogsItem: FC<Props> = ({ log, onClick }) => {
- const islogConfirmed = log.email_confirmed_at || log.phone_confirmed_at
-
- const router = useRouter()
- const { ref } = router.query
-
- return (
- <Table.tr key={log.id} onClick={onClick}>
- <Table.td className="whitespace-nowrap">
- <div className="flex items-center gap-2">
- <div className="rounded bg-scale-500 px-2">{log.function_status}</div>
- </div>
- </Table.td>
- <Table.td className="">
- <span className="text-xs text-scale-1100">{log.method}</span>
- </Table.td>
- <Table.td className="">
- <span className="font-mono text-xs text-scale-1100">{log.url}</span>
- </Table.td>
- <Table.td className="">
- <span className="text-scale-1100">
- {dayjs(log.created_at).format('DD MMM, YYYY HH:mm')}
- </span>
- </Table.td>
- </Table.tr>
- )
-}
-
-export default observer(FunctionLogsItem)
diff --git a/studio/components/interfaces/Settings/Logs/Logs.SavedQueriesItem.tsx b/studio/components/interfaces/Settings/Logs/Logs.SavedQueriesItem.tsx
index 76547dfd529..5c37144823d 100644
--- a/studio/components/interfaces/Settings/Logs/Logs.SavedQueriesItem.tsx
+++ b/studio/components/interfaces/Settings/Logs/Logs.SavedQueriesItem.tsx
@@ -4,6 +4,7 @@ import { Button, IconChevronRight, IconMaximize2, IconPlay } from 'ui'
import Table from 'components/to-be-cleaned/Table'
import { useRouter } from 'next/router'
import SqlSnippetCode from './Logs.SqlSnippetCode'
+import { timestampLocalFormatter, TimestampLocalFormatter } from './LogsFormatters'
interface Props {
item: any
@@ -33,12 +34,12 @@ const SavedQueriesItem: FC<Props> = ({ item }: Props) => {
</Table.td>
<Table.td className="">
<span className="text-scale-1100">
- {dayjs(item.inserted_at).format('DD MMM, YYYY HH:mm')}
+ {timestampLocalFormatter(item.inserted_at)}
</span>
</Table.td>
<Table.td className="">
<span className="text-scale-1100">
- {dayjs(item.updated_at).format('DD MMM, YYYY HH:mm')}
+ {timestampLocalFormatter(item.updated_at)}
</span>
</Table.td>
<Table.td className=" text-right">
diff --git a/studio/components/interfaces/Settings/Logs/LogsFormatters.tsx b/studio/components/interfaces/Settings/Logs/LogsFormatters.tsx
index b7ebaa0fdd5..6ea93cd06f8 100644
--- a/studio/components/interfaces/Settings/Logs/LogsFormatters.tsx
+++ b/studio/components/interfaces/Settings/Logs/LogsFormatters.tsx
@@ -235,9 +235,16 @@ export const TimestampLocalFormatter = ({
className?: string
value: string | number
}) => {
+ return <span className={`text-xs ${className}`}>{timestampLocalFormatter(value)}</span>
+}
+
+/**
+ * Formats a string to local timestamp display
+ * Accepts unix microsecond or iso timestamp
+ */
+export const timestampLocalFormatter = (value: string | number) => {
const timestamp = isUnixMicro(value) ? unixMicroToIsoTimestamp(value) : value
- const formattedTimestamp = dayjs(timestamp).format('DD MMM, HH:mm:ss')
- return <span className={`text-xs ${className}`}>{formattedTimestamp}</span>
+ return dayjs(timestamp).format('DD MMM HH:mm:ss')
}
/*