forked from bytedance/Elkeid
-
Notifications
You must be signed in to change notification settings - Fork 0
/
6932d2.70.min.js
1 lines (1 loc) · 13.9 KB
/
6932d2.70.min.js
1
(window.webpackJsonp=window.webpackJsonp||[]).push([[70],{319:function(e,t,n){"use strict";n.r(t);var r=n(5),s=n.n(r),i=n(4),a=n.n(i),o=n(0),c=n.n(o),l=n(6);function u(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function h(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?u(Object(n),!0).forEach((function(t){a()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):u(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function d(e,t){var n=Object(o.useContext)(l.a).prefixCls,r=e.spin,i=e.className,a=h(h({ref:t},e),{},{className:"".concat(i?i+" ":"").concat(n,"-icon ").concat(n,"-icon-download")});return r&&(a.className="".concat(a.className," ").concat(n,"-icon-loading")),delete a.spin,delete a.isIcon,c.a.createElement("svg",s()({fill:"none",stroke:"currentColor",strokeWidth:"4",viewBox:"0 0 48 48",width:"1em",height:"1em"},a),c.a.createElement("path",{d:"m33.072 22.071-9.07 9.071-9.072-9.07M24 5v26m16 4v6H8v-6"}))}var p=c.a.forwardRef(d);p.defaultProps={isIcon:!0},p.displayName="IconDownload";var f,m,b=p,v=n(41),O=n.n(v),g=(n(313),n(220)),y=n(17),E=(n(309),n(92)),N=n(578),w=n.n(N),x=n(26),j=n.n(x),_=n(643),S=n(579),P=n(563),C=n(562),k=n(40),D=n(559),I=n(34);function L(){return(L=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 T,R=function(e){return c.a.createElement("svg",L({width:16,height:20,fill:"none"},e),c.a.createElement("mask",{id:"export-file_svg__a",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:0,y:0,width:16,height:20},f||(f=c.a.createElement("path",{d:"M1.103 0h10.24c.146 0 .285.056.389.157l4.105 3.985c.104.101.163.24.163.384v14.393c0 .597-.494 1.081-1.103 1.081H1.103C.494 20 0 19.516 0 18.919V1.08C0 .484.494 0 1.103 0z",fill:"#fff"}))),m||(m=c.a.createElement("g",{mask:"url(#export-file_svg__a)"},c.a.createElement("path",{d:"M1.103 0h10.24c.146 0 .285.056.389.157l4.105 3.985c.104.101.163.24.163.384v14.393c0 .597-.494 1.081-1.103 1.081H1.103C.494 20 0 19.516 0 18.919V1.08C0 .484.494 0 1.103 0z",fill:"#1664FF"}),c.a.createElement("path",{fill:"#fff",d:"M4 6h8v1H4zM4 10h8v1H4zM4 14h6v1H4z"}),c.a.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.57 0h4.414v4.324h-3.31c-.61 0-1.104-.484-1.104-1.08V0z",fill:"#94BFFF"}))))},H="/data00/webprojectdev/hids_open/src/pages/host-list/export-host-util.tsx",F=S.a.div(T||(T=w()(["\n height: 36px;\n width: 100%;\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 0 12px;\n background: #f6f7fb;\n border-radius: 2px;\n"])));t.default=function(e){var t=Object(I.a)(),n="EXPORT_NOTIFY_ID",r=new _.SSE("".concat(k.a,"/api/v6/asset-center/ExportHosts"),{headers:{Token:t},method:"POST",payload:JSON.stringify(e)});r.addEventListener("open",(function(e){console.log("open",e)}),!1),r.addEventListener("progress",(function(e){console.log("progress",e);var t=JSON.parse(e.data)||{},s=null==t?void 0:t.data,i=s.export_total,a=s.export_count,o=s.status,l=s.file_name;if(o===D.ExportHostsStatusEnum.init||o===D.ExportHostsStatusEnum.exporting||o===D.ExportHostsStatusEnum.saving){var u=Math.round(a/i*100);u>99&&(u=99),E.a.info({id:n,icon:c.a.createElement(y.a,{__source:{fileName:H,lineNumber:71,columnNumber:17}}),title:"正在导出",duration:9e5,content:c.a.createElement(F,{__source:{fileName:H,lineNumber:75,columnNumber:13}},c.a.createElement(R,{style:{marginRight:"12px"},__source:{fileName:H,lineNumber:76,columnNumber:15}}),c.a.createElement(P.a,{content:l,__source:{fileName:H,lineNumber:77,columnNumber:15}}),c.a.createElement(g.a,{percent:u,type:"circle",size:"mini",style:{width:"16px",height:"16px"},__source:{fileName:H,lineNumber:78,columnNumber:15}}))})}else o===D.ExportHostsStatusEnum.success&&(E.a.success({id:n,title:"导出成功",duration:9e5,content:c.a.createElement(F,{__source:{fileName:H,lineNumber:93,columnNumber:13}},c.a.createElement(R,{style:{marginRight:"12px"},__source:{fileName:H,lineNumber:94,columnNumber:15}}),c.a.createElement(P.a,{content:l,__source:{fileName:H,lineNumber:95,columnNumber:15}}),c.a.createElement(C.a,{style:{marginRight:"-8px"},onClick:O()(j.a.mark((function e(){return j.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Object(D.DownloadFile)({params:{file_name:l}});case 2:E.a.remove(n);case 3:case"end":return e.stop()}}),e)}))),icon:c.a.createElement(b,{__source:{fileName:H,lineNumber:106,columnNumber:23}}),__source:{fileName:H,lineNumber:96,columnNumber:15}},"下载"))}),r.close())}),!1),r.addEventListener("error",(function(e){console.log("error",e),r.close()}),!1),r.stream()}},559:function(e,t,n){"use strict";n.r(t),n.d(t,"DescribeHostStatistics",(function(){return i})),n.d(t,"DescribeHosts",(function(){return a})),n.d(t,"ExportHostsStatusEnum",(function(){return r})),n.d(t,"ExportHosts",(function(){return o})),n.d(t,"DownloadFile",(function(){return c})),n.d(t,"DescribeTags",(function(){return l})),n.d(t,"AddTags",(function(){return u})),n.d(t,"DeleteTags",(function(){return h})),n.d(t,"UpdateTags",(function(){return d})),n.d(t,"DescribePlatforms",(function(){return p})),n.d(t,"DescribeIDCs",(function(){return f}));var r,s=n(40),i=function(){return Object(s.b)({method:"get",url:"/api/v6/asset-center/DescribeHostStatistics"},"获取主机统计信息")},a=function(e){var t=e.data,n=e.params;return Object(s.b)({method:"post",url:"/api/v6/asset-center/DescribeHosts",data:t,params:n},"获取主机列表信息")};!function(e){e.init="init",e.exporting="exporting",e.saving="saving",e.success="success",e.failed="failed"}(r||(r={}));var o=function(e){var t=e.data;return Object(s.b)({method:"post",url:"/api/v6/asset-center/ExportHosts",data:t},"导出主机信息")},c=function(e){var t=e.params;return Object(s.b)({method:"get",url:"/api/v6/shared/Download/".concat(t.file_name),responseType:"blob"},"下载文件",!1,!1)},l=function(){return Object(s.b)({method:"get",url:"/api/v6/asset-center/DescribeTags"},"获取标签信息")},u=function(e){var t=e.data;return Object(s.b)({method:"post",url:"/api/v6/asset-center/AddTags",data:t},"添加标签",!0)},h=function(e){var t=e.data;return Object(s.b)({method:"post",url:"/api/v6/asset-center/DeleteTags",data:t},"删除标签",!0)},d=function(e){var t=e.data;return Object(s.b)({method:"post",url:"/api/v6/asset-center/UpdateTags",data:t},"修改标签",!0)},p=function(){return Object(s.b)({method:"get",url:"/api/v6/asset-center/DescribePlatform"},"获取操作系统类型")},f=function(){return Object(s.b)({method:"get",url:"/api/v6/asset-center/DescribeIDC"},"获取数据中心类型")}},560:function(e,t,n){"use strict";n(13),n(570)},561:function(e,t,n){"use strict";var r=n(0),s=n.n(r),i=n(5),a=n.n(i),o=n(4),c=n.n(o),l=n(6);function u(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function h(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?u(Object(n),!0).forEach((function(t){c()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):u(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function d(e,t){var n=Object(r.useContext)(l.a).prefixCls,i=e.spin,o=e.className,c=h(h({ref:t},e),{},{className:"".concat(o?o+" ":"").concat(n,"-icon ").concat(n,"-icon-link")});return i&&(c.className="".concat(c.className," ").concat(n,"-icon-loading")),delete c.spin,delete c.isIcon,s.a.createElement("svg",a()({fill:"none",stroke:"currentColor",strokeWidth:"4",viewBox:"0 0 48 48",width:"1em",height:"1em"},c),s.a.createElement("path",{d:"m14.1 25.414-4.95 4.95a6 6 0 0 0 8.486 8.485l8.485-8.485a6 6 0 0 0 0-8.485m7.779.707 4.95-4.95a6 6 0 1 0-8.486-8.485l-8.485 8.485a6 6 0 0 0 0 8.485"}))}var p=s.a.forwardRef(d);p.defaultProps={isIcon:!0},p.displayName="IconLink";var f=p,m=n(1),b=n(3),v=n(7),O=function(){return(O=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var s in t=arguments[n])Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s]);return e}).apply(this,arguments)},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 s=0;for(r=Object.getOwnPropertySymbols(e);s<r.length;s++)t.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(e,r[s])&&(n[r[s]]=e[r[s]])}return n},y={hoverable:!0};var E=Object(r.forwardRef)((function(e,t){var n,i=Object(r.useContext)(b.a),a=i.getPrefixCls,o=i.componentConfig,c=Object(v.a)(e,y,null==o?void 0:o.Link),l=c.className,u=c.style,h=c.children,d=c.icon,p=c.status,E=c.disabled,N=c.hoverable,w=g(c,["className","style","children","icon","status","disabled","hoverable"]),x=a("link"),j="href"in c?"a":"span";return s.a.createElement(j,O({className:Object(m.a)(x,(n={},n[x+"-disabled"]=E,n[x+"-is-"+p]=p,n[x+"-with-icon"]=d,n[x+"-hoverless"]=!N,n),l),ref:t},w,{style:u,onClick:function(e){E?(e.preventDefault(),e.stopPropagation()):c.onClick&&c.onClick(e)}}),d?s.a.createElement("span",{className:x+"-icon"},!0===d?s.a.createElement(f,null):d):null,h)}));E.displayName="Link";t.a=E},562:function(e,t,n){"use strict";n(560);var r=n(561),s=n(5),i=n.n(s),a=n(0),o=n.n(a);t.a=function(e){var t=i()({},e);return o.a.createElement(r.a,i()({style:{padding:"0 8px"}},t,{__source:{fileName:"/data00/webprojectdev/hids_open/src/components/common/text-button/index.tsx",lineNumber:7,columnNumber:10}}))}},563:function(e,t,n){"use strict";n(302);var r=n(121),s=n(4),i=n.n(s),a=n(0),o=n.n(a),c="/data00/webprojectdev/hids_open/src/components/common/ellipsis-box/index.tsx";function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function u(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?l(Object(n),!0).forEach((function(t){i()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}t.a=function(e){var t=e.content,n=e.style;return o.a.createElement(r.a.Paragraph,{style:u({marginBottom:0},n),ellipsis:{rows:1,showTooltip:{type:"tooltip",props:{content:o.a.createElement("span",{style:{wordBreak:"break-all"},__source:{fileName:c,lineNumber:17,columnNumber:29}},t)}}},key:t,__source:{fileName:c,lineNumber:11,columnNumber:5}},t)}},570:function(e,t,n){},643:function(e,t,n){var r=function(e,t){if(!(this instanceof r))return new r(e,t);this.INITIALIZING=-1,this.CONNECTING=0,this.OPEN=1,this.CLOSED=2,this.url=e,t=t||{},this.headers=t.headers||{},this.payload=void 0!==t.payload?t.payload:"",this.method=t.method||(this.payload?"POST":"GET"),this.withCredentials=!!t.withCredentials,this.FIELD_SEPARATOR=":",this.listeners={},this.xhr=null,this.readyState=this.INITIALIZING,this.progress=0,this.chunk="",this.addEventListener=function(e,t){void 0===this.listeners[e]&&(this.listeners[e]=[]),-1===this.listeners[e].indexOf(t)&&this.listeners[e].push(t)},this.removeEventListener=function(e,t){if(void 0!==this.listeners[e]){var n=[];this.listeners[e].forEach((function(e){e!==t&&n.push(e)})),0===n.length?delete this.listeners[e]:this.listeners[e]=n}},this.dispatchEvent=function(e){if(!e)return!0;e.source=this;var t="on"+e.type;return(!this.hasOwnProperty(t)||(this[t].call(this,e),!e.defaultPrevented))&&(!this.listeners[e.type]||this.listeners[e.type].every((function(t){return t(e),!e.defaultPrevented})))},this._setReadyState=function(e){var t=new CustomEvent("readystatechange");t.readyState=e,this.readyState=e,this.dispatchEvent(t)},this._onStreamFailure=function(e){this.dispatchEvent(new CustomEvent("error")),this.close()},this._onStreamProgress=function(e){if(this.xhr)if(200===this.xhr.status){this.readyState==this.CONNECTING&&(this.dispatchEvent(new CustomEvent("open")),this._setReadyState(this.OPEN));var t=this.xhr.responseText.substring(this.progress);this.progress+=t.length,t.split(/(\r\n|\r|\n){2}/g).forEach(function(e){0===e.trim().length?(this.dispatchEvent(this._parseEventChunk(this.chunk.trim())),this.chunk=""):this.chunk+=e}.bind(this))}else this._onStreamFailure(e)},this._onStreamLoaded=function(e){this._onStreamProgress(e),this.dispatchEvent(this._parseEventChunk(this.chunk)),this.chunk=""},this._parseEventChunk=function(e){if(!e||0===e.length)return null;var t={id:null,retry:null,data:"",event:"message"};e.split(/\n|\r\n|\r/).forEach(function(e){var n=(e=e.trimRight()).indexOf(this.FIELD_SEPARATOR);if(!(n<=0)){var r=e.substring(0,n);if(r in t){var s=e.substring(n+1).trimLeft();"data"===r?t[r]+=s:t[r]=s}}}.bind(this));var n=new CustomEvent(t.event);return n.data=t.data,n.id=t.id,n},this._checkStreamClosed=function(){this.xhr&&this.xhr.readyState===XMLHttpRequest.DONE&&this._setReadyState(this.CLOSED)},this.stream=function(){for(var e in this._setReadyState(this.CONNECTING),this.xhr=new XMLHttpRequest,this.xhr.addEventListener("progress",this._onStreamProgress.bind(this)),this.xhr.addEventListener("load",this._onStreamLoaded.bind(this)),this.xhr.addEventListener("readystatechange",this._checkStreamClosed.bind(this)),this.xhr.addEventListener("error",this._onStreamFailure.bind(this)),this.xhr.addEventListener("abort",this._onStreamFailure.bind(this)),this.xhr.open(this.method,this.url),this.headers)this.xhr.setRequestHeader(e,this.headers[e]);this.xhr.withCredentials=this.withCredentials,this.xhr.send(this.payload)},this.close=function(){this.readyState!==this.CLOSED&&(this.xhr.abort(),this.xhr=null,this._setReadyState(this.CLOSED))}};t.SSE=r}}]);