1 line
16 KiB
JavaScript
1 line
16 KiB
JavaScript
(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;o<t;o++)n[o-1]=arguments[o];return r.cloneElement.apply(r,[e].concat(n))}function d(e){return(d="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 y(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function h(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function g(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 b(e,t){return(b=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=S(e);if(t){var o=S(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return E(this,n)}}function E(e,t){return!t||"object"!==d(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function S(e){return(S=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function w(){return(w=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)}var k=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 o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n};function O(e,t){return e[t]&&Math.floor(24/e[t])}var x=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&&b(e,t)}(c,e);var t,n,o,a=v(c);function c(){var e;return h(this,c),(e=a.apply(this,arguments)).renderItem=function(t){var n=t.getPrefixCls,o=e.context,a=o.grid,c=o.itemLayout,l=e.props,u=l.prefixCls,s=l.children,f=l.actions,d=l.extra,h=l.className,g=k(l,["prefixCls","children","actions","extra","className"]),b=n("list",u),v=f&&f.length>0&&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);n<t;n++)r[n]=e[n];return r}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 _(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function I(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 L(e,t){return(L=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function z(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=A(e);if(t){var o=A(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return T(this,n)}}function T(e,t){return!t||"object"!==C(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function A(e){return(A=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}x.Meta=function(e){return r.createElement(u.a,null,(function(t){var n=t.getPrefixCls,o=e.prefixCls,a=e.className,c=e.avatar,l=e.title,u=e.description,s=k(e,["prefixCls","className","avatar","title","description"]),f=n("list",o),p=i()("".concat(f,"-item-meta"),a),m=r.createElement("div",{className:"".concat(f,"-item-meta-content")},l&&r.createElement("h4",{className:"".concat(f,"-item-meta-title")},l),u&&r.createElement("div",{className:"".concat(f,"-item-meta-description")},u));return r.createElement("div",w({},s,{className:p}),c&&r.createElement("div",{className:"".concat(f,"-item-meta-avatar")},c),(l||u)&&m)}))},x.contextTypes={grid:o.any,itemLayout:o.string};var M=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 o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n},R=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&&L(e,t)}(p,e);var t,n,o,a=z(p);function p(e){var t;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,p),(t=a.call(this,e)).defaultPaginationProps={current:1,total:0},t.keys={},t.onPaginationChange=t.triggerPaginationEvent("onChange"),t.onPaginationShowSizeChange=t.triggerPaginationEvent("onShowSizeChange"),t.renderItem=function(e,n){var r,o=t.props,a=o.renderItem,i=o.rowKey;return a?((r="function"==typeof i?i(e):"string"==typeof i?e[i]:e.key)||(r="list-item-".concat(n)),t.keys[n]=r,a(e,n)):null},t.renderEmpty=function(e,n){var o=t.props.locale;return r.createElement("div",{className:"".concat(e,"-empty-text")},o&&o.emptyText||n("List"))},t.renderList=function(e){var n,o=e.getPrefixCls,a=e.renderEmpty,u=t.state,p=u.paginationCurrent,m=u.paginationSize,d=t.props,y=d.prefixCls,h=d.bordered,g=d.split,b=d.className,v=d.children,E=d.itemLayout,S=d.loadMore,w=d.pagination,k=d.grid,O=d.dataSource,x=void 0===O?[]:O,C=d.size,j=d.header,I=d.footer,L=d.loading,z=M(d,["prefixCls","bordered","split","className","children","itemLayout","loadMore","pagination","grid","dataSource","size","header","footer","loading"]),T=o("list",y),A=L;"boolean"==typeof A&&(A={spinning:A});var R=A&&A.spinning,W="";switch(C){case"large":W="lg";break;case"small":W="sm"}var q=i()(T,b,(_(n={},"".concat(T,"-vertical"),"vertical"===E),_(n,"".concat(T,"-").concat(W),W),_(n,"".concat(T,"-split"),g),_(n,"".concat(T,"-bordered"),h),_(n,"".concat(T,"-loading"),R),_(n,"".concat(T,"-grid"),k),_(n,"".concat(T,"-something-after-last-item"),t.isSomethingAfterLastItem()),n)),B=P(P(P({},t.defaultPaginationProps),{total:x.length,current:p,pageSize:m}),w||{}),H=Math.ceil(B.total/B.pageSize);B.current>H&&(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}}}]); |