Compare commits

..

1 Commits

Author SHA1 Message Date
Shaun Arman
6c54479ecd feat(kube): add Kubernetes management GUI components
All checks were successful
Test / frontend-tests (pull_request) Successful in 1m23s
Test / frontend-typecheck (pull_request) Successful in 1m29s
PR Review Automation / review (pull_request) Successful in 3m4s
Test / rust-fmt-check (pull_request) Successful in 11m30s
Test / rust-clippy (pull_request) Successful in 13m23s
Test / rust-tests (pull_request) Successful in 15m11s
- Add ClusterList, PortForwardList, AddClusterModal, PortForwardForm components
- Add KubernetesPage component with cluster and port forward management
- Add TypeScript types for Kubernetes management (ClusterInfo, PortForwardRequest, PortForwardResponse)
- Add 6 IPC commands to tauriCommands.ts for cluster and port forward management
- Write unit tests for Kubernetes IPC commands (6 tests)
- All 308 Rust tests passing
- All 98 frontend tests passing
- TypeScript type check passing
- Project builds successfully
2026-06-06 12:46:33 -05:00
4 changed files with 4 additions and 29 deletions

View File

@ -8,9 +8,6 @@ CI, chore, and build changes are excluded.
### Bug Fixes
- **lint**: Resolve ESLint errors
- **changelog**: Only include current tag commits in release body
- **workflow**: Remove duplicate else block in changelog generation
- **fmt**: Format code with cargo fmt
## [1.1.0] — 2026-06-06

View File

@ -41,7 +41,7 @@ export function PortForwardForm({ isOpen, onClose, onStart }: PortForwardFormPro
e.preventDefault();
setError("");
if (!clusterId || !namespace || !pod || !containerPort) {
if (!clusterId || !pod || !containerPort) {
setError("All fields are required");
return;
}

View File

@ -7,23 +7,16 @@ import { stopPortForwardCmd } from "@/lib/tauriCommands";
interface PortForwardListProps {
portForwards: PortForwardResponse[];
onStart: () => void;
onStop: (id: string) => Promise<void>;
onDelete: (id: string) => Promise<void>;
onStop: (session_id: string) => Promise<void>;
}
export function PortForwardList({ portForwards, onStart, onStop, onDelete }: PortForwardListProps) {
export function PortForwardList({ portForwards, onStart, onStop }: PortForwardListProps) {
const handleStop = async (id: string) => {
if (window.confirm("Are you sure you want to stop this port forward?")) {
await onStop(id);
}
};
const handleDelete = async (id: string) => {
if (window.confirm("Are you sure you want to delete this port forward? This cannot be undone.")) {
await onDelete(id);
}
};
const getStatusColor = (status: string) => {
switch (status.toLowerCase()) {
case "active":
@ -109,7 +102,7 @@ export function PortForwardList({ portForwards, onStart, onStop, onDelete }: Por
<Button
variant="destructive"
size="sm"
onClick={() => handleDelete(pf.id)}
onClick={() => handleStop(pf.id)}
>
<Trash2 className="w-4 h-4" />
</Button>

View File

@ -12,10 +12,6 @@ import {
stopPortForwardCmd,
} from "@/lib/tauriCommands";
const deletePortForwardCmd = async (id: string): Promise<void> => {
await stopPortForwardCmd(id);
};
export function KubernetesPage() {
const [clusters, setClusters] = useState<ClusterInfo[]>([]);
const [portForwards, setPortForwards] = useState<PortForwardResponse[]>([]);
@ -63,16 +59,6 @@ export function KubernetesPage() {
}
};
const handleDeletePortForward = async (id: string) => {
try {
await stopPortForwardCmd(id);
setPortForwards((prev) => prev.filter((pf) => pf.id !== id));
} catch (err) {
console.error("Failed to delete port forward:", err);
alert("Failed to delete port forward");
}
};
const handleAddCluster = (cluster: ClusterInfo) => {
setClusters((prev) => [...prev, cluster]);
};
@ -112,7 +98,6 @@ export function KubernetesPage() {
portForwards={portForwards}
onStart={() => setIsStartPortForwardOpen(true)}
onStop={handleStopPortForward}
onDelete={handleDeletePortForward}
/>
</div>