Files
op-packages/luci-app-honk/root/etc/honk/doona/assets/ProbeOptionsDialog-CbXH9b0U.js
T

2 lines
1022 B
JavaScript

import{r as e,j as s}from"./vendor-react-64fcanlc.js";import{u as o,b2 as i,cw as c,cg as a,B as n}from"./index-DkZLaQoO.js";import{I as r,J as t,q as l}from"./logs-DniNK6NG.js";function d({model:d}){const m=o(),h=e.useId(),p=r(),[u,b]=e.useState(t(d.choices,p.choice)?.id??""),[j,x]=e.useState(p.cold),[g,f]=e.useState(p.leaves),v=d.busy||!d.choices.some(e=>e.id===u);return s.jsx(i,{narrow:!0,isOpen:!0,onOpenChange:e=>!e&&d.close(),title:m("probe.title"),description:d.name,footer:()=>s.jsxs(s.Fragment,{children:[s.jsx(n,{onPress:d.close,children:m("ui.cancel")}),s.jsx(n,{accent:!0,type:"submit",form:h,isDisabled:v,children:m("probe.submit")})]}),children:s.jsxs(c,{id:h,onSubmit:e=>{e.preventDefault(),v||d.submit({...p,choice:u,cold:j,leaves:g})},children:[s.jsx(l,{label:m("probe.kind"),value:u,onChange:b,items:d.choices.map(e=>({id:e.id,label:m(e.label)}))}),s.jsx(a,{isSelected:j,onChange:x,children:m("probe.cold")}),d.group&&s.jsx(a,{isSelected:g,onChange:f,children:m("probe.leaves")})]})})}export{d as P};