mirror of
https://github.com/supabase/supabase.git
synced 2026-09-22 13:37:53 +08:00
0bf22ee6fc
workers -> compute <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Added the Compute experience for deploying, viewing, managing, and monitoring compute instances. - Added Compute navigation, instance detail pages, secrets, logs, deployment dialogs, generated snippets, and CLI commands. - Added filtering, status, availability, and data-loading support for compute instances. - **Updates** - Updated labels, icons, links, feature controls, unified logs, and secret-deletion messaging to use Compute terminology. - Compute routes now replace the previous Workers routes and pages. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
45 lines
1.3 KiB
TypeScript
45 lines
1.3 KiB
TypeScript
import { PermissionAction } from '@supabase/shared-types/out/constants'
|
|
import { BoxPlus } from 'icons'
|
|
import { Plus } from 'lucide-react'
|
|
import { EmptyStatePresentational } from 'ui-patterns/EmptyStatePresentational'
|
|
|
|
import { ButtonTooltip } from '@/components/ui/ButtonTooltip'
|
|
import { useAsyncCheckPermissions } from '@/hooks/misc/useCheckPermissions'
|
|
|
|
interface ComputeEmptyStateProps {
|
|
onDeploy: () => void
|
|
}
|
|
|
|
export const ComputeEmptyState = ({ onDeploy }: ComputeEmptyStateProps) => {
|
|
const { can: canDeployInstances } = useAsyncCheckPermissions(
|
|
PermissionAction.FUNCTIONS_WRITE,
|
|
'*'
|
|
)
|
|
|
|
return (
|
|
<EmptyStatePresentational
|
|
icon={BoxPlus}
|
|
title="Deploy your first Compute instance"
|
|
description="Spin up a Compute instance locally, then deploy it to the cloud. Dockerfile, Node.js and Deno supported at Private Alpha."
|
|
>
|
|
<ButtonTooltip
|
|
variant="primary"
|
|
size="tiny"
|
|
icon={<Plus size={14} />}
|
|
disabled={!canDeployInstances}
|
|
onClick={onDeploy}
|
|
tooltip={{
|
|
content: {
|
|
side: 'bottom',
|
|
text: canDeployInstances
|
|
? undefined
|
|
: 'You need additional permissions to deploy compute instances',
|
|
},
|
|
}}
|
|
>
|
|
Deploy
|
|
</ButtonTooltip>
|
|
</EmptyStatePresentational>
|
|
)
|
|
}
|