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

2 lines
1022 B
JavaScript

import{r as e,j as s}from"./vendor-react-64fcanlc.js";import{u as o,b5 as i,cx as c,ch as a,B as n}from"./index-BpMcZry4.js";import{F as r,G as t,L as l}from"./logs-CSLBu0fr.js";function d({model:d}){const h=o(),m=e.useId(),p=r(),[u,b]=e.useState(t(d.choices,p.choice)?.id??""),[j,x]=e.useState(p.cold),[f,g]=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:h("probe.title"),description:d.name,footer:()=>s.jsxs(s.Fragment,{children:[s.jsx(n,{onPress:d.close,children:h("ui.cancel")}),s.jsx(n,{accent:!0,type:"submit",form:m,isDisabled:v,children:h("probe.submit")})]}),children:s.jsxs(c,{id:m,onSubmit:e=>{e.preventDefault(),v||d.submit({...p,choice:u,cold:j,leaves:f})},children:[s.jsx(l,{label:h("probe.kind"),value:u,onChange:b,items:d.choices.map(e=>({id:e.id,label:h(e.label)}))}),s.jsx(a,{isSelected:j,onChange:x,children:h("probe.cold")}),d.group&&s.jsx(a,{isSelected:f,onChange:g,children:h("probe.leaves")})]})})}export{d as P};