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-DnroACXc.js";import{P as M}from"./app-CyTk3GnO.js";import{i as T,c as w}from"./app-DckefXYL.js";import{_ as C}from"./app-DPkDcD7h.js";import{_ as E,a as h}from"./app-DntYVxd7.js";import{_ as $}from"./app-MnSDCF4P.js";import{_ as x}from"./app-kOJTa9yF.js";import{_ as A}from"./app-BbRQPmFH.js";import{_ as I}from"./app-DFWP-E91.js";import{_ as V}from"./app-BdF_-Hag.js";import{_ as v}from"./app-COct4tsy.js";import{T as k}from"./app-CvgavM_z.js";import{D as N}from"./app-Cx7ENVlu.js";import"./app-CUqfl6on.js";import"./app-CF0qXH5Q.js";import"./app-BJhJ7lM8.js";import"./app-Dd07dUxy.js";import"./app-CYYQ_Zep.js";import"./app-Dpl5YSiv.js";import"./app-CF8nmC-F.js";import"./app-NVAx7Sc3.js";import"./app-xECxwo4T.js";import"./app-B4bUdtyo.js";import"./app-LqsmzyUT.js";import"./app-DSjO_8RR.js";import"./app-HaDoyrq5.js";import"./app-Cmxxk_WX.js";import"./app-B09rlSqG.js";import"./app-B8VsrFxM.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};
