Thanks to visit codestin.com
Credit goes to github.com

Skip to content

feat: add storybook for /deployment/network #5603

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jan 6, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
feat: add storybook for NetworkSettingsPage
  • Loading branch information
jsjoeio committed Jan 6, 2023
commit 7a04d557a590761721b2ef2e405e98d14c81c4ef
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
import { ComponentMeta, Story } from "@storybook/react"
import {
NetworkSettingsPageView,
NetworkSettingsPageViewProps,
} from "./NetworkSettingsPageView"

export default {
title: "pages/NetworkSettingsPageView",
component: NetworkSettingsPageView,
argTypes: {
deploymentConfig: {
defaultValue: {
derp: {
server: {
enable: {
name: "DERP Server Enable",
usage:
"Whether to enable or disable the embedded DERP relay server.",
value: true,
},
region_name: {
name: "DERP Server Region Name",
usage: "Region name that for the embedded DERP server.",
value: "aws-east",
},
stun_addresses: {
name: "DERP Server STUN Addresses",
usage:
"Addresses for STUN servers to establish P2P connections. Set empty to disable P2P connections.",
value: ["stun.l.google.com:19302", "stun.l.google.com:19301"],
},
},
config: {
url: {
name: "DERP Config URL",
usage:
"URL to fetch a DERP mapping on startup. See: https://tailscale.com/kb/1118/custom-derp-servers/",
value: "https://coder.com",
},
},
},
},
},
},
} as ComponentMeta<typeof NetworkSettingsPageView>

const Template: Story<NetworkSettingsPageViewProps> = (args) => (
<NetworkSettingsPageView {...args} />
)
export const Page = Template.bind({})
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { DeploymentConfig } from "api/typesGenerated"
import { Header } from "components/DeploySettingsLayout/Header"
import OptionsTable from "components/DeploySettingsLayout/OptionsTable"

type NetworkSettingsPageViewProps = {
export type NetworkSettingsPageViewProps = {
deploymentConfig: Pick<DeploymentConfig, "derp">
}

Expand Down