mirror of
https://github.com/coder/coder.git
synced 2026-11-02 21:50:08 +08:00
This pull request introduces support for external workspace management, allowing users to register and manage workspaces that are provisioned and managed outside of the Coder. * Added a new component AgentExternal which shows instructions for connecting external agents. * Added redacted fields to CodeExample so you can now hide specific parts of the code instead of the full line * Hides workspace actions if workspace is using external agent. <img width="1719" height="646" alt="image" src="https://github.com/user-attachments/assets/45b7bfae-7006-461f-a96d-e61f97084819" />
43 lines
820 B
TypeScript
43 lines
820 B
TypeScript
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
import { CodeExample } from "./CodeExample";
|
|
|
|
const meta: Meta<typeof CodeExample> = {
|
|
title: "components/CodeExample",
|
|
component: CodeExample,
|
|
args: {
|
|
secret: false,
|
|
code: `echo "hello, friend!"`,
|
|
},
|
|
};
|
|
|
|
export default meta;
|
|
type Story = StoryObj<typeof CodeExample>;
|
|
|
|
export const Example: Story = {
|
|
args: {
|
|
secret: false,
|
|
},
|
|
};
|
|
|
|
export const Secret: Story = {
|
|
args: {
|
|
secret: true,
|
|
},
|
|
};
|
|
|
|
export const LongCode: Story = {
|
|
args: {
|
|
secret: false,
|
|
code: "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICnKzATuWwmmt5+CKTPuRGN0R1PBemA+6/SStpLiyX+L",
|
|
},
|
|
};
|
|
|
|
export const Redact: Story = {
|
|
args: {
|
|
secret: false,
|
|
redactPattern: /CODER_AGENT_TOKEN="([^"]+)"/g,
|
|
redactReplacement: `CODER_AGENT_TOKEN="********"`,
|
|
showRevealButton: true,
|
|
},
|
|
};
|