import{r as L,o as a,c as p,w as d,b as l,a as t,u as s,g as m,D as x,f as r,t as U,F as R,d as c,e as _,i as T,h}from"./app-BYcXwl4U.js";import{P as b}from"./app-Doj30F-n.js";import{i as $,c as g}from"./app-a6cKceqE.js";import{_ as i}from"./app-Ufpj4Ll4.js";import{_ as v}from"./app-CQ-vNlMj.js";import{_ as w,a as P}from"./app-DxbU-QrX.js";import{_ as V}from"./app-DY-0PadZ.js";import{_ as f}from"./app-Wy4FFEmL.js";import{_ as S}from"./app-DiDEoOb6.js";import{_ as C}from"./app-CignoBaV.js";import{_ as y}from"./app-jKqt9xs8.js";import{D as M}from"./app-7GBSHA5C.js";import"./app-Ceh-tphd.js";import"./app-ysQ8KbGS.js";import"./app-Cp3gmk2J.js";import"./app--MWyBMkA.js";import"./app-BG60hdvp.js";import"./app-CNARLpXE.js";import"./app-SxAW7vhf.js";import"./app-D5k1HLu9.js";import"./app-BDgR0DSb.js";import"./app-CrjU8lgK.js";import"./app-D2Wz0BUQ.js";import"./app-D3zbrzdO.js";import"./app-0YmIdYYs.js";function N(){$(this),this.bodyType=this.bodyTypes[0].code,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>`},this.exceptURLPatterns=[],this.onlyURLPatterns=[]}const k=t("header",null,"添加自定义页面",-1),B=["value"],D=["value"],O=["value"],H=t("td",{class:"title"},"响应状态码 *",-1),I=t("p",{class:"comment"},"匹配的响应状态码，比如404，或者50x。",-1),J=t("td",null,"内容类型 *",-1),q=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),gt={__name:"createPopup",setup(X){const u=L(),e=g(new N,{refs:{htmlBody:u}});return(Z,n)=>(a(),p(b,null,{default:d(()=>[k,l(v,{action:"$",onSuccess:s(e).success},{default:d(()=>[t("input",{type:"hidden",name:"webId",value:s(e).webId},null,8,B),t("input",{type:"hidden",name:"exceptURLPatternsJSON",value:JSON.stringify(s(e).exceptURLPatterns)},null,8,D),t("input",{type:"hidden",name:"onlyURLPatternsJSON",value:JSON.stringify(s(e).onlyURLPatterns)},null,8,O),l(M,null,{default:d(()=>[t("tbody",null,[t("tr",null,[H,t("td",null,[l(i,{type:"text",name:"status",size:"3",placeholder:"状态码",maxlength:"3",style:{width:"5.2em"},autofocus:""}),I])]),t("tr",null,[J,t("td",null,[l(w,{name:"bodyType",modelValue:s(e).bodyType,"onUpdate:modelValue":n[0]||(n[0]=o=>s(e).bodyType=o)},{default:d(()=>[(a(!0),m(R,null,x(s(e).bodyTypes,o=>(a(),p(P,{value:o.code},{default:d(()=>[r(U(o.name),1)]),_:2},1032,["value"]))),256))]),_:1},8,["modelValue"])])]),c(t("tr",null,[q,t("td",null,[l(V,{name:"body",ref_key:"htmlBody",ref:u,rows:"7",class:"w-full"},null,512),t("p",z,[t("a",{href:"",onClick:n[1]||(n[1]=T((...o)=>s(e).addHTMLTemplate&&s(e).addHTMLTemplate(...o),["prevent"]))},"[使用模板]"),r("。填写页面的HTML内容，支持请求变量。 ")])])],512),[[_,s(e).bodyType=="html"]]),s(e).bodyType=="url"?(a(),m("tr",A,[E,t("td",null,[l(i,{type:"text",name:"url",maxlength:"500",placeholder:"类似于 https://example.com/page.html",class:"w-full"}),F])])):h("",!0),s(e).bodyType=="redirectURL"?(a(),m("tr",Y,[j,t("td",null,[l(i,{type:"text",name:"url",maxlength:"500",placeholder:"类似于 https://example.com/page.html",class:"w-full"}),G])])):h("",!0),t("tr",null,[t("td",K,[l(S)])])]),c(t("tbody",null,[t("tr",null,[t("td",null,[r("例外URL  "),l(f,{content:"对这些URL将不做任何限制。"})]),t("td",null,[l(y,{modelValue:s(e).exceptURLPatterns,"onUpdate:modelValue":n[2]||(n[2]=o=>s(e).exceptURLPatterns=o)},null,8,["modelValue"])])]),t("tr",null,[t("td",null,[r("限制URL  "),l(f,{content:"只对这些URL做限制。"})]),t("td",null,[l(y,{modelValue:s(e).onlyURLPatterns,"onUpdate:modelValue":n[3]||(n[3]=o=>s(e).onlyURLPatterns=o)},null,8,["modelValue"])])]),t("tr",null,[Q,t("td",null,[l(i,{type:"text",name:"newStatus",size:"3",placeholder:"状态码",maxlength:"3",style:{width:"5.2em"}}),W])])],512),[[_,s(e).moreOptionsVisible]])]),_:1}),l(C)]),_:1},8,["onSuccess"])]),_:1}))}};export{gt as default};
