mirror of
https://github.com/CyberL1/dlinux-dashboard.git
synced 2025-01-22 01:19:18 -05:00
fix: managing container's state
This commit is contained in:
parent
238c5a2cec
commit
03ddc35df0
@ -22,5 +22,10 @@ export default function ContainerInfo() {
|
|||||||
return "Fetching container info...";
|
return "Fetching container info...";
|
||||||
}
|
}
|
||||||
|
|
||||||
return (<Typography>Hostname: {info.name}</Typography>);
|
return (
|
||||||
|
<>
|
||||||
|
<Typography>Hostname: {info.name}</Typography>
|
||||||
|
<Typography>Memory: {info.memory}</Typography>
|
||||||
|
</>
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
@ -19,7 +19,7 @@ export default function ContainerPage() {
|
|||||||
<Paper square sx={{ padding: 1 }}>
|
<Paper square sx={{ padding: 1 }}>
|
||||||
<Paper sx={{ display: "flex" }} variant="outlined">
|
<Paper sx={{ display: "flex" }} variant="outlined">
|
||||||
<Typography variant="h6" sx={{ flexGrow: 1 }}>
|
<Typography variant="h6" sx={{ flexGrow: 1 }}>
|
||||||
Managing: {container.name}
|
State: {container.state.Status}
|
||||||
</Typography>
|
</Typography>
|
||||||
<ButtonGroup>
|
<ButtonGroup>
|
||||||
<Button
|
<Button
|
||||||
@ -48,8 +48,9 @@ export default function ContainerPage() {
|
|||||||
async function switchPowerState(state: string) {
|
async function switchPowerState(state: string) {
|
||||||
setPowerStateLocked(true);
|
setPowerStateLocked(true);
|
||||||
|
|
||||||
const res = await fetch(`/api/containers/${container.name}/${state}`, {
|
const res = await fetch(`https://api.ssh.surf/${state}`, {
|
||||||
method: "PUT",
|
// @ts-ignore
|
||||||
|
headers: { "x-ssh-auth": localStorage.getItem("key") },
|
||||||
});
|
});
|
||||||
|
|
||||||
if (res.ok) {
|
if (res.ok) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user