import{r as y,o as a,c as p,w as d,b as n,a as t,u as l,g as m,D as V,f as i,t as C,F as U,d as f,e as _,i as x,h as c}from"./app-SC54XQDl.js";import{P as L}from"./app-BGgVpkqZ.js";import{i as T,c as w}from"./app-Ba7ZqSpq.js";import{_ as g}from"./app-COkia88n.js";import{_ as R}from"./app-DWUwCFNm.js";import{_ as $}from"./app-DFulsyXy.js";import{_ as u}from"./app-CVQkwzlf.js";import{_ as b,a as S}from"./app-PrSv7rSt.js";import{_ as v}from"./app-T1ysvErZ.js";import{_ as P}from"./app-huVLEujn.js";import{_ as h}from"./app-DreD0GpY.js";import{D as N}from"./app-ZeVDYyDS.js";import"./app-yUrwy8EY.js";import"./app-CNHjdV6U.js";import"./app-DnXuoh8P.js";import"./app-BZGObKCm.js";import"./app-BPIIxVwk.js";import"./app-PPG0ZS4d.js";import"./app-DgoEZtNT.js";import"./app-Ch8j4za4.js";import"./app-Dw0jKdCD.js";import"./app-CCkWSX4Q.js";import"./app-DoVkxbmA.js";import"./app-C2mBgI5Z.js";import"./app-BxWqoSpr.js";function M(){T(this),this.success=this.$NotifyPopup,this.bodyType=this.pageConfig.bodyType,this.newStatus="",this.pageConfig.newStatus>0&&(this.newStatus=this.pageConfig.newStatus),this.addHTMLTemplate=function(){this.$refs.htmlBody.value=`<!DOCTYPE html>
<html lang="en">
<head>
	<title>\${status} \${statusMessage}</title>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
	<style>
		address { line-height: 1.8; }
	</style>
</head>
<body>

<h1>\${status} \${statusMessage}</h1>
<p><!-- 内容 --></p>

<address>Connection: \${remoteAddr} (Client) -&gt; \${serverAddr} (Server)</address>
<address>Request ID: \${requestId}</address>

</body>
</html>`}}const k=t("header",null,"修改自定义页面",-1),B=["value"],D=["value"],O=["value"],H=t("td",{class:"title"},"响应状态码 *",-1),J=t("p",{class:"comment"},"匹配的响应状态码，比如404，或者50x。",-1),q=t("td",null,"内容类型 *",-1),I=t("td",null,"显示页面HTML *",-1),z={class:"comment"},A={key:0},E=t("td",null,"显示页面URL *",-1),F=t("p",{class:"comment"},"将从此URL中读取内容。",-1),Y={key:1},j=t("td",null,"跳转到URL *",-1),G=t("p",{class:"comment"},"将会跳转到此URL，支持使用变量。",-1),K={colspan:"2"},Q=t("td",null,"新状态码",-1),W=t("p",{class:"comment"},"可以用来修改响应的状态码，不填表示不改变原有状态码。",-1),wt={__name:"updatePopup",setup(X){const r=y(),e=w(new M,{refs:{htmlBody:r}});return(Z,s)=>(a(),p(L,null,{default:d(()=>[k,n($,{action:"$",onSuccess:l(e).success},{default:d(()=>[t("input",{type:"hidden",name:"pageId",value:l(e).pageConfig.id},null,8,B),t("input",{type:"hidden",name:"exceptURLPatternsJSON",value:JSON.stringify(l(e).pageConfig.exceptURLPatterns)},null,8,D),t("input",{type:"hidden",name:"onlyURLPatternsJSON",value:JSON.stringify(l(e).pageConfig.onlyURLPatterns)},null,8,O),n(N,null,{default:d(()=>[t("tbody",null,[t("tr",null,[H,t("td",null,[n(u,{type:"text",name:"status",size:"3",placeholder:"状态码",maxlength:"3",style:{width:"5.2em"},autofocus:"",modelValue:l(e).pageConfig.status,"onUpdate:modelValue":s[0]||(s[0]=o=>l(e).pageConfig.status=o)},null,8,["modelValue"]),J])]),t("tr",null,[q,t("td",null,[n(b,{name:"bodyType",modelValue:l(e).bodyType,"onUpdate:modelValue":s[1]||(s[1]=o=>l(e).bodyType=o)},{default:d(()=>[(a(!0),m(U,null,V(l(e).bodyTypes,o=>(a(),p(S,{value:o.code},{default:d(()=>[i(C(o.name),1)]),_:2},1032,["value"]))),256))]),_:1},8,["modelValue"])])]),f(t("tr",null,[I,t("td",null,[n(v,{name:"body",ref_key:"htmlBody",ref:r,modelValue:l(e).pageConfig.body,"onUpdate:modelValue":s[2]||(s[2]=o=>l(e).pageConfig.body=o),rows:"7",class:"w-full"},null,8,["modelValue"]),t("p",z,[t("a",{href:"",onClick:s[3]||(s[3]=x((...o)=>l(e).addHTMLTemplate&&l(e).addHTMLTemplate(...o),["prevent"]))},"[使用模板]"),i("。填写页面的HTML内容，支持请求变量。 ")])])],512),[[_,l(e).bodyType=="html"]]),l(e).bodyType=="url"?(a(),m("tr",A,[E,t("td",null,[n(u,{type:"text",name:"url",maxlength:"500",placeholder:"类似于 https://example.com/page.html",modelValue:l(e).pageConfig.url,"onUpdate:modelValue":s[4]||(s[4]=o=>l(e).pageConfig.url=o),class:"w-full"},null,8,["modelValue"]),F])])):c("",!0),l(e).bodyType=="redirectURL"?(a(),m("tr",Y,[j,t("td",null,[n(u,{type:"text",name:"url",maxlength:"500",placeholder:"类似于 https://example.com/page.html",modelValue:l(e).pageConfig.url,"onUpdate:modelValue":s[5]||(s[5]=o=>l(e).pageConfig.url=o),class:"w-full"},null,8,["modelValue"]),G])])):c("",!0),t("tr",null,[t("td",K,[n(P)])])]),f(t("tbody",null,[t("tr",null,[t("td",null,[i("例外URL  "),n(g,{content:"对这些URL将不做任何限制。"})]),t("td",null,[n(h,{modelValue:l(e).pageConfig.exceptURLPatterns,"onUpdate:modelValue":s[6]||(s[6]=o=>l(e).pageConfig.exceptURLPatterns=o)},null,8,["modelValue"])])]),t("tr",null,[t("td",null,[i("限制URL  "),n(g,{content:"只对这些URL做限制。"})]),t("td",null,[n(h,{modelValue:l(e).pageConfig.onlyURLPatterns,"onUpdate:modelValue":s[7]||(s[7]=o=>l(e).pageConfig.onlyURLPatterns=o)},null,8,["modelValue"])])]),t("tr",null,[Q,t("td",null,[n(u,{type:"text",name:"newStatus",size:"3",placeholder:"状态码",maxlength:"3",style:{width:"5.2em"},modelValue:l(e).newStatus,"onUpdate:modelValue":s[8]||(s[8]=o=>l(e).newStatus=o)},null,8,["modelValue"]),W])])],512),[[_,l(e).moreOptionsVisible]])]),_:1}),n(R)]),_:1},8,["onSuccess"])]),_:1}))}};export{wt as default};
