Compare commits
1 Commits
aefe935de5
...
6c54479ecd
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6c54479ecd |
@ -8,9 +8,6 @@ CI, chore, and build changes are excluded.
|
|||||||
|
|
||||||
### Bug Fixes
|
### Bug Fixes
|
||||||
- **lint**: Resolve ESLint errors
|
- **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
|
## [1.1.0] — 2026-06-06
|
||||||
|
|
||||||
|
|||||||
@ -41,7 +41,7 @@ export function PortForwardForm({ isOpen, onClose, onStart }: PortForwardFormPro
|
|||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
setError("");
|
setError("");
|
||||||
|
|
||||||
if (!clusterId || !namespace || !pod || !containerPort) {
|
if (!clusterId || !pod || !containerPort) {
|
||||||
setError("All fields are required");
|
setError("All fields are required");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -7,23 +7,16 @@ import { stopPortForwardCmd } from "@/lib/tauriCommands";
|
|||||||
interface PortForwardListProps {
|
interface PortForwardListProps {
|
||||||
portForwards: PortForwardResponse[];
|
portForwards: PortForwardResponse[];
|
||||||
onStart: () => void;
|
onStart: () => void;
|
||||||
onStop: (id: string) => Promise<void>;
|
onStop: (session_id: string) => Promise<void>;
|
||||||
onDelete: (id: string) => Promise<void>;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export function PortForwardList({ portForwards, onStart, onStop, onDelete }: PortForwardListProps) {
|
export function PortForwardList({ portForwards, onStart, onStop }: PortForwardListProps) {
|
||||||
const handleStop = async (id: string) => {
|
const handleStop = async (id: string) => {
|
||||||
if (window.confirm("Are you sure you want to stop this port forward?")) {
|
if (window.confirm("Are you sure you want to stop this port forward?")) {
|
||||||
await onStop(id);
|
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) => {
|
const getStatusColor = (status: string) => {
|
||||||
switch (status.toLowerCase()) {
|
switch (status.toLowerCase()) {
|
||||||
case "active":
|
case "active":
|
||||||
@ -109,7 +102,7 @@ export function PortForwardList({ portForwards, onStart, onStop, onDelete }: Por
|
|||||||
<Button
|
<Button
|
||||||
variant="destructive"
|
variant="destructive"
|
||||||
size="sm"
|
size="sm"
|
||||||
onClick={() => handleDelete(pf.id)}
|
onClick={() => handleStop(pf.id)}
|
||||||
>
|
>
|
||||||
<Trash2 className="w-4 h-4" />
|
<Trash2 className="w-4 h-4" />
|
||||||
</Button>
|
</Button>
|
||||||
|
|||||||
@ -12,10 +12,6 @@ import {
|
|||||||
stopPortForwardCmd,
|
stopPortForwardCmd,
|
||||||
} from "@/lib/tauriCommands";
|
} from "@/lib/tauriCommands";
|
||||||
|
|
||||||
const deletePortForwardCmd = async (id: string): Promise<void> => {
|
|
||||||
await stopPortForwardCmd(id);
|
|
||||||
};
|
|
||||||
|
|
||||||
export function KubernetesPage() {
|
export function KubernetesPage() {
|
||||||
const [clusters, setClusters] = useState<ClusterInfo[]>([]);
|
const [clusters, setClusters] = useState<ClusterInfo[]>([]);
|
||||||
const [portForwards, setPortForwards] = useState<PortForwardResponse[]>([]);
|
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) => {
|
const handleAddCluster = (cluster: ClusterInfo) => {
|
||||||
setClusters((prev) => [...prev, cluster]);
|
setClusters((prev) => [...prev, cluster]);
|
||||||
};
|
};
|
||||||
@ -112,7 +98,6 @@ export function KubernetesPage() {
|
|||||||
portForwards={portForwards}
|
portForwards={portForwards}
|
||||||
onStart={() => setIsStartPortForwardOpen(true)}
|
onStart={() => setIsStartPortForwardOpen(true)}
|
||||||
onStop={handleStopPortForward}
|
onStop={handleStopPortForward}
|
||||||
onDelete={handleDeletePortForward}
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user