2 lines
1.2 KiB
JavaScript
2 lines
1.2 KiB
JavaScript
import{u as b,r as w,d as v,w as u,f as s,g as F,h as g,i as a,m as B,j as n,H as h,$ as C}from"./app-dvJP63FL.js";import{F as x}from"./Form-ZbAUhXmz.js";const S={__name:"Edit",props:{credentialId:{type:String,default:""}},setup(l){const{t:r}=b(),i=F(),m=C(),e=w(new x({name:r("label.my_device")})),d=l;function c(){e.patch("/webauthn/credentials/"+d.credentialId+"/name").then(()=>{m.success({text:r("notification.device_successfully_registered")}),i.push({name:"settings.webauthn.devices"})})}return(V,t)=>{const p=s("FormField"),f=s("FormButtons"),_=s("FormWrapper"),y=s("StackLayout");return g(),v(y,null,{content:u(()=>[a(_,{title:"heading.rename_device"},{default:u(()=>[B("form",{onSubmit:h(c,["prevent"]),onKeydown:t[2]||(t[2]=o=>n(e).onKeydown(o))},[a(p,{modelValue:n(e).name,"onUpdate:modelValue":t[0]||(t[0]=o=>n(e).name=o),fieldName:"name",errorMessage:n(e).errors.get("name"),inputType:"text",label:"field.new_name",autofocus:""},null,8,["modelValue","errorMessage"]),a(f,{submitId:"btnEditCredential",isBusy:n(e).isBusy,submitLabel:"label.save",showCancelButton:!0,onCancel:t[1]||(t[1]=o=>n(i).push({name:"settings.webauthn.devices"}))},null,8,["isBusy"])],32)]),_:1})]),_:1})}}};export{S as default};
|