Conversation
feature:Call Alibaba Cloud asset management to count cloud assets.
… out due to the large amount of account asset data, causing an exception
# Conflicts: # collector/alicloud/collector/resourcecenter/resource_center.go
…uring the collector runtime
…t monitoring (antgroup#46) * feat:Add the function of reporting CPU, disk and memory information during the collector runtime * feat:Alibaba Cloud SDK supports the configuration of proxy servers * fix:Optimize log printing and rule synchronization
* fix:save cloud account --------- Co-authored-by: j3ttt <86825323+j3ttt@users.noreply.github.com>
fix: 优化任务队列处理逻辑 refactor: 重构权限拦截器逻辑
fix: 调整权限拦截器日志级别
fix: 调整云账户扫描状态判断时间阈值
refactor: 优化任务处理逻辑为独立方法
fix: 修复资源合并任务中的空指针问题 refactor: 重构规则查询服务使用内存分页 chore: 更新多个模块的依赖版本
chore: 更新静态资源文件
|
Important Installation incomplete: to start using Gemini Code Assist, please ask the organization owner(s) to visit the Gemini Code Assist Admin Console and sign the Terms of Services. |
Reviewer's GuideThis PR standardizes the database initialization script formatting, updates the backend user initialization to enforce the admin role, corrects a front-end form field’s default type and value, and refreshes hashed static resource references after rebuilding. Class diagram for updated User domain logicclassDiagram
class User {
+String userId
+String username
+String roleName
+String status
+static User createDefaultUser()
+static User initDefaultUser(User user)
}
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey @jietian-sts - I've reviewed your changes - here's some feedback:
- This PR contains large build artifacts (compiled Umi bundles and hashed filenames in index.html) that shouldn’t be committed; please remove generated files and rely on the build process instead.
- The SQL init script has been entirely re-indented, obscuring the actual functional changes—consider splitting pure formatting updates into a separate commit or using an automated formatter.
- Hard-coding the new Umi hash in index.html and committing the built file indicates build artifacts are managed manually; please automate versioned script injection or exclude artifacts from source control.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- This PR contains large build artifacts (compiled Umi bundles and hashed filenames in index.html) that shouldn’t be committed; please remove generated files and rely on the build process instead.
- The SQL init script has been entirely re-indented, obscuring the actual functional changes—consider splitting pure formatting updates into a separate commit or using an automated formatter.
- Hard-coding the new Umi hash in index.html and committing the built file indicates build artifacts are managed manually; please automate versioned script injection or exclude artifacts from source control.
## Individual Comments
### Comment 1
<location> `db/init.sql:310` </location>
<code_context>
- `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
- `gmt_create` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
- `gmt_modified` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
- `associated_entity_list` varchar(1) DEFAULT NULL COMMENT '关联身份实体列表',
- `associated_entity_number` int(11) DEFAULT NULL COMMENT '关联数量',
- PRIMARY KEY(`id`)
</code_context>
<issue_to_address>
varchar(1) may be too restrictive for associated_entity_list.
If you need to store multiple identifiers, consider increasing the column length or switching to a type like TEXT or JSON.
</issue_to_address>
### Comment 2
<location> `client/src/pages/CloudAccount/AccountList/components/EditModalForm.tsx:324` </location>
<code_context>
name="enableInverseSelection"
tooltip={intl.formatMessage({ id: 'cloudAccount.extend.tooltip.selection.mode' })}
style={{ marginTop: '8px', marginBottom: 0 }}
+ initialValue={false}
>
{intl.formatMessage({ id: 'cloudAccount.extend.title.cloud.services.inverse.selection' })}
</code_context>
<issue_to_address>
Setting initialValue to false may override existing values unintentionally.
For edit forms, ensure initialValue does not overwrite existing data. Set it only for new records or initialize from current values.
</issue_to_address>
<suggested_fix>
<<<<<<< SEARCH
initialValue={false}
=======
initialValue={rest?.enableInverseSelection ?? false}
>>>>>>> REPLACE
</suggested_fix>
### Comment 3
<location> `app/application/src/main/java/com/alipay/application/service/system/domain/User.java:82` </location>
<code_context>
return user;
}
+ public static User initDefaultUser(User user) {
+ user.setUserId(DEFAULT_USER_ID);
+ user.setUsername(DEFAULT_USER_ID);
+ user.setRoleName(RoleNameType.admin);
+ user.setStatus(Status.valid);
+ return user;
+ }
+
</code_context>
<issue_to_address>
initDefaultUser mutates the input User, which may lead to side effects.
Directly modifying the input User may cause issues if it's used elsewhere. Consider returning a new User or clearly documenting that the method mutates its argument.
</issue_to_address>
### Comment 4
<location> `app/application/src/main/java/com/alipay/application/service/system/job/SystemInitializer.java:136` </location>
<code_context>
if (user == null) {
User defaultUser = User.createDefaultUser();
userRepository.save(defaultUser);
+ }else {
+ User.initDefaultUser(user);
+ userRepository.save(user);
}
</code_context>
<issue_to_address>
Re-saving an existing user after mutation may overwrite other fields.
initDefaultUser modifies multiple fields, which may overwrite existing user data. To prevent data loss, update only the required fields or use a partial update.
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
| `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键', | ||
| `gmt_create` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', | ||
| `gmt_modified` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间', | ||
| `associated_entity_list` varchar(1) DEFAULT NULL COMMENT '关联身份实体列表', |
There was a problem hiding this comment.
issue: varchar(1) may be too restrictive for associated_entity_list.
If you need to store multiple identifiers, consider increasing the column length or switching to a type like TEXT or JSON.
| name="enableInverseSelection" | ||
| tooltip={intl.formatMessage({ id: 'cloudAccount.extend.tooltip.selection.mode' })} | ||
| style={{ marginTop: '8px', marginBottom: 0 }} | ||
| initialValue={false} |
There was a problem hiding this comment.
suggestion (bug_risk): Setting initialValue to false may override existing values unintentionally.
For edit forms, ensure initialValue does not overwrite existing data. Set it only for new records or initialize from current values.
| initialValue={false} | |
| initialValue={rest?.enableInverseSelection ?? false} |
| @@ -79,4 +79,14 @@ public static User createDefaultUser() { | |||
| return user; | |||
There was a problem hiding this comment.
suggestion: initDefaultUser mutates the input User, which may lead to side effects.
Directly modifying the input User may cause issues if it's used elsewhere. Consider returning a new User or clearly documenting that the method mutates its argument.
| }else { | ||
| User.initDefaultUser(user); | ||
| userRepository.save(user); |
There was a problem hiding this comment.
issue (bug_risk): Re-saving an existing user after mutation may overwrite other fields.
initDefaultUser modifies multiple fields, which may overwrite existing user data. To prevent data loss, update only the required fields or use a partial update.
| @@ -0,0 +1 @@ | |||
| (self.webpackChunk=self.webpackChunk||[]).push([[9418],{91618:function(ie,Q,t){"use strict";t.d(Q,{Z:function(){return e}});var G=t(62435),v=Object.defineProperty,W=Object.getOwnPropertySymbols,j=Object.prototype.hasOwnProperty,ee=Object.prototype.propertyIsEnumerable,h=(l,n,r)=>n in l?v(l,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):l[n]=r,Ae=(l,n)=>{for(var r in n||(n={}))j.call(n,r)&&h(l,r,n[r]);if(W)for(var r of W(n))ee.call(n,r)&&h(l,r,n[r]);return l};const b=l=>React.createElement("svg",Ae({width:8,height:8,xmlns:"http://www.w3.org/2000/svg"},l),React.createElement("title",null,"\u5931\u8D25"),React.createElement("path",{d:"M4 0a4 4 0 1 1 0 8 4 4 0 0 1 0-8Zm-.81 2.784a.287.287 0 1 0-.406.405l.81.811-.81.81a.287.287 0 1 0 .405.406L4 4.406l.81.81a.287.287 0 1 0 .406-.405L4.406 4l.81-.81a.287.287 0 1 0-.405-.406L4 3.594l-.81-.81Z",fill:"#FF3931",fillRule:"nonzero"}));var se="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iOCIgaGVpZ2h0PSI4IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGQ9Ik00IDBhNCA0IDAgMSAxIDAgOCA0IDQgMCAwIDEgMC04Wm0tLjgxIDIuNzg0YS4yODcuMjg3IDAgMSAwLS40MDYuNDA1bC44MS44MTEtLjgxLjgxYS4yODcuMjg3IDAgMSAwIC40MDUuNDA2TDQgNC40MDZsLjgxLjgxYS4yODcuMjg3IDAgMSAwIC40MDYtLjQwNUw0LjQwNiA0bC44MS0uODFhLjI4Ny4yODcgMCAxIDAtLjQwNS0uNDA2TDQgMy41OTRsLS44MS0uODFaIiBmaWxsPSIjRkYzOTMxIiBmaWxsLXJ1bGU9Im5vbnplcm8iLz48L3N2Zz4=",D=Object.defineProperty,L=Object.getOwnPropertySymbols,te=Object.prototype.hasOwnProperty,N=Object.prototype.propertyIsEnumerable,ae=(l,n,r)=>n in l?D(l,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):l[n]=r,me=(l,n)=>{for(var r in n||(n={}))te.call(n,r)&&ae(l,r,n[r]);if(L)for(var r of L(n))N.call(n,r)&&ae(l,r,n[r]);return l};const F=l=>React.createElement("svg",me({width:8,height:8,xmlns:"http://www.w3.org/2000/svg"},l),React.createElement("title",null,"\u901A\u8FC7"),React.createElement("path",{d:"M4 0a4 4 0 1 1 0 8 4 4 0 0 1 0-8Zm1.712 2.788a.3.3 0 0 0-.424 0L3.502 4.576l-.79-.787a.3.3 0 0 0-.424.425l1.003.999a.3.3 0 0 0 .424-.001l1.997-2a.3.3 0 0 0 0-.424Z",fill:"#379E0E",fillRule:"nonzero"}));var C="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iOCIgaGVpZ2h0PSI4IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGQ9Ik00IDBhNCA0IDAgMSAxIDAgOCA0IDQgMCAwIDEgMC04Wm0xLjcxMiAyLjc4OGEuMy4zIDAgMCAwLS40MjQgMEwzLjUwMiA0LjU3NmwtLjc5LS43ODdhLjMuMyAwIDAgMC0uNDI0LjQyNWwxLjAwMy45OTlhLjMuMyAwIDAgMCAuNDI0LS4wMDFsMS45OTctMmEuMy4zIDAgMCAwIDAtLjQyNFoiIGZpbGw9IiMzNzlFMEUiIGZpbGwtcnVsZT0ibm9uemVybyIvPjwvc3ZnPg==",w=Object.defineProperty,I=Object.getOwnPropertySymbols,A=Object.prototype.hasOwnProperty,T=Object.prototype.propertyIsEnumerable,oe=(l,n,r)=>n in l?w(l,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):l[n]=r,X=(l,n)=>{for(var r in n||(n={}))A.call(n,r)&&oe(l,r,n[r]);if(I)for(var r of I(n))T.call(n,r)&&oe(l,r,n[r]);return l};const fe=l=>React.createElement("svg",X({width:8,height:8,xmlns:"http://www.w3.org/2000/svg"},l),React.createElement("title",null,"\u5F85\u64CD\u4F5C"),React.createElement("g",{fillRule:"nonzero",fill:"none"},React.createElement("path",{d:"M4 0a4 4 0 1 1 0 8 4 4 0 0 1 0-8Z",fill:"#FFB310"}),React.createElement("path",{d:"M3.775 2.412a.287.287 0 1 0-.573 0v1.71c0 .316.257.573.573.573h1.718a.287.287 0 1 0 0-.573H3.775v-1.71Z",fill:"#FFF1D4"})));var ce="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iOCIgaGVpZ2h0PSI4IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxnIGZpbGwtcnVsZT0ibm9uemVybyIgZmlsbD0ibm9uZSI+PHBhdGggZD0iTTQgMGE0IDQgMCAxIDEgMCA4IDQgNCAwIDAgMSAwLThaIiBmaWxsPSIjRkZCMzEwIi8+PHBhdGggZD0iTTMuNzc1IDIuNDEyYS4yODcuMjg3IDAgMSAwLS41NzMgMHYxLjcxYzAgLjMxNi4yNTcuNTczLjU3My41NzNoMS43MThhLjI4Ny4yODcgMCAxIDAgMC0uNTczSDMuNzc1di0xLjcxWiIgZmlsbD0iI0ZGRjFENCIvPjwvZz48L3N2Zz4=",Fe=t(66309),ve=t(53846),ue=t(86074),e=function(l){var n=l.state,r=(0,ue.jsx)(Fe.Z,{children:n||"-"});return["success","valid"].includes(n)?r=(0,ue.jsxs)(Fe.Z,{className:ve.Z.validTag,children:[(0,ue.jsx)("img",{src:C,alt:"VALID_ICON",className:ve.Z.imgResult}),"Valid"]}):["error","invalid","failed"].includes(n)?r=(0,ue.jsxs)(Fe.Z,{className:ve.Z.invalidTag,children:[(0,ue.jsx)("img",{src:se,alt:"VALID_ICON",className:ve.Z.imgResult}),"Invalid"]}):["waiting","wait"].includes(n)&&(r=(0,ue.jsxs)(Fe.Z,{className:ve.Z.waitingTag,children:[(0,ue.jsx)("img",{src:ce,alt:"WAITING_ICON",className:ve.Z.imgProcess}),"Waiting"]})),r}},24163:function(ie,Q,t){"use strict";var G=t(97857),v=t.n(G),W=t(25593),j=t(83062),ee=t(62435),h=t(86074),Ae=W.Z.Paragraph;Q.Z=function(b){var se=b.text,D=b.width,L=b.maxWidth,te=b.rows,N=te===void 0?2:te,ae=b.placement,me=ae===void 0?"top":ae,F=b.color,C=F===void 0?"rgba(0, 0, 0, 0.88)":F,w=b.link,I=w===void 0?!1:w,A=b.onClickCallBackFunc,T=b.style,oe=T===void 0?{}:T,X=b.copyable,fe=X===void 0?!1:X;return(0,h.jsx)("div",{style:{maxWidth:L,width:D},children:(0,h.jsx)(j.Z,{title:(0,h.jsx)("div",{children:se}),placement:me,children:(0,h.jsx)(Ae,{ellipsis:{rows:N},style:v()({marginBottom:0,color:C,cursor:I?"pointer":""},oe),onClick:A,copyable:fe,children:se})})})}},52078:function(ie,Q,t){"use strict";var G=t(97857),v=t.n(G),W=t(27997),j=t(62435),ee=t(86074),h=function(b){W.Mj.register({id:"json"});var se=b.value,D=se===void 0?"{}":se,L=b.onChange,te=b.editorStyle,N=te===void 0?{}:te,ae=b.editorKey,me=ae===void 0?"json-editor":ae,F=b.readOnly,C=F===void 0?!1:F,w=(0,j.useRef)(),I=(0,j.useRef)(),A=function(){var oe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"{}";try{return JSON.parse(oe),oe}catch(X){return console.warn("Invalid JSON string:",X),"{}"}};return(0,j.useEffect)(function(){if(w.current)return I.current?I.current.setValue(D):(I.current=W.j6.create(w.current,{value:A(D),language:"json",theme:"vs",readOnly:C,folding:!0,automaticLayout:!0}),I.current.onDidChangeModelContent(function(){var T=I.current.getValue();console.log("[JSONEditor] \u7F16\u8F91\u5668\u5185\u5BB9\u53D8\u66F4:",{newValue:T}),L==null||L(T)})),function(){if(I!=null&&I.current){var T;I==null||(T=I.current)===null||T===void 0||T.dispose(),I.current=null}}},[]),(0,j.useEffect)(function(){I.current&&D!==I.current.getValue()&&I.current.setValue(A(D))},[D]),(0,ee.jsx)("div",{ref:w,style:v()({height:360,borderRadius:4,overflow:"hidden"},N)},me)};Q.Z=h},87958:function(ie,Q,t){"use strict";t.r(Q),t.d(Q,{default:function(){return Ot}});var G=t(39380),v=t(62435),W=t(97857),j=t.n(W),ee=t(15009),h=t.n(ee),Ae=t(99289),b=t.n(Ae),se=t(5574),D=t.n(se),L=t(24163),te=t(25593),N=t(99859),ae=t(17788),me=t(21532),F=t(71230),C=t(15746),w=t(86250),I=t(96074),A=t(45830),T={leftInfoLabel:"leftInfoLabel___SJHhs",rightInfoLabel:"rightInfoLabel___c8v5r",basicInfoValue:"basicInfoValue___Cwl01",accountModal:"accountModal___hexAB",sectionDivider:"sectionDivider___oQjeE",proxyCollapse:"proxyCollapse___dPuDK"},oe=t(91618),X={ALI_CLOUD:{type:"basic",fields:[{name:"ak",label:"AK",required:!0},{name:"sk",label:"SK",required:!0}],hasProxy:!0},HUAWEI_CLOUD:{type:"basic",fields:[{name:"ak",label:"AK",required:!0},{name:"sk",label:"SK",required:!0}]},BAIDU_CLOUD:{type:"basic",fields:[{name:"ak",label:"AK",required:!0},{name:"sk",label:"SK",required:!0}]},AWS:{type:"basic",fields:[{name:"ak",label:"AK",required:!0},{name:"sk",label:"SK",required:!0}]},TENCENT_CLOUD:{type:"basic",fields:[{name:"ak",label:"AK",required:!0},{name:"sk",label:"SK",required:!0}]},KINGSOFT_CLOUD:{type:"basic",fields:[{name:"ak",label:"AK",required:!0},{name:"sk",label:"SK",required:!0}]},AZURE:{type:"basic",fields:[{name:"ak",label:"AK",required:!0},{name:"sk",label:"SK",required:!0}]},GCP:{type:"json",fields:[{name:"credentialsJson",label:"GCP KEY",required:!0}]},ALI_CLOUD_PRIVATE:{type:"exclusive",fields:[{name:"ak",label:"AK",required:!0},{name:"sk",label:"SK",required:!0},{name:"endpoint",label:"Endpoint",required:!0},{name:"regionId",label:"RegionId",required:!0}]},HUAWEI_CLOUD_PRIVATE:{type:"extend",fields:[{name:"ak",label:"AK",required:!0},{name:"sk",label:"SK",required:!0},{name:"iamEndpoint",label:"Iam_Endpoint",required:!0},{name:"ecsEndpoint",label:"Ecs_Endpoint",required:!0},{name:"elbEndpoint",label:"Elb_Endpoint",required:!0},{name:"evsEndpoint",label:"Evs_Endpoint",required:!0},{name:"vpcEndpoint",label:"Vpc_Endpoint",required:!0},{name:"obsEndpoint",label:"Obs_Endpoint",required:!0},{name:"regionId",label:"RegionId",required:!0},{name:"projectId",label:"ProjectId"}]}},fe={cloudAccountId:[{required:!0,message:"Please enter your cloud account ID"}],alias:[{required:!0,message:"Please enter the alias of your cloud account"}],tenantId:[{required:!0,message:"Please select the tenant"}],platform:[{required:!0,message:"Please select the cloud platform"}]},ce=["GCP"],Fe=null,ve=null,ue=null,e=t(86074),l=te.Z.Text,n=function(u){var y,H,a=u.accountInfo,J=u.visible,E=u.onCancel,i=u.tenantListAll,P=u.resourceTypeList,Z=(0,A.useIntl)(),Y=N.Z.useForm(),q=D()(Y,1),d=q[0],s=ce!=null&&ce.includes(a==null?void 0:a.platform)?600:500;return(0,e.jsxs)(ae.Z,{title:(0,e.jsx)("div",{style:{fontSize:16,fontWeight:500},children:Z.formatMessage({id:"cloudAccount.extend.title.accountInfo"})}),open:J,onCancel:E,footer:null,width:800,style:{minHeight:s},destroyOnClose:!0,children:[(0,e.jsx)(me.ZP,{theme:{components:{Form:{labelColor:"rgba(74, 74, 74, 1)",colorTextHeading:"rgba(74, 74, 74, 1)"}}},children:(0,e.jsxs)(N.Z,{form:d,layout:"vertical",children:[(0,e.jsxs)(F.Z,{children:[(0,e.jsxs)(C.Z,{span:12,children:[(0,e.jsxs)(F.Z,{style:{height:44},children:[(0,e.jsxs)("span",{className:T.leftInfoLabel,children:[Z.formatMessage({id:"cloudAccount.extend.title.accountId"}),"\xA0:"]}),(0,e.jsx)(L.Z,{style:{paddingTop:11,color:"#457aff"},text:(a==null?void 0:a.cloudAccountId)||"-",rows:1,maxWidth:100})]}),(0,e.jsxs)(F.Z,{style:{height:44},children:[(0,e.jsxs)("span",{className:T.leftInfoLabel,children:[Z.formatMessage({id:"cloudAccount.extend.title.alias"}),"\xA0:"]}),(0,e.jsx)(L.Z,{style:{paddingTop:11,color:"#457aff"},text:(a==null?void 0:a.alias)||"-",rows:1,maxWidth:100})]}),(0,e.jsxs)(F.Z,{style:{height:44},children:[(0,e.jsxs)("span",{className:T.leftInfoLabel,children:[Z.formatMessage({id:"cloudAccount.extend.title.platform"}),"\xA0:"]}),(0,e.jsx)(L.Z,{style:{paddingTop:11,color:"#457aff"},text:(P==null||(y=P.filter(function(g){return g.value===(a==null?void 0:a.platform)}))===null||y===void 0||(y=y.map(function(g){return Z.formatMessage({id:g.label})}))===null||y===void 0?void 0:y.toString())||"-",rows:1,maxWidth:100})]}),(0,e.jsxs)(F.Z,{style:{height:44},children:[(0,e.jsxs)("span",{className:T.leftInfoLabel,children:[Z.formatMessage({id:"common.select.label.tenant"}),"\xA0:"]}),(0,e.jsx)(L.Z,{style:{paddingTop:11,color:"#457aff"},text:(i==null||(H=i.find(function(g){return g.value===(a==null?void 0:a.tenantId)}))===null||H===void 0?void 0:H.label)||"-",rows:1,maxWidth:100})]})]}),(0,e.jsxs)(C.Z,{span:12,children:[(0,e.jsxs)(F.Z,{style:{height:44},children:[(0,e.jsxs)("span",{className:T.rightInfoLabel,children:[Z.formatMessage({id:"cloudAccount.extend.title.asset.number"}),"\xA0:"]}),(0,e.jsx)("span",{className:T.basicInfoValue,style:{color:"#457aff"},children:(a==null?void 0:a.resourceCount)||0})]}),(0,e.jsxs)(F.Z,{children:[(0,e.jsx)("span",{className:T.rightInfoLabel,style:{height:44},children:ce!=null&&ce.includes(a==null?void 0:a.platform)?"GCP KEY ".concat(Z.formatMessage({id:"common.link.text.status"})," : "):"AK/SK ".concat(Z.formatMessage({id:"common.link.text.status"})," : ")}),(0,e.jsx)(w.Z,{align:"center",children:(0,e.jsx)(oe.Z,{state:a==null?void 0:a.status})})]})]})]}),(0,e.jsx)(N.Z.Item,{label:Z.formatMessage({id:"cloudAccount.extend.title.lastScanTime"}),children:(0,e.jsx)(l,{style:{color:"rgba(74, 74, 74, 1)"},children:(a==null?void 0:a.lastScanTime)||" -"})}),(0,e.jsx)(N.Z.Item,{label:Z.formatMessage({id:"cloudAccount.extend.title.createTime"}),children:(0,e.jsx)(l,{style:{color:"rgba(74, 74, 74, 1)"},children:(a==null?void 0:a.gmtCreate)||"-"})}),(0,e.jsx)(N.Z.Item,{label:Z.formatMessage({id:"cloudAccount.extend.title.updateTime"}),children:(0,e.jsx)(l,{style:{color:"rgba(74, 74, 74, 1)"},children:(a==null?void 0:a.gmtModified)||"-"})})]})}),(0,e.jsx)(I.Z,{style:{margin:"18px 0 0 0",borderColor:"#457aff",opacity:.25}})]})},r=n,_e=t(13769),Xe=t.n(_e),ge=t(92635),qe=t(58638),et=t(45605),tt=t(25035),at=t(184),pe=t(5966),Ue=t(64317),nt=t(97462),rt=t(8214),st=t(63434),ot=t(3303),Ne=t(68872),de=t(83622),Re=t(83062),We=t(57381),Pe=t(32983),we=t(29448),lt=t(86548),it=t(52078),ct=function(u){var y=u.type,H=u.fields,a=u.accountId,J=u.visible,E=u.onVisibleChange,i=u.value,P=u.onChange,Z=(0,A.useIntl)(),Y=function(s,g){var m=j()({},i||{});m[s]=g,P==null||P(m)},q=function(s){var g=(s==null?void 0:s.trim())||"{}";P==null||P({credentialsJson:g})};return a&&!J?(0,e.jsx)(N.Z.Item,{label:Z.formatMessage({id:"cloudAccount.form.credential"}),name:"action",children:(0,e.jsx)(de.ZP,{type:"link",onClick:function(){return E(!0)},style:{padding:"4px 0",color:"#2f54eb"},children:(0,e.jsx)(lt.Z,{})})}):J?y==="json"?(0,e.jsx)(pe.Z,{name:"credentialsJson",label:"GCP KEY",initialValue:(i==null?void 0:i.credentialsJson)||"{}",rules:[{required:!0,validator:function(){var d=b()(h()().mark(function g(m,x){return h()().wrap(function(V){for(;;)switch(V.prev=V.next){case 0:if(x!=null&&x.trim()){V.next=2;break}throw new Error("Please enter a valid GCP KEY");case 2:V.prev=2,JSON.parse(x),V.next=9;break;case 6:throw V.prev=6,V.t0=V.catch(2),new Error("Please enter a valid GCP KEY in JSON format");case 9:case"end":return V.stop()}},g,null,[[2,6]])}));function s(g,m){return d.apply(this,arguments)}return s}()}],children:(0,e.jsx)(it.Z,{value:(i==null?void 0:i.credentialsJson)||"{}",onChange:q,editorStyle:{height:"240px"},editorKey:"CREDENTIALS_JSON_EDITOR"})}):(0,e.jsx)(e.Fragment,{children:H.map(function(d){var s=d.name;return(0,e.jsx)(pe.Z,{name:["credentials",s],label:d.label,rules:[{required:d.required}],fieldProps:{type:d.type||"text",onChange:function(m){return Y(s,m.target.value)}}},s)})}):null},ut=ct,dt=t(90672),mt=function(){var u=(0,A.useIntl)();return(0,e.jsx)(dt.Z,{name:"proxyConfig",label:u.formatMessage({id:"cloudAccount.form.proxy"}),placeholder:u.formatMessage({id:"cloudAccount.form.proxy.placeholder"})})},ft=mt,Ve=t(96486),vt=t(79930),gt=function(){var u=(0,A.useIntl)(),y=(0,v.useState)(!1),H=D()(y,2),a=H[0],J=H[1],E=(0,v.useState)([]),i=D()(E,2),P=i[0],Z=i[1],Y=(0,v.useCallback)(function(){var q=b()(h()().mark(function d(s){var g;return h()().wrap(function(x){for(;;)switch(x.prev=x.next){case 0:if(s!=null&&s.trim()){x.next=2;break}return x.abrupt("return");case 2:return J(!0),x.prev=3,x.next=6,(0,vt.queryGroupTypeList)({platformList:[s]});case 6:g=x.sent,(0,Ve.isEmpty)(g.content)?(Z([]),Ne.ZP.error(u.formatMessage({id:"cloudAccount.message.text.no.assets"}))):Z(g==null?void 0:g.content),x.next=14;break;case 10:x.prev=10,x.t0=x.catch(3),Ne.ZP.error("\u83B7\u53D6\u8D44\u6E90\u7C7B\u578B\u5217\u8868\u5931\u8D25"),Z([]);case 14:return x.prev=14,J(!1),x.finish(14);case 17:case"end":return x.stop()}},d,null,[[3,10,14,17]])}));return function(d){return q.apply(this,arguments)}}(),[u]);return{loading:a,resourceTypes:P,fetchResourceTypes:Y}},pt=["resourceTypeListForWeb","credentialMap","id","proxyConfig","platform"],ht=ot.Z.SHOW_CHILD,ke=te.Z.Text,xt=function(u){var y=(0,A.useModel)("rule"),H=y.platformList,a=(0,A.useModel)("tenant"),J=a.tenantListAll,E=gt(),i=E.loading,P=E.resourceTypes,Z=E.fetchResourceTypes,Y=N.Z.useForm(),q=D()(Y,1),d=q[0],s=(0,A.useIntl)(),g=u.editFormVisible,m=u.accountInfo,x=u.setEditFormVisible,Me=u.requestCurrentData,V=(0,v.useState)(!0),ye=D()(V,2),ne=ye[0],_=ye[1],$=(0,v.useState)("{}"),p=D()($,2),Se=p[0],Ce=p[1],be=function(R){var M=d.getFieldsValue(),B=M.platform;if(B){var f=X[B];if(f)if(f.type==="json"){var c=R.credentialsJson||"{}";Ce(c),d.setFieldsValue({credentials:{credentialsJson:c}})}else{var o=d.getFieldValue("credentials")||{},S=j()({},o);f.fields.forEach(function(k){var O=k.name;O in R&&R[O]!==void 0&&(S[O]=R[O])}),d.setFieldsValue({credentials:S})}}},Ze=function(){var U=b()(h()().mark(function R(){var M,B,f,c,o,S,k,O,De,K,Le,re,Te,Oe,ze,Je,$e;return h()().wrap(function(le){for(;;)switch(le.prev=le.next){case 0:if(M=d.getFieldsValue(),B=M.cloudAccountId,f=M.email,c=M.alias,o=M.tenantId,S=M.platform,k=M.resourceTypeList,O=M.site,De=M.owner,K=M.proxyConfig,Le=M.credentials,re=M.enableInverseSelection,Te={cloudAccountId:B,email:f,alias:c,tenantId:typeof o=="string"?parseInt(o,10):o,platform:S,resourceTypeList:k,site:O,owner:De,enableInverseSelection:re},Oe=X[S],Oe){le.next=6;break}return le.abrupt("return");case 6:return ne&&(Oe.type==="json"?Te.credentialsObj={credentialsJson:(Le==null?void 0:Le.credentialsJson)||Se}:(ze=j()({},Le||{}),Oe.fields.forEach(function(Nt){var Qe=Nt.name,Ye=d.getFieldValue(["credentials",Qe]);Ye!==void 0&&(ze[Qe]=Ye)}),Te.credentialsObj=ze)),Oe.hasProxy&&K&&(Te.proxyConfig=K),m.id&&(Te.id=m.id),le.next=11,(0,ge.saveCloudAccount)(Te);case 11:if(Je=le.sent,Je.msg!=="success"){le.next=18;break}return $e=m.id?"common.message.text.edit.success":"common.message.text.create.success",Ne.ZP.success(s.formatMessage({id:$e})),x(!1),le.next=18,Me();case 18:case"end":return le.stop()}},R)}));return function(){return U.apply(this,arguments)}}();(0,v.useEffect)(function(){if(g&&m.id){var U;_(!1);var R=m.resourceTypeListForWeb,M=m.credentialMap,B=m.id,f=m.proxyConfig,c=m.platform,o=Xe()(m,pt),S=j()(j()({},o),{},{credentials:M||{},resourceTypeList:R||[],proxyConfig:f||void 0,platform:c||"",enableInverseSelection:o.enableInverseSelection||!1});c&&((U=X[c])===null||U===void 0?void 0:U.type)==="json"&&M!==null&&M!==void 0&&M.credentialsJson&&Ce(M.credentialsJson),d.setFieldsValue(S),m.platform&&Z(m.platform)}},[g,m]);var Ee=function(){d.resetFields()},Ie=function(){x(!1),Ee()};return(0,e.jsxs)(at.a,{labelCol:{span:5},wrapperCol:{span:17},title:(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("span",{style:{marginRight:4},children:s.formatMessage({id:m.id?"cloudAccount.extend.title.edit":"cloudAccount.extend.title.add"})}),(0,e.jsxs)(de.ZP,{size:"small",type:"link",href:"https://cloudrec.yuque.com/org-wiki-cloudrec-iew3sz/hocvhx/fetbofdu8dx15q73",target:"_blank",style:{color:"#2f54eb",gap:4},children:[(0,e.jsx)(qe.Z,{}),(0,e.jsx)("span",{children:s.formatMessage({id:"common.link.text.help.center"})})]})]}),width:720,form:d,drawerProps:{destroyOnClose:!0,onClose:Ie,styles:{body:{paddingTop:24}}},open:g,onFinish:Ze,layout:"horizontal",children:[(0,e.jsx)(I.Z,{className:T.sectionDivider,dashed:!0,children:(0,e.jsx)(ke,{italic:!0,children:s.formatMessage({id:"cloudAccount.extend.title.basic.information"})})}),(0,e.jsxs)(F.Z,{children:[(0,e.jsx)(C.Z,{span:24,children:(0,e.jsx)(pe.Z,{disabled:!!m.id,name:"cloudAccountId",label:s.formatMessage({id:"cloudAccount.extend.title.account.id"}),rules:fe.cloudAccountId,fieldProps:{suffix:!!m.id&&(0,e.jsx)(Re.Z,{title:"\u4E91\u8D26\u53F7ID\u4E3A\u4E91\u5E73\u53F0\u4E3B\u8D26\u53F7ID\uFF0C\u521B\u5EFA\u540E\u65E0\u6CD5\u4FEE\u6539",children:(0,e.jsx)(et.Z,{style:{color:"rgba(0,0,0,.45)"}})})}})}),(0,e.jsx)(C.Z,{span:24,children:(0,e.jsx)(pe.Z,{name:"email",label:s.formatMessage({id:"cloudAccount.extend.title.account.email"})})}),(0,e.jsx)(C.Z,{span:24,children:(0,e.jsx)(pe.Z,{name:"alias",label:s.formatMessage({id:"cloudAccount.extend.title.account.alias"}),rules:fe.alias})}),(0,e.jsx)(C.Z,{span:24,children:(0,e.jsx)(Ue.Z,{label:s.formatMessage({id:"common.select.label.tenant"}),name:"tenantId",rules:fe.tenantId,options:J})}),(0,e.jsx)(C.Z,{span:24,children:(0,e.jsx)(pe.Z,{name:"owner",label:"Owner"})}),(0,e.jsx)(C.Z,{span:24,children:(0,e.jsx)(Ue.Z,{label:s.formatMessage({id:"cloudAccount.extend.title.cloud.platform"}),name:"platform",rules:fe.platform,options:(0,we.T$)(H,"start"),onChange:function(R){m.id&&_(!1),d.setFieldValue("resourceTypeList",void 0),Z(R)}})})]}),(0,e.jsx)(nt.Z,{name:["platform"],children:function(R){var M=R.platform;if(!M)return null;var B=X[M];return B?(0,e.jsxs)(F.Z,{children:[(0,e.jsxs)(C.Z,{span:24,children:[(0,e.jsx)(I.Z,{className:T.sectionDivider,dashed:!0,children:(0,e.jsx)(ke,{italic:!0,children:s.formatMessage({id:"cloudAccount.extend.title.detailed.configuration"})})}),(0,e.jsx)(ut,{type:B.type,fields:B.fields,accountId:m.id,visible:ne,onVisibleChange:_,value:d.getFieldValue("credentials"),onChange:be})]}),(0,e.jsx)(C.Z,{span:24,style:{marginBottom:"-12px"},children:(0,e.jsx)(rt.Z,{label:s.formatMessage({id:"cloudAccount.extend.title.cloud.services"}),name:"resourceTypeList",fieldProps:{multiple:!0,showCheckedStrategy:ht,options:P,allowClear:!0,showSearch:!0,notFoundContent:i?(0,e.jsx)(We.Z,{size:"small"}):(0,e.jsx)(Pe.Z,{image:Pe.Z.PRESENTED_IMAGE_SIMPLE})},extra:(0,e.jsxs)(st.Z,{name:"enableInverseSelection",tooltip:s.formatMessage({id:"cloudAccount.extend.tooltip.selection.mode"}),style:{marginTop:"8px",marginBottom:0},initialValue:!1,children:[s.formatMessage({id:"cloudAccount.extend.title.cloud.services.inverse.selection"}),(0,e.jsx)(Re.Z,{title:s.formatMessage({id:"cloudAccount.extend.tooltip.selection.mode"}),children:(0,e.jsx)(tt.Z,{style:{marginLeft:4}})})]})})}),(0,e.jsx)(C.Z,{span:24,style:{marginTop:"-16px"},children:(0,e.jsx)(pe.Z,{name:"site",label:s.formatMessage({id:"cloudAccount.extend.title.cloud.site"})})}),B.hasProxy&&(0,e.jsxs)(C.Z,{span:24,children:[(0,e.jsx)(I.Z,{className:T.sectionDivider,dashed:!0,children:(0,e.jsx)(ke,{italic:!0,children:s.formatMessage({id:"cloudAccount.form.proxy"})})}),(0,e.jsx)(ft,{})]})]}):null}})]})},Be=xt,jt=t(17910),yt=t(98165),Ct=t(62548),It=t(40357),At=t(72269),Ke=t(86738),z={accountListTable:"accountListTable___EAu4J",cloudAccountWrap:"cloudAccountWrap___rED3n",cloudAccountList:"cloudAccountList___bSSKI",accountCard:"accountCard___Ff6OW",divider:"divider___oeq1I",propertyWrap:"propertyWrap___cmHKv",propertyName:"propertyName___fiUje",accountNameWrap:"accountNameWrap___gsm80",accountModal:"accountModal___ZRBFT",iKnow:"iKnow____ILRT",basicInfoRow:"basicInfoRow___Nlip5",basicLeftRow:"basicLeftRow___KpoYr",leftInfoLabel:"leftInfoLabel___b3k2E",rightInfoLabel:"rightInfoLabel___ch993",basicInfoValue:"basicInfoValue___XJpgy"},Mt=function(u){var y=u.account,H=u.requestInitData,a=u.requestCurrentData,J=y.id,E=y.platform,i=y.cloudAccountId,P=y.alias,Z=y.accountStatus,Y=y.tenantName,q=y.resourceCount,d=y.riskCount,s=y.lastScanTime,g=y.collectorStatus,m=y.gmtCreate,x=y.gmtModified,Me=(0,A.useModel)("rule"),V=Me.platformList,ye=Ne.ZP.useMessage(),ne=D()(ye,2),_=ne[0],$=ne[1],p=(0,A.useIntl)(),Se=(0,v.useState)(!1),Ce=D()(Se,2),be=Ce[0],Ze=Ce[1],Ee=(0,v.useRef)({}),Ie=(0,v.useState)(!1),U=D()(Ie,2),R=U[0],M=U[1],B=(0,v.useRef)({}),f=function(){var o=b()(h()().mark(function S(k,O){var De,K;return h()().wrap(function(re){for(;;)switch(re.prev=re.next){case 0:return De={cloudAccountId:k,accountStatus:O},re.next=3,(0,ge.updateCloudAccountStatus)(De);case 3:if(K=re.sent,!(K.code===200||K.msg==="success")){re.next=8;break}return _.success(p.formatMessage({id:"common.message.text.edit.success"})),re.next=8,a();case 8:case"end":return re.stop()}},S)}));return function(k,O){return o.apply(this,arguments)}}(),c=function(){var o=b()(h()().mark(function S(){var k,O;return h()().wrap(function(K){for(;;)switch(K.prev=K.next){case 0:return k=_.loading(p.formatMessage({id:"common.message.text.delete.loading"})),K.next=3,(0,ge.removeCloudAccount)({id:J});case 3:if(O=K.sent,k(),!(O.code===200||O.msg==="success")){K.next=9;break}return _.success(p.formatMessage({id:"common.message.text.delete.success"})),K.next=9,H();case 9:case"end":return K.stop()}},S)}));return function(){return o.apply(this,arguments)}}();return(0,e.jsxs)(e.Fragment,{children:[$,(0,e.jsxs)("div",{className:z.accountCard,children:[(0,e.jsxs)(w.Z,{justify:"space-between",style:{width:"100%"},children:[(0,e.jsxs)(w.Z,{children:[(0,e.jsx)(It.Z,{src:jt.J_[E],alt:"PLATFORM_ICON",width:62,height:62,preview:!1}),(0,e.jsxs)("div",{className:z.accountNameWrap,children:[(0,e.jsx)(L.Z,{text:i||"-",maxWidth:100,rows:1,style:{color:"#262626",fontSize:17,fontWeight:500},placement:"topLeft"}),(0,e.jsx)(L.Z,{text:P||"-",maxWidth:100,rows:1,style:{color:"#333",fontSize:12,margin:"1px 0"},placement:"topLeft"}),(0,e.jsx)(L.Z,{text:(0,we.PZ)(E,V)||"-",maxWidth:100,rows:1,style:{color:"#999",fontSize:13},placement:"topLeft"})]})]}),(0,e.jsx)(Re.Z,{title:p.formatMessage({id:"cloudAccount.extend.title.collect.status"}),children:(0,e.jsx)(At.Z,{style:{flexShrink:0},checkedChildren:p.formatMessage({id:"common.button.text.enable"}),unCheckedChildren:p.formatMessage({id:"common.button.text.disable"}),checked:Z==="valid",onClick:function(){return f(i,Z==="valid"?"invalid":"valid")}})})]}),(0,e.jsx)(I.Z,{className:z.divider}),(0,e.jsxs)(F.Z,{gutter:[24,8],children:[(0,e.jsxs)(C.Z,{span:14,className:z.propertyWrap,children:[(0,e.jsx)("div",{className:z.propertyName,children:p.formatMessage({id:"cloudAccount.extend.title.tenant.attribution"})}),(0,e.jsx)(L.Z,{text:Y||"-",maxWidth:123,rows:1,style:{color:"#999",fontSize:13},placement:"topLeft"})]}),(0,e.jsxs)(C.Z,{span:10,className:z.propertyWrap,children:[(0,e.jsx)("div",{className:z.propertyName,children:p.formatMessage({id:"cloudAccount.extend.title.asset.number"})}),(0,e.jsxs)(w.Z,{align:"center",gap:8,children:[(0,e.jsx)(L.Z,{text:q,maxWidth:70,rows:1,style:{color:"#457AFF",fontSize:12},link:!0,onClickCallBackFunc:function(){return A.history.push("/assetManagement/assetList?platform=".concat(E,"&cloudAccountId=").concat(i))},placement:"topLeft"}),(0,e.jsx)(I.Z,{type:"vertical",style:{margin:0,height:12}}),(0,e.jsx)(L.Z,{text:d,maxWidth:70,rows:1,style:{color:"#ff4d4f",fontSize:12},link:!0,onClickCallBackFunc:function(){return A.history.push("/riskManagement/riskList?platform=".concat(E,"&cloudAccountId=").concat(i))},placement:"topLeft"})]})]}),(0,e.jsxs)(C.Z,{span:14,className:z.propertyWrap,children:[(0,e.jsx)("div",{className:z.propertyName,children:p.formatMessage({id:"cloudAccount.extend.title.lastScanTime"})}),(0,e.jsx)(L.Z,{text:s||"-",maxWidth:123,rows:1,style:{color:"#999",fontSize:13},placement:"topLeft"})]}),(0,e.jsxs)(C.Z,{span:10,className:z.propertyWrap,children:[(0,e.jsx)("div",{className:z.propertyName,children:p.formatMessage({id:"cloudAccount.extend.title.collection.status"})}),(0,e.jsxs)(w.Z,{align:"center",children:[(0,e.jsx)(L.Z,{text:g||"-",maxWidth:81,rows:1,style:{color:"#999",fontSize:13},placement:"topLeft"}),g==="\u626B\u63CF\u4E2D"?(0,e.jsx)(yt.Z,{style:{marginLeft:8,fontSize:13,color:"#1677FF"},spin:!0}):g==="\u5F85\u626B\u63CF"?(0,e.jsx)(Ke.Z,{title:p.formatMessage({id:"cloudAccount.extend.collection.popconfirm"}),onConfirm:b()(h()().mark(function o(){var S;return h()().wrap(function(O){for(;;)switch(O.prev=O.next){case 0:return O.next=2,(0,ge.createCollectTask)({cloudAccountId:i});case 2:if(S=O.sent,!(S.code===200||S.msg==="success")){O.next=7;break}return _.success(p.formatMessage({id:"common.message.text.add.success"})),O.next=7,a();case 7:case"end":return O.stop()}},o)})),okText:p.formatMessage({id:"common.button.text.ok"}),cancelText:p.formatMessage({id:"common.button.text.cancel"}),children:(0,e.jsx)(Ct.Z,{style:{marginLeft:8,cursor:"pointer",fontSize:13,color:"#1677FF"}})}):null]})]}),(0,e.jsxs)(C.Z,{span:24,className:z.propertyWrap,children:[(0,e.jsx)("div",{className:z.propertyName,children:p.formatMessage({id:"cloudAccount.extend.title.createAndUpdateTime"})}),(0,e.jsx)(L.Z,{text:m||"-",maxWidth:228,rows:1,style:{color:"#999",fontSize:13},placement:"topLeft"}),(0,e.jsx)(L.Z,{text:x||"-",maxWidth:228,rows:1,style:{color:"#999",fontSize:13,margin:"2px 0 16px 0"}})]})]}),(0,e.jsxs)(w.Z,{style:{width:"100%"},justify:"center",children:[(0,e.jsx)(Ke.Z,{title:p.formatMessage({id:"common.button.text.delete.confirm"}),onConfirm:function(){return c()},okText:p.formatMessage({id:"common.button.text.ok"}),cancelText:p.formatMessage({id:"common.button.text.cancel"}),children:(0,e.jsx)(de.ZP,{type:"primary",style:{width:64,height:30,borderRadius:4,backgroundColor:"#FFF2F3",color:"#EC4344"},children:p.formatMessage({id:"common.button.text.delete"})})}),(0,e.jsx)(de.ZP,{size:"small",type:"primary",style:{width:64,height:30,borderRadius:4,backgroundColor:"#E7F1FF",color:"#1677FF",margin:"0 8px"},onClick:function(){Ze(!0),Ee.current=j()({},y)},children:p.formatMessage({id:"common.button.text.edit"})}),(0,e.jsx)(de.ZP,{size:"small",type:"link",style:{width:64,height:30,borderRadius:4,backgroundColor:"#E7F1FF",color:"#1677FF",marginLeft:8},onClick:function(){A.history.push("/cloudAccount/collectionRecord?platform=".concat(E,"&cloudAccountId=").concat(i))},children:p.formatMessage({id:"cloudAccount.button.text.collection.record"})})]})]}),(0,e.jsx)(Be,{editFormVisible:be,setEditFormVisible:Ze,accountInfo:Ee.current,requestCurrentData:a}),(0,e.jsx)(r,{accountModalVisible:R,setAccountModalVisible:M,accountModalInfo:B.current})]})},St=Mt,Ge=t(93410),bt=t(84567),He=t(34041),Zt=t(42075),Et=t(84611),he=1,xe=12,Dt=[{label:(0,e.jsx)(A.FormattedMessage,{id:"cloudAccount.module.search.open"}),value:"valid"},{label:(0,e.jsx)(A.FormattedMessage,{id:"cloudAccount.module.search.stop"}),value:"invalid"},{label:(0,e.jsx)(A.FormattedMessage,{id:"cloudAccount.module.search.scanning"}),value:"running"},{label:(0,e.jsx)(A.FormattedMessage,{id:"cloudAccount.module.search.waitingToScan"}),value:"waiting"}],Lt=function(){var u,y=(0,A.useModel)("rule"),H=y.platformList,a=N.Z.useForm(),J=D()(a,1),E=J[0],i=(0,A.useIntl)(),P=(0,v.useRef)({}),Z=(0,v.useState)(!1),Y=D()(Z,2),q=Y[0],d=Y[1],s=(0,v.useState)(he),g=D()(s,2),m=g[0],x=g[1],Me=(0,v.useState)(xe),V=D()(Me,2),ye=V[0],ne=V[1],_=(0,A.useRequest)(function(f){return(0,ge.queryCloudAccountList)(f)},{manual:!0,formatResult:function(c){return c.content}}),$=_.data,p=_.run,Se=_.loading,Ce=function(){var f=b()(h()().mark(function c(){return h()().wrap(function(S){for(;;)switch(S.prev=S.next){case 0:return x(he),ne(xe),E==null||E.resetFields(),S.next=5,p({page:he,size:xe});case 5:case"end":return S.stop()}},c)}));return function(){return f.apply(this,arguments)}}(),be=function(){var f=b()(h()().mark(function c(){var o;return h()().wrap(function(k){for(;;)switch(k.prev=k.next){case 0:return x(he),ne(xe),o=E.getFieldsValue(),k.next=5,p(j()(j()({},o),{},{page:he,size:xe}));case 5:case"end":return k.stop()}},c)}));return function(){return f.apply(this,arguments)}}(),Ze=function(){E.resetFields()},Ee=function(c){x(he),ne(xe),p(j()(j()({},c),{},{page:he,size:xe}))};(0,v.useEffect)(function(){p({page:m,size:ye})},[]);var Ie=(0,A.useRequest)(function(f){return(0,ge.cloudAccountBaseInfoList)(j()({},f))},{formatResult:function(c){if(c.msg==="success"){var o;return(c==null||(o=c.content)===null||o===void 0||(o=o.accountAliasList)===null||o===void 0?void 0:o.map(function(S){return{label:S,value:S}}))||[]}}}),U=Ie.data,R=Ie.run,M=Ie.loading,B=(0,v.useMemo)(function(){var f=function(o){R({platformList:E.getFieldValue("platformList")||[],cloudAccountSearch:o})};return(0,Ve.debounce)(f,500)},[ge.cloudAccountBaseInfoList]);return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(Ge.Z,{style:{marginBottom:16},children:(0,e.jsxs)(N.Z,{form:E,onFinish:Ee,children:[(0,e.jsx)(F.Z,{gutter:[24,24],children:(0,e.jsx)(C.Z,{span:24,children:(0,e.jsx)(N.Z.Item,{name:"platformList",label:i.formatMessage({id:"common.select.label.cloudPlatform"}),style:{marginBottom:16},children:(0,e.jsx)(bt.Z.Group,{options:(0,we.T$)(H),onChange:function(c){return R({platformList:c||[]})}})})})}),(0,e.jsxs)(F.Z,{gutter:[24,24],children:[(0,e.jsx)(C.Z,{span:6,children:(0,e.jsx)(N.Z.Item,{name:"cloudAccountId",label:i.formatMessage({id:"common.select.label.cloudAccount"}),style:{marginBottom:0,width:"100%"},children:(0,e.jsx)(He.Z,{allowClear:!0,showSearch:!0,placeholder:i.formatMessage({id:"common.select.query.text.placeholder"}),notFoundContent:M&&(0,e.jsx)(We.Z,{size:"small"}),onSearch:B,options:U||[]})})}),(0,e.jsx)(C.Z,{span:6,children:(0,e.jsx)(N.Z.Item,{name:"status",label:i.formatMessage({id:"common.select.label.Collection.status"}),style:{marginBottom:0,width:"100%"},children:(0,e.jsx)(He.Z,{allowClear:!0,placeholder:i.formatMessage({id:"common.select.text.placeholder"}),options:Dt})})}),(0,e.jsx)(C.Z,{span:6,offset:6,style:{width:"100%"},children:(0,e.jsx)(w.Z,{justify:"flex-end",style:{width:"100%"},children:(0,e.jsx)(N.Z.Item,{style:{marginBottom:0},children:(0,e.jsxs)(Zt.Z,{size:8,children:[(0,e.jsx)(de.ZP,{onClick:Ze,children:i.formatMessage({id:"common.button.text.reset"})}),(0,e.jsx)(de.ZP,{type:"primary",htmlType:"submit",loading:Se,children:i.formatMessage({id:"common.button.text.query"})})]})})})})]})]})}),(0,e.jsxs)(Ge.Z,{style:{minHeight:488},children:[(0,e.jsx)(F.Z,{style:{marginBottom:28},justify:"end",children:(0,e.jsx)(de.ZP,{type:"primary",onClick:function(){d(!0),P.current={}},children:i.formatMessage({id:"common.button.text.add"})},"create")}),(0,e.jsx)(F.Z,{className:z.cloudAccountWrap,children:(0,e.jsx)(We.Z,{spinning:Se,children:(0,Ve.isEmpty)($==null?void 0:$.data)?(0,e.jsx)(w.Z,{align:"center",justify:"center",style:{width:" 100%",minHeight:356},children:(0,e.jsx)(Pe.Z,{image:Pe.Z.PRESENTED_IMAGE_SIMPLE})}):(0,e.jsx)("div",{className:z.cloudAccountList,children:$==null||(u=$.data)===null||u===void 0?void 0:u.map(function(f){return(0,e.jsx)(St,{account:f,requestInitData:Ce,requestCurrentData:be},f.id)})})})}),(0,e.jsx)(F.Z,{children:(0,e.jsx)(w.Z,{justify:"center",style:{width:"100%",marginTop:"16px"},children:(0,e.jsx)(Et.Z,{onChange:function(c,o){x(c),ne(o),p(j()(j()({},E.getFieldsValue()),{},{page:c,size:o}))},current:m,pageSize:ye,size:"small",showTotal:function(c,o){return(0,we.GO)(c,o,i==null?void 0:i.locale)},total:($==null?void 0:$.total)||0,showSizeChanger:!0,pageSizeOptions:[12,24]})})})]}),(0,e.jsx)(Be,{editFormVisible:q,setEditFormVisible:d,accountInfo:P.current,requestCurrentData:be})]})},Tt=Lt,Ft=function(){return(0,e.jsx)(G._z,{title:!1,children:(0,e.jsx)(Tt,{})})},Ot=Ft},53846:function(ie,Q){"use strict";Q.Z={customTitle:"customTitle___nzcxh",riskHigh:"riskHigh___GstO6",riskMedium:"riskMedium___F4JTb",riskLow:"riskLow___HJopw",imgProcess:"imgProcess___NGndv",imgResult:"imgResult___wKhiG",validTag:"validTag___TRSau",invalidTag:"invalidTag___opVlG",waitingTag:"waitingTag___JZpZT"}},85674:function(ie,Q,t){var G={"./simpleWorker":18352,"./simpleWorker.js":18352};function v(W){return Promise.resolve().then(function(){if(!t.o(G,W)){var j=new Error("Cannot find module '"+W+"'");throw j.code="MODULE_NOT_FOUND",j}var ee=G[W];return t(ee)})}v.keys=function(){return Object.keys(G)},v.id=85674,ie.exports=v},10131:function(ie,Q,t){var G={"./editorBaseApi":[20927],"./editorBaseApi.js":[20927],"./editorSimpleWorker":[81465],"./editorSimpleWorker.js":[81465],"./editorWorker":[85215],"./editorWorker.js":[85215],"./editorWorkerHost":[98008],"./editorWorkerHost.js":[98008],"./findSectionHeaders":[72846],"./findSectionHeaders.js":[72846],"./getIconClasses":[22016],"./getIconClasses.js":[22016],"./languageFeatureDebounce":[88191],"./languageFeatureDebounce.js":[88191],"./languageFeatures":[71922],"./languageFeatures.js":[71922],"./languageFeaturesService":[7421],"./languageFeaturesService.js":[7421],"./languageService":[81032],"./languageService.js":[81032],"./languagesAssociations":[73536],"./languagesAssociations.js":[73536],"./languagesRegistry":[4765],"./languagesRegistry.js":[4765],"./markerDecorations":[36357],"./markerDecorations.js":[36357],"./markerDecorationsService":[86036],"./markerDecorationsService.js":[86036],"./model":[73733],"./model.js":[73733],"./modelService":[51200],"./modelService.js":[51200],"./resolverService":[88216],"./resolverService.js":[88216],"./semanticTokensDto":[14704],"./semanticTokensDto.js":[14704],"./semanticTokensProviderStyling":[92294],"./semanticTokensProviderStyling.js":[92294],"./semanticTokensStyling":[73343],"./semanticTokensStyling.js":[73343],"./semanticTokensStylingService":[84146],"./semanticTokensStylingService.js":[84146],"./textModelSync/textModelSync.impl":[28944],"./textModelSync/textModelSync.impl.js":[28944],"./textModelSync/textModelSync.protocol":[23145,3145],"./textModelSync/textModelSync.protocol.js":[23145,3145],"./textResourceConfiguration":[71765],"./textResourceConfiguration.js":[71765],"./treeSitterParserService":[28922],"./treeSitterParserService.js":[28922],"./treeViewsDnd":[80642],"./treeViewsDnd.js":[80642],"./treeViewsDndService":[58345],"./treeViewsDndService.js":[58345],"./unicodeTextModelHighlighter":[31446],"./unicodeTextModelHighlighter.js":[31446]};function v(W){if(!t.o(G,W))return Promise.resolve().then(function(){var h=new Error("Cannot find module '"+W+"'");throw h.code="MODULE_NOT_FOUND",h});var j=G[W],ee=j[0];return Promise.all(j.slice(1).map(t.e)).then(function(){return t(ee)})}v.keys=function(){return Object.keys(G)},v.id=10131,ie.exports=v}}]); | |||
There was a problem hiding this comment.
issue (code-quality): Don't reassign parameter - n (dont-reassign-parameters)
Explanation
Reassigning parameters can lead to unexpected behavior, especially when accessing the arguments object. It can also cause optimization issues, especially in V8.From the Airbnb JavaScript Style Guide
| @@ -0,0 +1 @@ | |||
| (self.webpackChunk=self.webpackChunk||[]).push([[9418],{91618:function(ie,Q,t){"use strict";t.d(Q,{Z:function(){return e}});var G=t(62435),v=Object.defineProperty,W=Object.getOwnPropertySymbols,j=Object.prototype.hasOwnProperty,ee=Object.prototype.propertyIsEnumerable,h=(l,n,r)=>n in l?v(l,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):l[n]=r,Ae=(l,n)=>{for(var r in n||(n={}))j.call(n,r)&&h(l,r,n[r]);if(W)for(var r of W(n))ee.call(n,r)&&h(l,r,n[r]);return l};const b=l=>React.createElement("svg",Ae({width:8,height:8,xmlns:"http://www.w3.org/2000/svg"},l),React.createElement("title",null,"\u5931\u8D25"),React.createElement("path",{d:"M4 0a4 4 0 1 1 0 8 4 4 0 0 1 0-8Zm-.81 2.784a.287.287 0 1 0-.406.405l.81.811-.81.81a.287.287 0 1 0 .405.406L4 4.406l.81.81a.287.287 0 1 0 .406-.405L4.406 4l.81-.81a.287.287 0 1 0-.405-.406L4 3.594l-.81-.81Z",fill:"#FF3931",fillRule:"nonzero"}));var se="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iOCIgaGVpZ2h0PSI4IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGQ9Ik00IDBhNCA0IDAgMSAxIDAgOCA0IDQgMCAwIDEgMC04Wm0tLjgxIDIuNzg0YS4yODcuMjg3IDAgMSAwLS40MDYuNDA1bC44MS44MTEtLjgxLjgxYS4yODcuMjg3IDAgMSAwIC40MDUuNDA2TDQgNC40MDZsLjgxLjgxYS4yODcuMjg3IDAgMSAwIC40MDYtLjQwNUw0LjQwNiA0bC44MS0uODFhLjI4Ny4yODcgMCAxIDAtLjQwNS0uNDA2TDQgMy41OTRsLS44MS0uODFaIiBmaWxsPSIjRkYzOTMxIiBmaWxsLXJ1bGU9Im5vbnplcm8iLz48L3N2Zz4=",D=Object.defineProperty,L=Object.getOwnPropertySymbols,te=Object.prototype.hasOwnProperty,N=Object.prototype.propertyIsEnumerable,ae=(l,n,r)=>n in l?D(l,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):l[n]=r,me=(l,n)=>{for(var r in n||(n={}))te.call(n,r)&&ae(l,r,n[r]);if(L)for(var r of L(n))N.call(n,r)&&ae(l,r,n[r]);return l};const F=l=>React.createElement("svg",me({width:8,height:8,xmlns:"http://www.w3.org/2000/svg"},l),React.createElement("title",null,"\u901A\u8FC7"),React.createElement("path",{d:"M4 0a4 4 0 1 1 0 8 4 4 0 0 1 0-8Zm1.712 2.788a.3.3 0 0 0-.424 0L3.502 4.576l-.79-.787a.3.3 0 0 0-.424.425l1.003.999a.3.3 0 0 0 .424-.001l1.997-2a.3.3 0 0 0 0-.424Z",fill:"#379E0E",fillRule:"nonzero"}));var C="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iOCIgaGVpZ2h0PSI4IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGQ9Ik00IDBhNCA0IDAgMSAxIDAgOCA0IDQgMCAwIDEgMC04Wm0xLjcxMiAyLjc4OGEuMy4zIDAgMCAwLS40MjQgMEwzLjUwMiA0LjU3NmwtLjc5LS43ODdhLjMuMyAwIDAgMC0uNDI0LjQyNWwxLjAwMy45OTlhLjMuMyAwIDAgMCAuNDI0LS4wMDFsMS45OTctMmEuMy4zIDAgMCAwIDAtLjQyNFoiIGZpbGw9IiMzNzlFMEUiIGZpbGwtcnVsZT0ibm9uemVybyIvPjwvc3ZnPg==",w=Object.defineProperty,I=Object.getOwnPropertySymbols,A=Object.prototype.hasOwnProperty,T=Object.prototype.propertyIsEnumerable,oe=(l,n,r)=>n in l?w(l,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):l[n]=r,X=(l,n)=>{for(var r in n||(n={}))A.call(n,r)&&oe(l,r,n[r]);if(I)for(var r of I(n))T.call(n,r)&&oe(l,r,n[r]);return l};const fe=l=>React.createElement("svg",X({width:8,height:8,xmlns:"http://www.w3.org/2000/svg"},l),React.createElement("title",null,"\u5F85\u64CD\u4F5C"),React.createElement("g",{fillRule:"nonzero",fill:"none"},React.createElement("path",{d:"M4 0a4 4 0 1 1 0 8 4 4 0 0 1 0-8Z",fill:"#FFB310"}),React.createElement("path",{d:"M3.775 2.412a.287.287 0 1 0-.573 0v1.71c0 .316.257.573.573.573h1.718a.287.287 0 1 0 0-.573H3.775v-1.71Z",fill:"#FFF1D4"})));var ce="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iOCIgaGVpZ2h0PSI4IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxnIGZpbGwtcnVsZT0ibm9uemVybyIgZmlsbD0ibm9uZSI+PHBhdGggZD0iTTQgMGE0IDQgMCAxIDEgMCA4IDQgNCAwIDAgMSAwLThaIiBmaWxsPSIjRkZCMzEwIi8+PHBhdGggZD0iTTMuNzc1IDIuNDEyYS4yODcuMjg3IDAgMSAwLS41NzMgMHYxLjcxYzAgLjMxNi4yNTcuNTczLjU3My41NzNoMS43MThhLjI4Ny4yODcgMCAxIDAgMC0uNTczSDMuNzc1di0xLjcxWiIgZmlsbD0iI0ZGRjFENCIvPjwvZz48L3N2Zz4=",Fe=t(66309),ve=t(53846),ue=t(86074),e=function(l){var n=l.state,r=(0,ue.jsx)(Fe.Z,{children:n||"-"});return["success","valid"].includes(n)?r=(0,ue.jsxs)(Fe.Z,{className:ve.Z.validTag,children:[(0,ue.jsx)("img",{src:C,alt:"VALID_ICON",className:ve.Z.imgResult}),"Valid"]}):["error","invalid","failed"].includes(n)?r=(0,ue.jsxs)(Fe.Z,{className:ve.Z.invalidTag,children:[(0,ue.jsx)("img",{src:se,alt:"VALID_ICON",className:ve.Z.imgResult}),"Invalid"]}):["waiting","wait"].includes(n)&&(r=(0,ue.jsxs)(Fe.Z,{className:ve.Z.waitingTag,children:[(0,ue.jsx)("img",{src:ce,alt:"WAITING_ICON",className:ve.Z.imgProcess}),"Waiting"]})),r}},24163:function(ie,Q,t){"use strict";var G=t(97857),v=t.n(G),W=t(25593),j=t(83062),ee=t(62435),h=t(86074),Ae=W.Z.Paragraph;Q.Z=function(b){var se=b.text,D=b.width,L=b.maxWidth,te=b.rows,N=te===void 0?2:te,ae=b.placement,me=ae===void 0?"top":ae,F=b.color,C=F===void 0?"rgba(0, 0, 0, 0.88)":F,w=b.link,I=w===void 0?!1:w,A=b.onClickCallBackFunc,T=b.style,oe=T===void 0?{}:T,X=b.copyable,fe=X===void 0?!1:X;return(0,h.jsx)("div",{style:{maxWidth:L,width:D},children:(0,h.jsx)(j.Z,{title:(0,h.jsx)("div",{children:se}),placement:me,children:(0,h.jsx)(Ae,{ellipsis:{rows:N},style:v()({marginBottom:0,color:C,cursor:I?"pointer":""},oe),onClick:A,copyable:fe,children:se})})})}},52078:function(ie,Q,t){"use strict";var G=t(97857),v=t.n(G),W=t(27997),j=t(62435),ee=t(86074),h=function(b){W.Mj.register({id:"json"});var se=b.value,D=se===void 0?"{}":se,L=b.onChange,te=b.editorStyle,N=te===void 0?{}:te,ae=b.editorKey,me=ae===void 0?"json-editor":ae,F=b.readOnly,C=F===void 0?!1:F,w=(0,j.useRef)(),I=(0,j.useRef)(),A=function(){var oe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"{}";try{return JSON.parse(oe),oe}catch(X){return console.warn("Invalid JSON string:",X),"{}"}};return(0,j.useEffect)(function(){if(w.current)return I.current?I.current.setValue(D):(I.current=W.j6.create(w.current,{value:A(D),language:"json",theme:"vs",readOnly:C,folding:!0,automaticLayout:!0}),I.current.onDidChangeModelContent(function(){var T=I.current.getValue();console.log("[JSONEditor] \u7F16\u8F91\u5668\u5185\u5BB9\u53D8\u66F4:",{newValue:T}),L==null||L(T)})),function(){if(I!=null&&I.current){var T;I==null||(T=I.current)===null||T===void 0||T.dispose(),I.current=null}}},[]),(0,j.useEffect)(function(){I.current&&D!==I.current.getValue()&&I.current.setValue(A(D))},[D]),(0,ee.jsx)("div",{ref:w,style:v()({height:360,borderRadius:4,overflow:"hidden"},N)},me)};Q.Z=h},87958:function(ie,Q,t){"use strict";t.r(Q),t.d(Q,{default:function(){return Ot}});var G=t(39380),v=t(62435),W=t(97857),j=t.n(W),ee=t(15009),h=t.n(ee),Ae=t(99289),b=t.n(Ae),se=t(5574),D=t.n(se),L=t(24163),te=t(25593),N=t(99859),ae=t(17788),me=t(21532),F=t(71230),C=t(15746),w=t(86250),I=t(96074),A=t(45830),T={leftInfoLabel:"leftInfoLabel___SJHhs",rightInfoLabel:"rightInfoLabel___c8v5r",basicInfoValue:"basicInfoValue___Cwl01",accountModal:"accountModal___hexAB",sectionDivider:"sectionDivider___oQjeE",proxyCollapse:"proxyCollapse___dPuDK"},oe=t(91618),X={ALI_CLOUD:{type:"basic",fields:[{name:"ak",label:"AK",required:!0},{name:"sk",label:"SK",required:!0}],hasProxy:!0},HUAWEI_CLOUD:{type:"basic",fields:[{name:"ak",label:"AK",required:!0},{name:"sk",label:"SK",required:!0}]},BAIDU_CLOUD:{type:"basic",fields:[{name:"ak",label:"AK",required:!0},{name:"sk",label:"SK",required:!0}]},AWS:{type:"basic",fields:[{name:"ak",label:"AK",required:!0},{name:"sk",label:"SK",required:!0}]},TENCENT_CLOUD:{type:"basic",fields:[{name:"ak",label:"AK",required:!0},{name:"sk",label:"SK",required:!0}]},KINGSOFT_CLOUD:{type:"basic",fields:[{name:"ak",label:"AK",required:!0},{name:"sk",label:"SK",required:!0}]},AZURE:{type:"basic",fields:[{name:"ak",label:"AK",required:!0},{name:"sk",label:"SK",required:!0}]},GCP:{type:"json",fields:[{name:"credentialsJson",label:"GCP KEY",required:!0}]},ALI_CLOUD_PRIVATE:{type:"exclusive",fields:[{name:"ak",label:"AK",required:!0},{name:"sk",label:"SK",required:!0},{name:"endpoint",label:"Endpoint",required:!0},{name:"regionId",label:"RegionId",required:!0}]},HUAWEI_CLOUD_PRIVATE:{type:"extend",fields:[{name:"ak",label:"AK",required:!0},{name:"sk",label:"SK",required:!0},{name:"iamEndpoint",label:"Iam_Endpoint",required:!0},{name:"ecsEndpoint",label:"Ecs_Endpoint",required:!0},{name:"elbEndpoint",label:"Elb_Endpoint",required:!0},{name:"evsEndpoint",label:"Evs_Endpoint",required:!0},{name:"vpcEndpoint",label:"Vpc_Endpoint",required:!0},{name:"obsEndpoint",label:"Obs_Endpoint",required:!0},{name:"regionId",label:"RegionId",required:!0},{name:"projectId",label:"ProjectId"}]}},fe={cloudAccountId:[{required:!0,message:"Please enter your cloud account ID"}],alias:[{required:!0,message:"Please enter the alias of your cloud account"}],tenantId:[{required:!0,message:"Please select the tenant"}],platform:[{required:!0,message:"Please select the cloud platform"}]},ce=["GCP"],Fe=null,ve=null,ue=null,e=t(86074),l=te.Z.Text,n=function(u){var y,H,a=u.accountInfo,J=u.visible,E=u.onCancel,i=u.tenantListAll,P=u.resourceTypeList,Z=(0,A.useIntl)(),Y=N.Z.useForm(),q=D()(Y,1),d=q[0],s=ce!=null&&ce.includes(a==null?void 0:a.platform)?600:500;return(0,e.jsxs)(ae.Z,{title:(0,e.jsx)("div",{style:{fontSize:16,fontWeight:500},children:Z.formatMessage({id:"cloudAccount.extend.title.accountInfo"})}),open:J,onCancel:E,footer:null,width:800,style:{minHeight:s},destroyOnClose:!0,children:[(0,e.jsx)(me.ZP,{theme:{components:{Form:{labelColor:"rgba(74, 74, 74, 1)",colorTextHeading:"rgba(74, 74, 74, 1)"}}},children:(0,e.jsxs)(N.Z,{form:d,layout:"vertical",children:[(0,e.jsxs)(F.Z,{children:[(0,e.jsxs)(C.Z,{span:12,children:[(0,e.jsxs)(F.Z,{style:{height:44},children:[(0,e.jsxs)("span",{className:T.leftInfoLabel,children:[Z.formatMessage({id:"cloudAccount.extend.title.accountId"}),"\xA0:"]}),(0,e.jsx)(L.Z,{style:{paddingTop:11,color:"#457aff"},text:(a==null?void 0:a.cloudAccountId)||"-",rows:1,maxWidth:100})]}),(0,e.jsxs)(F.Z,{style:{height:44},children:[(0,e.jsxs)("span",{className:T.leftInfoLabel,children:[Z.formatMessage({id:"cloudAccount.extend.title.alias"}),"\xA0:"]}),(0,e.jsx)(L.Z,{style:{paddingTop:11,color:"#457aff"},text:(a==null?void 0:a.alias)||"-",rows:1,maxWidth:100})]}),(0,e.jsxs)(F.Z,{style:{height:44},children:[(0,e.jsxs)("span",{className:T.leftInfoLabel,children:[Z.formatMessage({id:"cloudAccount.extend.title.platform"}),"\xA0:"]}),(0,e.jsx)(L.Z,{style:{paddingTop:11,color:"#457aff"},text:(P==null||(y=P.filter(function(g){return g.value===(a==null?void 0:a.platform)}))===null||y===void 0||(y=y.map(function(g){return Z.formatMessage({id:g.label})}))===null||y===void 0?void 0:y.toString())||"-",rows:1,maxWidth:100})]}),(0,e.jsxs)(F.Z,{style:{height:44},children:[(0,e.jsxs)("span",{className:T.leftInfoLabel,children:[Z.formatMessage({id:"common.select.label.tenant"}),"\xA0:"]}),(0,e.jsx)(L.Z,{style:{paddingTop:11,color:"#457aff"},text:(i==null||(H=i.find(function(g){return g.value===(a==null?void 0:a.tenantId)}))===null||H===void 0?void 0:H.label)||"-",rows:1,maxWidth:100})]})]}),(0,e.jsxs)(C.Z,{span:12,children:[(0,e.jsxs)(F.Z,{style:{height:44},children:[(0,e.jsxs)("span",{className:T.rightInfoLabel,children:[Z.formatMessage({id:"cloudAccount.extend.title.asset.number"}),"\xA0:"]}),(0,e.jsx)("span",{className:T.basicInfoValue,style:{color:"#457aff"},children:(a==null?void 0:a.resourceCount)||0})]}),(0,e.jsxs)(F.Z,{children:[(0,e.jsx)("span",{className:T.rightInfoLabel,style:{height:44},children:ce!=null&&ce.includes(a==null?void 0:a.platform)?"GCP KEY ".concat(Z.formatMessage({id:"common.link.text.status"})," : "):"AK/SK ".concat(Z.formatMessage({id:"common.link.text.status"})," : ")}),(0,e.jsx)(w.Z,{align:"center",children:(0,e.jsx)(oe.Z,{state:a==null?void 0:a.status})})]})]})]}),(0,e.jsx)(N.Z.Item,{label:Z.formatMessage({id:"cloudAccount.extend.title.lastScanTime"}),children:(0,e.jsx)(l,{style:{color:"rgba(74, 74, 74, 1)"},children:(a==null?void 0:a.lastScanTime)||" -"})}),(0,e.jsx)(N.Z.Item,{label:Z.formatMessage({id:"cloudAccount.extend.title.createTime"}),children:(0,e.jsx)(l,{style:{color:"rgba(74, 74, 74, 1)"},children:(a==null?void 0:a.gmtCreate)||"-"})}),(0,e.jsx)(N.Z.Item,{label:Z.formatMessage({id:"cloudAccount.extend.title.updateTime"}),children:(0,e.jsx)(l,{style:{color:"rgba(74, 74, 74, 1)"},children:(a==null?void 0:a.gmtModified)||"-"})})]})}),(0,e.jsx)(I.Z,{style:{margin:"18px 0 0 0",borderColor:"#457aff",opacity:.25}})]})},r=n,_e=t(13769),Xe=t.n(_e),ge=t(92635),qe=t(58638),et=t(45605),tt=t(25035),at=t(184),pe=t(5966),Ue=t(64317),nt=t(97462),rt=t(8214),st=t(63434),ot=t(3303),Ne=t(68872),de=t(83622),Re=t(83062),We=t(57381),Pe=t(32983),we=t(29448),lt=t(86548),it=t(52078),ct=function(u){var y=u.type,H=u.fields,a=u.accountId,J=u.visible,E=u.onVisibleChange,i=u.value,P=u.onChange,Z=(0,A.useIntl)(),Y=function(s,g){var m=j()({},i||{});m[s]=g,P==null||P(m)},q=function(s){var g=(s==null?void 0:s.trim())||"{}";P==null||P({credentialsJson:g})};return a&&!J?(0,e.jsx)(N.Z.Item,{label:Z.formatMessage({id:"cloudAccount.form.credential"}),name:"action",children:(0,e.jsx)(de.ZP,{type:"link",onClick:function(){return E(!0)},style:{padding:"4px 0",color:"#2f54eb"},children:(0,e.jsx)(lt.Z,{})})}):J?y==="json"?(0,e.jsx)(pe.Z,{name:"credentialsJson",label:"GCP KEY",initialValue:(i==null?void 0:i.credentialsJson)||"{}",rules:[{required:!0,validator:function(){var d=b()(h()().mark(function g(m,x){return h()().wrap(function(V){for(;;)switch(V.prev=V.next){case 0:if(x!=null&&x.trim()){V.next=2;break}throw new Error("Please enter a valid GCP KEY");case 2:V.prev=2,JSON.parse(x),V.next=9;break;case 6:throw V.prev=6,V.t0=V.catch(2),new Error("Please enter a valid GCP KEY in JSON format");case 9:case"end":return V.stop()}},g,null,[[2,6]])}));function s(g,m){return d.apply(this,arguments)}return s}()}],children:(0,e.jsx)(it.Z,{value:(i==null?void 0:i.credentialsJson)||"{}",onChange:q,editorStyle:{height:"240px"},editorKey:"CREDENTIALS_JSON_EDITOR"})}):(0,e.jsx)(e.Fragment,{children:H.map(function(d){var s=d.name;return(0,e.jsx)(pe.Z,{name:["credentials",s],label:d.label,rules:[{required:d.required}],fieldProps:{type:d.type||"text",onChange:function(m){return Y(s,m.target.value)}}},s)})}):null},ut=ct,dt=t(90672),mt=function(){var u=(0,A.useIntl)();return(0,e.jsx)(dt.Z,{name:"proxyConfig",label:u.formatMessage({id:"cloudAccount.form.proxy"}),placeholder:u.formatMessage({id:"cloudAccount.form.proxy.placeholder"})})},ft=mt,Ve=t(96486),vt=t(79930),gt=function(){var u=(0,A.useIntl)(),y=(0,v.useState)(!1),H=D()(y,2),a=H[0],J=H[1],E=(0,v.useState)([]),i=D()(E,2),P=i[0],Z=i[1],Y=(0,v.useCallback)(function(){var q=b()(h()().mark(function d(s){var g;return h()().wrap(function(x){for(;;)switch(x.prev=x.next){case 0:if(s!=null&&s.trim()){x.next=2;break}return x.abrupt("return");case 2:return J(!0),x.prev=3,x.next=6,(0,vt.queryGroupTypeList)({platformList:[s]});case 6:g=x.sent,(0,Ve.isEmpty)(g.content)?(Z([]),Ne.ZP.error(u.formatMessage({id:"cloudAccount.message.text.no.assets"}))):Z(g==null?void 0:g.content),x.next=14;break;case 10:x.prev=10,x.t0=x.catch(3),Ne.ZP.error("\u83B7\u53D6\u8D44\u6E90\u7C7B\u578B\u5217\u8868\u5931\u8D25"),Z([]);case 14:return x.prev=14,J(!1),x.finish(14);case 17:case"end":return x.stop()}},d,null,[[3,10,14,17]])}));return function(d){return q.apply(this,arguments)}}(),[u]);return{loading:a,resourceTypes:P,fetchResourceTypes:Y}},pt=["resourceTypeListForWeb","credentialMap","id","proxyConfig","platform"],ht=ot.Z.SHOW_CHILD,ke=te.Z.Text,xt=function(u){var y=(0,A.useModel)("rule"),H=y.platformList,a=(0,A.useModel)("tenant"),J=a.tenantListAll,E=gt(),i=E.loading,P=E.resourceTypes,Z=E.fetchResourceTypes,Y=N.Z.useForm(),q=D()(Y,1),d=q[0],s=(0,A.useIntl)(),g=u.editFormVisible,m=u.accountInfo,x=u.setEditFormVisible,Me=u.requestCurrentData,V=(0,v.useState)(!0),ye=D()(V,2),ne=ye[0],_=ye[1],$=(0,v.useState)("{}"),p=D()($,2),Se=p[0],Ce=p[1],be=function(R){var M=d.getFieldsValue(),B=M.platform;if(B){var f=X[B];if(f)if(f.type==="json"){var c=R.credentialsJson||"{}";Ce(c),d.setFieldsValue({credentials:{credentialsJson:c}})}else{var o=d.getFieldValue("credentials")||{},S=j()({},o);f.fields.forEach(function(k){var O=k.name;O in R&&R[O]!==void 0&&(S[O]=R[O])}),d.setFieldsValue({credentials:S})}}},Ze=function(){var U=b()(h()().mark(function R(){var M,B,f,c,o,S,k,O,De,K,Le,re,Te,Oe,ze,Je,$e;return h()().wrap(function(le){for(;;)switch(le.prev=le.next){case 0:if(M=d.getFieldsValue(),B=M.cloudAccountId,f=M.email,c=M.alias,o=M.tenantId,S=M.platform,k=M.resourceTypeList,O=M.site,De=M.owner,K=M.proxyConfig,Le=M.credentials,re=M.enableInverseSelection,Te={cloudAccountId:B,email:f,alias:c,tenantId:typeof o=="string"?parseInt(o,10):o,platform:S,resourceTypeList:k,site:O,owner:De,enableInverseSelection:re},Oe=X[S],Oe){le.next=6;break}return le.abrupt("return");case 6:return ne&&(Oe.type==="json"?Te.credentialsObj={credentialsJson:(Le==null?void 0:Le.credentialsJson)||Se}:(ze=j()({},Le||{}),Oe.fields.forEach(function(Nt){var Qe=Nt.name,Ye=d.getFieldValue(["credentials",Qe]);Ye!==void 0&&(ze[Qe]=Ye)}),Te.credentialsObj=ze)),Oe.hasProxy&&K&&(Te.proxyConfig=K),m.id&&(Te.id=m.id),le.next=11,(0,ge.saveCloudAccount)(Te);case 11:if(Je=le.sent,Je.msg!=="success"){le.next=18;break}return $e=m.id?"common.message.text.edit.success":"common.message.text.create.success",Ne.ZP.success(s.formatMessage({id:$e})),x(!1),le.next=18,Me();case 18:case"end":return le.stop()}},R)}));return function(){return U.apply(this,arguments)}}();(0,v.useEffect)(function(){if(g&&m.id){var U;_(!1);var R=m.resourceTypeListForWeb,M=m.credentialMap,B=m.id,f=m.proxyConfig,c=m.platform,o=Xe()(m,pt),S=j()(j()({},o),{},{credentials:M||{},resourceTypeList:R||[],proxyConfig:f||void 0,platform:c||"",enableInverseSelection:o.enableInverseSelection||!1});c&&((U=X[c])===null||U===void 0?void 0:U.type)==="json"&&M!==null&&M!==void 0&&M.credentialsJson&&Ce(M.credentialsJson),d.setFieldsValue(S),m.platform&&Z(m.platform)}},[g,m]);var Ee=function(){d.resetFields()},Ie=function(){x(!1),Ee()};return(0,e.jsxs)(at.a,{labelCol:{span:5},wrapperCol:{span:17},title:(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("span",{style:{marginRight:4},children:s.formatMessage({id:m.id?"cloudAccount.extend.title.edit":"cloudAccount.extend.title.add"})}),(0,e.jsxs)(de.ZP,{size:"small",type:"link",href:"https://cloudrec.yuque.com/org-wiki-cloudrec-iew3sz/hocvhx/fetbofdu8dx15q73",target:"_blank",style:{color:"#2f54eb",gap:4},children:[(0,e.jsx)(qe.Z,{}),(0,e.jsx)("span",{children:s.formatMessage({id:"common.link.text.help.center"})})]})]}),width:720,form:d,drawerProps:{destroyOnClose:!0,onClose:Ie,styles:{body:{paddingTop:24}}},open:g,onFinish:Ze,layout:"horizontal",children:[(0,e.jsx)(I.Z,{className:T.sectionDivider,dashed:!0,children:(0,e.jsx)(ke,{italic:!0,children:s.formatMessage({id:"cloudAccount.extend.title.basic.information"})})}),(0,e.jsxs)(F.Z,{children:[(0,e.jsx)(C.Z,{span:24,children:(0,e.jsx)(pe.Z,{disabled:!!m.id,name:"cloudAccountId",label:s.formatMessage({id:"cloudAccount.extend.title.account.id"}),rules:fe.cloudAccountId,fieldProps:{suffix:!!m.id&&(0,e.jsx)(Re.Z,{title:"\u4E91\u8D26\u53F7ID\u4E3A\u4E91\u5E73\u53F0\u4E3B\u8D26\u53F7ID\uFF0C\u521B\u5EFA\u540E\u65E0\u6CD5\u4FEE\u6539",children:(0,e.jsx)(et.Z,{style:{color:"rgba(0,0,0,.45)"}})})}})}),(0,e.jsx)(C.Z,{span:24,children:(0,e.jsx)(pe.Z,{name:"email",label:s.formatMessage({id:"cloudAccount.extend.title.account.email"})})}),(0,e.jsx)(C.Z,{span:24,children:(0,e.jsx)(pe.Z,{name:"alias",label:s.formatMessage({id:"cloudAccount.extend.title.account.alias"}),rules:fe.alias})}),(0,e.jsx)(C.Z,{span:24,children:(0,e.jsx)(Ue.Z,{label:s.formatMessage({id:"common.select.label.tenant"}),name:"tenantId",rules:fe.tenantId,options:J})}),(0,e.jsx)(C.Z,{span:24,children:(0,e.jsx)(pe.Z,{name:"owner",label:"Owner"})}),(0,e.jsx)(C.Z,{span:24,children:(0,e.jsx)(Ue.Z,{label:s.formatMessage({id:"cloudAccount.extend.title.cloud.platform"}),name:"platform",rules:fe.platform,options:(0,we.T$)(H,"start"),onChange:function(R){m.id&&_(!1),d.setFieldValue("resourceTypeList",void 0),Z(R)}})})]}),(0,e.jsx)(nt.Z,{name:["platform"],children:function(R){var M=R.platform;if(!M)return null;var B=X[M];return B?(0,e.jsxs)(F.Z,{children:[(0,e.jsxs)(C.Z,{span:24,children:[(0,e.jsx)(I.Z,{className:T.sectionDivider,dashed:!0,children:(0,e.jsx)(ke,{italic:!0,children:s.formatMessage({id:"cloudAccount.extend.title.detailed.configuration"})})}),(0,e.jsx)(ut,{type:B.type,fields:B.fields,accountId:m.id,visible:ne,onVisibleChange:_,value:d.getFieldValue("credentials"),onChange:be})]}),(0,e.jsx)(C.Z,{span:24,style:{marginBottom:"-12px"},children:(0,e.jsx)(rt.Z,{label:s.formatMessage({id:"cloudAccount.extend.title.cloud.services"}),name:"resourceTypeList",fieldProps:{multiple:!0,showCheckedStrategy:ht,options:P,allowClear:!0,showSearch:!0,notFoundContent:i?(0,e.jsx)(We.Z,{size:"small"}):(0,e.jsx)(Pe.Z,{image:Pe.Z.PRESENTED_IMAGE_SIMPLE})},extra:(0,e.jsxs)(st.Z,{name:"enableInverseSelection",tooltip:s.formatMessage({id:"cloudAccount.extend.tooltip.selection.mode"}),style:{marginTop:"8px",marginBottom:0},initialValue:!1,children:[s.formatMessage({id:"cloudAccount.extend.title.cloud.services.inverse.selection"}),(0,e.jsx)(Re.Z,{title:s.formatMessage({id:"cloudAccount.extend.tooltip.selection.mode"}),children:(0,e.jsx)(tt.Z,{style:{marginLeft:4}})})]})})}),(0,e.jsx)(C.Z,{span:24,style:{marginTop:"-16px"},children:(0,e.jsx)(pe.Z,{name:"site",label:s.formatMessage({id:"cloudAccount.extend.title.cloud.site"})})}),B.hasProxy&&(0,e.jsxs)(C.Z,{span:24,children:[(0,e.jsx)(I.Z,{className:T.sectionDivider,dashed:!0,children:(0,e.jsx)(ke,{italic:!0,children:s.formatMessage({id:"cloudAccount.form.proxy"})})}),(0,e.jsx)(ft,{})]})]}):null}})]})},Be=xt,jt=t(17910),yt=t(98165),Ct=t(62548),It=t(40357),At=t(72269),Ke=t(86738),z={accountListTable:"accountListTable___EAu4J",cloudAccountWrap:"cloudAccountWrap___rED3n",cloudAccountList:"cloudAccountList___bSSKI",accountCard:"accountCard___Ff6OW",divider:"divider___oeq1I",propertyWrap:"propertyWrap___cmHKv",propertyName:"propertyName___fiUje",accountNameWrap:"accountNameWrap___gsm80",accountModal:"accountModal___ZRBFT",iKnow:"iKnow____ILRT",basicInfoRow:"basicInfoRow___Nlip5",basicLeftRow:"basicLeftRow___KpoYr",leftInfoLabel:"leftInfoLabel___b3k2E",rightInfoLabel:"rightInfoLabel___ch993",basicInfoValue:"basicInfoValue___XJpgy"},Mt=function(u){var y=u.account,H=u.requestInitData,a=u.requestCurrentData,J=y.id,E=y.platform,i=y.cloudAccountId,P=y.alias,Z=y.accountStatus,Y=y.tenantName,q=y.resourceCount,d=y.riskCount,s=y.lastScanTime,g=y.collectorStatus,m=y.gmtCreate,x=y.gmtModified,Me=(0,A.useModel)("rule"),V=Me.platformList,ye=Ne.ZP.useMessage(),ne=D()(ye,2),_=ne[0],$=ne[1],p=(0,A.useIntl)(),Se=(0,v.useState)(!1),Ce=D()(Se,2),be=Ce[0],Ze=Ce[1],Ee=(0,v.useRef)({}),Ie=(0,v.useState)(!1),U=D()(Ie,2),R=U[0],M=U[1],B=(0,v.useRef)({}),f=function(){var o=b()(h()().mark(function S(k,O){var De,K;return h()().wrap(function(re){for(;;)switch(re.prev=re.next){case 0:return De={cloudAccountId:k,accountStatus:O},re.next=3,(0,ge.updateCloudAccountStatus)(De);case 3:if(K=re.sent,!(K.code===200||K.msg==="success")){re.next=8;break}return _.success(p.formatMessage({id:"common.message.text.edit.success"})),re.next=8,a();case 8:case"end":return re.stop()}},S)}));return function(k,O){return o.apply(this,arguments)}}(),c=function(){var o=b()(h()().mark(function S(){var k,O;return h()().wrap(function(K){for(;;)switch(K.prev=K.next){case 0:return k=_.loading(p.formatMessage({id:"common.message.text.delete.loading"})),K.next=3,(0,ge.removeCloudAccount)({id:J});case 3:if(O=K.sent,k(),!(O.code===200||O.msg==="success")){K.next=9;break}return _.success(p.formatMessage({id:"common.message.text.delete.success"})),K.next=9,H();case 9:case"end":return K.stop()}},S)}));return function(){return o.apply(this,arguments)}}();return(0,e.jsxs)(e.Fragment,{children:[$,(0,e.jsxs)("div",{className:z.accountCard,children:[(0,e.jsxs)(w.Z,{justify:"space-between",style:{width:"100%"},children:[(0,e.jsxs)(w.Z,{children:[(0,e.jsx)(It.Z,{src:jt.J_[E],alt:"PLATFORM_ICON",width:62,height:62,preview:!1}),(0,e.jsxs)("div",{className:z.accountNameWrap,children:[(0,e.jsx)(L.Z,{text:i||"-",maxWidth:100,rows:1,style:{color:"#262626",fontSize:17,fontWeight:500},placement:"topLeft"}),(0,e.jsx)(L.Z,{text:P||"-",maxWidth:100,rows:1,style:{color:"#333",fontSize:12,margin:"1px 0"},placement:"topLeft"}),(0,e.jsx)(L.Z,{text:(0,we.PZ)(E,V)||"-",maxWidth:100,rows:1,style:{color:"#999",fontSize:13},placement:"topLeft"})]})]}),(0,e.jsx)(Re.Z,{title:p.formatMessage({id:"cloudAccount.extend.title.collect.status"}),children:(0,e.jsx)(At.Z,{style:{flexShrink:0},checkedChildren:p.formatMessage({id:"common.button.text.enable"}),unCheckedChildren:p.formatMessage({id:"common.button.text.disable"}),checked:Z==="valid",onClick:function(){return f(i,Z==="valid"?"invalid":"valid")}})})]}),(0,e.jsx)(I.Z,{className:z.divider}),(0,e.jsxs)(F.Z,{gutter:[24,8],children:[(0,e.jsxs)(C.Z,{span:14,className:z.propertyWrap,children:[(0,e.jsx)("div",{className:z.propertyName,children:p.formatMessage({id:"cloudAccount.extend.title.tenant.attribution"})}),(0,e.jsx)(L.Z,{text:Y||"-",maxWidth:123,rows:1,style:{color:"#999",fontSize:13},placement:"topLeft"})]}),(0,e.jsxs)(C.Z,{span:10,className:z.propertyWrap,children:[(0,e.jsx)("div",{className:z.propertyName,children:p.formatMessage({id:"cloudAccount.extend.title.asset.number"})}),(0,e.jsxs)(w.Z,{align:"center",gap:8,children:[(0,e.jsx)(L.Z,{text:q,maxWidth:70,rows:1,style:{color:"#457AFF",fontSize:12},link:!0,onClickCallBackFunc:function(){return A.history.push("/assetManagement/assetList?platform=".concat(E,"&cloudAccountId=").concat(i))},placement:"topLeft"}),(0,e.jsx)(I.Z,{type:"vertical",style:{margin:0,height:12}}),(0,e.jsx)(L.Z,{text:d,maxWidth:70,rows:1,style:{color:"#ff4d4f",fontSize:12},link:!0,onClickCallBackFunc:function(){return A.history.push("/riskManagement/riskList?platform=".concat(E,"&cloudAccountId=").concat(i))},placement:"topLeft"})]})]}),(0,e.jsxs)(C.Z,{span:14,className:z.propertyWrap,children:[(0,e.jsx)("div",{className:z.propertyName,children:p.formatMessage({id:"cloudAccount.extend.title.lastScanTime"})}),(0,e.jsx)(L.Z,{text:s||"-",maxWidth:123,rows:1,style:{color:"#999",fontSize:13},placement:"topLeft"})]}),(0,e.jsxs)(C.Z,{span:10,className:z.propertyWrap,children:[(0,e.jsx)("div",{className:z.propertyName,children:p.formatMessage({id:"cloudAccount.extend.title.collection.status"})}),(0,e.jsxs)(w.Z,{align:"center",children:[(0,e.jsx)(L.Z,{text:g||"-",maxWidth:81,rows:1,style:{color:"#999",fontSize:13},placement:"topLeft"}),g==="\u626B\u63CF\u4E2D"?(0,e.jsx)(yt.Z,{style:{marginLeft:8,fontSize:13,color:"#1677FF"},spin:!0}):g==="\u5F85\u626B\u63CF"?(0,e.jsx)(Ke.Z,{title:p.formatMessage({id:"cloudAccount.extend.collection.popconfirm"}),onConfirm:b()(h()().mark(function o(){var S;return h()().wrap(function(O){for(;;)switch(O.prev=O.next){case 0:return O.next=2,(0,ge.createCollectTask)({cloudAccountId:i});case 2:if(S=O.sent,!(S.code===200||S.msg==="success")){O.next=7;break}return _.success(p.formatMessage({id:"common.message.text.add.success"})),O.next=7,a();case 7:case"end":return O.stop()}},o)})),okText:p.formatMessage({id:"common.button.text.ok"}),cancelText:p.formatMessage({id:"common.button.text.cancel"}),children:(0,e.jsx)(Ct.Z,{style:{marginLeft:8,cursor:"pointer",fontSize:13,color:"#1677FF"}})}):null]})]}),(0,e.jsxs)(C.Z,{span:24,className:z.propertyWrap,children:[(0,e.jsx)("div",{className:z.propertyName,children:p.formatMessage({id:"cloudAccount.extend.title.createAndUpdateTime"})}),(0,e.jsx)(L.Z,{text:m||"-",maxWidth:228,rows:1,style:{color:"#999",fontSize:13},placement:"topLeft"}),(0,e.jsx)(L.Z,{text:x||"-",maxWidth:228,rows:1,style:{color:"#999",fontSize:13,margin:"2px 0 16px 0"}})]})]}),(0,e.jsxs)(w.Z,{style:{width:"100%"},justify:"center",children:[(0,e.jsx)(Ke.Z,{title:p.formatMessage({id:"common.button.text.delete.confirm"}),onConfirm:function(){return c()},okText:p.formatMessage({id:"common.button.text.ok"}),cancelText:p.formatMessage({id:"common.button.text.cancel"}),children:(0,e.jsx)(de.ZP,{type:"primary",style:{width:64,height:30,borderRadius:4,backgroundColor:"#FFF2F3",color:"#EC4344"},children:p.formatMessage({id:"common.button.text.delete"})})}),(0,e.jsx)(de.ZP,{size:"small",type:"primary",style:{width:64,height:30,borderRadius:4,backgroundColor:"#E7F1FF",color:"#1677FF",margin:"0 8px"},onClick:function(){Ze(!0),Ee.current=j()({},y)},children:p.formatMessage({id:"common.button.text.edit"})}),(0,e.jsx)(de.ZP,{size:"small",type:"link",style:{width:64,height:30,borderRadius:4,backgroundColor:"#E7F1FF",color:"#1677FF",marginLeft:8},onClick:function(){A.history.push("/cloudAccount/collectionRecord?platform=".concat(E,"&cloudAccountId=").concat(i))},children:p.formatMessage({id:"cloudAccount.button.text.collection.record"})})]})]}),(0,e.jsx)(Be,{editFormVisible:be,setEditFormVisible:Ze,accountInfo:Ee.current,requestCurrentData:a}),(0,e.jsx)(r,{accountModalVisible:R,setAccountModalVisible:M,accountModalInfo:B.current})]})},St=Mt,Ge=t(93410),bt=t(84567),He=t(34041),Zt=t(42075),Et=t(84611),he=1,xe=12,Dt=[{label:(0,e.jsx)(A.FormattedMessage,{id:"cloudAccount.module.search.open"}),value:"valid"},{label:(0,e.jsx)(A.FormattedMessage,{id:"cloudAccount.module.search.stop"}),value:"invalid"},{label:(0,e.jsx)(A.FormattedMessage,{id:"cloudAccount.module.search.scanning"}),value:"running"},{label:(0,e.jsx)(A.FormattedMessage,{id:"cloudAccount.module.search.waitingToScan"}),value:"waiting"}],Lt=function(){var u,y=(0,A.useModel)("rule"),H=y.platformList,a=N.Z.useForm(),J=D()(a,1),E=J[0],i=(0,A.useIntl)(),P=(0,v.useRef)({}),Z=(0,v.useState)(!1),Y=D()(Z,2),q=Y[0],d=Y[1],s=(0,v.useState)(he),g=D()(s,2),m=g[0],x=g[1],Me=(0,v.useState)(xe),V=D()(Me,2),ye=V[0],ne=V[1],_=(0,A.useRequest)(function(f){return(0,ge.queryCloudAccountList)(f)},{manual:!0,formatResult:function(c){return c.content}}),$=_.data,p=_.run,Se=_.loading,Ce=function(){var f=b()(h()().mark(function c(){return h()().wrap(function(S){for(;;)switch(S.prev=S.next){case 0:return x(he),ne(xe),E==null||E.resetFields(),S.next=5,p({page:he,size:xe});case 5:case"end":return S.stop()}},c)}));return function(){return f.apply(this,arguments)}}(),be=function(){var f=b()(h()().mark(function c(){var o;return h()().wrap(function(k){for(;;)switch(k.prev=k.next){case 0:return x(he),ne(xe),o=E.getFieldsValue(),k.next=5,p(j()(j()({},o),{},{page:he,size:xe}));case 5:case"end":return k.stop()}},c)}));return function(){return f.apply(this,arguments)}}(),Ze=function(){E.resetFields()},Ee=function(c){x(he),ne(xe),p(j()(j()({},c),{},{page:he,size:xe}))};(0,v.useEffect)(function(){p({page:m,size:ye})},[]);var Ie=(0,A.useRequest)(function(f){return(0,ge.cloudAccountBaseInfoList)(j()({},f))},{formatResult:function(c){if(c.msg==="success"){var o;return(c==null||(o=c.content)===null||o===void 0||(o=o.accountAliasList)===null||o===void 0?void 0:o.map(function(S){return{label:S,value:S}}))||[]}}}),U=Ie.data,R=Ie.run,M=Ie.loading,B=(0,v.useMemo)(function(){var f=function(o){R({platformList:E.getFieldValue("platformList")||[],cloudAccountSearch:o})};return(0,Ve.debounce)(f,500)},[ge.cloudAccountBaseInfoList]);return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(Ge.Z,{style:{marginBottom:16},children:(0,e.jsxs)(N.Z,{form:E,onFinish:Ee,children:[(0,e.jsx)(F.Z,{gutter:[24,24],children:(0,e.jsx)(C.Z,{span:24,children:(0,e.jsx)(N.Z.Item,{name:"platformList",label:i.formatMessage({id:"common.select.label.cloudPlatform"}),style:{marginBottom:16},children:(0,e.jsx)(bt.Z.Group,{options:(0,we.T$)(H),onChange:function(c){return R({platformList:c||[]})}})})})}),(0,e.jsxs)(F.Z,{gutter:[24,24],children:[(0,e.jsx)(C.Z,{span:6,children:(0,e.jsx)(N.Z.Item,{name:"cloudAccountId",label:i.formatMessage({id:"common.select.label.cloudAccount"}),style:{marginBottom:0,width:"100%"},children:(0,e.jsx)(He.Z,{allowClear:!0,showSearch:!0,placeholder:i.formatMessage({id:"common.select.query.text.placeholder"}),notFoundContent:M&&(0,e.jsx)(We.Z,{size:"small"}),onSearch:B,options:U||[]})})}),(0,e.jsx)(C.Z,{span:6,children:(0,e.jsx)(N.Z.Item,{name:"status",label:i.formatMessage({id:"common.select.label.Collection.status"}),style:{marginBottom:0,width:"100%"},children:(0,e.jsx)(He.Z,{allowClear:!0,placeholder:i.formatMessage({id:"common.select.text.placeholder"}),options:Dt})})}),(0,e.jsx)(C.Z,{span:6,offset:6,style:{width:"100%"},children:(0,e.jsx)(w.Z,{justify:"flex-end",style:{width:"100%"},children:(0,e.jsx)(N.Z.Item,{style:{marginBottom:0},children:(0,e.jsxs)(Zt.Z,{size:8,children:[(0,e.jsx)(de.ZP,{onClick:Ze,children:i.formatMessage({id:"common.button.text.reset"})}),(0,e.jsx)(de.ZP,{type:"primary",htmlType:"submit",loading:Se,children:i.formatMessage({id:"common.button.text.query"})})]})})})})]})]})}),(0,e.jsxs)(Ge.Z,{style:{minHeight:488},children:[(0,e.jsx)(F.Z,{style:{marginBottom:28},justify:"end",children:(0,e.jsx)(de.ZP,{type:"primary",onClick:function(){d(!0),P.current={}},children:i.formatMessage({id:"common.button.text.add"})},"create")}),(0,e.jsx)(F.Z,{className:z.cloudAccountWrap,children:(0,e.jsx)(We.Z,{spinning:Se,children:(0,Ve.isEmpty)($==null?void 0:$.data)?(0,e.jsx)(w.Z,{align:"center",justify:"center",style:{width:" 100%",minHeight:356},children:(0,e.jsx)(Pe.Z,{image:Pe.Z.PRESENTED_IMAGE_SIMPLE})}):(0,e.jsx)("div",{className:z.cloudAccountList,children:$==null||(u=$.data)===null||u===void 0?void 0:u.map(function(f){return(0,e.jsx)(St,{account:f,requestInitData:Ce,requestCurrentData:be},f.id)})})})}),(0,e.jsx)(F.Z,{children:(0,e.jsx)(w.Z,{justify:"center",style:{width:"100%",marginTop:"16px"},children:(0,e.jsx)(Et.Z,{onChange:function(c,o){x(c),ne(o),p(j()(j()({},E.getFieldsValue()),{},{page:c,size:o}))},current:m,pageSize:ye,size:"small",showTotal:function(c,o){return(0,we.GO)(c,o,i==null?void 0:i.locale)},total:($==null?void 0:$.total)||0,showSizeChanger:!0,pageSizeOptions:[12,24]})})})]}),(0,e.jsx)(Be,{editFormVisible:q,setEditFormVisible:d,accountInfo:P.current,requestCurrentData:be})]})},Tt=Lt,Ft=function(){return(0,e.jsx)(G._z,{title:!1,children:(0,e.jsx)(Tt,{})})},Ot=Ft},53846:function(ie,Q){"use strict";Q.Z={customTitle:"customTitle___nzcxh",riskHigh:"riskHigh___GstO6",riskMedium:"riskMedium___F4JTb",riskLow:"riskLow___HJopw",imgProcess:"imgProcess___NGndv",imgResult:"imgResult___wKhiG",validTag:"validTag___TRSau",invalidTag:"invalidTag___opVlG",waitingTag:"waitingTag___JZpZT"}},85674:function(ie,Q,t){var G={"./simpleWorker":18352,"./simpleWorker.js":18352};function v(W){return Promise.resolve().then(function(){if(!t.o(G,W)){var j=new Error("Cannot find module '"+W+"'");throw j.code="MODULE_NOT_FOUND",j}var ee=G[W];return t(ee)})}v.keys=function(){return Object.keys(G)},v.id=85674,ie.exports=v},10131:function(ie,Q,t){var G={"./editorBaseApi":[20927],"./editorBaseApi.js":[20927],"./editorSimpleWorker":[81465],"./editorSimpleWorker.js":[81465],"./editorWorker":[85215],"./editorWorker.js":[85215],"./editorWorkerHost":[98008],"./editorWorkerHost.js":[98008],"./findSectionHeaders":[72846],"./findSectionHeaders.js":[72846],"./getIconClasses":[22016],"./getIconClasses.js":[22016],"./languageFeatureDebounce":[88191],"./languageFeatureDebounce.js":[88191],"./languageFeatures":[71922],"./languageFeatures.js":[71922],"./languageFeaturesService":[7421],"./languageFeaturesService.js":[7421],"./languageService":[81032],"./languageService.js":[81032],"./languagesAssociations":[73536],"./languagesAssociations.js":[73536],"./languagesRegistry":[4765],"./languagesRegistry.js":[4765],"./markerDecorations":[36357],"./markerDecorations.js":[36357],"./markerDecorationsService":[86036],"./markerDecorationsService.js":[86036],"./model":[73733],"./model.js":[73733],"./modelService":[51200],"./modelService.js":[51200],"./resolverService":[88216],"./resolverService.js":[88216],"./semanticTokensDto":[14704],"./semanticTokensDto.js":[14704],"./semanticTokensProviderStyling":[92294],"./semanticTokensProviderStyling.js":[92294],"./semanticTokensStyling":[73343],"./semanticTokensStyling.js":[73343],"./semanticTokensStylingService":[84146],"./semanticTokensStylingService.js":[84146],"./textModelSync/textModelSync.impl":[28944],"./textModelSync/textModelSync.impl.js":[28944],"./textModelSync/textModelSync.protocol":[23145,3145],"./textModelSync/textModelSync.protocol.js":[23145,3145],"./textResourceConfiguration":[71765],"./textResourceConfiguration.js":[71765],"./treeSitterParserService":[28922],"./treeSitterParserService.js":[28922],"./treeViewsDnd":[80642],"./treeViewsDnd.js":[80642],"./treeViewsDndService":[58345],"./treeViewsDndService.js":[58345],"./unicodeTextModelHighlighter":[31446],"./unicodeTextModelHighlighter.js":[31446]};function v(W){if(!t.o(G,W))return Promise.resolve().then(function(){var h=new Error("Cannot find module '"+W+"'");throw h.code="MODULE_NOT_FOUND",h});var j=G[W],ee=j[0];return Promise.all(j.slice(1).map(t.e)).then(function(){return t(ee)})}v.keys=function(){return Object.keys(G)},v.id=10131,ie.exports=v}}]); | |||
There was a problem hiding this comment.
issue (code-quality): Use const or let instead of var. (avoid-using-var)
Explanation
`const` is preferred as it ensures you cannot reassign references (which can lead to buggy and confusing code). `let` may be used if you need to reassign references - it's preferred to `var` because it is block- rather than function-scoped.From the Airbnb JavaScript Style Guide
| @@ -0,0 +1 @@ | |||
| (self.webpackChunk=self.webpackChunk||[]).push([[9418],{91618:function(ie,Q,t){"use strict";t.d(Q,{Z:function(){return e}});var G=t(62435),v=Object.defineProperty,W=Object.getOwnPropertySymbols,j=Object.prototype.hasOwnProperty,ee=Object.prototype.propertyIsEnumerable,h=(l,n,r)=>n in l?v(l,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):l[n]=r,Ae=(l,n)=>{for(var r in n||(n={}))j.call(n,r)&&h(l,r,n[r]);if(W)for(var r of W(n))ee.call(n,r)&&h(l,r,n[r]);return l};const b=l=>React.createElement("svg",Ae({width:8,height:8,xmlns:"http://www.w3.org/2000/svg"},l),React.createElement("title",null,"\u5931\u8D25"),React.createElement("path",{d:"M4 0a4 4 0 1 1 0 8 4 4 0 0 1 0-8Zm-.81 2.784a.287.287 0 1 0-.406.405l.81.811-.81.81a.287.287 0 1 0 .405.406L4 4.406l.81.81a.287.287 0 1 0 .406-.405L4.406 4l.81-.81a.287.287 0 1 0-.405-.406L4 3.594l-.81-.81Z",fill:"#FF3931",fillRule:"nonzero"}));var se="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iOCIgaGVpZ2h0PSI4IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGQ9Ik00IDBhNCA0IDAgMSAxIDAgOCA0IDQgMCAwIDEgMC04Wm0tLjgxIDIuNzg0YS4yODcuMjg3IDAgMSAwLS40MDYuNDA1bC44MS44MTEtLjgxLjgxYS4yODcuMjg3IDAgMSAwIC40MDUuNDA2TDQgNC40MDZsLjgxLjgxYS4yODcuMjg3IDAgMSAwIC40MDYtLjQwNUw0LjQwNiA0bC44MS0uODFhLjI4Ny4yODcgMCAxIDAtLjQwNS0uNDA2TDQgMy41OTRsLS44MS0uODFaIiBmaWxsPSIjRkYzOTMxIiBmaWxsLXJ1bGU9Im5vbnplcm8iLz48L3N2Zz4=",D=Object.defineProperty,L=Object.getOwnPropertySymbols,te=Object.prototype.hasOwnProperty,N=Object.prototype.propertyIsEnumerable,ae=(l,n,r)=>n in l?D(l,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):l[n]=r,me=(l,n)=>{for(var r in n||(n={}))te.call(n,r)&&ae(l,r,n[r]);if(L)for(var r of L(n))N.call(n,r)&&ae(l,r,n[r]);return l};const F=l=>React.createElement("svg",me({width:8,height:8,xmlns:"http://www.w3.org/2000/svg"},l),React.createElement("title",null,"\u901A\u8FC7"),React.createElement("path",{d:"M4 0a4 4 0 1 1 0 8 4 4 0 0 1 0-8Zm1.712 2.788a.3.3 0 0 0-.424 0L3.502 4.576l-.79-.787a.3.3 0 0 0-.424.425l1.003.999a.3.3 0 0 0 .424-.001l1.997-2a.3.3 0 0 0 0-.424Z",fill:"#379E0E",fillRule:"nonzero"}));var C="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iOCIgaGVpZ2h0PSI4IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGQ9Ik00IDBhNCA0IDAgMSAxIDAgOCA0IDQgMCAwIDEgMC04Wm0xLjcxMiAyLjc4OGEuMy4zIDAgMCAwLS40MjQgMEwzLjUwMiA0LjU3NmwtLjc5LS43ODdhLjMuMyAwIDAgMC0uNDI0LjQyNWwxLjAwMy45OTlhLjMuMyAwIDAgMCAuNDI0LS4wMDFsMS45OTctMmEuMy4zIDAgMCAwIDAtLjQyNFoiIGZpbGw9IiMzNzlFMEUiIGZpbGwtcnVsZT0ibm9uemVybyIvPjwvc3ZnPg==",w=Object.defineProperty,I=Object.getOwnPropertySymbols,A=Object.prototype.hasOwnProperty,T=Object.prototype.propertyIsEnumerable,oe=(l,n,r)=>n in l?w(l,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):l[n]=r,X=(l,n)=>{for(var r in n||(n={}))A.call(n,r)&&oe(l,r,n[r]);if(I)for(var r of I(n))T.call(n,r)&&oe(l,r,n[r]);return l};const fe=l=>React.createElement("svg",X({width:8,height:8,xmlns:"http://www.w3.org/2000/svg"},l),React.createElement("title",null,"\u5F85\u64CD\u4F5C"),React.createElement("g",{fillRule:"nonzero",fill:"none"},React.createElement("path",{d:"M4 0a4 4 0 1 1 0 8 4 4 0 0 1 0-8Z",fill:"#FFB310"}),React.createElement("path",{d:"M3.775 2.412a.287.287 0 1 0-.573 0v1.71c0 .316.257.573.573.573h1.718a.287.287 0 1 0 0-.573H3.775v-1.71Z",fill:"#FFF1D4"})));var ce="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iOCIgaGVpZ2h0PSI4IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxnIGZpbGwtcnVsZT0ibm9uemVybyIgZmlsbD0ibm9uZSI+PHBhdGggZD0iTTQgMGE0IDQgMCAxIDEgMCA4IDQgNCAwIDAgMSAwLThaIiBmaWxsPSIjRkZCMzEwIi8+PHBhdGggZD0iTTMuNzc1IDIuNDEyYS4yODcuMjg3IDAgMSAwLS41NzMgMHYxLjcxYzAgLjMxNi4yNTcuNTczLjU3My41NzNoMS43MThhLjI4Ny4yODcgMCAxIDAgMC0uNTczSDMuNzc1di0xLjcxWiIgZmlsbD0iI0ZGRjFENCIvPjwvZz48L3N2Zz4=",Fe=t(66309),ve=t(53846),ue=t(86074),e=function(l){var n=l.state,r=(0,ue.jsx)(Fe.Z,{children:n||"-"});return["success","valid"].includes(n)?r=(0,ue.jsxs)(Fe.Z,{className:ve.Z.validTag,children:[(0,ue.jsx)("img",{src:C,alt:"VALID_ICON",className:ve.Z.imgResult}),"Valid"]}):["error","invalid","failed"].includes(n)?r=(0,ue.jsxs)(Fe.Z,{className:ve.Z.invalidTag,children:[(0,ue.jsx)("img",{src:se,alt:"VALID_ICON",className:ve.Z.imgResult}),"Invalid"]}):["waiting","wait"].includes(n)&&(r=(0,ue.jsxs)(Fe.Z,{className:ve.Z.waitingTag,children:[(0,ue.jsx)("img",{src:ce,alt:"WAITING_ICON",className:ve.Z.imgProcess}),"Waiting"]})),r}},24163:function(ie,Q,t){"use strict";var G=t(97857),v=t.n(G),W=t(25593),j=t(83062),ee=t(62435),h=t(86074),Ae=W.Z.Paragraph;Q.Z=function(b){var se=b.text,D=b.width,L=b.maxWidth,te=b.rows,N=te===void 0?2:te,ae=b.placement,me=ae===void 0?"top":ae,F=b.color,C=F===void 0?"rgba(0, 0, 0, 0.88)":F,w=b.link,I=w===void 0?!1:w,A=b.onClickCallBackFunc,T=b.style,oe=T===void 0?{}:T,X=b.copyable,fe=X===void 0?!1:X;return(0,h.jsx)("div",{style:{maxWidth:L,width:D},children:(0,h.jsx)(j.Z,{title:(0,h.jsx)("div",{children:se}),placement:me,children:(0,h.jsx)(Ae,{ellipsis:{rows:N},style:v()({marginBottom:0,color:C,cursor:I?"pointer":""},oe),onClick:A,copyable:fe,children:se})})})}},52078:function(ie,Q,t){"use strict";var G=t(97857),v=t.n(G),W=t(27997),j=t(62435),ee=t(86074),h=function(b){W.Mj.register({id:"json"});var se=b.value,D=se===void 0?"{}":se,L=b.onChange,te=b.editorStyle,N=te===void 0?{}:te,ae=b.editorKey,me=ae===void 0?"json-editor":ae,F=b.readOnly,C=F===void 0?!1:F,w=(0,j.useRef)(),I=(0,j.useRef)(),A=function(){var oe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"{}";try{return JSON.parse(oe),oe}catch(X){return console.warn("Invalid JSON string:",X),"{}"}};return(0,j.useEffect)(function(){if(w.current)return I.current?I.current.setValue(D):(I.current=W.j6.create(w.current,{value:A(D),language:"json",theme:"vs",readOnly:C,folding:!0,automaticLayout:!0}),I.current.onDidChangeModelContent(function(){var T=I.current.getValue();console.log("[JSONEditor] \u7F16\u8F91\u5668\u5185\u5BB9\u53D8\u66F4:",{newValue:T}),L==null||L(T)})),function(){if(I!=null&&I.current){var T;I==null||(T=I.current)===null||T===void 0||T.dispose(),I.current=null}}},[]),(0,j.useEffect)(function(){I.current&&D!==I.current.getValue()&&I.current.setValue(A(D))},[D]),(0,ee.jsx)("div",{ref:w,style:v()({height:360,borderRadius:4,overflow:"hidden"},N)},me)};Q.Z=h},87958:function(ie,Q,t){"use strict";t.r(Q),t.d(Q,{default:function(){return Ot}});var G=t(39380),v=t(62435),W=t(97857),j=t.n(W),ee=t(15009),h=t.n(ee),Ae=t(99289),b=t.n(Ae),se=t(5574),D=t.n(se),L=t(24163),te=t(25593),N=t(99859),ae=t(17788),me=t(21532),F=t(71230),C=t(15746),w=t(86250),I=t(96074),A=t(45830),T={leftInfoLabel:"leftInfoLabel___SJHhs",rightInfoLabel:"rightInfoLabel___c8v5r",basicInfoValue:"basicInfoValue___Cwl01",accountModal:"accountModal___hexAB",sectionDivider:"sectionDivider___oQjeE",proxyCollapse:"proxyCollapse___dPuDK"},oe=t(91618),X={ALI_CLOUD:{type:"basic",fields:[{name:"ak",label:"AK",required:!0},{name:"sk",label:"SK",required:!0}],hasProxy:!0},HUAWEI_CLOUD:{type:"basic",fields:[{name:"ak",label:"AK",required:!0},{name:"sk",label:"SK",required:!0}]},BAIDU_CLOUD:{type:"basic",fields:[{name:"ak",label:"AK",required:!0},{name:"sk",label:"SK",required:!0}]},AWS:{type:"basic",fields:[{name:"ak",label:"AK",required:!0},{name:"sk",label:"SK",required:!0}]},TENCENT_CLOUD:{type:"basic",fields:[{name:"ak",label:"AK",required:!0},{name:"sk",label:"SK",required:!0}]},KINGSOFT_CLOUD:{type:"basic",fields:[{name:"ak",label:"AK",required:!0},{name:"sk",label:"SK",required:!0}]},AZURE:{type:"basic",fields:[{name:"ak",label:"AK",required:!0},{name:"sk",label:"SK",required:!0}]},GCP:{type:"json",fields:[{name:"credentialsJson",label:"GCP KEY",required:!0}]},ALI_CLOUD_PRIVATE:{type:"exclusive",fields:[{name:"ak",label:"AK",required:!0},{name:"sk",label:"SK",required:!0},{name:"endpoint",label:"Endpoint",required:!0},{name:"regionId",label:"RegionId",required:!0}]},HUAWEI_CLOUD_PRIVATE:{type:"extend",fields:[{name:"ak",label:"AK",required:!0},{name:"sk",label:"SK",required:!0},{name:"iamEndpoint",label:"Iam_Endpoint",required:!0},{name:"ecsEndpoint",label:"Ecs_Endpoint",required:!0},{name:"elbEndpoint",label:"Elb_Endpoint",required:!0},{name:"evsEndpoint",label:"Evs_Endpoint",required:!0},{name:"vpcEndpoint",label:"Vpc_Endpoint",required:!0},{name:"obsEndpoint",label:"Obs_Endpoint",required:!0},{name:"regionId",label:"RegionId",required:!0},{name:"projectId",label:"ProjectId"}]}},fe={cloudAccountId:[{required:!0,message:"Please enter your cloud account ID"}],alias:[{required:!0,message:"Please enter the alias of your cloud account"}],tenantId:[{required:!0,message:"Please select the tenant"}],platform:[{required:!0,message:"Please select the cloud platform"}]},ce=["GCP"],Fe=null,ve=null,ue=null,e=t(86074),l=te.Z.Text,n=function(u){var y,H,a=u.accountInfo,J=u.visible,E=u.onCancel,i=u.tenantListAll,P=u.resourceTypeList,Z=(0,A.useIntl)(),Y=N.Z.useForm(),q=D()(Y,1),d=q[0],s=ce!=null&&ce.includes(a==null?void 0:a.platform)?600:500;return(0,e.jsxs)(ae.Z,{title:(0,e.jsx)("div",{style:{fontSize:16,fontWeight:500},children:Z.formatMessage({id:"cloudAccount.extend.title.accountInfo"})}),open:J,onCancel:E,footer:null,width:800,style:{minHeight:s},destroyOnClose:!0,children:[(0,e.jsx)(me.ZP,{theme:{components:{Form:{labelColor:"rgba(74, 74, 74, 1)",colorTextHeading:"rgba(74, 74, 74, 1)"}}},children:(0,e.jsxs)(N.Z,{form:d,layout:"vertical",children:[(0,e.jsxs)(F.Z,{children:[(0,e.jsxs)(C.Z,{span:12,children:[(0,e.jsxs)(F.Z,{style:{height:44},children:[(0,e.jsxs)("span",{className:T.leftInfoLabel,children:[Z.formatMessage({id:"cloudAccount.extend.title.accountId"}),"\xA0:"]}),(0,e.jsx)(L.Z,{style:{paddingTop:11,color:"#457aff"},text:(a==null?void 0:a.cloudAccountId)||"-",rows:1,maxWidth:100})]}),(0,e.jsxs)(F.Z,{style:{height:44},children:[(0,e.jsxs)("span",{className:T.leftInfoLabel,children:[Z.formatMessage({id:"cloudAccount.extend.title.alias"}),"\xA0:"]}),(0,e.jsx)(L.Z,{style:{paddingTop:11,color:"#457aff"},text:(a==null?void 0:a.alias)||"-",rows:1,maxWidth:100})]}),(0,e.jsxs)(F.Z,{style:{height:44},children:[(0,e.jsxs)("span",{className:T.leftInfoLabel,children:[Z.formatMessage({id:"cloudAccount.extend.title.platform"}),"\xA0:"]}),(0,e.jsx)(L.Z,{style:{paddingTop:11,color:"#457aff"},text:(P==null||(y=P.filter(function(g){return g.value===(a==null?void 0:a.platform)}))===null||y===void 0||(y=y.map(function(g){return Z.formatMessage({id:g.label})}))===null||y===void 0?void 0:y.toString())||"-",rows:1,maxWidth:100})]}),(0,e.jsxs)(F.Z,{style:{height:44},children:[(0,e.jsxs)("span",{className:T.leftInfoLabel,children:[Z.formatMessage({id:"common.select.label.tenant"}),"\xA0:"]}),(0,e.jsx)(L.Z,{style:{paddingTop:11,color:"#457aff"},text:(i==null||(H=i.find(function(g){return g.value===(a==null?void 0:a.tenantId)}))===null||H===void 0?void 0:H.label)||"-",rows:1,maxWidth:100})]})]}),(0,e.jsxs)(C.Z,{span:12,children:[(0,e.jsxs)(F.Z,{style:{height:44},children:[(0,e.jsxs)("span",{className:T.rightInfoLabel,children:[Z.formatMessage({id:"cloudAccount.extend.title.asset.number"}),"\xA0:"]}),(0,e.jsx)("span",{className:T.basicInfoValue,style:{color:"#457aff"},children:(a==null?void 0:a.resourceCount)||0})]}),(0,e.jsxs)(F.Z,{children:[(0,e.jsx)("span",{className:T.rightInfoLabel,style:{height:44},children:ce!=null&&ce.includes(a==null?void 0:a.platform)?"GCP KEY ".concat(Z.formatMessage({id:"common.link.text.status"})," : "):"AK/SK ".concat(Z.formatMessage({id:"common.link.text.status"})," : ")}),(0,e.jsx)(w.Z,{align:"center",children:(0,e.jsx)(oe.Z,{state:a==null?void 0:a.status})})]})]})]}),(0,e.jsx)(N.Z.Item,{label:Z.formatMessage({id:"cloudAccount.extend.title.lastScanTime"}),children:(0,e.jsx)(l,{style:{color:"rgba(74, 74, 74, 1)"},children:(a==null?void 0:a.lastScanTime)||" -"})}),(0,e.jsx)(N.Z.Item,{label:Z.formatMessage({id:"cloudAccount.extend.title.createTime"}),children:(0,e.jsx)(l,{style:{color:"rgba(74, 74, 74, 1)"},children:(a==null?void 0:a.gmtCreate)||"-"})}),(0,e.jsx)(N.Z.Item,{label:Z.formatMessage({id:"cloudAccount.extend.title.updateTime"}),children:(0,e.jsx)(l,{style:{color:"rgba(74, 74, 74, 1)"},children:(a==null?void 0:a.gmtModified)||"-"})})]})}),(0,e.jsx)(I.Z,{style:{margin:"18px 0 0 0",borderColor:"#457aff",opacity:.25}})]})},r=n,_e=t(13769),Xe=t.n(_e),ge=t(92635),qe=t(58638),et=t(45605),tt=t(25035),at=t(184),pe=t(5966),Ue=t(64317),nt=t(97462),rt=t(8214),st=t(63434),ot=t(3303),Ne=t(68872),de=t(83622),Re=t(83062),We=t(57381),Pe=t(32983),we=t(29448),lt=t(86548),it=t(52078),ct=function(u){var y=u.type,H=u.fields,a=u.accountId,J=u.visible,E=u.onVisibleChange,i=u.value,P=u.onChange,Z=(0,A.useIntl)(),Y=function(s,g){var m=j()({},i||{});m[s]=g,P==null||P(m)},q=function(s){var g=(s==null?void 0:s.trim())||"{}";P==null||P({credentialsJson:g})};return a&&!J?(0,e.jsx)(N.Z.Item,{label:Z.formatMessage({id:"cloudAccount.form.credential"}),name:"action",children:(0,e.jsx)(de.ZP,{type:"link",onClick:function(){return E(!0)},style:{padding:"4px 0",color:"#2f54eb"},children:(0,e.jsx)(lt.Z,{})})}):J?y==="json"?(0,e.jsx)(pe.Z,{name:"credentialsJson",label:"GCP KEY",initialValue:(i==null?void 0:i.credentialsJson)||"{}",rules:[{required:!0,validator:function(){var d=b()(h()().mark(function g(m,x){return h()().wrap(function(V){for(;;)switch(V.prev=V.next){case 0:if(x!=null&&x.trim()){V.next=2;break}throw new Error("Please enter a valid GCP KEY");case 2:V.prev=2,JSON.parse(x),V.next=9;break;case 6:throw V.prev=6,V.t0=V.catch(2),new Error("Please enter a valid GCP KEY in JSON format");case 9:case"end":return V.stop()}},g,null,[[2,6]])}));function s(g,m){return d.apply(this,arguments)}return s}()}],children:(0,e.jsx)(it.Z,{value:(i==null?void 0:i.credentialsJson)||"{}",onChange:q,editorStyle:{height:"240px"},editorKey:"CREDENTIALS_JSON_EDITOR"})}):(0,e.jsx)(e.Fragment,{children:H.map(function(d){var s=d.name;return(0,e.jsx)(pe.Z,{name:["credentials",s],label:d.label,rules:[{required:d.required}],fieldProps:{type:d.type||"text",onChange:function(m){return Y(s,m.target.value)}}},s)})}):null},ut=ct,dt=t(90672),mt=function(){var u=(0,A.useIntl)();return(0,e.jsx)(dt.Z,{name:"proxyConfig",label:u.formatMessage({id:"cloudAccount.form.proxy"}),placeholder:u.formatMessage({id:"cloudAccount.form.proxy.placeholder"})})},ft=mt,Ve=t(96486),vt=t(79930),gt=function(){var u=(0,A.useIntl)(),y=(0,v.useState)(!1),H=D()(y,2),a=H[0],J=H[1],E=(0,v.useState)([]),i=D()(E,2),P=i[0],Z=i[1],Y=(0,v.useCallback)(function(){var q=b()(h()().mark(function d(s){var g;return h()().wrap(function(x){for(;;)switch(x.prev=x.next){case 0:if(s!=null&&s.trim()){x.next=2;break}return x.abrupt("return");case 2:return J(!0),x.prev=3,x.next=6,(0,vt.queryGroupTypeList)({platformList:[s]});case 6:g=x.sent,(0,Ve.isEmpty)(g.content)?(Z([]),Ne.ZP.error(u.formatMessage({id:"cloudAccount.message.text.no.assets"}))):Z(g==null?void 0:g.content),x.next=14;break;case 10:x.prev=10,x.t0=x.catch(3),Ne.ZP.error("\u83B7\u53D6\u8D44\u6E90\u7C7B\u578B\u5217\u8868\u5931\u8D25"),Z([]);case 14:return x.prev=14,J(!1),x.finish(14);case 17:case"end":return x.stop()}},d,null,[[3,10,14,17]])}));return function(d){return q.apply(this,arguments)}}(),[u]);return{loading:a,resourceTypes:P,fetchResourceTypes:Y}},pt=["resourceTypeListForWeb","credentialMap","id","proxyConfig","platform"],ht=ot.Z.SHOW_CHILD,ke=te.Z.Text,xt=function(u){var y=(0,A.useModel)("rule"),H=y.platformList,a=(0,A.useModel)("tenant"),J=a.tenantListAll,E=gt(),i=E.loading,P=E.resourceTypes,Z=E.fetchResourceTypes,Y=N.Z.useForm(),q=D()(Y,1),d=q[0],s=(0,A.useIntl)(),g=u.editFormVisible,m=u.accountInfo,x=u.setEditFormVisible,Me=u.requestCurrentData,V=(0,v.useState)(!0),ye=D()(V,2),ne=ye[0],_=ye[1],$=(0,v.useState)("{}"),p=D()($,2),Se=p[0],Ce=p[1],be=function(R){var M=d.getFieldsValue(),B=M.platform;if(B){var f=X[B];if(f)if(f.type==="json"){var c=R.credentialsJson||"{}";Ce(c),d.setFieldsValue({credentials:{credentialsJson:c}})}else{var o=d.getFieldValue("credentials")||{},S=j()({},o);f.fields.forEach(function(k){var O=k.name;O in R&&R[O]!==void 0&&(S[O]=R[O])}),d.setFieldsValue({credentials:S})}}},Ze=function(){var U=b()(h()().mark(function R(){var M,B,f,c,o,S,k,O,De,K,Le,re,Te,Oe,ze,Je,$e;return h()().wrap(function(le){for(;;)switch(le.prev=le.next){case 0:if(M=d.getFieldsValue(),B=M.cloudAccountId,f=M.email,c=M.alias,o=M.tenantId,S=M.platform,k=M.resourceTypeList,O=M.site,De=M.owner,K=M.proxyConfig,Le=M.credentials,re=M.enableInverseSelection,Te={cloudAccountId:B,email:f,alias:c,tenantId:typeof o=="string"?parseInt(o,10):o,platform:S,resourceTypeList:k,site:O,owner:De,enableInverseSelection:re},Oe=X[S],Oe){le.next=6;break}return le.abrupt("return");case 6:return ne&&(Oe.type==="json"?Te.credentialsObj={credentialsJson:(Le==null?void 0:Le.credentialsJson)||Se}:(ze=j()({},Le||{}),Oe.fields.forEach(function(Nt){var Qe=Nt.name,Ye=d.getFieldValue(["credentials",Qe]);Ye!==void 0&&(ze[Qe]=Ye)}),Te.credentialsObj=ze)),Oe.hasProxy&&K&&(Te.proxyConfig=K),m.id&&(Te.id=m.id),le.next=11,(0,ge.saveCloudAccount)(Te);case 11:if(Je=le.sent,Je.msg!=="success"){le.next=18;break}return $e=m.id?"common.message.text.edit.success":"common.message.text.create.success",Ne.ZP.success(s.formatMessage({id:$e})),x(!1),le.next=18,Me();case 18:case"end":return le.stop()}},R)}));return function(){return U.apply(this,arguments)}}();(0,v.useEffect)(function(){if(g&&m.id){var U;_(!1);var R=m.resourceTypeListForWeb,M=m.credentialMap,B=m.id,f=m.proxyConfig,c=m.platform,o=Xe()(m,pt),S=j()(j()({},o),{},{credentials:M||{},resourceTypeList:R||[],proxyConfig:f||void 0,platform:c||"",enableInverseSelection:o.enableInverseSelection||!1});c&&((U=X[c])===null||U===void 0?void 0:U.type)==="json"&&M!==null&&M!==void 0&&M.credentialsJson&&Ce(M.credentialsJson),d.setFieldsValue(S),m.platform&&Z(m.platform)}},[g,m]);var Ee=function(){d.resetFields()},Ie=function(){x(!1),Ee()};return(0,e.jsxs)(at.a,{labelCol:{span:5},wrapperCol:{span:17},title:(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("span",{style:{marginRight:4},children:s.formatMessage({id:m.id?"cloudAccount.extend.title.edit":"cloudAccount.extend.title.add"})}),(0,e.jsxs)(de.ZP,{size:"small",type:"link",href:"https://cloudrec.yuque.com/org-wiki-cloudrec-iew3sz/hocvhx/fetbofdu8dx15q73",target:"_blank",style:{color:"#2f54eb",gap:4},children:[(0,e.jsx)(qe.Z,{}),(0,e.jsx)("span",{children:s.formatMessage({id:"common.link.text.help.center"})})]})]}),width:720,form:d,drawerProps:{destroyOnClose:!0,onClose:Ie,styles:{body:{paddingTop:24}}},open:g,onFinish:Ze,layout:"horizontal",children:[(0,e.jsx)(I.Z,{className:T.sectionDivider,dashed:!0,children:(0,e.jsx)(ke,{italic:!0,children:s.formatMessage({id:"cloudAccount.extend.title.basic.information"})})}),(0,e.jsxs)(F.Z,{children:[(0,e.jsx)(C.Z,{span:24,children:(0,e.jsx)(pe.Z,{disabled:!!m.id,name:"cloudAccountId",label:s.formatMessage({id:"cloudAccount.extend.title.account.id"}),rules:fe.cloudAccountId,fieldProps:{suffix:!!m.id&&(0,e.jsx)(Re.Z,{title:"\u4E91\u8D26\u53F7ID\u4E3A\u4E91\u5E73\u53F0\u4E3B\u8D26\u53F7ID\uFF0C\u521B\u5EFA\u540E\u65E0\u6CD5\u4FEE\u6539",children:(0,e.jsx)(et.Z,{style:{color:"rgba(0,0,0,.45)"}})})}})}),(0,e.jsx)(C.Z,{span:24,children:(0,e.jsx)(pe.Z,{name:"email",label:s.formatMessage({id:"cloudAccount.extend.title.account.email"})})}),(0,e.jsx)(C.Z,{span:24,children:(0,e.jsx)(pe.Z,{name:"alias",label:s.formatMessage({id:"cloudAccount.extend.title.account.alias"}),rules:fe.alias})}),(0,e.jsx)(C.Z,{span:24,children:(0,e.jsx)(Ue.Z,{label:s.formatMessage({id:"common.select.label.tenant"}),name:"tenantId",rules:fe.tenantId,options:J})}),(0,e.jsx)(C.Z,{span:24,children:(0,e.jsx)(pe.Z,{name:"owner",label:"Owner"})}),(0,e.jsx)(C.Z,{span:24,children:(0,e.jsx)(Ue.Z,{label:s.formatMessage({id:"cloudAccount.extend.title.cloud.platform"}),name:"platform",rules:fe.platform,options:(0,we.T$)(H,"start"),onChange:function(R){m.id&&_(!1),d.setFieldValue("resourceTypeList",void 0),Z(R)}})})]}),(0,e.jsx)(nt.Z,{name:["platform"],children:function(R){var M=R.platform;if(!M)return null;var B=X[M];return B?(0,e.jsxs)(F.Z,{children:[(0,e.jsxs)(C.Z,{span:24,children:[(0,e.jsx)(I.Z,{className:T.sectionDivider,dashed:!0,children:(0,e.jsx)(ke,{italic:!0,children:s.formatMessage({id:"cloudAccount.extend.title.detailed.configuration"})})}),(0,e.jsx)(ut,{type:B.type,fields:B.fields,accountId:m.id,visible:ne,onVisibleChange:_,value:d.getFieldValue("credentials"),onChange:be})]}),(0,e.jsx)(C.Z,{span:24,style:{marginBottom:"-12px"},children:(0,e.jsx)(rt.Z,{label:s.formatMessage({id:"cloudAccount.extend.title.cloud.services"}),name:"resourceTypeList",fieldProps:{multiple:!0,showCheckedStrategy:ht,options:P,allowClear:!0,showSearch:!0,notFoundContent:i?(0,e.jsx)(We.Z,{size:"small"}):(0,e.jsx)(Pe.Z,{image:Pe.Z.PRESENTED_IMAGE_SIMPLE})},extra:(0,e.jsxs)(st.Z,{name:"enableInverseSelection",tooltip:s.formatMessage({id:"cloudAccount.extend.tooltip.selection.mode"}),style:{marginTop:"8px",marginBottom:0},initialValue:!1,children:[s.formatMessage({id:"cloudAccount.extend.title.cloud.services.inverse.selection"}),(0,e.jsx)(Re.Z,{title:s.formatMessage({id:"cloudAccount.extend.tooltip.selection.mode"}),children:(0,e.jsx)(tt.Z,{style:{marginLeft:4}})})]})})}),(0,e.jsx)(C.Z,{span:24,style:{marginTop:"-16px"},children:(0,e.jsx)(pe.Z,{name:"site",label:s.formatMessage({id:"cloudAccount.extend.title.cloud.site"})})}),B.hasProxy&&(0,e.jsxs)(C.Z,{span:24,children:[(0,e.jsx)(I.Z,{className:T.sectionDivider,dashed:!0,children:(0,e.jsx)(ke,{italic:!0,children:s.formatMessage({id:"cloudAccount.form.proxy"})})}),(0,e.jsx)(ft,{})]})]}):null}})]})},Be=xt,jt=t(17910),yt=t(98165),Ct=t(62548),It=t(40357),At=t(72269),Ke=t(86738),z={accountListTable:"accountListTable___EAu4J",cloudAccountWrap:"cloudAccountWrap___rED3n",cloudAccountList:"cloudAccountList___bSSKI",accountCard:"accountCard___Ff6OW",divider:"divider___oeq1I",propertyWrap:"propertyWrap___cmHKv",propertyName:"propertyName___fiUje",accountNameWrap:"accountNameWrap___gsm80",accountModal:"accountModal___ZRBFT",iKnow:"iKnow____ILRT",basicInfoRow:"basicInfoRow___Nlip5",basicLeftRow:"basicLeftRow___KpoYr",leftInfoLabel:"leftInfoLabel___b3k2E",rightInfoLabel:"rightInfoLabel___ch993",basicInfoValue:"basicInfoValue___XJpgy"},Mt=function(u){var y=u.account,H=u.requestInitData,a=u.requestCurrentData,J=y.id,E=y.platform,i=y.cloudAccountId,P=y.alias,Z=y.accountStatus,Y=y.tenantName,q=y.resourceCount,d=y.riskCount,s=y.lastScanTime,g=y.collectorStatus,m=y.gmtCreate,x=y.gmtModified,Me=(0,A.useModel)("rule"),V=Me.platformList,ye=Ne.ZP.useMessage(),ne=D()(ye,2),_=ne[0],$=ne[1],p=(0,A.useIntl)(),Se=(0,v.useState)(!1),Ce=D()(Se,2),be=Ce[0],Ze=Ce[1],Ee=(0,v.useRef)({}),Ie=(0,v.useState)(!1),U=D()(Ie,2),R=U[0],M=U[1],B=(0,v.useRef)({}),f=function(){var o=b()(h()().mark(function S(k,O){var De,K;return h()().wrap(function(re){for(;;)switch(re.prev=re.next){case 0:return De={cloudAccountId:k,accountStatus:O},re.next=3,(0,ge.updateCloudAccountStatus)(De);case 3:if(K=re.sent,!(K.code===200||K.msg==="success")){re.next=8;break}return _.success(p.formatMessage({id:"common.message.text.edit.success"})),re.next=8,a();case 8:case"end":return re.stop()}},S)}));return function(k,O){return o.apply(this,arguments)}}(),c=function(){var o=b()(h()().mark(function S(){var k,O;return h()().wrap(function(K){for(;;)switch(K.prev=K.next){case 0:return k=_.loading(p.formatMessage({id:"common.message.text.delete.loading"})),K.next=3,(0,ge.removeCloudAccount)({id:J});case 3:if(O=K.sent,k(),!(O.code===200||O.msg==="success")){K.next=9;break}return _.success(p.formatMessage({id:"common.message.text.delete.success"})),K.next=9,H();case 9:case"end":return K.stop()}},S)}));return function(){return o.apply(this,arguments)}}();return(0,e.jsxs)(e.Fragment,{children:[$,(0,e.jsxs)("div",{className:z.accountCard,children:[(0,e.jsxs)(w.Z,{justify:"space-between",style:{width:"100%"},children:[(0,e.jsxs)(w.Z,{children:[(0,e.jsx)(It.Z,{src:jt.J_[E],alt:"PLATFORM_ICON",width:62,height:62,preview:!1}),(0,e.jsxs)("div",{className:z.accountNameWrap,children:[(0,e.jsx)(L.Z,{text:i||"-",maxWidth:100,rows:1,style:{color:"#262626",fontSize:17,fontWeight:500},placement:"topLeft"}),(0,e.jsx)(L.Z,{text:P||"-",maxWidth:100,rows:1,style:{color:"#333",fontSize:12,margin:"1px 0"},placement:"topLeft"}),(0,e.jsx)(L.Z,{text:(0,we.PZ)(E,V)||"-",maxWidth:100,rows:1,style:{color:"#999",fontSize:13},placement:"topLeft"})]})]}),(0,e.jsx)(Re.Z,{title:p.formatMessage({id:"cloudAccount.extend.title.collect.status"}),children:(0,e.jsx)(At.Z,{style:{flexShrink:0},checkedChildren:p.formatMessage({id:"common.button.text.enable"}),unCheckedChildren:p.formatMessage({id:"common.button.text.disable"}),checked:Z==="valid",onClick:function(){return f(i,Z==="valid"?"invalid":"valid")}})})]}),(0,e.jsx)(I.Z,{className:z.divider}),(0,e.jsxs)(F.Z,{gutter:[24,8],children:[(0,e.jsxs)(C.Z,{span:14,className:z.propertyWrap,children:[(0,e.jsx)("div",{className:z.propertyName,children:p.formatMessage({id:"cloudAccount.extend.title.tenant.attribution"})}),(0,e.jsx)(L.Z,{text:Y||"-",maxWidth:123,rows:1,style:{color:"#999",fontSize:13},placement:"topLeft"})]}),(0,e.jsxs)(C.Z,{span:10,className:z.propertyWrap,children:[(0,e.jsx)("div",{className:z.propertyName,children:p.formatMessage({id:"cloudAccount.extend.title.asset.number"})}),(0,e.jsxs)(w.Z,{align:"center",gap:8,children:[(0,e.jsx)(L.Z,{text:q,maxWidth:70,rows:1,style:{color:"#457AFF",fontSize:12},link:!0,onClickCallBackFunc:function(){return A.history.push("/assetManagement/assetList?platform=".concat(E,"&cloudAccountId=").concat(i))},placement:"topLeft"}),(0,e.jsx)(I.Z,{type:"vertical",style:{margin:0,height:12}}),(0,e.jsx)(L.Z,{text:d,maxWidth:70,rows:1,style:{color:"#ff4d4f",fontSize:12},link:!0,onClickCallBackFunc:function(){return A.history.push("/riskManagement/riskList?platform=".concat(E,"&cloudAccountId=").concat(i))},placement:"topLeft"})]})]}),(0,e.jsxs)(C.Z,{span:14,className:z.propertyWrap,children:[(0,e.jsx)("div",{className:z.propertyName,children:p.formatMessage({id:"cloudAccount.extend.title.lastScanTime"})}),(0,e.jsx)(L.Z,{text:s||"-",maxWidth:123,rows:1,style:{color:"#999",fontSize:13},placement:"topLeft"})]}),(0,e.jsxs)(C.Z,{span:10,className:z.propertyWrap,children:[(0,e.jsx)("div",{className:z.propertyName,children:p.formatMessage({id:"cloudAccount.extend.title.collection.status"})}),(0,e.jsxs)(w.Z,{align:"center",children:[(0,e.jsx)(L.Z,{text:g||"-",maxWidth:81,rows:1,style:{color:"#999",fontSize:13},placement:"topLeft"}),g==="\u626B\u63CF\u4E2D"?(0,e.jsx)(yt.Z,{style:{marginLeft:8,fontSize:13,color:"#1677FF"},spin:!0}):g==="\u5F85\u626B\u63CF"?(0,e.jsx)(Ke.Z,{title:p.formatMessage({id:"cloudAccount.extend.collection.popconfirm"}),onConfirm:b()(h()().mark(function o(){var S;return h()().wrap(function(O){for(;;)switch(O.prev=O.next){case 0:return O.next=2,(0,ge.createCollectTask)({cloudAccountId:i});case 2:if(S=O.sent,!(S.code===200||S.msg==="success")){O.next=7;break}return _.success(p.formatMessage({id:"common.message.text.add.success"})),O.next=7,a();case 7:case"end":return O.stop()}},o)})),okText:p.formatMessage({id:"common.button.text.ok"}),cancelText:p.formatMessage({id:"common.button.text.cancel"}),children:(0,e.jsx)(Ct.Z,{style:{marginLeft:8,cursor:"pointer",fontSize:13,color:"#1677FF"}})}):null]})]}),(0,e.jsxs)(C.Z,{span:24,className:z.propertyWrap,children:[(0,e.jsx)("div",{className:z.propertyName,children:p.formatMessage({id:"cloudAccount.extend.title.createAndUpdateTime"})}),(0,e.jsx)(L.Z,{text:m||"-",maxWidth:228,rows:1,style:{color:"#999",fontSize:13},placement:"topLeft"}),(0,e.jsx)(L.Z,{text:x||"-",maxWidth:228,rows:1,style:{color:"#999",fontSize:13,margin:"2px 0 16px 0"}})]})]}),(0,e.jsxs)(w.Z,{style:{width:"100%"},justify:"center",children:[(0,e.jsx)(Ke.Z,{title:p.formatMessage({id:"common.button.text.delete.confirm"}),onConfirm:function(){return c()},okText:p.formatMessage({id:"common.button.text.ok"}),cancelText:p.formatMessage({id:"common.button.text.cancel"}),children:(0,e.jsx)(de.ZP,{type:"primary",style:{width:64,height:30,borderRadius:4,backgroundColor:"#FFF2F3",color:"#EC4344"},children:p.formatMessage({id:"common.button.text.delete"})})}),(0,e.jsx)(de.ZP,{size:"small",type:"primary",style:{width:64,height:30,borderRadius:4,backgroundColor:"#E7F1FF",color:"#1677FF",margin:"0 8px"},onClick:function(){Ze(!0),Ee.current=j()({},y)},children:p.formatMessage({id:"common.button.text.edit"})}),(0,e.jsx)(de.ZP,{size:"small",type:"link",style:{width:64,height:30,borderRadius:4,backgroundColor:"#E7F1FF",color:"#1677FF",marginLeft:8},onClick:function(){A.history.push("/cloudAccount/collectionRecord?platform=".concat(E,"&cloudAccountId=").concat(i))},children:p.formatMessage({id:"cloudAccount.button.text.collection.record"})})]})]}),(0,e.jsx)(Be,{editFormVisible:be,setEditFormVisible:Ze,accountInfo:Ee.current,requestCurrentData:a}),(0,e.jsx)(r,{accountModalVisible:R,setAccountModalVisible:M,accountModalInfo:B.current})]})},St=Mt,Ge=t(93410),bt=t(84567),He=t(34041),Zt=t(42075),Et=t(84611),he=1,xe=12,Dt=[{label:(0,e.jsx)(A.FormattedMessage,{id:"cloudAccount.module.search.open"}),value:"valid"},{label:(0,e.jsx)(A.FormattedMessage,{id:"cloudAccount.module.search.stop"}),value:"invalid"},{label:(0,e.jsx)(A.FormattedMessage,{id:"cloudAccount.module.search.scanning"}),value:"running"},{label:(0,e.jsx)(A.FormattedMessage,{id:"cloudAccount.module.search.waitingToScan"}),value:"waiting"}],Lt=function(){var u,y=(0,A.useModel)("rule"),H=y.platformList,a=N.Z.useForm(),J=D()(a,1),E=J[0],i=(0,A.useIntl)(),P=(0,v.useRef)({}),Z=(0,v.useState)(!1),Y=D()(Z,2),q=Y[0],d=Y[1],s=(0,v.useState)(he),g=D()(s,2),m=g[0],x=g[1],Me=(0,v.useState)(xe),V=D()(Me,2),ye=V[0],ne=V[1],_=(0,A.useRequest)(function(f){return(0,ge.queryCloudAccountList)(f)},{manual:!0,formatResult:function(c){return c.content}}),$=_.data,p=_.run,Se=_.loading,Ce=function(){var f=b()(h()().mark(function c(){return h()().wrap(function(S){for(;;)switch(S.prev=S.next){case 0:return x(he),ne(xe),E==null||E.resetFields(),S.next=5,p({page:he,size:xe});case 5:case"end":return S.stop()}},c)}));return function(){return f.apply(this,arguments)}}(),be=function(){var f=b()(h()().mark(function c(){var o;return h()().wrap(function(k){for(;;)switch(k.prev=k.next){case 0:return x(he),ne(xe),o=E.getFieldsValue(),k.next=5,p(j()(j()({},o),{},{page:he,size:xe}));case 5:case"end":return k.stop()}},c)}));return function(){return f.apply(this,arguments)}}(),Ze=function(){E.resetFields()},Ee=function(c){x(he),ne(xe),p(j()(j()({},c),{},{page:he,size:xe}))};(0,v.useEffect)(function(){p({page:m,size:ye})},[]);var Ie=(0,A.useRequest)(function(f){return(0,ge.cloudAccountBaseInfoList)(j()({},f))},{formatResult:function(c){if(c.msg==="success"){var o;return(c==null||(o=c.content)===null||o===void 0||(o=o.accountAliasList)===null||o===void 0?void 0:o.map(function(S){return{label:S,value:S}}))||[]}}}),U=Ie.data,R=Ie.run,M=Ie.loading,B=(0,v.useMemo)(function(){var f=function(o){R({platformList:E.getFieldValue("platformList")||[],cloudAccountSearch:o})};return(0,Ve.debounce)(f,500)},[ge.cloudAccountBaseInfoList]);return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(Ge.Z,{style:{marginBottom:16},children:(0,e.jsxs)(N.Z,{form:E,onFinish:Ee,children:[(0,e.jsx)(F.Z,{gutter:[24,24],children:(0,e.jsx)(C.Z,{span:24,children:(0,e.jsx)(N.Z.Item,{name:"platformList",label:i.formatMessage({id:"common.select.label.cloudPlatform"}),style:{marginBottom:16},children:(0,e.jsx)(bt.Z.Group,{options:(0,we.T$)(H),onChange:function(c){return R({platformList:c||[]})}})})})}),(0,e.jsxs)(F.Z,{gutter:[24,24],children:[(0,e.jsx)(C.Z,{span:6,children:(0,e.jsx)(N.Z.Item,{name:"cloudAccountId",label:i.formatMessage({id:"common.select.label.cloudAccount"}),style:{marginBottom:0,width:"100%"},children:(0,e.jsx)(He.Z,{allowClear:!0,showSearch:!0,placeholder:i.formatMessage({id:"common.select.query.text.placeholder"}),notFoundContent:M&&(0,e.jsx)(We.Z,{size:"small"}),onSearch:B,options:U||[]})})}),(0,e.jsx)(C.Z,{span:6,children:(0,e.jsx)(N.Z.Item,{name:"status",label:i.formatMessage({id:"common.select.label.Collection.status"}),style:{marginBottom:0,width:"100%"},children:(0,e.jsx)(He.Z,{allowClear:!0,placeholder:i.formatMessage({id:"common.select.text.placeholder"}),options:Dt})})}),(0,e.jsx)(C.Z,{span:6,offset:6,style:{width:"100%"},children:(0,e.jsx)(w.Z,{justify:"flex-end",style:{width:"100%"},children:(0,e.jsx)(N.Z.Item,{style:{marginBottom:0},children:(0,e.jsxs)(Zt.Z,{size:8,children:[(0,e.jsx)(de.ZP,{onClick:Ze,children:i.formatMessage({id:"common.button.text.reset"})}),(0,e.jsx)(de.ZP,{type:"primary",htmlType:"submit",loading:Se,children:i.formatMessage({id:"common.button.text.query"})})]})})})})]})]})}),(0,e.jsxs)(Ge.Z,{style:{minHeight:488},children:[(0,e.jsx)(F.Z,{style:{marginBottom:28},justify:"end",children:(0,e.jsx)(de.ZP,{type:"primary",onClick:function(){d(!0),P.current={}},children:i.formatMessage({id:"common.button.text.add"})},"create")}),(0,e.jsx)(F.Z,{className:z.cloudAccountWrap,children:(0,e.jsx)(We.Z,{spinning:Se,children:(0,Ve.isEmpty)($==null?void 0:$.data)?(0,e.jsx)(w.Z,{align:"center",justify:"center",style:{width:" 100%",minHeight:356},children:(0,e.jsx)(Pe.Z,{image:Pe.Z.PRESENTED_IMAGE_SIMPLE})}):(0,e.jsx)("div",{className:z.cloudAccountList,children:$==null||(u=$.data)===null||u===void 0?void 0:u.map(function(f){return(0,e.jsx)(St,{account:f,requestInitData:Ce,requestCurrentData:be},f.id)})})})}),(0,e.jsx)(F.Z,{children:(0,e.jsx)(w.Z,{justify:"center",style:{width:"100%",marginTop:"16px"},children:(0,e.jsx)(Et.Z,{onChange:function(c,o){x(c),ne(o),p(j()(j()({},E.getFieldsValue()),{},{page:c,size:o}))},current:m,pageSize:ye,size:"small",showTotal:function(c,o){return(0,we.GO)(c,o,i==null?void 0:i.locale)},total:($==null?void 0:$.total)||0,showSizeChanger:!0,pageSizeOptions:[12,24]})})})]}),(0,e.jsx)(Be,{editFormVisible:q,setEditFormVisible:d,accountInfo:P.current,requestCurrentData:be})]})},Tt=Lt,Ft=function(){return(0,e.jsx)(G._z,{title:!1,children:(0,e.jsx)(Tt,{})})},Ot=Ft},53846:function(ie,Q){"use strict";Q.Z={customTitle:"customTitle___nzcxh",riskHigh:"riskHigh___GstO6",riskMedium:"riskMedium___F4JTb",riskLow:"riskLow___HJopw",imgProcess:"imgProcess___NGndv",imgResult:"imgResult___wKhiG",validTag:"validTag___TRSau",invalidTag:"invalidTag___opVlG",waitingTag:"waitingTag___JZpZT"}},85674:function(ie,Q,t){var G={"./simpleWorker":18352,"./simpleWorker.js":18352};function v(W){return Promise.resolve().then(function(){if(!t.o(G,W)){var j=new Error("Cannot find module '"+W+"'");throw j.code="MODULE_NOT_FOUND",j}var ee=G[W];return t(ee)})}v.keys=function(){return Object.keys(G)},v.id=85674,ie.exports=v},10131:function(ie,Q,t){var G={"./editorBaseApi":[20927],"./editorBaseApi.js":[20927],"./editorSimpleWorker":[81465],"./editorSimpleWorker.js":[81465],"./editorWorker":[85215],"./editorWorker.js":[85215],"./editorWorkerHost":[98008],"./editorWorkerHost.js":[98008],"./findSectionHeaders":[72846],"./findSectionHeaders.js":[72846],"./getIconClasses":[22016],"./getIconClasses.js":[22016],"./languageFeatureDebounce":[88191],"./languageFeatureDebounce.js":[88191],"./languageFeatures":[71922],"./languageFeatures.js":[71922],"./languageFeaturesService":[7421],"./languageFeaturesService.js":[7421],"./languageService":[81032],"./languageService.js":[81032],"./languagesAssociations":[73536],"./languagesAssociations.js":[73536],"./languagesRegistry":[4765],"./languagesRegistry.js":[4765],"./markerDecorations":[36357],"./markerDecorations.js":[36357],"./markerDecorationsService":[86036],"./markerDecorationsService.js":[86036],"./model":[73733],"./model.js":[73733],"./modelService":[51200],"./modelService.js":[51200],"./resolverService":[88216],"./resolverService.js":[88216],"./semanticTokensDto":[14704],"./semanticTokensDto.js":[14704],"./semanticTokensProviderStyling":[92294],"./semanticTokensProviderStyling.js":[92294],"./semanticTokensStyling":[73343],"./semanticTokensStyling.js":[73343],"./semanticTokensStylingService":[84146],"./semanticTokensStylingService.js":[84146],"./textModelSync/textModelSync.impl":[28944],"./textModelSync/textModelSync.impl.js":[28944],"./textModelSync/textModelSync.protocol":[23145,3145],"./textModelSync/textModelSync.protocol.js":[23145,3145],"./textResourceConfiguration":[71765],"./textResourceConfiguration.js":[71765],"./treeSitterParserService":[28922],"./treeSitterParserService.js":[28922],"./treeViewsDnd":[80642],"./treeViewsDnd.js":[80642],"./treeViewsDndService":[58345],"./treeViewsDndService.js":[58345],"./unicodeTextModelHighlighter":[31446],"./unicodeTextModelHighlighter.js":[31446]};function v(W){if(!t.o(G,W))return Promise.resolve().then(function(){var h=new Error("Cannot find module '"+W+"'");throw h.code="MODULE_NOT_FOUND",h});var j=G[W],ee=j[0];return Promise.all(j.slice(1).map(t.e)).then(function(){return t(ee)})}v.keys=function(){return Object.keys(G)},v.id=10131,ie.exports=v}}]); | |||
There was a problem hiding this comment.
issue (code-quality): Use const or let instead of var. (avoid-using-var)
Explanation
`const` is preferred as it ensures you cannot reassign references (which can lead to buggy and confusing code). `let` may be used if you need to reassign references - it's preferred to `var` because it is block- rather than function-scoped.From the Airbnb JavaScript Style Guide
| @@ -0,0 +1 @@ | |||
| (self.webpackChunk=self.webpackChunk||[]).push([[9418],{91618:function(ie,Q,t){"use strict";t.d(Q,{Z:function(){return e}});var G=t(62435),v=Object.defineProperty,W=Object.getOwnPropertySymbols,j=Object.prototype.hasOwnProperty,ee=Object.prototype.propertyIsEnumerable,h=(l,n,r)=>n in l?v(l,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):l[n]=r,Ae=(l,n)=>{for(var r in n||(n={}))j.call(n,r)&&h(l,r,n[r]);if(W)for(var r of W(n))ee.call(n,r)&&h(l,r,n[r]);return l};const b=l=>React.createElement("svg",Ae({width:8,height:8,xmlns:"http://www.w3.org/2000/svg"},l),React.createElement("title",null,"\u5931\u8D25"),React.createElement("path",{d:"M4 0a4 4 0 1 1 0 8 4 4 0 0 1 0-8Zm-.81 2.784a.287.287 0 1 0-.406.405l.81.811-.81.81a.287.287 0 1 0 .405.406L4 4.406l.81.81a.287.287 0 1 0 .406-.405L4.406 4l.81-.81a.287.287 0 1 0-.405-.406L4 3.594l-.81-.81Z",fill:"#FF3931",fillRule:"nonzero"}));var se="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iOCIgaGVpZ2h0PSI4IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGQ9Ik00IDBhNCA0IDAgMSAxIDAgOCA0IDQgMCAwIDEgMC04Wm0tLjgxIDIuNzg0YS4yODcuMjg3IDAgMSAwLS40MDYuNDA1bC44MS44MTEtLjgxLjgxYS4yODcuMjg3IDAgMSAwIC40MDUuNDA2TDQgNC40MDZsLjgxLjgxYS4yODcuMjg3IDAgMSAwIC40MDYtLjQwNUw0LjQwNiA0bC44MS0uODFhLjI4Ny4yODcgMCAxIDAtLjQwNS0uNDA2TDQgMy41OTRsLS44MS0uODFaIiBmaWxsPSIjRkYzOTMxIiBmaWxsLXJ1bGU9Im5vbnplcm8iLz48L3N2Zz4=",D=Object.defineProperty,L=Object.getOwnPropertySymbols,te=Object.prototype.hasOwnProperty,N=Object.prototype.propertyIsEnumerable,ae=(l,n,r)=>n in l?D(l,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):l[n]=r,me=(l,n)=>{for(var r in n||(n={}))te.call(n,r)&&ae(l,r,n[r]);if(L)for(var r of L(n))N.call(n,r)&&ae(l,r,n[r]);return l};const F=l=>React.createElement("svg",me({width:8,height:8,xmlns:"http://www.w3.org/2000/svg"},l),React.createElement("title",null,"\u901A\u8FC7"),React.createElement("path",{d:"M4 0a4 4 0 1 1 0 8 4 4 0 0 1 0-8Zm1.712 2.788a.3.3 0 0 0-.424 0L3.502 4.576l-.79-.787a.3.3 0 0 0-.424.425l1.003.999a.3.3 0 0 0 .424-.001l1.997-2a.3.3 0 0 0 0-.424Z",fill:"#379E0E",fillRule:"nonzero"}));var C="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iOCIgaGVpZ2h0PSI4IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGQ9Ik00IDBhNCA0IDAgMSAxIDAgOCA0IDQgMCAwIDEgMC04Wm0xLjcxMiAyLjc4OGEuMy4zIDAgMCAwLS40MjQgMEwzLjUwMiA0LjU3NmwtLjc5LS43ODdhLjMuMyAwIDAgMC0uNDI0LjQyNWwxLjAwMy45OTlhLjMuMyAwIDAgMCAuNDI0LS4wMDFsMS45OTctMmEuMy4zIDAgMCAwIDAtLjQyNFoiIGZpbGw9IiMzNzlFMEUiIGZpbGwtcnVsZT0ibm9uemVybyIvPjwvc3ZnPg==",w=Object.defineProperty,I=Object.getOwnPropertySymbols,A=Object.prototype.hasOwnProperty,T=Object.prototype.propertyIsEnumerable,oe=(l,n,r)=>n in l?w(l,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):l[n]=r,X=(l,n)=>{for(var r in n||(n={}))A.call(n,r)&&oe(l,r,n[r]);if(I)for(var r of I(n))T.call(n,r)&&oe(l,r,n[r]);return l};const fe=l=>React.createElement("svg",X({width:8,height:8,xmlns:"http://www.w3.org/2000/svg"},l),React.createElement("title",null,"\u5F85\u64CD\u4F5C"),React.createElement("g",{fillRule:"nonzero",fill:"none"},React.createElement("path",{d:"M4 0a4 4 0 1 1 0 8 4 4 0 0 1 0-8Z",fill:"#FFB310"}),React.createElement("path",{d:"M3.775 2.412a.287.287 0 1 0-.573 0v1.71c0 .316.257.573.573.573h1.718a.287.287 0 1 0 0-.573H3.775v-1.71Z",fill:"#FFF1D4"})));var ce="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iOCIgaGVpZ2h0PSI4IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxnIGZpbGwtcnVsZT0ibm9uemVybyIgZmlsbD0ibm9uZSI+PHBhdGggZD0iTTQgMGE0IDQgMCAxIDEgMCA4IDQgNCAwIDAgMSAwLThaIiBmaWxsPSIjRkZCMzEwIi8+PHBhdGggZD0iTTMuNzc1IDIuNDEyYS4yODcuMjg3IDAgMSAwLS41NzMgMHYxLjcxYzAgLjMxNi4yNTcuNTczLjU3My41NzNoMS43MThhLjI4Ny4yODcgMCAxIDAgMC0uNTczSDMuNzc1di0xLjcxWiIgZmlsbD0iI0ZGRjFENCIvPjwvZz48L3N2Zz4=",Fe=t(66309),ve=t(53846),ue=t(86074),e=function(l){var n=l.state,r=(0,ue.jsx)(Fe.Z,{children:n||"-"});return["success","valid"].includes(n)?r=(0,ue.jsxs)(Fe.Z,{className:ve.Z.validTag,children:[(0,ue.jsx)("img",{src:C,alt:"VALID_ICON",className:ve.Z.imgResult}),"Valid"]}):["error","invalid","failed"].includes(n)?r=(0,ue.jsxs)(Fe.Z,{className:ve.Z.invalidTag,children:[(0,ue.jsx)("img",{src:se,alt:"VALID_ICON",className:ve.Z.imgResult}),"Invalid"]}):["waiting","wait"].includes(n)&&(r=(0,ue.jsxs)(Fe.Z,{className:ve.Z.waitingTag,children:[(0,ue.jsx)("img",{src:ce,alt:"WAITING_ICON",className:ve.Z.imgProcess}),"Waiting"]})),r}},24163:function(ie,Q,t){"use strict";var G=t(97857),v=t.n(G),W=t(25593),j=t(83062),ee=t(62435),h=t(86074),Ae=W.Z.Paragraph;Q.Z=function(b){var se=b.text,D=b.width,L=b.maxWidth,te=b.rows,N=te===void 0?2:te,ae=b.placement,me=ae===void 0?"top":ae,F=b.color,C=F===void 0?"rgba(0, 0, 0, 0.88)":F,w=b.link,I=w===void 0?!1:w,A=b.onClickCallBackFunc,T=b.style,oe=T===void 0?{}:T,X=b.copyable,fe=X===void 0?!1:X;return(0,h.jsx)("div",{style:{maxWidth:L,width:D},children:(0,h.jsx)(j.Z,{title:(0,h.jsx)("div",{children:se}),placement:me,children:(0,h.jsx)(Ae,{ellipsis:{rows:N},style:v()({marginBottom:0,color:C,cursor:I?"pointer":""},oe),onClick:A,copyable:fe,children:se})})})}},52078:function(ie,Q,t){"use strict";var G=t(97857),v=t.n(G),W=t(27997),j=t(62435),ee=t(86074),h=function(b){W.Mj.register({id:"json"});var se=b.value,D=se===void 0?"{}":se,L=b.onChange,te=b.editorStyle,N=te===void 0?{}:te,ae=b.editorKey,me=ae===void 0?"json-editor":ae,F=b.readOnly,C=F===void 0?!1:F,w=(0,j.useRef)(),I=(0,j.useRef)(),A=function(){var oe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"{}";try{return JSON.parse(oe),oe}catch(X){return console.warn("Invalid JSON string:",X),"{}"}};return(0,j.useEffect)(function(){if(w.current)return I.current?I.current.setValue(D):(I.current=W.j6.create(w.current,{value:A(D),language:"json",theme:"vs",readOnly:C,folding:!0,automaticLayout:!0}),I.current.onDidChangeModelContent(function(){var T=I.current.getValue();console.log("[JSONEditor] \u7F16\u8F91\u5668\u5185\u5BB9\u53D8\u66F4:",{newValue:T}),L==null||L(T)})),function(){if(I!=null&&I.current){var T;I==null||(T=I.current)===null||T===void 0||T.dispose(),I.current=null}}},[]),(0,j.useEffect)(function(){I.current&&D!==I.current.getValue()&&I.current.setValue(A(D))},[D]),(0,ee.jsx)("div",{ref:w,style:v()({height:360,borderRadius:4,overflow:"hidden"},N)},me)};Q.Z=h},87958:function(ie,Q,t){"use strict";t.r(Q),t.d(Q,{default:function(){return Ot}});var G=t(39380),v=t(62435),W=t(97857),j=t.n(W),ee=t(15009),h=t.n(ee),Ae=t(99289),b=t.n(Ae),se=t(5574),D=t.n(se),L=t(24163),te=t(25593),N=t(99859),ae=t(17788),me=t(21532),F=t(71230),C=t(15746),w=t(86250),I=t(96074),A=t(45830),T={leftInfoLabel:"leftInfoLabel___SJHhs",rightInfoLabel:"rightInfoLabel___c8v5r",basicInfoValue:"basicInfoValue___Cwl01",accountModal:"accountModal___hexAB",sectionDivider:"sectionDivider___oQjeE",proxyCollapse:"proxyCollapse___dPuDK"},oe=t(91618),X={ALI_CLOUD:{type:"basic",fields:[{name:"ak",label:"AK",required:!0},{name:"sk",label:"SK",required:!0}],hasProxy:!0},HUAWEI_CLOUD:{type:"basic",fields:[{name:"ak",label:"AK",required:!0},{name:"sk",label:"SK",required:!0}]},BAIDU_CLOUD:{type:"basic",fields:[{name:"ak",label:"AK",required:!0},{name:"sk",label:"SK",required:!0}]},AWS:{type:"basic",fields:[{name:"ak",label:"AK",required:!0},{name:"sk",label:"SK",required:!0}]},TENCENT_CLOUD:{type:"basic",fields:[{name:"ak",label:"AK",required:!0},{name:"sk",label:"SK",required:!0}]},KINGSOFT_CLOUD:{type:"basic",fields:[{name:"ak",label:"AK",required:!0},{name:"sk",label:"SK",required:!0}]},AZURE:{type:"basic",fields:[{name:"ak",label:"AK",required:!0},{name:"sk",label:"SK",required:!0}]},GCP:{type:"json",fields:[{name:"credentialsJson",label:"GCP KEY",required:!0}]},ALI_CLOUD_PRIVATE:{type:"exclusive",fields:[{name:"ak",label:"AK",required:!0},{name:"sk",label:"SK",required:!0},{name:"endpoint",label:"Endpoint",required:!0},{name:"regionId",label:"RegionId",required:!0}]},HUAWEI_CLOUD_PRIVATE:{type:"extend",fields:[{name:"ak",label:"AK",required:!0},{name:"sk",label:"SK",required:!0},{name:"iamEndpoint",label:"Iam_Endpoint",required:!0},{name:"ecsEndpoint",label:"Ecs_Endpoint",required:!0},{name:"elbEndpoint",label:"Elb_Endpoint",required:!0},{name:"evsEndpoint",label:"Evs_Endpoint",required:!0},{name:"vpcEndpoint",label:"Vpc_Endpoint",required:!0},{name:"obsEndpoint",label:"Obs_Endpoint",required:!0},{name:"regionId",label:"RegionId",required:!0},{name:"projectId",label:"ProjectId"}]}},fe={cloudAccountId:[{required:!0,message:"Please enter your cloud account ID"}],alias:[{required:!0,message:"Please enter the alias of your cloud account"}],tenantId:[{required:!0,message:"Please select the tenant"}],platform:[{required:!0,message:"Please select the cloud platform"}]},ce=["GCP"],Fe=null,ve=null,ue=null,e=t(86074),l=te.Z.Text,n=function(u){var y,H,a=u.accountInfo,J=u.visible,E=u.onCancel,i=u.tenantListAll,P=u.resourceTypeList,Z=(0,A.useIntl)(),Y=N.Z.useForm(),q=D()(Y,1),d=q[0],s=ce!=null&&ce.includes(a==null?void 0:a.platform)?600:500;return(0,e.jsxs)(ae.Z,{title:(0,e.jsx)("div",{style:{fontSize:16,fontWeight:500},children:Z.formatMessage({id:"cloudAccount.extend.title.accountInfo"})}),open:J,onCancel:E,footer:null,width:800,style:{minHeight:s},destroyOnClose:!0,children:[(0,e.jsx)(me.ZP,{theme:{components:{Form:{labelColor:"rgba(74, 74, 74, 1)",colorTextHeading:"rgba(74, 74, 74, 1)"}}},children:(0,e.jsxs)(N.Z,{form:d,layout:"vertical",children:[(0,e.jsxs)(F.Z,{children:[(0,e.jsxs)(C.Z,{span:12,children:[(0,e.jsxs)(F.Z,{style:{height:44},children:[(0,e.jsxs)("span",{className:T.leftInfoLabel,children:[Z.formatMessage({id:"cloudAccount.extend.title.accountId"}),"\xA0:"]}),(0,e.jsx)(L.Z,{style:{paddingTop:11,color:"#457aff"},text:(a==null?void 0:a.cloudAccountId)||"-",rows:1,maxWidth:100})]}),(0,e.jsxs)(F.Z,{style:{height:44},children:[(0,e.jsxs)("span",{className:T.leftInfoLabel,children:[Z.formatMessage({id:"cloudAccount.extend.title.alias"}),"\xA0:"]}),(0,e.jsx)(L.Z,{style:{paddingTop:11,color:"#457aff"},text:(a==null?void 0:a.alias)||"-",rows:1,maxWidth:100})]}),(0,e.jsxs)(F.Z,{style:{height:44},children:[(0,e.jsxs)("span",{className:T.leftInfoLabel,children:[Z.formatMessage({id:"cloudAccount.extend.title.platform"}),"\xA0:"]}),(0,e.jsx)(L.Z,{style:{paddingTop:11,color:"#457aff"},text:(P==null||(y=P.filter(function(g){return g.value===(a==null?void 0:a.platform)}))===null||y===void 0||(y=y.map(function(g){return Z.formatMessage({id:g.label})}))===null||y===void 0?void 0:y.toString())||"-",rows:1,maxWidth:100})]}),(0,e.jsxs)(F.Z,{style:{height:44},children:[(0,e.jsxs)("span",{className:T.leftInfoLabel,children:[Z.formatMessage({id:"common.select.label.tenant"}),"\xA0:"]}),(0,e.jsx)(L.Z,{style:{paddingTop:11,color:"#457aff"},text:(i==null||(H=i.find(function(g){return g.value===(a==null?void 0:a.tenantId)}))===null||H===void 0?void 0:H.label)||"-",rows:1,maxWidth:100})]})]}),(0,e.jsxs)(C.Z,{span:12,children:[(0,e.jsxs)(F.Z,{style:{height:44},children:[(0,e.jsxs)("span",{className:T.rightInfoLabel,children:[Z.formatMessage({id:"cloudAccount.extend.title.asset.number"}),"\xA0:"]}),(0,e.jsx)("span",{className:T.basicInfoValue,style:{color:"#457aff"},children:(a==null?void 0:a.resourceCount)||0})]}),(0,e.jsxs)(F.Z,{children:[(0,e.jsx)("span",{className:T.rightInfoLabel,style:{height:44},children:ce!=null&&ce.includes(a==null?void 0:a.platform)?"GCP KEY ".concat(Z.formatMessage({id:"common.link.text.status"})," : "):"AK/SK ".concat(Z.formatMessage({id:"common.link.text.status"})," : ")}),(0,e.jsx)(w.Z,{align:"center",children:(0,e.jsx)(oe.Z,{state:a==null?void 0:a.status})})]})]})]}),(0,e.jsx)(N.Z.Item,{label:Z.formatMessage({id:"cloudAccount.extend.title.lastScanTime"}),children:(0,e.jsx)(l,{style:{color:"rgba(74, 74, 74, 1)"},children:(a==null?void 0:a.lastScanTime)||" -"})}),(0,e.jsx)(N.Z.Item,{label:Z.formatMessage({id:"cloudAccount.extend.title.createTime"}),children:(0,e.jsx)(l,{style:{color:"rgba(74, 74, 74, 1)"},children:(a==null?void 0:a.gmtCreate)||"-"})}),(0,e.jsx)(N.Z.Item,{label:Z.formatMessage({id:"cloudAccount.extend.title.updateTime"}),children:(0,e.jsx)(l,{style:{color:"rgba(74, 74, 74, 1)"},children:(a==null?void 0:a.gmtModified)||"-"})})]})}),(0,e.jsx)(I.Z,{style:{margin:"18px 0 0 0",borderColor:"#457aff",opacity:.25}})]})},r=n,_e=t(13769),Xe=t.n(_e),ge=t(92635),qe=t(58638),et=t(45605),tt=t(25035),at=t(184),pe=t(5966),Ue=t(64317),nt=t(97462),rt=t(8214),st=t(63434),ot=t(3303),Ne=t(68872),de=t(83622),Re=t(83062),We=t(57381),Pe=t(32983),we=t(29448),lt=t(86548),it=t(52078),ct=function(u){var y=u.type,H=u.fields,a=u.accountId,J=u.visible,E=u.onVisibleChange,i=u.value,P=u.onChange,Z=(0,A.useIntl)(),Y=function(s,g){var m=j()({},i||{});m[s]=g,P==null||P(m)},q=function(s){var g=(s==null?void 0:s.trim())||"{}";P==null||P({credentialsJson:g})};return a&&!J?(0,e.jsx)(N.Z.Item,{label:Z.formatMessage({id:"cloudAccount.form.credential"}),name:"action",children:(0,e.jsx)(de.ZP,{type:"link",onClick:function(){return E(!0)},style:{padding:"4px 0",color:"#2f54eb"},children:(0,e.jsx)(lt.Z,{})})}):J?y==="json"?(0,e.jsx)(pe.Z,{name:"credentialsJson",label:"GCP KEY",initialValue:(i==null?void 0:i.credentialsJson)||"{}",rules:[{required:!0,validator:function(){var d=b()(h()().mark(function g(m,x){return h()().wrap(function(V){for(;;)switch(V.prev=V.next){case 0:if(x!=null&&x.trim()){V.next=2;break}throw new Error("Please enter a valid GCP KEY");case 2:V.prev=2,JSON.parse(x),V.next=9;break;case 6:throw V.prev=6,V.t0=V.catch(2),new Error("Please enter a valid GCP KEY in JSON format");case 9:case"end":return V.stop()}},g,null,[[2,6]])}));function s(g,m){return d.apply(this,arguments)}return s}()}],children:(0,e.jsx)(it.Z,{value:(i==null?void 0:i.credentialsJson)||"{}",onChange:q,editorStyle:{height:"240px"},editorKey:"CREDENTIALS_JSON_EDITOR"})}):(0,e.jsx)(e.Fragment,{children:H.map(function(d){var s=d.name;return(0,e.jsx)(pe.Z,{name:["credentials",s],label:d.label,rules:[{required:d.required}],fieldProps:{type:d.type||"text",onChange:function(m){return Y(s,m.target.value)}}},s)})}):null},ut=ct,dt=t(90672),mt=function(){var u=(0,A.useIntl)();return(0,e.jsx)(dt.Z,{name:"proxyConfig",label:u.formatMessage({id:"cloudAccount.form.proxy"}),placeholder:u.formatMessage({id:"cloudAccount.form.proxy.placeholder"})})},ft=mt,Ve=t(96486),vt=t(79930),gt=function(){var u=(0,A.useIntl)(),y=(0,v.useState)(!1),H=D()(y,2),a=H[0],J=H[1],E=(0,v.useState)([]),i=D()(E,2),P=i[0],Z=i[1],Y=(0,v.useCallback)(function(){var q=b()(h()().mark(function d(s){var g;return h()().wrap(function(x){for(;;)switch(x.prev=x.next){case 0:if(s!=null&&s.trim()){x.next=2;break}return x.abrupt("return");case 2:return J(!0),x.prev=3,x.next=6,(0,vt.queryGroupTypeList)({platformList:[s]});case 6:g=x.sent,(0,Ve.isEmpty)(g.content)?(Z([]),Ne.ZP.error(u.formatMessage({id:"cloudAccount.message.text.no.assets"}))):Z(g==null?void 0:g.content),x.next=14;break;case 10:x.prev=10,x.t0=x.catch(3),Ne.ZP.error("\u83B7\u53D6\u8D44\u6E90\u7C7B\u578B\u5217\u8868\u5931\u8D25"),Z([]);case 14:return x.prev=14,J(!1),x.finish(14);case 17:case"end":return x.stop()}},d,null,[[3,10,14,17]])}));return function(d){return q.apply(this,arguments)}}(),[u]);return{loading:a,resourceTypes:P,fetchResourceTypes:Y}},pt=["resourceTypeListForWeb","credentialMap","id","proxyConfig","platform"],ht=ot.Z.SHOW_CHILD,ke=te.Z.Text,xt=function(u){var y=(0,A.useModel)("rule"),H=y.platformList,a=(0,A.useModel)("tenant"),J=a.tenantListAll,E=gt(),i=E.loading,P=E.resourceTypes,Z=E.fetchResourceTypes,Y=N.Z.useForm(),q=D()(Y,1),d=q[0],s=(0,A.useIntl)(),g=u.editFormVisible,m=u.accountInfo,x=u.setEditFormVisible,Me=u.requestCurrentData,V=(0,v.useState)(!0),ye=D()(V,2),ne=ye[0],_=ye[1],$=(0,v.useState)("{}"),p=D()($,2),Se=p[0],Ce=p[1],be=function(R){var M=d.getFieldsValue(),B=M.platform;if(B){var f=X[B];if(f)if(f.type==="json"){var c=R.credentialsJson||"{}";Ce(c),d.setFieldsValue({credentials:{credentialsJson:c}})}else{var o=d.getFieldValue("credentials")||{},S=j()({},o);f.fields.forEach(function(k){var O=k.name;O in R&&R[O]!==void 0&&(S[O]=R[O])}),d.setFieldsValue({credentials:S})}}},Ze=function(){var U=b()(h()().mark(function R(){var M,B,f,c,o,S,k,O,De,K,Le,re,Te,Oe,ze,Je,$e;return h()().wrap(function(le){for(;;)switch(le.prev=le.next){case 0:if(M=d.getFieldsValue(),B=M.cloudAccountId,f=M.email,c=M.alias,o=M.tenantId,S=M.platform,k=M.resourceTypeList,O=M.site,De=M.owner,K=M.proxyConfig,Le=M.credentials,re=M.enableInverseSelection,Te={cloudAccountId:B,email:f,alias:c,tenantId:typeof o=="string"?parseInt(o,10):o,platform:S,resourceTypeList:k,site:O,owner:De,enableInverseSelection:re},Oe=X[S],Oe){le.next=6;break}return le.abrupt("return");case 6:return ne&&(Oe.type==="json"?Te.credentialsObj={credentialsJson:(Le==null?void 0:Le.credentialsJson)||Se}:(ze=j()({},Le||{}),Oe.fields.forEach(function(Nt){var Qe=Nt.name,Ye=d.getFieldValue(["credentials",Qe]);Ye!==void 0&&(ze[Qe]=Ye)}),Te.credentialsObj=ze)),Oe.hasProxy&&K&&(Te.proxyConfig=K),m.id&&(Te.id=m.id),le.next=11,(0,ge.saveCloudAccount)(Te);case 11:if(Je=le.sent,Je.msg!=="success"){le.next=18;break}return $e=m.id?"common.message.text.edit.success":"common.message.text.create.success",Ne.ZP.success(s.formatMessage({id:$e})),x(!1),le.next=18,Me();case 18:case"end":return le.stop()}},R)}));return function(){return U.apply(this,arguments)}}();(0,v.useEffect)(function(){if(g&&m.id){var U;_(!1);var R=m.resourceTypeListForWeb,M=m.credentialMap,B=m.id,f=m.proxyConfig,c=m.platform,o=Xe()(m,pt),S=j()(j()({},o),{},{credentials:M||{},resourceTypeList:R||[],proxyConfig:f||void 0,platform:c||"",enableInverseSelection:o.enableInverseSelection||!1});c&&((U=X[c])===null||U===void 0?void 0:U.type)==="json"&&M!==null&&M!==void 0&&M.credentialsJson&&Ce(M.credentialsJson),d.setFieldsValue(S),m.platform&&Z(m.platform)}},[g,m]);var Ee=function(){d.resetFields()},Ie=function(){x(!1),Ee()};return(0,e.jsxs)(at.a,{labelCol:{span:5},wrapperCol:{span:17},title:(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("span",{style:{marginRight:4},children:s.formatMessage({id:m.id?"cloudAccount.extend.title.edit":"cloudAccount.extend.title.add"})}),(0,e.jsxs)(de.ZP,{size:"small",type:"link",href:"https://cloudrec.yuque.com/org-wiki-cloudrec-iew3sz/hocvhx/fetbofdu8dx15q73",target:"_blank",style:{color:"#2f54eb",gap:4},children:[(0,e.jsx)(qe.Z,{}),(0,e.jsx)("span",{children:s.formatMessage({id:"common.link.text.help.center"})})]})]}),width:720,form:d,drawerProps:{destroyOnClose:!0,onClose:Ie,styles:{body:{paddingTop:24}}},open:g,onFinish:Ze,layout:"horizontal",children:[(0,e.jsx)(I.Z,{className:T.sectionDivider,dashed:!0,children:(0,e.jsx)(ke,{italic:!0,children:s.formatMessage({id:"cloudAccount.extend.title.basic.information"})})}),(0,e.jsxs)(F.Z,{children:[(0,e.jsx)(C.Z,{span:24,children:(0,e.jsx)(pe.Z,{disabled:!!m.id,name:"cloudAccountId",label:s.formatMessage({id:"cloudAccount.extend.title.account.id"}),rules:fe.cloudAccountId,fieldProps:{suffix:!!m.id&&(0,e.jsx)(Re.Z,{title:"\u4E91\u8D26\u53F7ID\u4E3A\u4E91\u5E73\u53F0\u4E3B\u8D26\u53F7ID\uFF0C\u521B\u5EFA\u540E\u65E0\u6CD5\u4FEE\u6539",children:(0,e.jsx)(et.Z,{style:{color:"rgba(0,0,0,.45)"}})})}})}),(0,e.jsx)(C.Z,{span:24,children:(0,e.jsx)(pe.Z,{name:"email",label:s.formatMessage({id:"cloudAccount.extend.title.account.email"})})}),(0,e.jsx)(C.Z,{span:24,children:(0,e.jsx)(pe.Z,{name:"alias",label:s.formatMessage({id:"cloudAccount.extend.title.account.alias"}),rules:fe.alias})}),(0,e.jsx)(C.Z,{span:24,children:(0,e.jsx)(Ue.Z,{label:s.formatMessage({id:"common.select.label.tenant"}),name:"tenantId",rules:fe.tenantId,options:J})}),(0,e.jsx)(C.Z,{span:24,children:(0,e.jsx)(pe.Z,{name:"owner",label:"Owner"})}),(0,e.jsx)(C.Z,{span:24,children:(0,e.jsx)(Ue.Z,{label:s.formatMessage({id:"cloudAccount.extend.title.cloud.platform"}),name:"platform",rules:fe.platform,options:(0,we.T$)(H,"start"),onChange:function(R){m.id&&_(!1),d.setFieldValue("resourceTypeList",void 0),Z(R)}})})]}),(0,e.jsx)(nt.Z,{name:["platform"],children:function(R){var M=R.platform;if(!M)return null;var B=X[M];return B?(0,e.jsxs)(F.Z,{children:[(0,e.jsxs)(C.Z,{span:24,children:[(0,e.jsx)(I.Z,{className:T.sectionDivider,dashed:!0,children:(0,e.jsx)(ke,{italic:!0,children:s.formatMessage({id:"cloudAccount.extend.title.detailed.configuration"})})}),(0,e.jsx)(ut,{type:B.type,fields:B.fields,accountId:m.id,visible:ne,onVisibleChange:_,value:d.getFieldValue("credentials"),onChange:be})]}),(0,e.jsx)(C.Z,{span:24,style:{marginBottom:"-12px"},children:(0,e.jsx)(rt.Z,{label:s.formatMessage({id:"cloudAccount.extend.title.cloud.services"}),name:"resourceTypeList",fieldProps:{multiple:!0,showCheckedStrategy:ht,options:P,allowClear:!0,showSearch:!0,notFoundContent:i?(0,e.jsx)(We.Z,{size:"small"}):(0,e.jsx)(Pe.Z,{image:Pe.Z.PRESENTED_IMAGE_SIMPLE})},extra:(0,e.jsxs)(st.Z,{name:"enableInverseSelection",tooltip:s.formatMessage({id:"cloudAccount.extend.tooltip.selection.mode"}),style:{marginTop:"8px",marginBottom:0},initialValue:!1,children:[s.formatMessage({id:"cloudAccount.extend.title.cloud.services.inverse.selection"}),(0,e.jsx)(Re.Z,{title:s.formatMessage({id:"cloudAccount.extend.tooltip.selection.mode"}),children:(0,e.jsx)(tt.Z,{style:{marginLeft:4}})})]})})}),(0,e.jsx)(C.Z,{span:24,style:{marginTop:"-16px"},children:(0,e.jsx)(pe.Z,{name:"site",label:s.formatMessage({id:"cloudAccount.extend.title.cloud.site"})})}),B.hasProxy&&(0,e.jsxs)(C.Z,{span:24,children:[(0,e.jsx)(I.Z,{className:T.sectionDivider,dashed:!0,children:(0,e.jsx)(ke,{italic:!0,children:s.formatMessage({id:"cloudAccount.form.proxy"})})}),(0,e.jsx)(ft,{})]})]}):null}})]})},Be=xt,jt=t(17910),yt=t(98165),Ct=t(62548),It=t(40357),At=t(72269),Ke=t(86738),z={accountListTable:"accountListTable___EAu4J",cloudAccountWrap:"cloudAccountWrap___rED3n",cloudAccountList:"cloudAccountList___bSSKI",accountCard:"accountCard___Ff6OW",divider:"divider___oeq1I",propertyWrap:"propertyWrap___cmHKv",propertyName:"propertyName___fiUje",accountNameWrap:"accountNameWrap___gsm80",accountModal:"accountModal___ZRBFT",iKnow:"iKnow____ILRT",basicInfoRow:"basicInfoRow___Nlip5",basicLeftRow:"basicLeftRow___KpoYr",leftInfoLabel:"leftInfoLabel___b3k2E",rightInfoLabel:"rightInfoLabel___ch993",basicInfoValue:"basicInfoValue___XJpgy"},Mt=function(u){var y=u.account,H=u.requestInitData,a=u.requestCurrentData,J=y.id,E=y.platform,i=y.cloudAccountId,P=y.alias,Z=y.accountStatus,Y=y.tenantName,q=y.resourceCount,d=y.riskCount,s=y.lastScanTime,g=y.collectorStatus,m=y.gmtCreate,x=y.gmtModified,Me=(0,A.useModel)("rule"),V=Me.platformList,ye=Ne.ZP.useMessage(),ne=D()(ye,2),_=ne[0],$=ne[1],p=(0,A.useIntl)(),Se=(0,v.useState)(!1),Ce=D()(Se,2),be=Ce[0],Ze=Ce[1],Ee=(0,v.useRef)({}),Ie=(0,v.useState)(!1),U=D()(Ie,2),R=U[0],M=U[1],B=(0,v.useRef)({}),f=function(){var o=b()(h()().mark(function S(k,O){var De,K;return h()().wrap(function(re){for(;;)switch(re.prev=re.next){case 0:return De={cloudAccountId:k,accountStatus:O},re.next=3,(0,ge.updateCloudAccountStatus)(De);case 3:if(K=re.sent,!(K.code===200||K.msg==="success")){re.next=8;break}return _.success(p.formatMessage({id:"common.message.text.edit.success"})),re.next=8,a();case 8:case"end":return re.stop()}},S)}));return function(k,O){return o.apply(this,arguments)}}(),c=function(){var o=b()(h()().mark(function S(){var k,O;return h()().wrap(function(K){for(;;)switch(K.prev=K.next){case 0:return k=_.loading(p.formatMessage({id:"common.message.text.delete.loading"})),K.next=3,(0,ge.removeCloudAccount)({id:J});case 3:if(O=K.sent,k(),!(O.code===200||O.msg==="success")){K.next=9;break}return _.success(p.formatMessage({id:"common.message.text.delete.success"})),K.next=9,H();case 9:case"end":return K.stop()}},S)}));return function(){return o.apply(this,arguments)}}();return(0,e.jsxs)(e.Fragment,{children:[$,(0,e.jsxs)("div",{className:z.accountCard,children:[(0,e.jsxs)(w.Z,{justify:"space-between",style:{width:"100%"},children:[(0,e.jsxs)(w.Z,{children:[(0,e.jsx)(It.Z,{src:jt.J_[E],alt:"PLATFORM_ICON",width:62,height:62,preview:!1}),(0,e.jsxs)("div",{className:z.accountNameWrap,children:[(0,e.jsx)(L.Z,{text:i||"-",maxWidth:100,rows:1,style:{color:"#262626",fontSize:17,fontWeight:500},placement:"topLeft"}),(0,e.jsx)(L.Z,{text:P||"-",maxWidth:100,rows:1,style:{color:"#333",fontSize:12,margin:"1px 0"},placement:"topLeft"}),(0,e.jsx)(L.Z,{text:(0,we.PZ)(E,V)||"-",maxWidth:100,rows:1,style:{color:"#999",fontSize:13},placement:"topLeft"})]})]}),(0,e.jsx)(Re.Z,{title:p.formatMessage({id:"cloudAccount.extend.title.collect.status"}),children:(0,e.jsx)(At.Z,{style:{flexShrink:0},checkedChildren:p.formatMessage({id:"common.button.text.enable"}),unCheckedChildren:p.formatMessage({id:"common.button.text.disable"}),checked:Z==="valid",onClick:function(){return f(i,Z==="valid"?"invalid":"valid")}})})]}),(0,e.jsx)(I.Z,{className:z.divider}),(0,e.jsxs)(F.Z,{gutter:[24,8],children:[(0,e.jsxs)(C.Z,{span:14,className:z.propertyWrap,children:[(0,e.jsx)("div",{className:z.propertyName,children:p.formatMessage({id:"cloudAccount.extend.title.tenant.attribution"})}),(0,e.jsx)(L.Z,{text:Y||"-",maxWidth:123,rows:1,style:{color:"#999",fontSize:13},placement:"topLeft"})]}),(0,e.jsxs)(C.Z,{span:10,className:z.propertyWrap,children:[(0,e.jsx)("div",{className:z.propertyName,children:p.formatMessage({id:"cloudAccount.extend.title.asset.number"})}),(0,e.jsxs)(w.Z,{align:"center",gap:8,children:[(0,e.jsx)(L.Z,{text:q,maxWidth:70,rows:1,style:{color:"#457AFF",fontSize:12},link:!0,onClickCallBackFunc:function(){return A.history.push("/assetManagement/assetList?platform=".concat(E,"&cloudAccountId=").concat(i))},placement:"topLeft"}),(0,e.jsx)(I.Z,{type:"vertical",style:{margin:0,height:12}}),(0,e.jsx)(L.Z,{text:d,maxWidth:70,rows:1,style:{color:"#ff4d4f",fontSize:12},link:!0,onClickCallBackFunc:function(){return A.history.push("/riskManagement/riskList?platform=".concat(E,"&cloudAccountId=").concat(i))},placement:"topLeft"})]})]}),(0,e.jsxs)(C.Z,{span:14,className:z.propertyWrap,children:[(0,e.jsx)("div",{className:z.propertyName,children:p.formatMessage({id:"cloudAccount.extend.title.lastScanTime"})}),(0,e.jsx)(L.Z,{text:s||"-",maxWidth:123,rows:1,style:{color:"#999",fontSize:13},placement:"topLeft"})]}),(0,e.jsxs)(C.Z,{span:10,className:z.propertyWrap,children:[(0,e.jsx)("div",{className:z.propertyName,children:p.formatMessage({id:"cloudAccount.extend.title.collection.status"})}),(0,e.jsxs)(w.Z,{align:"center",children:[(0,e.jsx)(L.Z,{text:g||"-",maxWidth:81,rows:1,style:{color:"#999",fontSize:13},placement:"topLeft"}),g==="\u626B\u63CF\u4E2D"?(0,e.jsx)(yt.Z,{style:{marginLeft:8,fontSize:13,color:"#1677FF"},spin:!0}):g==="\u5F85\u626B\u63CF"?(0,e.jsx)(Ke.Z,{title:p.formatMessage({id:"cloudAccount.extend.collection.popconfirm"}),onConfirm:b()(h()().mark(function o(){var S;return h()().wrap(function(O){for(;;)switch(O.prev=O.next){case 0:return O.next=2,(0,ge.createCollectTask)({cloudAccountId:i});case 2:if(S=O.sent,!(S.code===200||S.msg==="success")){O.next=7;break}return _.success(p.formatMessage({id:"common.message.text.add.success"})),O.next=7,a();case 7:case"end":return O.stop()}},o)})),okText:p.formatMessage({id:"common.button.text.ok"}),cancelText:p.formatMessage({id:"common.button.text.cancel"}),children:(0,e.jsx)(Ct.Z,{style:{marginLeft:8,cursor:"pointer",fontSize:13,color:"#1677FF"}})}):null]})]}),(0,e.jsxs)(C.Z,{span:24,className:z.propertyWrap,children:[(0,e.jsx)("div",{className:z.propertyName,children:p.formatMessage({id:"cloudAccount.extend.title.createAndUpdateTime"})}),(0,e.jsx)(L.Z,{text:m||"-",maxWidth:228,rows:1,style:{color:"#999",fontSize:13},placement:"topLeft"}),(0,e.jsx)(L.Z,{text:x||"-",maxWidth:228,rows:1,style:{color:"#999",fontSize:13,margin:"2px 0 16px 0"}})]})]}),(0,e.jsxs)(w.Z,{style:{width:"100%"},justify:"center",children:[(0,e.jsx)(Ke.Z,{title:p.formatMessage({id:"common.button.text.delete.confirm"}),onConfirm:function(){return c()},okText:p.formatMessage({id:"common.button.text.ok"}),cancelText:p.formatMessage({id:"common.button.text.cancel"}),children:(0,e.jsx)(de.ZP,{type:"primary",style:{width:64,height:30,borderRadius:4,backgroundColor:"#FFF2F3",color:"#EC4344"},children:p.formatMessage({id:"common.button.text.delete"})})}),(0,e.jsx)(de.ZP,{size:"small",type:"primary",style:{width:64,height:30,borderRadius:4,backgroundColor:"#E7F1FF",color:"#1677FF",margin:"0 8px"},onClick:function(){Ze(!0),Ee.current=j()({},y)},children:p.formatMessage({id:"common.button.text.edit"})}),(0,e.jsx)(de.ZP,{size:"small",type:"link",style:{width:64,height:30,borderRadius:4,backgroundColor:"#E7F1FF",color:"#1677FF",marginLeft:8},onClick:function(){A.history.push("/cloudAccount/collectionRecord?platform=".concat(E,"&cloudAccountId=").concat(i))},children:p.formatMessage({id:"cloudAccount.button.text.collection.record"})})]})]}),(0,e.jsx)(Be,{editFormVisible:be,setEditFormVisible:Ze,accountInfo:Ee.current,requestCurrentData:a}),(0,e.jsx)(r,{accountModalVisible:R,setAccountModalVisible:M,accountModalInfo:B.current})]})},St=Mt,Ge=t(93410),bt=t(84567),He=t(34041),Zt=t(42075),Et=t(84611),he=1,xe=12,Dt=[{label:(0,e.jsx)(A.FormattedMessage,{id:"cloudAccount.module.search.open"}),value:"valid"},{label:(0,e.jsx)(A.FormattedMessage,{id:"cloudAccount.module.search.stop"}),value:"invalid"},{label:(0,e.jsx)(A.FormattedMessage,{id:"cloudAccount.module.search.scanning"}),value:"running"},{label:(0,e.jsx)(A.FormattedMessage,{id:"cloudAccount.module.search.waitingToScan"}),value:"waiting"}],Lt=function(){var u,y=(0,A.useModel)("rule"),H=y.platformList,a=N.Z.useForm(),J=D()(a,1),E=J[0],i=(0,A.useIntl)(),P=(0,v.useRef)({}),Z=(0,v.useState)(!1),Y=D()(Z,2),q=Y[0],d=Y[1],s=(0,v.useState)(he),g=D()(s,2),m=g[0],x=g[1],Me=(0,v.useState)(xe),V=D()(Me,2),ye=V[0],ne=V[1],_=(0,A.useRequest)(function(f){return(0,ge.queryCloudAccountList)(f)},{manual:!0,formatResult:function(c){return c.content}}),$=_.data,p=_.run,Se=_.loading,Ce=function(){var f=b()(h()().mark(function c(){return h()().wrap(function(S){for(;;)switch(S.prev=S.next){case 0:return x(he),ne(xe),E==null||E.resetFields(),S.next=5,p({page:he,size:xe});case 5:case"end":return S.stop()}},c)}));return function(){return f.apply(this,arguments)}}(),be=function(){var f=b()(h()().mark(function c(){var o;return h()().wrap(function(k){for(;;)switch(k.prev=k.next){case 0:return x(he),ne(xe),o=E.getFieldsValue(),k.next=5,p(j()(j()({},o),{},{page:he,size:xe}));case 5:case"end":return k.stop()}},c)}));return function(){return f.apply(this,arguments)}}(),Ze=function(){E.resetFields()},Ee=function(c){x(he),ne(xe),p(j()(j()({},c),{},{page:he,size:xe}))};(0,v.useEffect)(function(){p({page:m,size:ye})},[]);var Ie=(0,A.useRequest)(function(f){return(0,ge.cloudAccountBaseInfoList)(j()({},f))},{formatResult:function(c){if(c.msg==="success"){var o;return(c==null||(o=c.content)===null||o===void 0||(o=o.accountAliasList)===null||o===void 0?void 0:o.map(function(S){return{label:S,value:S}}))||[]}}}),U=Ie.data,R=Ie.run,M=Ie.loading,B=(0,v.useMemo)(function(){var f=function(o){R({platformList:E.getFieldValue("platformList")||[],cloudAccountSearch:o})};return(0,Ve.debounce)(f,500)},[ge.cloudAccountBaseInfoList]);return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(Ge.Z,{style:{marginBottom:16},children:(0,e.jsxs)(N.Z,{form:E,onFinish:Ee,children:[(0,e.jsx)(F.Z,{gutter:[24,24],children:(0,e.jsx)(C.Z,{span:24,children:(0,e.jsx)(N.Z.Item,{name:"platformList",label:i.formatMessage({id:"common.select.label.cloudPlatform"}),style:{marginBottom:16},children:(0,e.jsx)(bt.Z.Group,{options:(0,we.T$)(H),onChange:function(c){return R({platformList:c||[]})}})})})}),(0,e.jsxs)(F.Z,{gutter:[24,24],children:[(0,e.jsx)(C.Z,{span:6,children:(0,e.jsx)(N.Z.Item,{name:"cloudAccountId",label:i.formatMessage({id:"common.select.label.cloudAccount"}),style:{marginBottom:0,width:"100%"},children:(0,e.jsx)(He.Z,{allowClear:!0,showSearch:!0,placeholder:i.formatMessage({id:"common.select.query.text.placeholder"}),notFoundContent:M&&(0,e.jsx)(We.Z,{size:"small"}),onSearch:B,options:U||[]})})}),(0,e.jsx)(C.Z,{span:6,children:(0,e.jsx)(N.Z.Item,{name:"status",label:i.formatMessage({id:"common.select.label.Collection.status"}),style:{marginBottom:0,width:"100%"},children:(0,e.jsx)(He.Z,{allowClear:!0,placeholder:i.formatMessage({id:"common.select.text.placeholder"}),options:Dt})})}),(0,e.jsx)(C.Z,{span:6,offset:6,style:{width:"100%"},children:(0,e.jsx)(w.Z,{justify:"flex-end",style:{width:"100%"},children:(0,e.jsx)(N.Z.Item,{style:{marginBottom:0},children:(0,e.jsxs)(Zt.Z,{size:8,children:[(0,e.jsx)(de.ZP,{onClick:Ze,children:i.formatMessage({id:"common.button.text.reset"})}),(0,e.jsx)(de.ZP,{type:"primary",htmlType:"submit",loading:Se,children:i.formatMessage({id:"common.button.text.query"})})]})})})})]})]})}),(0,e.jsxs)(Ge.Z,{style:{minHeight:488},children:[(0,e.jsx)(F.Z,{style:{marginBottom:28},justify:"end",children:(0,e.jsx)(de.ZP,{type:"primary",onClick:function(){d(!0),P.current={}},children:i.formatMessage({id:"common.button.text.add"})},"create")}),(0,e.jsx)(F.Z,{className:z.cloudAccountWrap,children:(0,e.jsx)(We.Z,{spinning:Se,children:(0,Ve.isEmpty)($==null?void 0:$.data)?(0,e.jsx)(w.Z,{align:"center",justify:"center",style:{width:" 100%",minHeight:356},children:(0,e.jsx)(Pe.Z,{image:Pe.Z.PRESENTED_IMAGE_SIMPLE})}):(0,e.jsx)("div",{className:z.cloudAccountList,children:$==null||(u=$.data)===null||u===void 0?void 0:u.map(function(f){return(0,e.jsx)(St,{account:f,requestInitData:Ce,requestCurrentData:be},f.id)})})})}),(0,e.jsx)(F.Z,{children:(0,e.jsx)(w.Z,{justify:"center",style:{width:"100%",marginTop:"16px"},children:(0,e.jsx)(Et.Z,{onChange:function(c,o){x(c),ne(o),p(j()(j()({},E.getFieldsValue()),{},{page:c,size:o}))},current:m,pageSize:ye,size:"small",showTotal:function(c,o){return(0,we.GO)(c,o,i==null?void 0:i.locale)},total:($==null?void 0:$.total)||0,showSizeChanger:!0,pageSizeOptions:[12,24]})})})]}),(0,e.jsx)(Be,{editFormVisible:q,setEditFormVisible:d,accountInfo:P.current,requestCurrentData:be})]})},Tt=Lt,Ft=function(){return(0,e.jsx)(G._z,{title:!1,children:(0,e.jsx)(Tt,{})})},Ot=Ft},53846:function(ie,Q){"use strict";Q.Z={customTitle:"customTitle___nzcxh",riskHigh:"riskHigh___GstO6",riskMedium:"riskMedium___F4JTb",riskLow:"riskLow___HJopw",imgProcess:"imgProcess___NGndv",imgResult:"imgResult___wKhiG",validTag:"validTag___TRSau",invalidTag:"invalidTag___opVlG",waitingTag:"waitingTag___JZpZT"}},85674:function(ie,Q,t){var G={"./simpleWorker":18352,"./simpleWorker.js":18352};function v(W){return Promise.resolve().then(function(){if(!t.o(G,W)){var j=new Error("Cannot find module '"+W+"'");throw j.code="MODULE_NOT_FOUND",j}var ee=G[W];return t(ee)})}v.keys=function(){return Object.keys(G)},v.id=85674,ie.exports=v},10131:function(ie,Q,t){var G={"./editorBaseApi":[20927],"./editorBaseApi.js":[20927],"./editorSimpleWorker":[81465],"./editorSimpleWorker.js":[81465],"./editorWorker":[85215],"./editorWorker.js":[85215],"./editorWorkerHost":[98008],"./editorWorkerHost.js":[98008],"./findSectionHeaders":[72846],"./findSectionHeaders.js":[72846],"./getIconClasses":[22016],"./getIconClasses.js":[22016],"./languageFeatureDebounce":[88191],"./languageFeatureDebounce.js":[88191],"./languageFeatures":[71922],"./languageFeatures.js":[71922],"./languageFeaturesService":[7421],"./languageFeaturesService.js":[7421],"./languageService":[81032],"./languageService.js":[81032],"./languagesAssociations":[73536],"./languagesAssociations.js":[73536],"./languagesRegistry":[4765],"./languagesRegistry.js":[4765],"./markerDecorations":[36357],"./markerDecorations.js":[36357],"./markerDecorationsService":[86036],"./markerDecorationsService.js":[86036],"./model":[73733],"./model.js":[73733],"./modelService":[51200],"./modelService.js":[51200],"./resolverService":[88216],"./resolverService.js":[88216],"./semanticTokensDto":[14704],"./semanticTokensDto.js":[14704],"./semanticTokensProviderStyling":[92294],"./semanticTokensProviderStyling.js":[92294],"./semanticTokensStyling":[73343],"./semanticTokensStyling.js":[73343],"./semanticTokensStylingService":[84146],"./semanticTokensStylingService.js":[84146],"./textModelSync/textModelSync.impl":[28944],"./textModelSync/textModelSync.impl.js":[28944],"./textModelSync/textModelSync.protocol":[23145,3145],"./textModelSync/textModelSync.protocol.js":[23145,3145],"./textResourceConfiguration":[71765],"./textResourceConfiguration.js":[71765],"./treeSitterParserService":[28922],"./treeSitterParserService.js":[28922],"./treeViewsDnd":[80642],"./treeViewsDnd.js":[80642],"./treeViewsDndService":[58345],"./treeViewsDndService.js":[58345],"./unicodeTextModelHighlighter":[31446],"./unicodeTextModelHighlighter.js":[31446]};function v(W){if(!t.o(G,W))return Promise.resolve().then(function(){var h=new Error("Cannot find module '"+W+"'");throw h.code="MODULE_NOT_FOUND",h});var j=G[W],ee=j[0];return Promise.all(j.slice(1).map(t.e)).then(function(){return t(ee)})}v.keys=function(){return Object.keys(G)},v.id=10131,ie.exports=v}}]); | |||
There was a problem hiding this comment.
issue (code-quality): Use const or let instead of var. (avoid-using-var)
Explanation
`const` is preferred as it ensures you cannot reassign references (which can lead to buggy and confusing code). `let` may be used if you need to reassign references - it's preferred to `var` because it is block- rather than function-scoped.From the Airbnb JavaScript Style Guide
| @@ -0,0 +1 @@ | |||
| (self.webpackChunk=self.webpackChunk||[]).push([[9418],{91618:function(ie,Q,t){"use strict";t.d(Q,{Z:function(){return e}});var G=t(62435),v=Object.defineProperty,W=Object.getOwnPropertySymbols,j=Object.prototype.hasOwnProperty,ee=Object.prototype.propertyIsEnumerable,h=(l,n,r)=>n in l?v(l,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):l[n]=r,Ae=(l,n)=>{for(var r in n||(n={}))j.call(n,r)&&h(l,r,n[r]);if(W)for(var r of W(n))ee.call(n,r)&&h(l,r,n[r]);return l};const b=l=>React.createElement("svg",Ae({width:8,height:8,xmlns:"http://www.w3.org/2000/svg"},l),React.createElement("title",null,"\u5931\u8D25"),React.createElement("path",{d:"M4 0a4 4 0 1 1 0 8 4 4 0 0 1 0-8Zm-.81 2.784a.287.287 0 1 0-.406.405l.81.811-.81.81a.287.287 0 1 0 .405.406L4 4.406l.81.81a.287.287 0 1 0 .406-.405L4.406 4l.81-.81a.287.287 0 1 0-.405-.406L4 3.594l-.81-.81Z",fill:"#FF3931",fillRule:"nonzero"}));var se="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iOCIgaGVpZ2h0PSI4IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGQ9Ik00IDBhNCA0IDAgMSAxIDAgOCA0IDQgMCAwIDEgMC04Wm0tLjgxIDIuNzg0YS4yODcuMjg3IDAgMSAwLS40MDYuNDA1bC44MS44MTEtLjgxLjgxYS4yODcuMjg3IDAgMSAwIC40MDUuNDA2TDQgNC40MDZsLjgxLjgxYS4yODcuMjg3IDAgMSAwIC40MDYtLjQwNUw0LjQwNiA0bC44MS0uODFhLjI4Ny4yODcgMCAxIDAtLjQwNS0uNDA2TDQgMy41OTRsLS44MS0uODFaIiBmaWxsPSIjRkYzOTMxIiBmaWxsLXJ1bGU9Im5vbnplcm8iLz48L3N2Zz4=",D=Object.defineProperty,L=Object.getOwnPropertySymbols,te=Object.prototype.hasOwnProperty,N=Object.prototype.propertyIsEnumerable,ae=(l,n,r)=>n in l?D(l,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):l[n]=r,me=(l,n)=>{for(var r in n||(n={}))te.call(n,r)&&ae(l,r,n[r]);if(L)for(var r of L(n))N.call(n,r)&&ae(l,r,n[r]);return l};const F=l=>React.createElement("svg",me({width:8,height:8,xmlns:"http://www.w3.org/2000/svg"},l),React.createElement("title",null,"\u901A\u8FC7"),React.createElement("path",{d:"M4 0a4 4 0 1 1 0 8 4 4 0 0 1 0-8Zm1.712 2.788a.3.3 0 0 0-.424 0L3.502 4.576l-.79-.787a.3.3 0 0 0-.424.425l1.003.999a.3.3 0 0 0 .424-.001l1.997-2a.3.3 0 0 0 0-.424Z",fill:"#379E0E",fillRule:"nonzero"}));var C="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iOCIgaGVpZ2h0PSI4IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGQ9Ik00IDBhNCA0IDAgMSAxIDAgOCA0IDQgMCAwIDEgMC04Wm0xLjcxMiAyLjc4OGEuMy4zIDAgMCAwLS40MjQgMEwzLjUwMiA0LjU3NmwtLjc5LS43ODdhLjMuMyAwIDAgMC0uNDI0LjQyNWwxLjAwMy45OTlhLjMuMyAwIDAgMCAuNDI0LS4wMDFsMS45OTctMmEuMy4zIDAgMCAwIDAtLjQyNFoiIGZpbGw9IiMzNzlFMEUiIGZpbGwtcnVsZT0ibm9uemVybyIvPjwvc3ZnPg==",w=Object.defineProperty,I=Object.getOwnPropertySymbols,A=Object.prototype.hasOwnProperty,T=Object.prototype.propertyIsEnumerable,oe=(l,n,r)=>n in l?w(l,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):l[n]=r,X=(l,n)=>{for(var r in n||(n={}))A.call(n,r)&&oe(l,r,n[r]);if(I)for(var r of I(n))T.call(n,r)&&oe(l,r,n[r]);return l};const fe=l=>React.createElement("svg",X({width:8,height:8,xmlns:"http://www.w3.org/2000/svg"},l),React.createElement("title",null,"\u5F85\u64CD\u4F5C"),React.createElement("g",{fillRule:"nonzero",fill:"none"},React.createElement("path",{d:"M4 0a4 4 0 1 1 0 8 4 4 0 0 1 0-8Z",fill:"#FFB310"}),React.createElement("path",{d:"M3.775 2.412a.287.287 0 1 0-.573 0v1.71c0 .316.257.573.573.573h1.718a.287.287 0 1 0 0-.573H3.775v-1.71Z",fill:"#FFF1D4"})));var ce="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iOCIgaGVpZ2h0PSI4IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxnIGZpbGwtcnVsZT0ibm9uemVybyIgZmlsbD0ibm9uZSI+PHBhdGggZD0iTTQgMGE0IDQgMCAxIDEgMCA4IDQgNCAwIDAgMSAwLThaIiBmaWxsPSIjRkZCMzEwIi8+PHBhdGggZD0iTTMuNzc1IDIuNDEyYS4yODcuMjg3IDAgMSAwLS41NzMgMHYxLjcxYzAgLjMxNi4yNTcuNTczLjU3My41NzNoMS43MThhLjI4Ny4yODcgMCAxIDAgMC0uNTczSDMuNzc1di0xLjcxWiIgZmlsbD0iI0ZGRjFENCIvPjwvZz48L3N2Zz4=",Fe=t(66309),ve=t(53846),ue=t(86074),e=function(l){var n=l.state,r=(0,ue.jsx)(Fe.Z,{children:n||"-"});return["success","valid"].includes(n)?r=(0,ue.jsxs)(Fe.Z,{className:ve.Z.validTag,children:[(0,ue.jsx)("img",{src:C,alt:"VALID_ICON",className:ve.Z.imgResult}),"Valid"]}):["error","invalid","failed"].includes(n)?r=(0,ue.jsxs)(Fe.Z,{className:ve.Z.invalidTag,children:[(0,ue.jsx)("img",{src:se,alt:"VALID_ICON",className:ve.Z.imgResult}),"Invalid"]}):["waiting","wait"].includes(n)&&(r=(0,ue.jsxs)(Fe.Z,{className:ve.Z.waitingTag,children:[(0,ue.jsx)("img",{src:ce,alt:"WAITING_ICON",className:ve.Z.imgProcess}),"Waiting"]})),r}},24163:function(ie,Q,t){"use strict";var G=t(97857),v=t.n(G),W=t(25593),j=t(83062),ee=t(62435),h=t(86074),Ae=W.Z.Paragraph;Q.Z=function(b){var se=b.text,D=b.width,L=b.maxWidth,te=b.rows,N=te===void 0?2:te,ae=b.placement,me=ae===void 0?"top":ae,F=b.color,C=F===void 0?"rgba(0, 0, 0, 0.88)":F,w=b.link,I=w===void 0?!1:w,A=b.onClickCallBackFunc,T=b.style,oe=T===void 0?{}:T,X=b.copyable,fe=X===void 0?!1:X;return(0,h.jsx)("div",{style:{maxWidth:L,width:D},children:(0,h.jsx)(j.Z,{title:(0,h.jsx)("div",{children:se}),placement:me,children:(0,h.jsx)(Ae,{ellipsis:{rows:N},style:v()({marginBottom:0,color:C,cursor:I?"pointer":""},oe),onClick:A,copyable:fe,children:se})})})}},52078:function(ie,Q,t){"use strict";var G=t(97857),v=t.n(G),W=t(27997),j=t(62435),ee=t(86074),h=function(b){W.Mj.register({id:"json"});var se=b.value,D=se===void 0?"{}":se,L=b.onChange,te=b.editorStyle,N=te===void 0?{}:te,ae=b.editorKey,me=ae===void 0?"json-editor":ae,F=b.readOnly,C=F===void 0?!1:F,w=(0,j.useRef)(),I=(0,j.useRef)(),A=function(){var oe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"{}";try{return JSON.parse(oe),oe}catch(X){return console.warn("Invalid JSON string:",X),"{}"}};return(0,j.useEffect)(function(){if(w.current)return I.current?I.current.setValue(D):(I.current=W.j6.create(w.current,{value:A(D),language:"json",theme:"vs",readOnly:C,folding:!0,automaticLayout:!0}),I.current.onDidChangeModelContent(function(){var T=I.current.getValue();console.log("[JSONEditor] \u7F16\u8F91\u5668\u5185\u5BB9\u53D8\u66F4:",{newValue:T}),L==null||L(T)})),function(){if(I!=null&&I.current){var T;I==null||(T=I.current)===null||T===void 0||T.dispose(),I.current=null}}},[]),(0,j.useEffect)(function(){I.current&&D!==I.current.getValue()&&I.current.setValue(A(D))},[D]),(0,ee.jsx)("div",{ref:w,style:v()({height:360,borderRadius:4,overflow:"hidden"},N)},me)};Q.Z=h},87958:function(ie,Q,t){"use strict";t.r(Q),t.d(Q,{default:function(){return Ot}});var G=t(39380),v=t(62435),W=t(97857),j=t.n(W),ee=t(15009),h=t.n(ee),Ae=t(99289),b=t.n(Ae),se=t(5574),D=t.n(se),L=t(24163),te=t(25593),N=t(99859),ae=t(17788),me=t(21532),F=t(71230),C=t(15746),w=t(86250),I=t(96074),A=t(45830),T={leftInfoLabel:"leftInfoLabel___SJHhs",rightInfoLabel:"rightInfoLabel___c8v5r",basicInfoValue:"basicInfoValue___Cwl01",accountModal:"accountModal___hexAB",sectionDivider:"sectionDivider___oQjeE",proxyCollapse:"proxyCollapse___dPuDK"},oe=t(91618),X={ALI_CLOUD:{type:"basic",fields:[{name:"ak",label:"AK",required:!0},{name:"sk",label:"SK",required:!0}],hasProxy:!0},HUAWEI_CLOUD:{type:"basic",fields:[{name:"ak",label:"AK",required:!0},{name:"sk",label:"SK",required:!0}]},BAIDU_CLOUD:{type:"basic",fields:[{name:"ak",label:"AK",required:!0},{name:"sk",label:"SK",required:!0}]},AWS:{type:"basic",fields:[{name:"ak",label:"AK",required:!0},{name:"sk",label:"SK",required:!0}]},TENCENT_CLOUD:{type:"basic",fields:[{name:"ak",label:"AK",required:!0},{name:"sk",label:"SK",required:!0}]},KINGSOFT_CLOUD:{type:"basic",fields:[{name:"ak",label:"AK",required:!0},{name:"sk",label:"SK",required:!0}]},AZURE:{type:"basic",fields:[{name:"ak",label:"AK",required:!0},{name:"sk",label:"SK",required:!0}]},GCP:{type:"json",fields:[{name:"credentialsJson",label:"GCP KEY",required:!0}]},ALI_CLOUD_PRIVATE:{type:"exclusive",fields:[{name:"ak",label:"AK",required:!0},{name:"sk",label:"SK",required:!0},{name:"endpoint",label:"Endpoint",required:!0},{name:"regionId",label:"RegionId",required:!0}]},HUAWEI_CLOUD_PRIVATE:{type:"extend",fields:[{name:"ak",label:"AK",required:!0},{name:"sk",label:"SK",required:!0},{name:"iamEndpoint",label:"Iam_Endpoint",required:!0},{name:"ecsEndpoint",label:"Ecs_Endpoint",required:!0},{name:"elbEndpoint",label:"Elb_Endpoint",required:!0},{name:"evsEndpoint",label:"Evs_Endpoint",required:!0},{name:"vpcEndpoint",label:"Vpc_Endpoint",required:!0},{name:"obsEndpoint",label:"Obs_Endpoint",required:!0},{name:"regionId",label:"RegionId",required:!0},{name:"projectId",label:"ProjectId"}]}},fe={cloudAccountId:[{required:!0,message:"Please enter your cloud account ID"}],alias:[{required:!0,message:"Please enter the alias of your cloud account"}],tenantId:[{required:!0,message:"Please select the tenant"}],platform:[{required:!0,message:"Please select the cloud platform"}]},ce=["GCP"],Fe=null,ve=null,ue=null,e=t(86074),l=te.Z.Text,n=function(u){var y,H,a=u.accountInfo,J=u.visible,E=u.onCancel,i=u.tenantListAll,P=u.resourceTypeList,Z=(0,A.useIntl)(),Y=N.Z.useForm(),q=D()(Y,1),d=q[0],s=ce!=null&&ce.includes(a==null?void 0:a.platform)?600:500;return(0,e.jsxs)(ae.Z,{title:(0,e.jsx)("div",{style:{fontSize:16,fontWeight:500},children:Z.formatMessage({id:"cloudAccount.extend.title.accountInfo"})}),open:J,onCancel:E,footer:null,width:800,style:{minHeight:s},destroyOnClose:!0,children:[(0,e.jsx)(me.ZP,{theme:{components:{Form:{labelColor:"rgba(74, 74, 74, 1)",colorTextHeading:"rgba(74, 74, 74, 1)"}}},children:(0,e.jsxs)(N.Z,{form:d,layout:"vertical",children:[(0,e.jsxs)(F.Z,{children:[(0,e.jsxs)(C.Z,{span:12,children:[(0,e.jsxs)(F.Z,{style:{height:44},children:[(0,e.jsxs)("span",{className:T.leftInfoLabel,children:[Z.formatMessage({id:"cloudAccount.extend.title.accountId"}),"\xA0:"]}),(0,e.jsx)(L.Z,{style:{paddingTop:11,color:"#457aff"},text:(a==null?void 0:a.cloudAccountId)||"-",rows:1,maxWidth:100})]}),(0,e.jsxs)(F.Z,{style:{height:44},children:[(0,e.jsxs)("span",{className:T.leftInfoLabel,children:[Z.formatMessage({id:"cloudAccount.extend.title.alias"}),"\xA0:"]}),(0,e.jsx)(L.Z,{style:{paddingTop:11,color:"#457aff"},text:(a==null?void 0:a.alias)||"-",rows:1,maxWidth:100})]}),(0,e.jsxs)(F.Z,{style:{height:44},children:[(0,e.jsxs)("span",{className:T.leftInfoLabel,children:[Z.formatMessage({id:"cloudAccount.extend.title.platform"}),"\xA0:"]}),(0,e.jsx)(L.Z,{style:{paddingTop:11,color:"#457aff"},text:(P==null||(y=P.filter(function(g){return g.value===(a==null?void 0:a.platform)}))===null||y===void 0||(y=y.map(function(g){return Z.formatMessage({id:g.label})}))===null||y===void 0?void 0:y.toString())||"-",rows:1,maxWidth:100})]}),(0,e.jsxs)(F.Z,{style:{height:44},children:[(0,e.jsxs)("span",{className:T.leftInfoLabel,children:[Z.formatMessage({id:"common.select.label.tenant"}),"\xA0:"]}),(0,e.jsx)(L.Z,{style:{paddingTop:11,color:"#457aff"},text:(i==null||(H=i.find(function(g){return g.value===(a==null?void 0:a.tenantId)}))===null||H===void 0?void 0:H.label)||"-",rows:1,maxWidth:100})]})]}),(0,e.jsxs)(C.Z,{span:12,children:[(0,e.jsxs)(F.Z,{style:{height:44},children:[(0,e.jsxs)("span",{className:T.rightInfoLabel,children:[Z.formatMessage({id:"cloudAccount.extend.title.asset.number"}),"\xA0:"]}),(0,e.jsx)("span",{className:T.basicInfoValue,style:{color:"#457aff"},children:(a==null?void 0:a.resourceCount)||0})]}),(0,e.jsxs)(F.Z,{children:[(0,e.jsx)("span",{className:T.rightInfoLabel,style:{height:44},children:ce!=null&&ce.includes(a==null?void 0:a.platform)?"GCP KEY ".concat(Z.formatMessage({id:"common.link.text.status"})," : "):"AK/SK ".concat(Z.formatMessage({id:"common.link.text.status"})," : ")}),(0,e.jsx)(w.Z,{align:"center",children:(0,e.jsx)(oe.Z,{state:a==null?void 0:a.status})})]})]})]}),(0,e.jsx)(N.Z.Item,{label:Z.formatMessage({id:"cloudAccount.extend.title.lastScanTime"}),children:(0,e.jsx)(l,{style:{color:"rgba(74, 74, 74, 1)"},children:(a==null?void 0:a.lastScanTime)||" -"})}),(0,e.jsx)(N.Z.Item,{label:Z.formatMessage({id:"cloudAccount.extend.title.createTime"}),children:(0,e.jsx)(l,{style:{color:"rgba(74, 74, 74, 1)"},children:(a==null?void 0:a.gmtCreate)||"-"})}),(0,e.jsx)(N.Z.Item,{label:Z.formatMessage({id:"cloudAccount.extend.title.updateTime"}),children:(0,e.jsx)(l,{style:{color:"rgba(74, 74, 74, 1)"},children:(a==null?void 0:a.gmtModified)||"-"})})]})}),(0,e.jsx)(I.Z,{style:{margin:"18px 0 0 0",borderColor:"#457aff",opacity:.25}})]})},r=n,_e=t(13769),Xe=t.n(_e),ge=t(92635),qe=t(58638),et=t(45605),tt=t(25035),at=t(184),pe=t(5966),Ue=t(64317),nt=t(97462),rt=t(8214),st=t(63434),ot=t(3303),Ne=t(68872),de=t(83622),Re=t(83062),We=t(57381),Pe=t(32983),we=t(29448),lt=t(86548),it=t(52078),ct=function(u){var y=u.type,H=u.fields,a=u.accountId,J=u.visible,E=u.onVisibleChange,i=u.value,P=u.onChange,Z=(0,A.useIntl)(),Y=function(s,g){var m=j()({},i||{});m[s]=g,P==null||P(m)},q=function(s){var g=(s==null?void 0:s.trim())||"{}";P==null||P({credentialsJson:g})};return a&&!J?(0,e.jsx)(N.Z.Item,{label:Z.formatMessage({id:"cloudAccount.form.credential"}),name:"action",children:(0,e.jsx)(de.ZP,{type:"link",onClick:function(){return E(!0)},style:{padding:"4px 0",color:"#2f54eb"},children:(0,e.jsx)(lt.Z,{})})}):J?y==="json"?(0,e.jsx)(pe.Z,{name:"credentialsJson",label:"GCP KEY",initialValue:(i==null?void 0:i.credentialsJson)||"{}",rules:[{required:!0,validator:function(){var d=b()(h()().mark(function g(m,x){return h()().wrap(function(V){for(;;)switch(V.prev=V.next){case 0:if(x!=null&&x.trim()){V.next=2;break}throw new Error("Please enter a valid GCP KEY");case 2:V.prev=2,JSON.parse(x),V.next=9;break;case 6:throw V.prev=6,V.t0=V.catch(2),new Error("Please enter a valid GCP KEY in JSON format");case 9:case"end":return V.stop()}},g,null,[[2,6]])}));function s(g,m){return d.apply(this,arguments)}return s}()}],children:(0,e.jsx)(it.Z,{value:(i==null?void 0:i.credentialsJson)||"{}",onChange:q,editorStyle:{height:"240px"},editorKey:"CREDENTIALS_JSON_EDITOR"})}):(0,e.jsx)(e.Fragment,{children:H.map(function(d){var s=d.name;return(0,e.jsx)(pe.Z,{name:["credentials",s],label:d.label,rules:[{required:d.required}],fieldProps:{type:d.type||"text",onChange:function(m){return Y(s,m.target.value)}}},s)})}):null},ut=ct,dt=t(90672),mt=function(){var u=(0,A.useIntl)();return(0,e.jsx)(dt.Z,{name:"proxyConfig",label:u.formatMessage({id:"cloudAccount.form.proxy"}),placeholder:u.formatMessage({id:"cloudAccount.form.proxy.placeholder"})})},ft=mt,Ve=t(96486),vt=t(79930),gt=function(){var u=(0,A.useIntl)(),y=(0,v.useState)(!1),H=D()(y,2),a=H[0],J=H[1],E=(0,v.useState)([]),i=D()(E,2),P=i[0],Z=i[1],Y=(0,v.useCallback)(function(){var q=b()(h()().mark(function d(s){var g;return h()().wrap(function(x){for(;;)switch(x.prev=x.next){case 0:if(s!=null&&s.trim()){x.next=2;break}return x.abrupt("return");case 2:return J(!0),x.prev=3,x.next=6,(0,vt.queryGroupTypeList)({platformList:[s]});case 6:g=x.sent,(0,Ve.isEmpty)(g.content)?(Z([]),Ne.ZP.error(u.formatMessage({id:"cloudAccount.message.text.no.assets"}))):Z(g==null?void 0:g.content),x.next=14;break;case 10:x.prev=10,x.t0=x.catch(3),Ne.ZP.error("\u83B7\u53D6\u8D44\u6E90\u7C7B\u578B\u5217\u8868\u5931\u8D25"),Z([]);case 14:return x.prev=14,J(!1),x.finish(14);case 17:case"end":return x.stop()}},d,null,[[3,10,14,17]])}));return function(d){return q.apply(this,arguments)}}(),[u]);return{loading:a,resourceTypes:P,fetchResourceTypes:Y}},pt=["resourceTypeListForWeb","credentialMap","id","proxyConfig","platform"],ht=ot.Z.SHOW_CHILD,ke=te.Z.Text,xt=function(u){var y=(0,A.useModel)("rule"),H=y.platformList,a=(0,A.useModel)("tenant"),J=a.tenantListAll,E=gt(),i=E.loading,P=E.resourceTypes,Z=E.fetchResourceTypes,Y=N.Z.useForm(),q=D()(Y,1),d=q[0],s=(0,A.useIntl)(),g=u.editFormVisible,m=u.accountInfo,x=u.setEditFormVisible,Me=u.requestCurrentData,V=(0,v.useState)(!0),ye=D()(V,2),ne=ye[0],_=ye[1],$=(0,v.useState)("{}"),p=D()($,2),Se=p[0],Ce=p[1],be=function(R){var M=d.getFieldsValue(),B=M.platform;if(B){var f=X[B];if(f)if(f.type==="json"){var c=R.credentialsJson||"{}";Ce(c),d.setFieldsValue({credentials:{credentialsJson:c}})}else{var o=d.getFieldValue("credentials")||{},S=j()({},o);f.fields.forEach(function(k){var O=k.name;O in R&&R[O]!==void 0&&(S[O]=R[O])}),d.setFieldsValue({credentials:S})}}},Ze=function(){var U=b()(h()().mark(function R(){var M,B,f,c,o,S,k,O,De,K,Le,re,Te,Oe,ze,Je,$e;return h()().wrap(function(le){for(;;)switch(le.prev=le.next){case 0:if(M=d.getFieldsValue(),B=M.cloudAccountId,f=M.email,c=M.alias,o=M.tenantId,S=M.platform,k=M.resourceTypeList,O=M.site,De=M.owner,K=M.proxyConfig,Le=M.credentials,re=M.enableInverseSelection,Te={cloudAccountId:B,email:f,alias:c,tenantId:typeof o=="string"?parseInt(o,10):o,platform:S,resourceTypeList:k,site:O,owner:De,enableInverseSelection:re},Oe=X[S],Oe){le.next=6;break}return le.abrupt("return");case 6:return ne&&(Oe.type==="json"?Te.credentialsObj={credentialsJson:(Le==null?void 0:Le.credentialsJson)||Se}:(ze=j()({},Le||{}),Oe.fields.forEach(function(Nt){var Qe=Nt.name,Ye=d.getFieldValue(["credentials",Qe]);Ye!==void 0&&(ze[Qe]=Ye)}),Te.credentialsObj=ze)),Oe.hasProxy&&K&&(Te.proxyConfig=K),m.id&&(Te.id=m.id),le.next=11,(0,ge.saveCloudAccount)(Te);case 11:if(Je=le.sent,Je.msg!=="success"){le.next=18;break}return $e=m.id?"common.message.text.edit.success":"common.message.text.create.success",Ne.ZP.success(s.formatMessage({id:$e})),x(!1),le.next=18,Me();case 18:case"end":return le.stop()}},R)}));return function(){return U.apply(this,arguments)}}();(0,v.useEffect)(function(){if(g&&m.id){var U;_(!1);var R=m.resourceTypeListForWeb,M=m.credentialMap,B=m.id,f=m.proxyConfig,c=m.platform,o=Xe()(m,pt),S=j()(j()({},o),{},{credentials:M||{},resourceTypeList:R||[],proxyConfig:f||void 0,platform:c||"",enableInverseSelection:o.enableInverseSelection||!1});c&&((U=X[c])===null||U===void 0?void 0:U.type)==="json"&&M!==null&&M!==void 0&&M.credentialsJson&&Ce(M.credentialsJson),d.setFieldsValue(S),m.platform&&Z(m.platform)}},[g,m]);var Ee=function(){d.resetFields()},Ie=function(){x(!1),Ee()};return(0,e.jsxs)(at.a,{labelCol:{span:5},wrapperCol:{span:17},title:(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("span",{style:{marginRight:4},children:s.formatMessage({id:m.id?"cloudAccount.extend.title.edit":"cloudAccount.extend.title.add"})}),(0,e.jsxs)(de.ZP,{size:"small",type:"link",href:"https://cloudrec.yuque.com/org-wiki-cloudrec-iew3sz/hocvhx/fetbofdu8dx15q73",target:"_blank",style:{color:"#2f54eb",gap:4},children:[(0,e.jsx)(qe.Z,{}),(0,e.jsx)("span",{children:s.formatMessage({id:"common.link.text.help.center"})})]})]}),width:720,form:d,drawerProps:{destroyOnClose:!0,onClose:Ie,styles:{body:{paddingTop:24}}},open:g,onFinish:Ze,layout:"horizontal",children:[(0,e.jsx)(I.Z,{className:T.sectionDivider,dashed:!0,children:(0,e.jsx)(ke,{italic:!0,children:s.formatMessage({id:"cloudAccount.extend.title.basic.information"})})}),(0,e.jsxs)(F.Z,{children:[(0,e.jsx)(C.Z,{span:24,children:(0,e.jsx)(pe.Z,{disabled:!!m.id,name:"cloudAccountId",label:s.formatMessage({id:"cloudAccount.extend.title.account.id"}),rules:fe.cloudAccountId,fieldProps:{suffix:!!m.id&&(0,e.jsx)(Re.Z,{title:"\u4E91\u8D26\u53F7ID\u4E3A\u4E91\u5E73\u53F0\u4E3B\u8D26\u53F7ID\uFF0C\u521B\u5EFA\u540E\u65E0\u6CD5\u4FEE\u6539",children:(0,e.jsx)(et.Z,{style:{color:"rgba(0,0,0,.45)"}})})}})}),(0,e.jsx)(C.Z,{span:24,children:(0,e.jsx)(pe.Z,{name:"email",label:s.formatMessage({id:"cloudAccount.extend.title.account.email"})})}),(0,e.jsx)(C.Z,{span:24,children:(0,e.jsx)(pe.Z,{name:"alias",label:s.formatMessage({id:"cloudAccount.extend.title.account.alias"}),rules:fe.alias})}),(0,e.jsx)(C.Z,{span:24,children:(0,e.jsx)(Ue.Z,{label:s.formatMessage({id:"common.select.label.tenant"}),name:"tenantId",rules:fe.tenantId,options:J})}),(0,e.jsx)(C.Z,{span:24,children:(0,e.jsx)(pe.Z,{name:"owner",label:"Owner"})}),(0,e.jsx)(C.Z,{span:24,children:(0,e.jsx)(Ue.Z,{label:s.formatMessage({id:"cloudAccount.extend.title.cloud.platform"}),name:"platform",rules:fe.platform,options:(0,we.T$)(H,"start"),onChange:function(R){m.id&&_(!1),d.setFieldValue("resourceTypeList",void 0),Z(R)}})})]}),(0,e.jsx)(nt.Z,{name:["platform"],children:function(R){var M=R.platform;if(!M)return null;var B=X[M];return B?(0,e.jsxs)(F.Z,{children:[(0,e.jsxs)(C.Z,{span:24,children:[(0,e.jsx)(I.Z,{className:T.sectionDivider,dashed:!0,children:(0,e.jsx)(ke,{italic:!0,children:s.formatMessage({id:"cloudAccount.extend.title.detailed.configuration"})})}),(0,e.jsx)(ut,{type:B.type,fields:B.fields,accountId:m.id,visible:ne,onVisibleChange:_,value:d.getFieldValue("credentials"),onChange:be})]}),(0,e.jsx)(C.Z,{span:24,style:{marginBottom:"-12px"},children:(0,e.jsx)(rt.Z,{label:s.formatMessage({id:"cloudAccount.extend.title.cloud.services"}),name:"resourceTypeList",fieldProps:{multiple:!0,showCheckedStrategy:ht,options:P,allowClear:!0,showSearch:!0,notFoundContent:i?(0,e.jsx)(We.Z,{size:"small"}):(0,e.jsx)(Pe.Z,{image:Pe.Z.PRESENTED_IMAGE_SIMPLE})},extra:(0,e.jsxs)(st.Z,{name:"enableInverseSelection",tooltip:s.formatMessage({id:"cloudAccount.extend.tooltip.selection.mode"}),style:{marginTop:"8px",marginBottom:0},initialValue:!1,children:[s.formatMessage({id:"cloudAccount.extend.title.cloud.services.inverse.selection"}),(0,e.jsx)(Re.Z,{title:s.formatMessage({id:"cloudAccount.extend.tooltip.selection.mode"}),children:(0,e.jsx)(tt.Z,{style:{marginLeft:4}})})]})})}),(0,e.jsx)(C.Z,{span:24,style:{marginTop:"-16px"},children:(0,e.jsx)(pe.Z,{name:"site",label:s.formatMessage({id:"cloudAccount.extend.title.cloud.site"})})}),B.hasProxy&&(0,e.jsxs)(C.Z,{span:24,children:[(0,e.jsx)(I.Z,{className:T.sectionDivider,dashed:!0,children:(0,e.jsx)(ke,{italic:!0,children:s.formatMessage({id:"cloudAccount.form.proxy"})})}),(0,e.jsx)(ft,{})]})]}):null}})]})},Be=xt,jt=t(17910),yt=t(98165),Ct=t(62548),It=t(40357),At=t(72269),Ke=t(86738),z={accountListTable:"accountListTable___EAu4J",cloudAccountWrap:"cloudAccountWrap___rED3n",cloudAccountList:"cloudAccountList___bSSKI",accountCard:"accountCard___Ff6OW",divider:"divider___oeq1I",propertyWrap:"propertyWrap___cmHKv",propertyName:"propertyName___fiUje",accountNameWrap:"accountNameWrap___gsm80",accountModal:"accountModal___ZRBFT",iKnow:"iKnow____ILRT",basicInfoRow:"basicInfoRow___Nlip5",basicLeftRow:"basicLeftRow___KpoYr",leftInfoLabel:"leftInfoLabel___b3k2E",rightInfoLabel:"rightInfoLabel___ch993",basicInfoValue:"basicInfoValue___XJpgy"},Mt=function(u){var y=u.account,H=u.requestInitData,a=u.requestCurrentData,J=y.id,E=y.platform,i=y.cloudAccountId,P=y.alias,Z=y.accountStatus,Y=y.tenantName,q=y.resourceCount,d=y.riskCount,s=y.lastScanTime,g=y.collectorStatus,m=y.gmtCreate,x=y.gmtModified,Me=(0,A.useModel)("rule"),V=Me.platformList,ye=Ne.ZP.useMessage(),ne=D()(ye,2),_=ne[0],$=ne[1],p=(0,A.useIntl)(),Se=(0,v.useState)(!1),Ce=D()(Se,2),be=Ce[0],Ze=Ce[1],Ee=(0,v.useRef)({}),Ie=(0,v.useState)(!1),U=D()(Ie,2),R=U[0],M=U[1],B=(0,v.useRef)({}),f=function(){var o=b()(h()().mark(function S(k,O){var De,K;return h()().wrap(function(re){for(;;)switch(re.prev=re.next){case 0:return De={cloudAccountId:k,accountStatus:O},re.next=3,(0,ge.updateCloudAccountStatus)(De);case 3:if(K=re.sent,!(K.code===200||K.msg==="success")){re.next=8;break}return _.success(p.formatMessage({id:"common.message.text.edit.success"})),re.next=8,a();case 8:case"end":return re.stop()}},S)}));return function(k,O){return o.apply(this,arguments)}}(),c=function(){var o=b()(h()().mark(function S(){var k,O;return h()().wrap(function(K){for(;;)switch(K.prev=K.next){case 0:return k=_.loading(p.formatMessage({id:"common.message.text.delete.loading"})),K.next=3,(0,ge.removeCloudAccount)({id:J});case 3:if(O=K.sent,k(),!(O.code===200||O.msg==="success")){K.next=9;break}return _.success(p.formatMessage({id:"common.message.text.delete.success"})),K.next=9,H();case 9:case"end":return K.stop()}},S)}));return function(){return o.apply(this,arguments)}}();return(0,e.jsxs)(e.Fragment,{children:[$,(0,e.jsxs)("div",{className:z.accountCard,children:[(0,e.jsxs)(w.Z,{justify:"space-between",style:{width:"100%"},children:[(0,e.jsxs)(w.Z,{children:[(0,e.jsx)(It.Z,{src:jt.J_[E],alt:"PLATFORM_ICON",width:62,height:62,preview:!1}),(0,e.jsxs)("div",{className:z.accountNameWrap,children:[(0,e.jsx)(L.Z,{text:i||"-",maxWidth:100,rows:1,style:{color:"#262626",fontSize:17,fontWeight:500},placement:"topLeft"}),(0,e.jsx)(L.Z,{text:P||"-",maxWidth:100,rows:1,style:{color:"#333",fontSize:12,margin:"1px 0"},placement:"topLeft"}),(0,e.jsx)(L.Z,{text:(0,we.PZ)(E,V)||"-",maxWidth:100,rows:1,style:{color:"#999",fontSize:13},placement:"topLeft"})]})]}),(0,e.jsx)(Re.Z,{title:p.formatMessage({id:"cloudAccount.extend.title.collect.status"}),children:(0,e.jsx)(At.Z,{style:{flexShrink:0},checkedChildren:p.formatMessage({id:"common.button.text.enable"}),unCheckedChildren:p.formatMessage({id:"common.button.text.disable"}),checked:Z==="valid",onClick:function(){return f(i,Z==="valid"?"invalid":"valid")}})})]}),(0,e.jsx)(I.Z,{className:z.divider}),(0,e.jsxs)(F.Z,{gutter:[24,8],children:[(0,e.jsxs)(C.Z,{span:14,className:z.propertyWrap,children:[(0,e.jsx)("div",{className:z.propertyName,children:p.formatMessage({id:"cloudAccount.extend.title.tenant.attribution"})}),(0,e.jsx)(L.Z,{text:Y||"-",maxWidth:123,rows:1,style:{color:"#999",fontSize:13},placement:"topLeft"})]}),(0,e.jsxs)(C.Z,{span:10,className:z.propertyWrap,children:[(0,e.jsx)("div",{className:z.propertyName,children:p.formatMessage({id:"cloudAccount.extend.title.asset.number"})}),(0,e.jsxs)(w.Z,{align:"center",gap:8,children:[(0,e.jsx)(L.Z,{text:q,maxWidth:70,rows:1,style:{color:"#457AFF",fontSize:12},link:!0,onClickCallBackFunc:function(){return A.history.push("/assetManagement/assetList?platform=".concat(E,"&cloudAccountId=").concat(i))},placement:"topLeft"}),(0,e.jsx)(I.Z,{type:"vertical",style:{margin:0,height:12}}),(0,e.jsx)(L.Z,{text:d,maxWidth:70,rows:1,style:{color:"#ff4d4f",fontSize:12},link:!0,onClickCallBackFunc:function(){return A.history.push("/riskManagement/riskList?platform=".concat(E,"&cloudAccountId=").concat(i))},placement:"topLeft"})]})]}),(0,e.jsxs)(C.Z,{span:14,className:z.propertyWrap,children:[(0,e.jsx)("div",{className:z.propertyName,children:p.formatMessage({id:"cloudAccount.extend.title.lastScanTime"})}),(0,e.jsx)(L.Z,{text:s||"-",maxWidth:123,rows:1,style:{color:"#999",fontSize:13},placement:"topLeft"})]}),(0,e.jsxs)(C.Z,{span:10,className:z.propertyWrap,children:[(0,e.jsx)("div",{className:z.propertyName,children:p.formatMessage({id:"cloudAccount.extend.title.collection.status"})}),(0,e.jsxs)(w.Z,{align:"center",children:[(0,e.jsx)(L.Z,{text:g||"-",maxWidth:81,rows:1,style:{color:"#999",fontSize:13},placement:"topLeft"}),g==="\u626B\u63CF\u4E2D"?(0,e.jsx)(yt.Z,{style:{marginLeft:8,fontSize:13,color:"#1677FF"},spin:!0}):g==="\u5F85\u626B\u63CF"?(0,e.jsx)(Ke.Z,{title:p.formatMessage({id:"cloudAccount.extend.collection.popconfirm"}),onConfirm:b()(h()().mark(function o(){var S;return h()().wrap(function(O){for(;;)switch(O.prev=O.next){case 0:return O.next=2,(0,ge.createCollectTask)({cloudAccountId:i});case 2:if(S=O.sent,!(S.code===200||S.msg==="success")){O.next=7;break}return _.success(p.formatMessage({id:"common.message.text.add.success"})),O.next=7,a();case 7:case"end":return O.stop()}},o)})),okText:p.formatMessage({id:"common.button.text.ok"}),cancelText:p.formatMessage({id:"common.button.text.cancel"}),children:(0,e.jsx)(Ct.Z,{style:{marginLeft:8,cursor:"pointer",fontSize:13,color:"#1677FF"}})}):null]})]}),(0,e.jsxs)(C.Z,{span:24,className:z.propertyWrap,children:[(0,e.jsx)("div",{className:z.propertyName,children:p.formatMessage({id:"cloudAccount.extend.title.createAndUpdateTime"})}),(0,e.jsx)(L.Z,{text:m||"-",maxWidth:228,rows:1,style:{color:"#999",fontSize:13},placement:"topLeft"}),(0,e.jsx)(L.Z,{text:x||"-",maxWidth:228,rows:1,style:{color:"#999",fontSize:13,margin:"2px 0 16px 0"}})]})]}),(0,e.jsxs)(w.Z,{style:{width:"100%"},justify:"center",children:[(0,e.jsx)(Ke.Z,{title:p.formatMessage({id:"common.button.text.delete.confirm"}),onConfirm:function(){return c()},okText:p.formatMessage({id:"common.button.text.ok"}),cancelText:p.formatMessage({id:"common.button.text.cancel"}),children:(0,e.jsx)(de.ZP,{type:"primary",style:{width:64,height:30,borderRadius:4,backgroundColor:"#FFF2F3",color:"#EC4344"},children:p.formatMessage({id:"common.button.text.delete"})})}),(0,e.jsx)(de.ZP,{size:"small",type:"primary",style:{width:64,height:30,borderRadius:4,backgroundColor:"#E7F1FF",color:"#1677FF",margin:"0 8px"},onClick:function(){Ze(!0),Ee.current=j()({},y)},children:p.formatMessage({id:"common.button.text.edit"})}),(0,e.jsx)(de.ZP,{size:"small",type:"link",style:{width:64,height:30,borderRadius:4,backgroundColor:"#E7F1FF",color:"#1677FF",marginLeft:8},onClick:function(){A.history.push("/cloudAccount/collectionRecord?platform=".concat(E,"&cloudAccountId=").concat(i))},children:p.formatMessage({id:"cloudAccount.button.text.collection.record"})})]})]}),(0,e.jsx)(Be,{editFormVisible:be,setEditFormVisible:Ze,accountInfo:Ee.current,requestCurrentData:a}),(0,e.jsx)(r,{accountModalVisible:R,setAccountModalVisible:M,accountModalInfo:B.current})]})},St=Mt,Ge=t(93410),bt=t(84567),He=t(34041),Zt=t(42075),Et=t(84611),he=1,xe=12,Dt=[{label:(0,e.jsx)(A.FormattedMessage,{id:"cloudAccount.module.search.open"}),value:"valid"},{label:(0,e.jsx)(A.FormattedMessage,{id:"cloudAccount.module.search.stop"}),value:"invalid"},{label:(0,e.jsx)(A.FormattedMessage,{id:"cloudAccount.module.search.scanning"}),value:"running"},{label:(0,e.jsx)(A.FormattedMessage,{id:"cloudAccount.module.search.waitingToScan"}),value:"waiting"}],Lt=function(){var u,y=(0,A.useModel)("rule"),H=y.platformList,a=N.Z.useForm(),J=D()(a,1),E=J[0],i=(0,A.useIntl)(),P=(0,v.useRef)({}),Z=(0,v.useState)(!1),Y=D()(Z,2),q=Y[0],d=Y[1],s=(0,v.useState)(he),g=D()(s,2),m=g[0],x=g[1],Me=(0,v.useState)(xe),V=D()(Me,2),ye=V[0],ne=V[1],_=(0,A.useRequest)(function(f){return(0,ge.queryCloudAccountList)(f)},{manual:!0,formatResult:function(c){return c.content}}),$=_.data,p=_.run,Se=_.loading,Ce=function(){var f=b()(h()().mark(function c(){return h()().wrap(function(S){for(;;)switch(S.prev=S.next){case 0:return x(he),ne(xe),E==null||E.resetFields(),S.next=5,p({page:he,size:xe});case 5:case"end":return S.stop()}},c)}));return function(){return f.apply(this,arguments)}}(),be=function(){var f=b()(h()().mark(function c(){var o;return h()().wrap(function(k){for(;;)switch(k.prev=k.next){case 0:return x(he),ne(xe),o=E.getFieldsValue(),k.next=5,p(j()(j()({},o),{},{page:he,size:xe}));case 5:case"end":return k.stop()}},c)}));return function(){return f.apply(this,arguments)}}(),Ze=function(){E.resetFields()},Ee=function(c){x(he),ne(xe),p(j()(j()({},c),{},{page:he,size:xe}))};(0,v.useEffect)(function(){p({page:m,size:ye})},[]);var Ie=(0,A.useRequest)(function(f){return(0,ge.cloudAccountBaseInfoList)(j()({},f))},{formatResult:function(c){if(c.msg==="success"){var o;return(c==null||(o=c.content)===null||o===void 0||(o=o.accountAliasList)===null||o===void 0?void 0:o.map(function(S){return{label:S,value:S}}))||[]}}}),U=Ie.data,R=Ie.run,M=Ie.loading,B=(0,v.useMemo)(function(){var f=function(o){R({platformList:E.getFieldValue("platformList")||[],cloudAccountSearch:o})};return(0,Ve.debounce)(f,500)},[ge.cloudAccountBaseInfoList]);return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(Ge.Z,{style:{marginBottom:16},children:(0,e.jsxs)(N.Z,{form:E,onFinish:Ee,children:[(0,e.jsx)(F.Z,{gutter:[24,24],children:(0,e.jsx)(C.Z,{span:24,children:(0,e.jsx)(N.Z.Item,{name:"platformList",label:i.formatMessage({id:"common.select.label.cloudPlatform"}),style:{marginBottom:16},children:(0,e.jsx)(bt.Z.Group,{options:(0,we.T$)(H),onChange:function(c){return R({platformList:c||[]})}})})})}),(0,e.jsxs)(F.Z,{gutter:[24,24],children:[(0,e.jsx)(C.Z,{span:6,children:(0,e.jsx)(N.Z.Item,{name:"cloudAccountId",label:i.formatMessage({id:"common.select.label.cloudAccount"}),style:{marginBottom:0,width:"100%"},children:(0,e.jsx)(He.Z,{allowClear:!0,showSearch:!0,placeholder:i.formatMessage({id:"common.select.query.text.placeholder"}),notFoundContent:M&&(0,e.jsx)(We.Z,{size:"small"}),onSearch:B,options:U||[]})})}),(0,e.jsx)(C.Z,{span:6,children:(0,e.jsx)(N.Z.Item,{name:"status",label:i.formatMessage({id:"common.select.label.Collection.status"}),style:{marginBottom:0,width:"100%"},children:(0,e.jsx)(He.Z,{allowClear:!0,placeholder:i.formatMessage({id:"common.select.text.placeholder"}),options:Dt})})}),(0,e.jsx)(C.Z,{span:6,offset:6,style:{width:"100%"},children:(0,e.jsx)(w.Z,{justify:"flex-end",style:{width:"100%"},children:(0,e.jsx)(N.Z.Item,{style:{marginBottom:0},children:(0,e.jsxs)(Zt.Z,{size:8,children:[(0,e.jsx)(de.ZP,{onClick:Ze,children:i.formatMessage({id:"common.button.text.reset"})}),(0,e.jsx)(de.ZP,{type:"primary",htmlType:"submit",loading:Se,children:i.formatMessage({id:"common.button.text.query"})})]})})})})]})]})}),(0,e.jsxs)(Ge.Z,{style:{minHeight:488},children:[(0,e.jsx)(F.Z,{style:{marginBottom:28},justify:"end",children:(0,e.jsx)(de.ZP,{type:"primary",onClick:function(){d(!0),P.current={}},children:i.formatMessage({id:"common.button.text.add"})},"create")}),(0,e.jsx)(F.Z,{className:z.cloudAccountWrap,children:(0,e.jsx)(We.Z,{spinning:Se,children:(0,Ve.isEmpty)($==null?void 0:$.data)?(0,e.jsx)(w.Z,{align:"center",justify:"center",style:{width:" 100%",minHeight:356},children:(0,e.jsx)(Pe.Z,{image:Pe.Z.PRESENTED_IMAGE_SIMPLE})}):(0,e.jsx)("div",{className:z.cloudAccountList,children:$==null||(u=$.data)===null||u===void 0?void 0:u.map(function(f){return(0,e.jsx)(St,{account:f,requestInitData:Ce,requestCurrentData:be},f.id)})})})}),(0,e.jsx)(F.Z,{children:(0,e.jsx)(w.Z,{justify:"center",style:{width:"100%",marginTop:"16px"},children:(0,e.jsx)(Et.Z,{onChange:function(c,o){x(c),ne(o),p(j()(j()({},E.getFieldsValue()),{},{page:c,size:o}))},current:m,pageSize:ye,size:"small",showTotal:function(c,o){return(0,we.GO)(c,o,i==null?void 0:i.locale)},total:($==null?void 0:$.total)||0,showSizeChanger:!0,pageSizeOptions:[12,24]})})})]}),(0,e.jsx)(Be,{editFormVisible:q,setEditFormVisible:d,accountInfo:P.current,requestCurrentData:be})]})},Tt=Lt,Ft=function(){return(0,e.jsx)(G._z,{title:!1,children:(0,e.jsx)(Tt,{})})},Ot=Ft},53846:function(ie,Q){"use strict";Q.Z={customTitle:"customTitle___nzcxh",riskHigh:"riskHigh___GstO6",riskMedium:"riskMedium___F4JTb",riskLow:"riskLow___HJopw",imgProcess:"imgProcess___NGndv",imgResult:"imgResult___wKhiG",validTag:"validTag___TRSau",invalidTag:"invalidTag___opVlG",waitingTag:"waitingTag___JZpZT"}},85674:function(ie,Q,t){var G={"./simpleWorker":18352,"./simpleWorker.js":18352};function v(W){return Promise.resolve().then(function(){if(!t.o(G,W)){var j=new Error("Cannot find module '"+W+"'");throw j.code="MODULE_NOT_FOUND",j}var ee=G[W];return t(ee)})}v.keys=function(){return Object.keys(G)},v.id=85674,ie.exports=v},10131:function(ie,Q,t){var G={"./editorBaseApi":[20927],"./editorBaseApi.js":[20927],"./editorSimpleWorker":[81465],"./editorSimpleWorker.js":[81465],"./editorWorker":[85215],"./editorWorker.js":[85215],"./editorWorkerHost":[98008],"./editorWorkerHost.js":[98008],"./findSectionHeaders":[72846],"./findSectionHeaders.js":[72846],"./getIconClasses":[22016],"./getIconClasses.js":[22016],"./languageFeatureDebounce":[88191],"./languageFeatureDebounce.js":[88191],"./languageFeatures":[71922],"./languageFeatures.js":[71922],"./languageFeaturesService":[7421],"./languageFeaturesService.js":[7421],"./languageService":[81032],"./languageService.js":[81032],"./languagesAssociations":[73536],"./languagesAssociations.js":[73536],"./languagesRegistry":[4765],"./languagesRegistry.js":[4765],"./markerDecorations":[36357],"./markerDecorations.js":[36357],"./markerDecorationsService":[86036],"./markerDecorationsService.js":[86036],"./model":[73733],"./model.js":[73733],"./modelService":[51200],"./modelService.js":[51200],"./resolverService":[88216],"./resolverService.js":[88216],"./semanticTokensDto":[14704],"./semanticTokensDto.js":[14704],"./semanticTokensProviderStyling":[92294],"./semanticTokensProviderStyling.js":[92294],"./semanticTokensStyling":[73343],"./semanticTokensStyling.js":[73343],"./semanticTokensStylingService":[84146],"./semanticTokensStylingService.js":[84146],"./textModelSync/textModelSync.impl":[28944],"./textModelSync/textModelSync.impl.js":[28944],"./textModelSync/textModelSync.protocol":[23145,3145],"./textModelSync/textModelSync.protocol.js":[23145,3145],"./textResourceConfiguration":[71765],"./textResourceConfiguration.js":[71765],"./treeSitterParserService":[28922],"./treeSitterParserService.js":[28922],"./treeViewsDnd":[80642],"./treeViewsDnd.js":[80642],"./treeViewsDndService":[58345],"./treeViewsDndService.js":[58345],"./unicodeTextModelHighlighter":[31446],"./unicodeTextModelHighlighter.js":[31446]};function v(W){if(!t.o(G,W))return Promise.resolve().then(function(){var h=new Error("Cannot find module '"+W+"'");throw h.code="MODULE_NOT_FOUND",h});var j=G[W],ee=j[0];return Promise.all(j.slice(1).map(t.e)).then(function(){return t(ee)})}v.keys=function(){return Object.keys(G)},v.id=10131,ie.exports=v}}]); | |||
There was a problem hiding this comment.
issue (code-quality): Use const or let instead of var. (avoid-using-var)
Explanation
`const` is preferred as it ensures you cannot reassign references (which can lead to buggy and confusing code). `let` may be used if you need to reassign references - it's preferred to `var` because it is block- rather than function-scoped.From the Airbnb JavaScript Style Guide
| @@ -0,0 +1 @@ | |||
| (self.webpackChunk=self.webpackChunk||[]).push([[9418],{91618:function(ie,Q,t){"use strict";t.d(Q,{Z:function(){return e}});var G=t(62435),v=Object.defineProperty,W=Object.getOwnPropertySymbols,j=Object.prototype.hasOwnProperty,ee=Object.prototype.propertyIsEnumerable,h=(l,n,r)=>n in l?v(l,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):l[n]=r,Ae=(l,n)=>{for(var r in n||(n={}))j.call(n,r)&&h(l,r,n[r]);if(W)for(var r of W(n))ee.call(n,r)&&h(l,r,n[r]);return l};const b=l=>React.createElement("svg",Ae({width:8,height:8,xmlns:"http://www.w3.org/2000/svg"},l),React.createElement("title",null,"\u5931\u8D25"),React.createElement("path",{d:"M4 0a4 4 0 1 1 0 8 4 4 0 0 1 0-8Zm-.81 2.784a.287.287 0 1 0-.406.405l.81.811-.81.81a.287.287 0 1 0 .405.406L4 4.406l.81.81a.287.287 0 1 0 .406-.405L4.406 4l.81-.81a.287.287 0 1 0-.405-.406L4 3.594l-.81-.81Z",fill:"#FF3931",fillRule:"nonzero"}));var se="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iOCIgaGVpZ2h0PSI4IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGQ9Ik00IDBhNCA0IDAgMSAxIDAgOCA0IDQgMCAwIDEgMC04Wm0tLjgxIDIuNzg0YS4yODcuMjg3IDAgMSAwLS40MDYuNDA1bC44MS44MTEtLjgxLjgxYS4yODcuMjg3IDAgMSAwIC40MDUuNDA2TDQgNC40MDZsLjgxLjgxYS4yODcuMjg3IDAgMSAwIC40MDYtLjQwNUw0LjQwNiA0bC44MS0uODFhLjI4Ny4yODcgMCAxIDAtLjQwNS0uNDA2TDQgMy41OTRsLS44MS0uODFaIiBmaWxsPSIjRkYzOTMxIiBmaWxsLXJ1bGU9Im5vbnplcm8iLz48L3N2Zz4=",D=Object.defineProperty,L=Object.getOwnPropertySymbols,te=Object.prototype.hasOwnProperty,N=Object.prototype.propertyIsEnumerable,ae=(l,n,r)=>n in l?D(l,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):l[n]=r,me=(l,n)=>{for(var r in n||(n={}))te.call(n,r)&&ae(l,r,n[r]);if(L)for(var r of L(n))N.call(n,r)&&ae(l,r,n[r]);return l};const F=l=>React.createElement("svg",me({width:8,height:8,xmlns:"http://www.w3.org/2000/svg"},l),React.createElement("title",null,"\u901A\u8FC7"),React.createElement("path",{d:"M4 0a4 4 0 1 1 0 8 4 4 0 0 1 0-8Zm1.712 2.788a.3.3 0 0 0-.424 0L3.502 4.576l-.79-.787a.3.3 0 0 0-.424.425l1.003.999a.3.3 0 0 0 .424-.001l1.997-2a.3.3 0 0 0 0-.424Z",fill:"#379E0E",fillRule:"nonzero"}));var C="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iOCIgaGVpZ2h0PSI4IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGQ9Ik00IDBhNCA0IDAgMSAxIDAgOCA0IDQgMCAwIDEgMC04Wm0xLjcxMiAyLjc4OGEuMy4zIDAgMCAwLS40MjQgMEwzLjUwMiA0LjU3NmwtLjc5LS43ODdhLjMuMyAwIDAgMC0uNDI0LjQyNWwxLjAwMy45OTlhLjMuMyAwIDAgMCAuNDI0LS4wMDFsMS45OTctMmEuMy4zIDAgMCAwIDAtLjQyNFoiIGZpbGw9IiMzNzlFMEUiIGZpbGwtcnVsZT0ibm9uemVybyIvPjwvc3ZnPg==",w=Object.defineProperty,I=Object.getOwnPropertySymbols,A=Object.prototype.hasOwnProperty,T=Object.prototype.propertyIsEnumerable,oe=(l,n,r)=>n in l?w(l,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):l[n]=r,X=(l,n)=>{for(var r in n||(n={}))A.call(n,r)&&oe(l,r,n[r]);if(I)for(var r of I(n))T.call(n,r)&&oe(l,r,n[r]);return l};const fe=l=>React.createElement("svg",X({width:8,height:8,xmlns:"http://www.w3.org/2000/svg"},l),React.createElement("title",null,"\u5F85\u64CD\u4F5C"),React.createElement("g",{fillRule:"nonzero",fill:"none"},React.createElement("path",{d:"M4 0a4 4 0 1 1 0 8 4 4 0 0 1 0-8Z",fill:"#FFB310"}),React.createElement("path",{d:"M3.775 2.412a.287.287 0 1 0-.573 0v1.71c0 .316.257.573.573.573h1.718a.287.287 0 1 0 0-.573H3.775v-1.71Z",fill:"#FFF1D4"})));var ce="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iOCIgaGVpZ2h0PSI4IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxnIGZpbGwtcnVsZT0ibm9uemVybyIgZmlsbD0ibm9uZSI+PHBhdGggZD0iTTQgMGE0IDQgMCAxIDEgMCA4IDQgNCAwIDAgMSAwLThaIiBmaWxsPSIjRkZCMzEwIi8+PHBhdGggZD0iTTMuNzc1IDIuNDEyYS4yODcuMjg3IDAgMSAwLS41NzMgMHYxLjcxYzAgLjMxNi4yNTcuNTczLjU3My41NzNoMS43MThhLjI4Ny4yODcgMCAxIDAgMC0uNTczSDMuNzc1di0xLjcxWiIgZmlsbD0iI0ZGRjFENCIvPjwvZz48L3N2Zz4=",Fe=t(66309),ve=t(53846),ue=t(86074),e=function(l){var n=l.state,r=(0,ue.jsx)(Fe.Z,{children:n||"-"});return["success","valid"].includes(n)?r=(0,ue.jsxs)(Fe.Z,{className:ve.Z.validTag,children:[(0,ue.jsx)("img",{src:C,alt:"VALID_ICON",className:ve.Z.imgResult}),"Valid"]}):["error","invalid","failed"].includes(n)?r=(0,ue.jsxs)(Fe.Z,{className:ve.Z.invalidTag,children:[(0,ue.jsx)("img",{src:se,alt:"VALID_ICON",className:ve.Z.imgResult}),"Invalid"]}):["waiting","wait"].includes(n)&&(r=(0,ue.jsxs)(Fe.Z,{className:ve.Z.waitingTag,children:[(0,ue.jsx)("img",{src:ce,alt:"WAITING_ICON",className:ve.Z.imgProcess}),"Waiting"]})),r}},24163:function(ie,Q,t){"use strict";var G=t(97857),v=t.n(G),W=t(25593),j=t(83062),ee=t(62435),h=t(86074),Ae=W.Z.Paragraph;Q.Z=function(b){var se=b.text,D=b.width,L=b.maxWidth,te=b.rows,N=te===void 0?2:te,ae=b.placement,me=ae===void 0?"top":ae,F=b.color,C=F===void 0?"rgba(0, 0, 0, 0.88)":F,w=b.link,I=w===void 0?!1:w,A=b.onClickCallBackFunc,T=b.style,oe=T===void 0?{}:T,X=b.copyable,fe=X===void 0?!1:X;return(0,h.jsx)("div",{style:{maxWidth:L,width:D},children:(0,h.jsx)(j.Z,{title:(0,h.jsx)("div",{children:se}),placement:me,children:(0,h.jsx)(Ae,{ellipsis:{rows:N},style:v()({marginBottom:0,color:C,cursor:I?"pointer":""},oe),onClick:A,copyable:fe,children:se})})})}},52078:function(ie,Q,t){"use strict";var G=t(97857),v=t.n(G),W=t(27997),j=t(62435),ee=t(86074),h=function(b){W.Mj.register({id:"json"});var se=b.value,D=se===void 0?"{}":se,L=b.onChange,te=b.editorStyle,N=te===void 0?{}:te,ae=b.editorKey,me=ae===void 0?"json-editor":ae,F=b.readOnly,C=F===void 0?!1:F,w=(0,j.useRef)(),I=(0,j.useRef)(),A=function(){var oe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"{}";try{return JSON.parse(oe),oe}catch(X){return console.warn("Invalid JSON string:",X),"{}"}};return(0,j.useEffect)(function(){if(w.current)return I.current?I.current.setValue(D):(I.current=W.j6.create(w.current,{value:A(D),language:"json",theme:"vs",readOnly:C,folding:!0,automaticLayout:!0}),I.current.onDidChangeModelContent(function(){var T=I.current.getValue();console.log("[JSONEditor] \u7F16\u8F91\u5668\u5185\u5BB9\u53D8\u66F4:",{newValue:T}),L==null||L(T)})),function(){if(I!=null&&I.current){var T;I==null||(T=I.current)===null||T===void 0||T.dispose(),I.current=null}}},[]),(0,j.useEffect)(function(){I.current&&D!==I.current.getValue()&&I.current.setValue(A(D))},[D]),(0,ee.jsx)("div",{ref:w,style:v()({height:360,borderRadius:4,overflow:"hidden"},N)},me)};Q.Z=h},87958:function(ie,Q,t){"use strict";t.r(Q),t.d(Q,{default:function(){return Ot}});var G=t(39380),v=t(62435),W=t(97857),j=t.n(W),ee=t(15009),h=t.n(ee),Ae=t(99289),b=t.n(Ae),se=t(5574),D=t.n(se),L=t(24163),te=t(25593),N=t(99859),ae=t(17788),me=t(21532),F=t(71230),C=t(15746),w=t(86250),I=t(96074),A=t(45830),T={leftInfoLabel:"leftInfoLabel___SJHhs",rightInfoLabel:"rightInfoLabel___c8v5r",basicInfoValue:"basicInfoValue___Cwl01",accountModal:"accountModal___hexAB",sectionDivider:"sectionDivider___oQjeE",proxyCollapse:"proxyCollapse___dPuDK"},oe=t(91618),X={ALI_CLOUD:{type:"basic",fields:[{name:"ak",label:"AK",required:!0},{name:"sk",label:"SK",required:!0}],hasProxy:!0},HUAWEI_CLOUD:{type:"basic",fields:[{name:"ak",label:"AK",required:!0},{name:"sk",label:"SK",required:!0}]},BAIDU_CLOUD:{type:"basic",fields:[{name:"ak",label:"AK",required:!0},{name:"sk",label:"SK",required:!0}]},AWS:{type:"basic",fields:[{name:"ak",label:"AK",required:!0},{name:"sk",label:"SK",required:!0}]},TENCENT_CLOUD:{type:"basic",fields:[{name:"ak",label:"AK",required:!0},{name:"sk",label:"SK",required:!0}]},KINGSOFT_CLOUD:{type:"basic",fields:[{name:"ak",label:"AK",required:!0},{name:"sk",label:"SK",required:!0}]},AZURE:{type:"basic",fields:[{name:"ak",label:"AK",required:!0},{name:"sk",label:"SK",required:!0}]},GCP:{type:"json",fields:[{name:"credentialsJson",label:"GCP KEY",required:!0}]},ALI_CLOUD_PRIVATE:{type:"exclusive",fields:[{name:"ak",label:"AK",required:!0},{name:"sk",label:"SK",required:!0},{name:"endpoint",label:"Endpoint",required:!0},{name:"regionId",label:"RegionId",required:!0}]},HUAWEI_CLOUD_PRIVATE:{type:"extend",fields:[{name:"ak",label:"AK",required:!0},{name:"sk",label:"SK",required:!0},{name:"iamEndpoint",label:"Iam_Endpoint",required:!0},{name:"ecsEndpoint",label:"Ecs_Endpoint",required:!0},{name:"elbEndpoint",label:"Elb_Endpoint",required:!0},{name:"evsEndpoint",label:"Evs_Endpoint",required:!0},{name:"vpcEndpoint",label:"Vpc_Endpoint",required:!0},{name:"obsEndpoint",label:"Obs_Endpoint",required:!0},{name:"regionId",label:"RegionId",required:!0},{name:"projectId",label:"ProjectId"}]}},fe={cloudAccountId:[{required:!0,message:"Please enter your cloud account ID"}],alias:[{required:!0,message:"Please enter the alias of your cloud account"}],tenantId:[{required:!0,message:"Please select the tenant"}],platform:[{required:!0,message:"Please select the cloud platform"}]},ce=["GCP"],Fe=null,ve=null,ue=null,e=t(86074),l=te.Z.Text,n=function(u){var y,H,a=u.accountInfo,J=u.visible,E=u.onCancel,i=u.tenantListAll,P=u.resourceTypeList,Z=(0,A.useIntl)(),Y=N.Z.useForm(),q=D()(Y,1),d=q[0],s=ce!=null&&ce.includes(a==null?void 0:a.platform)?600:500;return(0,e.jsxs)(ae.Z,{title:(0,e.jsx)("div",{style:{fontSize:16,fontWeight:500},children:Z.formatMessage({id:"cloudAccount.extend.title.accountInfo"})}),open:J,onCancel:E,footer:null,width:800,style:{minHeight:s},destroyOnClose:!0,children:[(0,e.jsx)(me.ZP,{theme:{components:{Form:{labelColor:"rgba(74, 74, 74, 1)",colorTextHeading:"rgba(74, 74, 74, 1)"}}},children:(0,e.jsxs)(N.Z,{form:d,layout:"vertical",children:[(0,e.jsxs)(F.Z,{children:[(0,e.jsxs)(C.Z,{span:12,children:[(0,e.jsxs)(F.Z,{style:{height:44},children:[(0,e.jsxs)("span",{className:T.leftInfoLabel,children:[Z.formatMessage({id:"cloudAccount.extend.title.accountId"}),"\xA0:"]}),(0,e.jsx)(L.Z,{style:{paddingTop:11,color:"#457aff"},text:(a==null?void 0:a.cloudAccountId)||"-",rows:1,maxWidth:100})]}),(0,e.jsxs)(F.Z,{style:{height:44},children:[(0,e.jsxs)("span",{className:T.leftInfoLabel,children:[Z.formatMessage({id:"cloudAccount.extend.title.alias"}),"\xA0:"]}),(0,e.jsx)(L.Z,{style:{paddingTop:11,color:"#457aff"},text:(a==null?void 0:a.alias)||"-",rows:1,maxWidth:100})]}),(0,e.jsxs)(F.Z,{style:{height:44},children:[(0,e.jsxs)("span",{className:T.leftInfoLabel,children:[Z.formatMessage({id:"cloudAccount.extend.title.platform"}),"\xA0:"]}),(0,e.jsx)(L.Z,{style:{paddingTop:11,color:"#457aff"},text:(P==null||(y=P.filter(function(g){return g.value===(a==null?void 0:a.platform)}))===null||y===void 0||(y=y.map(function(g){return Z.formatMessage({id:g.label})}))===null||y===void 0?void 0:y.toString())||"-",rows:1,maxWidth:100})]}),(0,e.jsxs)(F.Z,{style:{height:44},children:[(0,e.jsxs)("span",{className:T.leftInfoLabel,children:[Z.formatMessage({id:"common.select.label.tenant"}),"\xA0:"]}),(0,e.jsx)(L.Z,{style:{paddingTop:11,color:"#457aff"},text:(i==null||(H=i.find(function(g){return g.value===(a==null?void 0:a.tenantId)}))===null||H===void 0?void 0:H.label)||"-",rows:1,maxWidth:100})]})]}),(0,e.jsxs)(C.Z,{span:12,children:[(0,e.jsxs)(F.Z,{style:{height:44},children:[(0,e.jsxs)("span",{className:T.rightInfoLabel,children:[Z.formatMessage({id:"cloudAccount.extend.title.asset.number"}),"\xA0:"]}),(0,e.jsx)("span",{className:T.basicInfoValue,style:{color:"#457aff"},children:(a==null?void 0:a.resourceCount)||0})]}),(0,e.jsxs)(F.Z,{children:[(0,e.jsx)("span",{className:T.rightInfoLabel,style:{height:44},children:ce!=null&&ce.includes(a==null?void 0:a.platform)?"GCP KEY ".concat(Z.formatMessage({id:"common.link.text.status"})," : "):"AK/SK ".concat(Z.formatMessage({id:"common.link.text.status"})," : ")}),(0,e.jsx)(w.Z,{align:"center",children:(0,e.jsx)(oe.Z,{state:a==null?void 0:a.status})})]})]})]}),(0,e.jsx)(N.Z.Item,{label:Z.formatMessage({id:"cloudAccount.extend.title.lastScanTime"}),children:(0,e.jsx)(l,{style:{color:"rgba(74, 74, 74, 1)"},children:(a==null?void 0:a.lastScanTime)||" -"})}),(0,e.jsx)(N.Z.Item,{label:Z.formatMessage({id:"cloudAccount.extend.title.createTime"}),children:(0,e.jsx)(l,{style:{color:"rgba(74, 74, 74, 1)"},children:(a==null?void 0:a.gmtCreate)||"-"})}),(0,e.jsx)(N.Z.Item,{label:Z.formatMessage({id:"cloudAccount.extend.title.updateTime"}),children:(0,e.jsx)(l,{style:{color:"rgba(74, 74, 74, 1)"},children:(a==null?void 0:a.gmtModified)||"-"})})]})}),(0,e.jsx)(I.Z,{style:{margin:"18px 0 0 0",borderColor:"#457aff",opacity:.25}})]})},r=n,_e=t(13769),Xe=t.n(_e),ge=t(92635),qe=t(58638),et=t(45605),tt=t(25035),at=t(184),pe=t(5966),Ue=t(64317),nt=t(97462),rt=t(8214),st=t(63434),ot=t(3303),Ne=t(68872),de=t(83622),Re=t(83062),We=t(57381),Pe=t(32983),we=t(29448),lt=t(86548),it=t(52078),ct=function(u){var y=u.type,H=u.fields,a=u.accountId,J=u.visible,E=u.onVisibleChange,i=u.value,P=u.onChange,Z=(0,A.useIntl)(),Y=function(s,g){var m=j()({},i||{});m[s]=g,P==null||P(m)},q=function(s){var g=(s==null?void 0:s.trim())||"{}";P==null||P({credentialsJson:g})};return a&&!J?(0,e.jsx)(N.Z.Item,{label:Z.formatMessage({id:"cloudAccount.form.credential"}),name:"action",children:(0,e.jsx)(de.ZP,{type:"link",onClick:function(){return E(!0)},style:{padding:"4px 0",color:"#2f54eb"},children:(0,e.jsx)(lt.Z,{})})}):J?y==="json"?(0,e.jsx)(pe.Z,{name:"credentialsJson",label:"GCP KEY",initialValue:(i==null?void 0:i.credentialsJson)||"{}",rules:[{required:!0,validator:function(){var d=b()(h()().mark(function g(m,x){return h()().wrap(function(V){for(;;)switch(V.prev=V.next){case 0:if(x!=null&&x.trim()){V.next=2;break}throw new Error("Please enter a valid GCP KEY");case 2:V.prev=2,JSON.parse(x),V.next=9;break;case 6:throw V.prev=6,V.t0=V.catch(2),new Error("Please enter a valid GCP KEY in JSON format");case 9:case"end":return V.stop()}},g,null,[[2,6]])}));function s(g,m){return d.apply(this,arguments)}return s}()}],children:(0,e.jsx)(it.Z,{value:(i==null?void 0:i.credentialsJson)||"{}",onChange:q,editorStyle:{height:"240px"},editorKey:"CREDENTIALS_JSON_EDITOR"})}):(0,e.jsx)(e.Fragment,{children:H.map(function(d){var s=d.name;return(0,e.jsx)(pe.Z,{name:["credentials",s],label:d.label,rules:[{required:d.required}],fieldProps:{type:d.type||"text",onChange:function(m){return Y(s,m.target.value)}}},s)})}):null},ut=ct,dt=t(90672),mt=function(){var u=(0,A.useIntl)();return(0,e.jsx)(dt.Z,{name:"proxyConfig",label:u.formatMessage({id:"cloudAccount.form.proxy"}),placeholder:u.formatMessage({id:"cloudAccount.form.proxy.placeholder"})})},ft=mt,Ve=t(96486),vt=t(79930),gt=function(){var u=(0,A.useIntl)(),y=(0,v.useState)(!1),H=D()(y,2),a=H[0],J=H[1],E=(0,v.useState)([]),i=D()(E,2),P=i[0],Z=i[1],Y=(0,v.useCallback)(function(){var q=b()(h()().mark(function d(s){var g;return h()().wrap(function(x){for(;;)switch(x.prev=x.next){case 0:if(s!=null&&s.trim()){x.next=2;break}return x.abrupt("return");case 2:return J(!0),x.prev=3,x.next=6,(0,vt.queryGroupTypeList)({platformList:[s]});case 6:g=x.sent,(0,Ve.isEmpty)(g.content)?(Z([]),Ne.ZP.error(u.formatMessage({id:"cloudAccount.message.text.no.assets"}))):Z(g==null?void 0:g.content),x.next=14;break;case 10:x.prev=10,x.t0=x.catch(3),Ne.ZP.error("\u83B7\u53D6\u8D44\u6E90\u7C7B\u578B\u5217\u8868\u5931\u8D25"),Z([]);case 14:return x.prev=14,J(!1),x.finish(14);case 17:case"end":return x.stop()}},d,null,[[3,10,14,17]])}));return function(d){return q.apply(this,arguments)}}(),[u]);return{loading:a,resourceTypes:P,fetchResourceTypes:Y}},pt=["resourceTypeListForWeb","credentialMap","id","proxyConfig","platform"],ht=ot.Z.SHOW_CHILD,ke=te.Z.Text,xt=function(u){var y=(0,A.useModel)("rule"),H=y.platformList,a=(0,A.useModel)("tenant"),J=a.tenantListAll,E=gt(),i=E.loading,P=E.resourceTypes,Z=E.fetchResourceTypes,Y=N.Z.useForm(),q=D()(Y,1),d=q[0],s=(0,A.useIntl)(),g=u.editFormVisible,m=u.accountInfo,x=u.setEditFormVisible,Me=u.requestCurrentData,V=(0,v.useState)(!0),ye=D()(V,2),ne=ye[0],_=ye[1],$=(0,v.useState)("{}"),p=D()($,2),Se=p[0],Ce=p[1],be=function(R){var M=d.getFieldsValue(),B=M.platform;if(B){var f=X[B];if(f)if(f.type==="json"){var c=R.credentialsJson||"{}";Ce(c),d.setFieldsValue({credentials:{credentialsJson:c}})}else{var o=d.getFieldValue("credentials")||{},S=j()({},o);f.fields.forEach(function(k){var O=k.name;O in R&&R[O]!==void 0&&(S[O]=R[O])}),d.setFieldsValue({credentials:S})}}},Ze=function(){var U=b()(h()().mark(function R(){var M,B,f,c,o,S,k,O,De,K,Le,re,Te,Oe,ze,Je,$e;return h()().wrap(function(le){for(;;)switch(le.prev=le.next){case 0:if(M=d.getFieldsValue(),B=M.cloudAccountId,f=M.email,c=M.alias,o=M.tenantId,S=M.platform,k=M.resourceTypeList,O=M.site,De=M.owner,K=M.proxyConfig,Le=M.credentials,re=M.enableInverseSelection,Te={cloudAccountId:B,email:f,alias:c,tenantId:typeof o=="string"?parseInt(o,10):o,platform:S,resourceTypeList:k,site:O,owner:De,enableInverseSelection:re},Oe=X[S],Oe){le.next=6;break}return le.abrupt("return");case 6:return ne&&(Oe.type==="json"?Te.credentialsObj={credentialsJson:(Le==null?void 0:Le.credentialsJson)||Se}:(ze=j()({},Le||{}),Oe.fields.forEach(function(Nt){var Qe=Nt.name,Ye=d.getFieldValue(["credentials",Qe]);Ye!==void 0&&(ze[Qe]=Ye)}),Te.credentialsObj=ze)),Oe.hasProxy&&K&&(Te.proxyConfig=K),m.id&&(Te.id=m.id),le.next=11,(0,ge.saveCloudAccount)(Te);case 11:if(Je=le.sent,Je.msg!=="success"){le.next=18;break}return $e=m.id?"common.message.text.edit.success":"common.message.text.create.success",Ne.ZP.success(s.formatMessage({id:$e})),x(!1),le.next=18,Me();case 18:case"end":return le.stop()}},R)}));return function(){return U.apply(this,arguments)}}();(0,v.useEffect)(function(){if(g&&m.id){var U;_(!1);var R=m.resourceTypeListForWeb,M=m.credentialMap,B=m.id,f=m.proxyConfig,c=m.platform,o=Xe()(m,pt),S=j()(j()({},o),{},{credentials:M||{},resourceTypeList:R||[],proxyConfig:f||void 0,platform:c||"",enableInverseSelection:o.enableInverseSelection||!1});c&&((U=X[c])===null||U===void 0?void 0:U.type)==="json"&&M!==null&&M!==void 0&&M.credentialsJson&&Ce(M.credentialsJson),d.setFieldsValue(S),m.platform&&Z(m.platform)}},[g,m]);var Ee=function(){d.resetFields()},Ie=function(){x(!1),Ee()};return(0,e.jsxs)(at.a,{labelCol:{span:5},wrapperCol:{span:17},title:(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("span",{style:{marginRight:4},children:s.formatMessage({id:m.id?"cloudAccount.extend.title.edit":"cloudAccount.extend.title.add"})}),(0,e.jsxs)(de.ZP,{size:"small",type:"link",href:"https://cloudrec.yuque.com/org-wiki-cloudrec-iew3sz/hocvhx/fetbofdu8dx15q73",target:"_blank",style:{color:"#2f54eb",gap:4},children:[(0,e.jsx)(qe.Z,{}),(0,e.jsx)("span",{children:s.formatMessage({id:"common.link.text.help.center"})})]})]}),width:720,form:d,drawerProps:{destroyOnClose:!0,onClose:Ie,styles:{body:{paddingTop:24}}},open:g,onFinish:Ze,layout:"horizontal",children:[(0,e.jsx)(I.Z,{className:T.sectionDivider,dashed:!0,children:(0,e.jsx)(ke,{italic:!0,children:s.formatMessage({id:"cloudAccount.extend.title.basic.information"})})}),(0,e.jsxs)(F.Z,{children:[(0,e.jsx)(C.Z,{span:24,children:(0,e.jsx)(pe.Z,{disabled:!!m.id,name:"cloudAccountId",label:s.formatMessage({id:"cloudAccount.extend.title.account.id"}),rules:fe.cloudAccountId,fieldProps:{suffix:!!m.id&&(0,e.jsx)(Re.Z,{title:"\u4E91\u8D26\u53F7ID\u4E3A\u4E91\u5E73\u53F0\u4E3B\u8D26\u53F7ID\uFF0C\u521B\u5EFA\u540E\u65E0\u6CD5\u4FEE\u6539",children:(0,e.jsx)(et.Z,{style:{color:"rgba(0,0,0,.45)"}})})}})}),(0,e.jsx)(C.Z,{span:24,children:(0,e.jsx)(pe.Z,{name:"email",label:s.formatMessage({id:"cloudAccount.extend.title.account.email"})})}),(0,e.jsx)(C.Z,{span:24,children:(0,e.jsx)(pe.Z,{name:"alias",label:s.formatMessage({id:"cloudAccount.extend.title.account.alias"}),rules:fe.alias})}),(0,e.jsx)(C.Z,{span:24,children:(0,e.jsx)(Ue.Z,{label:s.formatMessage({id:"common.select.label.tenant"}),name:"tenantId",rules:fe.tenantId,options:J})}),(0,e.jsx)(C.Z,{span:24,children:(0,e.jsx)(pe.Z,{name:"owner",label:"Owner"})}),(0,e.jsx)(C.Z,{span:24,children:(0,e.jsx)(Ue.Z,{label:s.formatMessage({id:"cloudAccount.extend.title.cloud.platform"}),name:"platform",rules:fe.platform,options:(0,we.T$)(H,"start"),onChange:function(R){m.id&&_(!1),d.setFieldValue("resourceTypeList",void 0),Z(R)}})})]}),(0,e.jsx)(nt.Z,{name:["platform"],children:function(R){var M=R.platform;if(!M)return null;var B=X[M];return B?(0,e.jsxs)(F.Z,{children:[(0,e.jsxs)(C.Z,{span:24,children:[(0,e.jsx)(I.Z,{className:T.sectionDivider,dashed:!0,children:(0,e.jsx)(ke,{italic:!0,children:s.formatMessage({id:"cloudAccount.extend.title.detailed.configuration"})})}),(0,e.jsx)(ut,{type:B.type,fields:B.fields,accountId:m.id,visible:ne,onVisibleChange:_,value:d.getFieldValue("credentials"),onChange:be})]}),(0,e.jsx)(C.Z,{span:24,style:{marginBottom:"-12px"},children:(0,e.jsx)(rt.Z,{label:s.formatMessage({id:"cloudAccount.extend.title.cloud.services"}),name:"resourceTypeList",fieldProps:{multiple:!0,showCheckedStrategy:ht,options:P,allowClear:!0,showSearch:!0,notFoundContent:i?(0,e.jsx)(We.Z,{size:"small"}):(0,e.jsx)(Pe.Z,{image:Pe.Z.PRESENTED_IMAGE_SIMPLE})},extra:(0,e.jsxs)(st.Z,{name:"enableInverseSelection",tooltip:s.formatMessage({id:"cloudAccount.extend.tooltip.selection.mode"}),style:{marginTop:"8px",marginBottom:0},initialValue:!1,children:[s.formatMessage({id:"cloudAccount.extend.title.cloud.services.inverse.selection"}),(0,e.jsx)(Re.Z,{title:s.formatMessage({id:"cloudAccount.extend.tooltip.selection.mode"}),children:(0,e.jsx)(tt.Z,{style:{marginLeft:4}})})]})})}),(0,e.jsx)(C.Z,{span:24,style:{marginTop:"-16px"},children:(0,e.jsx)(pe.Z,{name:"site",label:s.formatMessage({id:"cloudAccount.extend.title.cloud.site"})})}),B.hasProxy&&(0,e.jsxs)(C.Z,{span:24,children:[(0,e.jsx)(I.Z,{className:T.sectionDivider,dashed:!0,children:(0,e.jsx)(ke,{italic:!0,children:s.formatMessage({id:"cloudAccount.form.proxy"})})}),(0,e.jsx)(ft,{})]})]}):null}})]})},Be=xt,jt=t(17910),yt=t(98165),Ct=t(62548),It=t(40357),At=t(72269),Ke=t(86738),z={accountListTable:"accountListTable___EAu4J",cloudAccountWrap:"cloudAccountWrap___rED3n",cloudAccountList:"cloudAccountList___bSSKI",accountCard:"accountCard___Ff6OW",divider:"divider___oeq1I",propertyWrap:"propertyWrap___cmHKv",propertyName:"propertyName___fiUje",accountNameWrap:"accountNameWrap___gsm80",accountModal:"accountModal___ZRBFT",iKnow:"iKnow____ILRT",basicInfoRow:"basicInfoRow___Nlip5",basicLeftRow:"basicLeftRow___KpoYr",leftInfoLabel:"leftInfoLabel___b3k2E",rightInfoLabel:"rightInfoLabel___ch993",basicInfoValue:"basicInfoValue___XJpgy"},Mt=function(u){var y=u.account,H=u.requestInitData,a=u.requestCurrentData,J=y.id,E=y.platform,i=y.cloudAccountId,P=y.alias,Z=y.accountStatus,Y=y.tenantName,q=y.resourceCount,d=y.riskCount,s=y.lastScanTime,g=y.collectorStatus,m=y.gmtCreate,x=y.gmtModified,Me=(0,A.useModel)("rule"),V=Me.platformList,ye=Ne.ZP.useMessage(),ne=D()(ye,2),_=ne[0],$=ne[1],p=(0,A.useIntl)(),Se=(0,v.useState)(!1),Ce=D()(Se,2),be=Ce[0],Ze=Ce[1],Ee=(0,v.useRef)({}),Ie=(0,v.useState)(!1),U=D()(Ie,2),R=U[0],M=U[1],B=(0,v.useRef)({}),f=function(){var o=b()(h()().mark(function S(k,O){var De,K;return h()().wrap(function(re){for(;;)switch(re.prev=re.next){case 0:return De={cloudAccountId:k,accountStatus:O},re.next=3,(0,ge.updateCloudAccountStatus)(De);case 3:if(K=re.sent,!(K.code===200||K.msg==="success")){re.next=8;break}return _.success(p.formatMessage({id:"common.message.text.edit.success"})),re.next=8,a();case 8:case"end":return re.stop()}},S)}));return function(k,O){return o.apply(this,arguments)}}(),c=function(){var o=b()(h()().mark(function S(){var k,O;return h()().wrap(function(K){for(;;)switch(K.prev=K.next){case 0:return k=_.loading(p.formatMessage({id:"common.message.text.delete.loading"})),K.next=3,(0,ge.removeCloudAccount)({id:J});case 3:if(O=K.sent,k(),!(O.code===200||O.msg==="success")){K.next=9;break}return _.success(p.formatMessage({id:"common.message.text.delete.success"})),K.next=9,H();case 9:case"end":return K.stop()}},S)}));return function(){return o.apply(this,arguments)}}();return(0,e.jsxs)(e.Fragment,{children:[$,(0,e.jsxs)("div",{className:z.accountCard,children:[(0,e.jsxs)(w.Z,{justify:"space-between",style:{width:"100%"},children:[(0,e.jsxs)(w.Z,{children:[(0,e.jsx)(It.Z,{src:jt.J_[E],alt:"PLATFORM_ICON",width:62,height:62,preview:!1}),(0,e.jsxs)("div",{className:z.accountNameWrap,children:[(0,e.jsx)(L.Z,{text:i||"-",maxWidth:100,rows:1,style:{color:"#262626",fontSize:17,fontWeight:500},placement:"topLeft"}),(0,e.jsx)(L.Z,{text:P||"-",maxWidth:100,rows:1,style:{color:"#333",fontSize:12,margin:"1px 0"},placement:"topLeft"}),(0,e.jsx)(L.Z,{text:(0,we.PZ)(E,V)||"-",maxWidth:100,rows:1,style:{color:"#999",fontSize:13},placement:"topLeft"})]})]}),(0,e.jsx)(Re.Z,{title:p.formatMessage({id:"cloudAccount.extend.title.collect.status"}),children:(0,e.jsx)(At.Z,{style:{flexShrink:0},checkedChildren:p.formatMessage({id:"common.button.text.enable"}),unCheckedChildren:p.formatMessage({id:"common.button.text.disable"}),checked:Z==="valid",onClick:function(){return f(i,Z==="valid"?"invalid":"valid")}})})]}),(0,e.jsx)(I.Z,{className:z.divider}),(0,e.jsxs)(F.Z,{gutter:[24,8],children:[(0,e.jsxs)(C.Z,{span:14,className:z.propertyWrap,children:[(0,e.jsx)("div",{className:z.propertyName,children:p.formatMessage({id:"cloudAccount.extend.title.tenant.attribution"})}),(0,e.jsx)(L.Z,{text:Y||"-",maxWidth:123,rows:1,style:{color:"#999",fontSize:13},placement:"topLeft"})]}),(0,e.jsxs)(C.Z,{span:10,className:z.propertyWrap,children:[(0,e.jsx)("div",{className:z.propertyName,children:p.formatMessage({id:"cloudAccount.extend.title.asset.number"})}),(0,e.jsxs)(w.Z,{align:"center",gap:8,children:[(0,e.jsx)(L.Z,{text:q,maxWidth:70,rows:1,style:{color:"#457AFF",fontSize:12},link:!0,onClickCallBackFunc:function(){return A.history.push("/assetManagement/assetList?platform=".concat(E,"&cloudAccountId=").concat(i))},placement:"topLeft"}),(0,e.jsx)(I.Z,{type:"vertical",style:{margin:0,height:12}}),(0,e.jsx)(L.Z,{text:d,maxWidth:70,rows:1,style:{color:"#ff4d4f",fontSize:12},link:!0,onClickCallBackFunc:function(){return A.history.push("/riskManagement/riskList?platform=".concat(E,"&cloudAccountId=").concat(i))},placement:"topLeft"})]})]}),(0,e.jsxs)(C.Z,{span:14,className:z.propertyWrap,children:[(0,e.jsx)("div",{className:z.propertyName,children:p.formatMessage({id:"cloudAccount.extend.title.lastScanTime"})}),(0,e.jsx)(L.Z,{text:s||"-",maxWidth:123,rows:1,style:{color:"#999",fontSize:13},placement:"topLeft"})]}),(0,e.jsxs)(C.Z,{span:10,className:z.propertyWrap,children:[(0,e.jsx)("div",{className:z.propertyName,children:p.formatMessage({id:"cloudAccount.extend.title.collection.status"})}),(0,e.jsxs)(w.Z,{align:"center",children:[(0,e.jsx)(L.Z,{text:g||"-",maxWidth:81,rows:1,style:{color:"#999",fontSize:13},placement:"topLeft"}),g==="\u626B\u63CF\u4E2D"?(0,e.jsx)(yt.Z,{style:{marginLeft:8,fontSize:13,color:"#1677FF"},spin:!0}):g==="\u5F85\u626B\u63CF"?(0,e.jsx)(Ke.Z,{title:p.formatMessage({id:"cloudAccount.extend.collection.popconfirm"}),onConfirm:b()(h()().mark(function o(){var S;return h()().wrap(function(O){for(;;)switch(O.prev=O.next){case 0:return O.next=2,(0,ge.createCollectTask)({cloudAccountId:i});case 2:if(S=O.sent,!(S.code===200||S.msg==="success")){O.next=7;break}return _.success(p.formatMessage({id:"common.message.text.add.success"})),O.next=7,a();case 7:case"end":return O.stop()}},o)})),okText:p.formatMessage({id:"common.button.text.ok"}),cancelText:p.formatMessage({id:"common.button.text.cancel"}),children:(0,e.jsx)(Ct.Z,{style:{marginLeft:8,cursor:"pointer",fontSize:13,color:"#1677FF"}})}):null]})]}),(0,e.jsxs)(C.Z,{span:24,className:z.propertyWrap,children:[(0,e.jsx)("div",{className:z.propertyName,children:p.formatMessage({id:"cloudAccount.extend.title.createAndUpdateTime"})}),(0,e.jsx)(L.Z,{text:m||"-",maxWidth:228,rows:1,style:{color:"#999",fontSize:13},placement:"topLeft"}),(0,e.jsx)(L.Z,{text:x||"-",maxWidth:228,rows:1,style:{color:"#999",fontSize:13,margin:"2px 0 16px 0"}})]})]}),(0,e.jsxs)(w.Z,{style:{width:"100%"},justify:"center",children:[(0,e.jsx)(Ke.Z,{title:p.formatMessage({id:"common.button.text.delete.confirm"}),onConfirm:function(){return c()},okText:p.formatMessage({id:"common.button.text.ok"}),cancelText:p.formatMessage({id:"common.button.text.cancel"}),children:(0,e.jsx)(de.ZP,{type:"primary",style:{width:64,height:30,borderRadius:4,backgroundColor:"#FFF2F3",color:"#EC4344"},children:p.formatMessage({id:"common.button.text.delete"})})}),(0,e.jsx)(de.ZP,{size:"small",type:"primary",style:{width:64,height:30,borderRadius:4,backgroundColor:"#E7F1FF",color:"#1677FF",margin:"0 8px"},onClick:function(){Ze(!0),Ee.current=j()({},y)},children:p.formatMessage({id:"common.button.text.edit"})}),(0,e.jsx)(de.ZP,{size:"small",type:"link",style:{width:64,height:30,borderRadius:4,backgroundColor:"#E7F1FF",color:"#1677FF",marginLeft:8},onClick:function(){A.history.push("/cloudAccount/collectionRecord?platform=".concat(E,"&cloudAccountId=").concat(i))},children:p.formatMessage({id:"cloudAccount.button.text.collection.record"})})]})]}),(0,e.jsx)(Be,{editFormVisible:be,setEditFormVisible:Ze,accountInfo:Ee.current,requestCurrentData:a}),(0,e.jsx)(r,{accountModalVisible:R,setAccountModalVisible:M,accountModalInfo:B.current})]})},St=Mt,Ge=t(93410),bt=t(84567),He=t(34041),Zt=t(42075),Et=t(84611),he=1,xe=12,Dt=[{label:(0,e.jsx)(A.FormattedMessage,{id:"cloudAccount.module.search.open"}),value:"valid"},{label:(0,e.jsx)(A.FormattedMessage,{id:"cloudAccount.module.search.stop"}),value:"invalid"},{label:(0,e.jsx)(A.FormattedMessage,{id:"cloudAccount.module.search.scanning"}),value:"running"},{label:(0,e.jsx)(A.FormattedMessage,{id:"cloudAccount.module.search.waitingToScan"}),value:"waiting"}],Lt=function(){var u,y=(0,A.useModel)("rule"),H=y.platformList,a=N.Z.useForm(),J=D()(a,1),E=J[0],i=(0,A.useIntl)(),P=(0,v.useRef)({}),Z=(0,v.useState)(!1),Y=D()(Z,2),q=Y[0],d=Y[1],s=(0,v.useState)(he),g=D()(s,2),m=g[0],x=g[1],Me=(0,v.useState)(xe),V=D()(Me,2),ye=V[0],ne=V[1],_=(0,A.useRequest)(function(f){return(0,ge.queryCloudAccountList)(f)},{manual:!0,formatResult:function(c){return c.content}}),$=_.data,p=_.run,Se=_.loading,Ce=function(){var f=b()(h()().mark(function c(){return h()().wrap(function(S){for(;;)switch(S.prev=S.next){case 0:return x(he),ne(xe),E==null||E.resetFields(),S.next=5,p({page:he,size:xe});case 5:case"end":return S.stop()}},c)}));return function(){return f.apply(this,arguments)}}(),be=function(){var f=b()(h()().mark(function c(){var o;return h()().wrap(function(k){for(;;)switch(k.prev=k.next){case 0:return x(he),ne(xe),o=E.getFieldsValue(),k.next=5,p(j()(j()({},o),{},{page:he,size:xe}));case 5:case"end":return k.stop()}},c)}));return function(){return f.apply(this,arguments)}}(),Ze=function(){E.resetFields()},Ee=function(c){x(he),ne(xe),p(j()(j()({},c),{},{page:he,size:xe}))};(0,v.useEffect)(function(){p({page:m,size:ye})},[]);var Ie=(0,A.useRequest)(function(f){return(0,ge.cloudAccountBaseInfoList)(j()({},f))},{formatResult:function(c){if(c.msg==="success"){var o;return(c==null||(o=c.content)===null||o===void 0||(o=o.accountAliasList)===null||o===void 0?void 0:o.map(function(S){return{label:S,value:S}}))||[]}}}),U=Ie.data,R=Ie.run,M=Ie.loading,B=(0,v.useMemo)(function(){var f=function(o){R({platformList:E.getFieldValue("platformList")||[],cloudAccountSearch:o})};return(0,Ve.debounce)(f,500)},[ge.cloudAccountBaseInfoList]);return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(Ge.Z,{style:{marginBottom:16},children:(0,e.jsxs)(N.Z,{form:E,onFinish:Ee,children:[(0,e.jsx)(F.Z,{gutter:[24,24],children:(0,e.jsx)(C.Z,{span:24,children:(0,e.jsx)(N.Z.Item,{name:"platformList",label:i.formatMessage({id:"common.select.label.cloudPlatform"}),style:{marginBottom:16},children:(0,e.jsx)(bt.Z.Group,{options:(0,we.T$)(H),onChange:function(c){return R({platformList:c||[]})}})})})}),(0,e.jsxs)(F.Z,{gutter:[24,24],children:[(0,e.jsx)(C.Z,{span:6,children:(0,e.jsx)(N.Z.Item,{name:"cloudAccountId",label:i.formatMessage({id:"common.select.label.cloudAccount"}),style:{marginBottom:0,width:"100%"},children:(0,e.jsx)(He.Z,{allowClear:!0,showSearch:!0,placeholder:i.formatMessage({id:"common.select.query.text.placeholder"}),notFoundContent:M&&(0,e.jsx)(We.Z,{size:"small"}),onSearch:B,options:U||[]})})}),(0,e.jsx)(C.Z,{span:6,children:(0,e.jsx)(N.Z.Item,{name:"status",label:i.formatMessage({id:"common.select.label.Collection.status"}),style:{marginBottom:0,width:"100%"},children:(0,e.jsx)(He.Z,{allowClear:!0,placeholder:i.formatMessage({id:"common.select.text.placeholder"}),options:Dt})})}),(0,e.jsx)(C.Z,{span:6,offset:6,style:{width:"100%"},children:(0,e.jsx)(w.Z,{justify:"flex-end",style:{width:"100%"},children:(0,e.jsx)(N.Z.Item,{style:{marginBottom:0},children:(0,e.jsxs)(Zt.Z,{size:8,children:[(0,e.jsx)(de.ZP,{onClick:Ze,children:i.formatMessage({id:"common.button.text.reset"})}),(0,e.jsx)(de.ZP,{type:"primary",htmlType:"submit",loading:Se,children:i.formatMessage({id:"common.button.text.query"})})]})})})})]})]})}),(0,e.jsxs)(Ge.Z,{style:{minHeight:488},children:[(0,e.jsx)(F.Z,{style:{marginBottom:28},justify:"end",children:(0,e.jsx)(de.ZP,{type:"primary",onClick:function(){d(!0),P.current={}},children:i.formatMessage({id:"common.button.text.add"})},"create")}),(0,e.jsx)(F.Z,{className:z.cloudAccountWrap,children:(0,e.jsx)(We.Z,{spinning:Se,children:(0,Ve.isEmpty)($==null?void 0:$.data)?(0,e.jsx)(w.Z,{align:"center",justify:"center",style:{width:" 100%",minHeight:356},children:(0,e.jsx)(Pe.Z,{image:Pe.Z.PRESENTED_IMAGE_SIMPLE})}):(0,e.jsx)("div",{className:z.cloudAccountList,children:$==null||(u=$.data)===null||u===void 0?void 0:u.map(function(f){return(0,e.jsx)(St,{account:f,requestInitData:Ce,requestCurrentData:be},f.id)})})})}),(0,e.jsx)(F.Z,{children:(0,e.jsx)(w.Z,{justify:"center",style:{width:"100%",marginTop:"16px"},children:(0,e.jsx)(Et.Z,{onChange:function(c,o){x(c),ne(o),p(j()(j()({},E.getFieldsValue()),{},{page:c,size:o}))},current:m,pageSize:ye,size:"small",showTotal:function(c,o){return(0,we.GO)(c,o,i==null?void 0:i.locale)},total:($==null?void 0:$.total)||0,showSizeChanger:!0,pageSizeOptions:[12,24]})})})]}),(0,e.jsx)(Be,{editFormVisible:q,setEditFormVisible:d,accountInfo:P.current,requestCurrentData:be})]})},Tt=Lt,Ft=function(){return(0,e.jsx)(G._z,{title:!1,children:(0,e.jsx)(Tt,{})})},Ot=Ft},53846:function(ie,Q){"use strict";Q.Z={customTitle:"customTitle___nzcxh",riskHigh:"riskHigh___GstO6",riskMedium:"riskMedium___F4JTb",riskLow:"riskLow___HJopw",imgProcess:"imgProcess___NGndv",imgResult:"imgResult___wKhiG",validTag:"validTag___TRSau",invalidTag:"invalidTag___opVlG",waitingTag:"waitingTag___JZpZT"}},85674:function(ie,Q,t){var G={"./simpleWorker":18352,"./simpleWorker.js":18352};function v(W){return Promise.resolve().then(function(){if(!t.o(G,W)){var j=new Error("Cannot find module '"+W+"'");throw j.code="MODULE_NOT_FOUND",j}var ee=G[W];return t(ee)})}v.keys=function(){return Object.keys(G)},v.id=85674,ie.exports=v},10131:function(ie,Q,t){var G={"./editorBaseApi":[20927],"./editorBaseApi.js":[20927],"./editorSimpleWorker":[81465],"./editorSimpleWorker.js":[81465],"./editorWorker":[85215],"./editorWorker.js":[85215],"./editorWorkerHost":[98008],"./editorWorkerHost.js":[98008],"./findSectionHeaders":[72846],"./findSectionHeaders.js":[72846],"./getIconClasses":[22016],"./getIconClasses.js":[22016],"./languageFeatureDebounce":[88191],"./languageFeatureDebounce.js":[88191],"./languageFeatures":[71922],"./languageFeatures.js":[71922],"./languageFeaturesService":[7421],"./languageFeaturesService.js":[7421],"./languageService":[81032],"./languageService.js":[81032],"./languagesAssociations":[73536],"./languagesAssociations.js":[73536],"./languagesRegistry":[4765],"./languagesRegistry.js":[4765],"./markerDecorations":[36357],"./markerDecorations.js":[36357],"./markerDecorationsService":[86036],"./markerDecorationsService.js":[86036],"./model":[73733],"./model.js":[73733],"./modelService":[51200],"./modelService.js":[51200],"./resolverService":[88216],"./resolverService.js":[88216],"./semanticTokensDto":[14704],"./semanticTokensDto.js":[14704],"./semanticTokensProviderStyling":[92294],"./semanticTokensProviderStyling.js":[92294],"./semanticTokensStyling":[73343],"./semanticTokensStyling.js":[73343],"./semanticTokensStylingService":[84146],"./semanticTokensStylingService.js":[84146],"./textModelSync/textModelSync.impl":[28944],"./textModelSync/textModelSync.impl.js":[28944],"./textModelSync/textModelSync.protocol":[23145,3145],"./textModelSync/textModelSync.protocol.js":[23145,3145],"./textResourceConfiguration":[71765],"./textResourceConfiguration.js":[71765],"./treeSitterParserService":[28922],"./treeSitterParserService.js":[28922],"./treeViewsDnd":[80642],"./treeViewsDnd.js":[80642],"./treeViewsDndService":[58345],"./treeViewsDndService.js":[58345],"./unicodeTextModelHighlighter":[31446],"./unicodeTextModelHighlighter.js":[31446]};function v(W){if(!t.o(G,W))return Promise.resolve().then(function(){var h=new Error("Cannot find module '"+W+"'");throw h.code="MODULE_NOT_FOUND",h});var j=G[W],ee=j[0];return Promise.all(j.slice(1).map(t.e)).then(function(){return t(ee)})}v.keys=function(){return Object.keys(G)},v.id=10131,ie.exports=v}}]); | |||
There was a problem hiding this comment.
issue (code-quality): Use const or let instead of var. (avoid-using-var)
Explanation
`const` is preferred as it ensures you cannot reassign references (which can lead to buggy and confusing code). `let` may be used if you need to reassign references - it's preferred to `var` because it is block- rather than function-scoped.From the Airbnb JavaScript Style Guide
Thank you for your contribution to CloudRec!
What About:
java)go)opa)Description:
fix: 调整数据库表结构格式、前端字段初始值、默认用户初始化设置为admin角色
chore: 更新静态资源文件
Summary by Sourcery
Enhancements: