allinssl/build/static/js/drawer-B0Fdx8P4.js

2 lines
16 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

import{T as e,U as t,a0 as n,_ as a,bt as r,a8 as l,d as i,z as o,aO as s,aQ as c,V as d,aE as u,A as p,bu as v,Q as _,Z as h,bv as m,aA as f,bw as b,a1 as g,bx as x,by as y,a4 as z,aT as C,l as w,aF as k,Y as S,a7 as $,E as j,F as I,G as N,a as P,f as R,bz as F,bA as U,$ as B,r as O,m as T,c as V,J as A,p as E,x as D,o as L,t as M,bB as q,C as H,B as Q,ac as G,i as J}from"./main-nq6CyAEG.js";import{u as W}from"./index-BdmQ5hPU.js";import{u as Y,k as Z}from"./index-0TZgzcKc.js";import{S as K}from"./index-BOIfhWe5.js";import{D as X}from"./index-CFPNmhPX.js";import{r as ee}from"./verify-11EmNtXa.js";import{N as te}from"./text-Bj_I_6dj.js";import{N as ne,a as ae}from"./Tabs-CzGNH_VD.js";import"./test-atuOPBtq.js";import"./useStore-BqsFkvpN.js";import"./useStore-0WTuamI4.js";import"./setting-C065v3-2.js";import"./index-C42fj9Vo.js";import"./index-BFHookVd.js";import"./Flex-LdzdNWFG.js";import"./business-CsDkB4ip.js";const re=e("steps","\n width: 100%;\n display: flex;\n",[e("step","\n position: relative;\n display: flex;\n flex: 1;\n ",[t("disabled","cursor: not-allowed"),t("clickable","\n cursor: pointer;\n "),n("&:last-child",[e("step-splitor","display: none;")])]),e("step-splitor","\n background-color: var(--n-splitor-color);\n margin-top: calc(var(--n-step-header-font-size) / 2);\n height: 1px;\n flex: 1;\n align-self: flex-start;\n margin-left: 12px;\n margin-right: 12px;\n transition:\n color .3s var(--n-bezier),\n background-color .3s var(--n-bezier);\n "),e("step-content","flex: 1;",[e("step-content-header","\n color: var(--n-header-text-color);\n margin-top: calc(var(--n-indicator-size) / 2 - var(--n-step-header-font-size) / 2);\n line-height: var(--n-step-header-font-size);\n font-size: var(--n-step-header-font-size);\n position: relative;\n display: flex;\n font-weight: var(--n-step-header-font-weight);\n margin-left: 9px;\n transition:\n color .3s var(--n-bezier),\n background-color .3s var(--n-bezier);\n ",[a("title","\n white-space: nowrap;\n flex: 0;\n ")]),a("description","\n color: var(--n-description-text-color);\n margin-top: 12px;\n margin-left: 9px;\n transition:\n color .3s var(--n-bezier),\n background-color .3s var(--n-bezier);\n ")]),e("step-indicator","\n background-color: var(--n-indicator-color);\n box-shadow: 0 0 0 1px var(--n-indicator-border-color);\n height: var(--n-indicator-size);\n width: var(--n-indicator-size);\n border-radius: 50%;\n display: flex;\n align-items: center;\n justify-content: center;\n transition:\n background-color .3s var(--n-bezier),\n box-shadow .3s var(--n-bezier);\n ",[e("step-indicator-slot","\n position: relative;\n width: var(--n-indicator-icon-size);\n height: var(--n-indicator-icon-size);\n font-size: var(--n-indicator-icon-size);\n line-height: var(--n-indicator-icon-size);\n ",[a("index","\n display: inline-block;\n text-align: center;\n position: absolute;\n left: 0;\n top: 0;\n white-space: nowrap;\n font-size: var(--n-indicator-index-font-size);\n width: var(--n-indicator-icon-size);\n height: var(--n-indicator-icon-size);\n line-height: var(--n-indicator-icon-size);\n color: var(--n-indicator-text-color);\n transition: color .3s var(--n-bezier);\n ",[r()]),e("icon","\n color: var(--n-indicator-text-color);\n transition: color .3s var(--n-bezier);\n ",[r()]),e("base-icon","\n color: var(--n-indicator-text-color);\n transition: color .3s var(--n-bezier);\n ",[r()])])]),t("vertical","flex-direction: column;",[l("show-description",[n(">",[e("step","padding-bottom: 8px;")])]),n(">",[e("step","margin-bottom: 16px;",[n("&:last-child","margin-bottom: 0;"),n(">",[e("step-indicator",[n(">",[e("step-splitor","\n position: absolute;\n bottom: -8px;\n width: 1px;\n margin: 0 !important;\n left: calc(var(--n-indicator-size) / 2);\n height: calc(100% - var(--n-indicator-size));\n ")])]),e("step-content",[a("description","margin-top: 8px;")])])])])])]);function le(e){return e.map(((e,t)=>function(e,t){return"object"!=typeof e||null===e||Array.isArray(e)?null:(e.props||(e.props={}),e.props.internalIndex=t+1,e)}(e,t)))}const ie=Object.assign(Object.assign({},p.props),{current:Number,status:{type:String,default:"process"},size:{type:String,default:"medium"},vertical:Boolean,"onUpdate:current":[Function,Array],onUpdateCurrent:[Function,Array]}),oe=_("n-steps"),se=i({name:"Steps",props:ie,slots:Object,setup(e,{slots:t}){const{mergedClsPrefixRef:n,mergedRtlRef:a}=d(e),r=u("Steps",a,n),l=p("Steps","-steps",re,v,e,n);return h(oe,{props:e,mergedThemeRef:l,mergedClsPrefixRef:n,stepsSlots:t}),{mergedClsPrefix:n,rtlEnabled:r}},render(){const{mergedClsPrefix:e}=this;return o("div",{class:[`${e}-steps`,this.rtlEnabled&&`${e}-steps--rtl`,this.vertical&&`${e}-steps--vertical`]},le(s(c(this))))}}),ce=i({name:"Step",props:{status:String,title:String,description:String,disabled:Boolean,internalIndex:{type:Number,default:0}},slots:Object,setup(e){const t=z(oe,null);t||C("step","`n-step` must be placed inside `n-steps`.");const{inlineThemeDisabled:n}=d(),{props:a,mergedThemeRef:r,mergedClsPrefixRef:l,stepsSlots:i}=t,o=w((()=>a.vertical)),s=w((()=>{const{status:t}=e;if(t)return t;{const{internalIndex:t}=e,{current:n}=a;if(void 0===n)return"process";if(t<n)return"finish";if(t===n)return a.status||"process";if(t>n)return"wait"}return"process"})),c=w((()=>{const{value:e}=s,{size:t}=a,{common:{cubicBezierEaseInOut:n},self:{stepHeaderFontWeight:l,[k("stepHeaderFontSize",t)]:i,[k("indicatorIndexFontSize",t)]:o,[k("indicatorSize",t)]:c,[k("indicatorIconSize",t)]:d,[k("indicatorTextColor",e)]:u,[k("indicatorBorderColor",e)]:p,[k("headerTextColor",e)]:v,[k("splitorColor",e)]:_,[k("indicatorColor",e)]:h,[k("descriptionTextColor",e)]:m}}=r.value;return{"--n-bezier":n,"--n-description-text-color":m,"--n-header-text-color":v,"--n-indicator-border-color":p,"--n-indicator-color":h,"--n-indicator-icon-size":d,"--n-indicator-index-font-size":o,"--n-indicator-size":c,"--n-indicator-text-color":u,"--n-splitor-color":_,"--n-step-header-font-size":i,"--n-step-header-font-weight":l}})),u=n?S("step",w((()=>{const{value:e}=s,{size:t}=a;return`${e[0]}${t[0]}`})),c,a):void 0,p=w((()=>{if(e.disabled)return;const{onUpdateCurrent:t,"onUpdate:current":n}=a;return t||n?()=>{t&&$(t,e.internalIndex),n&&$(n,e.internalIndex)}:void 0}));return{stepsSlots:i,mergedClsPrefix:l,vertical:o,mergedStatus:s,handleStepClick:p,cssVars:n?void 0:c,themeClass:null==u?void 0:u.themeClass,onRender:null==u?void 0:u.onRender}},render(){const{mergedClsPrefix:e,onRender:t,handleStepClick:n,disabled:a}=this,r=m(this.$slots.default,(t=>{const n=t||this.description;return n?o("div",{class:`${e}-step-content__description`},n):null}));return null==t||t(),o("div",{class:[`${e}-step`,a&&`${e}-step--disabled`,!a&&n&&`${e}-step--clickable`,this.themeClass,r&&`${e}-step--show-description`,`${e}-step--${this.mergedStatus}-status`],style:this.cssVars,onClick:n},o("div",{class:`${e}-step-indicator`},o("div",{class:`${e}-step-indicator-slot`},o(b,null,{default:()=>m(this.$slots.icon,(t=>{const{mergedStatus:n,stepsSlots:a}=this;return"finish"!==n&&"error"!==n?t||o("div",{key:this.internalIndex,class:`${e}-step-indicator-slot__index`},this.internalIndex):"finish"===n?o(g,{clsPrefix:e,key:"finish"},{default:()=>f(a["finish-icon"],(()=>[o(x,null)]))}):"error"===n?o(g,{clsPrefix:e,key:"error"},{default:()=>f(a["error-icon"],(()=>[o(y,null)]))}):null}))})),this.vertical?o("div",{class:`${e}-step-splitor`}):null),o("div",{class:`${e}-step-content`},o("div",{class:`${e}-step-content-header`},o("div",{class:`${e}-step-content-header__title`},f(this.$slots.title,(()=>[this.title]))),this.vertical?null:o("div",{class:`${e}-step-splitor`})),r))}}),de={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 1024 1024"},ue=i({name:"SearchOutlined",render:function(e,t){return I(),j("svg",de,t[0]||(t[0]=[N("path",{d:"M909.6 854.5L649.9 594.8C690.2 542.7 712 479 712 412c0-80.2-31.3-155.4-87.9-212.1c-56.6-56.7-132-87.9-212.1-87.9s-155.5 31.3-212.1 87.9C143.2 256.5 112 331.8 112 412c0 80.1 31.3 155.5 87.9 212.1C256.5 680.8 331.8 712 412 712c67 0 130.6-21.8 182.7-62l259.7 259.6a8.2 8.2 0 0 0 11.6 0l43.6-43.5a8.2 8.2 0 0 0 0-11.6zM570.4 570.4C528 612.7 471.8 636 412 636s-116-23.3-158.4-65.6C211.3 528 188 471.8 188 412s23.3-116.1 65.6-158.4C296 211.3 352.2 188 412 188s116.1 23.2 158.4 65.6S636 352.2 636 412s-23.3 116.1-65.6 158.4z",fill:"currentColor"},null,-1)]))}}),pe="_configContainer_1yoz7_4",ve="_leftPanel_1yoz7_9",_e="_rightPanel_1yoz7_15",he="_searchBar_1yoz7_20",me="_cardContainer_1yoz7_25",fe="_optionCard_1yoz7_31",be="_optionCardSelected_1yoz7_36",ge="_cardContent_1yoz7_62",xe="_icon_1yoz7_67",ye="_iconSelected_1yoz7_71",ze="_footer_1yoz7_76",Ce="_footerButton_1yoz7_80",we="_container_1yoz7_85",ke="_formContainer_1yoz7_90";function Se(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!J(e)}const $e=i({name:"DeployNodeDrawer",props:{node:{type:Object,default:()=>({id:"",inputs:[],config:{provider:"",provider_id:"",inputs:{fromNodeId:"",name:""},skip:1}})}},setup(e){const{updateNode:t,updateNodeConfig:n,findApplyUploadNodesUp:a,isRefreshNode:r}=Y(),{useFormInput:l,useFormTextarea:i,useFormSelect:o}=T(),s=P(["primaryColor","borderColor"]),{handleError:c}=W(),d=R(),u=F(),p=U(),v=[{label:B("t_6_1747271296994"),value:"localhost",category:"host",icon:"ssh"},{label:B("t_5_1744958839222"),value:"ssh",category:"host",icon:"ssh"},{label:B("t_10_1745735765165"),value:"btpanel",category:"btpanel",icon:"btpanel"},{label:B("t_11_1745735766456"),value:"btpanel-site",category:"btpanel",icon:"btpanel"},{label:B("t_0_1747215751189"),value:"btwaf-site",category:"btpanel",icon:"btpanel"},{label:B("t_12_1745735765571"),value:"1panel",category:"1panel",icon:"1panel"},{label:B("t_13_1745735766084"),value:"1panel-site",category:"1panel",icon:"1panel"},{label:B("t_14_1745735766121"),value:"tencentcloud-cdn",category:"tencentcloud",icon:"tencentcloud"},{label:B("t_15_1745735768976"),value:"tencentcloud-cos",category:"tencentcloud",icon:"tencentcloud"},{label:B("t_16_1745735766712"),value:"aliyun-cdn",category:"aliyun",icon:"aliyun"},{label:B("t_2_1746697487164"),value:"aliyun-oss",category:"aliyun",icon:"aliyun"}],_=O([]),h=O(1),m=O(!0),f=O("process"),b=O("all"),g=O(""),x=O(Z(e.node.config)),y=O([{label:B("t_6_1747271296994"),value:"localhost"}]),z=w((()=>{var e;return x.value.provider?B("t_4_1746858917773")+""+(null==(e=v.find((e=>e.value===x.value.provider)))?void 0:e.label):B("t_19_1745735766810")})),C=w((()=>{let e=v;if("all"!==b.value&&(e=e.filter((e=>e.category===b.value))),g.value){const t=g.value.toLowerCase();e=e.filter((e=>e.label.toLowerCase().includes(t)||e.value.toLowerCase().includes(t)))}return e})),k=w((()=>{const e=[];switch(e.push("localhost"!==x.value.provider?{type:"custom",render:()=>V(X,{type:x.value.provider,path:"provider_id",value:x.value.provider_id,"onUpdate:value":e=>{x.value.provider_id=e.value}},null)}:o(B("t_0_1746754500246"),"provider",y.value,{disabled:!0}),o(B("t_1_1745748290291"),"inputs.fromNodeId",_.value,{onUpdateValue:(e,t)=>{x.value.inputs.fromNodeId=e,x.value.inputs.name=null==t?void 0:t.label}})),x.value.provider){case"localhost":case"ssh":e.push(l(B("t_1_1747280813656"),"certPath",{placeholder:B("t_30_1746667591892"),onInput:e=>x.value.certPath=e.trim()}),l(B("t_2_1747280811593"),"keyPath",{placeholder:B("t_31_1746667593074"),onInput:e=>x.value.keyPath=e.trim()}),i(B("t_3_1747280812067"),"beforeCmd",{placeholder:B("t_21_1745735769154"),rows:2},{showRequireMark:!1}),i(B("t_4_1747280811462"),"afterCmd",{placeholder:B("t_22_1745735767366"),rows:2},{showRequireMark:!1}));break;case"btwaf-site":case"btpanel-site":e.push(l(B("网站名"),"siteName",{placeholder:B("请输入网址名"),onInput:e=>x.value.siteName=e.trim()}));break;case"1panel-site":e.push(l(B("t_6_1747280809615"),"site_id",{placeholder:B("t_24_1745735766826"),onInput:e=>x.value.site_id=e.trim()}));break;case"tencentcloud-cdn":case"aliyun-cdn":e.push(l(B("t_17_1745227838561"),"domain",{placeholder:B("t_0_1744958839535"),onInput:e=>x.value.domain=e.trim()}));break;case"tencentcloud-cos":case"aliyun-oss":e.push(l(B("t_17_1745227838561"),"domain",{placeholder:B("t_0_1744958839535"),onInput:e=>x.value.domain=e.trim()})),e.push(l(B("t_7_1747280808936"),"region",{placeholder:B("t_25_1745735766651"),onInput:e=>x.value.region=e.trim()})),e.push(l(B("t_8_1747280809382"),"bucket",{placeholder:B("t_26_1745735767144"),onInput:e=>x.value.bucket=e.trim()}))}return e.push({type:"custom",render:()=>{let e,t;return V(E,{label:B("t_9_1747280810169"),path:"skip"},{default:()=>[V(te,null,Se(e=B("t_10_1747280816952"))?e:{default:()=>[e]}),V(A,{value:x.value.skip,"onUpdate:value":e=>x.value.skip=e,checkedValue:1,uncheckedValue:0,class:"mx-[.5rem] "},{checked:()=>B("t_11_1747280809178"),unchecked:()=>B("t_12_1747280809893")}),V(te,null,Se(t=B("t_13_1747280810369"))?t:{default:()=>[t]})]})}}),e})),S=async()=>{var t,n,r;if(!x.value.provider)return d.error(B("t_0_1746858920894"));"localhost"===x.value.provider?delete x.value.provider_id:x.value.provider_id=e.node.config.provider_id,_.value=a(e.node.id).map((e=>({label:e.name,value:e.id}))),_.value.length?(null==(t=x.value.inputs)?void 0:t.fromNodeId)||(x.value.inputs={name:(null==(n=_.value[0])?void 0:n.label)||"",fromNodeId:(null==(r=_.value[0])?void 0:r.value)||""}):d.warning(B("t_3_1745748298161")),h.value++,m.value=!1},$=()=>{h.value--,m.value=!0,x.value.provider_id="",x.value.provider=""},{component:j,example:I}=D({config:k,defaultValue:x,rules:ee}),N=async()=>{var a;try{await(null==(a=I.value)?void 0:a.validate());const l=x.value,i=l.inputs;n(e.node.id,{...l}),t(e.node.id,{inputs:[i]},!1),r.value=e.node.id,p()}catch(l){c(l)}};return L((()=>{u.value.footer=!1,u.value.area=[850,600],x.value.provider&&(e.node.inputs&&(x.value.inputs=e.node.inputs[0]),S())})),()=>{let e,t;return V("div",{class:we,style:s.value},[V(se,{size:"small",current:h.value,status:f.value},{default:()=>[V(ce,{title:B("t_28_1745735766626"),description:z.value},null),V(ce,{title:B("t_29_1745735768933"),description:B("t_2_1745738969878")},null)]}),1===h.value&&V("div",{class:pe},[V("div",{class:ve},[V(ne,{type:"bar",placement:"left",value:b.value,onUpdateValue:e=>b.value=e},{default:()=>[V(ae,{name:"all",tab:B("t_7_1747271292060")},null),V(ae,{name:"host",tab:B("t_1_1745833931535")},null),V(ae,{name:"btpanel",tab:B("t_8_1747271290414")},null),V(ae,{name:"1panel",tab:B("t_9_1747271284765")},null),V(ae,{name:"tencentcloud",tab:B("t_3_1747019616129")},null),V(ae,{name:"aliyun",tab:B("t_2_1747019616224")},null)]})]),V("div",{class:_e},[V("div",{class:he},[V(M,{value:g.value,onUpdateValue:e=>g.value=e,placeholder:B("t_14_1747280811231"),clearable:!0},{suffix:()=>V("div",{class:"flex items-center"},[V(ue,{class:"text-[var(--text-color-3)] w-[1.6rem] cursor-pointer font-bold"},null)])})]),V(q,{class:"!my-[1rem]"},null),V("div",{class:me},[C.value.map((e=>V("div",{key:e.value,class:`${fe} ${x.value.provider===e.value?be:""}`,onClick:()=>{x.value.provider=e.value}},[V("div",{class:ge},[V(K,{icon:`resources-${e.icon.replace(/-[a-z]+$/,"")}`,size:"2rem",class:`${xe} ${x.value.provider===e.value?ye:""}`},null),V(te,{type:x.value.provider===e.value?"primary":"default"},{default:()=>[e.label]})])])))])])]),2===h.value&&V(H,{class:ke},{default:()=>[V(j,{labelPlacement:"top"},null)]}),V("div",{class:ze},[V(Q,{class:Ce,onClick:p},Se(e=B("t_4_1744870861589"))?e:{default:()=>[e]}),V(G,{trigger:"hover",disabled:!!x.value.provider},{default:()=>[m.value?B("t_4_1745765868807"):null],trigger:()=>V(Q,{type:m.value?"primary":"default",class:Ce,disabled:!x.value.provider,onClick:m.value?S:$},{default:()=>[m.value?B("t_27_1745735764546"):B("t_0_1745738961258")]})}),!m.value&&V(Q,{type:"primary",onClick:N},Se(t=B("t_1_1745738963744"))?t:{default:()=>[t]})])])}}});export{$e as default};