fix: Fixed agent windows version
This commit is contained in:
@@ -416,10 +416,10 @@ export default function ServerDetailPage() {
|
||||
{updateSuccess ? "Update Sent!" : "Update Agent"}
|
||||
</Button>
|
||||
<div className="relative flex-1 min-w-64 rounded-lg border border-border bg-[#0a0c14] px-4 py-2.5 font-mono text-sm">
|
||||
<span className="text-accent">$</span> <span className="text-text-primary">{api.getUpdateCommand()}</span>
|
||||
<span className="text-accent">{server.os_info?.toLowerCase().includes("windows") ? "PS>" : "$"}</span> <span className="text-text-primary">{api.getUpdateCommand(server.os_info)}</span>
|
||||
<button
|
||||
onClick={async () => {
|
||||
await navigator.clipboard.writeText(api.getUpdateCommand());
|
||||
await navigator.clipboard.writeText(api.getUpdateCommand(server.os_info));
|
||||
setCopiedUpdate(true);
|
||||
setTimeout(() => setCopiedUpdate(false), 2000);
|
||||
}}
|
||||
|
||||
+4
-1
@@ -189,7 +189,10 @@ export const api = {
|
||||
});
|
||||
},
|
||||
|
||||
getUpdateCommand(): string {
|
||||
getUpdateCommand(osInfo?: string): string {
|
||||
if (osInfo && osInfo.toLowerCase().includes("windows")) {
|
||||
return `irm "${window.location.origin}/update.ps1" | iex`;
|
||||
}
|
||||
return `curl -fsSL "${window.location.origin}/update" | bash`;
|
||||
},
|
||||
|
||||
|
||||
@@ -26,6 +26,10 @@ const nextConfig: NextConfig = {
|
||||
source: "/update",
|
||||
destination: `${apiUrl}/update`,
|
||||
},
|
||||
{
|
||||
source: "/update.ps1",
|
||||
destination: `${apiUrl}/update.ps1`,
|
||||
},
|
||||
];
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user