Files
twofauth-rs/public/build/assets/Groups-Ccrpwp-O.js
T
wt cf25e28c28
Rust verification / test (push) Successful in 4m10s
initial commit
2026-10-28 15:59:54 +07:00

2 lines
3.2 KiB
JavaScript

import{U as V}from"./index-BJsmINgd.js";import{O as N,a as S,v as E,o as L,af as T,d as R,w as i,e as x,f as c,g as A,Q as g,h as u,i as a,j as s,m as o,t as n,p as f,l as m,F,E as M,k as v,n as k}from"./app-dvJP63FL.js";import{u as U}from"./bus-ChE1sp8V.js";import{u as W,m as O,T as j,M as q}from"./useSortable-6hRbxhTj.js";import{C as D}from"./circle-plus-BM92Iipr.js";import{c as P}from"./createLucideIcon-DsaEAGzP.js";const Q=[["path",{d:"M17 3a2 2 0 0 1 2 2v15a1 1 0 0 1-1.496.868l-4.512-2.578a2 2 0 0 0-1.984 0l-4.512 2.578A1 1 0 0 1 5 20V5a2 2 0 0 1 2-2z",key:"oz39mx"}],["path",{d:"m9 10 2 2 4-4",key:"1gnqz4"}]],H=P("bookmark-check",Q),J={class:"title"},K={class:"is-size-7-mobile"},X={class:"mt-3 mb-6"},Y={key:0},Z={id:"dv"},ee={class:"is-flex is-align-items-center"},te={class:"tfa-content is-size-5 is-size-6-mobile pr-2"},se={class:"has-ellipsis"},oe={class:"is-family-primary is-size-6 is-size-7-mobile has-text-grey"},ae={key:0,class:"tfa-cell"},ie={class:"tfa-cell"},ne=["onClick","title"],le={class:"tfa-cell ml-4"},re={class:"mt-2 is-size-7 is-pulled-right"},ge={__name:"Groups",setup(ce){const y=A(),t=N(),b=U(),C=S(),p=x(!1),{start:w,stop:z}=W("#dv",t.withoutTheAllGroup,{animation:200,handle:".drag-handle",onUpdate:e=>{const d=t.withoutTheAllGroup[e.oldIndex].id,l=t.items.findIndex(_=>_.id==d);O(t.items,l,e.newIndex+1,e),g(()=>{t.saveOrder()})}});return E(()=>t.isEmpty,e=>{e==!1?g(()=>{w()}):z()}),L(()=>{p.value=t.isEmpty,t.fetch().finally(()=>{p.value=!1})}),T((e,d)=>{e.name=="editGroup"&&(b.editedGroupName=t.items.find(l=>l.id==e.params.groupId)?.name)}),(e,d)=>{const l=c("RouterLink"),_=c("Spinner"),$=c("ResponsiveWidthWrapper"),G=c("NavigationButton"),B=c("VueFooter"),I=c("StackLayout");return u(),R(I,null,{content:i(()=>[a($,null,{default:i(()=>[o("h1",J,n(e.$t("heading.groups")),1),o("div",K,n(e.$t("message.manage_groups_legend")),1),o("div",X,[a(l,{class:"is-link mt-5",to:{name:"createGroup"}},{default:i(()=>[a(s(D)),f(" "+n(e.$t("link.create_group")),1)]),_:1})]),s(t).isEmpty?v("",!0):(u(),m("div",Y,[a(s(V),null,{default:i(({mode:h})=>[o("span",Z,[(u(!0),m(F,null,M(s(t).withoutTheAllGroup,r=>(u(),m("div",{key:r.id,class:"group-item"},[o("div",ee,[o("div",te,[o("div",se,[f(n(r.name)+" ",1),o("span",oe,n(e.$t("message.x_accounts",{count:r.twofaccounts_count})),1)])]),s(C).preferences.useGroupChips&&r.show_in_chips?(u(),m("div",ae,[a(s(H),{class:"icon mr-2"})])):v("",!0),o("div",ie,[a(l,{to:{name:"editGroup",params:{groupId:r.id}},class:k(["button tag mr-1",h=="dark"?"is-dark":"is-white"]),title:e.$t("tooltip.edit_group")},{default:i(()=>[f(n(e.$t("label.edit")),1)]),_:1},8,["to","class","title"]),o("button",{type:"button",class:k(["button tag",h=="dark"?"is-dark":"is-white"]),onClick:de=>s(t).remove(r.id),title:e.$t("tooltip.delete")},[a(s(j),{class:"icon-size-1"})],10,ne)]),o("div",le,[a(s(q),{class:"drag-handle has-text-grey is-draggable"})])])]))),128))])]),_:1}),o("div",re,n(e.$t("message.deleting_group_does_not_delete_accounts")),1)])),a(_,{isVisible:s(p)&&s(t).isEmpty,type:"list-loading"},null,8,["isVisible"])]),_:1})]),footer:i(()=>[a(B,null,{default:i(()=>[a(G,{action:"close",onClosed:d[0]||(d[0]=h=>s(y).push({name:"accounts"})),"current-page-title":e.$t("title.groups")},null,8,["current-page-title"])]),_:1})]),_:1})}}};export{ge as default};