2FAuth/public/build/assets/Groups-BMQ6YoNp.js
2024-11-17 23:37:23 +01:00

2 lines
2.2 KiB
JavaScript
Vendored

import{T as C,r as $,o as w,a0 as z,h as b,k as c,l,m as u,e as o,t as a,j as s,g as _,f as i,d as m,F,E as G,n as R,U as V,i as h,p as E}from"./app-D4Udf6Mm.js";import{u as N}from"./bus-RVphoWuw.js";/*! 2FAuth version 5.4.1 - Copyright (c) 2024 Bubka - https://github.com/Bubka/2FAuth */const I={class:"title has-text-grey-dark"},L={class:"is-size-7-mobile"},T={class:"mt-3 mb-6"},W={key:0},A=["onClick","title"],x={class:"is-family-primary is-size-6 is-size-7-mobile has-text-grey"},M={class:"mt-2 is-size-7 is-pulled-right"},S={key:1,class:"has-text-centered"},U={class:"is-size-4"},J={__name:"Groups",setup(j){E();const t=C(),f=N(),p=$(!1);return w(async()=>{p.value=t.isEmpty,await t.fetch().finally(()=>{p.value=!1})}),z((e,g)=>{var n;e.name=="editGroup"&&(f.editedGroupName=(n=t.items.find(d=>d.id==e.params.groupId))==null?void 0:n.name)}),(e,g)=>{const n=l("FontAwesomeIcon"),d=l("RouterLink"),k=l("ButtonBackCloseCancel"),y=l("VueFooter"),v=l("ResponsiveWidthWrapper");return u(),b(v,null,{default:c(()=>[o("h1",I,a(e.$t("groups.groups")),1),o("div",L,a(e.$t("groups.manage_groups_legend")),1),o("div",T,[s(d,{class:"is-link mt-5",to:{name:"createGroup"}},{default:c(()=>[s(n,{icon:["fas","plus-circle"]}),_(" "+a(e.$t("groups.create_group")),1)]),_:1})]),i(t).isEmpty?h("",!0):(u(),m("div",W,[(u(!0),m(F,null,G(i(t).withoutTheAllGroup,r=>(u(),m("div",{key:r.id,class:"group-item is-size-5 is-size-6-mobile"},[_(a(r.name)+" ",1),s(i(V),null,{default:c(({mode:B})=>[o("button",{class:R(["button tag is-pulled-right",B=="dark"?"is-dark":"is-white"]),onClick:q=>i(t).delete(r.id),title:e.$t("commons.delete")},a(e.$t("commons.delete")),11,A)]),_:2},1024),s(d,{to:{name:"editGroup",params:{groupId:r.id}},class:"has-text-grey px-1",title:e.$t("commons.rename")},{default:c(()=>[s(n,{icon:["fas","pen-square"]})]),_:2},1032,["to","title"]),o("span",x,a(e.$t("groups.x_accounts",{count:r.twofaccounts_count})),1)]))),128)),o("div",M,a(e.$t("groups.deleting_group_does_not_delete_accounts")),1)])),i(p)&&i(t).isEmpty?(u(),m("div",S,[o("span",U,[s(n,{icon:["fas","spinner"],spin:""})])])):h("",!0),s(y,{showButtons:!0},{default:c(()=>[s(k,{returnTo:{name:"accounts"},action:"close"})]),_:1})]),_:1})}}};export{J as default};