|
1 |
| -import { ComponentMeta, Story } from "@storybook/react"; |
2 |
| -import { |
3 |
| - NetworkSettingsPageView, |
4 |
| - NetworkSettingsPageViewProps, |
5 |
| -} from "./NetworkSettingsPageView"; |
| 1 | +import { DeploymentGroup } from "api/types"; |
| 2 | +import { NetworkSettingsPageView } from "./NetworkSettingsPageView"; |
| 3 | +import type { Meta, StoryObj } from "@storybook/react"; |
6 | 4 |
|
7 |
| -export default { |
| 5 | +const group: DeploymentGroup = { |
| 6 | + name: "Networking", |
| 7 | + description: "", |
| 8 | + children: [] as DeploymentGroup[], |
| 9 | +}; |
| 10 | + |
| 11 | +const meta: Meta<typeof NetworkSettingsPageView> = { |
8 | 12 | title: "pages/NetworkSettingsPageView",
|
9 | 13 | component: NetworkSettingsPageView,
|
10 | 14 | args: {
|
11 | 15 | options: [
|
12 | 16 | {
|
13 | 17 | name: "DERP Server Enable",
|
14 |
| - usage: "Whether to enable or disable the embedded DERP relay server.", |
| 18 | + description: |
| 19 | + "Whether to enable or disable the embedded DERP relay server.", |
15 | 20 | value: true,
|
16 |
| - group: { |
17 |
| - name: "Networking", |
18 |
| - }, |
| 21 | + group, |
| 22 | + flag: "derp", |
| 23 | + flag_shorthand: "d", |
| 24 | + hidden: false, |
19 | 25 | },
|
20 | 26 | {
|
21 | 27 | name: "DERP Server Region Name",
|
22 |
| - usage: "Region name that for the embedded DERP server.", |
| 28 | + description: "Region name that for the embedded DERP server.", |
23 | 29 | value: "aws-east",
|
24 |
| - group: { |
25 |
| - name: "Networking", |
26 |
| - }, |
| 30 | + group, |
| 31 | + flag: "derp", |
| 32 | + flag_shorthand: "d", |
| 33 | + hidden: false, |
27 | 34 | },
|
28 | 35 | {
|
29 | 36 | name: "DERP Server STUN Addresses",
|
30 |
| - usage: |
| 37 | + description: |
31 | 38 | "Addresses for STUN servers to establish P2P connections. Set empty to disable P2P connections.",
|
32 | 39 | value: ["stun.l.google.com:19302", "stun.l.google.com:19301"],
|
33 |
| - group: { |
34 |
| - name: "Networking", |
35 |
| - }, |
| 40 | + group, |
| 41 | + flag: "derp", |
| 42 | + flag_shorthand: "d", |
| 43 | + hidden: false, |
36 | 44 | },
|
37 | 45 | {
|
38 | 46 | name: "DERP Config URL",
|
39 |
| - usage: |
| 47 | + description: |
40 | 48 | "URL to fetch a DERP mapping on startup. See: https://tailscale.com/kb/1118/custom-derp-servers/",
|
41 | 49 | value: "https://coder.com",
|
42 |
| - group: { |
43 |
| - name: "Networking", |
44 |
| - }, |
| 50 | + group, |
| 51 | + flag: "derp", |
| 52 | + flag_shorthand: "d", |
| 53 | + hidden: false, |
45 | 54 | },
|
46 | 55 | {
|
47 | 56 | name: "Wildcard Access URL",
|
| 57 | + description: "", |
48 | 58 | value: "https://coder.com",
|
49 |
| - group: { |
50 |
| - name: "Networking", |
51 |
| - }, |
| 59 | + group, |
| 60 | + flag: "derp", |
| 61 | + flag_shorthand: "d", |
| 62 | + hidden: false, |
52 | 63 | },
|
53 | 64 | ],
|
54 | 65 | },
|
55 |
| -} as ComponentMeta<typeof NetworkSettingsPageView>; |
| 66 | +}; |
| 67 | + |
| 68 | +export default meta; |
| 69 | +type Story = StoryObj<typeof NetworkSettingsPageView>; |
56 | 70 |
|
57 |
| -const Template: Story<NetworkSettingsPageViewProps> = (args) => ( |
58 |
| - <NetworkSettingsPageView {...args} /> |
59 |
| -); |
60 |
| -export const Page = Template.bind({}); |
| 71 | +export const Page: Story = {}; |
0 commit comments