diff --git a/site/src/pages/AIBridgePage/RequestLogsPage/RequestLogsPage.tsx b/site/src/pages/AIBridgePage/RequestLogsPage/RequestLogsPage.tsx index 7d53ee6ea2..8c56d699f4 100644 --- a/site/src/pages/AIBridgePage/RequestLogsPage/RequestLogsPage.tsx +++ b/site/src/pages/AIBridgePage/RequestLogsPage/RequestLogsPage.tsx @@ -23,6 +23,7 @@ const RequestLogsPage: FC = () => { const isEntitled = entitlements.features.aibridge.entitlement === "entitled" || entitlements.features.aibridge.entitlement === "grace_period"; + const isEnabled = entitlements.features.aibridge.enabled; const hasPermission = permissions.viewAnyAIBridgeInterception; const canViewRequestLogs = isEntitled && hasPermission; @@ -71,6 +72,7 @@ const RequestLogsPage: FC = () => { ; export const Paywall: Story = { args: { isRequestLogsEntitled: false, + isRequestLogsEnabled: false, + }, +}; + +export const NotEnabled: Story = { + args: { + isRequestLogsEntitled: true, + isRequestLogsEnabled: false, }, }; export const Loaded: Story = { args: { isRequestLogsEntitled: true, + isRequestLogsEnabled: true, interceptions, filterProps: { ...defaultFilterProps, @@ -65,6 +74,7 @@ export const Loaded: Story = { export const Empty: Story = { args: { isRequestLogsEntitled: true, + isRequestLogsEnabled: true, interceptions: [], filterProps: { ...defaultFilterProps, @@ -77,6 +87,7 @@ export const Loading: Story = { args: { isLoading: true, isRequestLogsEntitled: true, + isRequestLogsEnabled: true, interceptions: [], filterProps: { ...defaultFilterProps, diff --git a/site/src/pages/AIBridgePage/RequestLogsPage/RequestLogsPageView.tsx b/site/src/pages/AIBridgePage/RequestLogsPage/RequestLogsPageView.tsx index 17ec8e58c3..e0fadbba47 100644 --- a/site/src/pages/AIBridgePage/RequestLogsPage/RequestLogsPageView.tsx +++ b/site/src/pages/AIBridgePage/RequestLogsPage/RequestLogsPageView.tsx @@ -1,4 +1,6 @@ import type { AIBridgeInterception } from "api/typesGenerated"; +import { Alert, AlertDetail, AlertTitle } from "components/Alert/Alert"; +import { Link } from "components/Link/Link"; import { PaginationContainer, type PaginationResult, @@ -14,12 +16,14 @@ import { import { TableEmpty } from "components/TableEmpty/TableEmpty"; import { TableLoader } from "components/TableLoader/TableLoader"; import type { ComponentProps, FC } from "react"; +import { docs } from "utils/docs"; import { RequestLogsFilter } from "./RequestLogsFilter/RequestLogsFilter"; import { RequestLogsRow } from "./RequestLogsRow/RequestLogsRow"; interface RequestLogsPageViewProps { isLoading: boolean; isRequestLogsEntitled: boolean; + isRequestLogsEnabled: boolean; interceptions?: readonly AIBridgeInterception[]; interceptionsQuery: PaginationResult; filterProps: ComponentProps; @@ -28,6 +32,7 @@ interface RequestLogsPageViewProps { export const RequestLogsPageView: FC = ({ isLoading, isRequestLogsEntitled, + isRequestLogsEnabled, interceptions, interceptionsQuery, filterProps, @@ -36,6 +41,24 @@ export const RequestLogsPageView: FC = ({ return ; } + if (!isRequestLogsEnabled) { + return ( + + + AI Bridge is included in your license, but not set up yet. + + + You have access to AI Governance, but it still needs to be setup. + Check out the{" "} + + AI Bridge + {" "} + documentation to get started. + + + ); + } + return ( <> diff --git a/site/src/pages/DeploymentSettingsPage/AIGovernanceSettingsPage/AIGovernanceSettingsPage.tsx b/site/src/pages/DeploymentSettingsPage/AIGovernanceSettingsPage/AIGovernanceSettingsPage.tsx index cf832890c4..71a0583c7b 100644 --- a/site/src/pages/DeploymentSettingsPage/AIGovernanceSettingsPage/AIGovernanceSettingsPage.tsx +++ b/site/src/pages/DeploymentSettingsPage/AIGovernanceSettingsPage/AIGovernanceSettingsPage.tsx @@ -7,6 +7,10 @@ import { AIGovernanceSettingsPageView } from "./AIGovernanceSettingsPageView"; const AIGovernanceSettingsPage: FC = () => { const { deploymentConfig } = useDeploymentConfig(); const { entitlements } = useDashboard(); + const isAiBridgeEntitled = + entitlements.features.aibridge.entitlement === "entitled" || + entitlements.features.aibridge.entitlement === "grace_period"; + const isAIBridgeEnabled = entitlements.features.aibridge.enabled; return ( <> @@ -14,10 +18,8 @@ const AIGovernanceSettingsPage: FC = () => { ); diff --git a/site/src/pages/DeploymentSettingsPage/AIGovernanceSettingsPage/AIGovernanceSettingsPageView.tsx b/site/src/pages/DeploymentSettingsPage/AIGovernanceSettingsPage/AIGovernanceSettingsPageView.tsx index 7b7247b479..4d5eb0410f 100644 --- a/site/src/pages/DeploymentSettingsPage/AIGovernanceSettingsPage/AIGovernanceSettingsPageView.tsx +++ b/site/src/pages/DeploymentSettingsPage/AIGovernanceSettingsPage/AIGovernanceSettingsPageView.tsx @@ -1,4 +1,6 @@ import type { SerpentOption } from "api/typesGenerated"; +import { Alert, AlertDetail, AlertTitle } from "components/Alert/Alert"; +import { Link } from "components/Link/Link"; import { PaywallAIGovernance } from "components/Paywall/PaywallAIGovernance"; import { SettingsHeader, @@ -15,11 +17,12 @@ import OptionsTable from "../OptionsTable"; type AIGovernanceSettingsPageViewProps = { options: SerpentOption[]; featureAIBridgeEntitled: boolean; + featureAIBridgeEnabled: boolean; }; export const AIGovernanceSettingsPageView: FC< AIGovernanceSettingsPageViewProps -> = ({ options, featureAIBridgeEntitled }) => { +> = ({ options, featureAIBridgeEntitled, featureAIBridgeEnabled }) => { return ( @@ -41,11 +44,28 @@ export const AIGovernanceSettingsPageView: FC< {featureAIBridgeEntitled ? ( - deploymentGroupHasParent(o.group, "AI Bridge")) - .filter((o) => !o.annotations?.secret === true)} - /> + <> + {!featureAIBridgeEnabled && ( + + + AI Bridge is included in your license, but not set up yet. + + + You have access to AI Governance, but it still needs to be + setup. Check out the{" "} + + AI Bridge + {" "} + documentation to get started. + + + )} + deploymentGroupHasParent(o.group, "AI Bridge")) + .filter((o) => !o.annotations?.secret === true)} + /> + ) : ( )}