mirror of
https://github.com/Bubka/2FAuth.git
synced 2024-12-12 02:00:47 +01:00
3 lines
6.5 KiB
JavaScript
3 lines
6.5 KiB
JavaScript
|
import{_ as z}from"./AdminTabs-Dso2jpCe.js";import{a4 as P,R as I,r as f,l as p,m as d,d as u,e,n as T,f as s,t as n,j as l,k as F,g as v,i as H,U as W,u as j,a as E,a2 as q,a1 as G,o as J,L as K,F as O,D as Q,H as X}from"./app-CzxRjCVM.js";import{u as w}from"./appSettingsUpdater-CwAA4o0u.js";import{_ as Y}from"./CopyButton-B9az3SKR.js";/*! 2FAuth version 5.4.3 - Copyright (c) 2024 Bubka - https://github.com/Bubka/2FAuth */const k=P("web"),C={getSystemInfos(i={}){return k.get("system/infos",{...i})},getLastRelease(i={}){return k.get("system/latestRelease",{...i})},sendTestEmail(i={}){return k.post("system/test-email",{...i})},clearCache(i={}){return k.get("system/clear-cache",{...i})},optimize(i={}){return k.get("system/optimize",{...i})}},Z={class:"columns is-mobile is-vcentered"},ee={class:"column is-narrow"},se={class:"column"},te={class:"is-size-7",href:"https://github.com/Bubka/2FAuth/releases"},ne={key:1,class:"has-text-grey"},ae={key:2,class:"has-text-grey"},oe={__name:"VersionChecker",setup(i){const _=I(),b=f(!1),h=f();async function c(){b.value=!0,h.value=void 0,await C.getLastRelease({returnError:!0}).then(r=>{_.latestRelease=r.data.newRelease,h.value=r.data.newRelease===null?null:r.data.newRelease===!1}).catch(()=>{h.value=null}),b.value=!1}return(r,m)=>{const g=p("FontAwesomeIcon");return d(),u("div",Z,[e("div",ee,[e("button",{type:"button",class:T([s(b)?"is-loading":"","button is-link is-rounded is-small"]),onClick:c},n(r.$t("admin.check_now")),3)]),e("div",se,[l(s(W),null,{default:F(({mode:y})=>[s(_).latestRelease?(d(),u("span",{key:0,class:T(["mt-2",y=="dark"?"has-text-warning":"has-text-warning-dark"])},[m[0]||(m[0]=e("span",{class:"release-flag"},null,-1)),v(n(r.$t("admin.x_is_available",{version:s(_).latestRelease}))+" ",1),e("a",te,n(r.$t("admin.view_on_github")),1)],2)):H("",!0),s(h)?(d(),u("span",ne,[l(g,{icon:["fas","check"],class:"mr-1 has-text-success"}),v(" "+n(r.$t("commons.you_are_up_to_date")),1)])):s(h)===null?(d(),u("span",ae,[l(g,{icon:["fas","times"],class:"mr-1 has-text-danger"}),v(n(r.$t("errors.check_failed_try_later")),1)])):H("",!0)]),_:1})])])}}},le={class:"options-tabs"},ie={class:"title is-4 pt-4 has-text-grey-light"},re={class:"field"},ce=["innerHTML"],de=["innerHTML"],ue=["innerHTML"],me={class:"columns is-mobile is-vcentered"},_e={class:"column is-narrow"},he={class:"icon is-small"},pe={class:"field"},fe=["innerHTML"],be=["innerHTML"],ge={class:"title is-4 pt-5 has-text-grey-light"},ye={class:"title is-4 pt-5 has-text-grey-light"},ke={class:"title is-4 pt-5 has-text-grey-light"},ve={class:"field"},Ce=["innerHTML"],Te=["innerHTML"],$e={class:"field mb-5 is-grouped"},Le={class:"control"},we={class:"field"},Fe=["innerHTML"],He={key:0,class:"about-debug box is-family-monospace is-size-7"},Me=["value"],Ve={class:"has-text-grey"},Ee={key:1,class:"about-debug box is-family-monospace is-size-7 has-text-warning-dark"},Be={__name:"AppSetup",setup(i){const _=K("2fauth"),b=j(),h=E(),c=I(),r=q(_.prefix+"returnTo","accounts"),m=f(),g=f(null),y=f(!1),$=f(!1),S=_.config.subdirectory+"/up",R=location.hostname+_.config.subdirectory+"/up";function U(){y.value=!0,C.sendTestEmail().finally(()=>{y.value=!1})}function B(){$.value=!0,C.clearCache().then(t=>{E().success({type:"is-success",text:X("admin.cache_cleared")})}).finally(()=>{$.value=!1})}return G(t=>{t.name.startsWith("admin.")||h.clear()}),J(async()=>{await c.fetch(),C.getSystemInfos({returnError:!0}).then(t=>{m.value=t.data.common}).catch(()=>{m.value=null})}),(t,a)=>{const L=p("FormCheckbox"),A=p("FontAwesomeIcon"),N=p("FormWrapper"),D=p("ButtonBackCloseCancel"),x=p("VueFooter");return d(),u("div",null,[l(z,{activeTab:"admin.appSetup"}),e("div",le,[l(N,null,{default:F(()=>{var M;return[e("form",null,[e("h4",ie,n(t.$t("settings.general")),1),l(L,{modelValue:s(c).checkForUpdate,"onUpdate:modelValue":[a[0]||(a[0]=o=>s(c).checkForUpdate=o),a[1]||(a[1]=o=>s(w)("checkForUpdate",o))],fieldName:"checkForUpdate",label:"commons.check_for_update",help:"commons.check_for_update_help"},null,8,["modelValue"]),l(oe),e("div",re,[e("label",{class:"label",
|
|||
|
//# sourceMappingURL=AppSetup-CjgtJWbk.js.map
|