Merge pull request #362 from ErickLuis00/canary

fix: wrong Docker version in Add Node commands
This commit is contained in:
Mauricio Siu
2024-08-18 18:17:49 -06:00
committed by GitHub
3 changed files with 27 additions and 14 deletions

View File

@@ -23,12 +23,14 @@ export const AddManager = () => {
<div className="flex flex-col gap-2.5 text-sm"> <div className="flex flex-col gap-2.5 text-sm">
<span>1. Go to your new server and run the following command</span> <span>1. Go to your new server and run the following command</span>
<span className="bg-muted rounded-lg p-2 flex justify-between"> <span className="bg-muted rounded-lg p-2 flex justify-between">
curl https://get.docker.com | sh -s -- --version 24.0 curl https://get.docker.com | sh -s -- --version {data?.version}
<button <button
type="button" type="button"
className="self-center" className="self-center"
onClick={() => { onClick={() => {
copy("curl https://get.docker.com | sh -s -- --version 24.0"); copy(
`curl https://get.docker.com | sh -s -- --version ${data?.version}`,
);
toast.success("Copied to clipboard"); toast.success("Copied to clipboard");
}} }}
> >
@@ -43,12 +45,12 @@ export const AddManager = () => {
cluster cluster
</span> </span>
<span className="bg-muted rounded-lg p-2 flex"> <span className="bg-muted rounded-lg p-2 flex">
{data} {data?.command}
<button <button
type="button" type="button"
className="self-start" className="self-start"
onClick={() => { onClick={() => {
copy(data || ""); copy(data?.command || "");
toast.success("Copied to clipboard"); toast.success("Copied to clipboard");
}} }}
> >

View File

@@ -22,12 +22,14 @@ export const AddWorker = () => {
<div className="flex flex-col gap-2.5 text-sm"> <div className="flex flex-col gap-2.5 text-sm">
<span>1. Go to your new server and run the following command</span> <span>1. Go to your new server and run the following command</span>
<span className="bg-muted rounded-lg p-2 flex justify-between"> <span className="bg-muted rounded-lg p-2 flex justify-between">
curl https://get.docker.com | sh -s -- --version 24.0 curl https://get.docker.com | sh -s -- --version {data?.version}
<button <button
type="button" type="button"
className="self-center" className="self-center"
onClick={() => { onClick={() => {
copy("curl https://get.docker.com | sh -s -- --version 24.0"); copy(
`curl https://get.docker.com | sh -s -- --version ${data?.version}`,
);
toast.success("Copied to clipboard"); toast.success("Copied to clipboard");
}} }}
> >
@@ -42,12 +44,12 @@ export const AddWorker = () => {
</span> </span>
<span className="bg-muted rounded-lg p-2 flex"> <span className="bg-muted rounded-lg p-2 flex">
{data} {data?.command}
<button <button
type="button" type="button"
className="self-start" className="self-start"
onClick={() => { onClick={() => {
copy(data || ""); copy(data?.command || "");
toast.success("Copied to clipboard"); toast.success("Copied to clipboard");
}} }}
> >

View File

@@ -35,14 +35,23 @@ export const clusterRouter = createTRPCRouter({
}), }),
addWorker: protectedProcedure.query(async ({ input }) => { addWorker: protectedProcedure.query(async ({ input }) => {
const result = await docker.swarmInspect(); const result = await docker.swarmInspect();
return `docker swarm join --token ${ const docker_version = await docker.version();
result.JoinTokens.Worker
} ${await getPublicIpWithFallback()}:2377`; return {
command: `docker swarm join --token ${
result.JoinTokens.Worker
} ${await getPublicIpWithFallback()}:2377`,
version: docker_version.Version,
};
}), }),
addManager: protectedProcedure.query(async ({ input }) => { addManager: protectedProcedure.query(async ({ input }) => {
const result = await docker.swarmInspect(); const result = await docker.swarmInspect();
return `docker swarm join --token ${ const docker_version = await docker.version();
result.JoinTokens.Manager return {
} ${await getPublicIpWithFallback()}:2377`; command: `docker swarm join --token ${
result.JoinTokens.Manager
} ${await getPublicIpWithFallback()}:2377`,
version: docker_version.Version,
};
}), }),
}); });