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-SC54XQDl.js";import{P as M}from"./app-BGgVpkqZ.js";import{i as T,c as w}from"./app-Ba7ZqSpq.js";import{_ as C}from"./app-CVQkwzlf.js";import{_ as E,a as h}from"./app-PrSv7rSt.js";import{_ as $}from"./app-DFulsyXy.js";import{_ as x}from"./app-CAmT4CZO.js";import{_ as A}from"./app-FlPLZh9D.js";import{_ as I}from"./app-T1ysvErZ.js";import{_ as V}from"./app-huVLEujn.js";import{_ as v}from"./app-DWUwCFNm.js";import{T as k}from"./app-B9vRijk4.js";import{D as N}from"./app-ZeVDYyDS.js";import"./app-yUrwy8EY.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-DZaelcLs.js";import"./app-CNHjdV6U.js";import"./app-CmrRgGIA.js";import"./app-CkINxBL9.js";import"./app--Lj8zATS.js";import"./app-C2mBgI5Z.js";import"./app-DoVkxbmA.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};
