Skip to content

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

fix(self-hosted): improve UI copy, cards, and timestamp display for edfn (#46175)

Andrey A.16a09b7ff9e1
diff --git a/apps/studio/components/interfaces/Functions/EdgeFunctionsListItem.tsx b/apps/studio/components/interfaces/Functions/EdgeFunctionsListItem.tsx
index 4f3de2b77d5..6f617d1c880 100644
--- a/apps/studio/components/interfaces/Functions/EdgeFunctionsListItem.tsx
+++ b/apps/studio/components/interfaces/Functions/EdgeFunctionsListItem.tsx
@@ -99,18 +99,26 @@ export const EdgeFunctionsListItem = ({ function: item }: EdgeFunctionsListItemP
</div>
</TableCell>
<TableCell className="hidden 2xl:table-cell whitespace-nowrap">
- <TimestampInfo
- className="text-sm text-foreground-light whitespace-nowrap"
- utcTimestamp={item.created_at}
- label={dayjs(item.created_at).fromNow()}
- />
+ {item.created_at ? (
+ <TimestampInfo
+ className="text-sm text-foreground-light whitespace-nowrap"
+ utcTimestamp={item.created_at}
+ label={dayjs(item.created_at).fromNow()}
+ />
+ ) : (
+ <span className="text-sm text-foreground-light">–</span>
+ )}
</TableCell>
<TableCell className="lg:table-cell">
- <TimestampInfo
- className="text-sm text-foreground-light whitespace-nowrap"
- utcTimestamp={item.updated_at}
- label={dayjs(item.updated_at).fromNow()}
- />
+ {item.updated_at ? (
+ <TimestampInfo
+ className="text-sm text-foreground-light whitespace-nowrap"
+ utcTimestamp={item.updated_at}
+ label={dayjs(item.updated_at).fromNow()}
+ />
+ ) : (
+ <span className="text-sm text-foreground-light">–</span>
+ )}
</TableCell>
{showLastHourStats && (
<>
diff --git a/apps/studio/components/interfaces/Functions/FunctionsEmptyState.tsx b/apps/studio/components/interfaces/Functions/FunctionsEmptyState.tsx
index 8f4f17cec61..7ddb7ce733c 100644
--- a/apps/studio/components/interfaces/Functions/FunctionsEmptyState.tsx
+++ b/apps/studio/components/interfaces/Functions/FunctionsEmptyState.tsx
@@ -1,5 +1,5 @@
import { useParams } from 'common'
-import { Code, Github, Play, Server, Terminal } from 'lucide-react'
+import { Code, Play, Terminal } from 'lucide-react'
import Link from 'next/link'
import { useRouter } from 'next/router'
import { parseAsString, useQueryState } from 'nuqs'
@@ -205,7 +205,7 @@ export const FunctionsInstructionsLocal = () => {
<div className="flex flex-col gap-y-4">
<Card>
<CardHeader>
- <CardTitle>Developing Edge Functions locally</CardTitle>
+ <CardTitle>Developing Edge Functions with the CLI</CardTitle>
</CardHeader>
<CardContent
className={cn(
@@ -241,7 +241,7 @@ export const FunctionsInstructionsLocal = () => {
<div className="p-8">
<div className="flex items-center gap-2">
<Play size={20} />
- <h4 className="text-base text-foreground">Run Edge Functions locally</h4>
+ <h4 className="text-base text-foreground">Run Edge Functions</h4>
</div>
<p className="text-sm text-foreground-light mt-1 mb-4 prose [&>code]:text-xs text-sm max-w-full">
You can run your Edge Function locally using <code>supabase functions serve</code>.
@@ -266,7 +266,7 @@ supabase functions serve # start the Functions watcher`.trim()}
<div className="p-8">
<div className="flex items-center gap-2">
<Terminal strokeWidth={1.5} size={20} />
- <h4 className="text-base text-foreground">Invoke Edge Functions locally</h4>
+ <h4 className="text-base text-foreground">Invoke Edge Functions</h4>
</div>
<p className="text-sm text-foreground-light mt-1 mb-4">
While serving your local Edge Functions, you can invoke it using cURL or one of the
@@ -295,25 +295,20 @@ curl --request POST 'http://localhost:54321/functions/v1/hello-world' \\
<Card>
<CardHeader>
- <CardTitle>Self-hosting Edge Functions</CardTitle>
+ <CardTitle>Self-hosted Supabase</CardTitle>
</CardHeader>
<CardContent className="p-0 grid grid-cols-[repeat(auto-fit,minmax(240px,1fr))] divide-y md:divide-y-0 md:divide-x divide-default items-stretch">
<div className="p-8">
- <div className="flex items-center gap-2">
- <Server size={20} />
- <h4 className="text-base text-foreground">Self-hosting Edge Functions</h4>
- </div>
- <p className="text-sm text-foreground-light mt-1 mb-4 max-w-3xl">
- Supabase Edge Runtime consists of a web server based on the Deno runtime, capable of
- running Javascript, Typescript, and WASM services. You may self-host edge functions
- on providers like Fly.io, Digital Ocean, or AWS.
+ <p className="text-sm text-foreground-light mt-1 mb-4">
+ Edge Functions are available in self-hosted Supabase via Supabase Edge Runtime.
+ Unlike the platform, functions must be added manually — place each function at{' '}
+ <code className="text-code-inline">
+ volumes/functions/&lt;function-name&gt;/index.ts
+ </code>{' '}
+ and restart the <code className="text-code-inline">functions</code> service to pick
+ up changes. See the guide to learn more about configuration, secrets, and routing.
</p>
- <div className="flex items-center gap-x-2">
- <DocsButton href={`${DOCS_URL}/reference/self-hosting-functions/introduction`} />
- <Button asChild type="default" icon={<Github />}>
- <a href="https://github.com/supabase/edge-runtime/">GitHub</a>
- </Button>
- </div>
+ <DocsButton href={`${DOCS_URL}/guides/self-hosting/self-hosted-functions`} />
</div>
</CardContent>
</Card>
@@ -362,71 +357,44 @@ export const FunctionsSecretsEmptyStateLocal = () => {
return (
<>
<Card>
- <CardHeader className="flex-row items-center justify-between">
- Local development & CLI
- <div className="flex items-center gap-x-2">
- <DocsButton href={`${DOCS_URL}/guides/functions/secrets#using-the-cli`} />
- </div>
+ <CardHeader>
+ <CardTitle>Local development & CLI</CardTitle>
</CardHeader>
<CardContent>
- <div className="text-sm text-foreground-light mt-1 mb-4 max-w-3xl">
- <p>
- Local secrets and environment variables can be loaded in either of the following two
- ways
- </p>
- <ul className="list-disc pl-6">
- <li className="prose [&>code]:text-xs text-sm max-w-full">
- Through an <code>.env</code> file placed at <code>supabase/functions/.env</code>,
- which is automatically loaded on <code>supabase start</code>
+ <div className="text-sm text-foreground-light mb-4">
+ <p className="mb-2">Secrets can be loaded in two ways:</p>
+ <ul className="list-disc pl-6 space-y-1">
+ <li>
+ Place a <code className="text-code-inline">.env</code> file at{' '}
+ <code className="text-code-inline">supabase/functions/.env</code> — picked up
+ automatically on <code className="text-code-inline">supabase start</code>.
</li>
- <li className="prose [&>code]:text-xs text-sm max-w-full">
- Through the <code>--env-file</code> option for <code>supabase functions serve</code>
- , for example: <code>supabase functions serve --env-file ./path/to/.env-file</code>
+ <li>
+ Pass <code className="text-code-inline">--env-file</code> to{' '}
+ <code className="text-code-inline">supabase functions serve</code>, e.g.{' '}
+ <code className="text-code-inline">
+ supabase functions serve --env-file ./path/to/.env-file
+ </code>
</li>
</ul>
</div>
+ <DocsButton href={`${DOCS_URL}/guides/functions/secrets#using-the-cli`} />
</CardContent>
</Card>
<Card>
- <CardHeader className="flex-row items-center justify-between">
- Self-Hosted Supabase
- <div className="flex items-center gap-x-2">
- <DocsButton href={`${DOCS_URL}/guides/self-hosting/docker#configuring-services`} />
- </div>
+ <CardHeader>
+ <CardTitle>Self-Hosted Supabase</CardTitle>
</CardHeader>
<CardContent>
- <p className="prose [&>code]:text-xs space-x-1 text-sm max-w-full">
- <span>Change settings in</span>
- <a
- target="_blank"
- rel="noopener noreferrer"
- href="https://github.com/supabase/supabase/blob/master/docker/.env.example"
- >
- .env file
- </a>
- <span>and</span>
- <a
- target="_blank"
- rel="noopener noreferrer"
- href="https://github.com/supabase/supabase/blob/master/docker/docker-compose.yml"
- >
- docker-compose.yml
- </a>
- <span>at</span>
- <code>functions</code>
- <span>service</span>
- </p>
- <p className="prose [&>code]:text-xs space-x-1 text-sm max-w-full">
- <span>Secrets can also be loaded at runtime by injecting them into</span>
- <a
- target="_blank"
- rel="noopener noreferrer"
- href="https://github.com/supabase/supabase/blob/8bb82bb3a5aee631e8e6e6e0c8a5f6e97fb8f898/docker/volumes/functions/main/index.ts#L74"
- >
- main/index.ts file
- </a>
+ <p className="text-sm text-foreground-light mb-4">
+ Configure secrets in your <code className="text-code-inline">.env</code> file and{' '}
+ <code className="text-code-inline">docker-compose.yml</code> under the{' '}
+ <code className="text-code-inline">functions</code> service.
</p>
+ <DocsButton
+ href={`${DOCS_URL}/guides/self-hosting/self-hosted-functions#custom-environment-variables`}
+ />
</CardContent>
</Card>
</>
diff --git a/apps/studio/components/interfaces/Settings/Database/SettingsDatabaseEmptyStateLocal.tsx b/apps/studio/components/interfaces/Settings/Database/SettingsDatabaseEmptyStateLocal.tsx
index 6a26777e945..61208b7cc6e 100644
--- a/apps/studio/components/interfaces/Settings/Database/SettingsDatabaseEmptyStateLocal.tsx
+++ b/apps/studio/components/interfaces/Settings/Database/SettingsDatabaseEmptyStateLocal.tsx
@@ -1,4 +1,4 @@
-import { Card, CardContent, CardHeader } from 'ui'
+import { Card, CardContent, CardHeader, CardTitle } from 'ui'
import { DocsButton } from '@/components/ui/DocsButton'
import { DOCS_URL } from '@/lib/constants'
@@ -7,40 +7,34 @@ export function SettingsDatabaseEmptyStateLocal() {
return (
<>
<Card>
- <CardHeader className="flex-row items-center justify-between">
- Local development & CLI
- <div className="flex items-center gap-x-2">
- <DocsButton href={`${DOCS_URL}/guides/local-development/cli/config#database-config`} />
- </div>
+ <CardHeader>
+ <CardTitle>Local development & CLI</CardTitle>
</CardHeader>
<CardContent>
- <p className="prose [&>code]:text-xs text-sm max-w-full">
- Change settings in <code>supabase/config.toml</code> file, which is automatically loaded
- on <code>supabase start</code>
+ <p className="text-sm text-foreground-light mb-4">
+ Configure database settings in{' '}
+ <code className="text-code-inline">supabase/config.toml</code> — applied automatically
+ on <code className="text-code-inline">supabase start</code>.
</p>
+ <DocsButton href={`${DOCS_URL}/guides/local-development/cli/config#database-config`} />
</CardContent>
</Card>
<Card>
- <CardHeader className="flex-row items-center justify-between">
- Self-Hosted Supabase
- <div className="flex items-center gap-x-2">
- <DocsButton
- href={`${DOCS_URL}/guides/self-hosting/docker#configuring-and-securing-supabase`}
- />
- </div>
+ <CardHeader>
+ <CardTitle>Self-Hosted Supabase</CardTitle>
</CardHeader>
<CardContent>
- <p className="prose [&>code]:text-xs space-x-1 text-sm max-w-full">
- <span>Change settings in</span>
+ <p className="text-sm text-foreground-light mb-4">
+ Change settings in{' '}
<a
target="_blank"
rel="noopener noreferrer"
href="https://github.com/supabase/supabase/blob/master/docker/.env.example"
>
.env file
- </a>
- <span>and</span>
+ </a>{' '}
+ and{' '}
<a
target="_blank"
rel="noopener noreferrer"
@@ -48,7 +42,11 @@ export function SettingsDatabaseEmptyStateLocal() {
>
docker-compose.yml
</a>
+ .
</p>
+ <DocsButton
+ href={`${DOCS_URL}/guides/self-hosting/docker#configuring-and-securing-supabase`}
+ />
</CardContent>
</Card>
</>
diff --git a/apps/studio/components/interfaces/Settings/Logs/LogsQueryPanel.tsx b/apps/studio/components/interfaces/Settings/Logs/LogsQueryPanel.tsx
index 1fa3d8900a7..61492a08984 100644
--- a/apps/studio/components/interfaces/Settings/Logs/LogsQueryPanel.tsx
+++ b/apps/studio/components/interfaces/Settings/Logs/LogsQueryPanel.tsx
@@ -1,4 +1,4 @@
-import { IS_PLATFORM, useFlag } from 'common'
+import { useFlag } from 'common'
import { BookOpen, Check, ChevronDown, ChevronsUpDown, Copy, ExternalLink, X } from 'lucide-react'
import Link from 'next/link'
import { ReactNode, useEffect, useState } from 'react'
@@ -129,7 +129,7 @@ const LogsQueryPanel = ({
</DropdownMenuContent>
</DropdownMenu>
- {IS_PLATFORM && logsTemplates && (
+ {logsTemplates && (
<DropdownMenu>
<DropdownMenuTrigger asChild>
<Button type="default" iconRight={<ChevronDown />}>
diff --git a/apps/studio/components/layouts/LogsLayout/LogsSidebarMenuV2.tsx b/apps/studio/components/layouts/LogsLayout/LogsSidebarMenuV2.tsx
index 557f1b1838b..b152f6abb09 100644
--- a/apps/studio/components/layouts/LogsLayout/LogsSidebarMenuV2.tsx
+++ b/apps/studio/components/layouts/LogsLayout/LogsSidebarMenuV2.tsx
@@ -339,7 +339,9 @@ export function LogsSidebarMenuV2() {
<InnerSideBarEmptyPanel
className="mx-4"
title="No queries created yet"
- description="Create and save your queries to use them in the explorer"
+ description={
+ IS_PLATFORM ? 'Create and save your queries to use them in the explorer' : undefined
+ }
actions={
<Button asChild type="default">
<Link href={`/project/${ref}/logs/explorer`}>Create query</Link>