2FAuth/public/build/assets/Options-e3b3035d.js

2 lines
9.7 KiB
JavaScript
Raw Normal View History

2024-03-15 15:37:37 +01:00
import{_ as P}from"./SettingTabs-beebcb43.js";import{Q as T,a as F,T as I,b as c,a2 as G,r as M,v as q,o as R,a0 as S,e as p,f as $,g as Q,m as l,h as i,p as _,t as u,i as o,j as V,J as L,I as j,a3 as W}from"./app-94c6def1.js";/*! 2FAuth version 5.1.0 - Copyright (c) 2023 Bubka - https://github.com/Bubka/2FAuth */const E={class:"options-tabs"},J={class:"block"},z={class:"title is-4 has-text-grey-light"},H={class:"field help"},K={class:"ml-2",href:"https://crowdin.com/project/2fauth"},X={class:"title is-4 pt-4 has-text-grey-light"},Y={class:"title is-4 pt-4 has-text-grey-light"},Z={class:"title is-4 pt-4 has-text-grey-light"},oe={__name:"Options",setup(ee){const f=T("2fauth"),s=F(),v=I(),b=c(),y=G(f.prefix+"returnTo","accounts"),O=[{text:"settings.forms.grid",value:"grid",icon:"th"},{text:"settings.forms.list",value:"list",icon:"list"}],h=[{text:"settings.forms.light",value:"light",icon:"sun"},{text:"settings.forms.dark",value:"dark",icon:"moon"},{text:"settings.forms.automatic",value:"system",icon:"desktop"}],w=[{text:"12 34 56",value:2,legend:"settings.forms.pair",title:"settings.forms.pair_legend"},{text:"123 456",value:3,legend:"settings.forms.trio",title:"settings.forms.trio_legend"},{text:"1234 5678",value:.5,legend:"settings.forms.half",title:"settings.forms.half_legend"}],x=[{text:"settings.forms.never",value:0},{text:"settings.forms.on_otp_copy",value:-1},{text:"settings.forms.1_minutes",value:1},{text:"settings.forms.5_minutes",value:5},{text:"settings.forms.10_minutes",value:10},{text:"settings.forms.15_minutes",value:15},{text:"settings.forms.30_minutes",value:30},{text:"settings.forms.1_hour",value:60},{text:"settings.forms.1_day",value:1440}],g=M([{text:"groups.no_group",value:0},{text:"groups.active_group",value:-1}]),C=[{text:"settings.forms.livescan",value:"livescan"},{text:"settings.forms.upload",value:"upload"},{text:"settings.forms.advanced_form",value:"advancedForm"}],D=[{text:"settings.forms.otp_generation_on_request",value:!0,legend:"settings.forms.otp_generation_on_request_legend",title:"settings.forms.otp_generation_on_request_title"},{text:"settings.forms.otp_generation_on_home",value:!1,legend:"settings.forms.otp_generation_on_home_legend",title:"settings.forms.otp_generation_on_home_title"}],U=q(()=>{let n=[{text:"languages.browser_preference",value:"browser"}];for(const e of f.langs)n.push({text:"languages."+e,value:e});return n});R(()=>{v.items.forEach(n=>{n.id>0&&g.value.push({text:n.name,value:n.id})}),s.refreshPreferences()});function r(n,e){L.updatePreference(n,e).then(m=>{c().success({type:"is-success",text:j("settings.forms.setting_saved")}),n==="lang"&&W()!==e?s.applyLanguage():n==="theme"&&s.applyTheme()})}return S(n=>{n.name.startsWith("settings.")||b.clear()}),(n,e)=>{const m=p("FormSelect"),N=p("FontAwesomeIcon"),d=p("FormToggle"),a=p("FormCheckbox"),k=p("FormWrapper"),A=p("ButtonBackCloseCancel"),B=p("VueFooter");return $(),Q("div",null,[l(P,{activeTab:"settings.options"}),i("div",E,[l(k,null,{default:_(()=>[i("form",null,[i("div",J,[i("h4",z,u(n.$t("settings.general")),1),l(m,{modelValue:o(s).preferences.lang,"onUpdate:modelValue":[e[0]||(e[0]=t=>o(s).preferences.lang=t),e[1]||(e[1]=t=>r("lang",t))],options:o(U),fieldName:"lang",label:"settings.forms.language.label",help:"settings.forms.language.help"},null,8,["modelValue","options"]),i("div",H,[V(u(n.$t("settings.forms.some_translation_are_missing"))+" ",1),i("a",K,[V(u(n.$t("settings.forms.help_translate_2fauth"))+" ",1),l(N,{icon:["fas","external-link-alt"]})])]),l(d,{modelValue:o(s).preferences.displayMode,"onUpdate:modelValue":[e[2]||(e[2]=t=>o(s).preferences.displayMode=t),e[3]||(e[3]=t=>r("displayMode",t))],choices:O,fieldName:"displayMode",label:"settings.forms.display_mode.label",help:"settings.forms.display_mode.help"},null,8,["modelValue"]),l(d,{modelValue:o(s).preferences.theme,"onUpdate:modelValue":[e[4]||(e[4]=t=>o(s).preferences.theme=t),e[5]||(e[5]=t=>r("theme",t))],choices:h,fieldName:"theme",label:"settings.forms.theme.label",help:"settings.forms.theme.help"},null,8,["modelValue"]),l(a,{modelValue:o(s).preferen