Skip to content

Open-source status page, incident response and uptime monitoring

chore: cli block (#1308)

Maximilian Kaskee7b5b2474b2d
diff --git a/apps/web/src/app/(pages)/(content)/(landing)/[slug]/page.tsx b/apps/web/src/app/(pages)/(content)/(landing)/[slug]/page.tsx
index 3cd4bd1d5..7e915794d 100644
--- a/apps/web/src/app/(pages)/(content)/(landing)/[slug]/page.tsx
+++ b/apps/web/src/app/(pages)/(content)/(landing)/[slug]/page.tsx
@@ -92,7 +92,7 @@ export default async function Page({
function Hero({ hero, description }: { hero: string; description: string }) {
return (
<div className="mx-auto my-12 flex flex-col items-center gap-4 sm:my-16 md:gap-6">
- <div className="flex flex-col gap-4 text-center md:gap-6">
+ <div className="flex flex-col gap-2 text-center md:gap-4">
<h1 className="font-cal text-5xl leading-tight md:text-6xl">{hero}</h1>
<h2 className="mx-auto max-w-md text-muted-foreground text-xl md:max-w-xl md:text-2xl">
{description}
diff --git a/apps/web/src/app/(pages)/(content)/page.tsx b/apps/web/src/app/(pages)/(content)/page.tsx
index 3dbc061eb..81885e8c7 100644
--- a/apps/web/src/app/(pages)/(content)/page.tsx
+++ b/apps/web/src/app/(pages)/(content)/page.tsx
@@ -16,7 +16,7 @@ const jsonLdProduct: WithContext<Product> = {
"@context": "https://schema.org",
"@type": "Product",
name: "openstatus",
- description: "Opensource uptime and synthetic monitoring.",
+ description: "Open-source uptime and synthetic monitoring with status pages.",
brand: {
"@type": "Brand",
name: "openstatus",
@@ -56,7 +56,7 @@ const jsonLDWebpage: WithContext<WebPage> = {
"@context": "https://schema.org",
"@type": "WebPage",
name: "openstatus",
- description: "Opensource uptime and synthetic monitoring.",
+ description: "Open-source uptime and synthetic monitoring with status pages.",
url: "https://openstatus.dev",
image: "https://openstatus.dev/assets/logos/OpenStatus-Logo.svg",
headline: "Showcase your uptime with a status page",
diff --git a/apps/web/src/components/icons.tsx b/apps/web/src/components/icons.tsx
index 53e900871..357c53940 100644
--- a/apps/web/src/components/icons.tsx
+++ b/apps/web/src/components/icons.tsx
@@ -17,7 +17,9 @@ import {
CreditCard,
Eye,
EyeOff,
+ File,
FileClock,
+ FileText,
Fingerprint,
Gauge,
Globe,
@@ -62,6 +64,7 @@ import {
UserCircle,
Users,
Webhook,
+ Workflow,
Youtube,
Zap,
} from "lucide-react";
@@ -106,6 +109,9 @@ export const Icons = {
bell: Bell,
zap: Zap,
eye: Eye,
+ file: File,
+ "file-text": FileText,
+ workflow: Workflow,
"eye-off": EyeOff,
network: Network,
users: Users,
diff --git a/apps/web/src/components/marketing/cli/card.tsx b/apps/web/src/components/marketing/cli/card.tsx
index a42fe7b46..333787553 100644
--- a/apps/web/src/components/marketing/cli/card.tsx
+++ b/apps/web/src/components/marketing/cli/card.tsx
@@ -1,4 +1,6 @@
import { cardConfig } from "@/config/features";
+import { Button } from "@openstatus/ui";
+import Link from "next/link";
import {
CardContainer,
CardContent,
@@ -8,7 +10,7 @@ import {
CardIcon,
CardTitle,
} from "../card";
-import { Terminal } from "./terminal";
+import { Code } from "./code";
export function CLICard() {
const { icon, title, features } = cardConfig.cli;
@@ -19,11 +21,22 @@ export function CLICard() {
<CardTitle>{title}</CardTitle>
</CardHeader>
<CardContent>
- <Terminal />
+ <Code />
<CardFeatureContainer>
{features?.map((feature, i) => (
<CardFeature key={i} {...feature} />
))}
+ <div className="text-center">
+ <Button className="rounded-full" asChild>
+ <Link
+ href="https://docs.openstatus.dev/cli/getting-started/"
+ target="_blank"
+ rel="noreferrer"
+ >
+ Learn more
+ </Link>
+ </Button>
+ </div>
</CardFeatureContainer>
</CardContent>
</CardContainer>
diff --git a/apps/web/src/components/marketing/cli/code.tsx b/apps/web/src/components/marketing/cli/code.tsx
new file mode 100644
index 000000000..611e3023b
--- /dev/null
+++ b/apps/web/src/components/marketing/cli/code.tsx
@@ -0,0 +1,33 @@
+import { Mdx } from "@/components/content/mdx";
+import { allUnrelateds } from "content-collections";
+
+const blockYaml = allUnrelateds.find(
+ (unrelated) => unrelated.slug === "yaml-file",
+);
+
+const blockCLI = allUnrelateds.find(
+ (unrelated) => unrelated.slug === "cli-block",
+);
+
+export function Code() {
+ if (!blockYaml) {
+ throw new Error("Yaml block not found");
+ }
+
+ if (!blockCLI) {
+ throw new Error("CLI block not found");
+ }
+
+ return (
+ <div className="flex flex-col gap-4">
+ <Mdx
+ code={blockCLI.mdx}
+ className="max-w-none prose-pre:overflow-hidden"
+ />
+ <Mdx
+ code={blockYaml.mdx}
+ className="max-w-none prose-pre:overflow-hidden"
+ />
+ </div>
+ );
+}
diff --git a/apps/web/src/components/marketing/cli/terminal.tsx b/apps/web/src/components/marketing/cli/terminal.tsx
deleted file mode 100644
index d987d8e0f..000000000
--- a/apps/web/src/components/marketing/cli/terminal.tsx
+++ /dev/null
@@ -1,42 +0,0 @@
-"use client";
-
-import { useCopyToClipboard } from "@/hooks/use-copy-to-clipboard";
-import { cn } from "@/lib/utils";
-import { Button } from "@openstatus/ui";
-import { CheckIcon, CopyIcon } from "lucide-react";
-import type React from "react";
-
-const command = "openstatus monitors trigger 420";
-
-export function Terminal({ className, ...props }: React.ComponentProps<"pre">) {
- const { copy, isCopied } = useCopyToClipboard();
-
- function handleCopy() {
- copy(command, { withToast: true });
- }
-
- return (
- <div className="relative truncate">
- <pre
- className={cn("rounded-lg border bg-muted/50 px-4 py-2", className)}
- {...props}
- >
- <code className="text-sm">
- <span className="text-muted-foreground">$</span> {command}
- </code>
- <Button
- variant="ghost"
- size="icon"
- onClick={handleCopy}
- className="absolute top-1 right-1 backdrop-blur-sm hover:bg-transparent"
- >
- {isCopied ? (
- <CheckIcon className="size-4" />
- ) : (
- <CopyIcon className="size-4" />
- )}
- </Button>
- </pre>
- </div>
- );
-}
diff --git a/apps/web/src/components/marketing/feature/index.tsx b/apps/web/src/components/marketing/feature/index.tsx
index 677b153f8..a151df91a 100644
--- a/apps/web/src/components/marketing/feature/index.tsx
+++ b/apps/web/src/components/marketing/feature/index.tsx
@@ -475,6 +475,36 @@ export function FeatureGitHubAction(
);
}
+const blockYaml = allUnrelateds.find(
+ (unrelated) => unrelated.slug === "yaml-file",
+);
+
+export function FeatureYAML(
+ props: Partial<Pick<InteractiveFeatureProps, "position">>,
+) {
+ if (!blockYaml) {
+ throw new Error("YAML file block not found");
+ }
+
+ return (
+ <InteractiveFeature
+ icon="file-text"
+ iconText="YAML File"
+ title="Monitoring as Code."
+ subTitle="Use any version control system to manage your monitors."
+ className="max-h-max"
+ component={
+ <Mdx
+ code={blockYaml.mdx}
+ className="max-w-none prose-pre:overflow-hidden"
+ />
+ }
+ col={2}
+ position={props.position || "right"}
+ />
+ );
+}
+
export function FeatureCLI(
props: Partial<Pick<InteractiveFeatureProps, "position">>,
) {
@@ -490,7 +520,7 @@ export function FeatureCLI(
icon="terminal"
iconText="CLI"
title="Run everywhere."
- subTitle="Create your monitors from your favorite terminal."
+ subTitle="Manage and trigger your monitors from your favorite terminal."
component={
<Mdx
code={blockCLI.mdx}
diff --git a/apps/web/src/config/features.tsx b/apps/web/src/config/features.tsx
index 90a49d5c7..abe4b7335 100644
--- a/apps/web/src/config/features.tsx
+++ b/apps/web/src/config/features.tsx
@@ -106,23 +106,22 @@ export const cardConfig = {
icon: "terminal",
title: "CLI",
features: [
+ {
+ icon: "file-text",
+ catchline: "YAML file configuration",
+ description: "Use version control to keep track of all your changes.",
+ },
{
icon: "sparkles",
- catchline: "No ClickOps",
- description: (
- <p>
- Use your config file to manage or trigger your monitors. Never leave
- your terminal.{" "}
- <a
- className="text-foreground"
- href="https://docs.openstatus.dev/cli/getting-started/"
- target="_blank"
- rel="noreferrer"
- >
- Learn more
- </a>
- </p>
- ),
+ catchline: "Monitoring as Code",
+ description:
+ "Apply changes to your monitors directly from the terminal.",
+ },
+ {
+ icon: "workflow",
+ catchline: "CI/CD",
+ description:
+ "Trigger a specific monitor or run your file within your workflows.",
},
],
},
diff --git a/apps/web/src/config/landings.tsx b/apps/web/src/config/landings.tsx
index 3dd273057..e7efdcc36 100644
--- a/apps/web/src/config/landings.tsx
+++ b/apps/web/src/config/landings.tsx
@@ -21,6 +21,7 @@ import {
FeatureSubscriptions,
FeatureTerraformProvider,
FeatureTimingAssertions,
+ FeatureYAML,
SpeedBanner,
} from "@/components/marketing/feature";
@@ -97,6 +98,7 @@ export const landingsConfig = {
"Use configuration files to define your monitoring and store them in your codebase.",
blocks: [
<FeatureCLI key="feature-cli" />,
+ <FeatureYAML key="feature-yaml-file" position="top" />,
<FeatureGitHubAction key="feature-github-action" />,
<EnterpriseBanner key="enterprise-banner" />,
<FeatureAPIMonitoring key="feature-api-monitoring" />,
diff --git a/apps/web/src/content/unrelated/cli-block.mdx b/apps/web/src/content/unrelated/cli-block.mdx
index 238a8ef6e..c4f45c115 100644
--- a/apps/web/src/content/unrelated/cli-block.mdx
+++ b/apps/web/src/content/unrelated/cli-block.mdx
@@ -1,3 +1,3 @@
```bash
-openstatus monitors create --config openstatus.yaml
+$ openstatus monitors apply
```
diff --git a/apps/web/src/content/unrelated/yaml-file.mdx b/apps/web/src/content/unrelated/yaml-file.mdx
new file mode 100644
index 000000000..d26774728
--- /dev/null
+++ b/apps/web/src/content/unrelated/yaml-file.mdx
@@ -0,0 +1,14 @@
+```yaml title="openstatus.yaml"
+"openstat.us":
+ active: true
+ frequency: 1m
+ kind: http
+ name: openstat.us
+ regions:
+ - ams
+ - iad
+ - syd
+ request:
+ method: GET
+ url: https://openstat.us
+```
\ No newline at end of file
diff --git a/apps/web/src/styles/globals.css b/apps/web/src/styles/globals.css
index 1241aa7c3..2855ca5b9 100644
--- a/apps/web/src/styles/globals.css
+++ b/apps/web/src/styles/globals.css
@@ -215,4 +215,28 @@
[data-highlighted-line] {
@apply bg-muted rounded;
}
-}
+
+ [data-rehype-pretty-code-caption] {
+ @apply mt-1 text-muted-foreground text-xs;
+ }
+
+ [data-rehype-pretty-code-title] {
+ @apply mb-1 text-muted-foreground text-xs font-mono;
+ }
+
+ .dark [data-theme='dark'] {
+ display: block;
+ }
+
+ [data-theme='dark'] {
+ display: none;
+ }
+
+ [data-theme='light'] {
+ display: block;
+ }
+
+ .dark [data-theme='light'] {
+ display: none;
+ }
+}
\ No newline at end of file