Skip to content

Commit 6f5e99b

Browse files
committed
feat(web): add GitHub link to AppHeader and enhance dashboard page with improved credit usage descriptions and icon updates
1 parent 784ea5b commit 6f5e99b

2 files changed

Lines changed: 45 additions & 90 deletions

File tree

apps/web/src/components/app-header.tsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import BookOpen from "lucide-react/icons/book-open";
22
import Bot from "lucide-react/icons/bot";
33
import Building from "lucide-react/icons/building";
4+
import Github from "lucide-react/icons/github";
45
import Settings from "lucide-react/icons/settings";
56
import { Link } from "react-router";
67

@@ -68,6 +69,15 @@ export function AppHeader() {
6869
<BookOpen className="h-4 w-4 mr-1.5" />
6970
<span>Documentation</span>
7071
</NavLink>
72+
<a
73+
href="https://github.com/dafthunk-com/dafthunk"
74+
target="_blank"
75+
rel="noopener noreferrer"
76+
className={navLinkClasses}
77+
>
78+
<Github className="h-4 w-4 mr-1.5" />
79+
<span>GitHub</span>
80+
</a>
7181
</nav>
7282
<ThemeToggle />
7383
<UserProfile />

apps/web/src/pages/dashboard-page.tsx

Lines changed: 35 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import AlertCircle from "lucide-react/icons/alert-circle";
2-
import Clock from "lucide-react/icons/clock";
31
import CreditCard from "lucide-react/icons/credit-card";
42
import Layers from "lucide-react/icons/layers";
53
import Logs from "lucide-react/icons/logs";
4+
import Minus from "lucide-react/icons/minus";
5+
import Plus from "lucide-react/icons/plus";
66
import Target from "lucide-react/icons/target";
77
import Workflow from "lucide-react/icons/workflow";
88
import { useEffect } from "react";
@@ -11,7 +11,6 @@ import { Link } from "react-router";
1111
import { InsetError } from "@/components/inset-error";
1212
import { InsetLoading } from "@/components/inset-loading";
1313
import { InsetLayout } from "@/components/layouts/inset-layout";
14-
import { Badge } from "@/components/ui/badge";
1514
import { Button } from "@/components/ui/button";
1615
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
1716
import { useOrgUrl } from "@/hooks/use-org-url";
@@ -62,7 +61,7 @@ export function DashboardPage() {
6261
const getProgressColor = (percentage: number) => {
6362
if (percentage >= 90) return "bg-red-500";
6463
if (percentage >= 70) return "bg-yellow-500";
65-
return "bg-green-500";
64+
return "bg-blue-500";
6665
};
6766

6867
return (
@@ -77,15 +76,15 @@ export function DashboardPage() {
7776
<CardContent>
7877
<div className="text-4xl font-bold">{dashboardStats.workflows}</div>
7978
<p className="text-xs text-muted-foreground pt-1">
80-
Total workflows created
79+
Number of workflows
8180
</p>
8281
<Button
8382
variant="outline"
8483
size="sm"
8584
className="mt-4 text-xs h-8"
8685
asChild
8786
>
88-
<Link to={getOrgUrl("workflows")}>Go to Workflows</Link>
87+
<Link to={getOrgUrl("workflows")}>View Workflows</Link>
8988
</Button>
9089
</CardContent>
9190
</Card>
@@ -99,7 +98,7 @@ export function DashboardPage() {
9998
{dashboardStats.deployments}
10099
</div>
101100
<p className="text-xs text-muted-foreground pt-1">
102-
Active deployments
101+
Number of deployments
103102
</p>
104103
<Button
105104
variant="outline"
@@ -120,100 +119,64 @@ export function DashboardPage() {
120119
<div className="text-4xl font-bold">
121120
{dashboardStats.executions.total}
122121
</div>
123-
<div className="text-xs text-muted-foreground pt-1 flex gap-3">
124-
<div className="flex items-center gap-1">
125-
<span className="flex size-2 translate-y-px rounded-full bg-blue-500" />
126-
<span>{dashboardStats.executions.running} running</span>
127-
</div>
128-
<div className="flex items-center gap-1">
129-
<span className="flex items-center gap-1">
130-
<AlertCircle className="size-3 text-red-500" />
131-
{dashboardStats.executions.failed} failed
132-
</span>
133-
</div>
134-
<div className="flex items-center gap-1">
135-
<Clock className="size-3" />
136-
<span>
137-
Avg. time: {dashboardStats.executions.avgTimeSeconds}s
138-
</span>
139-
</div>
140-
</div>
122+
<p className="text-xs text-muted-foreground pt-1">
123+
Number of executions
124+
</p>
141125
<Button
142126
variant="outline"
143127
size="sm"
144128
className="mt-4 text-xs h-8"
145129
asChild
146130
>
147-
<Link to={getOrgUrl("executions")}>View All Executions</Link>
131+
<Link to={getOrgUrl("executions")}>View Executions</Link>
148132
</Button>
149133
</CardContent>
150134
</Card>
151135
</div>
152136

153137
{/* Credits Section */}
154138
<div className="grid gap-4 md:grid-cols-2 lg:grid-cols-3 mb-6">
155-
{/* Total Credits Card */}
139+
{/* Credits Limit Card */}
156140
<Card>
157141
<CardHeader className="flex flex-row items-center justify-between space-y-0 pb-1">
158-
<CardTitle className="text-xl">Total Credits</CardTitle>
159-
<CreditCard className="size-8 text-muted-foreground" />
142+
<CardTitle className="text-xl">Credits</CardTitle>
143+
<Plus className="size-8 text-muted-foreground" />
160144
</CardHeader>
161145
<CardContent>
162-
<div className="text-4xl font-bold text-primary">
146+
<div className="text-4xl font-bold">
163147
{computeCredits.toLocaleString()}
164148
</div>
165-
<p className="text-xs text-muted-foreground pt-1">
166-
Available this month
167-
</p>
168-
<Badge variant="secondary" className="mt-2 text-xs">
169-
Monthly allocation
170-
</Badge>
149+
<p className="text-xs text-muted-foreground pt-1">Credits limit</p>
171150
</CardContent>
172151
</Card>
173152

174-
{/* Used Credits Card */}
153+
{/* Credits Used Card */}
175154
<Card>
176155
<CardHeader className="flex flex-row items-center justify-between space-y-0 pb-1">
177-
<CardTitle className="text-xl">Used Credits</CardTitle>
178-
<Layers className="size-8 text-muted-foreground" />
156+
<CardTitle className="text-xl">Used</CardTitle>
157+
<Minus className="size-8 text-muted-foreground" />
179158
</CardHeader>
180159
<CardContent>
181-
<div className="text-4xl font-bold text-destructive">
160+
<div className="text-4xl font-bold">
182161
{computeUsage.toLocaleString()}
183162
</div>
184-
<p className="text-xs text-muted-foreground pt-1">
185-
Credits consumed
186-
</p>
187-
<div className="text-xs text-muted-foreground pt-1 flex items-center gap-1">
188-
<span className="flex size-2 translate-y-px rounded-full bg-red-500" />
189-
<span>{usagePercentage.toFixed(1)}% of total</span>
190-
</div>
163+
<p className="text-xs text-muted-foreground pt-1">Credits used</p>
191164
</CardContent>
192165
</Card>
193166

194-
{/* Remaining Credits Card */}
167+
{/* Credits Remaining Card */}
195168
<Card>
196169
<CardHeader className="flex flex-row items-center justify-between space-y-0 pb-1">
197170
<CardTitle className="text-xl">Remaining</CardTitle>
198-
<Clock className="size-8 text-muted-foreground" />
171+
<CreditCard className="size-8 text-muted-foreground" />
199172
</CardHeader>
200173
<CardContent>
201-
<div className="text-4xl font-bold text-green-600">
174+
<div className="text-4xl font-bold">
202175
{remainingCredits.toLocaleString()}
203176
</div>
204177
<p className="text-xs text-muted-foreground pt-1">
205-
Credits left this month
178+
Credits remaining
206179
</p>
207-
<div className="text-xs text-muted-foreground pt-1 flex items-center gap-1">
208-
<span className="flex size-2 translate-y-px rounded-full bg-green-500" />
209-
<span>
210-
{usagePercentage >= 90
211-
? "Low remaining"
212-
: usagePercentage >= 70
213-
? "Moderate usage"
214-
: "Plenty remaining"}
215-
</span>
216-
</div>
217180
</CardContent>
218181
</Card>
219182
</div>
@@ -223,7 +186,7 @@ export function DashboardPage() {
223186
<CardHeader>
224187
<CardTitle className="flex items-center justify-between">
225188
<span>Usage Progress</span>
226-
<span className="text-2xl font-bold text-primary">
189+
<span className="text-2xl font-bold">
227190
{usagePercentage.toFixed(1)}%
228191
</span>
229192
</CardTitle>
@@ -243,48 +206,30 @@ export function DashboardPage() {
243206

244207
{/* Usage Status Message */}
245208
<div className="p-4 rounded-md bg-muted">
246-
{usagePercentage >= 90 ? (
247-
<p className="text-sm text-red-600 font-medium">
248-
⚠️ You've used {usagePercentage.toFixed(1)}% of your compute
249-
credits. Consider upgrading your plan or contact support.
250-
</p>
251-
) : usagePercentage >= 70 ? (
252-
<p className="text-sm text-yellow-600 font-medium">
253-
You've used {usagePercentage.toFixed(1)}% of your compute
254-
credits. Monitor your usage to avoid hitting limits.
255-
</p>
256-
) : (
257-
<p className="text-sm text-green-600 font-medium">
258-
You're using {usagePercentage.toFixed(1)}% of your compute
259-
credits. You have plenty of credits remaining this month.
260-
</p>
261-
)}
209+
<p className="text-sm text-muted-foreground">
210+
{usagePercentage.toFixed(1)}% of compute credits used
211+
</p>
262212
</div>
263213
</div>
264214
</CardContent>
265215
</Card>
266216

267217
{/* How Credits Work Card */}
268218
<Card className="mb-6">
269-
<CardHeader>
270-
<CardTitle className="flex items-center gap-3">
271-
<div className="flex-shrink-0 w-8 h-8 bg-blue-100 rounded-lg flex items-center justify-center">
272-
<Layers className="w-4 h-4 text-blue-600" />
273-
</div>
274-
How Credits Work
275-
</CardTitle>
219+
<CardHeader className="flex flex-row items-center justify-between space-y-0 pb-1">
220+
<CardTitle className="text-xl">How Credits Work</CardTitle>
221+
<Layers className="size-8 text-muted-foreground" />
276222
</CardHeader>
277223
<CardContent>
278224
<div className="space-y-2 text-sm text-muted-foreground">
279225
<p>
280-
Compute credits are consumed based on the individual nodes that
281-
execute within your workflows. Each node type has a different
282-
credit cost depending on its computational requirements.
226+
Compute credits are consumed by individual nodes within your
227+
workflows. Each node type has different credit costs based on
228+
computational requirements.
283229
</p>
284230
<p>
285231
The total cost of a workflow execution is the sum of all executed
286-
nodes. More complex workflows with many nodes or
287-
resource-intensive operations will consume more credits.
232+
nodes. More complex workflows consume more credits.
288233
</p>
289234
</div>
290235
</CardContent>

0 commit comments

Comments
 (0)