UNPKG

filecat

Version:
2 lines 10.7 kB
/*! For license information please see 636.fc1648927c1e40ec1fed.js.LICENSE.txt */ "use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[636],{1636(e,n,t){t.r(n),t.d(n,{default:()=>A});var r=t(2389),o=t(6540),i=t(7444),a=t(6417),c=t(4238),l=t(4944),u=t(447),f=t(5997),s=t(7952),d=t(5725),v=t(7071),m=t(4289),y=t(8062),p=t(7856);t(5629);function h(){var e,n,t="function"==typeof Symbol?Symbol:{},r=t.iterator||"@@iterator",o=t.toStringTag||"@@toStringTag";function i(t,r,o,i){var l=r&&r.prototype instanceof c?r:c,u=Object.create(l.prototype);return b(u,"_invoke",function(t,r,o){var i,c,l,u=0,f=o||[],s=!1,d={p:0,n:0,v:e,a:v,f:v.bind(e,4),d:function(n,t){return i=n,c=0,l=e,d.n=t,a}};function v(t,r){for(c=t,l=r,n=0;!s&&u&&!o&&n<f.length;n++){var o,i=f[n],v=d.p,m=i[2];t>3?(o=m===r)&&(l=i[(c=i[4])?5:(c=3,3)],i[4]=i[5]=e):i[0]<=v&&((o=t<2&&v<i[1])?(c=0,d.v=r,d.n=i[1]):v<m&&(o=t<3||i[0]>r||r>m)&&(i[4]=t,i[5]=r,d.n=m,c=0))}if(o||t>1)return a;throw s=!0,r}return function(o,f,m){if(u>1)throw TypeError("Generator is already running");for(s&&1===f&&v(f,m),c=f,l=m;(n=c<2?e:l)||!s;){i||(c?c<3?(c>1&&(d.n=-1),v(c,l)):d.n=l:d.v=l);try{if(u=2,i){if(c||(o="next"),n=i[o]){if(!(n=n.call(i,l)))throw TypeError("iterator result is not an object");if(!n.done)return n;l=n.value,c<2&&(c=0)}else 1===c&&(n=i.return)&&n.call(i),c<2&&(l=TypeError("The iterator does not provide a '"+o+"' method"),c=1);i=e}else if((n=(s=d.n<0)?l:t.call(r,d))!==a)break}catch(n){i=e,c=1,l=n}finally{u=1}}return{value:n,done:s}}}(t,o,i),!0),u}var a={};function c(){}function l(){}function u(){}n=Object.getPrototypeOf;var f=[][r]?n(n([][r]())):(b(n={},r,function(){return this}),n),s=u.prototype=c.prototype=Object.create(f);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,u):(e.__proto__=u,b(e,o,"GeneratorFunction")),e.prototype=Object.create(s),e}return l.prototype=u,b(s,"constructor",u),b(u,"constructor",l),l.displayName="GeneratorFunction",b(u,o,"GeneratorFunction"),b(s),b(s,o,"Generator"),b(s,r,function(){return this}),b(s,"toString",function(){return"[object Generator]"}),(h=function(){return{w:i,m:d}})()}function b(e,n,t,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}b=function(e,n,t,r){function i(n,t){b(e,n,function(e){return this._invoke(n,t,e)})}n?o?o(e,n,{value:t,enumerable:!r,configurable:!r,writable:!r}):e[n]=t:(i("next",0),i("throw",1),i("return",2))},b(e,n,t,r)}function w(e,n,t,r,o,i,a){try{var c=e[i](a),l=c.value}catch(e){return void t(e)}c.done?n(l):Promise.resolve(l).then(r,o)}function g(e){return function(){var n=this,t=arguments;return new Promise(function(r,o){var i=e.apply(n,t);function a(e){w(i,r,o,a,c,"next",e)}function c(e){w(i,r,o,a,c,"throw",e)}a(void 0)})}}function E(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var r,o,i,a,c=[],l=!0,u=!1;try{if(i=(t=t.call(e)).next,0===n){if(Object(t)!==t)return;l=!1}else for(;!(l=(r=i.call(t)).done)&&(c.push(r.value),c.length!==n);l=!0);}catch(e){u=!0,o=e}finally{try{if(!l&&null!=t.return&&(a=t.return(),Object(a)!==a))return}finally{if(u)throw o}}return c}}(e,n)||k(e,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function k(e,n){if(e){if("string"==typeof e)return _(e,n);var t={}.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_(e,n):void 0}}function _(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}var S,x,j=o.lazy(function(){return t.e(614).then(t.bind(t,5614))});function A(e){var n=(0,r.Bd)().t,t=E((0,i.L4)(a.A.workflow_realtime_show),2),b=t[0],w=t[1],_=E((0,o.useState)([]),2),A=(_[0],_[1],E((0,o.useState)([]),2)),C=(A[0],A[1],E((0,o.useState)(!1),2)),O=C[0],M=C[1],F=E((0,o.useState)(void 0),2),P=F[0],T=F[1],q=E((0,o.useState)([]),2),I=q[0],G=q[1],N=function(e){var n,t=function(e,n){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=k(e))||n&&e&&"number"==typeof e.length){t&&(e=t);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,c=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return a=e.done,e},e:function(e){c=!0,i=e},f:function(){try{a||null==t.return||t.return()}finally{if(c)throw i}}}}(e);try{for(t.s();!(n=t.n()).done;){var r,i=n.value;if(null==i.code&&(null==i||null===(r=i.extra_data)||void 0===r?void 0:r.running_type)===v.rl.running)i.name=o.createElement("div",null,o.createElement(u.fq,{running:!0}),i.name);else if(0===i.code)i.name=o.createElement("div",null,o.createElement(u.fq,{success:!0}),i.name);else{if(!(i.code<1)){delete i.children;continue}i.name=o.createElement("div",null,o.createElement(u.fq,{success:!1}),i.name)}i.children&&N(i.children)}}catch(e){t.e(e)}finally{t.f()}},B=function(){var e=g(h().m(function e(n){var t;return h().w(function(e){for(;;)switch(e.n){case 0:(t=new v.v3).filename_path="".concat((0,m.GG)("file",(0,m.vX)())).concat(b.filename),l.ws.addMsg(c.HK.workflow_realtime_one_rsq,function(e){if(e.context.list&&e.context.list.length>0){var n=e.context.list;N(n),G(n)}e.context.new_log&&K(e.context.new_log)}),l.ws.sendData(c.HK.workflow_realtime_one_req,t);case 1:return e.a(2)}},e)}));return function(n){return e.apply(this,arguments)}}(),H=function(){var e=g(h().m(function e(){var n;return h().w(function(e){for(;;)switch(e.n){case 0:n=new p.Terminal({fontFamily:"Monaco, Menlo, Consolas, 'Courier New', monospace",theme:{background:"#FFFFFF",foreground:"#000000",cursor:"#000000",selectionBackground:"#a6d2ff"},cursorBlink:!0,cursorStyle:"bar",scrollback:1e3,scrollSensitivity:1,tabStopWidth:4,convertEol:!0}),x=n,T(n);case 1:return e.a(2)}},e)}));return function(){return e.apply(this,arguments)}}();(0,o.useEffect)(function(){return M(!1),S=void 0,x=void 0,B(),g(h().m(function e(){return h().w(function(e){for(;;)switch(e.n){case 0:l.ws.removeMsg(c.HK.workflow_realtime_one_rsq),x&&(x.dispose(),x=null);case 1:return e.a(2)}},e)}))},[]);var K=function(){var e=g(h().m(function e(n){return h().w(function(e){for(;;)switch(e.n){case 0:if(x){e.n=1;break}return e.n=1,new Promise(function(e){S=e,M(!0),H()});case 1:n&&x.write(n);case 2:return e.a(2)}},e)}));return function(n){return e.apply(this,arguments)}}();return o.createElement("div",null,o.createElement(s.A,null,P&&o.createElement(f.rA,{icon:"print",title:"打印日志",onClick:function(){M(!O)}}),o.createElement(f.rA,{icon:"close",title:n("关闭"),onClick:function(){w({open:!1})}})),o.createElement(d.jW,{isFull:!0,more:!0},o.createElement(d.NN,null,o.createElement(y.A,{list:I,click:function(e){}}))),o.createElement("div",{style:{display:O?"":"none"}},o.createElement(j,{show:!0,terminal:P,init:function(){S&&(S(1),S=void 0)}})))}},5629(e,n,t){t.d(n,{W:()=>u,Y:()=>f});var r=t(6540),o=t(447),i=t(7071),a=t(2389);function c(e,n){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=function(e,n){if(e){if("string"==typeof e)return l(e,n);var t={}.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?l(e,n):void 0}}(e))||n&&e&&"number"==typeof e.length){t&&(e=t);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,c=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return a=e.done,e},e:function(e){c=!0,i=e},f:function(){try{a||null==t.return||t.return()}finally{if(c)throw i}}}}function l(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function u(e){var n,t,c,l=e.item,u=(0,a.Bd)().t;return null!=l.code?t=0===l.code:(null===(n=l.extra_data)||void 0===n?void 0:n.running_type)===i.rl.running&&(c=!0),r.createElement("div",null,r.createElement(o.fq,{success:t,running:c}),u(t?"成功":"失败"))}var f=function(e,n,t){if(n){var i,a=c(null!=n?n:[]);try{for(a.s();!(i=a.n()).done;){var l,u,s=i.value,d=void 0,v=[];if(s["use-yml"])f(v,void 0,s.use_job_children_list),d="".concat(s["use-yml"]," ;").concat(null!==(u=s.duration)&&void 0!==u?u:-1);else s.runs?d=JSON.stringify(s.runs):s.run?d=s.run:s["run-js"]?d=s["run-js"]:s.sleep&&(d="sleep ".concat(s.sleep));d=r.createElement("div",null,r.createElement(o.fq,{success:void 0===s.code?void 0:0===s.code})," ",d+" ;"+(null!==(l=s.duration)&&void 0!==l?l:"")),e.push({name:d,children:v,extra_data:{code:s.code,context:s.message}})}}catch(e){a.e(e)}finally{a.f()}}else if(t){var m,y=c(null!=t?t:[]);try{for(y.s();!(m=y.n()).done;){var p=m.value,h=r.createElement("div",null,r.createElement(o.fq,{success:void 0===p.code?void 0:0===p.code}),"$",p.name);e.push({name:h,extra_data:{code:p.code,is_job:!0,job_data:p}})}}catch(e){y.e(e)}finally{y.f()}}}},8062(e,n,t){t.d(n,{A:()=>c});var r=t(6540);function o(){return o=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var r in t)({}).hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},o.apply(null,arguments)}function i(e){return r.createElement("div",{className:"black-tip",onClick:function(){e.click&&e.click(e)},onContextMenu:function(n){n.stopPropagation(),n.nativeEvent.stopImmediatePropagation(),e.onContextMenu&&e.onContextMenu(n,e)}},e.name)}var a=function(e){return r.createElement("li",null,e.click?r.createElement(i,o({},e.node,{name:e.render?e.render(e.node):e.node.name,click:e.click,onContextMenu:e.onContextMenu})):r.createElement("div",null,e.render?e.render(e.node):e.node.name),e.node.children&&e.node.children.length>0&&r.createElement("ul",null,e.node.children.map(function(n,t){return r.createElement(a,{key:t,node:n,click:e.click,onContextMenu:e.onContextMenu,render:e.render})})))};const c=function(e){return r.createElement("div",{className:"card-tree-view"},r.createElement("ul",null,e.list&&e.list.map(function(n,t){return r.createElement(a,{key:t,node:n,click:e.click,onContextMenu:e.onContextMenu,render:e.render})})))}}}]);