/
proc
/
3430793
/
root
/
snap
/
lxd
/
current
/
share
/
lxd-ui
/
assets
/
File Upload :
llllll
Current File: //proc/3430793/root/snap/lxd/current/share/lxd-ui/assets/CancelOperationBtn-BDLD8hRV.js
import{d as e,r as f,l as p,j as t,bf as C,q as s}from"./index-dL2n30-Z.js";const m=({operation:n,project:a})=>{const l=e.useNotify(),c=e.useToastNotification(),[i,o]=f.useState(!1),r=p(),u=()=>{o(!0),C(n.id).then(()=>{c.success("Operation cancelled")}).catch(d=>{l.failure("Operation cancellation failed",d)}).finally(()=>{o(!1),r.invalidateQueries({queryKey:a?[s.operations,a]:[s.operations]})})};return n.status!=="Running"?null:t.jsx(e.ConfirmationButton,{onHoverText:n.may_cancel?"Cancel operation":"Cannot cancel operation at this stage",className:"u-no-margin--bottom",loading:i,disabled:!n.may_cancel||i,confirmationModalProps:{title:"Confirm cancel",children:t.jsx("p",{children:"This will cancel the operation."}),confirmButtonLabel:"Cancel operation",onConfirm:u,cancelButtonLabel:"Go back"},shiftClickEnabled:!0,showShiftClickHint:!0,children:t.jsx("span",{children:"Cancel"})})};export{m as C};
Copyright ©2k19 -
Hexid
|
Tex7ure