PageSourceSearch

https://frankieedgar.com/_nuxt/CbNRA4hh.js

js frankieedgar.com collected 2026-10-02 14:14:40 UTC 4,039 bytes, 1 lines download raw bytes

1import S from"./BO_wHg7V.js";import{u as F}from"./CSQgM3SS.js";import{a as M,C as q,z as H}from"#entry";import{aC as j,U as W,ad as x,e as I,F as G,aD as Q}from"./B9SPuWlS.js";import{i as k,a as Z}from"./BP6KYo0g.js";import{aN as J,ag as m,r as y,aE as l,o as K,y as i,q as X,aQ as R,Z as D,p as N,x as $,al as s,m as Y,aH as ee,ac as te}from"./CT7wXifU.js";import"./D6trejea.js";import"./Cp2c5yTg.js";const ae={class:"px-md-10 mx-1md-0 pa-4 py-md-10"},re={key:0,class:"overlay-component",style:{"z-index":"99"}},le={class:"loader-container"},se={__name:"RedirectAddEdit",props:{redirectId:{type:[String,Number],default:null}},setup(_){const f=M(),h=_,n=q(),{getApiCalls:d,postApiCalls:b,putApiCalls:A,secureEndpoint:v}=F(),{$toast:w}=j();J(()=>h.redirectId,async t=>{if(t)try{r.value=!0,c.value=!0;const a=(await d(v.REDIRECT,{id:parseInt(h.redirectId)}))[0];g.value=a.id,o.value=a.old_url,u.value=a.new_url,r.value=!1}catch{r.value=!1,c.value=!1,n.push("/admin/redirectUrl")}});const g=s(null),o=s(null),u=s(null),C=s(null),V=s(null),c=s(!1),r=s(!1),p=Y(()=>{if(window.location){let e=window.location.hostname.replace(/^www\./,"");return e=e.replace(/^([^-]+)-admin(-.*)?\./,"$1."),e=e.replace(/^admin\.([^.]+\.)/,"$1"),e}return Q().public.DEFAULT_PAGE_DOMAIN?.replace(/^www\./,"")||""}),E=t=>{if(!t||t.startsWith("/"))return!0;try{return new URL(t),!0}catch{return"Invalid URL format. Use /path or https://domain.com/path"}},O=()=>p.value?`/old-path or https://${p.value}/old-path`:"/old-path",z=()=>p.value?`Must be a path on this site (${p.value}) or a full URL with this site's domain`:"Must be a path on this site or a full URL with this site's domain",B=t=>{if(!t||t.startsWith("/"))return!0;try{const a=new URL(t).hostname.replace(/^www\./,""),U=p.value?.replace(/^www\./,"")||"";return a!==U?`Old URL must be from this site's domain (${U}). Use /path or https://${U}/path`:!0}catch{return!0}},L=async t=>{const e=await Z({oldUrl:C.value,newUrl:V.value});if(e&&t==!1)T();else if(e&&t==!0)P();else{w.error("Please fill out the required fields",{duration:15e3});return}},T=async()=>{try{r.value=!0;const t={old_url:o.value,new_url:u.value,organization:f.organization.id},e=await b(v.REDIRECT,t);w.success("Redirect created successfully",{duration:15e3}),r.value=!1,n.push("/admin/all-settings")}catch{r.value=!1}},P=async()=>{try{r.value=!0;const t={id:g.value,old_url:o.value,new_url:u.value,organization:f.organization.id},e=await A(v.REDIRECT,t);w.success("Redirect Updated successfully",{duration:15e3}),r.value=!1,n.push("/admin/all-settings")}catch{r.value=!1}};return(t,e)=>(m(),y("div",ae,[l(r)?(m(),y("div",re,[K("div",le,[i(W,{indeterminate:"",size:"64",color:"primary"})])])):X("",!0),i(G,null,{default:R(()=>[i(x,{modelValue:l(o),"onUpdate:modelValue":e[0]||(e[0]=a=>D(o)?o.value=a:null),label:"Old URL",name:"Old URL",rules:[l(k),E,B],ref_key:"oldUrlRef",ref:C,placeholder:O(),variant:"outlined",density:"comfortable",hint:z(),"persistent-hint":""},null,8,["modelValue","rules","placeholder","hint"]),i(x,{modelValue:l(u),"onUpdate:modelValue":e[1]||(e[1]=a=>D(u)?u.value=a:null),label:"New URL",name:"New URL",rules:[l(k),E],ref_key:"newUrlRef",ref:V,placeholder:"/new-path or https://any-domain.com/new-path",variant:"outlined",density:"comfortable",hint:"Can be a path on this site or any external/Internal URL (for cross-domain redirects)","persistent-hint":""},null,8,["modelValue","rules"]),l(c)?(m(),N(I,{key:1,class:"save-button mr-4",onClick:e[3]||(e[3]=a=>L(c.value=!0))},{default:R(()=>[...e[5]||(e[5]=[$("Update",-1)])]),_:1})):(m(),N(I,{key:0,class:"save-button mr-4",onClick:e[2]||(e[2]=a=>L(c.value=!1))},{default:R(()=>[...e[4]||(e[4]=[$("Save",-1)])]),_:1}))]),_:1})]))}},fe={__name:"[slug]",setup(_){H({meta:[{name:"robots",content:"noindex"}]});const f=ee(),h=s("Redirect URL Add/Edit"),n=s("");return te(()=>{const d=f.params.slug;d!=="new"&&(n.value=d)}),(d,b)=>(m(),y("div",null,[i(l(S),{header:l(h)},null,8,["header"]),i(l(se),{redirectId:l(n)},null,8,["redirectId"])]))}};export{fe as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.