mirror of https://github.com/allinssl/allinssl
2 lines
42 KiB
JavaScript
2 lines
42 KiB
JavaScript
import{A as e,C as t,l as n,D as o,E as r,F as i,G as l,d as a,H as s,I as c,r as u,o as d,x as g,J as h,K as f,L as p,M as m,O as b,P as w,Q as y,R as v,S as _,T as x,U as k,V as E,W as j,X as R,e as S,s as N,$ as O,c as T,p as C,j as M,Y as L,Z as $,i as A,B,_ as H,a0 as z,a1 as I,a as P,a2 as W,a3 as D,a4 as F,u as U,g as q,h as V,a5 as G,N as X,k as K,m as Z,y as J,z as Y,a6 as Q,a7 as ee,t as te}from"./main-DxBfl9jt.js";import{g as ne,a as oe,u as re,e as ie,b as le,d as ae,c as se,f as ce}from"./useStore-mdB8rUuJ.js";import{u as ue,g as de,N as ge,a as he}from"./index-BVkzzSq5.js";import{B as fe}from"./index-DLxP8kM6.js";import{t as pe}from"./throttle-CAtYuFBS.js";import{a as me,u as be}from"./index-Cw7KyqX3.js";import{E as we,S as ye,P as ve}from"./index-DL3P7MQx.js";function _e(o,r){const i=e(t,null);return n((()=>o.hljs||(null==i?void 0:i.mergedHljsRef.value)))}const xe=o([r("code","\n font-size: var(--n-font-size);\n font-family: var(--n-font-family);\n ",[i("show-line-numbers","\n display: flex;\n "),l("line-numbers","\n user-select: none;\n padding-right: 12px;\n text-align: right;\n transition: color .3s var(--n-bezier);\n color: var(--n-line-number-text-color);\n "),i("word-wrap",[o("pre","\n white-space: pre-wrap;\n word-break: break-all;\n ")]),o("pre","\n margin: 0;\n line-height: inherit;\n font-size: inherit;\n font-family: inherit;\n "),o("[class^=hljs]","\n color: var(--n-text-color);\n transition: \n color .3s var(--n-bezier),\n background-color .3s var(--n-bezier);\n ")]),({props:e})=>{const t=`${e.bPrefix}code`;return[`${t} .hljs-comment,\n ${t} .hljs-quote {\n color: var(--n-mono-3);\n font-style: italic;\n }`,`${t} .hljs-doctag,\n ${t} .hljs-keyword,\n ${t} .hljs-formula {\n color: var(--n-hue-3);\n }`,`${t} .hljs-section,\n ${t} .hljs-name,\n ${t} .hljs-selector-tag,\n ${t} .hljs-deletion,\n ${t} .hljs-subst {\n color: var(--n-hue-5);\n }`,`${t} .hljs-literal {\n color: var(--n-hue-1);\n }`,`${t} .hljs-string,\n ${t} .hljs-regexp,\n ${t} .hljs-addition,\n ${t} .hljs-attribute,\n ${t} .hljs-meta-string {\n color: var(--n-hue-4);\n }`,`${t} .hljs-built_in,\n ${t} .hljs-class .hljs-title {\n color: var(--n-hue-6-2);\n }`,`${t} .hljs-attr,\n ${t} .hljs-variable,\n ${t} .hljs-template-variable,\n ${t} .hljs-type,\n ${t} .hljs-selector-class,\n ${t} .hljs-selector-attr,\n ${t} .hljs-selector-pseudo,\n ${t} .hljs-number {\n color: var(--n-hue-6);\n }`,`${t} .hljs-symbol,\n ${t} .hljs-bullet,\n ${t} .hljs-link,\n ${t} .hljs-meta,\n ${t} .hljs-selector-id,\n ${t} .hljs-title {\n color: var(--n-hue-2);\n }`,`${t} .hljs-emphasis {\n font-style: italic;\n }`,`${t} .hljs-strong {\n font-weight: var(--n-font-weight-strong);\n }`,`${t} .hljs-link {\n text-decoration: underline;\n }`]}]),ke=a({name:"Code",props:Object.assign(Object.assign({},f.props),{language:String,code:{type:String,default:""},trim:{type:Boolean,default:!0},hljs:Object,uri:Boolean,inline:Boolean,wordWrap:Boolean,showLineNumbers:Boolean,internalFontSize:Number,internalNoHighlight:Boolean}),setup(e,{slots:t}){const{internalNoHighlight:o}=e,{mergedClsPrefixRef:r,inlineThemeDisabled:i}=c(),l=u(null),a=o?{value:void 0}:_e(e),s=n((()=>!e.inline&&!e.wordWrap&&e.showLineNumbers)),b=()=>{if(t.default)return;const{value:n}=l;if(!n)return;const{language:o}=e,r=e.uri?window.decodeURIComponent(e.code):e.code;if(o){const t=((e,t,n)=>{const{value:o}=a;return o&&e&&o.getLanguage(e)?o.highlight(n?t.trim():t,{language:e}).value:null})(o,r,e.trim);if(null!==t){if(e.inline)n.innerHTML=t;else{const e=n.querySelector(".__code__");e&&n.removeChild(e);const o=document.createElement("pre");o.className="__code__",o.innerHTML=t,n.appendChild(o)}return}}if(e.inline)return void(n.textContent=r);const i=n.querySelector(".__code__");if(i)i.textContent=r;else{const e=document.createElement("pre");e.className="__code__",e.textContent=r,n.innerHTML="",n.appendChild(e)}};d(b),g(h(e,"language"),b),g(h(e,"code"),b),o||g(a,b);const w=f("Code","-code",xe,p,e,r),y=n((()=>{const{common:{cubicBezierEaseInOut:t,fontFamilyMono:n},self:{textColor:o,fontSize:r,fontWeightStrong:i,lineNumberTextColor:l,"mono-3":a,"hue-1":s,"hue-2":c,"hue-3":u,"hue-4":d,"hue-5":g,"hue-5-2":h,"hue-6":f,"hue-6-2":p}}=w.value,{internalFontSize:m}=e;return{"--n-font-size":m?`${m}px`:r,"--n-font-family":n,"--n-font-weight-strong":i,"--n-bezier":t,"--n-text-color":o,"--n-mono-3":a,"--n-hue-1":s,"--n-hue-2":c,"--n-hue-3":u,"--n-hue-4":d,"--n-hue-5":g,"--n-hue-5-2":h,"--n-hue-6":f,"--n-hue-6-2":p,"--n-line-number-text-color":l}})),v=i?m("code",n((()=>`${e.internalFontSize||"a"}`)),y,e):void 0;return{mergedClsPrefix:r,codeRef:l,mergedShowLineNumbers:s,lineNumbers:n((()=>{let t=1;const n=[];let o=!1;for(const r of e.code)"\n"===r?(o=!0,n.push(t++)):o=!1;return o||n.push(t++),n.join("\n")})),cssVars:i?void 0:y,themeClass:null==v?void 0:v.themeClass,onRender:null==v?void 0:v.onRender}},render(){var e,t;const{mergedClsPrefix:n,wordWrap:o,mergedShowLineNumbers:r,onRender:i}=this;return null==i||i(),s("code",{class:[`${n}-code`,this.themeClass,o&&`${n}-code--word-wrap`,r&&`${n}-code--show-line-numbers`],style:this.cssVars,ref:"codeRef"},r?s("pre",{class:`${n}-code__line-numbers`},this.lineNumbers):null,null===(t=(e=this.$slots).default)||void 0===t?void 0:t.call(e))}}),Ee=b("n-log"),je=a({props:{line:{type:String,default:""}},setup(t){const{trimRef:o,highlightRef:r,languageRef:i,mergedHljsRef:l}=e(Ee),a=u(null),s=n((()=>o.value?t.line.trim():t.line));function c(){a.value&&(a.value.innerHTML=function(e,t){const{value:n}=l;if(n&&e&&n.getLanguage(e))return n.highlight(t,{language:e}).value;return t}(i.value,s.value))}return d((()=>{r.value&&c()})),g(h(t,"line"),(()=>{r.value&&c()})),{highlight:r,selfRef:a,maybeTrimmedLines:s}},render(){const{highlight:e,maybeTrimmedLines:t}=this;return s("pre",{ref:"selfRef"},e?null:t)}}),Re=a({name:"LogLoader",props:{clsPrefix:{type:String,required:!0}},setup:()=>({locale:y("Log").localeRef}),render(){const{clsPrefix:e}=this;return s("div",{class:`${e}-log-loader`},s(w,{clsPrefix:e,strokeWidth:24,scale:.85}),s("span",{class:`${e}-log-loader__content`},this.locale.loading))}}),Se=r("log","\n position: relative;\n box-sizing: border-box;\n transition: border-color .3s var(--n-bezier);\n",[o("pre","\n white-space: pre-wrap;\n word-break: break-word;\n margin: 0;\n "),r("log-loader","\n transition:\n color .3s var(--n-bezier),\n background-color .3s var(--n-bezier),\n border-color .3s var(--n-bezier);\n box-sizing: border-box;\n position: absolute;\n right: 16px;\n top: 8px;\n height: 34px;\n border-radius: 17px;\n line-height: 34px;\n white-space: nowrap;\n overflow: hidden;\n border: var(--n-loader-border);\n color: var(--n-loader-text-color);\n background-color: var(--n-loader-color);\n font-size: var(--n-loader-font-size);\n ",[v(),l("content","\n display: inline-block;\n vertical-align: bottom;\n line-height: 34px;\n padding-left: 40px;\n padding-right: 20px;\n white-space: nowrap;\n "),r("base-loading","\n color: var(--n-loading-color);\n position: absolute;\n left: 12px;\n top: calc(50% - 10px);\n font-size: 20px;\n width: 20px;\n height: 20px;\n display: inline-block;\n ")])]),Ne=a({name:"Log",props:Object.assign(Object.assign({},f.props),{loading:Boolean,trim:Boolean,log:String,fontSize:{type:Number,default:14},lines:{type:Array,default:()=>[]},lineHeight:{type:Number,default:1.25},language:String,rows:{type:Number,default:15},offsetTop:{type:Number,default:0},offsetBottom:{type:Number,default:0},hljs:Object,onReachTop:Function,onReachBottom:Function,onRequireMore:Function}),setup(e){const{mergedClsPrefixRef:t,inlineThemeDisabled:o}=c(e),r=u(!1),i=n((()=>void 0!==e.language)),l=n((()=>`calc(${Math.round(e.rows*e.lineHeight*e.fontSize)}px)`)),a=n((()=>{const{log:t}=e;return t?t.split("\n"):e.lines})),s=u(null),d=f("Log","-log",Se,k,e,t);const g=pe((function(t){if(r.value)return void E((()=>{r.value=!1}));if(s.value){const{containerRef:n,contentRef:o}=s.value;if(n&&o){const r=n.offsetHeight,i=n.scrollTop,l=i,a=o.offsetHeight-i-r,s=t.deltaY;if(0===l&&s<0){const{onRequireMore:t}=e;t&&t("top")}if(a<=0&&s>0){const{onRequireMore:t}=e;t&&t("bottom")}}}}),300);function p(e){const{value:t}=s;if(!t)return;const{silent:n,top:o,position:i}=e;n&&(r.value=!0),void 0!==o?t.scrollTo({left:0,top:o}):"bottom"!==i&&"top"!==i||t.scrollTo({position:i})}j(Ee,{languageRef:h(e,"language"),mergedHljsRef:_e(e),trimRef:h(e,"trim"),highlightRef:i});const b={scrollTo:p},w=n((()=>{const{self:{loaderFontSize:e,loaderTextColor:t,loaderColor:n,loaderBorder:o,loadingColor:r},common:{cubicBezierEaseInOut:i}}=d.value;return{"--n-bezier":i,"--n-loader-font-size":e,"--n-loader-border":o,"--n-loader-color":n,"--n-loader-text-color":t,"--n-loading-color":r}})),y=o?m("log",void 0,w,e):void 0;return Object.assign(Object.assign({},b),{mergedClsPrefix:t,scrollbarRef:s,mergedTheme:d,styleHeight:l,mergedLines:a,scrollToTop:function(e=!1){R("log","`scrollToTop` is deprecated, please use `scrollTo({ position: 'top'})` instead."),p({position:"top",silent:e})},scrollToBottom:function(e=!1){R("log","`scrollToTop` is deprecated, please use `scrollTo({ position: 'bottom'})` instead."),p({position:"bottom",silent:e})},handleWheel:g,handleScroll:function(t){const n=t.target,o=n.firstElementChild;if(r.value)return void E((()=>{r.value=!1}));const i=n.offsetHeight,l=n.scrollTop,a=o.offsetHeight-l-i;if(l<=e.offsetTop){const{onReachTop:t,onRequireMore:n}=e;n&&n("top"),t&&t()}if(a<=e.offsetBottom){const{onReachBottom:t,onRequireMore:n}=e;n&&n("bottom"),t&&t()}},cssVars:o?void 0:w,themeClass:null==y?void 0:y.themeClass,onRender:null==y?void 0:y.onRender})},render(){const{mergedClsPrefix:e,mergedTheme:t,onRender:n}=this;return null==n||n(),s("div",{class:[`${e}-log`,this.themeClass],style:[{lineHeight:this.lineHeight,height:this.styleHeight},this.cssVars],onWheelPassive:this.handleWheel},[s(_,{ref:"scrollbarRef",theme:t.peers.Scrollbar,themeOverrides:t.peerOverrides.Scrollbar,onScroll:this.handleScroll},{default:()=>s(ke,{internalNoHighlight:!0,internalFontSize:this.fontSize,theme:t.peers.Code,themeOverrides:t.peerOverrides.Code},{default:()=>this.mergedLines.map(((e,t)=>s(je,{key:t,line:e})))})}),s(x,{name:"fade-in-scale-up-transition"},{default:()=>this.loading?s(Re,{clsPrefix:e}):null})])}}),{handleError:Oe}=ue(),Te=S("workflow-store",(()=>({refreshTable:u(!1),isEditWorkFlow:u(!1),workflowFormData:u({name:"",templateType:"quick"}),workflowTemplateOptions:u([{label:"快速部署模板",value:"quick",description:"快速上线应用,简化流程"},{label:"高级自定义模板",value:"advanced",description:"完全自定义的部署流程"}]),fetchWorkflowList:async({p:e,limit:t,search:n})=>{try{const{data:o,count:r}=await ne({p:e,limit:t,search:n}).fetch();return{list:o||[],total:r}}catch(o){return Oe(o),{list:[],total:0}}},fetchWorkflowHistory:async({id:e,p:t,limit:n})=>{try{const o=await oe({id:e,p:t,limit:n}).fetch();return{list:o.data||[],total:o.count}}catch(o){return Oe(o),{list:[],total:0}}},deleteExistingWorkflow:async e=>{try{const{message:t,fetch:n}=ae({id:e.toString()});t.value=!0,await n()}catch(t){Oe(t).default(O("t_14_1745457488092"))}},executeExistingWorkflow:async e=>{try{const{message:t,fetch:n}=le({id:e});t.value=!0,await n()}catch(t){Oe(t).default(O("t_13_1745457487555"))}},setWorkflowActive:async({id:e,active:t})=>{try{const{message:n,fetch:o}=ie({id:e,active:t});n.value=!0,await o()}catch(n){Oe(n).default(O("t_12_1745457489076"))}},setWorkflowExecType:async({id:e,exec_type:t})=>{try{const{message:n,fetch:o}=re({id:e,exec_type:t});n.value=!0,await o()}catch(n){Oe(n).default(O("t_11_1745457488256"))}}}))),Ce=()=>{const e=Te();return{...e,...N(e)}};const Me=a({name:"AddWorkflowModal",setup(){const{workflowTemplateOptions:e,workflowFormData:t}=Ce(),{AddWorkflowForm:n}=at();return()=>T(L,{bordered:!1,class:"shadow-none","content-class":"!p-[10px]"},{default:()=>[T(n,{labelPlacement:"top",labelWidth:100},{template:()=>{let n;return T(C,{label:O("t_0_1745474945127"),required:!0},{default:()=>{return[T(M,{vertical:!0,class:"flex !flex-row "},(o=n=e.value.map((e=>T("div",{key:e.value,class:"cursor-pointer transition-all duration-300 ",onClick:()=>{t.value.templateType=e.value}},[T(L,{class:"rounded-lg border-1 "+(t.value.templateType===e.value?"border-primary-500":""),hoverable:!0},{default:()=>[T(M,{align:"center",justify:"space-between"},{default:()=>[T("div",null,[T("div",{class:"font-medium text-[14px]"},[e.label]),T("div",{class:"text-gray-500 text-[12px] mt-1"},[e.description])]),T($,{checked:t.value.templateType===e.value},null)]})]})]))),"function"==typeof o||"[object Object]"===Object.prototype.toString.call(o)&&!A(o)?n:{default:()=>[n]}))];var o}})}})]})}});const Le=a({name:"HistoryModal",props:{id:{type:String,required:!0}},setup(e){const{WorkflowHistoryTable:t,WorkflowHistoryTablePage:n,fetch:o}=st(e.id);return d((()=>{o()})),()=>T("div",{class:"flex w-full"},[T(fe,null,{header:()=>{let e;return T("div",{class:"flex items-center justify-between mb-[1.6rem]"},[T(B,{type:"primary",onClick:()=>o()},(t=e=O("t_9_1746667589516"),"function"==typeof t||"[object Object]"===Object.prototype.toString.call(t)&&!A(t)?e:{default:()=>[e]}))]);var t},content:()=>T(t,null,null),footerRight:()=>T(n,null,null)})])}});var $e,Ae;function Be(){if(Ae)return $e;function e(t){return t instanceof Map?t.clear=t.delete=t.set=function(){throw new Error("map is read-only")}:t instanceof Set&&(t.add=t.clear=t.delete=function(){throw new Error("set is read-only")}),Object.freeze(t),Object.getOwnPropertyNames(t).forEach((n=>{const o=t[n],r=typeof o;"object"!==r&&"function"!==r||Object.isFrozen(o)||e(o)})),t}Ae=1;class t{constructor(e){void 0===e.data&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function n(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function o(e,...t){const n=Object.create(null);for(const o in e)n[o]=e[o];return t.forEach((function(e){for(const t in e)n[t]=e[t]})),n}const r=e=>!!e.scope;class i{constructor(e,t){this.buffer="",this.classPrefix=t.classPrefix,e.walk(this)}addText(e){this.buffer+=n(e)}openNode(e){if(!r(e))return;const t=((e,{prefix:t})=>{if(e.startsWith("language:"))return e.replace("language:","language-");if(e.includes(".")){const n=e.split(".");return[`${t}${n.shift()}`,...n.map(((e,t)=>`${e}${"_".repeat(t+1)}`))].join(" ")}return`${t}${e}`})(e.scope,{prefix:this.classPrefix});this.span(t)}closeNode(e){r(e)&&(this.buffer+="</span>")}value(){return this.buffer}span(e){this.buffer+=`<span class="${e}">`}}const l=(e={})=>{const t={children:[]};return Object.assign(t,e),t};class a{constructor(){this.rootNode=l(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){const t=l({scope:e});this.add(t),this.stack.push(t)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,t){return"string"==typeof t?e.addText(t):t.children&&(e.openNode(t),t.children.forEach((t=>this._walk(e,t))),e.closeNode(t)),e}static _collapse(e){"string"!=typeof e&&e.children&&(e.children.every((e=>"string"==typeof e))?e.children=[e.children.join("")]:e.children.forEach((e=>{a._collapse(e)})))}}class s extends a{constructor(e){super(),this.options=e}addText(e){""!==e&&this.add(e)}startScope(e){this.openNode(e)}endScope(){this.closeNode()}__addSublanguage(e,t){const n=e.root;t&&(n.scope=`language:${t}`),this.add(n)}toHTML(){return new i(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function c(e){return e?"string"==typeof e?e:e.source:null}function u(e){return h("(?=",e,")")}function d(e){return h("(?:",e,")*")}function g(e){return h("(?:",e,")?")}function h(...e){return e.map((e=>c(e))).join("")}function f(...e){const t=function(e){const t=e[e.length-1];return"object"==typeof t&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}(e);return"("+(t.capture?"":"?:")+e.map((e=>c(e))).join("|")+")"}function p(e){return new RegExp(e.toString()+"|").exec("").length-1}const m=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function b(e,{joinWith:t}){let n=0;return e.map((e=>{n+=1;const t=n;let o=c(e),r="";for(;o.length>0;){const e=m.exec(o);if(!e){r+=o;break}r+=o.substring(0,e.index),o=o.substring(e.index+e[0].length),"\\"===e[0][0]&&e[1]?r+="\\"+String(Number(e[1])+t):(r+=e[0],"("===e[0]&&n++)}return r})).map((e=>`(${e})`)).join(t)}const w="[a-zA-Z]\\w*",y="[a-zA-Z_]\\w*",v="\\b\\d+(\\.\\d+)?",_="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",x="\\b(0b[01]+)",k={begin:"\\\\[\\s\\S]",relevance:0},E={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[k]},j={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[k]},R=function(e,t,n={}){const r=o({scope:"comment",begin:e,end:t,contains:[]},n);r.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const i=f("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return r.contains.push({begin:h(/[ ]+/,"(",i,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),r},S=R("//","$"),N=R("/\\*","\\*/"),O=R("#","$"),T={scope:"number",begin:v,relevance:0},C={scope:"number",begin:_,relevance:0},M={scope:"number",begin:x,relevance:0},L={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[k,{begin:/\[/,end:/\]/,relevance:0,contains:[k]}]},$={scope:"title",begin:w,relevance:0},A={scope:"title",begin:y,relevance:0},B={begin:"\\.\\s*"+y,relevance:0};var H=Object.freeze({__proto__:null,APOS_STRING_MODE:E,BACKSLASH_ESCAPE:k,BINARY_NUMBER_MODE:M,BINARY_NUMBER_RE:x,COMMENT:R,C_BLOCK_COMMENT_MODE:N,C_LINE_COMMENT_MODE:S,C_NUMBER_MODE:C,C_NUMBER_RE:_,END_SAME_AS_BEGIN:function(e){return Object.assign(e,{"on:begin":(e,t)=>{t.data._beginMatch=e[1]},"on:end":(e,t)=>{t.data._beginMatch!==e[1]&&t.ignoreMatch()}})},HASH_COMMENT_MODE:O,IDENT_RE:w,MATCH_NOTHING_RE:/\b\B/,METHOD_GUARD:B,NUMBER_MODE:T,NUMBER_RE:v,PHRASAL_WORDS_MODE:{begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},QUOTE_STRING_MODE:j,REGEXP_MODE:L,RE_STARTERS_RE:"!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",SHEBANG:(e={})=>{const t=/^#![ ]*\//;return e.binary&&(e.begin=h(t,/.*\b/,e.binary,/\b.*/)),o({scope:"meta",begin:t,end:/$/,relevance:0,"on:begin":(e,t)=>{0!==e.index&&t.ignoreMatch()}},e)},TITLE_MODE:$,UNDERSCORE_IDENT_RE:y,UNDERSCORE_TITLE_MODE:A});function z(e,t){"."===e.input[e.index-1]&&t.ignoreMatch()}function I(e,t){void 0!==e.className&&(e.scope=e.className,delete e.className)}function P(e,t){t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=z,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,void 0===e.relevance&&(e.relevance=0))}function W(e,t){Array.isArray(e.illegal)&&(e.illegal=f(...e.illegal))}function D(e,t){if(e.match){if(e.begin||e.end)throw new Error("begin & end are not supported with match");e.begin=e.match,delete e.match}}function F(e,t){void 0===e.relevance&&(e.relevance=1)}const U=(e,t)=>{if(!e.beforeMatch)return;if(e.starts)throw new Error("beforeMatch cannot be used with starts");const n=Object.assign({},e);Object.keys(e).forEach((t=>{delete e[t]})),e.keywords=n.keywords,e.begin=h(n.beforeMatch,u(n.begin)),e.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},e.relevance=0,delete n.beforeMatch},q=["of","and","for","in","not","or","if","then","parent","list","value"];function V(e,t,n="keyword"){const o=Object.create(null);return"string"==typeof e?r(n,e.split(" ")):Array.isArray(e)?r(n,e):Object.keys(e).forEach((function(n){Object.assign(o,V(e[n],t,n))})),o;function r(e,n){t&&(n=n.map((e=>e.toLowerCase()))),n.forEach((function(t){const n=t.split("|");o[n[0]]=[e,G(n[0],n[1])]}))}}function G(e,t){return t?Number(t):function(e){return q.includes(e.toLowerCase())}(e)?0:1}const X={},K=(e,t)=>{X[`${e}/${t}`]||(X[`${e}/${t}`]=!0)},Z=new Error;function J(e,t,{key:n}){let o=0;const r=e[n],i={},l={};for(let a=1;a<=t.length;a++)l[a+o]=r[a],i[a+o]=!0,o+=p(t[a-1]);e[n]=l,e[n]._emit=i,e[n]._multi=!0}function Y(e){!function(e){e.scope&&"object"==typeof e.scope&&null!==e.scope&&(e.beginScope=e.scope,delete e.scope)}(e),"string"==typeof e.beginScope&&(e.beginScope={_wrap:e.beginScope}),"string"==typeof e.endScope&&(e.endScope={_wrap:e.endScope}),function(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw Z;if("object"!=typeof e.beginScope||null===e.beginScope)throw Z;J(e,e.begin,{key:"beginScope"}),e.begin=b(e.begin,{joinWith:""})}}(e),function(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw Z;if("object"!=typeof e.endScope||null===e.endScope)throw Z;J(e,e.end,{key:"endScope"}),e.end=b(e.end,{joinWith:""})}}(e)}function Q(e){function t(t,n){return new RegExp(c(t),"m"+(e.case_insensitive?"i":"")+(e.unicodeRegex?"u":"")+(n?"g":""))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(e,t){t.position=this.position++,this.matchIndexes[this.matchAt]=t,this.regexes.push([t,e]),this.matchAt+=p(e)+1}compile(){0===this.regexes.length&&(this.exec=()=>null);const e=this.regexes.map((e=>e[1]));this.matcherRe=t(b(e,{joinWith:"|"}),!0),this.lastIndex=0}exec(e){this.matcherRe.lastIndex=this.lastIndex;const t=this.matcherRe.exec(e);if(!t)return null;const n=t.findIndex(((e,t)=>t>0&&void 0!==e)),o=this.matchIndexes[n];return t.splice(0,n),Object.assign(t,o)}}class r{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(e){if(this.multiRegexes[e])return this.multiRegexes[e];const t=new n;return this.rules.slice(e).forEach((([e,n])=>t.addRule(e,n))),t.compile(),this.multiRegexes[e]=t,t}resumingScanAtSamePosition(){return 0!==this.regexIndex}considerAll(){this.regexIndex=0}addRule(e,t){this.rules.push([e,t]),"begin"===t.type&&this.count++}exec(e){const t=this.getMatcher(this.regexIndex);t.lastIndex=this.lastIndex;let n=t.exec(e);if(this.resumingScanAtSamePosition())if(n&&n.index===this.lastIndex);else{const t=this.getMatcher(0);t.lastIndex=this.lastIndex+1,n=t.exec(e)}return n&&(this.regexIndex+=n.position+1,this.regexIndex===this.count&&this.considerAll()),n}}if(e.compilerExtensions||(e.compilerExtensions=[]),e.contains&&e.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=o(e.classNameAliases||{}),function n(i,l){const a=i;if(i.isCompiled)return a;[I,D,Y,U].forEach((e=>e(i,l))),e.compilerExtensions.forEach((e=>e(i,l))),i.__beforeBegin=null,[P,W,F].forEach((e=>e(i,l))),i.isCompiled=!0;let s=null;return"object"==typeof i.keywords&&i.keywords.$pattern&&(i.keywords=Object.assign({},i.keywords),s=i.keywords.$pattern,delete i.keywords.$pattern),s=s||/\w+/,i.keywords&&(i.keywords=V(i.keywords,e.case_insensitive)),a.keywordPatternRe=t(s,!0),l&&(i.begin||(i.begin=/\B|\b/),a.beginRe=t(a.begin),i.end||i.endsWithParent||(i.end=/\B|\b/),i.end&&(a.endRe=t(a.end)),a.terminatorEnd=c(a.end)||"",i.endsWithParent&&l.terminatorEnd&&(a.terminatorEnd+=(i.end?"|":"")+l.terminatorEnd)),i.illegal&&(a.illegalRe=t(i.illegal)),i.contains||(i.contains=[]),i.contains=[].concat(...i.contains.map((function(e){return function(e){e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map((function(t){return o(e,{variants:null},t)})));if(e.cachedVariants)return e.cachedVariants;if(ee(e))return o(e,{starts:e.starts?o(e.starts):null});if(Object.isFrozen(e))return o(e);return e}("self"===e?i:e)}))),i.contains.forEach((function(e){n(e,a)})),i.starts&&n(i.starts,l),a.matcher=function(e){const t=new r;return e.contains.forEach((e=>t.addRule(e.begin,{rule:e,type:"begin"}))),e.terminatorEnd&&t.addRule(e.terminatorEnd,{type:"end"}),e.illegal&&t.addRule(e.illegal,{type:"illegal"}),t}(a),a}(e)}function ee(e){return!!e&&(e.endsWithParent||ee(e.starts))}class te extends Error{constructor(e,t){super(e),this.name="HTMLInjectionError",this.html=t}}const ne=n,oe=o,re=Symbol("nomatch"),ie=function(n){const o=Object.create(null),r=Object.create(null),i=[];let l=!0;const a="Could not find the language '{}', did you forget to load/include a language module?",c={disableAutodetect:!0,name:"Plain text",contains:[]};let p={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:s};function m(e){return p.noHighlightRe.test(e)}function b(e,t,n){let o="",r="";"object"==typeof t?(o=e,n=t.ignoreIllegals,r=t.language):(K("10.7.0","highlight(lang, code, ...args) has been deprecated."),K("10.7.0","Please use highlight(code, options) instead.\nhttps://github.com/highlightjs/highlight.js/issues/2277"),r=e,o=t),void 0===n&&(n=!0);const i={code:o,language:r};R("before:highlight",i);const l=i.result?i.result:w(i.language,i.code,n);return l.code=i.code,R("after:highlight",l),l}function w(e,n,r,i){const s=Object.create(null);function c(){if(!R.keywords)return void N.addText(O);let e=0;R.keywordPatternRe.lastIndex=0;let t=R.keywordPatternRe.exec(O),n="";for(;t;){n+=O.substring(e,t.index);const r=x.case_insensitive?t[0].toLowerCase():t[0],i=(o=r,R.keywords[o]);if(i){const[e,o]=i;if(N.addText(n),n="",s[r]=(s[r]||0)+1,s[r]<=7&&(T+=o),e.startsWith("_"))n+=t[0];else{const n=x.classNameAliases[e]||e;d(t[0],n)}}else n+=t[0];e=R.keywordPatternRe.lastIndex,t=R.keywordPatternRe.exec(O)}var o;n+=O.substring(e),N.addText(n)}function u(){null!=R.subLanguage?function(){if(""===O)return;let e=null;if("string"==typeof R.subLanguage){if(!o[R.subLanguage])return void N.addText(O);e=w(R.subLanguage,O,!0,S[R.subLanguage]),S[R.subLanguage]=e._top}else e=y(O,R.subLanguage.length?R.subLanguage:null);R.relevance>0&&(T+=e.relevance),N.__addSublanguage(e._emitter,e.language)}():c(),O=""}function d(e,t){""!==e&&(N.startScope(t),N.addText(e),N.endScope())}function g(e,t){let n=1;const o=t.length-1;for(;n<=o;){if(!e._emit[n]){n++;continue}const o=x.classNameAliases[e[n]]||e[n],r=t[n];o?d(r,o):(O=r,c(),O=""),n++}}function h(e,t){return e.scope&&"string"==typeof e.scope&&N.openNode(x.classNameAliases[e.scope]||e.scope),e.beginScope&&(e.beginScope._wrap?(d(O,x.classNameAliases[e.beginScope._wrap]||e.beginScope._wrap),O=""):e.beginScope._multi&&(g(e.beginScope,t),O="")),R=Object.create(e,{parent:{value:R}}),R}function f(e,n,o){let r=function(e,t){const n=e&&e.exec(t);return n&&0===n.index}(e.endRe,o);if(r){if(e["on:end"]){const o=new t(e);e["on:end"](n,o),o.isMatchIgnored&&(r=!1)}if(r){for(;e.endsParent&&e.parent;)e=e.parent;return e}}if(e.endsWithParent)return f(e.parent,n,o)}function m(e){return 0===R.matcher.regexIndex?(O+=e[0],1):(L=!0,0)}function b(e){const t=e[0],o=n.substring(e.index),r=f(R,e,o);if(!r)return re;const i=R;R.endScope&&R.endScope._wrap?(u(),d(t,R.endScope._wrap)):R.endScope&&R.endScope._multi?(u(),g(R.endScope,e)):i.skip?O+=t:(i.returnEnd||i.excludeEnd||(O+=t),u(),i.excludeEnd&&(O=t));do{R.scope&&N.closeNode(),R.skip||R.subLanguage||(T+=R.relevance),R=R.parent}while(R!==r.parent);return r.starts&&h(r.starts,e),i.returnEnd?0:t.length}let v={};function _(o,i){const a=i&&i[0];if(O+=o,null==a)return u(),0;if("begin"===v.type&&"end"===i.type&&v.index===i.index&&""===a){if(O+=n.slice(i.index,i.index+1),!l){const t=new Error(`0 width match regex (${e})`);throw t.languageName=e,t.badRule=v.rule,t}return 1}if(v=i,"begin"===i.type)return function(e){const n=e[0],o=e.rule,r=new t(o),i=[o.__beforeBegin,o["on:begin"]];for(const t of i)if(t&&(t(e,r),r.isMatchIgnored))return m(n);return o.skip?O+=n:(o.excludeBegin&&(O+=n),u(),o.returnBegin||o.excludeBegin||(O=n)),h(o,e),o.returnBegin?0:n.length}(i);if("illegal"===i.type&&!r){const e=new Error('Illegal lexeme "'+a+'" for mode "'+(R.scope||"<unnamed>")+'"');throw e.mode=R,e}if("end"===i.type){const e=b(i);if(e!==re)return e}if("illegal"===i.type&&""===a)return O+="\n",1;if(M>1e5&&M>3*i.index){throw new Error("potential infinite loop, way more iterations than matches")}return O+=a,a.length}const x=k(e);if(!x)throw a.replace("{}",e),new Error('Unknown language: "'+e+'"');const E=Q(x);let j="",R=i||E;const S={},N=new p.__emitter(p);!function(){const e=[];for(let t=R;t!==x;t=t.parent)t.scope&&e.unshift(t.scope);e.forEach((e=>N.openNode(e)))}();let O="",T=0,C=0,M=0,L=!1;try{if(x.__emitTokens)x.__emitTokens(n,N);else{for(R.matcher.considerAll();;){M++,L?L=!1:R.matcher.considerAll(),R.matcher.lastIndex=C;const e=R.matcher.exec(n);if(!e)break;const t=_(n.substring(C,e.index),e);C=e.index+t}_(n.substring(C))}return N.finalize(),j=N.toHTML(),{language:e,value:j,relevance:T,illegal:!1,_emitter:N,_top:R}}catch($){if($.message&&$.message.includes("Illegal"))return{language:e,value:ne(n),illegal:!0,relevance:0,_illegalBy:{message:$.message,index:C,context:n.slice(C-100,C+100),mode:$.mode,resultSoFar:j},_emitter:N};if(l)return{language:e,value:ne(n),illegal:!1,relevance:0,errorRaised:$,_emitter:N,_top:R};throw $}}function y(e,t){t=t||p.languages||Object.keys(o);const n=function(e){const t={value:ne(e),illegal:!1,relevance:0,_top:c,_emitter:new p.__emitter(p)};return t._emitter.addText(e),t}(e),r=t.filter(k).filter(j).map((t=>w(t,e,!1)));r.unshift(n);const i=r.sort(((e,t)=>{if(e.relevance!==t.relevance)return t.relevance-e.relevance;if(e.language&&t.language){if(k(e.language).supersetOf===t.language)return 1;if(k(t.language).supersetOf===e.language)return-1}return 0})),[l,a]=i,s=l;return s.secondBest=a,s}function v(e){let t=null;const n=function(e){let t=e.className+" ";t+=e.parentNode?e.parentNode.className:"";const n=p.languageDetectRe.exec(t);if(n){const e=k(n[1]);return e||a.replace("{}",n[1]),e?n[1]:"no-highlight"}return t.split(/\s+/).find((e=>m(e)||k(e)))}(e);if(m(n))return;if(R("before:highlightElement",{el:e,language:n}),e.dataset.highlighted)return;if(e.children.length>0&&(p.ignoreUnescapedHTML,p.throwUnescapedHTML)){throw new te("One of your code blocks includes unescaped HTML.",e.innerHTML)}t=e;const o=t.textContent,i=n?b(o,{language:n,ignoreIllegals:!0}):y(o);e.innerHTML=i.value,e.dataset.highlighted="yes",function(e,t,n){const o=t&&r[t]||n;e.classList.add("hljs"),e.classList.add(`language-${o}`)}(e,n,i.language),e.result={language:i.language,re:i.relevance,relevance:i.relevance},i.secondBest&&(e.secondBest={language:i.secondBest.language,relevance:i.secondBest.relevance}),R("after:highlightElement",{el:e,result:i,text:o})}let _=!1;function x(){if("loading"===document.readyState)return _||window.addEventListener("DOMContentLoaded",(function(){x()}),!1),void(_=!0);document.querySelectorAll(p.cssSelector).forEach(v)}function k(e){return e=(e||"").toLowerCase(),o[e]||o[r[e]]}function E(e,{languageName:t}){"string"==typeof e&&(e=[e]),e.forEach((e=>{r[e.toLowerCase()]=t}))}function j(e){const t=k(e);return t&&!t.disableAutodetect}function R(e,t){const n=e;i.forEach((function(e){e[n]&&e[n](t)}))}Object.assign(n,{highlight:b,highlightAuto:y,highlightAll:x,highlightElement:v,highlightBlock:function(e){return K("10.7.0","highlightBlock will be removed entirely in v12.0"),K("10.7.0","Please use highlightElement now."),v(e)},configure:function(e){p=oe(p,e)},initHighlighting:()=>{x(),K("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")},initHighlightingOnLoad:function(){x(),K("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")},registerLanguage:function(e,t){let r=null;try{r=t(n)}catch(i){if("Language definition for '{}' could not be registered.".replace("{}",e),!l)throw i;r=c}r.name||(r.name=e),o[e]=r,r.rawDefinition=t.bind(null,n),r.aliases&&E(r.aliases,{languageName:e})},unregisterLanguage:function(e){delete o[e];for(const t of Object.keys(r))r[t]===e&&delete r[t]},listLanguages:function(){return Object.keys(o)},getLanguage:k,registerAliases:E,autoDetection:j,inherit:oe,addPlugin:function(e){!function(e){e["before:highlightBlock"]&&!e["before:highlightElement"]&&(e["before:highlightElement"]=t=>{e["before:highlightBlock"](Object.assign({block:t.el},t))}),e["after:highlightBlock"]&&!e["after:highlightElement"]&&(e["after:highlightElement"]=t=>{e["after:highlightBlock"](Object.assign({block:t.el},t))})}(e),i.push(e)},removePlugin:function(e){const t=i.indexOf(e);-1!==t&&i.splice(t,1)}}),n.debugMode=function(){l=!1},n.safeMode=function(){l=!0},n.versionString="11.11.1",n.regex={concat:h,lookahead:u,either:f,optional:g,anyNumberOfTimes:d};for(const t in H)"object"==typeof H[t]&&e(H[t]);return Object.assign(n,H),n},le=ie({});return le.newInstance=()=>ie({}),$e=le,le.HighlightJS=le,le.default=le,$e}const He=de(Be()),ze={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},Ie=a({name:"DownloadOutline",render:function(e,t){return z(),H("svg",ze,t[0]||(t[0]=[I("path",{d:"M336 176h40a40 40 0 0 1 40 40v208a40 40 0 0 1-40 40H136a40 40 0 0 1-40-40V216a40 40 0 0 1 40-40h40",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),I("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M176 272l80 80l80-80"},null,-1),I("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M256 48v288"},null,-1)]))}}),Pe={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},We=a({name:"RefreshOutline",render:function(e,t){return z(),H("svg",Pe,t[0]||(t[0]=[I("path",{d:"M320 146s24.36-12-64-12a160 160 0 1 0 160 160",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-miterlimit":"10","stroke-width":"32"},null,-1),I("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M256 58l80 80l-80 80"},null,-1)]))}}),De=a({name:"LogViewer",props:{content:{type:String,default:""},loading:{type:Boolean,default:!1},enableDownload:{type:Boolean,default:!0},downloadFileName:{type:String,default:"logs.txt"},title:{type:String,default:O("t_0_1746776194126")},fetchLogs:{type:Function,default:()=>Promise.resolve("")}},setup(e){const t=u(e.content||""),o=u(e.loading),r=u(null);g((()=>e.content),(e=>{t.value=e,s()})),g((()=>e.loading),(e=>{o.value=e})),He.registerLanguage("custom-logs",(()=>({contains:[{className:"info-text",begin:/\[INFO\]/},{className:"error-text",begin:/\[ERROR\]/},{className:"warning-text",begin:/\[WARNING\]/},{className:"date-text",begin:/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/}]})));const i=P(["successColor","errorColor","warningColor","successColorPressed"]),l=async()=>{if(e.fetchLogs){o.value=!0;try{const n=await e.fetchLogs();t.value=n,s()}catch(n){}finally{o.value=!1}}},a=()=>{if(!t.value)return;const n=new Blob([t.value],{type:"text/plain"}),o=URL.createObjectURL(n),r=document.createElement("a");r.href=o,r.download=e.downloadFileName,document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(o)},s=()=>{E((()=>{var e;null==(e=r.value)||e.scrollTo({top:Number.MAX_SAFE_INTEGER})}))},c=()=>{l()},h=n((()=>t.value?t.value.split("\n").map((e=>({type:"default",content:e}))):[]));return d((()=>{l()})),()=>T(L,{bordered:!1,class:"w-full h-full",contentClass:"!p-3",style:i.value},{default:()=>[T("div",{class:"mb-2.5 flex justify-start items-center"},[T(M,null,{default:()=>[T(B,{onClick:c,size:"small",type:"primary"},{default:()=>[T(W,{class:"mr-1"},{default:()=>[T(We,null,null)]}),O("t_0_1746497662220")]}),e.enableDownload&&T(B,{onClick:a,size:"small"},{default:()=>[T(W,{class:"mr-1"},{default:()=>[T(Ie,null,null)]}),O("t_2_1746776194263")]})]})]),T(ge,{show:o.value},{default:()=>[T(D,{hljs:He},{default:()=>[T(Ne,{ref:r,log:t.value,rows:h.value.length,language:"custom-logs",loading:o.value,fontSize:14,trim:!1,lineHeight:1.5,style:{height:"500px",border:"1px solid var(--n-border-color)",padding:"10px",borderRadius:"10px"}},null)]})]})]})}}),Fe=a({name:"HistoryLogsModal",props:{id:{type:[String],required:!0}},setup(e){const t=u(!1),n=u(""),o=async()=>{t.value=!0;try{const{data:t}=await se({id:e.id}).fetch();return n.value=t||"没有日志数据",n.value}catch(o){return"获取日志失败: "+(o instanceof Error?o.message:String(o))}finally{t.value=!1}};return()=>T(De,{title:`工作流执行日志 (ID: ${e.id})`,loading:t.value,content:n.value,fetchLogs:o},null)}});function Ue(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!A(e)}const{refreshTable:qe,fetchWorkflowList:Ve,fetchWorkflowHistory:Ge,workflowFormData:Xe,deleteExistingWorkflow:Ke,executeExistingWorkflow:Ze,setWorkflowActive:Je,setWorkflowExecType:Ye}=Ce(),{isEdit:Qe,workDefalutNodeData:et,resetWorkflowData:tt,workflowData:nt,detectionRefresh:ot}=ce(),{handleError:rt}=ue(),{useFormSlot:it}=Z(),lt=(e,t)=>({title:t,key:e,width:100,render:t=>{const n={success:{type:"success",text:O("t_8_1745227838023")},fail:{type:"error",text:O("t_9_1745227838305")},running:{type:"warning",text:O("t_0_1746519384035")}}[t[e]]||{type:"default",text:O("t_1_1746773348701")};return"running"===t[e]&&(qe.value=!0),T(X,{type:n.type,size:"small"},{default:()=>[n.text]})}}),at=()=>{const{confirm:e}=Y(),t=n((()=>[it("template")])),{component:o,data:r}=J({config:t,rules:{},defaultValue:Xe});return e((async e=>{try{e(),tt(),Q.push(`/auto-deploy/workflow-view?type=${r.value.templateType}`)}catch(t){rt(t)}})),{AddWorkflowForm:o}},st=e=>{const{component:t,loading:n,param:o,data:r,total:i,fetch:l}=q({config:[{title:O("t_4_1745227838558"),key:"create_time",width:230,render:e=>e.create_time?e.create_time:"-"},{title:O("t_5_1745227839906"),key:"end_time",width:230,render:e=>e.end_time?e.end_time:"-"},{title:O("t_6_1745227838798"),key:"exec_type",width:110,render:e=>T(X,{type:"auto"===e.exec_type?"info":"default",size:"small",bordered:!1},{default:()=>["auto"===e.exec_type?O("t_2_1745215915397"):O("t_3_1745215914237")]})},lt("status",O("t_7_1745227838093")),{title:O("t_8_1745215914610"),key:"actions",fixed:"right",align:"right",width:80,render:e=>{let t;return T(M,{justify:"end"},{default:()=>[T(B,{size:"tiny",strong:!0,secondary:!0,type:"primary",onClick:()=>(async e=>{K({title:O("t_0_1746579648713"),component:Fe,area:730,componentProps:{id:e}})})(e.id.toString())},Ue(t=O("t_12_1745227838814"))?t:{default:()=>[t]})]})}}],request:Ge,defaultValue:{id:e,p:1,limit:10},watchValue:["p","limit"]}),{component:a}=V({param:o,total:i,alias:{page:"p",pageSize:"limit"}});return{WorkflowHistoryTable:t,WorkflowHistoryTablePage:a,loading:n,param:o,data:r,total:i,fetch:l}},ct=a({name:"WorkflowManager",setup(){const{WorkflowTable:e,WorkflowTablePage:t,isDetectionAddWorkflow:o,handleAddWorkflow:r,hasChildRoutes:i,param:l,fetch:a,data:s}=(()=>{const e=F(),t=U(),o=n((()=>"/auto-deploy"!==e.path)),{component:r,loading:i,param:l,data:a,total:s,fetch:c}=q({config:[{title:O("t_0_1745215914686"),key:"name",width:200,ellipsis:{tooltip:!0}},{title:O("t_1_1746590060448"),key:"type",width:100,render:e=>T(M,null,{default:()=>[T(G,{size:"small",value:e.exec_type,"onUpdate:value":[t=>e.exec_type=t,()=>{m(e)}],checkedValue:"auto",uncheckedValue:"manual"},null),T("span",null,["auto"===e.exec_type?O("t_2_1745215915397"):O("t_3_1745215914237")])]})},{title:O("t_7_1745215914189"),key:"created_at",width:180,render:e=>e.create_time||"-"},lt("last_run_status",O("t_0_1746677882486")),{title:O("t_8_1745215914610"),key:"actions",fixed:"right",align:"right",width:220,render:e=>{let t,n,o,r;return T(M,{justify:"end"},{default:()=>[T(B,{style:{"--n-text-color":"var(--text-color-3)"},size:"tiny",strong:!0,secondary:!0,onClick:()=>f(e)},Ue(t=O("t_9_1745215914666"))?t:{default:()=>[t]}),T(B,{size:"tiny",strong:!0,secondary:!0,type:"info",onClick:()=>p(e)},Ue(n=O("t_10_1745215914342"))?n:{default:()=>[n]}),T(B,{size:"tiny",strong:!0,secondary:!0,type:"primary",onClick:()=>b(e)},Ue(o=O("t_11_1745215915429"))?o:{default:()=>[o]}),T(B,{size:"tiny",strong:!0,secondary:!0,type:"error",onClick:()=>w(e)},Ue(r=O("t_12_1745215914312"))?r:{default:()=>[r]})]})}}],request:Ve,defaultValue:{p:1,limit:10,search:""},watchValue:["p","limit"]}),{component:u}=V({param:l,total:s,alias:{page:"p",pageSize:"limit"}}),d=me((()=>{setTimeout((()=>{c(),qe.value=!1}),1e3)}),100);g((()=>qe.value),(e=>{e&&d()}));const h=()=>{ot.value=!0,K({title:O("t_5_1746667590676"),component:Me,footer:!0,area:500,onUpdateShow(e){e||c()}})},f=async e=>{K({title:e?`【${e.name}】 - ${O("t_9_1745215914666")}`:O("t_9_1745215914666"),component:Le,area:800,componentProps:{id:e.id}})},p=async({name:e,id:t})=>{he({title:O("t_13_1745215915455"),content:O("t_2_1745227839794",{name:e}),onPositiveClick:async()=>{await Ze(t),await c()}})},m=({id:e,exec_type:t})=>{he({title:O("manual"===t?"t_2_1745457488661":"t_3_1745457486983"),content:O("manual"===t?"t_4_1745457497303":"t_5_1745457494695"),onPositiveClick:()=>Ye({id:e,exec_type:t}),onNegativeClick:c,onClose:c})},b=e=>{const n=JSON.parse(e.content);Qe.value=!0,nt.value={id:e.id,name:e.name,content:n,exec_type:e.exec_type,active:e.active},et.value={id:e.id,name:e.name,childNode:n},ot.value=!0,t.push("/auto-deploy/workflow-view?isEdit=true")},w=e=>{he({title:O("t_16_1745215915209"),content:O("t_3_1745227841567",{name:e.name}),onPositiveClick:async()=>{await Ke(e.id),await c()}})};return{WorkflowTable:r,WorkflowTablePage:u,isDetectionAddWorkflow:()=>{const{type:n}=e.query;(null==n?void 0:n.includes("create"))&&(h(),t.push({query:{}}))},handleViewHistory:f,handleAddWorkflow:h,handleChangeActive:({id:e,active:t})=>{he({title:O(t?"t_7_1745457487185":"t_6_1745457487560"),content:O(t?"t_9_1745457500045":"t_8_1745457496621"),onPositiveClick:()=>Je({id:e,active:t}),onNegativeClick:c,onClose:c})},handleSetWorkflowExecType:m,handleExecuteWorkflow:p,handleEditWorkflow:b,handleDeleteWorkflow:w,hasChildRoutes:o,fetch:c,data:a,loading:i,param:l}})(),c=U(),u=P(["contentPadding","borderColor","headerHeight","iconColorHover"]);return g((()=>c.currentRoute.value.path),(e=>{"/auto-deploy"===e&&a()})),d((()=>{o(),a()})),()=>T("div",{class:"h-full flex flex-col",style:u.value},[T("div",{class:"mx-auto max-w-[1600px] w-full p-6"},[i.value?T(ee,null,null):T(fe,null,{headerLeft:()=>T(B,{type:"primary",size:"large",class:"px-5",onClick:r},{default:()=>[T(ve,{class:"text-[var(--text-color-3)] w-[1.6rem]"},null),T("span",{class:"px-2"},[O("t_0_1747047213730")])]}),headerRight:()=>T(te,{value:l.value.search,"onUpdate:value":e=>l.value.search=e,onKeydown:e=>{"Enter"===e.key&&a()},onClear:()=>be(a,100),placeholder:O("t_1_1745227838776"),clearable:!0,size:"large",class:"min-w-[300px]"},{suffix:()=>T("div",{class:"flex items-center",onClick:a},[T(ye,{class:"text-[var(--text-color-3)] w-[1.6rem] cursor-pointer font-bold"},null)])}),content:()=>T("div",{class:"rounded-lg "},[T(e,{size:"medium"},{empty:()=>T(we,{addButtonText:O("t_0_1747047213730"),onAddClick:r},null)})]),footerRight:()=>T("div",{class:"mt-4 flex justify-end"},[T(t,null,{prefix:()=>T("span",null,[O("t_0_1746773350551",[s.value.total])])})])})])])}});export{ct as default};
|