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