import{I as C}from"./IdnodeGrid-U6EqXqja.js";import{d as A,u as E,o as x,e as w,f as r,g as d,i as v,t as P,h as e,I as T,F as V,r as L,_ as S}from"./index-D92x6h1h.js";import{A as D}from"./ActionMenu-B3aKIJFu.js";import{B as R}from"./BooleanCell-BFiLlZVv.js";import{u as U}from"./useEditorMode-DvyB-mon.js";import{u as F}from"./useBulkAction-UV8yZtrd.js";import{b as N}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:"users-ipblock__empty"},a="enabled,prefix,comment",z=A({__name:"ConfigUsersIpBlockingView",setup(M){const{t}=E(),c=[{field:"enabled",sortable:!0,filterType:"boolean",width:120,minVisible:"phone",phoneOrder:1,cellComponent:R,editable:!0},{field:"prefix",sortable:!0,filterType:"string",width:350,minVisible:"phone",phoneRole:"primary",editable:!0},{field:"comment",sortable:!0,filterType:"string",width:250,minVisible:"phone",phoneOrder:2,editable:!0}],p=L(a),{editingUuid:n,editingUuids:u,creatingBase:m,gridRef:f,editorLevel:b,editorList:g,openEditor:l,openCreate:k,closeEditor:y,flipToEdit:_}=U({createBase:"ipblock/entry",editList:p,createList:a,urlSync:!0}),I=F({endpoint:"idnode/delete",confirmText:t("Do you really want to delete the selected entries?"),confirmSeverity:"danger",failPrefix:t("Failed to delete")});function h(s,o){return N({selection:s,clearSelection:o,remove:I,onAdd:k,onEdit:l,addTooltip:t("Add a new IP blocking entry")})}return(s,o)=>(x(),w(V,null,[r(C,{ref_key:"gridRef",ref:f,endpoint:"ipblock/entry/grid","help-page":"class/ipblocking","entity-class":"ipblocking",columns:c,"store-key":"config-users-ip-blocking","default-sort":{key:"prefix",dir:"ASC"},"lock-level":"expert","virtual-scroller-options":{itemSize:36,lazy:!1},"count-label":e(t)("IP blocks"),"edit-mode":"cell",class:"users-ipblock__grid",onRowDblclick:o[0]||(o[0]=i=>e(l)([i]))},{empty:d(()=>[v("p",O,P(e(t)("No IP blocking entries.")),1)]),toolbarActions:d(({selection:i,clearSelection:B})=>[r(D,{actions:h(i,B)},null,8,["actions"])]),_:1},8,["count-label"]),r(T,{uuid:e(n),uuids:e(u),"create-base":e(m),level:e(b),list:e(g),title:e(n)?e(t)("Edit IP Blocking Entry"):e(t)("Add IP Blocking Entry"),onClose:e(y),onCreated:e(_)},null,8,["uuid","uuids","create-base","level","list","title","onClose","onCreated"])],64))}}),re=S(z,[["__scopeId","data-v-3981cb10"]]);export{re as default};
