import{I as w}from"./IdnodeGrid-U6EqXqja.js";import{d as E,u as M,o as B,e as T,f as d,g as a,i as k,t as D,h as e,I as V,F as I,r as F,_ as N}from"./index-D92x6h1h.js";import{A as R}from"./ActionMenu-B3aKIJFu.js";import{B as u}from"./BooleanCell-BFiLlZVv.js";import{E as L}from"./EnumNameCell-BjJ4chu_.js";import{u as U}from"./useEditorMode-DvyB-mon.js";import{u as $}from"./useBulkAction-UV8yZtrd.js";import{b as z}from"./dvrToolbarHelpers-C5M0Cokf.js";import"./DataGrid-CbtTsx8d.js";import"./index-BG9mM10J.js";import"./index-7HNOjfAo.js";import"./localDay-CoEbUe3O.js";import"./SearchInput-DBHWpJgW.js";import"./useGridLayout-DCIiMD42.js";import"./CollapsibleSection.vue_vue_type_style_index_0_lang-Cq2AVc9p.js";import"./sliders-horizontal-Am8f4Xsv.js";import"./useStaleDataRecovery-BuNK-94T.js";const O={class:"dvb-mux-sched__empty"},G=E({__name:"DvbMuxSchedView",setup(K){const{t}=M();function c(i){if(typeof i!="number"||i<=0)return"";const o=Math.round(i/60),r=Math.floor(o/60),s=o%60;return r>0?`${r}h ${s.toString().padStart(2,"0")}m`:`${s}m`}const m=[{field:"enabled",sortable:!0,filterType:"boolean",width:100,minVisible:"phone",phoneOrder:1,cellComponent:u,editable:!0},{field:"mux",sortable:!0,filterType:"string",width:280,minVisible:"phone",phoneRole:"primary",cellComponent:L,enumSource:{type:"api",uri:"idnode/load",params:{class:"mpegts_mux",enum:1}},editable:!0,targetUuidField:"mux",targetAccessKey:"admin"},{field:"cron",sortable:!0,filterType:"string",width:180,minVisible:"phone",phoneOrder:2,editable:!0},{field:"timeout",sortable:!0,filterType:"numeric",width:130,format:c,editable:!0},{field:"restart",sortable:!0,filterType:"boolean",width:110,cellComponent:u,editable:!0}],p=F(""),{editingUuid:n,editingUuids:f,creatingBase:b,creatingSubclass:h,gridRef:_,editorLevel:g,editorList:x,openEditor:l,openCreate:y,closeEditor:A,flipToEdit:C}=U({createBase:"mpegts/mux_sched",editList:p,urlSync:!0}),S=$({endpoint:"idnode/delete",confirmText:t("Do you really want to delete the selected mux schedulers?"),confirmSeverity:"danger",failPrefix:t("Failed to delete")});function v(i,o){return z({selection:i,clearSelection:o,remove:S,onAdd:()=>y(),onEdit:l,addTooltip:t("Add a new mux scheduler")})}return(i,o)=>(B(),T(I,null,[d(w,{ref_key:"gridRef",ref:_,endpoint:"mpegts/mux_sched/grid","help-page":"class/mpegts_mux_sched","entity-class":"mpegts_mux_sched","notification-class":"mpegts_mux_sched",columns:m,"store-key":"config-dvb-mux-sched","default-sort":{key:"cron",dir:"ASC"},"virtual-scroller-options":{itemSize:36,lazy:!1},"count-label":e(t)("schedulers"),"edit-mode":"cell",class:"dvb-mux-sched__grid",onRowDblclick:o[0]||(o[0]=r=>e(l)([r]))},{empty:a(()=>[k("p",O,D(e(t)("No mux schedulers defined. Add one to drive periodic mux tuning via a cron expression.")),1)]),toolbarActions:a(({selection:r,clearSelection:s})=>[d(R,{actions:v(r,s)},null,8,["actions"])]),_:1},8,["count-label"]),d(V,{uuid:e(n),uuids:e(f),"create-base":e(b),subclass:e(h),level:e(g),list:e(x),title:e(n)?e(t)("Edit Mux Scheduler"):e(t)("Add Mux Scheduler"),onClose:e(A),onCreated:e(C)},null,8,["uuid","uuids","create-base","subclass","level","list","title","onClose","onCreated"])],64))}}),ne=N(G,[["__scopeId","data-v-b3badaa1"]]);export{ne as default};
