forgeplus/public/react/build/static/js/42.15b2909e.chunk.js

1 line
17 KiB
JavaScript

(this.webpackJsonp=this.webpackJsonp||[]).push([[42],{"0Cz8":function(e,t,n){var r=n("Xi7e"),a=n("ebwN"),o=n("e4Nc");e.exports=function(e,t){var n=this.__data__;if(n instanceof r){var i=n.__data__;if(!a||i.length<199)return i.push([e,t]),this.size=++n.size,this;n=this.__data__=new o(i)}return n.set(e,t),this.size=n.size,this}},"6sVZ":function(e,t){var n=Object.prototype;e.exports=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||n)}},"77Zs":function(e,t,n){var r=n("Xi7e");e.exports=function(){this.__data__=new r,this.size=0}},B8du:function(e,t){e.exports=function(){return!1}},BuC1:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=u(n("kLXV")),a=u(n("5rEg")),o=u(n("2fM7")),i=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,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{!r&&l.return&&l.return()}finally{if(a)throw o}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")};n("k3Gp"),n("1vPl"),n("8QGh");var l=n("q1tI"),c=u(l);function u(e){return e&&e.__esModule?e:{default:e}}var s=o.default.Option,f=["push","pull_request","tag","cron","custom","promote","rollback"];t.default=function(e){var t=e.visible,n=e.onCancel,u=e.onOk,p=e.value,d=e.branchList,m=(0,l.useState)(void 0),v=i(m,2),h=v[0],y=v[1],b=(0,l.useState)(void 0),g=i(b,2),E=g[0],_=g[1],j=(0,l.useState)([f[0]]),w=i(j,2),x=w[0],N=w[1];return(0,l.useEffect)((function(){d&&d.length>0&&_(d[0].name)}),[d]),(0,l.useEffect)((function(){p?(y(p.pipeline_name),_(p.branch),N(p.event)):y(void 0)}),[p]),c.default.createElement(r.default,{visible:t,title:"流水线名称",width:"500px",onCancel:n,onOk:function(){u(h,p&&p.id,E,x)},centered:!0},c.default.createElement("div",{className:"choosenList"},c.default.createElement("span",null,"流水线名称:"),c.default.createElement(a.default,{value:h,onChange:function(e){return y(e.target.value)},placeholder:"请输入名称",style:{width:"340px",margin:"6px 0px"}})),c.default.createElement("div",{className:"choosenList mt20"},c.default.createElement("span",null,"触发条件:"),c.default.createElement(o.default,{value:E,style:{width:"150px"},dropdownClassName:"chooseCon",onChange:function(e){return _(e)}},d&&d.length>0&&d.map((function(e,t){return c.default.createElement(s,{value:e.name,key:t},e.name)}))),c.default.createElement(o.default,{mode:"multiple",allowClear:!0,value:x,dropdownClassName:"chooseCon",style:{width:"180px",marginLeft:"10px"},onChange:function(e){N(e)}},f.map((function(e,t){return c.default.createElement(s,{value:e,key:t},e)})))))}},DSRE:function(e,t,n){(function(e){var r=n("Kz5y"),a=n("B8du"),o=t&&!t.nodeType&&t,i=o&&"object"==typeof e&&e&&!e.nodeType&&e,l=i&&i.exports===o?r.Buffer:void 0,c=(l?l.isBuffer:void 0)||a;e.exports=c}).call(this,n("YuTi")(e))},JHRd:function(e,t,n){var r=n("Kz5y").Uint8Array;e.exports=r},Jwem:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,a,o=h(n("W9HT")),i=h(n("NUBc")),l=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,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{!r&&l.return&&l.return()}finally{if(a)throw o}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},c=(r=["{\n padding:24px 30px;\n}"],a=["{\n padding:24px 30px;\n}"],Object.freeze(Object.defineProperties(r,{raw:{value:Object.freeze(a)}})));n("04bd"),n("YQTV");var u=n("q1tI"),s=h(u),f=n("spEH"),p=h(n("NPS8")),d=h(n("gyhb")),m=h(n("vDqi")),v=h(n("BuC1"));function h(e){return e&&e.__esModule?e:{default:e}}var y=h(n("vOnD")).default.div(c);t.default=function(e){var t=(0,u.useState)(!0),n=l(t,2),r=n[0],a=n[1],c=(0,u.useState)(void 0),h=l(c,2),b=h[0],g=h[1],E=(0,u.useState)(void 0),_=l(E,2),j=_[0],w=_[1],x=(0,u.useState)(void 0),N=l(x,2),C=N[0],k=N[1],O=(0,u.useState)(!1),S=l(O,2),P=S[0],A=S[1],T=(0,u.useState)(1),z=l(T,2),I=z[0],L=z[1],D=(0,u.useState)(0),B=l(D,2),V=B[0],M=(B[1],(0,u.useState)(void 0)),R=l(M,2),q=R[0],F=R[1],U=e.projectDetail,H=e.current_user,J=e.match.params.projectsId,Z=e.match.params.owner;function X(){m.default.get("/ci/pipelines/list.json",{params:{identifier:J,owner:Z,page:I,limit:15}}).then((function(e){e&&e.data&&w(e.data.pipelines),a(!1)})).catch((function(e){a(!1)}))}function G(e,t,n,r){if(A(!0),g(void 0),e){var a=r.split(",");g({pipeline_name:e,id:t,branch:n,event:a})}else g(void 0)}(0,u.useEffect)((function(){U&&k(e.projectDetail.permission)}),[U]),(0,u.useEffect)((function(){X()}),[I]),(0,u.useEffect)((function(){if(Z&&J){var e="/"+Z+"/"+J+"/branches.json";m.default.get(e).then((function(e){e&&e.data&&F(e.data)})).catch((function(e){}))}}),[Z,J]);var K=H&&C&&"Reporter"!==C;return s.default.createElement(o.default,{spinning:r},s.default.createElement(v.default,{branchList:q,visible:P,value:b,onCancel:function(){return A(!1)},onOk:function(t,n,r,a){if(t){for(var o="",i=0;i<a.length;i++)o+=a[i]+",";if(o=o.substring(0,o.length-1),n){var l="/ci/pipelines/"+n+".json";m.default.put(l,{pipeline_name:t,repo:J,branch:r,event:o,owner:Z}).then((function(t){t&&t.data?(A(!1),X(),e.showNotification("流水线名称更新成功!")):e.showNotification("流水线名称更新失败,请稍后再试!")})).catch((function(e){}))}else{m.default.post("/ci/pipelines.json",{pipeline_name:t,file_name:".trustie-pipeline.yml",repo:J,branch:r,event:o,owner:Z}).then((function(t){A(!1),t&&t.data?(e.showNotification("流水线新增成功,请进行工作流配置!"),e.history.push("/"+Z+"/"+J+"/devops/"+t.data.id)):e.showNotification("流水线新增失败,请稍后再试!")})).catch((function(e){}))}}else e.showNotification("请输入流水线名称!")}}),s.default.createElement("div",{className:"disposePanel"},s.default.createElement(d.default,{manager:K?function(){e.history.push("/"+Z+"/"+J+"/devops/mould")}:void 0,parameter:K?function(){e.history.push("/"+Z+"/"+J+"/devops/params")}:void 0}),s.default.createElement(y,null,K&&s.default.createElement(f.Blueback,{onClick:function(){return G(void 0,void 0)}},"新增流水线"),s.default.createElement("div",{className:"mt20 disposeList"},s.default.createElement(p.default,{list:j,operate:K,projectsId:J,owner:Z,showModal:G,deleteFunc:function(t){var n="/ci/pipelines/"+t+".json";m.default.delete(n).then((function(t){t&&t.data&&(e.showNotification("流水线删除成功!"),X())})).catch((function(e){}))}}),V>15&&s.default.createElement("div",{className:"mt20 pb20",style:{textAlign:"center"}},s.default.createElement(i.default,{simple:!0,current:I,pageSize:15,total:V,onChange:function(e){return L(e)}}))))))}},L8xA:function(e,t){e.exports=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}},MMmD:function(e,t,n){var r=n("lSCD"),a=n("shjB");e.exports=function(e){return null!=e&&a(e.length)&&!r(e)}},NJEC:function(e,t,n){"use strict";n.r(t);var r=n("q1tI"),a=n("VCL8"),o=n("3S7+"),i=n("CtXQ"),l=n("2/Rp"),c=n("YMnH"),u=n("ZvpZ"),s=n("H84U");function f(e){return(f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function p(){return(p=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}).apply(this,arguments)}function d(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function m(e,t){return(m=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function v(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=b(e);if(t){var a=b(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return h(this,n)}}function h(e,t){return!t||"object"!==f(t)&&"function"!=typeof t?y(e):t}function y(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function b(e){return(b=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var g=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(r=Object.getOwnPropertySymbols(e);a<r.length;a++)t.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]])}return n},E=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&m(e,t)}(f,e);var t,n,a,i=v(f);function f(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,f),(t=i.call(this,e)).onConfirm=function(e){t.setVisible(!1,e);var n=t.props.onConfirm;n&&n.call(y(t),e)},t.onCancel=function(e){t.setVisible(!1,e);var n=t.props.onCancel;n&&n.call(y(t),e)},t.onVisibleChange=function(e){t.props.disabled||t.setVisible(e)},t.saveTooltip=function(e){t.tooltip=e},t.renderOverlay=function(e,n){var a=t.props,o=a.okButtonProps,i=a.cancelButtonProps,c=a.title,u=a.cancelText,s=a.okText,f=a.okType,d=a.icon;return r.createElement("div",null,r.createElement("div",{className:"".concat(e,"-inner-content")},r.createElement("div",{className:"".concat(e,"-message")},d,r.createElement("div",{className:"".concat(e,"-message-title")},c)),r.createElement("div",{className:"".concat(e,"-buttons")},r.createElement(l.default,p({onClick:t.onCancel,size:"small"},i),u||n.cancelText),r.createElement(l.default,p({onClick:t.onConfirm,type:f,size:"small"},o),s||n.okText))))},t.renderConfirm=function(e){var n=e.getPrefixCls,a=t.props,i=a.prefixCls,l=a.placement,s=g(a,["prefixCls","placement"]),f=n("popover",i),d=r.createElement(c.a,{componentName:"Popconfirm",defaultLocale:u.a.Popconfirm},(function(e){return t.renderOverlay(f,e)}));return r.createElement(o.default,p({},s,{prefixCls:f,placement:l,onVisibleChange:t.onVisibleChange,visible:t.state.visible,overlay:d,ref:t.saveTooltip}))},t.state={visible:e.visible},t}return t=f,a=[{key:"getDerivedStateFromProps",value:function(e){return"visible"in e?{visible:e.visible}:"defaultVisible"in e?{visible:e.defaultVisible}:null}}],(n=[{key:"getPopupDomNode",value:function(){return this.tooltip.getPopupDomNode()}},{key:"setVisible",value:function(e,t){var n=this.props;"visible"in n||this.setState({visible:e});var r=n.onVisibleChange;r&&r(e,t)}},{key:"render",value:function(){return r.createElement(s.a,null,this.renderConfirm)}}])&&d(t.prototype,n),a&&d(t,a),f}(r.Component);E.defaultProps={transitionName:"zoom-big",placement:"top",trigger:"click",okType:"primary",icon:r.createElement(i.default,{type:"exclamation-circle",theme:"filled"}),disabled:!1},Object(a.polyfill)(E),t.default=E},NPS8:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=l(n("wCAj")),a=l(n("NJEC"));n("mbEz"),n("k994");var o=l(n("q1tI")),i=n("eO8H");function l(e){return e&&e.__esModule?e:{default:e}}t.default=function(e){var t=e.list,n=e.operate,l=e.projectsId,c=e.owner,u=e.showModal,s=e.deleteFunc,f=[{title:"流水线名称",dataIndex:"pipeline_name",key:1,ellipsis:!0,render:function(e,t){return o.default.createElement("span",{onDoubleClick:function(){return u(e,t.id,t.branch,t.event)},style:{display:"block",cursor:"pointer"}},e)}},{title:"文件名称",dataIndex:"file_name",key:1,width:"15%",ellipsis:!0,render:function(e,t){var n,r=(n=t.branch)&&n.length>0&&n.indexOf("/")>-1?n.replaceAll("/","%2F"):n;return o.default.createElement(i.Link,{to:"/"+c+"/"+l+"/tree/"+r+"/"+e,className:"color-blue"},e)}},{title:"触发分支",dataIndex:"branch",key:1,width:"10%",ellipsis:!0},{title:"触发事件",dataIndex:"event",key:1,width:"10%",ellipsis:!0},{title:"最近构建时间",dataIndex:"last_build_time",key:1,width:"15%",ellipsis:!0},{title:"最近构建状态",dataIndex:"pipeline_status",key:1,width:"12%",ellipsis:!0,render:function(e){return function(e){switch(e){case"running":return o.default.createElement("span",{className:"statusTag running"},o.default.createElement("i",{className:"iconfont icon-yunhangzhong"}),"运行中");case"failure":case"error":return o.default.createElement("span",{className:"statusTag failed"},o.default.createElement("i",{className:"iconfont icon-weitongguo"}),"未通过");case"success":return o.default.createElement("span",{className:"statusTag pass"},o.default.createElement("i",{className:"iconfont icon-yitongguo"}),"已通过");case"killed":return o.default.createElement("span",{className:"statusTag killed"},o.default.createElement("i",{className:"iconfont icon-weitongguo"}),"已撤销");default:return o.default.createElement("span",{className:"statusTag Preparing"},o.default.createElement("i",{className:"iconfont icon-zhunbeizhong"}),"准备中")}}(e)}},{title:"操作",dataIndex:"operation",key:1,width:"21%",render:function(e,t){return o.default.createElement("span",null,n?o.default.createElement(i.Link,{to:"/"+c+"/"+l+"/devops/"+t.id,className:"mr10 color-grey-6"},o.default.createElement("i",{className:"iconfont icon-zaibianji font-13 mr3"}),"编辑"):"",n?o.default.createElement(a.default,{title:"确定要删除此流水线?",onConfirm:function(){return s(t.id)},okText:"确定",cancelText:"取消"},o.default.createElement("a",{className:"mr10 color-grey-6"},o.default.createElement("i",{className:"iconfont icon-lajitong font-13 mr3"}),"删除")):"",o.default.createElement(i.Link,{to:"/"+c+"/"+l+"/devops/list/"+t.branch,className:"color-grey-6"},o.default.createElement("i",{className:"iconfont icon-yunhang font-13 mr3"}),"查看运行记录"))}}];return o.default.createElement(r.default,{size:"small",columns:f,dataSource:t,rowKey:function(e){return e.id},pagination:!1})}},"UNi/":function(e,t){e.exports=function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}},VaNO:function(e,t){e.exports=function(e){return this.__data__.has(e)}},b80T:function(e,t,n){var r=n("UNi/"),a=n("03A+"),o=n("Z0cm"),i=n("DSRE"),l=n("wJg7"),c=n("c6wG"),u=Object.prototype.hasOwnProperty;e.exports=function(e,t){var n=o(e),s=!n&&a(e),f=!n&&!s&&i(e),p=!n&&!s&&!f&&c(e),d=n||s||f||p,m=d?r(e.length,String):[],v=m.length;for(var h in e)!t&&!u.call(e,h)||d&&("length"==h||f&&("offset"==h||"parent"==h)||p&&("buffer"==h||"byteLength"==h||"byteOffset"==h)||l(h,v))||m.push(h);return m}},c6wG:function(e,t,n){var r=n("dD9F"),a=n("sEf8"),o=n("mdPL"),i=o&&o.isTypedArray,l=i?a(i):r;e.exports=l},dD9F:function(e,t,n){var r=n("NykK"),a=n("shjB"),o=n("ExA7"),i={};i["[object Float32Array]"]=i["[object Float64Array]"]=i["[object Int8Array]"]=i["[object Int16Array]"]=i["[object Int32Array]"]=i["[object Uint8Array]"]=i["[object Uint8ClampedArray]"]=i["[object Uint16Array]"]=i["[object Uint32Array]"]=!0,i["[object Arguments]"]=i["[object Array]"]=i["[object ArrayBuffer]"]=i["[object Boolean]"]=i["[object DataView]"]=i["[object Date]"]=i["[object Error]"]=i["[object Function]"]=i["[object Map]"]=i["[object Number]"]=i["[object Object]"]=i["[object RegExp]"]=i["[object Set]"]=i["[object String]"]=i["[object WeakMap]"]=!1,e.exports=function(e){return o(e)&&a(e.length)&&!!i[r(e)]}},fmRc:function(e,t,n){var r=n("Xi7e"),a=n("77Zs"),o=n("L8xA"),i=n("gCq4"),l=n("VaNO"),c=n("0Cz8");function u(e){var t=this.__data__=new r(e);this.size=t.size}u.prototype.clear=a,u.prototype.delete=o,u.prototype.get=i,u.prototype.has=l,u.prototype.set=c,e.exports=u},gCq4:function(e,t){e.exports=function(e){return this.__data__.get(e)}},gyhb:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,a=n("q1tI"),o=(r=a)&&r.__esModule?r:{default:r},i=n("spEH");t.default=function(e){var t=e.manager,n=e.parameter;return o.default.createElement(i.AlignCenterBetween,null,o.default.createElement("span",{className:"font-20"},"工作流配置"),o.default.createElement(i.FlexAJ,null,n&&o.default.createElement(i.Blueline,{onClick:n},"参数管理"),t&&o.default.createElement(i.Blueline,{style:{marginLeft:"20px"},onClick:t},"模板管理"),o.default.createElement("a",{href:"https://forum.trustie.net/forums/3111/detail",target:"_blank",className:"color-grey-6 ml20"},o.default.createElement("i",{className:"iconfont icon-tishi1 font-14 mr3"}),"模板使用说明")))}},k994:function(e,t,n){"use strict";n.r(t);n("SchZ"),n("Aosp"),n("L/Qf")},kekF:function(e,t){e.exports=function(e,t){return function(n){return e(t(n))}}},mdPL:function(e,t,n){(function(e){var r=n("WFqU"),a=t&&!t.nodeType&&t,o=a&&"object"==typeof e&&e&&!e.nodeType&&e,i=o&&o.exports===a&&r.process,l=function(){try{var e=o&&o.require&&o.require("util").types;return e||i&&i.binding&&i.binding("util")}catch(e){}}();e.exports=l}).call(this,n("YuTi")(e))},sEf8:function(e,t){e.exports=function(e){return function(t){return e(t)}}},zZ0H:function(e,t){e.exports=function(e){return e}}}]);