Skip to content

Commit 2ccfac5

Browse files
committed
Updating dashbutton for all affected D1 chapters
1 parent 4827f7a commit 2ccfac5

File tree

8 files changed

+58
-64
lines changed

8 files changed

+58
-64
lines changed

src/content/docs/d1/best-practices/remote-development.mdx

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
---
22
title: Remote development
33
pcx_content_type: concept
4+
reviewed: 2025-09-02
45
sidebar:
56
order: 9
67

78
---
89

10+
import { DashButton } from "~/components";
11+
912
D1 supports remote development using the [dashboard playground](/workers/playground/#use-the-playground). The dashboard playground uses a browser version of Visual Studio Code, allowing you to rapidly iterate on your Worker entirely in your browser.
1013

1114
## 1. Bind a D1 database to a Worker
@@ -20,14 +23,13 @@ Users new to D1 and/or Cloudflare Workers should read the [D1 tutorial](/d1/get-
2023

2124
:::
2225

23-
1. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com) and select your account.
24-
2. Go to [**Workers & Pages** > **Overview**](https://dash.cloudflare.com/?to=/:account/workers-and-pages).
25-
3. Select an existing Worker.
26-
4. Select the **Settings** tab.
27-
5. Select the **Variables** sub-tab.
28-
6. Scroll down to the **D1 Database Bindings** heading.
29-
7. Enter a variable name, such as `DB`, and select the D1 database you wish to access from this Worker.
30-
8. Select **Save and deploy**.
26+
1. <DashButton url="/?to=/:account/workers-and-pages" />
27+
2. Select an existing Worker.
28+
3. Go to the **Bindings** tab.
29+
4. Select **Add binding**.
30+
5. Select **D1 database** > **Add binding**.
31+
6. Enter a variable name, such as `DB`, and select the D1 database you wish to access from this Worker.
32+
7. Select **Add binding**.
3133

3234
## 2. Start a remote development session
3335

src/content/docs/d1/configuration/data-location.mdx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ sidebar:
55
order: 5
66
---
77

8+
import { DashButton } from "~/components";
9+
810
Learn how the location of data stored in D1 is determined, including where the leader is placed and how you optimize that location based on your needs.
911

1012
## Automatic (recommended)
@@ -46,11 +48,10 @@ wrangler d1 create new-database --location=weur
4648

4749
To provide a location hint when creating a database via the dashboard:
4850

49-
1. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com) and select your account.
50-
2. Go to [**Workers & Pages** > **D1**](https://dash.cloudflare.com/?to=/:account/workers/d1).
51-
3. Select **Create database**.
52-
4. Provide a database name and an optional **Location**.
53-
5. Select **Create** to create your database.
51+
1. <DashButton url="/?to=/:account/workers/d1" />
52+
2. Select **Create database**.
53+
3. Provide a database name and an optional **Location**.
54+
4. Select **Create** to create your database.
5455

5556
## Available location hints
5657

src/content/docs/d1/get-started.mdx

Lines changed: 17 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ sidebar:
66
order: 2
77
---
88

9-
import { Render, PackageManagers, Steps, FileTree, Tabs, TabItem, TypeScriptExample, WranglerConfig } from "~/components";
9+
import { Render, PackageManagers, Steps, FileTree, Tabs, TabItem, TypeScriptExample, WranglerConfig, DashButton } from "~/components";
1010

1111
This guide instructs you through:
1212

@@ -89,12 +89,11 @@ For example: `CI=true npm create cloudflare@latest d1-tutorial --type=simple --g
8989
</TabItem> <TabItem label='Dashboard'>
9090

9191
<Steps>
92-
1. Log in to your [Cloudflare dashboard](https://dash.cloudflare.com/) and select your account.
93-
2. Go to your account > **Compute (Workers)** > **Workers & Pages**.
94-
3. Select **Create**.
95-
4. Under **Start from a template**, select **Hello world**.
96-
5. Name your Worker. For this tutorial, name your Worker `d1-tutorial`.
97-
6. Select **Deploy**.
92+
1. <DashButton url="/?to=/:account/workers-and-pages" />
93+
2. Select **Create application**.
94+
3. Select **Start with Hello World!** > **Get started**.
95+
4. Name your Worker. For this tutorial, name your Worker `d1-tutorial`.
96+
5. Select **Deploy**.
9897
</Steps>
9998
</TabItem> </Tabs>
10099

@@ -148,7 +147,7 @@ This creates a new D1 database and outputs the [binding](/workers/runtime-apis/b
148147
</TabItem> <TabItem label='Dashboard'>
149148

150149
<Steps>
151-
1. Go to **Storage & Databases** > **D1 SQL Database**.
150+
1. <DashButton url="/?to=/:account/workers/d1" />
152151
2. Select **Create Database**.
153152
3. Name your database. For this tutorial, name your D1 database `prod-d1-tutorial`.
154153
4. (Optional) Provide a location hint. Location hint is an optional parameter you can provide to indicate your desired geographical location for your database. Refer to [Provide a location hint](/d1/configuration/data-location/#provide-a-location-hint) for more information.
@@ -216,18 +215,13 @@ You can also bind your D1 database to a [Pages Function](/pages/functions/). For
216215
You create bindings by adding them to the Worker you have created.
217216

218217
<Steps>
219-
1. Go to **Compute (Workers)** > **Workers & Pages**.
218+
1. <DashButton url="/?to=/:account/workers-and-pages" />
220219
2. Select the `d1-tutorial` Worker you created in [step 1](/d1/get-started/#1-create-a-worker).
221-
3. Select **Settings**.
222-
4. Scroll to **Bindings**, then select **Add**.
223-
5. Select **D1 database**.
220+
3. Go to the **Bindings** tab.
221+
4. Select **Add binding**.
222+
5. Select **D1 database** > **Add binding**.
224223
6. Name your binding in **Variable name**, then select the `prod-d1-tutorial` D1 database you created in [step 2](/d1/get-started/#2-create-a-database) from the dropdown menu. For this tutorial, name your binding `prod_d1_tutorial`.
225-
7. Select **Deploy** to deploy your binding. When deploying, there are two options:
226-
- **Deploy:** Immediately deploy the binding to 100% of your audience.
227-
- **Save version:** Save a version of the binding which you can deploy in the future.
228-
229-
For this tutorial, select **Deploy**.
230-
224+
7. Select **Add binding**.
231225
</Steps>
232226

233227
</TabItem>
@@ -298,7 +292,7 @@ After correctly preparing your [Wrangler configuration file](/workers/wrangler/c
298292
Use the Dashboard to create a table and populate it with data.
299293

300294
<Steps>
301-
1. Go to **Storage & Databases** > **D1 SQL Database**.
295+
1. <DashButton url="/?to=/:account/workers/d1" />
302296
2. Select the `prod-d1-tutorial` database you created in [step 2](/d1/get-started/#2-create-a-database).
303297
3. Select **Console**.
304298
4. Paste the following SQL snippet.
@@ -399,7 +393,7 @@ After configuring your Worker, you can test your project locally before you depl
399393
You can query your D1 database using your Worker.
400394

401395
<Steps>
402-
1. Go to **Compute (Workers)** > **Workers & Pages**.
396+
1. <DashButton url="/?to=/:account/workers-and-pages" />
403397
2. Select the `d1-tutorial` Worker you created.
404398
3. Select the **Edit code** icon (**\<\/\>**).
405399
4. Clear the contents of the `worker.js` file, then paste the following code:
@@ -521,7 +515,7 @@ To deploy your Worker to production using Wrangler, you must first repeat the [d
521515
</TabItem> <TabItem label='Dashboard'>
522516
<Steps>
523517

524-
1. Go to **Compute (Workers)** > **Workers & Pages**.
518+
1. <DashButton url="/?to=/:account/workers-and-pages" />
525519
2. Select your `d1-tutorial` Worker.
526520
3. Select **Deployments**.
527521
4. From the **Version History** table, select **Deploy version**.
@@ -575,7 +569,7 @@ npx wrangler d1 delete prod-d1-tutorial
575569
</TabItem><TabItem label='Dashboard'>
576570

577571
<Steps>
578-
1. Go to **Storages & Databases** > **D1 SQL Database**.
572+
1. <DashButton url="/?to=/:account/workers/d1" />
579573

580574
2. Select your `prod-d1-tutorial` D1 database.
581575

@@ -606,7 +600,7 @@ npx wrangler delete d1-tutorial
606600
</TabItem> <TabItem label='Dashboard'>
607601

608602
<Steps>
609-
1. Go to **Compute (Workers)** > **Workers & Pages**.
603+
1. <DashButton url="/?to=/:account/workers-and-pages" />
610604

611605
2. Select your `d1-tutorial` Worker.
612606

src/content/docs/d1/observability/audit-logs.mdx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,13 @@ pcx_content_type: reference
33
title: Audit Logs
44
---
55

6+
import { DashButton } from "~/components";
7+
68
[Audit logs](/fundamentals/account/account-security/review-audit-logs/) provide a comprehensive summary of changes made within your Cloudflare account, including those made to D1 databases. This functionality is available on all plan types, free of charge, and is always enabled.
79

810
## Viewing audit logs
911

10-
To view audit logs for your D1 databases:
11-
12-
1. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com/?account=audit-log) and select your account.
13-
2. Go to **Manage Account** > **Audit Log**.
12+
To view audit logs for your D1 databases, <DashButton url="/?to=/:account/audit-log" />
1413

1514
For more information on how to access and use audit logs, refer to [Review audit logs](/fundamentals/account/account-security/review-audit-logs/).
1615

src/content/docs/d1/observability/billing.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ sidebar:
55
order: 11
66
---
77

8+
import { DashButton } from "~/components";
89

910
D1 exposes analytics to track billing metrics (rows read, rows written, and total storage) across all databases in your account.
1011

@@ -14,9 +15,8 @@ The metrics displayed in the [Cloudflare dashboard](https://dash.cloudflare.com/
1415

1516
Total account billable usage analytics for D1 are available in the Cloudflare dashboard. To view current and past metrics for an account:
1617

17-
1. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com) and select your account.
18-
2. Go to **Manage Account** > **Billing**.
19-
3. Select the **Billable Usage** tab.
18+
1. <DashButton url="/?to=/:account/billing" />
19+
2. Go to **Billable Usage**.
2020

2121
From here you can view charts of your account's D1 usage on a daily or month-to-date timeframe.
2222

src/content/docs/d1/observability/metrics-analytics.mdx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
---
22
pcx_content_type: concept
33
title: Metrics and analytics
4+
reviewed: 2025-09-02
45
sidebar:
56
order: 10
67
---
78

8-
import { Details } from "~/components";
9+
import { Details, DashButton } from "~/components";
910

1011
D1 exposes database analytics that allow you to inspect query volume, query latency, and storage size across all and/or each database in your account.
1112

@@ -40,10 +41,9 @@ Refer to the [Pricing documentation](/d1/platform/pricing/) for more details on
4041

4142
Per-database analytics for D1 are available in the Cloudflare dashboard. To view current and historical metrics for a database:
4243

43-
1. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com) and select your account.
44-
2. Go to [**Workers & Pages** > **D1**](https://dash.cloudflare.com/?to=/:account/workers/d1).
45-
3. Select an existing database.
46-
4. Select the **Metrics** tab.
44+
1. <DashButton url="/?to=/:account/workers/d1" />
45+
2. Select an existing D1 database.
46+
3. Select the **Metrics** tab.
4747

4848
You can optionally select a time window to query. This defaults to the last 24 hours.
4949

src/content/docs/d1/tutorials/import-to-d1-with-rest-api/index.mdx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ tags:
1010
- SQL
1111
---
1212

13-
import { Render, Steps, PackageManagers } from "~/components";
13+
import { Render, Steps, PackageManagers, DashButton } from "~/components";
1414

1515
In this tutorial, you will learn how to import a database into D1 using the [REST API](/api/resources/d1/subresources/database/methods/import/).
1616

@@ -38,8 +38,8 @@ To create the table, follow these steps:
3838

3939
<Steps>
4040

41-
1. Go to **Storage & Databases** > **D1**.
42-
2. Select **Create**.
41+
1. <DashButton url="/?to=/:account/workers/d1" />
42+
2. Select **Create database**.
4343
3. Name your database. For this tutorial, name your D1 database `d1-import-tutorial`.
4444
4. (Optional) Provide a location hint. Location hint is an optional parameter you can provide to indicate your desired geographical location for your database. Refer to [Provide a location hint](/d1/configuration/data-location/#provide-a-location-hint) for more information.
4545
5. Select **Create**.
@@ -80,8 +80,8 @@ To create the table, follow these steps:
8080
3. In your `index.js` file, define the following variables:
8181

8282
- `TARGET_TABLE`: The target table name
83-
- `ACCOUNT_ID`: The account ID (you can find this in the Cloudflare dashboard > **Workers & Pages**)
84-
- `DATABASE_ID`: The D1 database ID (you can find this in the Cloudflare dashboard > **Storage & Databases** > **D1 SQL Database** > your database)
83+
- `ACCOUNT_ID`: The account ID. Refer to **Account Details** in **Workers & Pages**.
84+
- `DATABASE_ID`: The D1 database ID. Go to your data base to see your database ID.
8585
- `D1_API_KEY`: The D1 API token generated in [step 1](/d1/tutorials/import-to-d1-with-rest-api#1-create-a-d1-api-token)
8686

8787
:::caution

src/content/partials/d1/generate-d1-api-token.mdx

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,20 @@
22
{}
33
---
44

5-
import { Steps } from "~/components";
5+
import { Steps, DashButton } from "~/components";
66

77
<Steps>
8-
1. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com/) and select your account.
9-
2. Select your user icon, then select **My Profile**.
10-
3. Go to **API Tokens**.
11-
4. Under **API Tokens**, select **Create Token**.
12-
5. Scroll to **Custom token** > **Create custom token**, then select **Get started**.
13-
6. Under **Token name**, enter a descriptive token name. For example, `Name-D1-Import-API-Token`.
14-
7. Under **Permissions**:
8+
1. <DashButton url="/?to=/:account/api-tokens" />
9+
2. Under **API Tokens**, select **Create Token**.
10+
3. Scroll to **Custom token** > **Create custom token**, then select **Get started**.
11+
4. Under **Token name**, enter a descriptive token name. For example, `Name-D1-Import-API-Token`.
12+
5. Under **Permissions**:
1513
- Select **Account**.
1614
- Select **D1**.
1715
- Select **Edit**.
18-
8. Select **Continue to summary**.
19-
9. Select **Create token**.
20-
10. Copy the API token and save it in a secure file.
16+
6. Select **Continue to summary**.
17+
7. Select **Create token**.
18+
8. Copy the API token and save it in a secure file.
2119
</Steps>
2220

2321
- Refer to [Create API token](/fundamentals/api/get-started/create-token/) for more information on creating API tokens through the Cloudflare dashboard.

0 commit comments

Comments
 (0)