summaryrefslogtreecommitdiff
path: root/makima/frontend/src/routes/daemons.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'makima/frontend/src/routes/daemons.tsx')
-rw-r--r--makima/frontend/src/routes/daemons.tsx98
1 files changed, 34 insertions, 64 deletions
diff --git a/makima/frontend/src/routes/daemons.tsx b/makima/frontend/src/routes/daemons.tsx
index 90a476d..0f55190 100644
--- a/makima/frontend/src/routes/daemons.tsx
+++ b/makima/frontend/src/routes/daemons.tsx
@@ -1,16 +1,12 @@
-import { useState, useEffect, useCallback } from "react";
+import { useState, useEffect } from "react";
import { useAuth } from "../contexts/AuthContext";
import { useNavigate } from "react-router";
import { Masthead } from "../components/Masthead";
import {
listDaemons,
restartDaemon,
- listDaemonPlatforms,
- API_BASE,
type Daemon,
type DaemonListResponse,
- type DaemonPlatform,
-
} from "../lib/api";
// =============================================================================
@@ -52,10 +48,6 @@ export default function DaemonsPage() {
const [restartingDaemonId, setRestartingDaemonId] = useState<string | null>(null);
const [restartConfirmDaemonId, setRestartConfirmDaemonId] = useState<string | null>(null);
- // Platform availability state
- const [platforms, setPlatforms] = useState<DaemonPlatform[]>([]);
- const [platformsLoading, setPlatformsLoading] = useState(true);
-
// Redirect if not authenticated
useEffect(() => {
if (isAuthConfigured && !isAuthenticated) {
@@ -92,36 +84,17 @@ export default function DaemonsPage() {
}
};
- // Friendly labels for platform identifiers
- const platformLabels: Record<string, string> = {
- "linux-x86_64": "Linux (Intel/AMD)",
- "linux-arm64": "Linux (ARM64)",
- "macos-x86_64": "macOS (Intel)",
- "macos-arm64": "macOS (Apple Silicon)",
- };
-
- const loadPlatforms = useCallback(async () => {
- try {
- setPlatformsLoading(true);
- const response = await listDaemonPlatforms();
- setPlatforms(response.platforms);
- } catch {
- // Fallback: show all platforms as unavailable if API endpoint is missing
- setPlatforms([
- { platform: "linux-x86_64", available: false, downloadUrl: "/api/v1/daemon/download/linux-x86_64" },
- { platform: "linux-arm64", available: false, downloadUrl: "/api/v1/daemon/download/linux-arm64" },
- { platform: "macos-x86_64", available: false, downloadUrl: "/api/v1/daemon/download/macos-x86_64" },
- { platform: "macos-arm64", available: false, downloadUrl: "/api/v1/daemon/download/macos-arm64" },
- ]);
- } finally {
- setPlatformsLoading(false);
- }
- }, []);
+ // Static platform data for download links
+ const downloadPlatforms = [
+ { key: "linux-x86_64", label: "Linux (Intel/AMD)", filename: "makima-vX.X.X-linux-x86_64.tar.gz" },
+ { key: "linux-arm64", label: "Linux (ARM64)", filename: "makima-vX.X.X-linux-arm64.tar.gz" },
+ { key: "macos-x86_64", label: "macOS (Intel)", filename: "makima-vX.X.X-macos-x86_64.tar.gz" },
+ { key: "macos-arm64", label: "macOS (Apple Silicon)", filename: "makima-vX.X.X-macos-arm64.tar.gz" },
+ ];
// Initial load
useEffect(() => {
loadDaemons();
- loadPlatforms();
}, []);
// Auto-refresh daemons every 30 seconds
@@ -157,33 +130,22 @@ export default function DaemonsPage() {
</p>
<div className="grid grid-cols-2 gap-2 mb-4">
- {platformsLoading ? (
- <p className="col-span-2 text-[#7788aa] font-mono text-[10px]">Loading platforms...</p>
- ) : (
- platforms.map((p) => (
- <a
- key={p.platform}
- href={p.available ? `${API_BASE}${p.downloadUrl}` : undefined}
- download={p.available ? true : undefined}
- className={`flex flex-col items-center justify-center gap-1 p-3 border border-[rgba(117,170,252,0.25)] bg-[#0a1525] font-mono text-xs text-[#9bc3ff] transition-colors ${
- p.available
- ? "hover:bg-[#0d1f3a] cursor-pointer"
- : "opacity-50 pointer-events-none"
- }`}
- >
- <span className="text-[10px] uppercase tracking-wide">
- {platformLabels[p.platform] || p.platform}
- </span>
- <span
- className={`text-[10px] ${
- p.available ? "text-green-400" : "text-[#556677]"
- }`}
- >
- {p.available ? "Available" : "Not bundled"}
- </span>
- </a>
- ))
- )}
+ {downloadPlatforms.map((p) => (
+ <a
+ key={p.key}
+ href="https://github.com/soryu-co/makima/releases/latest"
+ target="_blank"
+ rel="noopener noreferrer"
+ className="flex flex-col items-center justify-center gap-1 p-3 border border-[rgba(117,170,252,0.25)] bg-[#0a1525] font-mono text-xs text-[#9bc3ff] transition-colors hover:bg-[#0d1f3a] cursor-pointer"
+ >
+ <span className="text-[10px] uppercase tracking-wide">
+ {p.label}
+ </span>
+ <span className="text-[10px] text-[#556677]">
+ {p.filename}
+ </span>
+ </a>
+ ))}
</div>
<div className="border-t border-[rgba(117,170,252,0.15)] pt-3">
@@ -191,7 +153,7 @@ export default function DaemonsPage() {
Quick Install
</p>
<code className="block bg-black/50 px-3 py-2 text-[11px] font-mono text-green-400 break-all">
- curl -fsSL https://raw.githubusercontent.com/soryu-co/soryu/master/install.sh | bash
+ curl -fsSL https://raw.githubusercontent.com/soryu-co/makima/master/install.sh | bash
</code>
</div>
</section>
@@ -234,7 +196,15 @@ export default function DaemonsPage() {
</div>
<p className="text-[#556677] font-mono text-[10px]">
- Kubernetes manifests available in the repository under <code className="text-[#75aafc]">k8s/daemon/</code>
+ Kubernetes manifests available at{" "}
+ <a
+ href="https://github.com/soryu-co/makima"
+ target="_blank"
+ rel="noopener noreferrer"
+ className="text-[#75aafc] hover:underline"
+ >
+ github.com/soryu-co/makima
+ </a>
</p>
</section>
</div>