build/static/js/72.bef599ce.chunk.js

1 line
24 KiB
JavaScript
Raw Normal View History

2022-12-08 16:50:44 +08:00
(this.webpackJsonp=this.webpackJsonp||[]).push([[72],{"B/o2":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},a=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,a=!1,i=void 0;try{for(var l,o=e[Symbol.iterator]();!(r=(l=o.next()).done)&&(n.push(l.value),!t||n.length!==t);r=!0);}catch(e){a=!0,i=e}finally{try{!r&&o.return&&o.return()}finally{if(a)throw i}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},i=n("q1tI"),l=c(i),o=c(n("GJQR")),u=c(n("hi2r")),s=c(n("vDqi"));function c(e){return e&&e.__esModule?e:{default:e}}t.default=function(){var e=(0,i.useState)(void 0),t=a(e,2),n=t[0],c=t[1];return(0,i.useEffect)((function(){n||s.default.get("/api/ci/pipelines/ssh_server.json").then((function(e){e&&e.data&&c(r({},e.data))})).catch((function(e){})),setTimeout((function(){u.default.publish("create-socket",1)}),300)}),[n]),l.default.createElement(o.default,{sshConfigData:n||{},sid:1})}},FFNF:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TagsLine=t.Tags=void 0;var r,a=n("q1tI"),i=(r=a)&&r.__esModule?r:{default:r};n("KkuB");t.Tags=function(e){switch(e){case"running":return i.default.createElement("span",{className:"statusColor running"},"运行中");case"failure":case"error":return i.default.createElement("span",{className:"statusColor failed"},"未通过");case"success":return i.default.createElement("span",{className:"statusColor pass"},"已通过");case"pending":return i.default.createElement("span",{className:"statusColor Preparing"},"准备中");case"killed":return i.default.createElement("span",{className:"statusColor killed"},"已撤销")}},t.TagsLine=function(e){switch(e){case"running":return i.default.createElement("span",{className:"statuslineColor running"},"运行中");case"failure":case"error":return i.default.createElement("span",{className:"statuslineColor failed"},"未通过");case"success":return i.default.createElement("span",{className:"statuslineColor pass"},"已通过");case"pending":return i.default.createElement("span",{className:"statuslineColor Preparing"},"准备中");case"killed":return i.default.createElement("span",{className:"statuslineColor killed"},"已撤销");case"skipped":return i.default.createElement("span",{className:"statuslineColor skipped"},"已跳过")}}},GJQR:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},a=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,a=!1,i=void 0;try{for(var l,o=e[Symbol.iterator]();!(r=(l=o.next()).done)&&(n.push(l.value),!t||n.length!==t);r=!0);}catch(e){a=!0,i=e}finally{try{!r&&o.return&&o.return()}finally{if(a)throw i}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},i=n("q1tI"),l=d(i),o=n("J66h"),u=n("/POA");n("q7KB");var s=d(n("hi2r")),c=d(n("bdgK"));function d(e){return e&&e.__esModule?e:{default:e}}function f(e,t,n){var r=n._core._renderService.dimensions.actualCellWidth||9.5,a=n._core._renderService.dimensions.actualCellHeight||18,i=Math.floor(t/a);return[Math.floor(e/r),i]}t.default=function(e){var t=e.sshConfigData,n=e.sid,d=(0,i.useState)(null),p=a(d,2),g=p[0],m=p[1],h=t.ws_url,x=(t.password,t.port),b=t.secret,v=(0,i.useRef)(),y=(0,i.useRef)(),E=(0,i.useRef)(!1);return(0,i.useEffect)((function(){if(v.current&&h){var e=new u.Terminal({fontSize:16,rendererType:"dom"});e.open(v.current),e.onData((function(e){y.current&&1===y.current.readyState&&(y.current.send(JSON.stringify({tp:"client",data:e})),s.default.publish("on-operating-ssh"))})),e.write("Connecting..."),m(e);var t=function(e,t){var n=new c.default((function(t){console.log(