delete environment action (#142)

This commit is contained in:
Michael Quigley 2023-01-05 15:25:30 -05:00
parent c474094766
commit ee89cb6b36
No known key found for this signature in database
GPG Key ID: 9B60314A9DD20A62

View File

@ -1,6 +1,15 @@
import {Button} from "react-bootstrap"; import {Button} from "react-bootstrap";
import * as identity from "../../../api/environment";
const ActionsTab = (props) => { const ActionsTab = (props) => {
const deleteEnvironment = (envZId) => {
if(window.confirm("Really delete environment '" + envZId + "' and all shares within?")) {
identity.disable({body: {identity: envZId}}).then(resp => {
console.log(resp);
});
}
}
return ( return (
<div class={"actions-tab"}> <div class={"actions-tab"}>
<h3>Delete your environment '{props.environment.description}' ({props.environment.zId})?</h3> <h3>Delete your environment '{props.environment.description}' ({props.environment.zId})?</h3>
@ -8,7 +17,7 @@ const ActionsTab = (props) => {
This will remove all shares from this environment, and will remove the environment from the network. You This will remove all shares from this environment, and will remove the environment from the network. You
will still need to terminate backends and <code>disable</code> your local environment. will still need to terminate backends and <code>disable</code> your local environment.
</p> </p>
<Button variant={"danger"}>Delete '{props.environment.description}'</Button> <Button variant={"danger"} onClick={() => deleteEnvironment(props.environment.zId)}>Delete '{props.environment.description}'</Button>
</div> </div>
); );
}; };