mirror of
https://github.com/CyberL1/dlinux-dashboard.git
synced 2025-01-21 17:09:19 -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 (<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 sx={{ display: "flex" }} variant="outlined">
|
||||
<Typography variant="h6" sx={{ flexGrow: 1 }}>
|
||||
Managing: {container.name}
|
||||
State: {container.state.Status}
|
||||
</Typography>
|
||||
<ButtonGroup>
|
||||
<Button
|
||||
@ -48,8 +48,9 @@ export default function ContainerPage() {
|
||||
async function switchPowerState(state: string) {
|
||||
setPowerStateLocked(true);
|
||||
|
||||
const res = await fetch(`/api/containers/${container.name}/${state}`, {
|
||||
method: "PUT",
|
||||
const res = await fetch(`https://api.ssh.surf/${state}`, {
|
||||
// @ts-ignore
|
||||
headers: { "x-ssh-auth": localStorage.getItem("key") },
|
||||
});
|
||||
|
||||
if (res.ok) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user