owntone-server/htdocs/assets/PageSettingsRemotesOutputs.js
2023-12-14 20:00:28 +00:00

2 lines
3.3 KiB
JavaScript

import{C as k}from"./ContentWithHeading.js";import{T as b}from"./TabsSettings.js";import{_ as x,e as p,r as f,o as a,c as r,d as _,w as l,a as t,t as i,j as g,Z as v,h as m,k as u,F as y,f as w,v as q}from"./index.js";const S={name:"PageSettingsRemotesOutputs",components:{ContentWithHeading:k,TabsSettings:b},data(){return{pairing_req:{pin:""},verification_req:{pin:""}}},computed:{outputs(){return this.$store.state.outputs},pairing(){return this.$store.state.pairing}},methods:{kickoff_pairing(){p.pairing_kickoff(this.pairing_req)},kickoff_verification(e){p.output_update(e,this.verification_req)},output_toggle(e){p.output_toggle(e)}}},V={class:"fd-page-with-tabs"},$=["textContent"],U={key:0,class:"notification"},B={class:"label has-text-weight-normal"},M=["textContent"],N=["textContent"],T={class:"field is-grouped"},D={class:"control"},F=["placeholder"],O={class:"control"},P=["textContent"],R={key:1,class:"content"},j=["textContent"],E=["textContent"],H=["textContent"],L={class:"field"},W={class:"control"},Z=["id","onUpdate:modelValue","onChange"],z=["for","textContent"],A=["onSubmit"],G={class:"field is-grouped"},I={class:"control"},J=["placeholder"],K={class:"control"},Q=["textContent"];function X(e,o,Y,tt,d,s){const C=f("tabs-settings"),h=f("content-with-heading");return a(),r("div",V,[_(C),_(h,null,{"heading-left":l(()=>[t("div",{class:"title is-4",textContent:i(e.$t("page.settings.devices.pairing"))},null,8,$)]),content:l(()=>[s.pairing.active?(a(),r("div",U,[t("form",{onSubmit:o[1]||(o[1]=m((...n)=>s.kickoff_pairing&&s.kickoff_pairing(...n),["prevent"]))},[t("label",B,[t("span",{textContent:i(e.$t("page.settings.devices.pairing-request"))},null,8,M),t("b",{textContent:i(s.pairing.remote)},null,8,N)]),t("div",T,[t("div",D,[g(t("input",{"onUpdate:modelValue":o[0]||(o[0]=n=>d.pairing_req.pin=n),class:"input",type:"text",pattern:"[\\d]{4}",placeholder:e.$t("page.settings.devices.pairing-code")},null,8,F),[[v,d.pairing_req.pin]])]),t("div",O,[t("button",{class:"button is-info",type:"submit",textContent:i(e.$t("page.settings.devices.send"))},null,8,P)])])],32)])):u("",!0),s.pairing.active?u("",!0):(a(),r("div",R,[t("p",{textContent:i(e.$t("page.settings.devices.no-active-pairing"))},null,8,j)]))]),_:1}),_(h,null,{"heading-left":l(()=>[t("div",{class:"title is-4",textContent:i(e.$t("page.settings.devices.speaker-pairing"))},null,8,E)]),content:l(()=>[t("p",{class:"content",textContent:i(e.$t("page.settings.devices.speaker-pairing-info"))},null,8,H),(a(!0),r(y,null,w(s.outputs,n=>(a(),r("div",{key:n.id},[t("div",L,[t("div",W,[g(t("input",{id:n.id,"onUpdate:modelValue":c=>n.selected=c,type:"checkbox",class:"switch is-rounded mr-2",onChange:c=>s.output_toggle(n.id)},null,40,Z),[[q,n.selected]]),t("label",{for:n.id,class:"checkbox",textContent:i(n.name)},null,8,z)])]),n.needs_auth_key?(a(),r("form",{key:0,class:"mb-5",onSubmit:m(c=>s.kickoff_verification(n.id),["prevent"])},[t("div",G,[t("div",I,[g(t("input",{"onUpdate:modelValue":o[2]||(o[2]=c=>d.verification_req.pin=c),class:"input",type:"text",pattern:"[\\d]{4}",placeholder:e.$t("page.settings.devices.verification-code")},null,8,J),[[v,d.verification_req.pin]])]),t("div",K,[t("button",{class:"button is-info",type:"submit",textContent:i(e.$t("page.settings.devices.verify"))},null,8,Q)])])],40,A)):u("",!0)]))),128))]),_:1})])}const st=x(S,[["render",X]]);export{st as default};