Skip to content

Commit 062b671

Browse files
committed
Fix stateful service deploy
1 parent edc6507 commit 062b671

14 files changed

Lines changed: 138 additions & 131 deletions

File tree

web/actions/projects.ts

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -728,10 +728,15 @@ export async function deployService(serviceId: string) {
728728
env[secret.key] = secret.encryptedValue;
729729
}
730730

731-
await db
732-
.update(services)
733-
.set({ replicas: totalReplicas })
734-
.where(eq(services.id, serviceId));
731+
const updateData: { replicas: number; lockedServerId?: string } = {
732+
replicas: totalReplicas,
733+
};
734+
735+
if (service.stateful && !service.lockedServerId) {
736+
updateData.lockedServerId = serverIds[0];
737+
}
738+
739+
await db.update(services).set(updateData).where(eq(services.id, serviceId));
735740

736741
const deploymentIds: string[] = [];
737742
let replicaIndex = 0;

web/app/(dashboard)/dashboard/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export default async function DashboardPage() {
1919
]);
2020

2121
return (
22-
<div className="pt-4 space-y-12">
22+
<div className="container max-w-7xl mx-auto px-4 py-6 space-y-12">
2323
<div className="space-y-6">
2424
<div className="flex items-center justify-between">
2525
<div>

web/app/(dashboard)/dashboard/projects/[slug]/[env]/page.tsx

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,14 @@ export default async function ProjectEnvironmentPage({
3232
},
3333
]}
3434
/>
35-
<ServiceCanvas
36-
projectId={project.id}
37-
projectSlug={slug}
38-
envId={environment.id}
39-
envName={environment.name}
40-
/>
35+
<div className="container max-w-7xl mx-auto px-4 py-6">
36+
<ServiceCanvas
37+
projectId={project.id}
38+
projectSlug={slug}
39+
envId={environment.id}
40+
envName={environment.name}
41+
/>
42+
</div>
4143
</>
4244
);
4345
}

web/app/(dashboard)/dashboard/projects/[slug]/[env]/services/[serviceId]/builds/[buildId]/page.tsx

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -87,13 +87,15 @@ export default async function BuildPage({
8787
},
8888
]}
8989
/>
90-
<BuildDetails
91-
projectSlug={slug}
92-
envName={env}
93-
service={data.service}
94-
build={data.build}
95-
githubRepo={data.githubRepo}
96-
/>
90+
<div className="container max-w-7xl mx-auto px-4 py-6">
91+
<BuildDetails
92+
projectSlug={slug}
93+
envName={env}
94+
service={data.service}
95+
build={data.build}
96+
githubRepo={data.githubRepo}
97+
/>
98+
</div>
9799
</>
98100
);
99101
}

web/app/(dashboard)/dashboard/projects/[slug]/[env]/services/[serviceId]/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ export default function ArchitecturePage() {
4545
}}
4646
label="Stop All"
4747
loadingLabel="Stopping..."
48-
variant="destructive"
48+
variant="warning"
4949
size="sm"
5050
onComplete={onUpdate}
5151
/>

web/app/(dashboard)/dashboard/projects/[slug]/settings/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export default async function ProjectSettingsPage({
2929
{ label: "Settings", href: `/dashboard/projects/${slug}/settings` },
3030
]}
3131
/>
32-
<div className="space-y-6">
32+
<div className="container max-w-7xl mx-auto px-4 py-6 space-y-6">
3333
<div>
3434
<h1 className="text-2xl font-bold">Project Settings</h1>
3535
<p className="text-muted-foreground">

web/app/(dashboard)/dashboard/servers/[id]/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export default async function ServerDetailPage({
3535
{ label: server.name, href: `/dashboard/servers/${id}` },
3636
]}
3737
/>
38-
<div className="space-y-6">
38+
<div className="container max-w-7xl mx-auto px-4 py-6 space-y-6">
3939
<div className="flex items-center gap-3">
4040
<h1 className="text-lg font-semibold">{server.name}</h1>
4141
<StatusIndicator status={server.status} />

web/app/(dashboard)/layout-client.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ export function DashboardLayoutClient({
103103
<div className="min-h-screen">
104104
<DashboardHeader email={session.user.email} />
105105
<OfflineServersBanner />
106-
<main className="container max-w-7xl mx-auto px-4 py-6">
106+
<main>
107107
{children}
108108
</main>
109109
<Toaster />

web/app/globals.css

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -58,30 +58,30 @@
5858
--card-foreground: oklch(0.147 0.004 49.25);
5959
--popover: oklch(1 0 0);
6060
--popover-foreground: oklch(0.147 0.004 49.25);
61-
--primary: oklch(0.61 0.11 222);
62-
--primary-foreground: oklch(0.98 0.02 201);
61+
--primary: oklch(0.55 0.2 260);
62+
--primary-foreground: oklch(0.98 0.01 260);
6363
--secondary: oklch(0.967 0.001 286.375);
6464
--secondary-foreground: oklch(0.21 0.006 285.885);
6565
--muted: oklch(0.97 0.001 106.424);
6666
--muted-foreground: oklch(0.553 0.013 58.071);
67-
--accent: oklch(0.61 0.11 222);
68-
--accent-foreground: oklch(0.98 0.02 201);
67+
--accent: oklch(0.55 0.2 260);
68+
--accent-foreground: oklch(0.98 0.01 260);
6969
--destructive: oklch(0.577 0.245 27.325);
7070
--border: oklch(0.923 0.003 48.717);
7171
--input: oklch(0.923 0.003 48.717);
7272
--ring: oklch(0.709 0.01 56.259);
73-
--chart-1: oklch(0.87 0.12 207);
74-
--chart-2: oklch(0.8 0.13 212);
75-
--chart-3: oklch(0.71 0.13 215);
76-
--chart-4: oklch(0.61 0.11 222);
77-
--chart-5: oklch(0.52 0.09 223);
73+
--chart-1: oklch(0.85 0.15 250);
74+
--chart-2: oklch(0.75 0.18 255);
75+
--chart-3: oklch(0.65 0.2 260);
76+
--chart-4: oklch(0.55 0.2 260);
77+
--chart-5: oklch(0.45 0.18 265);
7878
--radius: 0.75rem;
7979
--sidebar: oklch(0.985 0.001 106.423);
8080
--sidebar-foreground: oklch(0.147 0.004 49.25);
81-
--sidebar-primary: oklch(0.61 0.11 222);
82-
--sidebar-primary-foreground: oklch(0.98 0.02 201);
83-
--sidebar-accent: oklch(0.61 0.11 222);
84-
--sidebar-accent-foreground: oklch(0.98 0.02 201);
81+
--sidebar-primary: oklch(0.55 0.2 260);
82+
--sidebar-primary-foreground: oklch(0.98 0.01 260);
83+
--sidebar-accent: oklch(0.55 0.2 260);
84+
--sidebar-accent-foreground: oklch(0.98 0.01 260);
8585
--sidebar-border: oklch(0.923 0.003 48.717);
8686
--sidebar-ring: oklch(0.709 0.01 56.259);
8787
}
@@ -93,29 +93,29 @@
9393
--card-foreground: oklch(0.985 0.001 106.423);
9494
--popover: oklch(0.216 0.006 56.043);
9595
--popover-foreground: oklch(0.985 0.001 106.423);
96-
--primary: oklch(0.71 0.13 215);
97-
--primary-foreground: oklch(0.3 0.05 230);
96+
--primary: oklch(0.65 0.2 260);
97+
--primary-foreground: oklch(0.2 0.05 260);
9898
--secondary: oklch(0.274 0.006 286.033);
9999
--secondary-foreground: oklch(0.985 0 0);
100100
--muted: oklch(0.268 0.007 34.298);
101101
--muted-foreground: oklch(0.709 0.01 56.259);
102-
--accent: oklch(0.71 0.13 215);
103-
--accent-foreground: oklch(0.3 0.05 230);
102+
--accent: oklch(0.65 0.2 260);
103+
--accent-foreground: oklch(0.2 0.05 260);
104104
--destructive: oklch(0.704 0.191 22.216);
105105
--border: oklch(1 0 0 / 10%);
106106
--input: oklch(1 0 0 / 15%);
107107
--ring: oklch(0.553 0.013 58.071);
108-
--chart-1: oklch(0.87 0.12 207);
109-
--chart-2: oklch(0.8 0.13 212);
110-
--chart-3: oklch(0.71 0.13 215);
111-
--chart-4: oklch(0.61 0.11 222);
112-
--chart-5: oklch(0.52 0.09 223);
108+
--chart-1: oklch(0.85 0.15 250);
109+
--chart-2: oklch(0.75 0.18 255);
110+
--chart-3: oklch(0.65 0.2 260);
111+
--chart-4: oklch(0.55 0.2 260);
112+
--chart-5: oklch(0.45 0.18 265);
113113
--sidebar: oklch(0.216 0.006 56.043);
114114
--sidebar-foreground: oklch(0.985 0.001 106.423);
115-
--sidebar-primary: oklch(0.8 0.13 212);
116-
--sidebar-primary-foreground: oklch(0.3 0.05 230);
117-
--sidebar-accent: oklch(0.71 0.13 215);
118-
--sidebar-accent-foreground: oklch(0.3 0.05 230);
115+
--sidebar-primary: oklch(0.65 0.2 260);
116+
--sidebar-primary-foreground: oklch(0.2 0.05 260);
117+
--sidebar-accent: oklch(0.65 0.2 260);
118+
--sidebar-accent-foreground: oklch(0.2 0.05 260);
119119
--sidebar-border: oklch(1 0 0 / 10%);
120120
--sidebar-ring: oklch(0.553 0.013 58.071);
121121
}

web/components/service-canvas.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,8 @@ function EnvironmentSelector({
4848
))}
4949
</SelectContent>
5050
</Select>
51-
<Link href={`/dashboard/projects/${projectSlug}/settings`}>
52-
<Button variant="ghost" size="icon">
53-
<Settings className="h-4 w-4" />
54-
</Button>
51+
<Link href={`/dashboard/projects/${projectSlug}/settings`} className="ml-1 text-muted-foreground hover:text-foreground hover:bg-muted rounded-full p-2">
52+
<Settings className="h-4 w-4 text-muted-foreground" />
5553
</Link>
5654
</div>
5755
);

0 commit comments

Comments
 (0)