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

2 lines
16 KiB
JavaScript
Raw Permalink 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{E as e,F as t,D as n,G as a,bz as r,aj as l,d as i,H as o,aW as s,aY as c,I as d,aM as u,K as p,bA as v,O as _,W as f,bB as h,aI as m,bC as b,ae as g,bD as y,bE as x,A as z,a$ as C,l as k,aN as w,M as S,ai as $,_ as j,a0 as I,a1 as N,a as P,f as R,bF as F,bG as U,$ as B,r as O,m as V,c as A,a5 as T,p as D,y as E,o as M,t as H,bH as L,Y as q,B as W,an as G,i as Y}from"./main-CXHt5J7o.js";import{u as K}from"./index-Dv2Y5sg_.js";import{u as J,k as Q}from"./index-BWwnYlhS.js";import{S as X}from"./index-jbOEmup6.js";import{D as Z}from"./index-BY1ypC6X.js";import{r as ee}from"./verify-COiM4qjf.js";import{a as te}from"./text-CUnLK1OQ.js";import{N as ne,a as ae}from"./Tabs-5zJbLbXc.js";import"./test-DtT5WfW6.js";import"./useStore-D9wITEfn.js";import"./useStore-CNcAvEQj.js";import"./setting-Cxpe0UON.js";import"./index-CI3N6W-E.js";import"./index-BybeMT3m.js";import"./business-D4JGqTgv.js";import"./throttle-BXA_LWlT.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 f(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=k((()=>a.vertical)),s=k((()=>{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=k((()=>{const{value:e}=s,{size:t}=a,{common:{cubicBezierEaseInOut:n},self:{stepHeaderFontWeight:l,[w("stepHeaderFontSize",t)]:i,[w("indicatorIndexFontSize",t)]:o,[w("indicatorSize",t)]:c,[w("indicatorIconSize",t)]:d,[w("indicatorTextColor",e)]:u,[w("indicatorBorderColor",e)]:p,[w("headerTextColor",e)]:v,[w("splitorColor",e)]:_,[w("indicatorColor",e)]:f,[w("descriptionTextColor",e)]:h}}=r.value;return{"--n-bezier":n,"--n-description-text-color":h,"--n-header-text-color":v,"--n-indicator-border-color":p,"--n-indicator-color":f,"--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",k((()=>{const{value:e}=s,{size:t}=a;return`${e[0]}${t[0]}`})),c,a):void 0,p=k((()=>{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=h(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:()=>h(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:()=>m(a["finish-icon"],(()=>[o(y,null)]))}):"error"===n?o(g,{clsPrefix:e,key:"error"},{default:()=>m(a["error-icon"],(()=>[o(x,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`},m(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",fe="_searchBar_1yoz7_20",he="_cardContainer_1yoz7_25",me="_optionCard_1yoz7_31",be="_optionCardSelected_1yoz7_36",ge="_cardContent_1yoz7_62",ye="_icon_1yoz7_67",xe="_iconSelected_1yoz7_71",ze="_footer_1yoz7_76",Ce="_footerButton_1yoz7_80",ke="_container_1yoz7_85",we="_formContainer_1yoz7_90";function Se(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!Y(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}=J(),{useFormInput:l,useFormTextarea:i,useFormSelect:o}=V(),s=P(["primaryColor","borderColor"]),{handleError:c}=K(),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_0_1747367069267"),value:"btpanel-dockersite",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"},{label:B("t_0_1747298114839"),value:"safeline-site",category:"safeline",icon:"safeline"},{label:B("t_1_1747298114192"),value:"safeline-panel",category:"safeline",icon:"safeline"}],_=O([]),f=O(1),h=O(!0),m=O("process"),b=O("all"),g=O(""),y=O(Q(e.node.config)),x=O([{label:B("t_6_1747271296994"),value:"localhost"}]),z=k((()=>{var e;return y.value.provider?B("t_4_1746858917773")+""+(null==(e=v.find((e=>e.value===y.value.provider)))?void 0:e.label):B("t_19_1745735766810")})),C=k((()=>{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})),w=k((()=>{const e=[];switch(e.push("localhost"!==y.value.provider?{type:"custom",render:()=>A(Z,{type:y.value.provider,path:"provider_id",value:y.value.provider_id,"onUpdate:value":e=>{y.value.provider_id=e.value}},null)}:o(B("t_0_1746754500246"),"provider",x.value,{disabled:!0}),o(B("t_1_1745748290291"),"inputs.fromNodeId",_.value,{onUpdateValue:(e,t)=>{y.value.inputs.fromNodeId=e,y.value.inputs.name=null==t?void 0:t.label}})),y.value.provider){case"localhost":case"ssh":e.push(l(B("t_1_1747280813656"),"certPath",{placeholder:B("t_30_1746667591892"),onInput:e=>y.value.certPath=e.trim()}),l(B("t_2_1747280811593"),"keyPath",{placeholder:B("t_31_1746667593074"),onInput:e=>y.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":case"btpanel-dockersite":case"safeline-site":e.push(l(B("t_0_1747296173751"),"siteName",{placeholder:B("t_1_1747296175494"),onInput:e=>y.value.siteName=e.trim()}));break;case"1panel-site":e.push(l(B("t_6_1747280809615"),"site_id",{placeholder:B("t_24_1745735766826"),onInput:e=>y.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=>y.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=>y.value.domain=e.trim()})),e.push(l(B("t_7_1747280808936"),"region",{placeholder:B("t_25_1745735766651"),onInput:e=>y.value.region=e.trim()})),e.push(l(B("t_8_1747280809382"),"bucket",{placeholder:B("t_26_1745735767144"),onInput:e=>y.value.bucket=e.trim()}))}return e.push({type:"custom",render:()=>{let e,t;return A(D,{label:B("t_9_1747280810169"),path:"skip"},{default:()=>[A(te,null,Se(e=B("t_10_1747280816952"))?e:{default:()=>[e]}),A(T,{value:y.value.skip,"onUpdate:value":e=>y.value.skip=e,checkedValue:1,uncheckedValue:0,class:"mx-[.5rem] "},{checked:()=>B("t_11_1747280809178"),unchecked:()=>B("t_12_1747280809893")}),A(te,null,Se(t=B("t_13_1747280810369"))?t:{default:()=>[t]})]})}}),e})),S=async()=>{var t,n,r;if(!y.value.provider)return d.error(B("t_0_1746858920894"));"localhost"===y.value.provider?delete y.value.provider_id:y.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=y.value.inputs)?void 0:t.fromNodeId)||(y.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")),f.value++,h.value=!1},$=()=>{f.value--,h.value=!0,y.value.provider_id="",y.value.provider=""},{component:j,example:I}=E({config:w,defaultValue:y,rules:ee}),N=async()=>{var a;try{await(null==(a=I.value)?void 0:a.validate());const l=y.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 M((()=>{u.value.footer=!1,u.value.area=[850,600],y.value.provider&&(e.node.inputs&&(y.value.inputs=e.node.inputs[0]),S())})),()=>{let e,t;return A("div",{class:ke,style:s.value},[A(se,{size:"small",current:f.value,status:m.value},{default:()=>[A(ce,{title:B("t_28_1745735766626"),description:z.value},null),A(ce,{title:B("t_29_1745735768933"),description:B("t_2_1745738969878")},null)]}),1===f.value&&A("div",{class:pe},[A("div",{class:ve},[A(ne,{type:"bar",placement:"left",value:b.value,onUpdateValue:e=>b.value=e},{default:()=>[A(ae,{name:"all",tab:B("t_7_1747271292060")},null),A(ae,{name:"host",tab:B("t_1_1745833931535")},null),A(ae,{name:"btpanel",tab:B("t_8_1747271290414")},null),A(ae,{name:"1panel",tab:B("t_9_1747271284765")},null),A(ae,{name:"tencentcloud",tab:B("t_3_1747019616129")},null),A(ae,{name:"aliyun",tab:B("t_2_1747019616224")},null),A(ae,{name:"safeline",tab:B("t_1_1747298114192")},null)]})]),A("div",{class:_e},[A("div",{class:fe},[A(H,{value:g.value,onUpdateValue:e=>g.value=e,placeholder:B("t_14_1747280811231"),clearable:!0},{suffix:()=>A("div",{class:"flex items-center"},[A(ue,{class:"text-[var(--text-color-3)] w-[1.6rem] cursor-pointer font-bold"},null)])})]),A(L,{class:"!my-[1rem]"},null),A("div",{class:he},[C.value.map((e=>A("div",{key:e.value,class:`${me} ${y.value.provider===e.value?be:""}`,onClick:()=>{y.value.provider=e.value}},[A("div",{class:ge},[A(X,{icon:`resources-${e.icon.replace(/-[a-z]+$/,"")}`,size:"2rem",class:`${ye} ${y.value.provider===e.value?xe:""}`},null),A(te,{type:y.value.provider===e.value?"primary":"default"},{default:()=>[e.label]})])])))])])]),2===f.value&&A(q,{class:we},{default:()=>[A(j,{labelPlacement:"top"},null)]}),A("div",{class:ze},[A(W,{class:Ce,onClick:p},Se(e=B("t_4_1744870861589"))?e:{default:()=>[e]}),A(G,{trigger:"hover",disabled:!!y.value.provider},{default:()=>[h.value?B("t_4_1745765868807"):null],trigger:()=>A(W,{type:h.value?"primary":"default",class:Ce,disabled:!y.value.provider,onClick:h.value?S:$},{default:()=>[h.value?B("t_27_1745735764546"):B("t_0_1745738961258")]})}),!h.value&&A(W,{type:"primary",onClick:N},Se(t=B("t_1_1745738963744"))?t:{default:()=>[t]})])])}}});export{$e as default};