File tree 8 files changed +153
-18
lines changed
components/DeploySettingsLayout
ObservabilitySettingsPage
8 files changed +153
-18
lines changed Original file line number Diff line number Diff line change @@ -122,6 +122,12 @@ const NetworkSettingsPage = lazy(
122
122
"./pages/DeploySettingsPage/NetworkSettingsPage/NetworkSettingsPage"
123
123
) ,
124
124
) ;
125
+ const ObservabilitySettingsPage = lazy (
126
+ ( ) =>
127
+ import (
128
+ "./pages/DeploySettingsPage/ObservabilitySettingsPage/ObservabilitySettingsPage"
129
+ ) ,
130
+ ) ;
125
131
const ExternalAuthPage = lazy (
126
132
( ) => import ( "./pages/ExternalAuthPage/ExternalAuthPage" ) ,
127
133
) ;
@@ -290,6 +296,10 @@ export const AppRouter: FC = () => {
290
296
< Route path = "licenses" element = { < LicensesSettingsPage /> } />
291
297
< Route path = "licenses/add" element = { < AddNewLicensePage /> } />
292
298
< Route path = "security" element = { < SecuritySettingsPage /> } />
299
+ < Route
300
+ path = "observability"
301
+ element = { < ObservabilitySettingsPage /> }
302
+ />
293
303
< Route path = "appearance" element = { < AppearanceSettingsPage /> } />
294
304
< Route path = "network" element = { < NetworkSettingsPage /> } />
295
305
< Route path = "userauth" element = { < UserAuthSettingsPage /> } />
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ import Brush from "@mui/icons-material/Brush";
2
2
import LaunchOutlined from "@mui/icons-material/LaunchOutlined" ;
3
3
import ApprovalIcon from "@mui/icons-material/VerifiedUserOutlined" ;
4
4
import LockRounded from "@mui/icons-material/LockOutlined" ;
5
+ import InsertChartIcon from "@mui/icons-material/InsertChart" ;
5
6
import Globe from "@mui/icons-material/PublicOutlined" ;
6
7
import HubOutlinedIcon from "@mui/icons-material/HubOutlined" ;
7
8
import VpnKeyOutlined from "@mui/icons-material/VpnKeyOutlined" ;
@@ -133,6 +134,12 @@ export const Sidebar: React.FC = () => {
133
134
>
134
135
Security
135
136
</ SidebarNavItem >
137
+ < SidebarNavItem
138
+ href = "observability"
139
+ icon = { < SidebarNavItemIcon icon = { InsertChartIcon } /> }
140
+ >
141
+ Observability
142
+ </ SidebarNavItem >
136
143
{ dashboard . experiments . includes ( "deployment_health_page" ) && (
137
144
< SidebarNavItem
138
145
href = "/health"
Original file line number Diff line number Diff line change
1
+ import { useDashboard } from "components/Dashboard/DashboardProvider" ;
2
+ import { useDeploySettings } from "components/DeploySettingsLayout/DeploySettingsLayout" ;
3
+ import { FC } from "react" ;
4
+ import { Helmet } from "react-helmet-async" ;
5
+ import { pageTitle } from "utils/page" ;
6
+ import { ObservabilitySettingsPageView } from "./ObservabilitySettingsPageView" ;
7
+
8
+ const ObservabilitySettingsPage : FC = ( ) => {
9
+ const { deploymentValues : deploymentValues } = useDeploySettings ( ) ;
10
+ const { entitlements } = useDashboard ( ) ;
11
+
12
+ return (
13
+ < >
14
+ < Helmet >
15
+ < title > { pageTitle ( "Observability Settings" ) } </ title >
16
+ </ Helmet >
17
+
18
+ < ObservabilitySettingsPageView
19
+ options = { deploymentValues . options }
20
+ featureAuditLogEnabled = { entitlements . features [ "audit_log" ] . enabled }
21
+ />
22
+ </ >
23
+ ) ;
24
+ } ;
25
+
26
+ export default ObservabilitySettingsPage ;
Original file line number Diff line number Diff line change
1
+ import { ObservabilitySettingsPageView } from "./ObservabilitySettingsPageView" ;
2
+ import type { Meta , StoryObj } from "@storybook/react" ;
3
+ import { ClibaseGroup } from "api/typesGenerated" ;
4
+
5
+ const group : ClibaseGroup = {
6
+ name : "Introspection" ,
7
+ description : "" ,
8
+ } ;
9
+
10
+ const meta : Meta < typeof ObservabilitySettingsPageView > = {
11
+ title : "pages/DeploySettingsPage/ObservabilitySettingsPageView" ,
12
+ component : ObservabilitySettingsPageView ,
13
+ args : {
14
+ options : [
15
+ {
16
+ name : "Verbose" ,
17
+ value : true ,
18
+ group,
19
+ flag : "verbose" ,
20
+ flag_shorthand : "v" ,
21
+ hidden : false ,
22
+ } ,
23
+ {
24
+ name : "Human Log Location" ,
25
+ description : "Output human-readable logs to a given file." ,
26
+ value : "/dev/stderr" ,
27
+ flag : "log-human" ,
28
+ hidden : false ,
29
+ } ,
30
+ {
31
+ name : "Stackdriver Log Location" ,
32
+ description : "Output Stackdriver compatible logs to a given file." ,
33
+ value : "" ,
34
+ flag : "log-stackdriver" ,
35
+ hidden : false ,
36
+ } ,
37
+ {
38
+ name : "Prometheus Enable" ,
39
+ description :
40
+ "Serve prometheus metrics on the address defined by prometheus address." ,
41
+ value : true ,
42
+ group : { ...group } ,
43
+ flag : "prometheus-enable" ,
44
+ hidden : false ,
45
+ } ,
46
+ ] ,
47
+ featureAuditLogEnabled : true ,
48
+ } ,
49
+ } ;
50
+
51
+ export default meta ;
52
+ type Story = StoryObj < typeof ObservabilitySettingsPageView > ;
53
+
54
+ export const Page : Story = { } ;
Original file line number Diff line number Diff line change
1
+ import { ClibaseOption } from "api/typesGenerated" ;
2
+ import {
3
+ Badges ,
4
+ DisabledBadge ,
5
+ EnabledBadge ,
6
+ EnterpriseBadge ,
7
+ } from "components/DeploySettingsLayout/Badges" ;
8
+ import { Header } from "components/DeploySettingsLayout/Header" ;
9
+ import OptionsTable from "components/DeploySettingsLayout/OptionsTable" ;
10
+ import { Stack } from "components/Stack/Stack" ;
11
+ import { deploymentGroupHasParent } from "utils/deployOptions" ;
12
+ import { docs } from "utils/docs" ;
13
+
14
+ export type ObservabilitySettingsPageViewProps = {
15
+ options : ClibaseOption [ ] ;
16
+ featureAuditLogEnabled : boolean ;
17
+ } ;
18
+ export const ObservabilitySettingsPageView = ( {
19
+ options : options ,
20
+ featureAuditLogEnabled,
21
+ } : ObservabilitySettingsPageViewProps ) : JSX . Element => {
22
+ return (
23
+ < >
24
+ < Stack direction = "column" spacing = { 6 } >
25
+ < div >
26
+ < Header title = "Observability" />
27
+ < Header
28
+ title = "Audit Logging"
29
+ secondary
30
+ description = "Allow auditors to monitor user operations in your deployment."
31
+ docsHref = { docs ( "/admin/audit-logs" ) }
32
+ />
33
+
34
+ < Badges >
35
+ { featureAuditLogEnabled ? < EnabledBadge /> : < DisabledBadge /> }
36
+ < EnterpriseBadge />
37
+ </ Badges >
38
+ </ div >
39
+
40
+ < div >
41
+ < Header
42
+ title = "Monitoring"
43
+ secondary
44
+ description = "Monitoring your Coder application with logs and metrics."
45
+ />
46
+
47
+ < OptionsTable
48
+ options = { options . filter ( ( o ) =>
49
+ deploymentGroupHasParent ( o . group , "Introspection" ) ,
50
+ ) }
51
+ />
52
+ </ div >
53
+ </ Stack >
54
+ </ >
55
+ ) ;
56
+ } ;
Original file line number Diff line number Diff line change @@ -17,7 +17,6 @@ const SecuritySettingsPage: FC = () => {
17
17
18
18
< SecuritySettingsPageView
19
19
options = { deploymentValues . options }
20
- featureAuditLogEnabled = { entitlements . features [ "audit_log" ] . enabled }
21
20
featureBrowserOnlyEnabled = {
22
21
entitlements . features [ "browser_only" ] . enabled
23
22
}
Original file line number Diff line number Diff line change @@ -47,7 +47,6 @@ const meta: Meta<typeof SecuritySettingsPageView> = {
47
47
hidden : false ,
48
48
} ,
49
49
] ,
50
- featureAuditLogEnabled : true ,
51
50
featureBrowserOnlyEnabled : true ,
52
51
} ,
53
52
} ;
Original file line number Diff line number Diff line change @@ -16,12 +16,10 @@ import { docs } from "utils/docs";
16
16
17
17
export type SecuritySettingsPageViewProps = {
18
18
options : ClibaseOption [ ] ;
19
- featureAuditLogEnabled : boolean ;
20
19
featureBrowserOnlyEnabled : boolean ;
21
20
} ;
22
21
export const SecuritySettingsPageView = ( {
23
22
options : options ,
24
- featureAuditLogEnabled,
25
23
featureBrowserOnlyEnabled,
26
24
} : SecuritySettingsPageViewProps ) : JSX . Element => {
27
25
const tlsOptions = options . filter ( ( o ) =>
@@ -47,20 +45,6 @@ export const SecuritySettingsPageView = ({
47
45
/>
48
46
</ div >
49
47
50
- < div >
51
- < Header
52
- title = "Audit Logging"
53
- secondary
54
- description = "Allow auditors to monitor user operations in your deployment."
55
- docsHref = { docs ( "/admin/audit-logs" ) }
56
- />
57
-
58
- < Badges >
59
- { featureAuditLogEnabled ? < EnabledBadge /> : < DisabledBadge /> }
60
- < EnterpriseBadge />
61
- </ Badges >
62
- </ div >
63
-
64
48
< div >
65
49
< Header
66
50
title = "Browser Only Connections"
You can’t perform that action at this time.
0 commit comments