Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit8ffc16d

Browse files
committed
feat: add<Paywall /> to/ai-governance/request-logs
1 parent5c8057d commit8ffc16d

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

‎site/src/pages/AIGovernancePage/RequestLogsPage/RequestLogsPage.tsx‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,18 @@
11
import{listInterceptions}from"api/queries/aiBridge";
2+
import{useFeatureVisibility}from"modules/dashboard/useFeatureVisibility";
23
importtype{FC}from"react";
34
import{useQuery}from"react-query";
45
import{pageTitle}from"utils/page";
56
import{RequestLogsPageView}from"./RequestLogsPageView";
67

78
constRequestLogsPage:FC=()=>{
9+
constfeats=useFeatureVisibility();
10+
// The "else false" is required if audit_log is undefined.
11+
// It may happen if owner removes the license.
12+
//
13+
// see: https://github.com/coder/coder/issues/14798
14+
constisRequestLogsVisible=feats.aibridge||false;
15+
816
constinterceptionsQuery=useQuery(listInterceptions());
917

1018
return(
@@ -13,6 +21,7 @@ const RequestLogsPage: FC = () => {
1321

1422
<RequestLogsPageView
1523
isLoading={interceptionsQuery.isLoading}
24+
isRequestLogsVisible={isRequestLogsVisible}
1625
interceptions={interceptionsQuery.data?.results}
1726
/>
1827
</>

‎site/src/pages/AIGovernancePage/RequestLogsPage/RequestLogsPageView.tsx‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
importtype{AIBridgeInterception}from"api/typesGenerated";
2+
import{Paywall}from"components/Paywall/Paywall";
23
import{
34
Table,
45
TableBody,
@@ -13,13 +14,26 @@ import { RequestLogsRow } from "./RequestLogsRow/RequestLogsRow";
1314

1415
interfaceRequestLogsPageViewProps{
1516
isLoading:boolean;
17+
isRequestLogsVisible:boolean;
1618
interceptions?:readonlyAIBridgeInterception[];
1719
}
1820

1921
exportconstRequestLogsPageView:FC<RequestLogsPageViewProps>=({
2022
isLoading,
23+
isRequestLogsVisible,
2124
interceptions,
2225
})=>{
26+
if(!isRequestLogsVisible){
27+
return(
28+
<Paywall
29+
message="AI Governance"
30+
description="AI Governance allows you to monitor and manage AI requests. You need an Premium license to use this feature."
31+
// TODO: Add documentation link
32+
// documentationLink={docs("/admin/security/ai-governance")}
33+
/>
34+
);
35+
}
36+
2337
return(
2438
<Table>
2539
<TableHeader>

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp