(this.webpackJsonp=this.webpackJsonp||[]).push([[92],{"0fBl":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=c(n("2/Rp"));n("L/Qf");var o=c(n("q1tI")),a=n("spEH"),i=c(n("/k9T"));function c(e){return e&&e.__esModule?e:{default:e}}t.default=function(e){var t=e.visible,n=e.onCancel,c=e.onSuccess,l=e.title,u=e.subTitle,s=e.content;return o.default.createElement(i.default,{title:l,btn:o.default.createElement("div",null,o.default.createElement(r.default,{size:"large",onClick:n},"取消"),o.default.createElement(r.default,{type:"danger",size:"large",onClick:c},"确认删除")),onCancel:n,visible:t},o.default.createElement("div",{className:"desc"},o.default.createElement(a.AlignCenter,{className:"descMain"},o.default.createElement("i",{className:"iconfont icon-shanchu_tc_icon mr10"}),s),o.default.createElement("p",{className:"task-hide-2",style:{WebkitLineClamp:5}},"删除后未来事件将不会推送至此Webhook地址:",o.default.createElement("span",{title:u},u))))}},"5ZNU":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=m(n("NUBc")),o=m(n("VXEj")),a=m(n("2/Rp")),i=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,o=!1,a=void 0;try{for(var i,c=e[Symbol.iterator]();!(r=(i=c.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){o=!0,a=e}finally{try{!r&&c.return&&c.return()}finally{if(o)throw a}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")};n("YQTV"),n("LXko"),n("L/Qf");var c=n("q1tI"),l=m(c),u=n("spEH"),s=m(n("0fBl"));n("MKhi");var f=n("eO8H"),p=m(n("vDqi"));function m(e){return e&&e.__esModule?e:{default:e}}t.default=function(e){var t=(0,c.useState)(void 0),n=i(t,2),m=n[0],d=n[1],y=(0,c.useState)(1),h=i(y,2),g=h[0],b=h[1],v=(0,c.useState)(1),E=i(v,2),S=E[0],w=E[1],k=(0,c.useState)(void 0),O=i(k,2),x=O[0],C=O[1],N=(0,c.useState)(!1),j=i(N,2),P=j[0],_=j[1],I=(0,c.useState)(void 0),L=i(I,2),z=L[0],T=L[1],A=e.match.params,M=A.owner,R=A.projectsId;function W(){var e="/"+M+"/"+R+"/webhooks.json";p.default.get(e,{params:{page:g,limit:15}}).then((function(e){e&&e.data&&(d(e.data.webhooks),w(e.data.total_count))})).catch((function(e){}))}return(0,c.useEffect)((function(){M&&R&&W()}),[M,R,g]),l.default.createElement("div",null,l.default.createElement(s.default,{visible:P,onCancel:function(){return _(!1)},onSuccess:function(){if(x){var t="/"+M+"/"+R+"/webhooks/"+x+".json";p.default.delete(t).then((function(t){t&&(e.showNotification("webhook删除成功!"),g>1&&1===m.length?b(g-1):W(),_(!1))})).catch((function(e){}))}},title:"删除Webhook",content:"您确定要删除此Webhook吗?",subTitle:"删除后未来事件将不会推送至此Webhook地址:"+z}),l.default.createElement(u.Banner,null,l.default.createElement("span",null,"Webhooks(网络钩子)"),l.default.createElement(a.default,{type:"primary",size:"large",onClick:function(){if(S>=20)return e.showNotification("webhooks数量已到上限!请删除暂不使用的webhooks以进行添加操作");e.history.push("/"+M+"/"+R+"/settings/webhooks/new")}},"添加Webhook")),l.default.createElement("div",{className:"hookpanel"},l.default.createElement("p",{className:"color-grey-3"},"每当特定事件(如push代码,合并请求被编辑)发生时,我们将通过webhook给您提供的远程URL发送post请求。您可以在我们的",l.default.createElement("a",{className:"color-blue hoverLine",target:"_blank",href:"https://forum.trustie.net/forums/3408/detail"},"webhooks指南"),"中了解更多信息"),m&&m.length>0&&l.default.createElement(o.default,null,m.map((function(t,n){return l.default.createElement(o.default.Item,{key:n},l.default.createElement("i",{className:"iconfont icon-a-xuanzhongwebhookicon color-grey-d mr12 font-17"}),l.default.createElement(f.Link,{to:"/"+M+"/"+R+"/settings/webhooks/"+t.id,className:"webName"},t.url),l.default.createElement("span",null,l.default.createElement(a.default,{ghost:!0,type:"primary",onClick:function(){e.history.push("/"+M+"/"+R+"/settings/webhooks/"+t.id)}},"编辑"),l.default.createElement(a.default,{ghost:!0,className:"ml20",type:"danger",onClick:function(){!function(e,t){C(e),T(t),_(!0)}(t.id,t.url)}},"删除")))}))),S>15&&l.default.createElement("div",{className:"edu-txt-center mt20 mb20"},l.default.createElement(r.default,{current:g,total:S,onChange:function(e){b(e)},pageSize:15}))))}},"74dF":function(e,t,n){},LXko:function(e,t,n){"use strict";n.r(t);n("SchZ"),n("74dF"),n("vAZS"),n("04bd"),n("YQTV"),n("4t1q")},MKhi:function(e,t,n){},VXEj:function(e,t,n){"use strict";n.r(t),n.d(t,"default",(function(){return R}));var r=n("q1tI"),o=n("17x9"),a=n("TSYQ"),i=n.n(a),c=n("BGR+"),l=n("W9HT"),u=n("H84U"),s=n("NUBc"),f=n("qrJ5"),p=n("/kpp");function m(e){if(!r.isValidElement(e))return e;for(var t=arguments.length,n=new Array(t>1?t-1:0),o=1;o0&&r.createElement("ul",{className:"".concat(b,"-item-action"),key:"actions"},f.map((function(e,t){return r.createElement("li",{key:"".concat(b,"-item-action-").concat(t)},e,t!==f.length-1&&r.createElement("em",{className:"".concat(b,"-item-action-split")}))}))),E=a?"div":"li",S=r.createElement(E,w({},g,{className:i()("".concat(b,"-item"),h,y({},"".concat(b,"-item-no-flex"),!e.isFlexMode()))}),"vertical"===c&&d?[r.createElement("div",{className:"".concat(b,"-item-main"),key:"content"},s,v),r.createElement("div",{className:"".concat(b,"-item-extra"),key:"extra"},d)]:[s,v,m(d,{key:"extra"})]);return a?r.createElement(p.a,{span:O(a,"column"),xs:O(a,"xs"),sm:O(a,"sm"),md:O(a,"md"),lg:O(a,"lg"),xl:O(a,"xl"),xxl:O(a,"xxl")},S):S},e}return t=c,(n=[{key:"isItemContainsTextNodeAndNotSingular",value:function(){var e,t=this.props.children;return r.Children.forEach(t,(function(t){"string"==typeof t&&(e=!0)})),e&&r.Children.count(t)>1}},{key:"isFlexMode",value:function(){var e=this.props.extra;return"vertical"===this.context.itemLayout?!!e:!this.isItemContainsTextNodeAndNotSingular()}},{key:"render",value:function(){return r.createElement(u.a,null,this.renderItem)}}])&&g(t.prototype,n),o&&g(t,o),c}(r.Component);function C(e){return(C="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 N(e){return function(e){if(Array.isArray(e))return j(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return j(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return j(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function j(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);nH&&(B.current=H);var U,D=w?r.createElement("div",{className:"".concat(T,"-pagination")},r.createElement(s.default,P({},B,{onChange:t.onPaginationChange,onShowSizeChange:t.onPaginationShowSizeChange}))):null,Q=N(x);if(w&&x.length>(B.current-1)*B.pageSize&&(Q=N(x).splice((B.current-1)*B.pageSize,B.pageSize)),U=R&&r.createElement("div",{style:{minHeight:53}}),Q.length>0){var V=Q.map((function(e,n){return t.renderItem(e,n)})),F=[];r.Children.forEach(V,(function(e,n){F.push(r.cloneElement(e,{key:t.keys[n]}))})),U=k?r.createElement(f.a,{gutter:k.gutter},F):r.createElement("ul",{className:"".concat(T,"-items")},F)}else v||R||(U=t.renderEmpty(T,a));var K=B.position||"bottom";return r.createElement("div",P({className:q},Object(c.default)(z,["rowKey","renderItem","locale"])),("top"===K||"both"===K)&&D,j&&r.createElement("div",{className:"".concat(T,"-header")},j),r.createElement(l.default,A,U,v),I&&r.createElement("div",{className:"".concat(T,"-footer")},I),S||("bottom"===K||"both"===K)&&D)};var n=e.pagination,o=n&&"object"===C(n)?n:{};return t.state={paginationCurrent:o.defaultCurrent||1,paginationSize:o.defaultPageSize||10},t}return t=p,(n=[{key:"getChildContext",value:function(){return{grid:this.props.grid,itemLayout:this.props.itemLayout}}},{key:"triggerPaginationEvent",value:function(e){var t=this;return function(n,r){var o=t.props.pagination;t.setState({paginationCurrent:n,paginationSize:r}),o&&o[e]&&o[e](n,r)}}},{key:"isSomethingAfterLastItem",value:function(){var e=this.props,t=e.loadMore,n=e.pagination,r=e.footer;return!!(t||n||r)}},{key:"render",value:function(){return r.createElement(u.a,null,this.renderList)}}])&&I(t.prototype,n),o&&I(t,o),p}(r.Component);R.Item=x,R.childContextTypes={grid:o.any,itemLayout:o.string},R.defaultProps={dataSource:[],bordered:!1,split:!0,loading:!1,pagination:!1}}}]);