import{r as y,o,c as d,w as c,b as l,a as t,u as s,f as i,g as n,h as r,i as _,d as u,e as f}from"./app-BYcXwl4U.js";import{P as M}from"./app-Doj30F-n.js";import{i as T,c as w}from"./app-a6cKceqE.js";import{_ as C}from"./app-Ufpj4Ll4.js";import{_ as E,a as h}from"./app-DxbU-QrX.js";import{_ as $}from"./app-CQ-vNlMj.js";import{_ as x}from"./app-B1xJNzEy.js";import{_ as A}from"./app-DwtlHtUX.js";import{_ as I}from"./app-DY-0PadZ.js";import{_ as V}from"./app-DiDEoOb6.js";import{_ as v}from"./app-CignoBaV.js";import{T as k}from"./app-5TZYCptM.js";import{D as N}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-BHl80pFw.js";import"./app-CrjU8lgK.js";import"./app-CrkKi1Ag.js";import"./app-yt37eDzA.js";import"./app-BQ5ggxk2.js";import"./app-D3zbrzdO.js";import"./app-D2Wz0BUQ.js";function B(){T(this),this.success=this.$NotifyPopup,this.isCA=0,this.textMode=!1,this.switchTextMode=function(){this.textMode=!this.textMode,this.textMode&&this.$delay(function(){this.$refs.certTextField.focus()})}}const F=t("header",null,"上传证书",-1),R=["value"],P=t("td",{class:"title"},"证书说明 *",-1),b=t("p",{class:"comment"},"可以简单说明证书的用途。",-1),S=t("td",null,"证书类型",-1),G={key:0},g={key:1},D={class:"comment"},z={key:0},K={key:1},O={key:0},Y={key:0},L={key:1},U={class:"comment"},j={key:0},q={key:1},H={key:0},J={colspan:"2"},Q=t("td",null,"详细说明",-1),W=t("td",null,"启用当前证书",-1),vt={__name:"uploadPopup",setup(X){const m=y(),e=w(new B,{refs:{certTextField:m}});return(Z,a)=>(o(),d(M,null,{default:c(()=>[F,l($,{action:"$",onSuccess:s(e).success},{default:c(()=>[t("input",{type:"hidden",name:"textMode",value:s(e).textMode?1:0},null,8,R),l(N,null,{default:c(()=>[t("tbody",null,[t("tr",null,[P,t("td",null,[l(C,{name:"name",maxlength:"100",autofocus:"",class:"w-full"}),b])]),t("tr",null,[S,t("td",null,[l(E,{name:"isCA",modelValue:s(e).isCA,"onUpdate:modelValue":a[0]||(a[0]=p=>s(e).isCA=p)},{default:c(()=>[l(h,{value:"0"},{default:c(()=>[i("加密证书")]),_:1}),l(h,{value:"1"},{default:c(()=>[i("CA证书")]),_:1})]),_:1},8,["modelValue"])])]),t("tr",null,[t("td",null,[s(e).textMode?(o(),n("span",G,"输入证书内容")):(o(),n("span",g,"选择证书文件")),i(" *")]),t("td",null,[s(e).textMode?r("",!0):(o(),d(k,{key:0,type:"file",name:"certFile",accept:"application/x-pem-file, application/pkcs10, application/x-pkcs12, application/x-x509-user-cert, application/x-x509-ca-cert, application/pkix-cert, .pem"})),s(e).textMode?(o(),d(x,{key:1,class:"w-full",rows:"10",ref_key:"certTextField",ref:m,spellcheck:"false",name:"certText",placeholder:"-----BEGIN CERTIFICATE-----",style:{"font-size":"0.7em"}},null,512)):r("",!0),t("p",D,[t("a",{href:"",onClick:a[1]||(a[1]=_((...p)=>s(e).switchTextMode&&s(e).switchTextMode(...p),["prevent"]))},[i("["),s(e).textMode?(o(),n("span",K,"上传文件")):(o(),n("span",z,"输入内容")),i("]")]),i('。文件内容中通常含有"-----BEGIN CERTIFICATE-----"类似的信息'),s(e).textMode?(o(),n("span",O,"，可以直接拖动证书文件到输入框")):r("",!0),i("。 ")])])]),u(t("tr",null,[t("td",null,[s(e).textMode?(o(),n("span",Y,"输入私钥内容")):(o(),n("span",L,"选择私钥文件")),i(" *")]),t("td",null,[s(e).textMode?r("",!0):(o(),d(k,{key:0,type:"file",name:"keyFile",accept:"application/pkcs8, .key, .pem"})),s(e).textMode?(o(),d(x,{key:1,class:"w-full",rows:"10",spellcheck:"false",name:"keyText",placeholder:"-----BEGIN RSA PRIVATE KEY-----",style:{"font-size":"0.7em"}})):r("",!0),t("p",U,[t("a",{href:"",onClick:a[2]||(a[2]=_((...p)=>s(e).switchTextMode&&s(e).switchTextMode(...p),["prevent"]))},[i("["),s(e).textMode?(o(),n("span",q,"上传文件")):(o(),n("span",j,"输入内容")),i("]")]),i('。文件内容中通常含有"-----BEGIN RSA PRIVATE KEY-----"类似的信息'),s(e).textMode?(o(),n("span",H,"，可以直接拖动私钥文件到输入框")):r("",!0),i("。 ")])])],512),[[f,s(e).isCA==0]]),t("tr",null,[t("td",J,[l(V)])])]),u(t("tbody",null,[t("tr",null,[Q,t("td",null,[l(I,{rows:"3",name:"description",maxlength:"200",class:"w-full"})])]),t("tr",null,[W,t("td",null,[l(A,{name:"isOn",value:"1",checked:"checked"})])])],512),[[f,s(e).moreOptionsVisible]])]),_:1}),l(v)]),_:1},8,["onSuccess"])]),_:1}))}};export{vt as default};
