skyline-console/skyline_console/static/compute.bundle.1663167892.js
zhangjingwei 49dca85560 feat: update dist for rc1 release
1. Update dist for rc1 release
2. Update version in the package.json

Change-Id: Iaf7c0f5261f0e89b7a38acc1d2be5482bc2384a2
2022-09-14 23:08:02 +08:00

1 line
288 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

(window.webpackJsonp=window.webpackJsonp||[]).push([[6],{1225:function(e,t,a){"use strict";var r=a(33),i=a(44),n=a(32),l=a(25),o=a(27),s=a(45),u=a(46),d=a(19),c=a(21);d(t,"__esModule",{value:!0}),t.default=t.IronicStore=void 0;var f,p,m,h,v=c(a(65)),g=c(a(27)),y=c(a(32)),b=c(a(588)),_=c(a(25)),S=c(a(62)),M=c(a(51)),I=c(a(71)),x=c(a(36)),A=c(a(54)),w=(c(a(72)),a(34)),N=c(a(48)),C=c(a(53));function P(e,t){var a=r(e);if(i){var o=i(e);t&&(o=n(o).call(o,(function(t){return l(e,t).enumerable}))),a.push.apply(a,o)}return a}var k=(f=class extends C.default{constructor(){super(...arguments),(0,I.default)(this,"bootDevice",p,this),(0,I.default)(this,"supportedBootDevices",m,this),(0,I.default)(this,"traits",h,this)}get client(){return N.default.ironic.nodes}get portClient(){return N.default.ironic.ports}get traitClient(){return N.default.placement.traits}get listWithDetail(){return!0}detailDidFetch(e,t,a){var r=this;return(0,M.default)((function*(){if(a.onlyDetail)return e;var{uuid:t}=e,i=function(e){for(var t=1;t<arguments.length;t++){var a,r=null!=arguments[t]?arguments[t]:{};if(t%2)o(a=P(Object(r),!0)).call(a,(function(t){(0,x.default)(e,t,r[t])}));else if(s)u(e,s(r));else{var i;o(i=P(Object(r))).call(i,(function(t){d(e,t,l(r,t))}))}}return e}({},e),[n,c,f,p]=yield v.default.all([r.getBootDevice(t),r.client.states.list(t),r.client.validate.list(t),r.client.ports.list(t)]);return i.bootDevice=n,i.states=c,i.validate=f,i.portsNew=p.ports,i}))()}listDidFetch(e){var t=this;return(0,M.default)((function*(){if(0===e.length)return e;var a=yield t.portClient.listDetail(),{ports:r}=a;return(0,g.default)(e).call(e,(e=>{var t=(0,y.default)(r).call(r,(t=>t.node_uuid===e.uuid));e.portCount=t.length})),e}))()}changeProvision(e,t){return this.submitting(this.client.updateStatesProvision(e,t))}changePower(e,t){return this.submitting(this.client.UpdateStatesPower(e,t))}setMaintenance(e,t){return this.submitting(this.client.updateMaintenance(e,t))}clearMaintenance(e){return this.submitting(this.client.deleteMaintenance(e))}getBootDevice(e){var t=this;return(0,M.default)((function*(){try{var a=yield t.submitting(t.client.getManagementBootDevice(e));return t.bootDevice=a,a}catch(e){return null}}))()}getSupportedBootDevice(e){var t=this;return(0,M.default)((function*(){var a=yield t.submitting(t.client.getManagementBootDeviceSupported(e));return t.supportedBootDevices=a.supported_boot_devices||[],t.supportedBootDevices}))()}setBootDevice(e,t){return this.submitting(this.client.updateManagementBootDevice(e,t))}create(e){var t=this;return(0,M.default)((function*(){var{traits:a=[]}=e,r=(0,S.default)(e,["traits"]);if(0===a.length)return t.submitting(t.client.create(r));t.isLoading=!0;var i=yield t.client.create(r),{uuid:n}=i;return t.updateTraits(n,a)}))()}edit(e,t){var{id:a}=e;return this.submitting(this.client.patch(a,t))}getTraits(){var e=this;return(0,M.default)((function*(){var t=yield e.traitClient.list(),{traits:a=[]}=t;(0,b.default)(a).call(a),e.traits=a}))()}updateTraits(e,t){var a={traits:t};return this.submitting(this.client.updateTraits(e,a))}},p=(0,A.default)(f.prototype,"bootDevice",[w.observable],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return null}}),m=(0,A.default)(f.prototype,"supportedBootDevices",[w.observable],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return[]}}),h=(0,A.default)(f.prototype,"traits",[w.observable],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return[]}}),(0,A.default)(f.prototype,"changeProvision",[w.action],(0,_.default)(f.prototype,"changeProvision"),f.prototype),(0,A.default)(f.prototype,"changePower",[w.action],(0,_.default)(f.prototype,"changePower"),f.prototype),(0,A.default)(f.prototype,"setMaintenance",[w.action],(0,_.default)(f.prototype,"setMaintenance"),f.prototype),(0,A.default)(f.prototype,"clearMaintenance",[w.action],(0,_.default)(f.prototype,"clearMaintenance"),f.prototype),(0,A.default)(f.prototype,"getBootDevice",[w.action],(0,_.default)(f.prototype,"getBootDevice"),f.prototype),(0,A.default)(f.prototype,"getSupportedBootDevice",[w.action],(0,_.default)(f.prototype,"getSupportedBootDevice"),f.prototype),(0,A.default)(f.prototype,"setBootDevice",[w.action],(0,_.default)(f.prototype,"setBootDevice"),f.prototype),(0,A.default)(f.prototype,"create",[w.action],(0,_.default)(f.prototype,"create"),f.prototype),(0,A.default)(f.prototype,"edit",[w.action],(0,_.default)(f.prototype,"edit"),f.prototype),(0,A.default)(f.prototype,"getTraits",[w.action],(0,_.default)(f.prototype,"getTraits"),f.prototype),(0,A.default)(f.prototype,"updateTraits",[w.action],(0,_.default)(f.prototype,"updateTraits"),f.prototype),f);t.IronicStore=k;var j=new k;t.default=j},1277:function(e,a,r){"use strict";var i=r(33),n=r(44),l=r(32),o=r(25),s=r(27),u=r(45),d=r(46),c=r(19),f=r(21);c(a,"__esModule",{value:!0}),a.default=a.StepCreate=void 0;var p=f(r(102)),m=f(r(27)),h=f(r(65)),v=f(r(200)),g=f(r(1204)),y=f(r(81)),b=f(r(36)),_=r(406),S=r(1193),M=f(r(1218)),I=r(1213),x=r(341),A=f(r(3614)),w=f(r(3615));function N(e,t){var a=i(e);if(n){var r=n(e);t&&(r=l(r).call(r,(function(t){return o(e,t).enumerable}))),a.push.apply(a,r)}return a}class C extends S.StepAction{constructor(){super(...arguments),(0,b.default)(this,"getProperties",((e,t,a)=>{var r,i,n,l=(0,p.default)(a).call(a,(e=>"flavor_families"===e.key)),o=(0,p.default)(r=l.value).call(r,(t=>t.architecture===e)),s=(0,p.default)(i=o.categories).call(i,(e=>e.name===t)),u={};return(0,m.default)(n=s.properties||[]).call(n,(e=>{u[e.key]=e.value})),u})),(0,b.default)(this,"onSubmit",(e=>{var{body:t,extraSpecs:a,accessControl:r}=e;return this.store.create(t,a,r)}))}static allowed(){return h.default.resolve(!0)}get tab(){var e,t=(0,x.parse)((0,v.default)(e=this.routing.location.search).call(e,1)),{tab:a}=t;return a}get listUrl(){var{architecture:e}=(0,g.default)(this)||{},t=e||this.tab;return this.getRoutePath("flavor",null,{tab:t})}get name(){return t("create flavor")}get hasConfirmStep(){return!1}init(){this.store=M.default}get steps(){return[{title:t("Params Setting"),component:w.default},{title:t("Access Type Setting"),component:A.default}]}getPageSizeValue(e,t){return"custom"===e?t:e}getSubmitData(e){var{architecture:t,category:a,name:r,vcpus:i,memoryGb:n,bandwidth:l,iops:f,ephemeral:p,gpuType:h,gpuNumber:v,numaNodesNum:g,memPageSizeValueMore:_,memPageSizeValue:S,memPageSizeMore:M,attachUsb:x,usbType:A,usbNumber:w,numaNodes:C,cpuPolicy:P,cpuThreadPolicy:k,memPageSize:j,settings:T=[],accessType:D,accessControl:z={},resourceProps:L,traitProps:E,disk:O}=e,R={name:r,vcpus:i,ram:1024*n,disk:O||0},V="public"===D;R["os-flavor-access:is_public"]=V,(0,I.categoryHasEphemeral)(a)&&(R["OS-FLV-EXT-DATA:ephemeral"]=p);var F=function(e){for(var t=1;t<arguments.length;t++){var a,r=null!=arguments[t]?arguments[t]:{};if(t%2)s(a=N(Object(r),!0)).call(a,(function(t){(0,b.default)(e,t,r[t])}));else if(u)d(e,u(r));else{var i;s(i=N(Object(r))).call(i,(function(t){c(e,t,o(r,t))}))}}return e}({":architecture":t,":category":a},this.getProperties(t,a,T));l&&(F["quota:vif_outbound_average"]=1e3*l*125,F["quota:vif_inbound_average"]=1e3*l*125),(0,I.categoryHasIOPS)(a)&&f&&(F["quota:disk_total_iops_sec"]=f);var G,B,U,Y,H,q=(0,I.isGpuCategory)(a),K=(0,I.isGpuVisual)(a),Q=q&&!K;x&&(F["pci_passthrough:alias"]=(0,y.default)(G="".concat(A,":")).call(G,w));Q?F["pci_passthrough:alias"]=x?(0,y.default)(B=(0,y.default)(U=(0,y.default)(Y="".concat(h,":")).call(Y,v,",")).call(U,A,":")).call(B,w):(0,y.default)(H="".concat(h,":")).call(H,v):K&&(F["resources:VGPU"]=v);return(0,I.isComputeOptimized)(a)?(F["hw:numa_nodes"]=C.length,(0,m.default)(C).call(C,((e,t)=>{F["hw:numa_cpus.".concat(t)]=e.value.cpu,F["hw:numa_mem.".concat(t)]=e.value.ram})),F["hw:cpu_policy"]=P,F["hw:cpu_thread_policy"]=k,F["hw:mem_page_size"]=this.getPageSizeValue(j,S)):"bare_metal"!==t&&(F["hw:numa_nodes"]=g,F["hw:mem_page_size"]=this.getPageSizeValue(M,_)),(0,I.isBareMetal)(t)&&((0,m.default)(L).call(L,(e=>{var{key:t,value:a}=e.value;F["resources:".concat(t)]=a})),(0,m.default)(E).call(E,(e=>{var{value:t}=e;F["trait:".concat(t)]="required"}))),{body:R,extraSpecs:F,accessControl:!V&&(z.selectedRowKeys||[])}}}a.StepCreate=C,(0,b.default)(C,"id","flavor-create"),(0,b.default)(C,"title",t("Create Flavor")),(0,b.default)(C,"path","/compute/flavor-admin/create"),(0,b.default)(C,"policy","os_compute_api:os-flavor-manage:create");var P=(0,_.inject)("rootStore")((0,_.observer)(C));a.default=P},1278:function(e,a,r){"use strict";var i=r(19),n=r(21);i(a,"__esModule",{value:!0}),a.default=void 0;var l=n(r(36)),o=r(1193),s=n(r(1218));class u extends o.ConfirmAction{constructor(){super(...arguments),(0,l.default)(this,"policy","os_compute_api:os-flavor-manage:delete"),(0,l.default)(this,"confirmContext",(e=>{var a=this.getName(e);return t("If an instance is using this flavor, deleting it will cause the instance's flavor data to be missing. Are you sure to delete {name}?",{name:a})})),(0,l.default)(this,"onSubmit",(e=>{var{id:t}=e;return s.default.delete({id:t})}))}get id(){return"delete"}get title(){return t("Delete Flavor")}get isDanger(){return!0}get buttonText(){return t("Delete")}get actionName(){return t("delete flavor")}}a.default=u},1279:function(e,a,r){"use strict";var i=r(33),n=r(44),l=r(32),o=r(25),s=r(27),u=r(45),d=r(46),c=r(19),f=r(21);c(a,"__esModule",{value:!0}),a.default=a.ManageAccess=void 0;var p=f(r(65)),m=f(r(32)),h=f(r(90)),v=f(r(57)),g=f(r(51)),y=f(r(36)),b=r(406),_=f(r(1218)),S=r(1193),M=r(407),I=r(1235);function x(e,t){var a=i(e);if(n){var r=n(e);t&&(r=l(r).call(r,(function(t){return o(e,t).enumerable}))),a.push.apply(a,r)}return a}function A(e){for(var t=1;t<arguments.length;t++){var a,r=null!=arguments[t]?arguments[t]:{};if(t%2)s(a=x(Object(r),!0)).call(a,(function(t){(0,y.default)(e,t,r[t])}));else if(u)d(e,u(r));else{var i;s(i=x(Object(r))).call(i,(function(t){c(e,t,o(r,t))}))}}return e}class w extends S.ModalAction{constructor(){super(...arguments),(0,y.default)(this,"onSubmit",(e=>{var t,{access:a}=e;if(!a)return p.default.resolve();var{selectedRowKeys:r}=a,{id:i}=this.item,n=(0,m.default)(r).call(r,(e=>{var t;return(0,h.default)(t=this.currentAccess).call(t,e)<0})),l=(0,m.default)(t=this.currentAccess).call(t,(e=>(0,h.default)(r).call(r,e)<0));return _.default.updateAccess(i,n,l)}))}init(){this.store=_.default,this.projectStore=new M.ProjectStore,this.getAccess(),this.getProjects()}get name(){return t("Manage Access")}static get modalSize(){return"large"}getModalSize(){return"large"}getAccess(){var e=this;return(0,g.default)((function*(){yield e.store.fetchAccess(e.item.id),e.updateDefaultValue()}))()}getProjects(){var e=this;return(0,g.default)((function*(){yield e.projectStore.fetchList(),e.updateDefaultValue()}))()}get projects(){return this.projectStore.list.data||[]}get defaultValue(){var{name:e}=this.item;return{name:e,access:{selectedRowKeys:this.currentAccess}}}get currentAccess(){var e;return(0,v.default)(e=this.store.access||[]).call(e,(e=>e.tenant_id))}get formItems(){return[{name:"name",label:t("Flavor Name"),type:"label",iconType:"flavor"},A({name:"access",label:t("Access Control"),type:"select-table",isMulti:!0,required:!0,isLoading:this.projectStore.list.isLoading,data:this.projects},I.projectTableOptions)]}}a.ManageAccess=w,(0,y.default)(w,"id","manage-access"),(0,y.default)(w,"title",t("Manage Access")),(0,y.default)(w,"policy",["os_compute_api:os-flavor-access","os_compute_api:os-flavor-access:add_tenant_access","os_compute_api:os-flavor-access:remove_tenant_access"]),(0,y.default)(w,"allowed",(e=>p.default.resolve(!e.is_public)));var N=(0,b.inject)("rootStore")((0,b.observer)(w));a.default=N},1280:function(e,t,a){"use strict";var r=a(19),i=a(21);r(t,"__esModule",{value:!0}),t.default=t.AggregateStore=void 0;var n,l=i(a(27)),o=i(a(65)),s=i(a(57)),u=i(a(25)),d=i(a(54)),c=a(34),f=i(a(48)),p=i(a(53)),m=(n=class extends p.default{get client(){return f.default.nova.aggregates}manageHost(e){var{adds:t,dels:a,id:r}=e,i=[];return(0,l.default)(t).call(t,(e=>{var t={add_host:{host:e}};i.push(t)})),(0,l.default)(a).call(a,(e=>{var t={remove_host:{host:e}};i.push(t)})),this.submitting(o.default.all((0,s.default)(i).call(i,(e=>this.client.action(r,e)))))}manageMetadata(e){var{id:t,metadata:a}=e,r={set_metadata:{metadata:a}};return this.submitting(this.client.action(t,r))}},(0,d.default)(n.prototype,"manageHost",[c.action],(0,u.default)(n.prototype,"manageHost"),n.prototype),(0,d.default)(n.prototype,"manageMetadata",[c.action],(0,u.default)(n.prototype,"manageMetadata"),n.prototype),n);t.AggregateStore=m;var h=new m;t.default=h},1281:function(e,a,r){"use strict";var i=r(19),n=r(21);i(a,"__esModule",{value:!0}),a.getDifFromAddSelectValue=a.hasValue=a.canChangeStatus=a.provisioningState=a.powerState=void 0;var l=n(r(90)),o=n(r(27)),s=n(r(102)),u=n(r(81)),d=n(r(343)),c=n(r(199)),f={"power on":t("Power On"),"power off":t("Power Off"),rebooting:t("Rebooting"),"soft rebooting":t("Soft Rebooting"),"soft power off":t("Soft Power Off")};a.powerState=f;var p={enroll:t("Enroll"),manageable:t("Manageable"),active:t("Active"),available:t("Available"),"wait call-back":t("Deploy Wait"),deleting:t("Deleting"),deleted:t("Deleted"),cleaning:t("Cleaning"),"adopt failed":t("Adopt Failed"),"clean failed":t("Clean Failed"),inspecting:t("Inspecting"),"inspect failed":t("Inspect Failed"),"clean wait":t("Clean Wait"),"deploy failed":t("Deploy Failed"),deploying:t("Deploying"),error:t("Error"),rebuild:t("Rebuilt"),verifying:t("Verifying")};a.provisioningState=p;a.canChangeStatus=e=>{var t;return(0,l.default)(t=["available","active","manageable","enroll"]).call(t,e.provision_state)>=0};a.hasValue=e=>!!e||(0,d.default)(e)||!(0,c.default)(e);a.getDifFromAddSelectValue=(e,t,a)=>{var r=[],i=[],n=[];return(0,o.default)(e).call(e,(e=>{var n,{key:l,value:o}=e.value,d=(0,s.default)(t).call(t,(e=>e.value.key===l)),c={path:(0,u.default)(n="/".concat(a,"/")).call(n,l),value:o};d?d.value.value!==o&&(c.op="replace",i.push(c)):(c.op="add",r.push(c))})),(0,o.default)(t).call(t,(t=>{var{key:r}=t.value;if(!(0,s.default)(e).call(e,(e=>e.value.key===r))){var i,l=(0,u.default)(i="/".concat(a,"/")).call(i,r);n.push({op:"remove",path:l})}})),{adds:r,replaces:i,dels:n}}},1282:function(e,t,a){"use strict";var r=a(19),i=a(21);r(t,"__esModule",{value:!0}),t.default=t.IronicPortGroupStore=void 0;var n,l=i(a(25)),o=i(a(54)),s=a(34),u=i(a(48)),d=i(a(53)),c=(n=class extends d.default{get client(){return u.default.ironic.nodes.portgroups}listFetchByClient(e,t){var{id:a}=t;return this.client.listDetail(a,e)}get paramsFunc(){return()=>{}}create(e){return this.submitting(u.default.ironic.portgroups.create(e))}edit(e,t){var{id:a}=e;return this.submitting(u.default.ironic.portgroups.patch(a,t))}},(0,o.default)(n.prototype,"create",[s.action],(0,l.default)(n.prototype,"create"),n.prototype),(0,o.default)(n.prototype,"edit",[s.action],(0,l.default)(n.prototype,"edit"),n.prototype),n);t.IronicPortGroupStore=c;var f=new c;t.default=f},1332:function(e,a,r){"use strict";var i=r(33),n=r(44),l=r(32),o=r(25),s=r(27),u=r(45),d=r(46),c=r(19),f=r(160),p=r(21);c(a,"__esModule",{value:!0}),a.default=a.Instance=void 0;var m=p(r(198)),h=p(r(33)),v=p(r(57)),g=p(r(102)),y=p(r(1233)),b=p(r(81)),_=p(r(32)),S=p(r(62)),M=p(r(36)),I=p(r(0)),x=r(406),A=p(r(584)),w=p(r(1194)),N=r(1195),C=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var a=j(t);if(a&&a.has(e))return a.get(e);var r={},i=c&&o;for(var n in e)if("default"!==n&&Object.prototype.hasOwnProperty.call(e,n)){var l=i?o(e,n):null;l&&(l.get||l.set)?c(r,n,l):r[n]=e[n]}r.default=e,a&&a.set(e,r);return r}(r(408)),P=r(1397),k=p(r(1535));function j(e){if("function"!=typeof f)return null;var t=new f,a=new f;return(j=function(e){return e?a:t})(e)}function T(e,t){var a=i(e);if(n){var r=n(e);t&&(r=l(r).call(r,(function(t){return o(e,t).enumerable}))),a.push.apply(a,r)}return a}function D(e){for(var t=1;t<arguments.length;t++){var a,r=null!=arguments[t]?arguments[t]:{};if(t%2)s(a=T(Object(r),!0)).call(a,(function(t){(0,M.default)(e,t,r[t])}));else if(u)d(e,u(r));else{var i;s(i=T(Object(r))).call(i,(function(t){c(e,t,o(r,t))}))}}return e}class z extends w.default{constructor(){super(...arguments),(0,M.default)(this,"updateFetchParamsByPage",(e=>{var{id:t}=e,a=D({},(0,S.default)(e,["id"]));if(this.inHostDetailPage){var{detail:{service:{host:r}={}}={}}=this.props;a.host=r}if(this.inFlavorDetailPage){var{detail:{id:i}={}}=this.props;a.flavor_id=i}return a})),(0,M.default)(this,"updateFetchParams",(e=>{var{detail:t={}}=this.props,{members:a}=t,{id:r}=e,i=D({},(0,S.default)(e,["id"]));return this.inServerGroupDetailPage&&(i.members=a,i.isServerGroup=!0),i}))}init(){this.inDetailPage?this.inServerGroupDetailPage?this.store=new P.ServerGroupInstanceStore:this.store=new C.ServerStore:this.store=C.default,this.downloadStore=new C.ServerStore}get policy(){return this.isAdminPage?"os_compute_api:servers:index:get_all_tenants":"os_compute_api:servers:index"}get name(){return t("instances")}get inServerGroupDetailPage(){var e;return!!this.inDetailPage&&(0,m.default)(e=this.path).call(e,"server-group")}get inHostDetailPage(){var e;return!!this.inDetailPage&&(0,m.default)(e=this.path).call(e,"hypervisors")}get inFlavorDetailPage(){var e;return!!this.inDetailPage&&(0,m.default)(e=this.path).call(e,"flavor")}get isFilterByBackend(){return!this.inServerGroupDetailPage}get isSortByBackend(){return this.isFilterByBackend}get transitionStatusList(){return(0,h.default)(N.transitionStatus)}get adminPageHasProjectFilter(){return!0}get defaultSortKey(){return"created_at"}get batchActions(){var{selectedRowKeys:e=[],data:t=[]}=this.store.list,a=(0,v.default)(e).call(e,(e=>(0,g.default)(t).call(t,(t=>t.id===e)))),r=(0,y.default)(a).call(a,(e=>(0,N.isIronicInstance)(e))),i=(0,y.default)(a).call(a,(e=>!(0,N.isIronicInstance)(e)));return r?k.default.batchActionsForIronic:i?k.default.batchActions:k.default.batchActionsForOthers}getCheckboxProps(e){return{name:e.name}}getColumns(){var e=[{title:t("ID/Name"),dataIndex:"name",routeName:this.getRouteName("instanceDetail"),sortKey:"display_name"},{title:t("Project ID/Name"),dataIndex:"project_name",isHideable:!0,hidden:!this.isAdminPage,sortKey:"project_id"},{title:t("Host"),dataIndex:"host",isHideable:!0,hidden:!this.isAdminPage},{title:t("Image"),dataIndex:"image_os_distro",isHideable:!0,render:(e,t)=>I.default.createElement(A.default,{type:e,title:t.image_name}),stringify:(e,t)=>t.image_name,sorter:!1,width:80},{title:t("Fixed IP"),dataIndex:"fixed_addresses",sorter:!1,isHideable:!0,render:e=>e.length?(0,v.default)(e).call(e,(e=>I.default.createElement("div",{key:e},e))):"-",stringify:e=>e.join(",")||"-"},{title:t("Floating IP"),dataIndex:"floating_addresses",isHideable:!0,sorter:!1,render:e=>e.length?(0,v.default)(e).call(e,(e=>I.default.createElement("div",{key:e},e,I.default.createElement("br",null)))):"-",stringify:e=>e.join(",")||"-"},{title:t("Flavor"),dataIndex:"flavor",sorter:!1,isHideable:!0,render:(e,a)=>{var r;return(0,N.isIronicInstance)(a)?(0,b.default)(r="".concat(e,"(")).call(r,t("Ironic Instance"),")"):e}},{title:t("Status"),dataIndex:"status",sorter:!1,render:e=>N.instanceStatus[e&&e.toLowerCase()]||"-"},{title:t("Tags"),dataIndex:"tags",render:e=>(0,v.default)(e).call(e,((e,t)=>(0,N.SimpleTag)({tag:e,index:t}))),isHideable:!0,sorter:!1},{title:t("Locked"),dataIndex:"locked",isHideable:!0,render:N.lockRender,width:80,stringify:e=>e?t("Locked"):t("Not locked")},{title:t("Created At"),dataIndex:"created_at",isHideable:!0,valueRender:"sinceTime"}];return this.inFlavorDetailPage?(0,_.default)(e).call(e,(e=>"flavor"!==e.dataIndex)):this.inHostDetailPage?(0,_.default)(e).call(e,(e=>"host"!==e.dataIndex)):e}get actionConfigs(){var{batchActions:e}=this;return this.isAdminPage?D(D({},k.default.adminActions),{},{batchActions:e}):this.inFlavorDetailPage?D(D({},k.default.actionConfigs),{},{primaryActions:[],batchActions:e}):D(D({},k.default.actionConfigs),{},{batchActions:e})}get searchFilters(){return[{label:t("Name"),name:"name"},...this.isAdminPage?[{label:t("Project Name"),name:"project_name"}]:[],...this.isAdminPage&&!this.inHostDetailPage?[{label:t("Host"),name:"host"}]:[],N.instanceStatusFilter,{label:t("Tags"),name:"tags"}]}}a.Instance=z;var L=(0,x.inject)("rootStore")((0,x.observer)(z));a.default=L},1342:function(e,t,a){"use strict";var r=a(19),i=a(21);r(t,"__esModule",{value:!0}),t.default=t.IronicPortStore=void 0;var n,l=i(a(25)),o=i(a(54)),s=a(34),u=i(a(48)),d=i(a(53)),c=(n=class extends d.default{get client(){return u.default.ironic.ports}get nodePortsClient(){return u.default.ironic.nodes.ports}listFetchByClient(e,t){var{id:a}=t;return this.nodePortsClient.listDetail(a,e)}get paramsFunc(){return()=>{}}create(e){return this.submitting(this.client.create(e))}edit(e,t){var{id:a}=e;return this.submitting(this.client.patch(a,t))}},(0,o.default)(n.prototype,"create",[s.action],(0,l.default)(n.prototype,"create"),n.prototype),(0,o.default)(n.prototype,"edit",[s.action],(0,l.default)(n.prototype,"edit"),n.prototype),n);t.IronicPortStore=c;var f=new c;t.default=f},1406:function(e,a,r){"use strict";var i=r(33),n=r(44),l=r(32),o=r(25),s=r(27),u=r(45),d=r(46),c=r(19),f=r(21);c(a,"__esModule",{value:!0}),a.default=a.Create=void 0;var p=f(r(27)),m=f(r(33)),h=f(r(90)),v=f(r(32)),g=f(r(65)),y=f(r(51)),b=f(r(62)),_=f(r(36)),S=f(r(202)),M=f(r(559)),I=f(r(199)),x=r(406),A=r(1193),w=f(r(1225)),N=r(34),C=r(161),P=r(1281),k=f(r(3680)),j=f(r(3681)),T=f(r(3682));function D(e,t){var a=i(e);if(n){var r=n(e);t&&(r=l(r).call(r,(function(t){return o(e,t).enumerable}))),a.push.apply(a,r)}return a}class z extends A.StepAction{constructor(){var e;super(...arguments),e=this,(0,_.default)(this,"updateItemValueToArray",((e,t)=>{var a=e[t]||{};e[t]=(0,C.updateObjToAddSelectArray)(a)})),(0,_.default)(this,"updateDriverInfoValue",(e=>{var t,{driver_info:a={}}=e;(0,p.default)(t=(0,m.default)(a)).call(t,(t=>{e["driver_info_".concat(t)]=a[t]}))})),(0,_.default)(this,"updateValues",(e=>{var{custom_trait:t=[],standard_trait:a=[]}=e,r=(0,b.default)(e,["custom_trait","standard_trait"]),i=[];return(0,p.default)(t).call(t,(e=>i.push(e.value))),i.push(...a),function(e){for(var t=1;t<arguments.length;t++){var a,r=null!=arguments[t]?arguments[t]:{};if(t%2)s(a=D(Object(r),!0)).call(a,(function(t){(0,_.default)(e,t,r[t])}));else if(u)d(e,u(r));else{var i;s(i=D(Object(r))).call(i,(function(t){c(e,t,o(r,t))}))}}return e}({traits:i},r)})),(0,_.default)(this,"onSubmit",(e=>{var t=this.updateValues(e);return this.isEdit?this.submitEdit(t):this.submitCreate(t)})),(0,_.default)(this,"submitCreate",(e=>{var t,a={},r={},{more:i}=e,n=(0,b.default)(e,["more"]);return(0,p.default)(t=(0,m.default)(n)).call(t,(t=>{var i="driver_info_";if(0===(0,h.default)(t).call(t,i)){var n=t.substring(i.length);r[n]=e[t]}else if("properties"===t||"extra"===t){var l=(0,C.updateAddSelectValueToObj)(e[t]);(0,I.default)(l)||(a[t]=l)}else a[t]=e[t]})),a.driver_info=r,this.store.create(a)})),(0,_.default)(this,"getKeyPath",(e=>{var t="driver_info_";return 0===(0,h.default)(e).call(e,t)?"/driver_info/".concat(e.substring(t.length)):"/".concat(e)})),(0,_.default)(this,"submitEdit",function(){var t=(0,y.default)((function*(t){var a,r=[],i=[],n=[],{extra:l}=e.state,{properties:o,extra:s,more:u,traits:d}=t,c=(0,b.default)(t,["properties","extra","more","traits"]),{properties:f,extra:h,traits:y}=l;(0,p.default)(a=(0,m.default)(c)).call(a,(a=>{var n=t[a],o={value:n,path:e.getKeyPath(a)};if(!(0,M.default)(l,a)&&(0,P.hasValue)(n))o.op="add",r.push(o);else{var s=l[a];(0,S.default)(s,n)||!s&&!n||(o.op="replace",i.push(o))}}));var{adds:_,replaces:I,dels:x}=(0,P.getDifFromAddSelectValue)(o,f,"properties"),{adds:A,replaces:w,dels:N}=(0,P.getDifFromAddSelectValue)(s,h,"extra");r.push(...(0,v.default)(_).call(_,(e=>(0,P.hasValue)(e.value))),...(0,v.default)(A).call(A,(e=>(0,P.hasValue)(e.value)))),i.push(...(0,v.default)(I).call(I,(e=>(0,P.hasValue)(e.value))),...(0,v.default)(w).call(w,(e=>(0,P.hasValue)(e.value)))),n.push(...x,...N);var C=[...r,...i,...n];return(0,S.default)(d,y)||(yield e.store.updateTraits(e.id,d)),0===C.length?g.default.resolve():e.store.edit({id:e.id},C)}));return function(e){return t.apply(this,arguments)}}())}static allowed(){return g.default.resolve(!0)}get listUrl(){return this.getRoutePath("baremetalNode")}get name(){return this.isEdit?t("edit baremetal node"):t("create baremetal node")}get hasConfirmStep(){return!1}get hasExtraProps(){return this.isEdit}get steps(){return[{title:t("Node Info"),component:T.default},{title:t("Driver Info"),component:j.default},{title:t("Driver Interface"),component:k.default}]}get isEdit(){var{pathname:e}=this.props.location;return(0,h.default)(e).call(e,"edit")>=0}get id(){var{id:e}=this.props.match.params;return e}init(){this.store=w.default,this.getDetail()}getDetail(){var e=this;return(0,y.default)((function*(){if(e.isEdit){var t=yield e.store.fetchDetail({id:e.id,onlyDetail:!0}),a=(0,N.toJS)(t);e.updateItemValueToArray(a,"properties"),e.updateItemValueToArray(a,"extra"),e.updateDriverInfoValue(a),e.setState({extra:(0,N.toJS)(a)})}}))()}}a.Create=z,(0,_.default)(z,"id","create"),(0,_.default)(z,"title",t("Create Node")),(0,_.default)(z,"path","/compute/baremetal-node-admin/create"),(0,_.default)(z,"policy","baremetal:node:create");var L=(0,x.inject)("rootStore")((0,x.observer)(z));a.default=L},1535:function(e,a,r){"use strict";var i=r(19),n=r(21);i(a,"__esModule",{value:!0}),a.default=void 0;var l,o=n(r(81)),s=n(r(200)),u=n(r(3474)),d=n(r(3476)),c=n(r(3477)),f=n(r(1253)),p=n(r(1541)),m=n(r(3507)),h=n(r(3508)),v=n(r(3509)),g=n(r(3510)),y=n(r(3511)),b=n(r(3512)),_=n(r(3513)),S=n(r(3514)),M=n(r(3515)),I=n(r(3516)),x=n(r(3517)),A=n(r(3518)),w=n(r(1542)),N=n(r(3519)),C=n(r(3520)),P=n(r(3521)),k=n(r(3522)),j=n(r(3523)),T=n(r(3524)),D=n(r(3525)),z=n(r(3526)),L=n(r(3527)),E=n(r(3528)),O=n(r(3529)),R=n(r(3530)),V=n(r(3531)),F=n(r(3532)),G=n(r(3533)),B=n(r(3534)),U=[h.default,v.default,M.default,I.default,y.default,b.default,x.default,A.default,_.default,S.default,D.default,z.default],Y=[c.default,g.default,w.default,N.default,O.default,L.default,R.default],H=[F.default,G.default,C.default,m.default,T.default],q=[h.default,v.default,y.default,b.default,u.default],K=(0,o.default)(l=(0,s.default)(q).call(q,0,-2)).call(l,V.default),Q=(0,s.default)(q).call(q,0,-1),Z={actionConfigs:{rowActions:{firstAction:k.default,moreActions:[{title:t("Instance Status"),actions:U},{title:t("Related Resources"),actions:Y},{title:t("Backups & Snapshots"),actions:[d.default]},{title:t("Configuration Update"),actions:H},{action:j.default},{action:u.default},{action:V.default},{action:B.default}]},batchActions:q,primaryActions:[f.default,p.default]},adminActions:{rowActions:{firstAction:k.default,moreActions:[{title:t("Instance Status"),actions:U},{action:P.default},{action:E.default},{action:u.default},{action:V.default}]},batchActions:q,primaryActions:[]},batchActions:q,batchActionsForIronic:K,batchActionsForOthers:Q};a.default=Z},1536:function(e,t,a){var r=a(3475);"string"==typeof r&&(r=[[e.i,r,""]]);var i={hmr:!0,transform:undefined,insertInto:void 0};a(75)(r,i);r.locals&&(e.exports=r.locals)},1541:function(e,a,r){"use strict";var i=r(33),n=r(44),l=r(32),o=r(25),s=r(27),u=r(45),d=r(46),c=r(19),f=r(21);c(a,"__esModule",{value:!0}),a.default=a.CreateIronic=void 0;var p=f(r(65)),m=f(r(90)),h=f(r(1204)),v=f(r(57)),g=f(r(1335)),y=f(r(81));r(1239);var b=f(r(1240)),_=f(r(409));r(589);var S=f(r(590)),M=f(r(51)),I=f(r(36)),x=f(r(1537)),A=f(r(199)),w=f(r(0)),N=r(406),C=r(34),P=(r(173),r(1193)),k=f(r(408)),j=f(r(407)),T=f(r(4)),D=r(1195),z=r(76),L=f(r(1228)),E=f(r(3501)),O=f(r(3503)),R=f(r(3504)),V=f(r(3505)),F=f(r(3506));function G(e,t){var a=i(e);if(n){var r=n(e);t&&(r=l(r).call(r,(function(t){return o(e,t).enumerable}))),a.push.apply(a,r)}return a}function B(e){for(var t=1;t<arguments.length;t++){var a,r=null!=arguments[t]?arguments[t]:{};if(t%2)s(a=G(Object(r),!0)).call(a,(function(t){(0,I.default)(e,t,r[t])}));else if(u)d(e,u(r));else{var i;s(i=G(Object(r))).call(i,(function(t){c(e,t,o(r,t))}))}}return e}class U extends P.StepAction{constructor(){super(...arguments),(0,I.default)(this,"onCountChange",(e=>{var{data:a}=this.state,r=t("Quota: Project quotas sufficient resources can be created"),i="success";(0,x.default)(this.quota)&&e>this.quota&&(r=t("Quota: Insufficient quota to create resources, please adjust resource quantity or quota(left { quota }, input { input }).",{quota:this.quota,input:e}),i="error"),this.msg=r,this.setState({data:B(B({},a),{},{count:e}),status:i})})),(0,I.default)(this,"onSubmit",(e=>e?this.store.create(e):p.default.reject())),(0,I.default)(this,"onOk",(()=>{var{data:e}=this.state;this.values=e;var a=this.getSubmitData(e);this.onSubmit(a).then((()=>{this.routing.push(this.listUrl),L.default.success(this.successText)}),(e=>{var{response:{data:a}={}}=e,{forbidden:{message:r=""}={}}=a||{};r&&"string"==typeof r&&-1!==(0,m.default)(r).call(r,"Quota exceeded")?L.default.error(t("Quota exceeded")):L.default.errorWithDetail(a,this.errorText)}))}))}init(){this.store=k.default,this.projectStore=j.default,this.getQuota()}static allowed(e,t){var a,{isAdminPage:r=!1}=t,{match:i}=t||{},n=(0,m.default)(a=i.path).call(a,"/compute/server")>=0;return p.default.resolve(!n&&!r&&(0,D.canCreateIronicByEndpoint)())}getQuota(){var e=this;return(0,M.default)((function*(){yield e.projectStore.fetchProjectQuota({project_id:e.currentProjectId}),e.onCountChange(1)}))()}get quota(){var{instances:e={}}=(0,C.toJS)(this.projectStore.quota)||{},{limit:t=10,used:a=0}=e;return-1===t?1/0:t-a}get name(){return t("Create ironic instance")}get listUrl(){var{image:e,volume:t,servergroup:a}=this.locationParams;return e?this.getRoutePath("image"):t?this.getRoutePath("volume"):a?this.getRoutePath("serverGroupDetail",{id:a}):this.getRoutePath("instance")}get checkEndpoint(){return!0}get endpoint(){return(0,z.ironicOriginEndpoint)()}get hasConfirmStep(){return!1}get steps(){return[{title:t("Base Config"),component:F.default},{title:t("Network Config"),component:V.default},{title:t("System Config"),component:R.default},{title:t("Confirm Config"),component:O.default}]}get instanceName(){var e,t,{name:a,count:r=1}=(0,h.default)(this)||{};return 1===r?a:(0,v.default)(e=(0,g.default)(t=new Array(r)).call(t,r)).call(e,((e,t)=>{var r;return(0,y.default)(r="".concat(a,"-")).call(r,t+1)})).join(", ")}get successText(){return t("The creation instruction was issued successfully, instance: {name}. \n You can wait for a few seconds to follow the changes of the list data or manually refresh the data to get the final display result.",{action:this.name.toLowerCase(),name:this.instanceName})}get errorText(){var{status:e}=this.state;return"error"===e?t("Unable to create instance: insufficient quota to create resources."):this.ipBatchError?t("Unable to create instance: batch creation is not supported when specifying IP."):t("The creation instruction has been issued, please refresh to see the actual situation in the list.")}renderBadge(){var{status:e="success"}=this.state;return"success"===e?null:w.default.createElement("div",{style:{marginTop:8,marginBottom:8}},w.default.createElement(S.default,{status:e,text:this.msg}))}renderExtra(){return null}renderFooterLeft(){var{data:e}=this.state,{count:a=1}=e,r={min:1,max:100,precision:0,onChange:this.onCountChange,formatter:e=>"$ ".concat(e).replace(/\D/g,"")};return w.default.createElement("div",{style:{display:"flex",flexDirection:"column"}},w.default.createElement("div",{style:{display:"flex",alignItems:"center"}},w.default.createElement("div",{className:E.default["number-input"]},w.default.createElement("span",null,t("Count")),w.default.createElement(b.default,(0,_.default)({},r,{value:a,className:(0,T.default)(E.default.input,"instance-count")}))),this.renderExtra()),this.renderBadge())}getSubmitData(e){var{status:t}=this.state;if("error"===t)return null;var{availableZone:a,bootableVolume:r,dataDisk:i,host:n,image:l,instanceSnapshot:o,iso:s,keypair:u,loginType:d,network:c,networks:f,password:m,physicalNode:h,physicalNodeType:g,project:y,resource:b,securityGroup:_,source:S,flavor:M,systemDisk:I,userData:x="",serverGroup:A,name:w,count:N=1}=e,C=l.selectedRowKeys[0],P=!1,{selectedRows:k=[]}=_||{},j={security_groups:(0,v.default)(k).call(k,(e=>({name:e.id}))),name:w,flavorRef:M.selectedRowKeys[0],availability_zone:a.value,networks:(0,v.default)(f).call(f,(e=>{var t={uuid:e.value.network};return 1===e.value.ipType&&e.value.ip&&(t.fixed_ip=e.value.ip,P=!0),t}))};return P&&N>1?(this.ipBatchError=!0,p.default.reject()):(C&&(j.imageRef=C),"keypair"===d.value?j.key_name=u.selectedRowKeys[0]:j.adminPass=m,N>1&&(j.min_count=N,j.max_count=N,j.return_reservation_id=!0),(j.adminPass||x)&&(j.user_data=btoa((0,D.getUserData)(j.adminPass,x))),{server:j})}}a.CreateIronic=U,(0,I.default)(U,"id","ironic-create"),(0,I.default)(U,"title",t("Create Ironic Instance")),(0,I.default)(U,"path",((e,t)=>{var a,{detail:r,match:i}=t||{};return!r||(0,A.default)(r)?"/compute/ironic-instance/create":(0,m.default)(a=i.path).call(a,"/compute/server")>=0?"/compute/ironic-instance/create?servergroup=".concat(r.id):void 0})),(0,I.default)(U,"policy",["os_compute_api:servers:create","os_compute_api:os-availability-zone:list"]);var Y=(0,N.inject)("rootStore")((0,N.observer)(U));a.default=Y},1542:function(e,a,r){"use strict";var i=r(19),n=r(21);i(a,"__esModule",{value:!0}),a.default=a.AttachVolume=void 0;var l=n(r(65)),o=n(r(36)),s=n(r(111)),u=r(406),d=n(r(408)),c=n(r(140)),f=r(1193),p=r(1195),m=r(557);class h extends f.ModalAction{constructor(){super(...arguments),(0,o.default)(this,"onSubmit",(e=>{var{volume:t}=e,{id:a}=this.item,r={volumeAttachment:{volumeId:t.selectedRowKeys[0]}};return this.store.attachVolume({id:a,body:r})}))}init(){this.store=d.default}get name(){return t("Attach volume")}get isAsyncAction(){return!0}static get modalSize(){return"large"}getModalSize(){return"large"}get defaultValue(){var{name:e}=this.item;return{instance:e}}get formItems(){return[{name:"instance",label:t("Instance"),type:"label",iconType:"instance"},{name:"volume",label:t("Volume"),type:"volume-select-table",tip:m.multiTip,isMulti:!1,required:!0,serverId:this.item.id,disabledFunc:e=>"iso"===(0,s.default)(e,"origin_data.volume_image_metadata.disk_format")}]}}a.AttachVolume=h,(0,o.default)(h,"id","attach-volume"),(0,o.default)(h,"title",t("Attach Volume")),(0,o.default)(h,"policy","os_compute_api:os-volumes-attachments:create"),(0,o.default)(h,"allowed",((e,t)=>{var{isAdminPage:a}=t;return l.default.resolve(c.default.checkEndpoint("cinder")&&!a&&(0,p.allowAttachVolumeInstance)(e))}));var v=(0,u.inject)("rootStore")((0,u.observer)(h));a.default=v},1551:function(e,a,r){"use strict";var i=r(33),n=r(44),l=r(32),o=r(25),s=r(27),u=r(45),d=r(46),c=r(19),f=r(160),p=r(21);c(a,"__esModule",{value:!0}),a.default=a.Snapshots=void 0;var m=p(r(198)),h=p(r(36)),v=r(406),g=p(r(1194)),y=r(563),b=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var a=I(t);if(a&&a.has(e))return a.get(e);var r={},i=c&&o;for(var n in e)if("default"!==n&&Object.prototype.hasOwnProperty.call(e,n)){var l=i?o(e,n):null;l&&(l.get||l.set)?c(r,n,l):r[n]=e[n]}r.default=e,a&&a.set(e,r);return r}(r(1339)),_=r(334),S=r(3603),M=p(r(1552));function I(e){if("function"!=typeof f)return null;var t=new f,a=new f;return(I=function(e){return e?a:t})(e)}function x(e,t){var a=i(e);if(n){var r=n(e);t&&(r=l(r).call(r,(function(t){return o(e,t).enumerable}))),a.push.apply(a,r)}return a}function A(e){for(var t=1;t<arguments.length;t++){var a,r=null!=arguments[t]?arguments[t]:{};if(t%2)s(a=x(Object(r),!0)).call(a,(function(t){(0,h.default)(e,t,r[t])}));else if(u)d(e,u(r));else{var i;s(i=x(Object(r))).call(i,(function(t){c(e,t,o(r,t))}))}}return e}class w extends g.default{constructor(){super(...arguments),(0,h.default)(this,"updateFetchParams",(e=>A(A({},e),{},{owner:this.inDetailPage?this.props.detail.tenant_id:null}))),(0,h.default)(this,"getColumns",(()=>(0,S.getBaseSnapshotColumns)(this)))}init(){this.store=this.inDetailPage?new b.InstanceSnapshotStore:b.default,this.downloadStore=this.inDetailPage?this.store:new b.InstanceSnapshotStore}get policy(){return"get_images"}get name(){return t("instance snapshots")}get isRecycleBinDetail(){var e;return(0,m.default)(e=this.path).call(e,"recycle-bin")}get actionConfigs(){return this.isRecycleBinDetail?_.emptyActionConfig:this.isAdminPage?M.default.adminConfigs:M.default.actionConfigs}get transitionStatusList(){return y.transitionStatusList}get isFilterByBackend(){return!1}get isSortByBackend(){return!0}get defaultSortKey(){return"created_at"}get adminPageHasProjectFilter(){return!0}get projectFilterKey(){return"owner"}get currentProjectId(){return this.props.detail.tenant_id}get searchFilters(){return[{label:t("Name"),name:"name"},{label:t("Status"),name:"status",options:[{label:t("Active"),key:"active"},{label:t("Saving"),key:"saving"}]}]}}a.Snapshots=w;var N=(0,v.inject)("rootStore")((0,v.observer)(w));a.default=N},1552:function(e,t,a){"use strict";var r=a(19),i=a(21);r(t,"__esModule",{value:!0}),t.default=void 0;var n=i(a(3604)),l=i(a(3605)),o=i(a(3606)),s=i(a(3607)),u={actionConfigs:{rowActions:{firstAction:o.default,moreActions:[{action:l.default},{action:n.default},{action:s.default}]},batchActions:[s.default]},adminConfigs:{rowActions:{firstAction:o.default,moreActions:[{action:s.default}]},batchActions:[s.default]}};t.default=u},1553:function(e,a,r){"use strict";var i=r(33),n=r(44),l=r(32),o=r(25),s=r(27),u=r(45),d=r(46),c=r(19),f=r(21);c(a,"__esModule",{value:!0}),a.default=a.Image=void 0;var p=f(r(90)),m=f(r(36)),h=f(r(0)),v=r(406),g=f(r(584)),y=f(r(1194)),b=r(563),_=r(565),S=r(161),M=f(r(1554));function I(e,t){var a=i(e);if(n){var r=n(e);t&&(r=l(r).call(r,(function(t){return o(e,t).enumerable}))),a.push.apply(a,r)}return a}function x(e){for(var t=1;t<arguments.length;t++){var a,r=null!=arguments[t]?arguments[t]:{};if(t%2)s(a=I(Object(r),!0)).call(a,(function(t){(0,m.default)(e,t,r[t])}));else if(u)d(e,u(r));else{var i;s(i=I(Object(r))).call(i,(function(t){c(e,t,o(r,t))}))}}return e}class A extends y.default{constructor(){super(...arguments),(0,m.default)(this,"updateFetchParams",(e=>{if(this.isAdminPage)return x(x({},e),{},{all_projects:!0});switch(this.tab){case"public":return x(x({},e),{},{visibility:"public"});case"shared":return x(x({},e),{},{visibility:"shared"});case"project":return x(x({},e),{},{owner:this.currentProjectId});case"all":return x(x({},e),{},{all_projects:!0})}})),(0,m.default)(this,"getColumns",(()=>[{title:t("ID/Name"),dataIndex:"name",routeName:this.getRouteName("imageDetail")},{title:t("Project ID/Name"),dataIndex:"project_name",hidden:!this.isAdminPage&&"all"!==this.tab,sorter:!1},{title:t("Description"),dataIndex:"description",isHideable:!0,sorter:!1},{title:t("Use Type"),dataIndex:"usage_type",isHideable:!0,valueMap:b.imageUsage,sorter:!1},{title:t("Type"),dataIndex:"os_distro",isHideable:!0,render:e=>h.default.createElement(g.default,{type:e,title:e}),width:80,sorter:!1},{title:t("Status"),dataIndex:"status",valueMap:b.imageStatus},{title:t("Visibility"),dataIndex:"visibility",valueMap:b.imageVisibility,sorter:!1},{title:t("Disk Format"),dataIndex:"disk_format",isHideable:!0,valueMap:b.imageFormats},{title:t("Size"),dataIndex:"size",isHideable:!0,valueRender:"formatSize"},{title:t("Created At"),dataIndex:"created_at",isHideable:!0,valueRender:"sinceTime"}]))}init(){this.store=new _.ImageStore,this.downloadStore=new _.ImageStore}get policy(){return"get_images"}get name(){return t("images")}get actionConfigs(){return this.isAdminPage?M.default.actionConfigsAdmin:M.default.actionConfigs}get transitionStatusList(){return b.transitionStatusList}get isFilterByBackend(){return!1}get isSortByBackend(){return!0}get defaultSortKey(){return"created_at"}get hasTab(){return!this.isAdminPage}get tab(){if(this.isAdminPage)return null;var{tab:e="project"}=this.props;return e}get adminPageHasProjectFilter(){return!0}get projectFilterKey(){return"owner"}get searchFilters(){var e=[{label:t("Name"),name:"name"},{label:t("Status"),name:"status",options:(0,S.getOptions)(b.imageStatus)}],a=["public","shared"];return(0,p.default)(a).call(a,this.tab)<0&&e.push({label:t("Visibility"),name:"visibility",options:(0,S.getOptions)(b.imageVisibility)}),e}}a.Image=A;var w=(0,v.inject)("rootStore")((0,v.observer)(A));a.default=w},1554:function(e,t,a){"use strict";var r=a(19),i=a(21);r(t,"__esModule",{value:!0}),t.default=void 0;var n=i(a(1555)),l=i(a(3638)),o=i(a(3639)),s=i(a(3640)),u=i(a(3641)),d=i(a(3642)),c=i(a(3643)),f=i(a(3644)),p={actionConfigs:{rowActions:{firstAction:l.default,moreActions:[{action:s.default},{action:u.default},{action:d.default},{action:o.default}]},batchActions:[o.default],primaryActions:[n.default]},actionConfigsAdmin:{rowActions:{firstAction:l.default,moreActions:[{action:o.default},{action:f.default},{action:c.default}]},batchActions:[o.default],primaryActions:[n.default]}};t.default=p},1555:function(e,a,r){"use strict";var i=r(33),n=r(44),l=r(32),o=r(25),s=r(27),u=r(45),d=r(46),c=r(19),f=r(21);c(a,"__esModule",{value:!0}),a.default=a.CreateForm=void 0;var p=f(r(33)),m=f(r(3632)),h=f(r(226)),v=f(r(198)),g=f(r(65)),y=f(r(57)),b=f(r(32)),_=f(r(62)),S=f(r(36)),M=r(406),I=r(1193),x=f(r(565)),A=r(563),w=r(1213),N=r(161),C=r(407),P=r(1235);function k(e,t){var a=i(e);if(n){var r=n(e);t&&(r=l(r).call(r,(function(t){return o(e,t).enumerable}))),a.push.apply(a,r)}return a}function j(e){for(var t=1;t<arguments.length;t++){var a,r=null!=arguments[t]?arguments[t]:{};if(t%2)s(a=k(Object(r),!0)).call(a,(function(t){(0,S.default)(e,t,r[t])}));else if(u)d(e,u(r));else{var i;s(i=k(Object(r))).call(i,(function(t){c(e,t,o(r,t))}))}}return e}class T extends I.FormAction{constructor(){super(...arguments),(0,S.default)(this,"checkFileType",(e=>{var t=(0,p.default)(this.imageFormats),{name:a}=e,r=a.substring((0,m.default)(a).call(a,".")+1);return(0,h.default)(t).call(t,(e=>{var t;return(0,v.default)(t=r.toLowerCase()).call(t,e)}))})),(0,S.default)(this,"validateFile",((e,a)=>a?this.checkFileType(a)?g.default.resolve():g.default.reject(t("Please select a file with the suffix {types}",{types:(0,p.default)(this.imageFormats).join(",")})):g.default.reject(t("Please select a file")))),(0,S.default)(this,"validateURL",((e,a)=>{if(!a)return g.default.reject(t("Please enter URL!"));return/^https?:\/\/(.*)/.test(a)?g.default.resolve():g.default.reject(t('Please enter a file link starting with "http://" or "https://"!'))})),(0,S.default)(this,"onSubmit",(e=>{var{uploadType:t,file:a,url:r,visibility:i,more:n,hw_cpu_policy:l,hw_cpu_thread_policy:o,min_ram:s,owner:u,usage_type:d="common",members:c}=e,f=j({visibility:i||"private",container_format:"bare",usage_type:d},(0,_.default)(e,["uploadType","file","url","visibility","more","hw_cpu_policy","hw_cpu_thread_policy","min_ram","owner","usage_type","members"]));s&&(f.min_ram=1024*s),l!==N.NoSetValue&&(f.hw_cpu_policy=l),o!==N.NoSetValue&&(f.hw_cpu_thread_policy=o),this.isAdminPage&&(f.owner=u.selectedRowKeys[0]);var p="shared"===i?c.selectedRowKeys:[],m=this.getUploadRequestConf(),h="file"===t?a:r;return this.store.create(f,h,p,m)}))}init(){this.store=x.default,this.projectStore=new C.ProjectStore,this.getProjects()}get listUrl(){return this.getRoutePath("image")}get name(){return t("Create image")}get labelCol(){return{xs:{span:6},sm:{span:5}}}get hasRequestCancelCallback(){return!0}static allowed(){return g.default.resolve(!0)}getProjects(){this.isAdminPage&&this.projectStore.fetchList()}get projects(){return this.projectStore.list.data||[]}get defaultValue(){return{uploadType:"file",hw_qemu_guest_agent:"yes",usage_type:"common",visibility:!!this.isAdminPage&&"public",hw_cpu_policy:N.NoSetValue,hw_cpu_thread_policy:N.NoSetValue}}get imageFormats(){return this.isAdminPage?A.imageFormats:A.imageFormatsConsole}get formatList(){var e;return(0,y.default)(e=(0,p.default)(this.imageFormats)).call(e,(e=>({value:e,label:this.imageFormats[e]})))}get osList(){var e;return(0,y.default)(e=(0,p.default)(A.imageOS)).call(e,(e=>({value:e,label:A.imageOS[e]})))}get yesNoList(){return[{value:"yes",label:t("Yes")},{value:"no",label:t("No")}]}get useTypeList(){var e,t;return(0,b.default)(e=(0,y.default)(t=(0,p.default)(A.imageUsage)).call(t,(e=>({value:e,label:A.imageUsage[e]})))).call(e,(e=>!!this.isAdminPage||("common"===e.value||"ironic"===e.value)))}get typeList(){return[{value:"file",label:t("Upload File")},{value:"url",label:t("File URL")}]}get formItems(){var{more:e,visibility:a,uploadType:r}=this.state,i=this.isAdminPage&&"shared"===a,n="url"===r;return[{name:"name",label:t("Name"),type:"input-name",isImage:!0,required:!0},j({name:"owner",label:t("Owned Project"),type:"select-table",required:this.isAdminPage,hidden:!this.isAdminPage,data:this.projects,isLoading:this.projectStore.list.isLoading},P.projectTableOptions),{name:"uploadType",label:t("Upload Type"),type:"radio",options:this.typeList},{name:"file",label:t("File"),type:"upload",validator:this.validateFile,required:!n,hidden:n},{name:"url",label:t("File URL"),type:"input",required:n,hidden:!n,validator:this.validateURL},{name:"disk_format",label:t("Format"),type:"select",options:this.formatList,required:!0},{name:"os_distro",label:t("OS"),type:"select",options:this.osList,required:!0},{name:"os_version",label:t("OS Version"),type:"input",required:!0},{name:"os_admin_user",label:t("OS Admin"),type:"input",required:!0,extra:t("In general, administrator for Windows,root for Linux, please fill by image uploading.")},{name:"min_disk",label:t("Min System Disk (GiB)"),type:"input-int",min:0,max:500},{name:"min_ram",label:t("Min Memory (GiB)"),type:"input-int",min:0,max:500},{name:"visibility",label:t("Visibility"),type:"radio",options:(0,N.getOptions)(A.imageVisibility),hidden:!this.isAdminPage},j({name:"members",label:t("Project"),type:"select-table",required:i,isMulti:!0,hidden:!i,data:this.projects,isLoading:this.projectStore.list.isLoading},P.projectTableOptions),{name:"protected",label:t("Protected"),type:"check",content:t("Protected")},{name:"usage_type",label:t("Usage Type"),type:"select",options:this.useTypeList},{name:"description",label:t("Description"),type:"textarea",maxLength:255},{name:"more",label:t("Advanced Options"),type:"more"},{name:"hw_qemu_guest_agent",label:t("qemu_guest_agent enabled"),type:"radio",onlyRadio:!0,options:this.yesNoList,tip:t("It is recommended to install and use this agent. The instance created with this image can be used to modify the password (qemu_guest_agent needs to be installed when creating the image)."),hidden:!e},{name:"hw_cpu_policy",label:t("CPU Policy"),type:"select",options:(0,N.getOptionsWithNoSet)(w.cpuPolicyList),hidden:!e},{name:"hw_cpu_thread_policy",label:t("CPU Thread Policy"),type:"select",options:(0,N.getOptionsWithNoSet)(w.cpuThreadPolicyList),hidden:!e}]}}a.CreateForm=T,(0,S.default)(T,"id","image-create"),(0,S.default)(T,"title",t("Create Image")),(0,S.default)(T,"path",((e,t)=>{var{isAdminPage:a}=t;return a?"/compute/image-admin/create":"/compute/image/create"})),(0,S.default)(T,"policy",["add_image","upload_image"]),(0,S.default)(T,"aliasPolicy",["glance:add_image","glance:upload_image"]);var D=(0,M.inject)("rootStore")((0,M.observer)(T));a.default=D},1556:function(e,t,a){"use strict";var r=a(19),i=a(21);r(t,"__esModule",{value:!0}),t.default=void 0;var n=i(a(1539)),l=i(a(3646)),o={rowActions:{firstAction:l.default},batchActions:[l.default],primaryActions:[n.default]};t.default=o},1557:function(e,t,a){"use strict";var r=a(19),i=a(21);r(t,"__esModule",{value:!0}),t.default=void 0;var n=i(a(3650)),l=i(a(3651)),o=i(a(3652)),s={actionConfigs:{rowActions:{firstAction:l.default,moreActions:[{action:o.default}]},batchActions:[l.default],primaryActions:[n.default]},actionConfigsAdmin:{rowActions:{firstAction:l.default},batchActions:[l.default],primaryActions:[]}};t.default=s},1558:function(e,t,a){"use strict";var r=a(19),i=a(21);r(t,"__esModule",{value:!0}),t.default=void 0;var n=i(a(1559)),l=i(a(1560)),o=i(a(3673)),s=i(a(3674)),u=i(a(3675)),d=i(a(3676)),c=i(a(3677)),f=i(a(3678)),p=i(a(3679)),m=i(a(1406)),h=i(a(3683)),v=i(a(3684)),g={rowActions:{firstAction:o.default,moreActions:[{action:h.default},{action:s.default},{action:u.default},{action:v.default},{action:d.default},{action:c.default},{action:f.default},{action:n.default},{action:l.default},{action:p.default}]},batchActions:[p.default],primaryActions:[m.default]};t.default=g},1559:function(e,a,r){"use strict";var i=r(33),n=r(44),l=r(32),o=r(25),s=r(27),u=r(45),d=r(46),c=r(19),f=r(21);c(a,"__esModule",{value:!0}),a.default=a.Create=void 0;var p=f(r(102)),m=f(r(57)),h=f(r(65)),v=f(r(62)),g=f(r(36)),y=f(r(199)),b=r(406),_=f(r(1342)),S=r(1282),M=r(1193),I=r(334),x=f(r(1214)),A=r(556),w=r(161);function N(e,t){var a=i(e);if(n){var r=n(e);t&&(r=l(r).call(r,(function(t){return o(e,t).enumerable}))),a.push.apply(a,r)}return a}function C(e){for(var t=1;t<arguments.length;t++){var a,r=null!=arguments[t]?arguments[t]:{};if(t%2)s(a=N(Object(r),!0)).call(a,(function(t){(0,g.default)(e,t,r[t])}));else if(u)d(e,u(r));else{var i;s(i=N(Object(r))).call(i,(function(t){c(e,t,o(r,t))}))}}return e}class P extends M.ModalAction{constructor(){super(...arguments),(0,g.default)(this,"checkKeyValues",(e=>!!(0,y.default)(e)||!(0,p.default)(e).call(e,(e=>{var{key:t,value:a}=e.value||{};return!t||null==a})))),(0,g.default)(this,"onSubmit",(e=>{var{port_id:t,switch_id:a,switch_info:r,extra:i,node:n}=e,l=C(C({},(0,v.default)(e,["port_id","switch_id","switch_info","extra","node"])),{},{local_link_connection:{port_id:t,switch_id:a,switch_info:r},node_uuid:this.item.uuid,extra:(0,w.updateAddSelectValueToObj)(i)});return _.default.create(l)}))}init(){this.groupStore=new S.IronicPortGroupStore,this.getPortGroups()}get name(){return t("Create Port")}get messageHasItemName(){return!1}getPortGroups(){var{uuid:e}=this.item;this.groupStore.fetchList({id:e})}get defaultValue(){var{name:e,uuid:t}=this.item;return{node:e||t,pxe_enabled:!0}}get portGroups(){var e;return(0,m.default)(e=this.groupStore.list.data||[]).call(e,(e=>({value:e.uuid,label:e.name||e.uuid})))}get formItems(){return[{name:"node",label:t("Node"),type:"label",iconType:"host"},{name:"address",label:t("MAC Address"),required:!0,type:"input",validator:A.macAddressValidate},{name:"pxe_enabled",label:t("PXE Enabled"),type:"radio",options:I.yesNoOptions},{name:"portgroup_uuid",label:t("Port Group"),type:"select",options:this.portGroups},{label:t("Local Link Connection"),type:"title"},{name:"port_id",label:t("Port ID"),type:"input",tip:t("Identifier of the physical port on the switch to which nodes port is connected to")},{name:"switch_id",label:t("Switch ID"),type:"input",tip:t("Only a MAC address or an OpenFlow based datapath_id of the switch are accepted in this field")},{name:"switch_info",label:t("Switch Info"),type:"input",tip:t("an optional string field to be used to store any vendor-specific information")},{name:"physical_network",label:t("Physical Network"),type:"input",tip:t("The name of the physical network to which a port is connected")},{name:"extra",label:t("Extra Infos"),type:"add-select",itemComponent:x.default,addText:t("Add Extra Info"),validator:(e,a)=>this.checkKeyValues(a)?h.default.resolve():h.default.reject(t("Please enter complete key value!"))}]}}a.Create=P,(0,g.default)(P,"id","CreatePort"),(0,g.default)(P,"title",t("Create Port")),(0,g.default)(P,"policy","baremetal:port:create"),(0,g.default)(P,"allowed",(()=>h.default.resolve(!0)));var k=(0,b.inject)("rootStore")((0,b.observer)(P));a.default=k},1560:function(e,a,r){"use strict";var i=r(33),n=r(44),l=r(32),o=r(25),s=r(27),u=r(45),d=r(46),c=r(19),f=r(21);c(a,"__esModule",{value:!0}),a.default=a.Create=void 0;var p=f(r(102)),m=f(r(65)),h=f(r(62)),v=f(r(36)),g=f(r(199)),y=r(406),b=f(r(1282)),_=r(1193),S=r(334),M=f(r(1214)),I=r(556),x=r(161);function A(e,t){var a=i(e);if(n){var r=n(e);t&&(r=l(r).call(r,(function(t){return o(e,t).enumerable}))),a.push.apply(a,r)}return a}function w(e){for(var t=1;t<arguments.length;t++){var a,r=null!=arguments[t]?arguments[t]:{};if(t%2)s(a=A(Object(r),!0)).call(a,(function(t){(0,v.default)(e,t,r[t])}));else if(u)d(e,u(r));else{var i;s(i=A(Object(r))).call(i,(function(t){c(e,t,o(r,t))}))}}return e}class N extends _.ModalAction{constructor(){super(...arguments),(0,v.default)(this,"checkKeyValues",(e=>!!(0,g.default)(e)||!(0,p.default)(e).call(e,(e=>{var{key:t,value:a}=e.value||{};return!t||null==a})))),(0,v.default)(this,"onSubmit",(e=>{var{properties:t,extra:a,node:r}=e,i=w(w({},(0,h.default)(e,["properties","extra","node"])),{},{node_uuid:this.item.uuid,extra:(0,x.updateAddSelectValueToObj)(a),properties:(0,x.updateAddSelectValueToObj)(t)});return b.default.create(i)}))}get name(){return t("Create Port Group")}get messageHasItemName(){return!1}get defaultValue(){var{name:e,uuid:t}=this.item;return{node:e||t,standalone_ports_supported:!0}}get formItems(){return[{name:"node",label:t("Node"),type:"label",iconType:"host"},{name:"name",label:t("Name"),type:"input"},{name:"address",label:t("MAC Address"),type:"input",required:!0,validator:I.macAddressValidate},{name:"standalone_ports_supported",label:t("Stand Alone Ports Supported"),type:"radio",options:S.yesNoOptions},{name:"properties",label:t("Properties"),type:"add-select",itemComponent:M.default,addText:t("Add Property"),validator:(e,a)=>this.checkKeyValues(a)?m.default.resolve():m.default.reject(t("Please enter complete key value!"))},{name:"extra",label:t("Extra Infos"),type:"add-select",itemComponent:M.default,addText:t("Add Extra Info"),validator:(e,a)=>this.checkKeyValues(a)?m.default.resolve():m.default.reject(t("Please enter complete key value!"))}]}}a.Create=N,(0,v.default)(N,"id","CreatePort"),(0,v.default)(N,"title",t("Create Port Group")),(0,v.default)(N,"policy","baremetal:portgroup:create"),(0,v.default)(N,"allowed",(()=>m.default.resolve(!0)));var C=(0,y.inject)("rootStore")((0,y.observer)(N));a.default=C},3431:function(e,t,a){"use strict";var r=a(19),i=a(21);r(t,"__esModule",{value:!0}),t.default=void 0;var n=i(a(413)),l=i(a(3432)),o=e=>(0,n.default)(l.default,e);t.default=o},3432:function(e,t,a){"use strict";var r=a(19),i=a(21);r(t,"__esModule",{value:!0}),t.default=void 0;var n=i(a(1212)),l=i(a(567)),o=i(a(1332)),s=i(a(3536)),u=i(a(3608)),d=i(a(3628)),c=i(a(1277)),f=i(a(1253)),p=i(a(1541)),m=i(a(3631)),h=i(a(1553)),v=i(a(1555)),g=i(a(1551)),y=i(a(3645)),b=i(a(3647)),_=i(a(3649)),S=i(a(3653)),M=i(a(3654)),I=i(a(3656)),x=i(a(3662)),A=i(a(3663)),w=i(a(3672)),N=i(a(3685)),C=i(a(1406)),P="/compute",k=[{path:P,component:n.default,routes:[{path:"".concat(P,"/instance"),component:o.default,exact:!0},{path:"".concat(P,"/instance-admin"),component:o.default,exact:!0},{path:"".concat(P,"/instance/detail/:id"),component:s.default,exact:!0},{path:"".concat(P,"/instance-admin/detail/:id"),component:s.default,exact:!0},{path:"".concat(P,"/instance/create"),component:f.default,exact:!0},{path:"".concat(P,"/ironic-instance/create"),component:p.default,exact:!0},{path:"".concat(P,"/instance-snapshot"),component:g.default,exact:!0},{path:"".concat(P,"/instance-snapshot-admin"),component:g.default,exact:!0},{path:"".concat(P,"/instance-snapshot/detail/:id"),component:M.default,exact:!0},{path:"".concat(P,"/instance-snapshot-admin/detail/:id"),component:M.default,exact:!0},{path:"".concat(P,"/flavor"),component:u.default,exact:!0},{path:"".concat(P,"/flavor-admin"),component:u.default,exact:!0},{path:"".concat(P,"/flavor/detail/:id"),component:d.default,exact:!0},{path:"".concat(P,"/flavor-admin/detail/:id"),component:d.default,exact:!0},{path:"".concat(P,"/server-group"),component:_.default,exact:!0},{path:"".concat(P,"/server-group-admin"),component:_.default,exact:!0},{path:"".concat(P,"/server-group/detail/:id"),component:S.default,exact:!0},{path:"".concat(P,"/server-group-admin/detail/:id"),component:S.default,exact:!0},{path:"".concat(P,"/flavor-admin/create"),component:c.default,exact:!0},{path:"".concat(P,"/image"),component:m.default,exact:!0},{path:"".concat(P,"/image-admin"),component:h.default,exact:!0},{path:"".concat(P,"/image/create"),component:v.default,exact:!0},{path:"".concat(P,"/image-admin/create"),component:v.default,exact:!0},{path:"".concat(P,"/image/detail/:id"),component:M.default,exact:!0},{path:"".concat(P,"/image-admin/detail/:id"),component:M.default,exact:!0},{path:"".concat(P,"/keypair"),component:y.default,exact:!0},{path:"".concat(P,"/keypair/detail/:id"),component:b.default,exact:!0},{path:"".concat(P,"/hypervisors-admin"),component:I.default,exact:!0},{path:"".concat(P,"/hypervisors-admin/detail/:id"),component:x.default,exact:!0},{path:"".concat(P,"/aggregates-admin"),component:A.default,exact:!0},{path:"".concat(P,"/baremetal-node-admin"),component:w.default,exact:!0},{path:"".concat(P,"/baremetal-node-admin/detail/:id"),component:N.default,exact:!0},{path:"".concat(P,"/baremetal-node-admin/create"),component:C.default,exact:!0},{path:"".concat(P,"/baremetal-node-admin/edit/:id"),component:C.default,exact:!0},{path:"*",component:l.default}]}];t.default=k},3474:function(e,a,r){"use strict";var i=r(19),n=r(21);i(a,"__esModule",{value:!0}),a.default=void 0;var l=n(r(102)),o=n(r(1233)),s=n(r(27));r(411);var u=n(r(227)),d=n(r(1248)),c=n(r(612));r(571);var f=n(r(417)),p=n(r(36)),m=n(r(91)),h=n(r(0)),v=r(1193),g=r(1195),y=n(r(408)),b=(r(173),r(555),n(r(4))),_=n(r(1536));class S extends v.ConfirmAction{constructor(){super(...arguments),(0,p.default)(this,"policy",["os_compute_api:servers:delete","os_compute_api:os-deferred-delete:force"]),(0,p.default)(this,"isShelved",(e=>"shelved_offloaded"===e.status)),(0,p.default)(this,"hasShelvedItem",(e=>{var t=(0,m.default)(e)?e:[e];return!!(0,l.default)(t).call(t,this.isShelved)})),(0,p.default)(this,"allShelvedItem",(e=>{var t=(0,m.default)(e)?e:[e];return(0,o.default)(t).call(t,this.isShelved)})),(0,p.default)(this,"initChangeType",(e=>{if(this.allShelvedItem(e))return this.onChangeType(!0,e),void(this.initCheckedValue=!0);this.initCheckedValue=!1,this.onChangeType(!1,e)})),(0,p.default)(this,"confirmContext",(e=>{var a=this.getName(e);return this.initChangeType(e),h.default.createElement("div",null,h.default.createElement("p",{className:_.default.mb16},this.unescape(t("Are you sure to delete instance { name }? ",{name:a}))),h.default.createElement("p",{className:_.default.mb16},this.deleteTip),h.default.createElement("div",null,this.renderCheckbox(e),this.renderCheckboxTip()),this.renderExtra(e))})),(0,p.default)(this,"allowedCheckFunc",(e=>!e||(0,g.isNotLockedOrAdmin)(e,this.isAdminPage)&&!(0,g.isIronicInstance)(e))),(0,p.default)(this,"performErrorMsg",(e=>{var a=(0,m.default)(e)?e:[e],r=this.getName(a),i=t('Instance "{ name }" is locked, can not delete it.',{name:r});return a.length>1&&(i=t('Instances "{ name }" are locked, can not delete them.',{name:r})),i})),(0,p.default)(this,"onSubmit",(e=>{var{id:t,isHardDeleted:a=!1}=e||this.item,r=this.isShelved(e||this.item);return a||r?y.default.forceDelete({id:t}):y.default.delete({id:t})}))}get id(){return"SoftDelete"}get title(){return t("Delete Instance")}get isDanger(){return!0}get buttonText(){return t("Delete")}get actionName(){return t("delete instance")}get isAsyncAction(){return!0}onChangeType(e,t){(0,m.default)(t)?(0,s.default)(t).call(t,(t=>{t.isHardDeleted=e})):t.isHardDeleted=e}renderExtra(e){return this.hasShelvedItem(e)?h.default.createElement("div",{style:{color:"rgba(0, 0, 0, 0.45)"}},t("The shelved offloaded instance only supports immediate deletion")):null}renderCheckbox(e){return this.initCheckedValue?h.default.createElement(f.default,{checked:this.initCheckedValue,disabled:!0},t("Immediately delete")):h.default.createElement(f.default,{onChange:t=>{this.onChangeType(t.target.checked,e)}},t("Immediately delete"))}get deleteTip(){return t("When the computing service starts the recycling instance interval, the instance will be stored in the recycling bin after deletion, and will be retained according to the corresponding time interval. You can choose to restore it within this period. After successful recovery, the status of the instance is running and related resources remain unchanged.")}get snapshotTip(){return t("If you still want to keep the disk data, it is recommended that you create a snapshot for the disk before deleting.")}renderCheckboxTip(){var e=h.default.createElement("div",{className:_.default.tip},h.default.createElement("h4",{className:_.default["tip-title"]},h.default.createElement(c.default,{className:_.default["tip-icon"]}),t("The instance deleted immediately cannot be restored")),h.default.createElement("p",{className:(0,b.default)(_.default["tip-content"],_.default.mb16)},t("The associated floating IP, virtual adapter, volume and other resources will be automatically disassociated.")),h.default.createElement("p",{className:_.default["tip-content"]},this.snapshotTip));return h.default.createElement(u.default,{title:e,color:"white"},h.default.createElement(d.default,null))}}a.default=S},3475:function(e,t,a){(t=e.exports=a(74)(!1)).push([e.i,"/* init */\n/* specific color */\n/* border */\n/* background */\n/* shadow */\n/* font */\n/* 中号字体 */\n/* animation */\n/* size */\n/* sider */\n.index__mb16--1gP54 {\n margin-bottom: 16px;\n}\n.index__tip--1FqMU {\n color: rgba(0, 0, 0, 0.65);\n}\n.index__tip-title--FytkU {\n color: rgba(0, 0, 0, 0.85);\n font-weight: 400;\n}\n.index__tip-icon--um9uF {\n margin-right: 8px;\n color: #fedf40;\n}\n.index__tip-content--mECaD {\n margin-left: 20px;\n}\n",""]),t.locals={mb16:"index__mb16--1gP54",tip:"index__tip--1FqMU","tip-title":"index__tip-title--FytkU","tip-icon":"index__tip-icon--um9uF","tip-content":"index__tip-content--mECaD"}},3476:function(e,a,r){"use strict";var i=r(33),n=r(44),l=r(32),o=r(25),s=r(27),u=r(45),d=r(46),c=r(19),f=r(21);c(a,"__esModule",{value:!0}),a.default=a.CreateSnapshot=a.getAdd=a.getZero=a.getQuota=a.getWishes=void 0,r(572);var p=f(r(574)),m=f(r(51)),h=f(r(36)),v=f(r(174)),g=f(r(33)),y=f(r(27)),b=f(r(335)),_=f(r(1204)),S=f(r(65)),M=f(r(0)),I=r(406),x=(r(173),f(r(408))),A=r(1193),w=r(1195),N=r(1334),C=f(r(566)),P=f(r(407));function k(e,t){var a=i(e);if(n){var r=n(e);t&&(r=l(r).call(r,(function(t){return o(e,t).enumerable}))),a.push.apply(a,r)}return a}function j(e){for(var t=1;t<arguments.length;t++){var a,r=null!=arguments[t]?arguments[t]:{};if(t%2)s(a=k(Object(r),!0)).call(a,(function(t){(0,h.default)(e,t,r[t])}));else if(u)d(e,u(r));else{var i;s(i=k(Object(r))).call(i,(function(t){c(e,t,o(r,t))}))}}return e}var T=()=>{var{volumesForSnapshot:e=[]}=x.default;return e.length?{types:(0,v.default)(e).call(e,((e,t)=>{var{volume_type:a}=t;return e[a]?e[a]+=1:e[a]=1,e}),{}),total:e.length}:{total:0,types:{}}};a.getWishes=T;var D=e=>{var t,{snapshots:a={}}=e||{},{types:r={}}=T();return j({snapshotQuota:a},(0,v.default)(t=(0,g.default)(r||{})).call(t,((t,a)=>(t[a]=(e||{})["snapshots_".concat(a)]||{},t)),{}))};a.getQuota=D;var z=e=>{var a,{types:r={}}=T(),i=D(e)||{},{snapshotQuota:n={}}=i,l=[j(j({},n),{},{add:0,name:"snapshot",title:t("Volume Snapshot")})];return(0,y.default)(a=(0,g.default)(r)).call(a,(e=>{var a=i[e]||{};l.push(j(j({},a),{},{add:0,name:e,title:t("{name} type snapshots",{name:e}),type:"line"}))})),l};a.getZero=z;var L=e=>{var t,a=z(e),{types:r={},total:i=0}=T(),n=D(e)||{},{snapshotQuota:l}=n,{left:o=0}=l||{};if(-1!==o&&o<i)return a;var s=JSON.parse((0,b.default)(a));s[0].add=i;var u=!0;return(0,y.default)(t=(0,g.default)(r)).call(t,((e,t)=>{if(u){var a=n[e],{left:i=0}=a||{},l=r[e];-1!==i&&i<l?u=!1:s[t+1].add=l}})),u?s:a};a.getAdd=L;class E extends A.ModalAction{constructor(){super(...arguments),(0,h.default)(this,"onSubmit",(e=>{var{snapshot:t}=e,{id:a}=this.item;return this.store.createImage({id:a,image:t})}))}init(){this.store=x.default,this.volumeStore=new N.InstanceVolumeStore,this.volumeTypeStore=C.default,this.getQuota()}get name(){return t("create instance snapshot")}get tips(){var e=t("The instance which is boot from volume will create snapshots for each mounted volumes.");return t("A snapshot is an image which preserves the disk state of a running instance, which can be used to start a new instance.")+e}static get modalSize(){return"middle"}getModalSize(){return"middle"}get instanceName(){return(0,_.default)(this).snapshot}get isBootFromVolume(){return(0,w.isBootFromVolume)(this.item)}get showQuota(){return this.isBootFromVolume}get quotaInfo(){var{quota:e,quotaLoading:t}=this.state;return t?[]:L(e)}static get disableSubmit(){var{volumesForSnapshot:e=[]}=x.default;if(!e.length)return!1;var{cinderQuota:t}=P.default;return 0===L(t)[0].add}getQuota(){var e=this;return(0,m.default)((function*(){e.store.setVolumesForSnapshot([]),e.setState({quota:{},quotaLoading:!0});var t=[P.default.fetchProjectCinderQuota(),e.isBootFromVolume?e.volumeStore.fetchList({serverId:e.item.id}):null],[a,r]=yield S.default.all(t);e.store.setVolumesForSnapshot(r||[]),e.setState({quota:a,quotaLoading:!1,volumes:r||[]})}))()}getVolumes(){if(!this.isBootFromVolume)return null;var{volumes:e=[]}=this.state,a=[{dataIndex:"id",title:t("ID/Name"),render:(e,t)=>{var{name:a}=t;return M.default.createElement(M.default.Fragment,null,M.default.createElement("div",null,e),M.default.createElement("div",null,a||"-"))}},{dataIndex:"size",title:t("Size"),render:e=>"".concat(e,"GiB")},{dataIndex:"volume_type",title:t("Volume Type")}];return M.default.createElement(p.default,{columns:a,dataSource:e,rowKey:"id",pagination:!1})}get defaultValue(){var{name:e}=this.item;return{instance:e,snapshot:""}}get formItems(){var e=[{name:"instance",label:t("Instance"),type:"label",iconType:"instance"},{name:"snapshot",label:t("Instance Snapshot Name"),type:"input-name",isImage:!0,required:!0}];return this.isBootFromVolume&&e.push({name:"volumes",label:t("Volumes"),type:"label",content:this.getVolumes()}),e}}a.CreateSnapshot=E,(0,h.default)(E,"id","create-snapshot"),(0,h.default)(E,"title",t("Create Instance Snapshot")),(0,h.default)(E,"buttonText",t("Create Snapshot")),(0,h.default)(E,"isSnapshotReadyState",(e=>(0,w.checkStatus)(["active","shutoff","suspended"],e))),(0,h.default)(E,"policy","os_compute_api:servers:create_image"),(0,h.default)(E,"allowed",(e=>S.default.resolve(E.isSnapshotReadyState(e)&&!(0,w.isIronicInstance)(e))));var O=(0,I.inject)("rootStore")((0,I.observer)(E));a.default=O},3477:function(e,a,r){"use strict";var i=r(19),n=r(21);i(a,"__esModule",{value:!0}),a.default=a.AttachInterface=void 0;var l=n(r(65)),o=n(r(102)),s=n(r(81)),u=n(r(36)),d=n(r(0)),c=r(406),f=n(r(408)),p=r(228),m=r(414),h=r(1193),v=r(1195),g=r(556),{isIPv4:y,isIpv6:b,isIpInRangeAll:_}=g.ipValidate;class S extends h.ModalAction{constructor(){super(...arguments),(0,u.default)(this,"checkIP",((e,a)=>{if(!a||!y(a)&&!b(a))return l.default.reject(t("Please input a valid ip!"));var{allocation_pools:r}=this.state.subnet||{};if(r&&!(0,o.default)(r).call(r,(e=>_(a,e.start,e.end))))return l.default.reject(t("The ip is not within the allocated pool!"));return l.default.resolve()})),(0,u.default)(this,"disabledNetwork",(e=>!e.subnets||0===e.subnets.length)),(0,u.default)(this,"onNetworkChange",(e=>{var{selectedRowKeys:t=[]}=e;0!==t.length&&this.getSubnets(t[0])})),(0,u.default)(this,"onSubmit",(e=>{var{network:t,ip:a,ipType:r}=e,{id:i}=this.item,n={net_id:t.selectedRowKeys[0]};1===r&&(n.fixed_ips=[{ip_address:a}]);var l={interfaceAttachment:n};return this.store.addInterface({id:i,body:l})}))}init(){this.store=f.default,this.networkStore=new p.NetworkStore,this.subnetStore=new m.SubnetStore}static get modalSize(){return"large"}getModalSize(){return"large"}get name(){return t("attach interface")}get subnets(){return this.subnetStore.list.data||[]}getSubnets(e){this.subnetStore.fetchList({network_id:e})}get tips(){return d.default.createElement(d.default.Fragment,null,t("After attaching interface, you may need to login the instance to update the network interface configuration and restart the network service."),d.default.createElement("br",null),t("The port created here will be automatically deleted when detach. If you need a reusable port, please go to the Virtual Adapter page to create and attach the port to instance.")," ")}get defaultValue(){var{name:e}=this.item;return{instance:e,snapshot:"",ipType:0}}get nameForStateUpdate(){return["network","ipType","subnet"]}get ipTypeOptions(){return[{label:t("Automatically Assigned Address"),value:0},{label:t("Manually Assigned Address"),value:1}]}get formItems(){var{ipType:e,subnet:a}=this.state,r=1===e,i=a&&a.ip_version||4;return[{name:"instance",label:t("Instance"),type:"label",iconType:"instance"},{name:"network",label:t("Network"),type:"network-select-table",showExternal:!0,required:!0,disabledFunc:this.disabledNetwork,onChange:this.onNetworkChange},{name:"ipType",label:t("Set IP"),type:"radio",options:this.ipTypeOptions},{name:"subnet",label:t("Subnet"),type:"select-table",required:r,data:this.subnets,isLoading:this.subnetStore.list.isLoading,hidden:!r,isMulti:!1,filterParams:[{label:t("Name"),name:"name"}],columns:[{title:t("Name"),dataIndex:"name"},{title:t("Cidr"),dataIndex:"cidr"},{title:t("Allocation Pools"),dataIndex:"allocation_pools",render:e=>{var t;return(0,s.default)(t="".concat(e[0].start," -- ")).call(t,e[0].end)}}]},{name:"ip",label:t("Given IP"),type:"ip-input",required:1===e,hidden:1!==e,version:i,validator:this.checkIP,extra:t("Please make sure this IP address be available.")}]}}a.AttachInterface=S,(0,u.default)(S,"id","attach-interface"),(0,u.default)(S,"title",t("Attach Interface")),(0,u.default)(S,"policy","os_compute_api:os-attach-interfaces:create"),(0,u.default)(S,"allowed",((e,t)=>{var{isAdminPage:a=!1}=t;return l.default.resolve(!a&&(0,v.isActiveOrShutOff)(e)&&(0,v.isNotLocked)(e)&&(0,v.isNotDeleting)(e))}));var M=(0,c.inject)("rootStore")((0,c.observer)(S));a.default=M},3501:function(e,t,a){var r=a(3502);"string"==typeof r&&(r=[[e.i,r,""]]);var i={hmr:!0,transform:undefined,insertInto:void 0};a(75)(r,i);r.locals&&(e.exports=r.locals)},3502:function(e,t,a){(t=e.exports=a(74)(!1)).push([e.i,".index__input--n9iyF {\n margin-right: 32px;\n margin-left: 16px;\n}\n.index__number-input--2NbTH {\n min-width: 165px;\n}\n",""]),t.locals={input:"index__input--n9iyF","number-input":"index__number-input--2NbTH"}},3503:function(e,a,r){"use strict";var i=r(19),n=r(21);i(a,"__esModule",{value:!0}),a.default=a.ConfirmStep=void 0;var l=n(r(65)),o=n(r(81)),s=n(r(1538)),u=n(r(57)),d=n(r(36)),c=r(406),f=n(r(1201));class p extends f.default{constructor(){super(...arguments),(0,d.default)(this,"allowed",(()=>l.default.resolve()))}init(){}get title(){return"ConfirmStep"}get name(){return"ConfirmStep"}getFlavor(){var e,t,a,{context:r}=this.props,{flavor:i}=r,{disk:n,ram:l,vcpus:u}=i.selectedRows[0];return n?(0,o.default)(e=(0,o.default)(t="".concat(u,"VCPU/")).call(t,n,"GiB/")).call(e,(0,s.default)(l/1024,10),"GiB"):(0,o.default)(a="".concat(u,"VCPU/")).call(a,(0,s.default)(l/1024,10),"GiB")}getSourceValue(){var{context:e}=this.props,{selectedRows:t=[],selectedRowKeys:a=[]}=e.image;return t.length?t[0].name:a[0]}getVirtualLANs(){var{context:e}=this.props,{networks:t}=e;return(0,u.default)(t).call(t,(e=>{var t,a,r,{networkOption:i,subnetOption:n,ipTypeOption:l,ip:s}=e.value,u=1===l.value?n.name||n.label:"";return(0,o.default)(t=(0,o.default)(a=(0,o.default)(r="".concat(i.name||i.label," ")).call(r,l.label," ")).call(a,u," ")).call(t,1===l.value?s:"")}))}getSecurityGroups(){var{context:e}=this.props,{securityGroup:{selectedRows:t=[]}={}}=e;return(0,u.default)(t).call(t,(e=>e.name))}getLoginType(){var e,{context:t}=this.props,{loginType:a,keypair:r}=t,{value:i,label:n}=a;return(0,o.default)(e="".concat(n," ")).call(e,"keypair"===i?r.selectedRows[0].name:"")}goStep(e){var{goStep:t}=this.props;t&&t(e)}get defaultValue(){return{autoRelease:!1}}get formItems(){var{context:e}=this.props;return[{name:"confirm-count",label:t("Count"),type:"label",content:e.count||1},{name:"confirm-config",label:t("Config Overview"),type:"descriptions",title:t("Base Config"),onClick:()=>{this.goStep(0)},items:[{label:t("Available Zone"),value:e.availableZone.label},{label:t("Project"),value:e.project},{label:t("Flavor"),value:this.getFlavor()},{label:t("Image Name"),value:this.getSourceValue()}]},{type:"short-divider"},{name:"confirm-config-network",label:" ",type:"descriptions",title:t("Network Config"),onClick:()=>{this.goStep(1)},items:[{label:t("Virtual LAN"),value:this.getVirtualLANs(),span:1},{label:t("Security Group"),value:this.getSecurityGroups(),span:1}]},{type:"short-divider"},{name:"confirm-config-system",label:" ",type:"descriptions",title:t("System Config"),onClick:()=>{this.goStep(2)},items:[{label:t("Name"),value:e.name},{label:t("Login Type"),value:this.getLoginType()}]}]}}a.ConfirmStep=p;var m=(0,c.inject)("rootStore")((0,c.observer)(p));a.default=m},3504:function(e,a,r){"use strict";var i=r(33),n=r(44),l=r(32),o=r(25),s=r(27),u=r(45),d=r(46),c=r(19),f=r(21);c(a,"__esModule",{value:!0}),a.default=a.SystemStep=void 0;var p=f(r(65)),m=f(r(57)),h=f(r(36)),v=r(406),g=f(r(420)),y=f(r(1201)),b=r(556);function _(e,t){var a=i(e);if(n){var r=n(e);t&&(r=l(r).call(r,(function(t){return o(e,t).enumerable}))),a.push.apply(a,r)}return a}function S(e){for(var t=1;t<arguments.length;t++){var a,r=null!=arguments[t]?arguments[t]:{};if(t%2)s(a=_(Object(r),!0)).call(a,(function(t){(0,h.default)(e,t,r[t])}));else if(u)d(e,u(r));else{var i;s(i=_(Object(r))).call(i,(function(t){c(e,t,o(r,t))}))}}return e}class M extends y.default{constructor(){super(...arguments),(0,h.default)(this,"allowed",(()=>p.default.resolve()))}init(){this.keyPairStore=g.default,this.getKeypairs()}get title(){return"SystemStep"}get name(){return"SystemStep"}get keypairs(){var e;return(0,m.default)(e=this.keyPairStore.list.data||[]).call(e,(e=>S(S({},e),{},{key:e.name,id:e.name})))}get defaultValue(){var{context:e={}}=this.props;return{loginType:e.loginType||this.loginTypes[0],more:!1}}get loginTypes(){return[{label:t("Keypair"),value:"keypair"},{label:t("Password"),value:"password"}]}getKeypairs(){this.keyPairStore.fetchList()}get nameForStateUpdate(){return["loginType","password","confirmPassword"]}get formItems(){var{loginType:e}=this.state,a=e===this.loginTypes[1].value;return[{name:"name",label:t("Name"),type:"input-name",placeholder:t("Please input name"),isInstance:!0,required:!0},{name:"loginType",label:t("Login Type"),type:"radio",options:this.loginTypes,isWrappedValue:!0},{name:"keypair",label:t("Keypair"),type:"select-table",data:this.keypairs,isLoading:this.keyPairStore.list.isLoading,isMulti:!1,required:!a,hidden:a,tip:t("The SSH key is a way to remotely log in to the instance. The cloud platform only helps to keep the public key. Please keep your private key properly."),filterParams:[{label:t("Name"),name:"name"}],columns:[{title:t("Name"),dataIndex:"name"},{title:t("Fingerprint"),dataIndex:"fingerprint"}],selectedLabel:t("Keypair")},{name:"password",label:t("Password"),type:"input-password",required:a,hidden:!a,otherRule:(0,b.getPasswordOtherRule)("password","instance")},{name:"confirmPassword",label:t("Confirm Password"),type:"input-password",required:a,hidden:!a,otherRule:(0,b.getPasswordOtherRule)("confirmPassword","instance")}]}}a.SystemStep=M;var I=(0,v.inject)("rootStore")((0,v.observer)(M));a.default=I},3505:function(e,a,r){"use strict";var i=r(19),n=r(21);i(a,"__esModule",{value:!0}),a.default=a.NetworkStep=void 0;var l=n(r(65)),o=n(r(102)),s=n(r(57)),u=n(r(27)),d=n(r(90)),c=n(r(1233));r(333);var f=n(r(332)),p=n(r(1323)),m=n(r(51)),h=n(r(36)),v=n(r(91)),g=n(r(199)),y=n(r(0)),b=r(406),_=(r(173),r(555),r(228)),S=r(414),M=r(416),I=r(556),x=n(r(1201)),A=n(r(1383)),w=r(564),N=r(1274),C=r(558),{isIPv4:P,isIpv6:k}=I.ipValidate;class j extends x.default{constructor(){var e;super(...arguments),e=this,(0,h.default)(this,"allowed",(()=>l.default.resolve())),(0,h.default)(this,"getSubnetPromise",function(){var t=(0,m.default)((function*(t){if(!e.subnetMap[t]){var a=yield e.subnetStore.fetchList({network_id:t});e.subnetMap[t]=a}return e.subnetMap[t]}));return function(e){return t.apply(this,arguments)}}()),(0,h.default)(this,"checkNetworks",(e=>!(!(0,v.default)(e)||(0,g.default)(e)||(0,g.default)(e[0].value))&&(!(0,o.default)(e).call(e,(e=>!e.value||!e.value.network))&&!(0,o.default)(e).call(e,(e=>1===e.value.ipType&&!P(e.value.ip)&&!k(e.value.ip)))))),(0,h.default)(this,"disabledNetwork",(e=>!e.subnets||0===e.subnets.length)),(0,h.default)(this,"onNetworkChange",(e=>{var{selectedRows:t}=e;this.setState({networkSelectRows:t},(()=>{this.getSubnets()})),this.updateContext({networkSelectRows:t})}))}init(){this.networkStore=new _.NetworkStore,this.subnetStore=new S.SubnetStore,this.securityGroupStore=new M.SecurityGroupStore,this.subnetMap={}}get title(){return"NetworkStep"}get name(){return"NetworkStep"}get defaultValue(){return{networks:[]}}getSubnets(){var e=this;return(0,m.default)((function*(){var{networkSelectRows:t,networks:a=[]}=e.state,r=yield l.default.all((0,s.default)(t).call(t,(t=>e.getSubnetPromise(t.id)))),i=[];(0,u.default)(r).call(r,(e=>{i.push(...e)}));var n=[],c=(0,s.default)(t).call(t,((e,t)=>{var r=(0,o.default)(i).call(i,(t=>t.network_id===e.id)),l=(0,o.default)(a).call(a,((t,a)=>t.value.network===e.id&&(n.push(a),!0)));return l||{value:{network:e.id,subnet:r.id,networkOption:e,subnetOption:r,ipTypeOption:w.ipTypeOptions[0],ipType:0},index:t}})),f=(0,s.default)(t).call(t,(e=>e.id));(0,u.default)(a).call(a,((e,t)=>{(0,d.default)(n).call(n,t)<0&&(0,d.default)(f).call(f,e.value.network)>=0&&c.push(e)})),e.updateFormValue("networks",c),e.setState({subnets:i,initValue:c})}))()}get nameForStateUpdate(){return["networkSelect","networks"]}get formItems(){var{networkSelectRows:e=[],subnets:a,initValue:r=[]}=this.state,i=e.length>0,n=e.length&&(0,c.default)(e).call(e,(e=>e.port_security_enabled));return[{name:"networkSelect",label:t("Networks"),type:"network-select-table",disabledFunc:this.disabledNetwork,onChange:this.onNetworkChange,showExternal:!0,isMulti:!1,required:!0,header:y.default.createElement("div",null,t("Please reasonably plan the network and subnet to which the virtual network card belongs."),t(" You can go to the console to "),(0,C.getLinkRender)({key:"network",value:"".concat(t("create a new network/subnet")," > ")}))},{name:"networks",label:t("Virtual LAN"),type:"add-select",networks:e,hidden:!i,subnets:a,itemComponent:A.default,required:i,addTextTips:t("Virtual LANs"),addText:t("Add Virtual LAN"),minCount:e.length||0,optionsByIndex:!0,initValue:r,validator:(e,t)=>this.checkNetworks(t)?l.default.resolve():l.default.reject("")},{name:"ipv6",label:"IPv6",type:"label",hidden:!0,content:y.default.createElement("span",null,t("The selected VPC/ subnet does not have IPv6 enabled.")," ",y.default.createElement(f.default,{type:"link"},t("To open")," ",y.default.createElement(p.default,null))," ")},{type:"divider"},{name:"securityGroup",label:t("Security Group"),type:"select-table",tip:t("Each instance belongs to at least one security group, which needs to be specified when it is created. Instances in the same security group can communicate with each other on the network, and instances in different security groups are disconnected from the internal network by default."),backendPageStore:this.securityGroupStore,extraParams:{project_id:this.currentProjectId},required:n,hidden:!n,isMulti:!0,header:y.default.createElement("div",{style:{marginBottom:8}},t("The security group is similar to the firewall function and is used to set up network access control. "),t(" You can go to the console to "),(0,C.getLinkRender)({key:"securityGroup",value:"".concat(t("create a new security group"),"> ")}),t("Note: The security group you use will act on all virtual adapters of the instance.")),filterParams:N.securityGroupFilter,columns:N.securityGroupColumns,onRow:()=>{}}]}}a.NetworkStep=j;var T=(0,b.inject)("rootStore")((0,b.observer)(j));a.default=T},3506:function(e,a,r){"use strict";var i=r(33),n=r(44),l=r(32),o=r(25),s=r(27),u=r(45),d=r(46),c=r(19),f=r(21);c(a,"__esModule",{value:!0}),a.default=a.BaseStep=void 0;var p=f(r(65)),m=f(r(57)),h=f(r(32)),v=f(r(51)),g=f(r(36)),y=f(r(0)),b=r(406),_=r(34),S=f(r(565)),M=f(r(1262)),I=r(563),x=f(r(1201)),A=f(r(1275));function w(e,t){var a=i(e);if(n){var r=n(e);t&&(r=l(r).call(r,(function(t){return o(e,t).enumerable}))),a.push.apply(a,r)}return a}function N(e){for(var t=1;t<arguments.length;t++){var a,r=null!=arguments[t]?arguments[t]:{};if(t%2)s(a=w(Object(r),!0)).call(a,(function(t){(0,g.default)(e,t,r[t])}));else if(u)d(e,u(r));else{var i;s(i=w(Object(r))).call(i,(function(t){c(e,t,o(r,t))}))}}return e}class C extends x.default{constructor(){super(...arguments),(0,g.default)(this,"allowed",(()=>p.default.resolve())),(0,g.default)(this,"onImageTabChange",(e=>{this.setState({imageTab:e})})),(0,g.default)(this,"checkSystemDisk",((e,t)=>t.type?p.default.resolve():p.default.reject(""))),(0,g.default)(this,"onFlavorChange",(e=>{this.updateContext({flavor:e})}))}init(){this.imageStore=S.default,this.getAvailZones(),this.getImages()}get title(){return"BaseStep"}get name(){return"BaseStep"}get isStep(){return!0}get defaultValue(){var e=this.sourceTypes[0];return{systemDisk:this.defaultVolumeType,source:e,project:this.currentProjectName,dataDisk:[]}}get sourceTypes(){return[{label:t("Image"),value:"image"}]}get availableZones(){var e,t;return(0,m.default)(e=(0,h.default)(t=M.default.list.data||[]).call(t,(e=>e.zoneState.available))).call(e,(e=>({value:e.zoneName,label:e.zoneName})))}get images(){var{imageTab:e}=this.state,{image:t}=this.locationParams,a=t?[(0,_.toJS)(this.imageStore.detail)]:this.imageStore.list.data||[],r=(0,h.default)(a).call(a,(t=>!!(0,I.canImageCreateIronicInstance)(t)&&(e?(0,I.getImageOS)(t)===e:t)));return(0,m.default)(r).call(r,(e=>N(N({},e),{},{key:e.id})))}getAvailZones(){var e=this;return(0,v.default)((function*(){yield M.default.fetchListWithoutDetail(),e.availableZones.length&&e.updateFormValue("availableZone",e.availableZones[0])}))()}getImages(){var e=this;return(0,v.default)((function*(){var t,{image:a}=e.locationParams;(a?yield e.imageStore.fetchDetail({id:a}):yield e.imageStore.fetchList({all_projects:e.hasAdminRole}),a)&&e.updateFormValue("image",{selectedRowKeys:[a],selectedRows:(0,h.default)(t=e.images).call(t,(e=>e.id===a))})}))()}get systemTabs(){return(0,I.getImageSystemTabs)()}get nameForStateUpdate(){return["image","flavor"]}get formItems(){var{image:e}=this.locationParams,a=e?this.imageStore.isLoading:this.imageStore.list.isLoading;return[{name:"project",label:t("Project"),type:"label"},{name:"availableZone",label:t("Available Zone"),type:"select",placeholder:t("Please select"),isWrappedValue:!0,required:!0,options:this.availableZones,tip:t("Availability zone refers to a physical area where power and network are independent of each other in the same area. In the same region, the availability zone and the availability zone can communicate with each other in the intranet, and the available zones can achieve fault isolation.")},{type:"divider"},{name:"flavor",label:t("Specification"),type:"select-table",component:y.default.createElement(A.default,{isIronic:"true",onChange:this.onFlavorChange}),required:!0,wrapperCol:{xs:{span:24},sm:{span:18}}},{name:"image",label:t("Operating System"),type:"select-table",data:this.images,isLoading:a,required:!0,filterParams:[{label:t("Name"),name:"name"}],columns:(0,I.getImageColumns)(this),tabs:this.systemTabs,defaultTabValue:this.locationParams.os_distro||this.systemTabs[0].value,selectedLabel:t("Image"),onTabChange:this.onImageTabChange}]}}a.BaseStep=C;var P=(0,b.inject)("rootStore")((0,b.observer)(C));a.default=P},3507:function(e,a,r){"use strict";var i=r(19),n=r(21);i(a,"__esModule",{value:!0}),a.default=a.ChangePassword=void 0;var l=n(r(65)),o=n(r(36)),s=r(406),u=n(r(408)),d=r(1193),c=r(556),f=r(1195);class p extends d.ModalAction{constructor(){super(...arguments),(0,o.default)(this,"onSubmit",(e=>{var{password:t}=e,{id:a}=this.item;return this.store.changePassword({id:a,password:t})}))}init(){this.store=u.default}get name(){return t("Change password")}get tips(){return t("If OS is Linux, system will reset root password, if OS is Windows, system will reset Administrator password.")}get defaultValue(){var{name:e}=this.item;return{instance:e,snapshot:"",ipType:0}}get formItems(){return[{name:"instance",label:t("Instance"),type:"label",iconType:"instance"},{name:"password",label:t("Password"),type:"input-password",required:!0,otherRule:(0,c.getPasswordOtherRule)("password","instance")},{name:"confirmPassword",label:t("Confirm Password"),type:"input-password",dependencies:["password"],required:!0,otherRule:(0,c.getPasswordOtherRule)("confirmPassword","instance")}]}}a.ChangePassword=p,(0,o.default)(p,"id","change-password"),(0,o.default)(p,"title",t("Change Password")),(0,o.default)(p,"policy","os_compute_api:os-admin-password"),(0,o.default)(p,"isActive",(e=>(0,f.checkStatus)(["active"],e))),(0,o.default)(p,"allowed",((e,t)=>{var{isAdminPage:a}=t;return l.default.resolve(p.isActive(e)&&(0,f.isNotLockedOrAdmin)(e,a)&&!(0,f.isIronicInstance)(e))}));var m=(0,s.inject)("rootStore")((0,s.observer)(p));a.default=m},3508:function(e,a,r){"use strict";var i=r(19),n=r(21);i(a,"__esModule",{value:!0}),a.default=void 0;var l=n(r(32)),o=n(r(57)),s=n(r(36)),u=n(r(91)),d=n(r(0)),c=r(1193),f=r(1195),p=n(r(408));class m extends c.ConfirmAction{constructor(){super(...arguments),(0,s.default)(this,"policy","os_compute_api:servers:start"),(0,s.default)(this,"allowedCheckFunc",(e=>!e||this.canStart(e)&&(0,f.isNotLockedOrAdmin)(e,this.isAdminPage))),(0,s.default)(this,"performErrorMsg",(e=>{var a=(0,u.default)(e)?e:[e],r=(0,l.default)(a).call(a,(e=>!(0,f.isNotLockedOrAdmin)(e))),i=(0,l.default)(a).call(a,(e=>!this.canStart(e))),n=[];return r.length&&n.push(t('Instance "{ name }" is locked, can not start it.',{name:this.getName(r)})),i.length&&n.push(t('Instance "{ name }" status is not shutoff, can not start it.',{name:this.getName(i)})),(0,o.default)(n).call(n,(e=>d.default.createElement("p",null,e)))})),(0,s.default)(this,"onSubmit",(e=>{var{id:t}=e||this.item;return p.default.start({id:t})}))}get id(){return"start"}get title(){return t("Start Instance")}get buttonText(){return t("Start")}get actionName(){return t("start instance")}get passiveAction(){return t("be started")}get isAsyncAction(){return!0}canStart(e){return(0,f.checkStatus)(["shutdown","shutoff","crashed"],e)}}a.default=m},3509:function(e,a,r){"use strict";var i=r(19),n=r(21);i(a,"__esModule",{value:!0}),a.default=void 0;var l=n(r(32)),o=n(r(57)),s=n(r(36)),u=n(r(91)),d=n(r(0)),c=r(1193),f=r(1195),p=n(r(408));class m extends c.ConfirmAction{constructor(){super(...arguments),(0,s.default)(this,"policy","os_compute_api:servers:stop"),(0,s.default)(this,"allowedCheckFunc",(e=>!e||(0,f.isNotLockedOrAdmin)(e,this.isAdminPage)&&this.isRunning(e))),(0,s.default)(this,"performErrorMsg",(e=>{var a=(0,u.default)(e)?e:[e],r=(0,l.default)(a).call(a,(e=>!this.isRunning(e))),i=(0,l.default)(a).call(a,(e=>!(0,f.isNotLockedOrAdmin)(e,this.isAdminPage))),n=[];return r.length&&n.push(t('Instance "{ name }" status is not in active or suspended, can not stop it.',{name:this.getName(r)})),i.length&&n.push(t('Instance "{ name }" is locked, can not stop it.',{name:this.getName(i)})),(0,o.default)(n).call(n,(e=>d.default.createElement("p",null,e)))})),(0,s.default)(this,"onSubmit",(e=>{var{id:t}=e||this.item;return p.default.stop({id:t})}))}get id(){return"stop"}get title(){return t("Stop Instance")}get isDanger(){return!0}get buttonText(){return t("Stop")}get actionName(){return t("stop instance")}get passiveAction(){return t("be stopped")}get isAsyncAction(){return!0}isRunning(e){return(0,f.checkStatus)(["active"],e)}}a.default=m},3510:function(e,a,r){"use strict";var i=r(33),n=r(44),l=r(32),o=r(25),s=r(27),u=r(45),d=r(46),c=r(19),f=r(21);c(a,"__esModule",{value:!0}),a.default=a.DetachInterface=void 0;var p=f(r(57)),m=f(r(65)),h=f(r(51)),v=f(r(36)),g=f(r(0)),y=r(406),b=r(408),_=r(1193),S=r(1210),M=r(1195);function I(e,t){var a=i(e);if(n){var r=n(e);t&&(r=l(r).call(r,(function(t){return o(e,t).enumerable}))),a.push.apply(a,r)}return a}function x(e){for(var t=1;t<arguments.length;t++){var a,r=null!=arguments[t]?arguments[t]:{};if(t%2)s(a=I(Object(r),!0)).call(a,(function(t){(0,v.default)(e,t,r[t])}));else if(u)d(e,u(r));else{var i;s(i=I(Object(r))).call(i,(function(t){c(e,t,o(r,t))}))}}return e}class A extends _.ModalAction{constructor(){super(...arguments),(0,v.default)(this,"onSubmit",(e=>{var{id:t}=this.item,{interfaces:{selectedRowKeys:a=[]}}=e;return this.store.detachInterface({id:t,ports:a})}))}init(){this.store=new b.ServerStore,this.getPorts(),this.state.portLoading=!0}get name(){return t("Detach interface")}get isAsyncAction(){return!0}static get modalSize(){return"large"}getModalSize(){return"large"}get ports(){var{interfaces:e=[]}=this.store;return(0,p.default)(e).call(e,(e=>{var t,a=(0,p.default)(t=e.fixed_ips).call(t,(e=>e.ip_address)).join(",");return x(x({},e),{},{name:a,id:e.port_id})}))}getPorts(){var e=this;return(0,h.default)((function*(){yield e.store.fetchInterfaceList({id:e.item.id}),e.setState({portLoading:!1})}))()}get defaultValue(){var{name:e}=this.item;return{instance:e}}get formItems(){var{portLoading:e}=this.state;return[{name:"instance",label:t("Instance"),type:"label",iconType:"instance"},{name:"interfaces",label:t("Network Interface"),type:"select-table",required:!0,data:this.ports,isLoading:e,isMulti:!0,filterParams:[{label:t("Ip Address"),name:"name"}],columns:[{title:t("Ip Address"),dataIndex:"fixed_ips",render:e=>(0,p.default)(e).call(e,(e=>g.default.createElement("div",{key:e.ip_address},e.ip_address)))},{title:t("State"),dataIndex:"port_state",valueMap:S.portStatus},{title:t("Mac Address"),dataIndex:"mac_addr"}]}]}}a.DetachInterface=A,(0,v.default)(A,"id","detach-interface"),(0,v.default)(A,"title",t("Detach Interface")),(0,v.default)(A,"policy","os_compute_api:os-attach-interfaces:delete"),(0,v.default)(A,"hasInterfaces",(e=>e.fixed_addresses.length>0)),(0,v.default)(A,"allowed",(e=>m.default.resolve((0,M.isActiveOrShutOff)(e)&&A.hasInterfaces(e)&&(0,M.isNotLocked)(e))));var w=(0,y.inject)("rootStore")((0,y.observer)(A));a.default=w},3511:function(e,a,r){"use strict";var i=r(19),n=r(21);i(a,"__esModule",{value:!0}),a.default=void 0;var l=n(r(32)),o=n(r(57)),s=n(r(36)),u=n(r(91)),d=n(r(0)),c=r(1193),f=r(1195),p=n(r(408));class m extends c.ConfirmAction{constructor(){super(...arguments),(0,s.default)(this,"policy","os_compute_api:servers:reboot"),(0,s.default)(this,"allowedCheckFunc",(e=>!e||(0,f.isNotLockedOrAdmin)(e,this.isAdminPage)&&this.canReboot(e))),(0,s.default)(this,"performErrorMsg",(e=>{var a=(0,u.default)(e)?e:[e],r=(0,l.default)(a).call(a,(e=>!this.canReboot(e))),i=(0,l.default)(a).call(a,(e=>!(0,f.isNotLockedOrAdmin)(e,this.isAdminPage))),n=[];return r.length&&n.push(t('Instance "{ name }" status is not in active or shutoff, can not reboot it.',{name:this.getName(r)})),i.length&&n.push(t('Instance "{ name }" is locked, can not reboot it.',{name:this.getName(i)})),(0,o.default)(n).call(n,(e=>d.default.createElement("p",null,e)))})),(0,s.default)(this,"onSubmit",(e=>{var{id:t}=e||this.item;return p.default.reboot({id:t})}))}get id(){return"reboot"}get title(){return t("Reboot Instance")}get buttonText(){return t("Reboot")}get actionName(){return t("reboot instance")}get isDanger(){return!0}get passiveAction(){return t("be rebooted")}get isAsyncAction(){return!0}canReboot(e){return(0,f.checkStatus)(["active","shutoff"],e)}}a.default=m},3512:function(e,a,r){"use strict";var i=r(19),n=r(21);i(a,"__esModule",{value:!0}),a.default=void 0;var l=n(r(32)),o=n(r(57)),s=n(r(36)),u=n(r(91)),d=n(r(0)),c=r(1193),f=r(1195),p=n(r(408));class m extends c.ConfirmAction{constructor(){super(...arguments),(0,s.default)(this,"policy","os_compute_api:servers:reboot"),(0,s.default)(this,"allowedCheckFunc",(e=>!e||(0,f.isNotLockedOrAdmin)(e,this.isAdminPage)&&this.isActive(e)&&!(0,f.isIronicInstance)(e))),(0,s.default)(this,"performErrorMsg",(e=>{var a=(0,u.default)(e)?e:[e],r=(0,l.default)(a).call(a,(e=>!this.isActive(e))),i=(0,l.default)(a).call(a,(e=>!(0,f.isNotLockedOrAdmin)(e,this.isAdminPage))),n=(0,l.default)(a).call(a,(e=>(0,f.isIronicInstance)(e))),s=[];return r.length&&s.push(t('Instance "{ name }" status is not active, can not soft reboot it.',{name:this.getName(r)})),i.length&&s.push(t('Instance "{ name }" is locked, can not soft reboot it.',{name:this.getName(i)})),n.length&&s.push(t('Instance "{ name }" is ironic, can not soft reboot it.',{name:this.getName(n)})),(0,o.default)(s).call(s,(e=>d.default.createElement("p",null,e)))})),(0,s.default)(this,"onSubmit",(e=>{var{id:t}=e||this.item;return p.default.softReboot({id:t})}))}get id(){return"softReboot"}get title(){return t("Soft Reboot Instance")}get buttonText(){return t("Soft Reboot")}get actionName(){return t("soft reboot instance")}get passiveAction(){return t("be soft rebooted")}isActive(e){return(0,f.checkStatus)(["active"],e)}}a.default=m},3513:function(e,a,r){"use strict";var i=r(19),n=r(21);i(a,"__esModule",{value:!0}),a.default=void 0;var l=n(r(36)),o=n(r(91)),s=r(1193),u=r(1195),d=n(r(408));class c extends s.ConfirmAction{constructor(){super(...arguments),(0,l.default)(this,"policy","os_compute_api:os-pause-server:pause"),(0,l.default)(this,"allowedCheckFunc",(e=>!e||(0,u.isNotLocked)(e)&&this.isActive(e)&&!this.isAdminPage&&!(0,u.isIronicInstance)(e))),(0,l.default)(this,"performErrorMsg",(e=>{var a=(0,o.default)(e)?e[0]:e,r=t('You are not allowed to { action } "{ name }".',{action:this.actionName,name:a.name});return this.isActive(a)?(0,u.isNotLocked)(a)||(r=t('Instance "{ name }" is locked, can not pause it.',{name:a.name})):r=t('Instance "{ name }" status is not in active, can not pause it.',{name:a.name}),r})),(0,l.default)(this,"onSubmit",(()=>{var{id:e}=this.item;return d.default.pause({id:e})}))}get id(){return"pause"}get title(){return t("Pause Instance")}get buttonText(){return t("Pause")}get actionName(){return t("pause instance")}get isAsyncAction(){return!0}isActive(e){return(0,u.checkStatus)(["active"],e)}}a.default=c},3514:function(e,a,r){"use strict";var i=r(19),n=r(21);i(a,"__esModule",{value:!0}),a.default=void 0;var l=n(r(36)),o=n(r(91)),s=r(1193),u=r(1195),d=n(r(408));class c extends s.ConfirmAction{constructor(){super(...arguments),(0,l.default)(this,"policy","os_compute_api:os-pause-server:unpause"),(0,l.default)(this,"allowedCheckFunc",(e=>!e||(0,u.isNotLockedOrAdmin)(e,this.isAdminPage)&&this.isPaused(e))),(0,l.default)(this,"performErrorMsg",(e=>{var a=(0,o.default)(e)?e[0]:e,r=t('You are not allowed to { action } "{ name }".',{action:this.actionName,name:a.name});return this.isPaused(a)?(0,u.isNotLockedOrAdmin)(a,this.isAdminPage)||(r=t('Instance "{ name }" is locked, can not unpause it.',{name:a.name})):r=t('Instance "{ name }" status is not in paused, can not unpause it.',{name:a.name}),r})),(0,l.default)(this,"onSubmit",(()=>{var{id:e}=this.item;return d.default.unpause({id:e})}))}get id(){return"unpause"}get title(){return t("Unpause Instance")}get buttonText(){return t("Unpause")}get actionName(){return t("unpause instance")}isPaused(e){return(0,u.checkStatus)(["paused"],e)}}a.default=c},3515:function(e,a,r){"use strict";var i=r(19),n=r(21);i(a,"__esModule",{value:!0}),a.default=void 0;var l=n(r(36)),o=n(r(91)),s=r(1193),u=r(1195),d=n(r(408));class c extends s.ConfirmAction{constructor(){super(...arguments),(0,l.default)(this,"policy","os_compute_api:os-lock-server:lock"),(0,l.default)(this,"allowedCheckFunc",(e=>!e||!this.isAdminPage&&(0,u.isNotLocked)(e))),(0,l.default)(this,"performErrorMsg",(e=>{var a=(0,o.default)(e)?e[0]:e,r=t('You are not allowed to { action } "{ name }".',{action:this.actionName,name:a.name});return(0,u.isNotLocked)(a)||(r=t('Instance "{ name }" has already been locked.',{name:a.name})),r})),(0,l.default)(this,"confirmContext",(e=>{if(!this.messageHasItemName)return t("Are you sure to {action}?",{action:this.actionNameDisplay||this.title});var a=this.getName(e);return t("Are you sure to {action} (instance: {name})?",{action:this.actionNameDisplay||this.title,name:a})+t("Lock instance will lock the operations that have a direct impact on the operation of the instance, such as: shutdown, restart, delete, the mounting and unmounting of volume, etc. It does not involve the capacity expansion and change type of volume.")})),(0,l.default)(this,"onSubmit",(()=>{var{id:e}=this.item;return d.default.lock({id:e})}))}get id(){return"lock"}get title(){return t("Lock Instance")}get buttonText(){return t("Lock")}get actionName(){return t("lock instance")}}a.default=c},3516:function(e,a,r){"use strict";var i=r(19),n=r(21);i(a,"__esModule",{value:!0}),a.default=void 0;var l=n(r(36)),o=n(r(91)),s=r(1193),u=r(1195),d=n(r(408));class c extends s.ConfirmAction{constructor(){super(...arguments),(0,l.default)(this,"policy","os_compute_api:os-lock-server:unlock"),(0,l.default)(this,"allowedCheckFunc",(e=>!e||!this.isAdminPage&&(0,u.isLocked)(e))),(0,l.default)(this,"performErrorMsg",(e=>{var a=(0,o.default)(e)?e[0]:e,r=t('You are not allowed to { action } "{ name }".',{action:this.actionName,name:a.name});return(0,u.isLocked)(a)||(r=t('Instance "{ name }" is not locked, can not unlock it.',{name:a.name})),r})),(0,l.default)(this,"onSubmit",(()=>{var{id:e}=this.item;return d.default.unlock({id:e})}))}get id(){return"unlock"}get title(){return t("Unlock Instance")}get buttonText(){return t("Unlock")}get actionName(){return t("unlock instance")}}a.default=c},3517:function(e,a,r){"use strict";var i=r(19),n=r(21);i(a,"__esModule",{value:!0}),a.default=void 0;var l=n(r(36)),o=n(r(91)),s=r(1193),u=r(1195),d=n(r(408));class c extends s.ConfirmAction{constructor(){super(...arguments),(0,l.default)(this,"policy","os_compute_api:os-suspend-server:suspend"),(0,l.default)(this,"allowedCheckFunc",(e=>!e||(0,u.isNotLockedOrAdmin)(e,this.isAdminPage)&&this.isActive(e)&&!(0,u.isIronicInstance)(e))),(0,l.default)(this,"performErrorMsg",(e=>{var a=(0,o.default)(e)?e[0]:e,r=t('You are not allowed to { action } "{ name }".',{action:this.actionName,name:a.name});return this.isActive(a)?(0,u.isNotLockedOrAdmin)(a,this.isAdminPage)||(r=t('Instance "{ name }" is locked, can not suspend it.',{name:a.name})):r=t('Instance "{ name }" status is not in active, can not suspend it.',{name:a.name}),r})),(0,l.default)(this,"onSubmit",(()=>{var{id:e}=this.item;return d.default.suspend({id:e})}))}get id(){return"suspend"}get title(){return t("Suspend Instance")}get buttonText(){return t("Suspend")}get actionName(){return t("suspend instance")}get isAsyncAction(){return!0}isActive(e){return(0,u.checkStatus)(["active"],e)}}a.default=c},3518:function(e,a,r){"use strict";var i=r(19),n=r(21);i(a,"__esModule",{value:!0}),a.default=void 0;var l=n(r(36)),o=n(r(91)),s=r(1193),u=r(1195),d=n(r(408));class c extends s.ConfirmAction{constructor(){super(...arguments),(0,l.default)(this,"policy","os_compute_api:os-suspend-server:resume"),(0,l.default)(this,"allowedCheckFunc",(e=>!e||(0,u.isNotLockedOrAdmin)(e,this.isAdminPage)&&this.isSuspended(e))),(0,l.default)(this,"performErrorMsg",(e=>{var a=(0,o.default)(e)?e[0]:e,r=t('You are not allowed to { action } "{ name }".',{action:this.actionName,name:a.name});return this.isActive(a)?(0,u.isNotLockedOrAdmin)(a,this.isAdminPage)||(r=t('Instance "{ name }" is locked, can not resume it.',{name:a.name})):r=t('Instance "{ name }" status is not in suspended, can not resume it.',{name:a.name}),r})),(0,l.default)(this,"onSubmit",(()=>{var{id:e}=this.item;return d.default.resume({id:e})}))}get id(){return"resume"}get title(){return t("Resume Instance")}get buttonText(){return t("Resume")}get actionName(){return t("resume instance")}get isAsyncAction(){return!0}isSuspended(e){return(0,u.checkStatus)(["suspended"],e)}}a.default=c},3519:function(e,a,r){"use strict";var i=r(19),n=r(21);i(a,"__esModule",{value:!0}),a.default=a.DetachVolume=void 0;var l=n(r(32)),o=n(r(65)),s=n(r(36)),u=r(406),d=r(1334),c=n(r(408)),f=n(r(140)),p=r(1193),m=r(557),h=r(1195);class v extends p.ModalAction{constructor(){super(...arguments),(0,s.default)(this,"onSubmit",(e=>{var{id:t}=this.item,{volumes:{selectedRowKeys:a=[]}}=e;return this.store.detachVolume({id:t,volumes:a})}))}init(){this.store=c.default,this.volumeStore=new d.InstanceVolumeStore,this.getVolumes()}get name(){return t("Detach Volume")}static get modalSize(){return"large"}getModalSize(){return"large"}get volumes(){var e;return(0,l.default)(e=this.volumeStore.list.data||[]).call(e,(e=>!(0,m.isOsDisk)(e)))}getVolumes(){var{id:e}=this.item;this.volumeStore.fetchList({serverId:e})}get defaultValue(){var{name:e}=this.item;return{instance:e}}get formItems(){return[{name:"instance",label:t("Instance"),type:"label",iconType:"instance"},{name:"volumes",label:t("Volume"),type:"select-table",required:!0,data:this.volumes,isLoading:this.volumeStore.list.isLoading,filterParams:[{label:t("Name"),name:"name"}],columns:[{title:t("Name"),dataIndex:"name"},{title:t("Size"),dataIndex:"size",unit:"GiB"},{title:t("Status"),dataIndex:"status",valueMap:m.volumeStatus},{title:t("Type"),dataIndex:"volume_type"},{title:t("Created At"),dataIndex:"created_at",valueRender:"sinceTime"}]}]}}a.DetachVolume=v,(0,s.default)(v,"id","detach-volume"),(0,s.default)(v,"title",t("Detach Volume")),(0,s.default)(v,"policy","os_compute_api:os-volumes-attachments:delete"),(0,s.default)(v,"allowed",((e,t)=>{var{isAdminPage:a}=t;return o.default.resolve(f.default.checkEndpoint("cinder")&&!a&&(0,h.allowAttachVolumeInstance)(e))}));var g=(0,u.inject)("rootStore")((0,u.observer)(v));a.default=g},3520:function(e,a,r){"use strict";var i=r(33),n=r(44),l=r(32),o=r(25),s=r(27),u=r(45),d=r(46),c=r(19),f=r(21);c(a,"__esModule",{value:!0}),a.fetchQuota=P,a.default=a.Resize=a.getFlavorLabel=a.getQuotaInfo=a.checkFlavorDisable=a.getAdd=a.getQuota=void 0;var p=f(r(81)),m=f(r(65)),h=f(r(36)),v=f(r(51)),g=f(r(199)),y=f(r(0)),b=r(406),_=f(r(1218)),S=f(r(408)),M=r(1193),I=r(1195),x=f(r(407)),A=r(161),w=f(r(1275));function N(e,t){var a=i(e);if(n){var r=n(e);t&&(r=l(r).call(r,(function(t){return o(e,t).enumerable}))),a.push.apply(a,r)}return a}function C(e){for(var t=1;t<arguments.length;t++){var a,r=null!=arguments[t]?arguments[t]:{};if(t%2)s(a=N(Object(r),!0)).call(a,(function(t){(0,h.default)(e,t,r[t])}));else if(u)d(e,u(r));else{var i;s(i=N(Object(r))).call(i,(function(t){c(e,t,o(r,t))}))}}return e}function P(e){return k.apply(this,arguments)}function k(){return(k=(0,v.default)((function*(e){e.setState({quota:{},quotaLoading:!0});var t=yield x.default.fetchProjectNovaQuota();e.setState({quota:t,quotaLoading:!1})}))).apply(this,arguments)}var j=e=>{if((0,g.default)(e))return{};var{cores:t={},ram:a={}}=e||{};return{cores:t,ram:a}};a.getQuota=j;var T=(e,t)=>{if((0,g.default)(t))return{};var{vcpus:a,ram:r}=e.item.flavor_info||{},{vcpus:i,ram:n}=t||{};return{vcpuAdd:i-a,ramAdd:(0,A.getGiBValue)(n-r)}};a.getAdd=T;var D=(e,t)=>{var{quotaLoading:a=!0,quota:r}=t.state;if(a||(0,g.default)(r))return!1;var{cores:{left:i},ram:{left:n}}=j(r),{vcpuAdd:l,ramAdd:o}=T(t,e);return!(-1===i||i>=l)||!(-1===n||n>=o)};a.checkFlavorDisable=D;var z=e=>{var{quota:a={},quotaLoading:r,flavor:i={}}=e.state;if(r||(0,g.default)(a))return[];var{cores:n={},ram:l={}}=j(a),{vcpuAdd:o=0,ramAdd:s=0}=T(e,i||{});return[C(C({},n),{},{add:o,name:"cpu",title:t("CPU")}),C(C({},l),{},{add:s,name:"ram",title:t("Memory (GiB)"),type:"line"})]};a.getQuotaInfo=z;var L=e=>{var a,r,i,n,{flavor:l,flavor_info:{vcpus:o,ram:s}={}}=e.item;return(0,p.default)(a=(0,p.default)(r=(0,p.default)(i=(0,p.default)(n="".concat(l," (")).call(n,t("VCPUs"),": ")).call(i,o,", ")).call(r,t("Memory"),": ")).call(a,(0,A.formatSize)(s,2),")")};a.getFlavorLabel=L;class E extends M.ModalAction{constructor(){super(...arguments),(0,h.default)(this,"onFlavorChange",(e=>{var{selectedRows:t=[]}=e||{};this.setState({flavor:t[0]})})),(0,h.default)(this,"disabledFlavor",(e=>D(e,this))),(0,h.default)(this,"onSubmit",(e=>{var{id:t}=this.item,{newFlavor:a}=e,r=a.selectedRowKeys[0];return S.default.resize({id:t,flavor:r})}))}init(){this.store=_.default,P(this)}get name(){return t("resize")}static get modalSize(){return"large"}get isAsyncAction(){return!0}getModalSize(){return"large"}get tips(){return y.default.createElement("div",null,y.default.createElement("p",{style:{color:"#0068FF"}},t("The current operation requires the instance to be shut down:")),y.default.createElement("p",null,t("In order to avoid data loss, the instance will shut down and interrupt your business. Please confirm carefully.")),y.default.createElement("p",null,t("Forced shutdown may result in data loss or file system damage. You can also take the initiative to shut down and perform operations.")))}get showQuota(){return!0}get quotaInfo(){return z(this)}get defaultValue(){var{name:e}=this.item;return{instance:e,flavor:L(this)}}get formItems(){var{flavor:e}=this.item;return[{name:"instance",label:t("Instance"),type:"label",iconType:"instance"},{name:"flavor",label:t("Current Flavor"),type:"label",iconType:"flavor"},{name:"newFlavor",label:t("Flavor"),type:"select-table",component:y.default.createElement(w.default,{flavor:e,onChange:this.onFlavorChange,disabledFunc:this.disabledFlavor}),required:!0,wrapperCol:{xs:{span:24},sm:{span:18}}},{name:"option",label:t("Forced Shutdown"),type:"check",content:t("Agree to force shutdown"),required:!0}]}}a.Resize=E,(0,h.default)(E,"id","resize"),(0,h.default)(E,"title",t("Resize")),(0,h.default)(E,"isDanger",!0),(0,h.default)(E,"policy","os_compute_api:servers:resize"),(0,h.default)(E,"isActiveOrShutOff",(e=>(0,I.checkStatus)(["active","shutoff"],e,!1))),(0,h.default)(E,"allowed",((e,t)=>{var{isAdminPage:a}=t;return m.default.resolve(!E.isAdminPage&&E.isActiveOrShutOff(e)&&(0,I.isNotLockedOrAdmin)(e,a)&&!(0,I.isIronicInstance)(e))}));var O=(0,b.inject)("rootStore")((0,b.observer)(E));a.default=O},3521:function(e,a,r){"use strict";var i=r(33),n=r(44),l=r(32),o=r(25),s=r(27),u=r(45),d=r(46),c=r(19),f=r(21);c(a,"__esModule",{value:!0}),a.default=a.LiveMigrate=void 0;var p=f(r(57)),m=f(r(32)),h=f(r(65)),v=f(r(36)),g=r(406),y=f(r(408)),b=r(1193),_=r(1195),S=f(r(586)),M=r(1337);function I(e,t){var a=i(e);if(n){var r=n(e);t&&(r=l(r).call(r,(function(t){return o(e,t).enumerable}))),a.push.apply(a,r)}return a}function x(e){for(var t=1;t<arguments.length;t++){var a,r=null!=arguments[t]?arguments[t]:{};if(t%2)s(a=I(Object(r),!0)).call(a,(function(t){(0,v.default)(e,t,r[t])}));else if(u)d(e,u(r));else{var i;s(i=I(Object(r))).call(i,(function(t){c(e,t,o(r,t))}))}}return e}class A extends b.ModalAction{constructor(){super(...arguments),(0,v.default)(this,"onSubmit",(e=>{var t,{host:{selectedRows:a=[]}={}}=e,{id:r}=this.item,i=null;a.length>0&&(i={host:null===(t=a[0])||void 0===t?void 0:t.service_host});return this.store.migrate({id:r,body:i})}))}init(){this.store=y.default,this.hypervisorStore=S.default,this.getHypervisors()}get name(){return t("migrate")}static get modalSize(){return"large"}getModalSize(){return"large"}getHypervisors(){this.hypervisorStore.fetchList()}get hypervisors(){var e,t;return(0,p.default)(e=(0,m.default)(t=this.hypervisorStore.list.data||[]).call(t,(e=>"ironic"!==e.hypervisor_type))).call(e,(e=>x(x({},e),{},{key:e.id})))}get tips(){return t("Choose a host to migrate instance to. If not selected, the scheduler will auto select target host.")}get defaultValue(){var{name:e,host:t}=this.item;return{instance:e,current:t}}get formItems(){var{host:e}=this.item;return[{name:"instance",label:t("Instance"),type:"label",iconType:"instance"},{name:"current",label:t("Current Compute Host"),type:"label",iconType:"aggregate"},{name:"host",label:t("Target Compute Host"),type:"select-table",data:this.hypervisors,isLoading:this.hypervisorStore.list.isLoading,isMulti:!1,extra:t("If nova-compute on the host is disabled, it will be forbidden to be selected as the target host."),filterParams:M.hypervisorFilters,columns:M.hypervisorColumns,disabledFunc:t=>t.service_host===e||"enabled"!==t.status}]}}a.LiveMigrate=A,(0,v.default)(A,"id","migrate"),(0,v.default)(A,"title",t("Migrate")),(0,v.default)(A,"policy","os_compute_api:os-migrate-server:migrate"),(0,v.default)(A,"allowed",(e=>h.default.resolve(((0,_.isActive)(e)||(0,_.isStopped)(e))&&(0,_.isNotDeleting)(e)&&!(0,_.isIronicInstance)(e))));var w=(0,g.inject)("rootStore")((0,g.observer)(A));a.default=w},3522:function(e,a,r){"use strict";var i=r(19),n=r(21);i(a,"__esModule",{value:!0}),a.default=void 0;var l=n(r(81)),o=n(r(51)),s=n(r(36)),u=r(1193),d=n(r(408)),c=r(1195),f=n(r(234)),{getLocale:p}=f.default;class m extends u.ConfirmAction{constructor(){var e;super(...arguments),e=this,(0,s.default)(this,"policy","os_compute_api:os-remote-consoles"),(0,s.default)(this,"confirmContext",(()=>t("Are you sure to jump directly to the console? The console will open in a new page later."))),(0,s.default)(this,"allowedCheckFunc",(e=>!e||(0,c.isActive)(e)&&!(0,c.isIronicInstance)(e))),(0,s.default)(this,"performErrorMsg",(()=>t("You are not allowed to jump to the console."))),(0,s.default)(this,"onSubmit",(0,o.default)((function*(){var t,a,{id:r}=e.item,i=d.default;a=(0,c.isIronicInstance)(e.item)?yield i.getConsoleIronic({id:r}):yield i.getConsole({id:r});var{url:n}=a.remote_console,o=p();window.open((0,l.default)(t="".concat(n,"&language=")).call(t,o))})))}get id(){return"console"}get title(){return t("Jump to Console")}get buttonText(){return t("Console")}get actionName(){return t("jump to the console")}}a.default=m},3523:function(e,a,r){"use strict";var i=r(19),n=r(21);i(a,"__esModule",{value:!0}),a.default=a.Edit=void 0;var l=n(r(65)),o=n(r(36)),s=r(406),u=r(1193),d=n(r(408));class c extends u.ModalAction{constructor(){super(...arguments),(0,o.default)(this,"onSubmit",(e=>{var{name:t}=e,a={name:t},{id:r}=this.item;return d.default.edit({id:r},a)}))}init(){this.store=d.default}static allowed(){return l.default.resolve(!0)}get formItems(){return[{name:"name",label:t("Name"),type:"input-name",required:!0,placeholder:t("Please input name"),isInstance:!0}]}}a.Edit=c,(0,o.default)(c,"id","edit-server"),(0,o.default)(c,"title",t("Edit Instance")),(0,o.default)(c,"buttonText",t("Edit")),(0,o.default)(c,"policy","os_compute_api:servers:update");var f=(0,s.inject)("rootStore")((0,s.observer)(c));a.default=f},3524:function(e,a,r){"use strict";var i=r(33),n=r(44),l=r(32),o=r(25),s=r(27),u=r(45),d=r(46),c=r(19),f=r(21);c(a,"__esModule",{value:!0}),a.default=a.Rebuild=void 0;var p=f(r(32)),m=f(r(57)),h=f(r(65)),v=f(r(36)),g=r(406),y=f(r(565)),b=f(r(408)),_=r(1193),S=r(1195),M=r(563);function I(e,t){var a=i(e);if(n){var r=n(e);t&&(r=l(r).call(r,(function(t){return o(e,t).enumerable}))),a.push.apply(a,r)}return a}function x(e){for(var t=1;t<arguments.length;t++){var a,r=null!=arguments[t]?arguments[t]:{};if(t%2)s(a=I(Object(r),!0)).call(a,(function(t){(0,v.default)(e,t,r[t])}));else if(u)d(e,u(r));else{var i;s(i=I(Object(r))).call(i,(function(t){c(e,t,o(r,t))}))}}return e}class A extends _.ModalAction{constructor(){super(...arguments),(0,v.default)(this,"onImageTabChange",(e=>{this.setState({imageTab:e})})),(0,v.default)(this,"onSubmit",(e=>{var{id:t}=this.item,{image:{selectedRowKeys:a=[]}}=e;return this.store.rebuild({id:t,image:a[0]})}))}init(){this.store=b.default,this.imageStore=y.default,this.getImages()}get name(){return t("rebuild instance")}static get modalSize(){return"large"}get labelCol(){return{xs:{span:6},sm:{span:4}}}get images(){var e,{imageTab:t}=this.state,a=(0,p.default)(e=this.imageStore.list.data||[]).call(e,(e=>!!(0,M.canImageCreateInstance)(e)&&(!t||(0,M.getImageOS)(e)===t)));return(0,m.default)(a).call(a,(e=>x(x({},e),{},{key:e.id})))}getImages(){this.imageStore.fetchList()}get systemTabs(){return(0,M.getImageSystemTabs)()}get defaultValue(){var{name:e}=this.item;return{instance:e}}get formItems(){return[{name:"instance",label:t("Instance"),type:"label",iconType:"instance"},{name:"image",label:t("Operating System"),type:"select-table",data:this.images,isLoading:this.imageStore.list.isLoading,required:!0,isMulti:!1,filterParams:[{label:t("Name"),name:"name"}],columns:(0,M.getImageColumns)(this),tabs:this.systemTabs,defaultTabValue:this.systemTabs[0].value,selectedLabel:t("Image"),onTabChange:this.onImageTabChange}]}}a.Rebuild=A,(0,v.default)(A,"id","rebuild"),(0,v.default)(A,"title",t("Rebuild Instance")),(0,v.default)(A,"policy","os_compute_api:servers:rebuild"),(0,v.default)(A,"isRootVolumeInUse",(()=>!0)),(0,v.default)(A,"allowed",(e=>{var t=(0,S.isActiveOrShutOff)(e)&&(0,S.isNotLocked)(e)&&A.isRootVolumeInUse(e)&&!(0,S.isIsoInstance)(e);return h.default.resolve(t)}));var w=(0,g.inject)("rootStore")((0,g.observer)(A));a.default=w},3525:function(e,a,r){"use strict";var i=r(19),n=r(21);i(a,"__esModule",{value:!0}),a.default=void 0;var l=n(r(36)),o=n(r(0)),s=r(1193),u=r(1195),d=n(r(408)),c=n(r(1536));class f extends s.ConfirmAction{constructor(){super(...arguments),(0,l.default)(this,"policy","os_compute_api:os-shelve:shelve"),(0,l.default)(this,"isStatusOk",(e=>(0,u.checkStatus)(["active","shutoff","paused","suspended"],e))),(0,l.default)(this,"allowedCheckFunc",(e=>!e||(0,u.isNotLockedOrAdmin)(e,this.isAdminPage)&&this.isStatusOk(e)&&!(0,u.isIronicInstance)(e))),(0,l.default)(this,"confirmContext",(e=>{var{name:a}=e;return o.default.createElement("div",null,o.default.createElement("p",{className:c.default.mb16},this.unescape(t("Are you sure to shelve instance { name }? ",{name:a}))),o.default.createElement("p",null,t("After shelving, the instance will be shut down, resources will be released, and the snapshot will be saved to Glance. This will take about a few minutes, please be patient. You also can choose to unshelve to restore the instance.")))})),(0,l.default)(this,"onSubmit",(()=>{var{id:e}=this.item;return d.default.shelve({id:e})}))}get id(){return"shelve"}get title(){return t("Shelve Instance")}get buttonText(){return t("Shelve")}get actionName(){return t("shelve instance")}get isAsyncAction(){return!0}}a.default=f},3526:function(e,a,r){"use strict";var i=r(19),n=r(21);i(a,"__esModule",{value:!0}),a.default=void 0;var l=n(r(36)),o=r(1193),s=r(1195),u=n(r(408));class d extends o.ConfirmAction{constructor(){super(...arguments),(0,l.default)(this,"policy","os_compute_api:os-shelve:unshelve"),(0,l.default)(this,"isStatusOk",(e=>(0,s.checkStatus)(["shelved","shelved_offloaded"],e))),(0,l.default)(this,"allowedCheckFunc",(e=>!e||(0,s.isNotLockedOrAdmin)(e,this.isAdminPage)&&this.isStatusOk(e))),(0,l.default)(this,"onSubmit",(()=>{var{id:e}=this.item;return u.default.unshelve({id:e})}))}get id(){return"shelve"}get title(){return t("Unshelve Instance")}get buttonText(){return t("Unshelve")}get actionName(){return t("unshelve instance")}get isAsyncAction(){return!0}}a.default=d},3527:function(e,a,r){"use strict";var i=r(19),n=r(21);i(a,"__esModule",{value:!0}),a.default=a.DisassociateFip=void 0;var l=n(r(65)),o=n(r(57)),s=n(r(51)),u=n(r(36)),d=r(406),c=r(336),f=r(1193);class p extends f.ModalAction{constructor(){var e;super(...arguments),e=this,(0,u.default)(this,"onSubmit",function(){var t=(0,s.default)((function*(t){var{address:a}=t,r=yield e.store.fetchList({floating_ip_address:a});return r.length?e.store.disassociateFip({id:r[0].id}):l.default.resolve()}));return function(e){return t.apply(this,arguments)}}())}init(){this.store=new c.FloatingIpStore}get name(){return t("disassociate floating ip")}get fips(){var{floating_addresses:e=[]}=this.item;return(0,o.default)(e).call(e,(e=>({value:e,label:e})))}get defaultValue(){var{name:e}=this.item;return{instance:e}}get formItems(){return[{name:"instance",label:t("Instance"),type:"label",iconType:"instance"},{name:"address",label:t("Floating Ip"),type:"select",required:!0,options:this.fips}]}}a.DisassociateFip=p,(0,u.default)(p,"id","DisassociateFip"),(0,u.default)(p,"title",t("Disassociate Floating Ip")),(0,u.default)(p,"policy","update_floatingip"),(0,u.default)(p,"hasFip",(e=>e.floating_addresses.length>0)),(0,u.default)(p,"allowed",(e=>l.default.resolve(p.hasFip(e))));var m=(0,d.inject)("rootStore")((0,d.observer)(p));a.default=m},3528:function(e,a,r){"use strict";var i=r(33),n=r(44),l=r(32),o=r(25),s=r(27),u=r(45),d=r(46),c=r(19),f=r(21);c(a,"__esModule",{value:!0}),a.default=a.LiveMigrate=void 0;var p=f(r(57)),m=f(r(32)),h=f(r(65)),v=f(r(36)),g=r(406),y=f(r(408)),b=r(1193),_=r(1195),S=f(r(586)),M=r(1337);function I(e,t){var a=i(e);if(n){var r=n(e);t&&(r=l(r).call(r,(function(t){return o(e,t).enumerable}))),a.push.apply(a,r)}return a}function x(e){for(var t=1;t<arguments.length;t++){var a,r=null!=arguments[t]?arguments[t]:{};if(t%2)s(a=I(Object(r),!0)).call(a,(function(t){(0,v.default)(e,t,r[t])}));else if(u)d(e,u(r));else{var i;s(i=I(Object(r))).call(i,(function(t){c(e,t,o(r,t))}))}}return e}class A extends b.ModalAction{constructor(){super(...arguments),(0,v.default)(this,"onSubmit",(e=>{var{host:t,option:{blockMigrate:a}}=e,{id:r}=this.item,i={host:t?t.selectedRows[0].service_host:null,block_migration:a||"auto"};return this.store.migrateLive({id:r,body:i})}))}init(){this.store=y.default,this.hypervisorStore=S.default,this.getHypervisors()}get name(){return t("live migrate")}static get modalSize(){return"large"}getModalSize(){return"large"}getHypervisors(){this.hypervisorStore.fetchList()}get hypervisors(){var e,t;return(0,p.default)(e=(0,m.default)(t=this.hypervisorStore.list.data||[]).call(t,(e=>"ironic"!==e.hypervisor_type))).call(e,(e=>x(x({},e),{},{key:e.id})))}get tips(){return t("Choose a host to live migrate instance to. If not selected, the scheduler will auto select target host.")}get defaultValue(){var{name:e,host:t}=this.item;return{instance:e,current:t,option:{blockMigrate:!1}}}get formItems(){var{host:e}=this.item;return[{name:"instance",label:t("Instance"),type:"label",iconType:"instance"},{name:"current",label:t("Current Compute Host"),type:"label",iconType:"aggregate"},{name:"host",label:t("Target Compute Host"),type:"select-table",data:this.hypervisors,isLoading:this.hypervisorStore.list.isLoading,isMulti:!1,extra:t("If nova-compute on the host is disabled, it will be forbidden to be selected as the target host."),filterParams:M.hypervisorFilters,columns:M.hypervisorColumns,disabledFunc:t=>t.service_host===e||"enabled"!==t.status},{name:"option",label:t("Options"),type:"check-group",options:[{label:t("Block Migrate"),value:"blockMigrate"}]}]}}a.LiveMigrate=A,(0,v.default)(A,"id","LiveMigrate"),(0,v.default)(A,"title",t("Live Migrate")),(0,v.default)(A,"policy","os_compute_api:os-migrate-server:migrate_live"),(0,v.default)(A,"allowed",(e=>h.default.resolve(((0,_.isActive)(e)||(0,_.isPaused)(e))&&(0,_.isNotDeleting)(e)&&!(0,_.isIronicInstance)(e))));var w=(0,g.inject)("rootStore")((0,g.observer)(A));a.default=w},3529:function(e,a,r){"use strict";var i=r(19),n=r(21);i(a,"__esModule",{value:!0}),a.default=a.AssociateFip=void 0;var l=n(r(65)),o=n(r(51)),s=n(r(36)),u=r(406),d=n(r(408)),c=n(r(336)),f=r(1193),p=r(1195),m=r(1219),h=r(1224),v=r(1210);class g extends f.ModalAction{constructor(){super(...arguments),(0,s.default)(this,"handleFixedIPChange",(e=>h.handleFixedIPChange.call(this,e))),(0,s.default)(this,"onSubmit",(e=>{var{fixed_ip:t,fip:a}=e,r=t.selectedRows[0],i=a.selectedRowKeys[0];return c.default.associateFip({id:i,port_id:r.port_id,fixed_ip_address:r.fixed_ip_address})}))}init(){this.getInterfaces(),m.getCanReachSubnetIdsWithRouterIdInComponent.call(this),this.state={fixed_ip:null,interfaces:[],canAssociateFloatingIPs:[],canReachSubnetIdsWithRouterId:[],routerIdWithExternalNetworkInfo:[],portLoading:!0}}static get modalSize(){return"large"}getModalSize(){return"large"}get name(){return t("Associate Floating IP")}getInterfaces(){var e=this;return(0,o.default)((function*(){var{id:t}=e.item,a=yield d.default.fetchInterfaceList({id:t}),r=yield(0,h.getInterfaceWithReason)(a);e.setState({interfaces:r,portLoading:!1})}))()}get ports(){var{interfaces:e,canReachSubnetIdsWithRouterId:t}=this.state;return v.getPortsAndReasons.call(this,e,t)}get defaultValue(){var{name:e}=this.item;return{instance:e}}getFIPFormItemExtra(){return(0,h.getFIPFormItemExtra)()}disableFIPAssociate(e){return(0,h.disableFIPAssociate)(e)}get formItems(){var e=(0,h.getFixedIPFormItemForAssociate)(t("Instance IP"),this),a=(0,h.getFIPFormItemForAssociate)(this);return[{name:"instance",label:t("Instance"),type:"label",iconType:"instance"},e,a]}}a.AssociateFip=g,(0,s.default)(g,"id","AssociateFip"),(0,s.default)(g,"title",t("Associate Floating IP")),(0,s.default)(g,"policy","update_floatingip"),(0,s.default)(g,"canAssociated",(e=>e.fixed_addresses.length>e.floating_addresses.length)),(0,s.default)(g,"allowed",((e,t)=>{var{isAdminPage:a=!1}=t;return l.default.resolve(!a&&(0,p.isNotError)(e)&&g.canAssociated(e))}));var y=(0,u.inject)("rootStore")((0,u.observer)(g));a.default=y},3530:function(e,a,r){"use strict";var i=r(33),n=r(44),l=r(32),o=r(25),s=r(27),u=r(45),d=r(46),c=r(19),f=r(21);c(a,"__esModule",{value:!0}),a.default=a.ManageSecurityGroup=void 0;var p=f(r(65)),m=f(r(57)),h=f(r(51)),v=f(r(36)),g=f(r(0)),y=r(406),b=r(1193),_=f(r(408)),S=r(561),M=r(416),I=r(1210),x=r(1274),A=r(34);function w(e,t){var a=i(e);if(n){var r=n(e);t&&(r=l(r).call(r,(function(t){return o(e,t).enumerable}))),a.push.apply(a,r)}return a}function N(e){for(var t=1;t<arguments.length;t++){var a,r=null!=arguments[t]?arguments[t]:{};if(t%2)s(a=w(Object(r),!0)).call(a,(function(t){(0,v.default)(e,t,r[t])}));else if(u)d(e,u(r));else{var i;s(i=w(Object(r))).call(i,(function(t){c(e,t,o(r,t))}))}}return e}class C extends b.ModalAction{constructor(){var e;super(...arguments),e=this,(0,v.default)(this,"getSecurityGroupPromise",function(){var t=(0,h.default)((function*(t){if(!e.securityGroupMap[t]){var a=yield e.securityGroupStore.fetchDetail({id:t});e.securityGroupMap[t]=a}return e.securityGroupMap[t]}));return function(e){return t.apply(this,arguments)}}()),(0,v.default)(this,"onPortChange",function(){var t=(0,h.default)((function*(t){var{selectedRows:a=[]}=t,r=a[0];if(r){var{security_groups:i=[]}=r,n=yield p.default.all((0,m.default)(i).call(i,(t=>e.getSecurityGroupPromise(t))));e.formRef.current.setFieldsValue({securityGroup:{selectedRowKeys:i}}),e.setState({sgInitValue:{selectedRowKeys:i,port:r,selectedRows:n}})}}));return function(e){return t.apply(this,arguments)}}()),(0,v.default)(this,"onSubmit",(e=>{var{securityGroup:{selectedRowKeys:t=[]}={},port:{selectedRowKeys:a=[]}}=e,r=a[0],i={port:{security_groups:t}};return this.securityGroupStore.updatePortSecurityGroup({id:r,reqBody:i})}))}init(){this.store=_.default,this.securityGroupStore=new M.SecurityGroupStore,this.portStore=new S.PortStore,this.getPorts(),this.securityGroupMap={}}getPorts(){this.portStore.fetchList({device_id:this.item.id})}get ports(){var e=(0,A.toJS)(this.portStore.list.data)||[];return(0,m.default)(e).call(e,(e=>N(N({},e),{},{name:e.id,security_groups:e.origin_data.security_groups})))}static get modalSize(){return"large"}getModalSize(){return"large"}get name(){return t("Manage Security Group")}get defaultValue(){var{name:e}=this.item,{port:t}=this.state,a={name:e};return t&&(a.securityGroup={selectedRowKeys:t.security_groups},a.port={selectedRowKeys:[t.id]}),a}get formItems(){var{sgInitValue:e={}}=this.state;return[{name:"name",label:t("Instance"),type:"label",iconType:"instance"},{name:"port",label:t("Virtual Adapter"),type:"select-table",required:!0,data:this.ports,isLoading:this.portStore.list.isLoading,isMulti:!1,onChange:this.onPortChange,filterParams:[{label:t("Owned Network"),name:"network_name"}],columns:[{title:t("ID"),dataIndex:"id"},{title:t("Owned Network"),dataIndex:"network_name"},{title:t("IPv4 Address"),dataIndex:"ipv4",render:e=>(0,m.default)(e).call(e,(e=>g.default.createElement("div",{key:e},e)))},{title:t("IPv6 Address"),dataIndex:"ipv6",render:e=>(0,m.default)(e).call(e,(e=>g.default.createElement("div",{key:e},e)))},{title:t("Mac Address"),dataIndex:"mac_address",isHideable:!0},{title:t("Status"),dataIndex:"status",render:e=>I.portStatus[e]||e}]},{name:"securityGroup",label:t("Security Group"),type:"select-table",initValue:e,required:!0,tips:t("The security group is similar to the firewall function for setting up network access control, or you can go to the console and create a new security group. (Note: The security group you selected will work on all virtual LANS on the instances.)"),backendPageStore:this.securityGroupStore,extraParams:{project_id:this.currentProjectId},isMulti:!0,filterParams:x.securityGroupFilter,columns:x.securityGroupColumns,onRow:()=>{}}]}}a.ManageSecurityGroup=C,(0,v.default)(C,"id","manage-security-group"),(0,v.default)(C,"title",t("Manage Security Group")),(0,v.default)(C,"allowed",(()=>p.default.resolve(!0))),(0,v.default)(C,"policy","update_port");var P=(0,y.inject)("rootStore")((0,y.observer)(C));a.default=P},3531:function(e,a,r){"use strict";var i=r(19),n=r(21);i(a,"__esModule",{value:!0}),a.default=void 0;var l=n(r(36)),o=r(1193),s=n(r(408)),u=r(1195);class d extends o.ConfirmAction{constructor(){super(...arguments),(0,l.default)(this,"policy","os_compute_api:os-deferred-delete:force"),(0,l.default)(this,"allowedCheckFunc",(e=>!e||(0,u.isNotLockedOrAdmin)(e,this.isAdminPage)&&(0,u.isIronicInstance)(e))),(0,l.default)(this,"onSubmit",(e=>{var{id:t}=e||this.item;return s.default.forceDelete({id:t})}))}get id(){return"delete"}get title(){return t("Delete")}get actionName(){return t("delete ironic instance")}get isDanger(){return!0}get isAsyncAction(){return!0}}a.default=d},3532:function(e,a,r){"use strict";var i=r(19),n=r(21);i(a,"__esModule",{value:!0}),a.default=void 0;var l=n(r(36)),o=r(1193),s=n(r(408));class u extends o.ConfirmAction{constructor(){super(...arguments),(0,l.default)(this,"policy","os_compute_api:servers:resize"),(0,l.default)(this,"allowedCheckFunc",(e=>!e||"verify_resize"===e.status.toLowerCase())),(0,l.default)(this,"confirmContext",(e=>{var a=this.getName(e);return t("".concat(this.actionNameDisplay," (instance: {name})?"),{name:a})})),(0,l.default)(this,"onSubmit",(e=>{var{id:t}=e||this.item;return s.default.update(t,{confirmResize:null})}))}get id(){return"confirm_resize_migrate"}get title(){return t("Confirm Resize or Migrate")}get buttonText(){return t("Confirm Resize or Migrate")}get actionName(){return t("confirm resize or migrate")}}a.default=u},3533:function(e,a,r){"use strict";var i=r(19),n=r(21);i(a,"__esModule",{value:!0}),a.default=void 0;var l=n(r(36)),o=r(1193),s=n(r(408));class u extends o.ConfirmAction{constructor(){super(...arguments),(0,l.default)(this,"policy","os_compute_api:servers:resize"),(0,l.default)(this,"allowedCheckFunc",(e=>!e||"verify_resize"===e.status.toLowerCase())),(0,l.default)(this,"onSubmit",(e=>{var{id:t}=e||this.item;return s.default.update(t,{revertResize:null})}))}get id(){return"revert_resize_migrate"}get title(){return t("Revert Resize or Migrate")}get buttonText(){return t("Revert Resize or Migrate")}get actionName(){return t("revert resize or migrate")}}a.default=u},3534:function(e,a,r){"use strict";var i=r(19),n=r(21);i(a,"__esModule",{value:!0}),a.default=a.ModifyTags=void 0;var l=n(r(65)),o=n(r(226)),s=n(r(198)),u=n(r(36)),d=n(r(202)),c=n(r(0)),f=r(406),p=r(1193),m=n(r(1543)),h=n(r(3535));class v extends p.ModalAction{constructor(){super(...arguments),(0,u.default)(this,"onSubmit",(e=>h.default.update({serverId:this.props.item.id},e)))}get name(){return t("modify instance tags")}init(){this.state.tags=this.props.item.tags||[]}get formItems(){var{tags:e}=this.state;return[{name:"tags",label:t("Tags"),component:c.default.createElement(m.default,{tags:e,maxLength:60,maxCount:50}),validator:(e,a)=>{var r=this.props.item.tags||[];if((0,d.default)(a,r))return l.default.resolve(!0);var i="";return(0,o.default)(a).call(a,(e=>{var t=(0,s.default)(e).call(e,"/")||(0,s.default)(e).call(e,",");return t&&(i=e),t}))?l.default.reject(new Error(t("Invalid Tag Value: {tag}",{tag:i}))):(0,o.default)(r).call(r,(function(e){return(0,o.default)(a).call(a,(t=>{var a=e!==t&&t.toLowerCase()===e.toLowerCase();return a&&(i=t),a}))}))?l.default.reject(new Error(t("Duplicate tag name: {tag}",{tag:i}))):l.default.resolve(!0)},extra:c.default.createElement("div",null,c.default.createElement("div",null,"1. ",t("Each server can have up to 50 tags")),c.default.createElement("div",null,"2. ",t("Tags are not case sensitive")),c.default.createElement("div",null,"3. ",t("Tag is no longer than 60 characters")),c.default.createElement("div",null,"4. ",t("Forward Slash / is not allowed to be in a tag name")),c.default.createElement("div",null,"5."," ",t("Commas , are not allowed to be in a tag name in order to simplify requests that specify lists of tags")))}]}}a.ModifyTags=v,(0,u.default)(v,"id","modify-instance-tags"),(0,u.default)(v,"title",t("Modify Instance Tags")),(0,u.default)(v,"buttonText",t("Modify Instance Tags")),(0,u.default)(v,"policy","os_compute_api:os-server-tags:update_all"),(0,u.default)(v,"allowed",(()=>l.default.resolve(!0)));var g=(0,f.inject)("rootStore")((0,f.observer)(v));a.default=g},3535:function(e,t,a){"use strict";var r=a(19),i=a(21);r(t,"__esModule",{value:!0}),t.default=t.TagStore=void 0;var n,l=i(a(25)),o=i(a(54)),s=a(34),u=i(a(48)),d=i(a(53)),c=(n=class extends d.default{get client(){return u.default.nova.servers}get paramsFunc(){return()=>null}update(e,t){var{serverId:a}=e;return this.submitting(this.client.updateTags(a,t))}},(0,o.default)(n.prototype,"update",[s.action],(0,l.default)(n.prototype,"update"),n.prototype),n);t.TagStore=c;var f=new c;t.default=f},3536:function(e,a,r){"use strict";var i=r(33),n=r(44),l=r(32),o=r(25),s=r(27),u=r(45),d=r(46),c=r(19),f=r(21);c(a,"__esModule",{value:!0}),a.default=a.InstanceDetail=void 0;var p=f(r(198)),m=f(r(562)),h=f(r(32)),v=f(r(36)),g=r(406),y=r(1195),b=r(408),_=f(r(1200)),S=f(r(1399)),M=f(r(1402)),I=f(r(1341)),x=f(r(3578)),A=r(34),w=f(r(3581)),N=f(r(3592)),C=f(r(3602)),P=f(r(1551)),k=f(r(1535));function j(e,t){var a=i(e);if(n){var r=n(e);t&&(r=l(r).call(r,(function(t){return o(e,t).enumerable}))),a.push.apply(a,r)}return a}function T(e){for(var t=1;t<arguments.length;t++){var a,r=null!=arguments[t]?arguments[t]:{};if(t%2)s(a=j(Object(r),!0)).call(a,(function(t){(0,v.default)(e,t,r[t])}));else if(u)d(e,u(r));else{var i;s(i=j(Object(r))).call(i,(function(t){c(e,t,o(r,t))}))}}return e}class D extends _.default{constructor(){super(...arguments),(0,v.default)(this,"updateFetchParams",(e=>T(T({},e),{},{isRecycleBinDetail:this.isRecycleBinDetail})))}get name(){return t("instance")}get enableCinder(){return this.props.rootStore.checkEndpoint("cinder")}get policy(){return"os_compute_api:servers:show"}get isRecycleBinDetail(){var e;return(0,p.default)(e=this.path).call(e,"recycle-bin")}get listUrl(){return this.isRecycleBinDetail?this.getRoutePath("recycleBin"):this.getRoutePath("instance")}get actionConfigs(){return this.isRecycleBinDetail?x.default:this.isAdminPage?k.default.adminActions:k.default.actionConfigs}get detailData(){var{id:e,status:t}=this.store.detail;if(e&&"soft_deleted"===t&&!this.isRecycleBinDetail){var a=this.getRoutePath("recycleBinDetail",{id:e});this.routing.push(a)}return(0,A.toJS)(this.store.detail)||{}}getActionData(){return this.detailData.itemInList||{}}get detailInfos(){return[{title:t("Name"),dataIndex:"name"},{title:t("Status"),dataIndex:"status",valueMap:y.instanceStatus},{title:t("Lock Status"),dataIndex:"locked",render:y.lockRender},{title:t("Project ID"),dataIndex:"tenant_id",hidden:!this.isAdminPage},{title:t("Created At"),dataIndex:"created",valueRender:"toLocalTime"},{title:t("Host"),dataIndex:"OS-EXT-SRV-ATTR:host"}]}get tabs(){var e=[{title:t("Detail"),key:"detail",component:w.default},{title:t("Instance Snapshots"),key:"snapshots",component:P.default},{title:t("Interfaces"),key:"interface",component:I.default},{title:t("Floating IPs"),key:"floatingIps",component:M.default},{title:t("Security Groups"),key:"securityGroup",component:N.default},{title:t("Action Logs"),key:"action",component:C.default}];return this.enableCinder&&(0,m.default)(e).call(e,1,0,{title:t("Volumes"),key:"volumes",component:S.default}),(0,y.isIronicInstance)(this.detailData)?(0,h.default)(e).call(e,(e=>"volumes"!==e.key&&"snapshots"!==e.key&&"monitor"!==e.key)):e}init(){this.store=new b.ServerStore}}a.InstanceDetail=D;var z=(0,g.inject)("rootStore")((0,g.observer)(D));a.default=z},3578:function(e,t,a){"use strict";var r=a(19),i=a(21);r(t,"__esModule",{value:!0}),t.default=void 0;var n=i(a(3579)),l=i(a(3580)),o={rowActions:{firstAction:l.default,moreActions:[{action:n.default}]},batchActions:[l.default,n.default]};t.default=o},3579:function(e,a,r){"use strict";var i=r(19),n=r(21);i(a,"__esModule",{value:!0}),a.default=void 0;var l=n(r(36)),o=r(1193),s=n(r(408));class u extends o.ConfirmAction{constructor(){super(...arguments),(0,l.default)(this,"policy","os_compute_api:os-deferred-delete:force"),(0,l.default)(this,"allowedCheckFunc",(e=>!0)),(0,l.default)(this,"onSubmit",(e=>{var{id:t}=e||this.item;return s.default.forceDelete({id:t})}))}get id(){return"delete"}get title(){return t("Delete")}get actionName(){return t("delete instance")}get isDanger(){return!0}get isAsyncAction(){return!0}}a.default=u},3580:function(e,a,r){"use strict";var i=r(19),n=r(21);i(a,"__esModule",{value:!0}),a.default=void 0;var l=n(r(36)),o=r(1193),s=n(r(408));class u extends o.ConfirmAction{constructor(){super(...arguments),(0,l.default)(this,"policy","os_compute_api:os-deferred-delete:restore"),(0,l.default)(this,"allowedCheckFunc",(e=>!0)),(0,l.default)(this,"onSubmit",(e=>{var{id:t}=e||this.item;return s.default.restore({id:t})}))}get id(){return"Recover"}get title(){return t("Recover")}get actionName(){return t("recover instance")}get passiveAction(){return t("be recovered")}get isAsyncAction(){return!0}}a.default=u},3581:function(e,a,r){"use strict";var i=r(19),n=r(21);i(a,"__esModule",{value:!0}),a.default=a.BaseDetail=void 0;var l=n(r(562)),o=n(r(57)),s=n(r(27)),u=n(r(33)),d=n(r(32)),c=n(r(102)),f=n(r(81)),p=n(r(339)),m=n(r(579));r(333);var h=n(r(332)),v=n(r(1273));r(1196);var g=n(r(1197));r(1198);var y=n(r(1199)),b=n(r(51)),_=n(r(36)),S=n(r(0)),M=r(34),I=r(406),x=r(408),A=r(1334),w=r(575),N=r(585),C=n(r(1202)),P=n(r(1249)),k=r(201),j=(r(173),r(555),n(r(635))),T=n(r(3587)),D=n(r(3588)),z=n(r(3589)),L=n(r(4)),E=n(r(584)),O=r(1195),R=r(161),V=r(569),F=n(r(1542)),G=n(r(140)),B=n(r(3590));class U extends C.default{constructor(){var e;super(...arguments),e=this,(0,_.default)(this,"fetchVolumes",(0,b.default)((function*(){var t={serverId:e.id};e.isMyResource||(t.all_projects=!0),yield e.volumeStore.fetchList(t)}))),(0,_.default)(this,"fetchInterfaces",(0,b.default)((function*(){var t={device_id:e.id};e.isMyResource||(t.all_projects=!0),yield e.interfaceStore.fetchList(t),e.store.isLoading=!1}))),(0,_.default)(this,"fetchSeverGroup",(0,b.default)((function*(){var{server_groups:t=[]}=e.detailData;yield e.serverGroupStore.fetchDetail({id:t[0]})}))),(0,_.default)(this,"handleRefreshVolume",(()=>{this.fetchVolumes()}))}componentDidMount(){this.fetchVolumes(),this.fetchInterfaces(),this.detailData.server_groups[0]&&this.fetchSeverGroup()}init(){this.store=new x.ServerStore,this.interfaceStore=new w.PortStore,this.volumeStore=new A.InstanceVolumeStore,this.serverGroupStore=new N.ServerGroupStore}get leftCards(){var e=[this.networkCard,this.flavorCard,this.imageCard,this.securityGroupCard,this.tagsCard];return(0,O.isIronicInstance)(this.detailData)||e.push(this.serverGroupCard),e}get rightCards(){var e=[this.topoCard],{detail:{fault:t}}=this.props;return t&&t.message&&(0,l.default)(e).call(e,0,0,this.errorCard),e}get tagsCard(){var e=(0,M.toJS)(this.detailData.tags)||[],a=e.length?(0,o.default)(e).call(e,((e,t)=>(0,O.SimpleTag)({tag:e,index:t}))):"-",r=[{label:t("Tags"),content:a}];return{title:t("Tags Info"),options:r}}get networkCard(){var e,a=(0,M.toJS)(this.detailData.addresses)||[],r=[];(0,s.default)(e=(0,u.default)(a)).call(e,(e=>{var t=a[e],i=(0,d.default)(t).call(t,(e=>"fixed"===e["OS-EXT-IPS:type"])),n=(0,d.default)(t).call(t,(e=>"floating"===e["OS-EXT-IPS:type"]));(0,s.default)(i).call(i,(t=>{var a=(0,c.default)(n).call(n,(e=>e["OS-EXT-IPS-MAC:mac_addr"]===t["OS-EXT-IPS-MAC:mac_addr"]));r.push({netName:e,fixedIp:t,fip:a})}))}));var i=(0,o.default)(r).call(r,((e,t)=>{var a,{netName:r,fixedIp:i,fip:n}=e;return S.default.createElement("div",{key:(0,f.default)(a="".concat(i["OS-EXT-IPS-MAC:mac_addr"],"-")).call(a,t)},r," | ",i.addr," ",n&&S.default.createElement("span",null,"| ",n.addr))})),n=[{label:t("Network"),content:i}];return{title:t("Network Info"),options:n}}get flavorCard(){var e=(0,M.toJS)(this.detailData.flavor)||{},{extra_specs:a={}}=e,r=[{label:t("Flavor Name"),content:e.original_name},{label:t("RAM"),content:"".concat(e.ram/1024," GiB")},{label:t("VCPUs"),content:e.vcpus}];return"heterogeneous_computing"===a[":architecture"]&&"visualization_compute_optimized_type_with_gpu"===a[":category"]&&r.push({label:t("VGPU"),content:a["resources:VGPU"]}),{title:t("Flavor Info"),options:r}}get imageCard(){var e=this.detailData.itemInList||{},{image:a,image_name:r}=e,i=this.getRoutePath("imageDetail",{id:a}),n=[{label:t("Name"),content:r||"-"},{label:t("ID"),content:a?S.default.createElement(k.Link,{to:i},a):"-"}];return{title:t("Image Info"),options:n}}get securityGroupCard(){var{security_groups:e=[]}=this.detailData,a=(0,p.default)(new m.default((0,o.default)(e).call(e,(e=>e.name)))),{match:{url:r}}=this.props,i=[{label:t("Name"),dataIndex:"security_groups",render:()=>a&&a.length?(0,o.default)(a).call(a,(e=>S.default.createElement("div",{key:e},S.default.createElement(k.Link,{to:"".concat(r,"?tab=securityGroup"),key:e},e)))):"-"}];return{title:t("Security Group Info"),options:i}}get serverGroupCard(){var e=this.serverGroupStore.detail||{},{name:a}=e,r=[{label:t("Name"),content:a||"-"}];return{title:t("Server Group"),options:r}}get interfaces(){var e,t=[],{match:{url:a}}=this.props;return(0,s.default)(e=this.interfaceStore.list.data||[]).call(e,(e=>{var{name:r,id:i,networkName:n,fixed_ips:l=[],network_id:s}=e;t.push({networkName:n,name:S.default.createElement(k.Link,{to:"".concat(a,"?tab=interface")},r||i),address:(0,o.default)(l).call(l,(e=>e.ip_address)),network_id:s,interface:e})})),t}get volumeActions(){return{firstAction:F.default}}renderInterfaceRow(){var e,t=(0,o.default)(e=this.interfaces).call(e,((e,t)=>{var a;return S.default.createElement("div",{className:B.default["vm-interface"],key:"vm-interface-".concat(t)},S.default.createElement("div",{className:B.default["interface-line"]}),S.default.createElement("div",{className:B.default["interface-item"]},S.default.createElement("div",{style:{marginBottom:8}},e.networkName," ( ",e.name," )"," "),S.default.createElement("div",null,S.default.createElement("img",{alt:"interface_icon",src:z.default,style:{height:28,paddingLeft:6,marginRight:10}}),S.default.createElement("div",{style:{display:"inline-table"}},(0,o.default)(a=e.address).call(a,(e=>{var a;return S.default.createElement("div",{key:(0,f.default)(a="".concat(e,"-")).call(a,t)},e)}))))))}));return S.default.createElement(y.default,null,t)}renderImageType(e){return S.default.createElement(E.default,{className:B.default["info-item-icon"],type:e,title:e})}renderVmRow(){var e=(0,M.toJS)(this.detailData.itemInList)||{},{status:t}=this.detailData,{image_name:a,image_os_distro:r}=e;return S.default.createElement(y.default,{className:(0,L.default)(B.default.vm)},S.default.createElement("div",{className:B.default["vm-icon"]},S.default.createElement("img",{alt:"instance_icon",src:D.default,style:{height:36}})),S.default.createElement("div",{className:B.default["vm-info"]},S.default.createElement("div",{className:B.default["info-item"]},this.renderImageType(r),S.default.createElement("span",null,a)),S.default.createElement("div",{className:B.default["info-item"]},S.default.createElement(j.default,{status:t,text:O.instanceStatus[t]}))))}renderVolumeRow(){var e;if(!this.props.rootStore.checkEndpoint("cinder"))return null;var{match:{url:a}}=this.props,r=(0,o.default)(e=this.volumeStore.list.data||[]).call(e,(e=>{var r=[{label:"os_disk"===e.disk_tag?t("Root Disk"):t("Data Disk"),value:e.name||"-"},{label:t("ID"),value:S.default.createElement(k.Link,{to:"".concat(a,"?tab=volumes")},e.id)},{label:t("Size"),value:e.size?"".concat(e.size,"GiB"):"-"},{label:t("Volume Type"),value:e.volume_type||"-"},{label:t("Create Time"),value:(0,V.getSinceTime)(e.created_at)||"-"}],i=(0,o.default)(r).call(r,(e=>S.default.createElement(y.default,{className:B.default["volume-info-item"],key:"volume-info-item-".concat((0,R.generateId)())},S.default.createElement(g.default,{span:3,className:B.default["info-key"]},e.label),S.default.createElement(g.default,null,e.value))));return S.default.createElement("div",{className:B.default["attached-volume"],key:"attached-volume-".concat((0,R.generateId)())},S.default.createElement("div",{className:B.default["attached-volume-line"]}),S.default.createElement("div",{className:B.default["attached-volume-content"]},S.default.createElement("div",{className:B.default["volume-icon"]},S.default.createElement("img",{alt:"volume_icon",src:T.default,style:{height:36}})),S.default.createElement("div",{className:B.default["volume-info"]},i)))})),{isAdminPage:i}=this.props,n={isAdminPage:i};return S.default.createElement(y.default,{className:B.default["vm-volume"]},S.default.createElement("div",{className:B.default["volume-inline"]}),S.default.createElement("div",{className:B.default["volume-content"]},r,S.default.createElement("div",null,S.default.createElement("div",{className:B.default["attach-action-line"]}),S.default.createElement(P.default,{actions:this.volumeActions,onFinishAction:this.handleRefreshVolume,item:this.detailData,containerProps:n,firstActionClassName:B.default["attach-btn"]}))))}renderTopoContent(){return S.default.createElement("div",{className:B.default["topology-content"]},this.renderVmRow(),this.renderInterfaceRow(),this.renderVolumeRow())}get topoCard(){var e=t("Instance Architecture"),a=S.default.createElement("div",null,S.default.createElement("p",null,t("The instance architecture diagram mainly shows the overall architecture composition of the instance. If you need to view the network topology of the instance, please go to: ")),S.default.createElement(k.Link,{to:"/network/topo"},t("Network topology page"))),r=[{content:this.renderTopoContent()}],{refreshDetail:i}=this.props;return{labelCol:0,title:e,titleHelp:a,options:r,button:S.default.createElement(h.default,{size:"small",type:"default",shape:"circle",style:{marginLeft:16},onClick:()=>i(),icon:S.default.createElement(v.default,null)})}}get errorCard(){var{detail:{fault:e}}=this.props,a=[{label:t("Message"),content:e.message},{label:t("Code"),content:e.code},{label:t("Created At"),content:(0,V.getLocalTimeStr)(e.created)}];return G.default.hasAdminRole&&(0,l.default)(a).call(a,1,0,{label:t("Details"),content:S.default.createElement("pre",{className:B.default["pre-wrap"]},e.details)}),{labelCol:4,title:t("Error"),options:a,className:B.default["error-card"]}}}a.BaseDetail=U;var Y=(0,I.inject)("rootStore")((0,I.observer)(U));a.default=Y},3587:function(e,t,a){"use strict";a.r(t),t.default="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBzdGFuZGFsb25lPSJubyI/PjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+PHN2ZyB0PSIxNTk0MzYxNjk0MjU0IiBjbGFzcz0iaWNvbiIgdmlld0JveD0iMCAwIDEwMjQgMTAyNCIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHAtaWQ9IjczMyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHdpZHRoPSIyMDAiIGhlaWdodD0iMjAwIj48ZGVmcz48c3R5bGUgdHlwZT0idGV4dC9jc3MiPjwvc3R5bGU+PC9kZWZzPjxwYXRoIGQ9Ik02NTguNyA4NzMuNmgzNi43di0zNi43aC0zNi43djM2Ljd6IG03My41IDBoMzYuN3YtMzYuN2gtMzYuN3YzNi43eiBtNzMuNCAwaDM2Ljd2LTM2LjdoLTM2Ljd2MzYuN3ogbS02NjEtNzMuNWg3NzEuMnYxMTAuMkgxNDQuNlY4MDAuMXpNMTA3LjkgOTQ3aDg0NC42Vjc2My40SDEwNy45Vjk0N3oiIGZpbGw9IiIgcC1pZD0iNzM0Ij48L3BhdGg+PHBhdGggZD0iTTE4MS4zIDY1LjdsLTczLjQgNjk3LjdoMzguM2w3MS44LTY2MWg2MjQuM2w3MS45IDY2MWgzOC4zTDg3OS4xIDY1Ljd6IiBmaWxsPSIiIHAtaWQ9IjczNSI+PC9wYXRoPjxwYXRoIGQ9Ik0yODguNiA1MDNjMC01NiA0NS40LTEwMS41IDEwMS41LTEwMS41aDEuNGM1LjctMzQuOSAyNi4xLTYwLjEgMzEuNi02Ni40IDI2LjQtMzEuOCA2Ni4yLTUyIDExMC43LTUyIDY1LjEgMCAxMjAuMSA0My4zIDEzNy44IDEwMi43IDYuOSAxMS4yIDYuOSA2MiA2LjkgNjYuMnYwLjZjMi41LTAuMiA0LjktMC40IDcuNS0wLjQgNDIgMCA3Ni4xIDQ0LjEgNzYuMSA3Ni4xIDAgMzItMzEgNDIuMy00Mi4yIDQyLjMtMS42IDAtNC42IDAtOC44LTAuMnYwLjJIMzIyLjRjLTcgMC0zMy44LTExLjctMzMuOC02Ny42bTc3LTEzMy4xYy02MyAxMS42LTExMC44IDY2LjgtMTEwLjggMTMzLjEgMCA3NC43IDM4LjggMTAxLjUgNTAuOCAxMDEuNWg0MDUuNnYwLjRjMjEuNiAwIDg0LjgtMTUuOCA4NC44LTc2LjUgMC01Mi0zNi4xLTk1LjYtODQuNy0xMDctMi44LTk1LjYtODEuMi0xNzIuMS0xNzcuNS0xNzIuMS03OC4xIDAtMTQ0LjUgNTAuNS0xNjguMiAxMjAuNiIgZmlsbD0iIiBwLWlkPSI3MzYiPjwvcGF0aD48cGF0aCBkPSJNNDA3LjcgNDAxLjZINDI3YzE1LjYtNDMuMiA1NS40LTc0LjggMTAzLjEtNzguNXYtMTguNGMtNTcuOCAzLjgtMTA2IDQzLjQtMTIyLjQgOTYuOSIgZmlsbD0iIiBwLWlkPSI3MzciPjwvcGF0aD48L3N2Zz4="},3588:function(e,t,a){"use strict";a.r(t),t.default="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBzdGFuZGFsb25lPSJubyI/PjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+PHN2ZyB0PSIxNTk0MzYyMjA0MTg4IiBjbGFzcz0iaWNvbiIgdmlld0JveD0iMCAwIDEwMjQgMTAyNCIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHAtaWQ9IjExOTQiIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB3aWR0aD0iMjAwIiBoZWlnaHQ9IjIwMCI+PGRlZnM+PHN0eWxlIHR5cGU9InRleHQvY3NzIj48L3N0eWxlPjwvZGVmcz48cGF0aCBkPSJNMjM0LjY2NjY2NyAyNTZoNDIuNjY2NjY2VjE3MC42NjY2NjdoLTQyLjY2NjY2NnY4NS4zMzMzMzN6IG0tODUuMzMzMzM0IDBoNDIuNjY2NjY3VjE3MC42NjY2NjdIMTQ5LjMzMzMzM3Y4NS4zMzMzMzN6IG01MzMuMzMzMzM0LTIxLjMzMzMzM2gxNzAuNjY2NjY2VjE5MmgtMTcwLjY2NjY2NnY0Mi42NjY2Njd6TTIzNC42NjY2NjcgNTU0LjY2NjY2N2g0Mi42NjY2NjZ2LTg1LjMzMzMzNGgtNDIuNjY2NjY2djg1LjMzMzMzNHogbS04NS4zMzMzMzQgMGg0Mi42NjY2Njd2LTg1LjMzMzMzNEgxNDkuMzMzMzMzdjg1LjMzMzMzNHogbTUzMy4zMzMzMzQtMjEuMzMzMzM0aDE3MC42NjY2NjZ2LTQyLjY2NjY2NmgtMTcwLjY2NjY2NnY0Mi42NjY2NjZ6IG0yNzcuMzMzMzMzIDE0OS4zMzMzMzRjMTIuOCAwIDIxLjMzMzMzMy04LjUzMzMzMyAyMS4zMzMzMzMtMjEuMzMzMzM0VjY0YzAtMTIuOC04LjUzMzMzMy0yMS4zMzMzMzMtMjEuMzMzMzMzLTIxLjMzMzMzM0g2NGMtMTIuOCAwLTIxLjMzMzMzMyA4LjUzMzMzMy0yMS4zMzMzMzMgMjEuMzMzMzMzdjU5Ny4zMzMzMzNjMCAxMi44IDguNTMzMzMzIDIxLjMzMzMzMyAyMS4zMzMzMzMgMjEuMzMzMzM0aDQyNi42NjY2Njd2OTguMTMzMzMzTDQxOC4xMzMzMzMgODUzLjMzMzMzM0g0Mi42NjY2Njd2NDIuNjY2NjY3aDM3NS40NjY2NjZsNzguOTMzMzM0IDc4LjkzMzMzM2M0LjI2NjY2NyA0LjI2NjY2NyAxMC42NjY2NjcgNi40IDE0LjkzMzMzMyA2LjRzMTAuNjY2NjY3LTIuMTMzMzMzIDE0LjkzMzMzMy02LjRsNzguOTMzMzM0LTc4LjkzMzMzM0g5ODEuMzMzMzMzdi00Mi42NjY2NjdINjA1Ljg2NjY2N0w1MzMuMzMzMzMzIDc4MC44VjY4Mi42NjY2NjdoNDI2LjY2NjY2N3pNODUuMzMzMzMzIDg1LjMzMzMzM2g4NTMuMzMzMzM0djI1Nkg4NS4zMzMzMzNWODUuMzMzMzMzeiBtNDgyLjEzMzMzNCA3ODkuMzMzMzM0TDUxMiA5MzAuMTMzMzMzIDQ1Ni41MzMzMzMgODc0LjY2NjY2N2w1NS40NjY2NjctNTUuNDY2NjY3IDU1LjQ2NjY2NyA1NS40NjY2Njd6TTg1LjMzMzMzMyA2NDBWMzg0aDg1My4zMzMzMzR2MjU2SDg1LjMzMzMzM3oiIHAtaWQ9IjExOTUiPjwvcGF0aD48L3N2Zz4="},3589:function(e,t,a){"use strict";a.r(t),t.default="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBzdGFuZGFsb25lPSJubyI/PjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+PHN2ZyB0PSIxNTk0MzYyODIzMjY3IiBjbGFzcz0iaWNvbiIgdmlld0JveD0iMCAwIDEwMjQgMTAyNCIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHAtaWQ9IjE2MjYiIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB3aWR0aD0iMjAwIiBoZWlnaHQ9IjIwMCI+PGRlZnM+PHN0eWxlIHR5cGU9InRleHQvY3NzIj48L3N0eWxlPjwvZGVmcz48cGF0aCBkPSJNNDM4LjAxIDU2MS4yNzFjMjYuMjEzIDAgNDcuNTQ0LTE3LjY0NyA1NC44NDItNDEuNDY5aDE1NS42NTd2ODMuMDM5aDE5OS42MjZWNDAzLjIxNUg2NDguNTA5djgzLjA4NEg0OTIuODUyYy03LjI5OC0yMy44MjItMjguNjI5LTQxLjQ2OS01NC44NDItNDEuNDY5LTMyLjE1NiAwLTU4LjIyMyAyNi4wNjctNTguMjIzIDU4LjIyMXMyNi4wNjggNTguMjIgNTguMjIzIDU4LjIyeiBtMjQ0LjAwMi0xMjQuNTU0aDEzMi42MjF2MTMyLjYyMUg2ODIuMDEyVjQzNi43MTd6IG0tNTg0LjM4OSAxLjgzN0g2NC4xMnYxNDIuNDc1aDMzLjUwMlY0MzguNTU0ek02NC4xMiAxMDguOTQ5VjM2NC44M2gzMy41MDJWMTQyLjQ1Mmg1NC4xMDV2NzM0LjYzNEg5Ny42MjNWNjU0Ljc1Mkg2NC4xMnYyNTUuODM3aDg5Ni4yMzR2LTgwMS42NEg2NC4xMnpNMTg1LjIzMSAzNjcuMTZoODIuMjExdjEyNS44NThIMTg1Ljg4di0zMS41MzJoLTAuNjQ5VjM2Ny4xNnogbTAgMTkwLjkzNmgwLjY0OVY1MjYuNTJoODEuNTYxdjEyNS44NThIMTg1LjIzdi05NC4yODJ6IG03NDEuNjIxIDMxOC45OWgtOTUuMDg4Vjc0OS40ODFoLTMzLjUwMnYxMjcuNjA1aC02Ni40NDVWNzQ5LjQ4MWgtMzMuNTAydjEyNy42MDVoLTY2LjQ2N1Y3NDkuNDgxaC0zMy41MDJ2MTI3LjYwNWgtNjYuNDY3Vjc0OS40ODFoLTMzLjUwMnYxMjcuNjA1SDE4NS44OHYtMjkuMTEzaC0wLjY0OXYtOTYuNjExaDAuNjQ5VjY4NS44OGgxMTUuMDY0VjMzMy42NTdIMTg1Ljg4VjI2OC4yMmgtMC42NDl2LTk2LjY1NWgwLjY0OXYtMjkuMTEzaDc0MC45NzJ2NzM0LjYzNHoiIGZpbGw9IiIgcC1pZD0iMTYyNyI+PC9wYXRoPjwvc3ZnPg=="},3590:function(e,t,a){var r=a(3591);"string"==typeof r&&(r=[[e.i,r,""]]);var i={hmr:!0,transform:undefined,insertInto:void 0};a(75)(r,i);r.locals&&(e.exports=r.locals)},3591:function(e,t,a){(t=e.exports=a(74)(!1)).push([e.i,"/* init */\n/* specific color */\n/* border */\n/* background */\n/* shadow */\n/* font */\n/* 中号字体 */\n/* animation */\n/* size */\n/* sider */\n.index__topology-content--1cSJn {\n overflow: auto;\n}\n.index__topology-content--1cSJn .index__vm-interface--1d_Ey:first-child {\n border-left: 1px solid #d2d2d2;\n}\n.index__topology-content--1cSJn .index__vm-interface--1d_Ey:first-child .index__interface-line--8fWUK {\n border-left: none;\n}\n.index__topology-content--1cSJn .index__vm-interface--1d_Ey {\n display: inline-block;\n margin-left: 35px;\n padding-bottom: 20px;\n}\n.index__topology-content--1cSJn .index__vm-interface--1d_Ey .index__interface-line--8fWUK {\n display: inline-block;\n width: 8px;\n height: 60px;\n border-bottom: 1px solid #d2d2d2;\n border-left: 1px solid #d2d2d2;\n}\n.index__topology-content--1cSJn .index__vm-interface--1d_Ey .index__interface-item--NVhcx {\n display: inline-block;\n}\n.index__topology-content--1cSJn .index__vm--3TPR2 {\n padding: 16px;\n background-color: #fbfdff;\n border: 1px solid #cfe1ff;\n border-radius: 4px;\n}\n.index__topology-content--1cSJn .index__vm--3TPR2 .index__vm-icon--1c_A9 {\n display: inline;\n padding-right: 24px;\n font-size: 25px;\n}\n.index__topology-content--1cSJn .index__vm--3TPR2 .index__vm-status--15Fe3 {\n display: inline-block;\n width: 6px;\n height: 6px;\n margin-right: 13px;\n margin-left: 5px;\n border-radius: 6px;\n}\n.index__topology-content--1cSJn .index__vm--3TPR2 .index__vm-info--2-5wS {\n display: inline;\n}\n.index__topology-content--1cSJn .index__vm--3TPR2 .index__vm-info--2-5wS .index__info-item--Rk6uB {\n padding-bottom: 8px;\n}\n.index__topology-content--1cSJn .index__vm--3TPR2 .index__vm-info--2-5wS .index__info-item--Rk6uB .index__info-item-icon--2OgR6 {\n display: inline;\n height: 16px;\n padding-right: 8px;\n}\n.index__topology-content--1cSJn .index__vm--3TPR2 .index__vm-info--2-5wS :last-child {\n padding-bottom: 0;\n}\n.index__topology-content--1cSJn .index__vm-volume--1T2Ma {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n}\n.index__topology-content--1cSJn .index__vm-volume--1T2Ma .index__volume-inline--2lwJK {\n width: 36px;\n margin-bottom: 12px;\n border-right: 1px solid #d2d2d2;\n}\n.index__topology-content--1cSJn .index__vm-volume--1T2Ma .index__volume-content--34D9n {\n -webkit-box-flex: 1;\n -ms-flex: 1;\n flex: 1;\n}\n.index__topology-content--1cSJn .index__vm-volume--1T2Ma .index__volume-content--34D9n .index__attached-volume--13RWR {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n padding: 8px 0;\n}\n.index__topology-content--1cSJn .index__vm-volume--1T2Ma .index__volume-content--34D9n .index__attached-volume--13RWR .index__attached-volume-line--3LhIZ {\n width: 60px;\n height: 52px;\n border-bottom: 1px solid #d2d2d2;\n}\n.index__topology-content--1cSJn .index__vm-volume--1T2Ma .index__volume-content--34D9n .index__attached-volume--13RWR .index__attached-volume-content--1te6S {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-flex: 1;\n -ms-flex: 1;\n flex: 1;\n padding: 16px;\n background-color: #fbfdff;\n border: 1px solid #cfe1ff;\n border-radius: 4px;\n}\n.index__topology-content--1cSJn .index__vm-volume--1T2Ma .index__volume-content--34D9n .index__attached-volume--13RWR .index__attached-volume-content--1te6S .index__volume-icon--2SMM2 {\n padding-right: 24px;\n font-size: 25px;\n}\n.index__topology-content--1cSJn .index__vm-volume--1T2Ma .index__volume-content--34D9n .index__attached-volume--13RWR .index__attached-volume-content--1te6S .index__volume-info--2gdLd {\n -webkit-box-flex: 1;\n -ms-flex: 1;\n flex: 1;\n}\n.index__topology-content--1cSJn .index__vm-volume--1T2Ma .index__volume-content--34D9n .index__attached-volume--13RWR .index__attached-volume-content--1te6S .index__volume-info--2gdLd .index__volume-info-item--1GH_g {\n padding-bottom: 8px;\n}\n.index__topology-content--1cSJn .index__vm-volume--1T2Ma .index__volume-content--34D9n .index__attached-volume--13RWR .index__attached-volume-content--1te6S .index__volume-info--2gdLd .index__volume-info-item--1GH_g .index__info-key--3NbQp {\n margin-right: 8px;\n}\n.index__topology-content--1cSJn .index__vm-volume--1T2Ma .index__volume-content--34D9n .index__attached-volume--13RWR .index__attached-volume-content--1te6S .index__volume-info--2gdLd :last-child {\n padding-bottom: 0;\n}\n.index__topology-content--1cSJn .index__vm-volume--1T2Ma .index__volume-content--34D9n .index__attach-action-line--2PNV3 {\n display: inline-block;\n width: 60px;\n height: 24px;\n margin-right: 10px;\n border-bottom: 1px solid #d2d2d2;\n}\n.index__attach-btn--29U51 {\n max-width: 100px;\n}\n.index__attach-btn--29U51 span {\n max-width: 80px;\n}\n.index__error-card--2sRLi {\n -webkit-box-flex: 0;\n -ms-flex-positive: 0;\n flex-grow: 0;\n}\n.index__error-card--2sRLi .index__pre-wrap--2mXzo {\n font-family: Monaco, Menlo, Consolas, 'Courier New', monospace;\n white-space: pre-wrap;\n word-wrap: break-word;\n}\n",""]),t.locals={"topology-content":"index__topology-content--1cSJn","vm-interface":"index__vm-interface--1d_Ey","interface-line":"index__interface-line--8fWUK","interface-item":"index__interface-item--NVhcx",vm:"index__vm--3TPR2","vm-icon":"index__vm-icon--1c_A9","vm-status":"index__vm-status--15Fe3","vm-info":"index__vm-info--2-5wS","info-item":"index__info-item--Rk6uB","info-item-icon":"index__info-item-icon--2OgR6","vm-volume":"index__vm-volume--1T2Ma","volume-inline":"index__volume-inline--2lwJK","volume-content":"index__volume-content--34D9n","attached-volume":"index__attached-volume--13RWR","attached-volume-line":"index__attached-volume-line--3LhIZ","attached-volume-content":"index__attached-volume-content--1te6S","volume-icon":"index__volume-icon--2SMM2","volume-info":"index__volume-info--2gdLd","volume-info-item":"index__volume-info-item--1GH_g","info-key":"index__info-key--3NbQp","attach-action-line":"index__attach-action-line--2PNV3","attach-btn":"index__attach-btn--29U51","error-card":"index__error-card--2sRLi","pre-wrap":"index__pre-wrap--2mXzo"}},3592:function(e,a,r){"use strict";var i=r(33),n=r(44),l=r(32),o=r(25),s=r(27),u=r(45),d=r(46),c=r(19),f=r(21);c(a,"__esModule",{value:!0}),a.default=a.SecurityGroup=void 0;var p=f(r(32)),m=f(r(90)),h=f(r(57)),v=f(r(1395));r(337);var g=f(r(338));r(581);var y=f(r(423));r(572);var b=f(r(574)),_=f(r(409));r(1198);var S=f(r(1199));r(1196);var M=f(r(1197));r(333);var I=f(r(332));r(1250);var x=f(r(1251)),A=f(r(51)),w=f(r(36));r(1260);var N=f(r(1261));r(1404);var C=f(r(1405)),P=f(r(0)),k=r(406),j=r(34),T=f(r(408)),D=(r(173),f(r(1333))),z=f(r(4)),L=f(r(3597)),E=(r(555),f(r(1249))),O=r(347),R=r(161),V=r(558),F=f(r(3598)),G=f(r(3600)),B=f(r(3601));function U(e,t){var a=i(e);if(n){var r=n(e);t&&(r=l(r).call(r,(function(t){return o(e,t).enumerable}))),a.push.apply(a,r)}return a}function Y(e){for(var t=1;t<arguments.length;t++){var a,r=null!=arguments[t]?arguments[t]:{};if(t%2)s(a=U(Object(r),!0)).call(a,(function(t){(0,w.default)(e,t,r[t])}));else if(u)d(e,u(r));else{var i;s(i=U(Object(r))).call(i,(function(t){c(e,t,o(r,t))}))}}return e}var{Panel:H}=C.default,{TabPane:q}=N.default;class K extends P.default.Component{constructor(e){var t,a;super(e),t=this,(0,w.default)(this,"componentDidMount",(0,A.default)((function*(){t.actionCallback(!0)}))),(0,w.default)(this,"actionCallback",function(){var e=(0,A.default)((function*(e){var{match:{params:{id:a}}}=t.props;yield t.store.fetchSecurityGroup({id:a});var{activeInterface:r}=t.state,i=e?t.store.securityGroups.interfaces[0]:r;t.filterSecurityGroup(i)}));return function(t){return e.apply(this,arguments)}}()),(0,w.default)(this,"filterSecurityGroup",(e=>{var t,{data:a}=this.store.securityGroups,r=(0,p.default)(t=(0,j.toJS)(a)).call(t,(t=>{var a;return-1!==(0,m.default)(a=e.security_groups).call(a,t.id)}));this.setState({activeInterfaceId:e&&e.id,activeInterface:e,filterData:r})})),this.state={activeInterfaceId:null,activeInterface:null,filterData:[]},this.store=T.default,this.tableColumns=(0,p.default)(a=(0,O.getSelfColumns)(this)).call(a,(e=>"direction"!==e.dataIndex))}get isAdminPage(){var{pathname:e}=this.props.location;return(0,R.isAdminPage)(e)}get showActions(){return!this.isAdminPage}getDetailUrl(e){var t=this.isAdminPage?"securityGroupDetailAdmin":"securityGroupDetail";return(0,V.getPath)({key:t,params:{id:e}})}renderPanelTitle(e){var{activeInterfaceId:a,filterData:r}=this.state,i=Y(Y({},e),{},{activeInterfaceId:a,filterData:r});return P.default.createElement("div",null,P.default.createElement(S.default,null,P.default.createElement(M.default,{span:22},P.default.createElement("span",null,t("Security Group")),P.default.createElement(x.default,{type:"vertical",className:F.default["header-divider"]}),P.default.createElement(I.default,{type:"link"},e.name)),P.default.createElement(M.default,{span:2},1!==r.length&&this.showActions?P.default.createElement(E.default,{actions:{firstAction:G.default},onFinishAction:this.actionCallback,item:i},t("Detach")):null)))}renderPanel(e,a){var r,i,n=(0,p.default)(r=e.security_group_rules).call(r,(e=>"egress"===e.direction)),l=(0,p.default)(i=e.security_group_rules).call(i,(e=>"ingress"===e.direction));return P.default.createElement(H,{header:this.renderPanelTitle(e,a),key:e.id,className:F.default.panel},P.default.createElement(N.default,{defaultActiveKey:"".concat(e.id,"-1")},P.default.createElement(q,{tab:t("Egress"),key:"".concat(e.id,"-1")},P.default.createElement(b.default,(0,_.default)({size:"middle",pagination:!1,bordered:!1},this.state,{columns:this.tableColumns,dataSource:n}))),P.default.createElement(q,{tab:t("Ingress"),key:"".concat(e.id,"-2")},P.default.createElement(b.default,(0,_.default)({size:"middle",pagination:!1,bordered:!1},this.state,{columns:this.tableColumns,dataSource:l})))))}renderRadio(e,a){return P.default.createElement(y.default.Button,{onClick:()=>this.filterSecurityGroup(e),value:a},P.default.createElement("div",null,P.default.createElement(S.default,null,P.default.createElement(M.default,{span:10},P.default.createElement("img",{className:F.default.image,alt:"example",src:L.default})),P.default.createElement(M.default,{span:14},P.default.createElement("div",{style:{fontSize:12}},t("Interface Name:")," ",e.id.substring(0,8)," "),P.default.createElement("div",{className:F.default["security-group-text"]},t("Security Group Num:")," ",e.security_groups.length)))))}render(){var e,{interfaces:a,isLoading:r}=this.store.securityGroups,{filterData:i,activeInterfaceId:n,activeInterface:l}=this.state,{port_security_enabled:o=!1}=l||{};return P.default.createElement("div",{className:(0,z.default)(F.default.wrapper,this.className)},P.default.createElement(g.default,{spinning:r},P.default.createElement(y.default.Group,{defaultValue:0,size:"large",marginBottom:"20",onChange:this.onChange,className:F.default["radio-button"]},a?(0,h.default)(e=(0,j.toJS)(a)).call(e,((e,t)=>this.renderRadio(e,t))):null)),this.showActions&&o&&P.default.createElement("div",{style:{marginBottom:20,marginTop:20}},P.default.createElement(D.default,{primaryActions:[B.default],onFinishAction:this.actionCallback,containerProps:{port:n,portItem:l,filterData:i}},t("Attach Security Group"))),i&&i.length?P.default.createElement(g.default,{spinning:r},P.default.createElement(C.default,{className:F.default.collapse,accordion:!0,bordered:!1,expandIcon:e=>{var{isActive:t}=e;return P.default.createElement(v.default,{rotate:t?90:0})}},(0,h.default)(i).call(i,((e,t)=>this.renderPanel(e,t))))):null)}}a.SecurityGroup=K;var Q=(0,k.inject)("rootStore")((0,k.observer)(K));a.default=Q},3597:function(e,t,a){"use strict";a.r(t),t.default="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIQAAABSCAYAAACVI3yVAAAAAXNSR0IArs4c6QAADzJJREFUeAHtXXtwVOUVP9/m/dwNJCEkIckmvFUQCgjyRotYAj6KvHy0Ao1JIAqlzOhoMfBHO1qrdVq1OO1UZzpjH7ZTWx9YB2up1VE7tbXTFjvyKKJFRCWKvELy9XfuJmSz2c3e7+zm7t0l38ySvfd+537nnPu75zvnfOdbFJ1vrUVn0RlaQh6aAdFHkKb8800FIfIehw4eox3qWT6vQi6m9mGjngkBv4ZPaWoLaiidpk4qoBV0n/o83ZA0Obtfp9OomBrxJixOTgEc4Dof2kFLfUBs0jl0ku6AuFMcUGtyDuGhR6lVnWDmU3vKaNDFlEatAENtcj6pAee6HQi4nx5Rf+weKXUB0aDrusAwtFvYwb+9NNCG+WEb/UDtCT6bmoBo1NMg5O34ZAcLO/i9SwOa3oVmttKD6oNQnaQeIJr0UgjZgGnCEyrs4LGlgTcRaH+LI4pw+kgdQLRqDx22Qsqrwgk6eM7SwE5aQA/RctURSR+pAYhWnQ0w8BTBU8Vg66sBDYv5EySfnux7qfeZ5AfEJj0EYeU2iFXXW7TBI0sDik4jkvgOPaxesaOR5AbEBu2nsxYYiu0Iex72+RieVCvA8I5d2ZPX8bpFT6EOug+CDoIh/NPeT3m00QQMfJvktBBNmlPQTYORRHgk4OzrlEP30APqZMQeES4kFyA4kviA1gAI10aQJ/ppbb0E+fg3B50z8EleKxle2rdwejfks9YmwncJOuuBj3GW3oDD+S8+mzyA+CoiiWzaAp552VracqAmH6ROxTUchvpuKIYBYdYYPKX0ONYzziSHYtYiksiguyHlKDNJe/UuwhFbhlRsZyDXTgj231iFcz8gGnUNhN0GDJeIhOX3RhGvZ/AUkYrtM8j3Owj2kVi4TnqVrQPTuxsQ6/VkzG93gk/Zw9RY3lJWFJIpVpa7CY90gcFaujZmVSFOS6OX6PtqbzetewHRpK8EGNZDYKnTxw4jW5W0bmFT7O9eWM3fQz9nRXIpOoVp+PnQBS73zahaKwSUN0PIZSJBmUhbq5zFUJb75BMLFUSo6K84+nPQGbOvHjqGHMVzdK/6LJTQXQrjAth2+gaY5NpHaeOiWR8+7pJNKk1vuk4c/gGSWSFi70u2j96jYfRCt88QSuWeKWOj9iEi5khiTCiTto8DIWWB7f7J1fE0Js9nYf0Oidn20B5Moi8DDAyssM0db1GDroKw28FhaVguo51M/UiiDVaBI4lPoqki4vV0eg3O498jXu+6kHgL0awvRhE4RxJ50ZiNcJ2dTnYeUzOS0PQ/yPYMAGGchrb05YHTmUEv0vfUAes4yj+JBUSzXggwtIBHaSSQYeUnlJg+inoSfvltJAZ2QUcRC1qicHgC7vVO+q46GqXfucuJmTI4kmimm/AwV5zjxPQLRxKBhJM0LDUd0en+r0O+18SDKvoYtDux2nnc5B7OA6JVZ6K66etgco4JoyF9UzeS0LAGHlgFordDZLZ/qOggJopd9Khqt08U6OksIBq0F8Z9KyzDOFNGz/WPIZJQyEsU5dKQvCwqzEqnLAjPU5WzOjgnSN8vWUilzR9LNKyw7zW7Z0YNI/pCtT2hoI+PsSR6V51PPdJ9f+eU0aIrgdrtAENZ9+BGf2OMJAqyqaA4n8rSPZRlNK5DnQuRnL98PBH4FDU8XJpcRTQagDBpoOvAW1FS7VNWBOOMU9mkJwAMdwEMbOolLaZIorSQhnmzhYtjEm4NacqQRps3mogthKSl44nOrCMq53ScoHVyCW5XG3hANOnLMdatGFI6FkcSnIY2pucpotxLlbmZ5O0W2G1/R+KNno6HmSa01Zj+aA7A5BMs/0E/Gp/Nfp861q0XIRvd5FH+Nuob0WNVlF6RL8cQSWBqSKsoourMNMqNPEBir0zCXD+hUs7DENjbOSOxFCzIwAAIp/C52e9VPwvmwPitCyaO+H2HzqA3aROuz4vYJ9oFjUSVIi5qMQYtO4wMBrx1AlVFYyz262kw8bNGEdVwlYawVUIzM2BZAHzzpuhDj4euqilUr4YSGys79AZ9jlt0IRaotuI8XCRxYxMv8rXzMimvzEtVHpcmq/ht5kiiJIYVl7Fwyy+GAyl5eLAK/waGFtf41P5wT0dyz3D3CZxr1BXgkqubyiN36udKIJIYgh4iM4951AdFV4A+vnL1w7LJJR+S85cBDPnCSAJvNU3BNFMnqx1jrezyaFrmL+rxGUL5j5/iGvWFuPk38ZFin40f77EQhYUAQikAIVscw6AD3cph4ueOwYILpgtJy8DkPgtTBKyfqMEy/MjvpSalVL8FNfEBRLOej/zaJiBQ6pOkw6qUSOghqOsjiTEw8dP8qPeXzPd4/BxJzAOYCgWWBfrBOgHdjkjiXjtIih0QTXo1HuYNdgaL0IctAlsGY3VxJIHYuwpOpHSlNAJL8TmNh0FTauBMySZQiwkk06ywEjIaNwx/Akq9saZI/dousRwQDYgkPMgvYFq0O1iffjFEEpnplFnho2q3Zh45WcT5gRHsEQlbNV6TS/yyHAXAeBgYWlLlU38xGV6AO9x+jS6AeWd/gf0GafPiHqJIAommPFiGEUCzjH8pxzbpcmHzFmC1ZmgMdusCuMYT2D0WNOjlraxMqq/IVe+akpsrdKMejnrd7RhIxm4cIoniQipXLv2FmCEAAYOB531JQ7hM02qJ/NIchaLnCry0okT1LaC1ww+GN2i36PGYJni1UvRmYyT2E+SRRD4iiVz3RhI8PcyG85fBUgoaRyA8zUhzFHiYD/l9dBsiiQ7B8BaJfUA06bmo3NksiQS6mIspkhheSBV464TLN1L12KcbB8eRHUh+wyWNVznnAgyS1U74Cx34bEYa+kHJ2ME09thv1CtBdFMwoeF3cSTBGUekoauy3RpJwBqw48ehpbRx/cPMkUjAmE/gPORx2N2VdV71jHT8YLr+AdGq01HdxDWPXwwmMvzOWUf2tfsfK8xN3R5JZMDEz0XmEdGOuPmRdZxWI7Ysh1QG1dfmR6+mtstg5IfUrPO7qqEn2r1ZmH7sa4hya8j550LRVWBQ9t6EYSaepzj9vABgKIohkuCVzgukOQrs3srIQFiZp96Pp1zhld2sy+A4bsNAI8SDKVgFzjMImjeHvLwmATAI3TPBoAYkxUjOMxgky848TBqkml5LVCXMUUAvT2V7aXW5Cvw+tQHrUbvi3iFtgx6L6qa7cVb0ZoOOH6I4koCyS4pysNnMpa0a4SAvXXPiSdKyURU1G/ScgZQ05aH7/YW0BZFEp4Q+Gk1vQDTrWZgmtoAIbIuaOJKANVFINpUjkuAaCFe2i2Diuailt9LsswrLZ4WV+ZIcBXZ5403bgDWJHfZHNO/ZIxv/kJfG9nt5izWSGIFIQvjeyJm2Q8mLUlzmNiqGtVRepeRIQrja2Yaw8rpan3rBDr+x9AkAIvD7Tb/EjYSGEPULGj6DYPs9FJQB57EGJljy3sQiuy1aLnzl/MDwGCIJBtJkWBZJjgJAOIAKq/rqAvVPWwzH2CngVNbgLofFdwpEEj22xvaN4JTloAi2GooK79zavtPAdGR/YYofBS0xQHUS3PKxw2X8AQyv5abR0rICdUR2B3OqnsfYqK8A+Rp87Be4BKyCKJLAPgRvqcsiCZ4aMG1RKcz7aLzVsVgFdjpn1BJx7aOkAQy/UF76il+pUxJ6KU0PIEzuwD/s0UELMU2IsH/DdFo0bjhdrXmhKwVbDqaZOWOQjRMVAlpTy7drvHQnIgnttHrMHwgX0XbQlQCDcViK1Gzaull0Pd68mU4L6tR42CpoRRJYojdvitpR89iAmsfHzInjQ2EGCE5YkWUZkKcza758ylk3k25B3SMWh1OzYc3FmiY4pW3aMEV8AntwLcDwkiltPPvbB0QL/g+rszQfg2OmNWu1JTR09TTagKSMNFFrNmACevOeSo4k7Cs0iElF70Cri+sK1X+Czibkqz3vvkVPAhimSjic6if/4ouoGaVu0hoKybCO0eDNtnZbS3MUIP9TpoeuqSxUHznGdD8D9Q9o/rHxo/gdhw5CJG7erryQJl1aR2ugNMmMaj6gwxQcScSyyRbK/ykKWtbCeTzjMOsRh4sMCI4kOrHs3Skz86svoYVYybs2VSMJ7BCzIgnJJlt+Gghx70ZBy/aITyZBF8IDgiOJTlqEj3F+Dg6VZ+1sWlXpi+kXYhKkDnvDxrLJFk7GaSTieJPtE/ZGc7ZXX0Dcpodhb+YVCCvNI4k8yl6LSAKh13hnxXBuNK6b5KVr+ETmTdFRLH3zJttXzImdoegNiCZdCwTPBxiMA6eaYhrCkQTib1k1tjPyxjQKb7jhopbeSrN3S/hRe6DUxfilln32KBLTqyfKaEFF9VmaBTAYN2xAra6fSOvx1hgnq4wHSwABp7SnIqRE+Cxril5EjuHL1f1sspXdOP5UAUBw7eSHdKnk9gsvpInYhLoO82JKRhK8yXb2SPkPgcEy/Lhrk227RL9O0wQA8T6soKAkZuVUuuyiCloGoyKZUZ2W1Xg89hd4tVKy6QZA4E22d6Cg5R7jgRNI0DMdculcB10CXrKi8QNroBrm0Eqs5M2L1jeZrnevdnJ520isdkp/HhBKPQk03Iif+/tVMsnPvPYAwibnR7TO/6yNfg5f40s2Sc6rbrAMhwGGpdgn8UYyCm4EiEMndOWZ0/Q0poiJySisAzz/A8F6fV2OOujAWAMyhG1AHPhET0KZL4MBwddgC9UALMNObLJdLt1kG3q/RB3bcgb3fqrrsXt09yAYwj8mgOFhRBL1yQ4Gli4qIPa16RbsAPgN+rqyIjr8I3LmLIDQCQVuQjX0eixQ4Z1J/hZxytBae/YfowdgFW5NfjEHRILjyOeuQg3D0wNy9wTdNCwgDmudd+IYPQEwLEkQX24f9j1YhnpUN/3N7Yya8tcHEAc/1+Xt7fj/nTRNNr3ZedF/gDbZukV3vQCx77ieoNvx/zuhetwtDLqJDyjrt7k+Wl2m1Odu4iuevJxzKve36UUAw8u4+SAYwmgYWcwHUN10TSqDgcW21jL2tunrUdn0OI6Nl73D6C61TgU22bagoOWHqSVYeGkUoom0fces/7ArJYtgw4tt++ynsAzLAYbnbVMkecfuKaOXL5HkMsWFfSjkqXRFk84nMLDiPJxQQYJlHT4fxEWTyXoTTA1g/T3o4Ul8rqgtUle7vbppIFT9f2bufJ+IENUJAAAAAElFTkSuQmCC"},3598:function(e,t,a){var r=a(3599);"string"==typeof r&&(r=[[e.i,r,""]]);var i={hmr:!0,transform:undefined,insertInto:void 0};a(75)(r,i);r.locals&&(e.exports=r.locals)},3599:function(e,t,a){(t=e.exports=a(74)(!1)).push([e.i,"/* init */\n/* specific color */\n/* border */\n/* background */\n/* shadow */\n/* font */\n/* 中号字体 */\n/* animation */\n/* size */\n/* sider */\n.index__wrapper--310WV {\n min-height: calc(100vh - 108px);\n padding: 0 16px;\n}\n.index__collapse--wSiUn {\n margin-bottom: 24px;\n overflow: hidden;\n}\n.index__panel--30Vl4 {\n margin-bottom: 24px;\n padding-top: 12px;\n padding-bottom: 12px;\n font-size: larger;\n background: #fff;\n}\n.index__header-divider--3ZGVN {\n width: 2px;\n margin: 0 5px;\n background-color: rgba(0, 0, 0, 0.45);\n}\n.index__image--1tdnF {\n width: 70px;\n padding: 10px;\n}\n.index__radio-button--2cF9L .ant-radio-button-wrapper {\n width: 250px;\n height: 100px;\n margin-right: 40px;\n margin-bottom: 20px;\n padding: 15px;\n}\n.index__security-group-text--3v-p7 {\n font-size: 12px;\n}\n",""]),t.locals={wrapper:"index__wrapper--310WV",collapse:"index__collapse--wSiUn",panel:"index__panel--30Vl4","header-divider":"index__header-divider--3ZGVN",image:"index__image--1tdnF","radio-button":"index__radio-button--2cF9L","security-group-text":"index__security-group-text--3v-p7"}},3600:function(e,a,r){"use strict";var i=r(19),n=r(21);i(a,"__esModule",{value:!0}),a.default=void 0;var l=n(r(27)),o=n(r(36)),s=r(1193),u=n(r(416));class d extends s.ConfirmAction{constructor(){super(...arguments),(0,o.default)(this,"policy","update_port"),(0,o.default)(this,"allowedCheckFunc",(()=>!0)),(0,o.default)(this,"onSubmit",(e=>{var{activeInterfaceId:t,filterData:a,id:r}=e,i=[];(0,l.default)(a).call(a,(e=>{e.id!==r&&i.push(e.id)}));var n={port:{security_groups:i}};return u.default.updatePortSecurityGroup({id:t,reqBody:n})}))}get id(){return"detach"}get title(){return t("Detach Security Group")}get isDanger(){return!0}get buttonText(){return t("Detach")}get actionName(){return t("detach security group")}}a.default=d},3601:function(e,a,r){"use strict";var i=r(19),n=r(21);i(a,"__esModule",{value:!0}),a.default=a.ManageSecurityGroup=void 0;var l=n(r(57)),o=n(r(65)),s=n(r(36)),u=r(406),d=r(1193),c=n(r(408)),f=r(416),p=r(1274);class m extends d.ModalAction{constructor(){super(...arguments),(0,s.default)(this,"onSubmit",(e=>{var{securityGroup:{selectedRowKeys:t=[]}={}}=e,{port:a}=this.containerProps,r={port:{security_groups:t}};return this.securityGroupStore.updatePortSecurityGroup({id:a,reqBody:r})}))}init(){this.store=c.default,this.securityGroupStore=new f.SecurityGroupStore}static get modalSize(){return"large"}getModalSize(){return"large"}get name(){return t("Manage Security Group")}get messageHasItemName(){return!1}get defaultValue(){var{filterData:e=[]}=this.containerProps;return{securityGroup:{selectedRowKeys:(0,l.default)(e).call(e,(e=>e.id)),selectedRows:e}}}get formItems(){return[{name:"securityGroup",label:t("Security Group"),type:"select-table",required:!0,tips:t("The security group is similar to the firewall function for setting up network access control, or you can go to the console and create a new security group. (Note: The security group you selected will work on all virtual LANS on the instances.)"),backendPageStore:this.securityGroupStore,extraParams:{project_id:this.currentProjectId},isMulti:!0,filterParams:p.securityGroupFilter,columns:p.securityGroupColumns,onRow:()=>{}}]}}a.ManageSecurityGroup=m,(0,s.default)(m,"id","manage-security-group"),(0,s.default)(m,"title",t("Manage Security Group")),(0,s.default)(m,"policy","update_port"),(0,s.default)(m,"allowed",(()=>o.default.resolve(!0)));var h=(0,u.inject)("rootStore")((0,u.observer)(m));a.default=h},3602:function(e,a,r){"use strict";var i=r(19),n=r(21);i(a,"__esModule",{value:!0}),a.default=a.ActionLog=void 0;var l=n(r(36)),o=r(406),s=n(r(1194)),u=n(r(1533)),d=r(1195);class c extends s.default{constructor(){super(...arguments),(0,l.default)(this,"getColumns",(()=>(0,d.actionColumn)(this)))}init(){this.store=u.default}get name(){return t("Action Logs")}get rowKey(){return"request_id"}get policy(){return"os_compute_api:os-instance-actions:list"}get hideSearch(){return!0}}a.ActionLog=c;var f=(0,o.inject)("rootStore")((0,o.observer)(c));a.default=f},3603:function(e,a,r){"use strict";r(19)(a,"__esModule",{value:!0}),a.getBaseSnapshotColumns=void 0;var i=r(563);a.getBaseSnapshotColumns=e=>[{title:t("ID/Name"),dataIndex:"name",routeName:e.getRouteName("instanceSnapshotDetail")},{title:t("Project ID/Name"),dataIndex:"project_name",isHideable:!0,hidden:!e.isAdminPage,sorter:!1},{title:t("Description"),dataIndex:"description",isHideable:!0,sorter:!1},{title:t("Disk Format"),dataIndex:"disk_format",isHideable:!0,valueMap:i.imageFormats},{title:t("Status"),dataIndex:"status",valueMap:i.imageStatus},{title:t("Created At"),dataIndex:"created_at",isHideable:!0,valueRender:"sinceTime"}]},3604:function(e,a,r){"use strict";var i=r(19),n=r(21);i(a,"__esModule",{value:!0}),a.default=a.CreateVolume=void 0;var l=n(r(1204)),o=n(r(65)),s=n(r(102)),u=n(r(81)),d=n(r(51)),c=n(r(36)),f=r(406),p=r(34),m=r(1193),h=n(r(410)),v=r(1339),g=r(557);class y extends m.ModalAction{constructor(){super(...arguments),(0,c.default)(this,"onSubmit",(e=>{var{name:t,size:a,volume_type:r}=e,i={imageRef:this.item.id,name:t,size:a};return i.volume_type=r||this.volumeType,h.default.create(i)}))}init(){this.volumeStore=h.default,this.snapshotStore=new v.InstanceSnapshotStore,this.getVolumeTypes(),this.getMinSize()}get name(){return t("Create Volume")}get instanceName(){return(0,l.default)(this).name}static get disableSubmit(){return(0,g.checkQuotaDisable)()}static get showQuota(){return!0}get showQuota(){return!0}get quotaInfo(){return(0,g.getQuotaInfo)(this)}getVolumeTypes(){var e=this;return(0,d.default)((function*(){var t,{id:a}=e.item,[r,i]=yield o.default.all([e.volumeStore.fetchVolumeTypes(),e.snapshotStore.fetchDetail({id:a})]),{volumeDetail:{volume_type:n}={}}=i,l=(0,s.default)(t=e.volumeTypes).call(t,(e=>e.label===n));l&&(e.volumeType=l.value,(0,g.setCreateVolumeType)(n)),e.updateFormValue("volume_type",e.volumeType)}))()}getMinSize(){var e=this;return(0,d.default)((function*(){var{id:t}=e.item;e.snapshot&&e.snapshot.volume_size?(0,g.fetchQuota)(e,e.minSize):(yield e.snapshotStore.fetchDetail({id:t}),(0,g.fetchQuota)(e,e.minSize),e.updateDefaultValue())}))()}get volumeTypes(){return this.volumeStore.volumeTypes}get tips(){return t("Snapshots can be converted into volume and used to create an instance from the volume.")}get defaultValue(){var{name:e}=this.item;return{snapshot:e,size:this.minSize,volume_type:this.volumeType}}get bdmData(){var{block_device_mapping:e="[]"}=this.item;return JSON.parse(e)}get snapshot(){var e;return(0,s.default)(e=this.bdmData).call(e,(e=>0===e.boot_index))}get minSize(){var{min_disk:e,size:t}=this.item,a=Math.max(e,Math.ceil(t/1024/1024/1024),1,(this.snapshot||{}).volume_size||1);if(a)return a;var{snapshotDetail:{size:r=0}={}}=(0,p.toJS)(this.snapshotStore.detail)||{};return Math.max(r,1)}get formItems(){var e,{more:a}=this.state;return[{name:"snapshot",label:t("Volume Snapshot"),type:"label",iconType:"snapshot"},{name:"name",label:t("Name"),type:"input-name",placeholder:t("Please input name"),required:!0},{name:"size",label:t("Capacity (GiB)"),type:"input-int",min:this.minSize,extra:(0,u.default)(e="".concat(t("Min size"),": ")).call(e,this.minSize,"GiB"),required:!0,onChange:g.onVolumeSizeChange},{name:"more",type:"more",label:t("Advanced Options")},{name:"volume_type",label:t("Volume Type"),type:"select",options:this.volumeTypes,placeholder:t("Please select volume type"),hidden:!a,onChange:g.onVolumeTypeChange}]}}a.CreateVolume=y,(0,c.default)(y,"id","create"),(0,c.default)(y,"title",t("Create Volume")),(0,c.default)(y,"policy","volume:create_from_image"),(0,c.default)(y,"allowed",(()=>o.default.resolve(!0)));var b=(0,f.inject)("rootStore")((0,f.observer)(y));a.default=b},3605:function(e,a,r){"use strict";var i=r(19),n=r(21);i(a,"__esModule",{value:!0}),a.default=a.StepCreate=void 0;var l=n(r(65)),o=n(r(36)),s=r(406),u=n(r(1253));class d extends u.default{static path(e){return"/compute/instance/create?snapshot=".concat(e.id)}static allowed(e){return l.default.resolve("active"===e.status)}}a.StepCreate=d,(0,o.default)(d,"id","instance-create"),(0,o.default)(d,"title",t("Create Instance")),(0,o.default)(d,"policy","os_compute_api:servers:create");var c=(0,s.inject)("rootStore")((0,s.observer)(d));a.default=c},3606:function(e,a,r){"use strict";var i=r(19),n=r(21);i(a,"__esModule",{value:!0}),a.default=a.EditAction=void 0;var l=n(r(27)),o=n(r(33)),s=n(r(65)),u=n(r(36)),d=n(r(559)),c=n(r(111)),f=r(406),p=r(1193),m=n(r(565));class h extends p.ModalAction{constructor(){super(...arguments),(0,u.default)(this,"onSubmit",(e=>{var t,{id:a}=this.item,r=[];return(0,l.default)(t=(0,o.default)(e)).call(t,(t=>{if((0,d.default)(this.item,t)&&(0,c.default)(this.item,t)!==e[t]){var a={op:"replace",path:"/".concat(t),value:e[t]};r.push(a)}else if(!(0,d.default)(this.item,t)&&e[t]){var i={op:"add",path:"/".concat(t),value:e[t]};r.push(i)}})),0===r.length?s.default.resolve():m.default.update({id:a},r)}))}get name(){return t("edit instance snapshot")}get defaultValue(){var{name:e,description:t}=this.item;return{name:e,description:t}}get formItems(){return[{name:"name",label:t("Name"),type:"input-name",placeholder:t("Please input name"),isImage:!0,required:!0},{name:"description",label:t("Description"),type:"textarea"}]}}a.EditAction=h,(0,u.default)(h,"id","edit"),(0,u.default)(h,"title",t("Edit Instance Snapshot")),(0,u.default)(h,"buttonText",t("Edit")),(0,u.default)(h,"policy","modify_image"),(0,u.default)(h,"allowed",(()=>s.default.resolve(!0)));var v=(0,f.inject)("rootStore")((0,f.observer)(h));a.default=v},3607:function(e,a,r){"use strict";var i=r(19),n=r(21);i(a,"__esModule",{value:!0}),a.default=void 0;var l=n(r(36)),o=r(1193),s=n(r(565));class u extends o.ConfirmAction{constructor(){super(...arguments),(0,l.default)(this,"policy","delete_image"),(0,l.default)(this,"onSubmit",(e=>s.default.delete({id:e.id})))}get id(){return"delete"}get title(){return t("Delete Instance Snapshot")}get isDanger(){return!0}get buttonText(){return t("Delete")}get actionName(){return t("delete instance snapshot")}}a.default=u},3608:function(e,t,a){"use strict";var r=a(19),i=a(21);r(t,"__esModule",{value:!0}),t.default=t.Flavor=void 0;var n=i(a(57)),l=i(a(51)),o=a(406),s=i(a(1234)),u=i(a(1276)),d=a(1213),c=i(a(3611)),f=i(a(3616)),p=i(a(3619)),m=i(a(3622)),h=i(a(3625));class v extends s.default{init(){this.settingStore=u.default,this.getSettings()}getSettings(){var e=this;return(0,l.default)((function*(){yield e.settingStore.fetchList();var t=(0,d.getAllArchitecture)(e.settingStore.list.data);e.setState({architectures:t})}))()}get tabs(){var{architectures:e=[]}=this.state,t={x86_architecture:c.default,heterogeneous_computing:f.default,bare_metal:m.default,arm_architecture:p.default,custom:h.default};return(0,n.default)(e).call(e,(e=>({title:d.flavorArchitectures[e],key:e,component:t[e]})))}}t.Flavor=v;var g=(0,o.inject)("rootStore")((0,o.observer)(v));t.default=g},3611:function(e,a,r){"use strict";var i=r(33),n=r(44),l=r(32),o=r(25),s=r(27),u=r(45),d=r(46),c=r(19),f=r(21);c(a,"__esModule",{value:!0}),a.default=a.Flavor=void 0;var p=f(r(81)),m=f(r(36)),h=r(406),v=f(r(1194)),g=r(1218),y=r(334),b=r(1213),_=r(161),S=f(r(3612));function M(e,t){var a=i(e);if(n){var r=n(e);t&&(r=l(r).call(r,(function(t){return o(e,t).enumerable}))),a.push.apply(a,r)}return a}function I(e){for(var t=1;t<arguments.length;t++){var a,r=null!=arguments[t]?arguments[t]:{};if(t%2)s(a=M(Object(r),!0)).call(a,(function(t){(0,m.default)(e,t,r[t])}));else if(u)d(e,u(r));else{var i;s(i=M(Object(r))).call(i,(function(t){c(e,t,o(r,t))}))}}return e}class x extends v.default{constructor(){super(...arguments),(0,m.default)(this,"getColumns",(()=>[...(0,b.getBaseColumns)(this),...b.extraColumns])),(0,m.default)(this,"updateFetchParams",(e=>I(I({},e),{},{tab:"x86_architecture"})))}init(){this.store=new g.FlavorStore}get policy(){return"os_compute_api:os-flavor-extra-specs:index"}get name(){var e;return(0,p.default)(e="".concat(b.flavorArchitectures.x86_architecture," ")).call(e,t("Flavors"))}get hasTab(){return!0}get actionConfigs(){return this.isAdminPage?S.default:y.emptyActionConfig}get searchFilters(){return[{label:t("Name"),name:"name"},{label:t("Category"),name:"category",options:(0,_.getOptions)(b.x86CategoryList)}]}}a.Flavor=x;var A=(0,h.inject)("rootStore")((0,h.observer)(x));a.default=A},3612:function(e,t,a){"use strict";var r=a(19),i=a(21);r(t,"__esModule",{value:!0}),t.default=void 0;var n=i(a(3613)),l=i(a(1278)),o=i(a(1279)),s={rowActions:{firstAction:l.default,moreActions:[{action:o.default}]},batchActions:[l.default],primaryActions:[n.default]};t.default=s},3613:function(e,a,r){"use strict";var i=r(19),n=r(21);i(a,"__esModule",{value:!0}),a.default=void 0;var l=n(r(65)),o=n(r(36)),s=n(r(1277));class u extends s.default{static allowed(){return l.default.resolve(!0)}}a.default=u,(0,o.default)(u,"id","flavor-create"),(0,o.default)(u,"title",t("Create Flavor")),(0,o.default)(u,"path","/compute/flavor-admin/create?tab=x86_architecture"),(0,o.default)(u,"policy","os_compute_api:os-flavor-manage:create")},3614:function(e,a,r){"use strict";var i=r(33),n=r(44),l=r(32),o=r(25),s=r(27),u=r(45),d=r(46),c=r(19),f=r(21);c(a,"__esModule",{value:!0}),a.default=a.AccessTypeSetting=void 0;var p=f(r(36)),m=r(406),h=f(r(1201)),v=r(407),g=r(1235);function y(e,t){var a=i(e);if(n){var r=n(e);t&&(r=l(r).call(r,(function(t){return o(e,t).enumerable}))),a.push.apply(a,r)}return a}function b(e){for(var t=1;t<arguments.length;t++){var a,r=null!=arguments[t]?arguments[t]:{};if(t%2)s(a=y(Object(r),!0)).call(a,(function(t){(0,p.default)(e,t,r[t])}));else if(u)d(e,u(r));else{var i;s(i=y(Object(r))).call(i,(function(t){c(e,t,o(r,t))}))}}return e}class _ extends h.default{init(){this.projectStore=new v.ProjectStore,this.getProjects()}get projects(){return this.projectStore.list.data||[]}get defaultValue(){return{accessType:this.accessTypeList[0].value,accessControl:this.targetKeys}}get accessTypeList(){return[{label:t("Public"),value:"public"},{label:t("Access Control"),value:"accessControl"}]}getProjects(){this.projectStore.fetchList()}get formItems(){var{accessType:e}=this.state,a=e!==this.accessTypeList[0].value;return[{name:"accessType",label:t("Access Type"),type:"radio",options:this.accessTypeList},b({name:"accessControl",label:t("Access Control"),type:"select-table",isMulti:!0,hidden:!a,required:a,data:this.projects,isLoading:this.projectStore.list.isLoading},g.projectTableOptions)]}}a.AccessTypeSetting=_;var S=(0,m.inject)("rootStore")((0,m.observer)(_));a.default=S},3615:function(e,a,r){"use strict";var i=r(19),n=r(21);i(a,"__esModule",{value:!0}),a.default=a.ParamSetting=void 0;var l=n(r(102)),o=n(r(57)),s=n(r(65)),u=n(r(27)),d=n(r(200)),c=n(r(33)),f=n(r(51)),p=n(r(36)),m=n(r(199)),h=n(r(0)),v=r(406),g=r(34),y=n(r(1490)),b=n(r(1201)),_=r(1213),S=n(r(1276)),M=r(161),I=r(341),x=n(r(1214));class A extends b.default{constructor(){super(...arguments),(0,p.default)(this,"getCategoryProperties",(e=>{var t,a=(0,l.default)(t=this.flavorCategoryList).call(t,(t=>t.value===e));return a?a.properties:[]})),(0,p.default)(this,"getDefaultResourcePropValues",(()=>{var e;return(0,o.default)(e=this.resourcePropNeedKeys).call(e,((e,t)=>({index:t,value:{key:e,value:"0"}})))})),(0,p.default)(this,"allowed",(()=>s.default.resolve())),(0,p.default)(this,"numaValidate",(e=>{var{getFieldValue:a}=e;return{validator(e,r){var i=a("category");if(!(0,_.isComputeOptimized)(i))return s.default.resolve();if(!r||0===r.length)return s.default.reject(t("Please set MUNA"));var n=a("vcpus"),l=a("memoryGb");if(!n||!l)return s.default.reject(t("Please set CPU && Ram first."));var o=1024*l,d=0,c=0;(0,u.default)(r).call(r,(e=>{d+=e.value.cpu,c+=e.value.ram}));var f=!1,p=t("Invalid: ");return d!==n&&(p+=t("CPU value is { cpu }, NUMA CPU value is { totalCpu }, need to be equal. ",{cpu:n,totalCpu:d}),f=!0),c!==1024*l&&(p+=t("Ram value is { ram }, NUMA RAM value is { totalRam }, need to be equal. ",{ram:o,totalRam:c}),f=!0),f?s.default.reject(p):s.default.resolve()}}})),(0,p.default)(this,"pageSizeValueValidate",((e,a)=>/^[1-9]\d*(Kb\(it\)|Kib\(it\)|Mb\(it\)|Mib\(it\)|Gb\(it\)|Gib\(it\)|Tb\(it\)|Tib\(it\)|KB|KiB|MB|MiB|GB|GiB|TB|TiB)?$/.test(a)?s.default.resolve():s.default.reject(t("Please enter right format memory page value!")))),(0,p.default)(this,"checkResourceProps",(e=>!(0,l.default)(e).call(e,((e,t)=>{var{key:a,value:r}=e.value||{};if(!r)return!0;if(t>=this.resourcePropNeedKeys.length){if(!/^CUSTOM_[A-Z0-9_]{1,248}$/.test(a))return!0}return!1})))),(0,p.default)(this,"checkTraitProps",(e=>!!(0,m.default)(e)||!(0,l.default)(e).call(e,(e=>!e.value))))}init(){this.settingStore=S.default,this.getSettings()}getSettings(){var e=this;return(0,f.default)((function*(){yield e.settingStore.fetchList(),e.updateDefaultValue()}))()}get familyItemValue(){return(0,_.getFamilyItemValue)(this.settingStore.list.data)}get tab(){var e,t=(0,I.parse)((0,d.default)(e=this.routing.location.search).call(e,1)),{tab:a}=t;return a}get flavorArchitectures(){var e;return(0,o.default)(e=(0,_.getAllArchitecture)(this.settingStore.list.data,!1)).call(e,(e=>({label:_.flavorArchitectures[e],value:e})))}get flavorCategoryList(){var e,t,{architecture:a}=this.state;if(!a)return[];var r=(0,l.default)(e=this.familyItemValue).call(e,(e=>e.architecture===a));return r?(0,o.default)(t=r.categories).call(t,(e=>({value:e.name,label:_.flavorCategoryList[e.name]||e.name,properties:e.properties}))):[]}get gpuTypes(){var e,t,a,r=(0,l.default)(e=this.settingStore.list.data||[]).call(e,(e=>"gpu_models"===e.key));return r&&r.value instanceof Array?(0,o.default)(t=r.value).call(t,(e=>({value:e,label:e}))):r&&"object"==typeof r.value?(0,o.default)(a=(0,c.default)(r.value)).call(a,(e=>({label:e,value:e}))):[]}get usbTypes(){var e,t,a,r=(0,l.default)(e=this.settingStore.list.data||[]).call(e,(e=>"usb_models"===e.key));return r&&r.value instanceof Array?(0,o.default)(t=r.value).call(t,(e=>({value:e,label:e}))):r&&"object"==typeof r.value?(0,o.default)(a=(0,c.default)(r.value)).call(a,(e=>({label:e,value:e}))):[]}get vgpuTypes(){return[{value:"vgpu",label:"vgpu"}]}get resourcePropNeedKeys(){return["VCPU","MEMORY_MB","DISK_GB"]}get defaultValue(){return{vcpus:1,memoryGb:1,numaNodesNum:1,settings:(0,g.toJS)(this.settingStore.list.data||[]),ephemeral:0,ephemeralTmp:0,disk:0,architecture:this.tab,attachUsb:!1,resourceProps:this.getDefaultResourcePropValues(),traitProps:[],memPageSizeMore:"any",memPageSize:"large"}}get defaultNUMAValue(){return{cpu:1,ram:1024}}get nameForStateUpdate(){return["architecture","category","attachUsb","memPageSizeMore","more","memPageSize"]}get enableCinder(){return this.props.rootStore.checkEndpoint("cinder")}get formItems(){var{architecture:e,category:a,attachUsb:r,memPageSizeMore:i,more:n=!1,memPageSize:l}=this.state,o="bare_metal"===e,u=(0,_.categoryHasIOPS)(a),d=(0,_.categoryHasEphemeral)(a),c=(0,_.isGpuCategory)(a),f=(0,_.isGpuVisual)(a),p=c&&!f,m=(0,_.isComputeOptimized)(a),v=_.flavorCategoryList[a]||a,g=!m&&!o,b=n&&g,S=b&&"custom"===i,I=m&&"custom"===l,A=t("It is recommended that { instanceType } instance simultaneously set NUMA affinity policy for PCIE device to force or priority matching. This configuration can further improve PCIE computing performance.",{instanceType:v}),w=t("It is recommended to set CPU binding strategy as binding on { instanceType } instance. This configuration further improves the performance of the instance CPU.",{instanceType:v}),N=t("It is recommended to set the CPU thread binding policy as thread binding in { instanceType } instance, which can further improve the CPU performance of instance.",{instanceType:v}),C=t("It is recommended that the { instanceType } instance simultaneously set large page memory to large. { instanceType } instances also require faster memory addressing capabilities.",{instanceType:v}),P=t("The unit suffix must be one of the following: Kb(it), Kib(it), Mb(it), Mib(it), Gb(it), Gib(it), Tb(it), Tib(it), KB, KiB, MB, MiB, GB, GiB, TB, TiB. If the unit suffix is not provided, it is assumed to be KB."),k=t("Please enter a memory page size, such as: 1024, 1024MiB");return[{name:"title1",label:t("Basic Parameters"),type:"title"},{name:"architecture",label:t("Architecture"),type:"radio",options:this.flavorArchitectures,required:!0},{name:"category",label:t("Type"),type:"radio",options:this.flavorCategoryList,required:!0,wrapperCol:{xs:{span:16},sm:{span:12}}},{name:"name",label:t("Name"),type:"input-name",placeholder:t("Please input name"),required:!0},{name:"vcpus",label:t("CPU(Core)"),type:"input-int",min:1,extra:t("The number of vCPU cores should not exceed the maximum number of CPU cores of the physical node. Otherwise it will cause fail to schedule to any physical node when creating instance."),required:!0},{name:"memoryGb",label:t("Ram Size (GiB)"),type:"input-int",min:1,required:!0},{name:"bandwidth",label:t("Internal Network Bandwidth(Gbps)"),type:"input-int",hidden:o,min:1},{name:"ephemeral",label:t("Ephemeral Disk (GiB)"),type:"input-int",min:0,hidden:!d,required:d},{name:"ephemeralTmp",label:t("Ephemeral Disk (GiB)"),type:"input-int",min:0,hidden:o||d,disabled:!d},{name:"disk",label:t("Root Disk (GiB)"),type:"input-int",min:0,hidden:this.enableCinder},{name:"iops",label:t("Storage IOPS"),type:"input-int",min:1,hidden:o||!u},{name:"numaNodesNum",label:t("NUMA Nodes"),type:"input-int",min:1,required:!0,hidden:!g},{name:"more",label:t("Advanced Options"),type:"more",hidden:!g},{name:"memPageSizeMore",label:t("Memory Page"),type:"select",options:_.pageTypeList,hidden:!b,required:b,tip:C},{name:"memPageSizeValueMore",label:t("Memory Page Size"),type:"input",hidden:!S,required:S,extra:P,validator:this.pageSizeValueValidate,placeholder:k},{name:"gpu-type",label:t("GPU Parameters"),type:"title",hidden:!c},{name:"gpuType",label:t("GPU Model"),type:"select",hidden:!p,required:p,options:this.gpuTypes,tip:t("GPU pass-through will load GPU devices directly to the instance for use. VGPU is a GPU virtualization solution. GPU resources will be segmented and distributed to multiple instances for shared use.")},{name:"gpuNumber",label:t("Number of GPU"),type:"input-int",min:1,hidden:!c,required:c},{name:"title2",label:t("Optimized Parameters"),type:"title",hidden:!m},{name:"numaNodes",label:t("NUMA Nodes"),type:"add-select",dependencies:["vcpu","memoryGb"],required:m,defaultItemValue:this.defaultNUMAValue,itemComponent:y.default,minCount:1,maxCount:8,addTextTips:t("NUMA Node"),addText:t("Add NUMA Node"),otherRule:this.numaValidate,hidden:!m,tip:A},{name:"cpuPolicy",label:t("CPU Policy"),type:"radio",options:(0,M.getOptions)(_.cpuPolicyList),tip:w,hidden:!m,required:m},{name:"cpuThreadPolicy",label:t("CPU Thread Policy"),type:"select",options:_.cpuThreadPolicyList,tip:N,hidden:!m,required:m},{name:"memPageSize",label:t("Memory Page"),type:"select",options:_.pageTypeList,hidden:!m,required:m,tip:C},{name:"memPageSizeValue",label:t("Memory Page Size"),type:"input",hidden:!I,required:I,extra:P,validator:this.pageSizeValueValidate,placeholder:k},{name:"usb-type",label:t("USB Parameters"),type:"title",hidden:!this.usbTypes[0]},{name:"attachUsb",label:t("Attach USB"),type:"radio",optionType:"default",hidden:!this.usbTypes[0],options:[{label:t("Yes"),value:!0},{label:t("No"),value:!1}]},{name:"usbType",label:t("Usb Controller"),type:"select",hidden:!r,required:r,options:this.usbTypes},{name:"usbNumber",label:t("Number of Usb Controller"),type:"input-int",min:1,hidden:!r,required:r},{name:"bare-metal-type",label:t("BareMetal Parameters"),type:"title",hidden:!o},{name:"resourceProps",label:t("Resource Class Properties"),type:"add-select",itemComponent:x.default,addText:t("Add Property"),minCount:this.resourcePropNeedKeys.length,hidden:!o,required:o,readonlyKeys:this.resourcePropNeedKeys,extra:h.default.createElement("div",null,h.default.createElement("p",null,t("1. The name of the custom resource class property should start with CUSTOM_, can only contain uppercase letters A ~ Z, numbers 0 ~ 9 or underscores, and the length should not exceed 255 characters (for example: CUSTOM_BAREMETAL_SMALL).")),h.default.createElement("p",null,t("2. You can customize the resource class name of the flavor, but it needs to correspond to the resource class of the scheduled node (for example, the resource class name of the scheduling node is baremetal.with-GPU, and the custom resource class name of the flavor is CUSTOM_BAREMETAL_WITH_GPU=1)."))),validator:(e,a)=>this.checkResourceProps(a)?s.default.resolve():s.default.reject(t("Please enter right format key value!"))},{name:"traitProps",label:t("Trait Properties"),type:"add-select",isInput:!0,addText:t("Add Property"),hidden:!o,required:o,extra:t("The trait name of the flavor needs to correspond to the trait of the scheduling node; by injecting the necessary traits into the ironic instance, the computing service will only schedule the instance to the bare metal node with all necessary traits (for example: the trait of the scheduling node has HW_CPU_X86_VMX trait, and the flavor adds HW_CPU_X86_VMX, it can be scheduled to this node for necessary traits)."),validator:(e,a)=>this.checkTraitProps(a)?s.default.resolve():s.default.reject(t("Please enter right format trait!"))}]}}a.ParamSetting=A;var w=(0,v.inject)("rootStore")((0,v.observer)(A));a.default=w},3616:function(e,a,r){"use strict";var i=r(33),n=r(44),l=r(32),o=r(25),s=r(27),u=r(45),d=r(46),c=r(19),f=r(21);c(a,"__esModule",{value:!0}),a.default=a.Flavor=void 0;var p=f(r(81)),m=f(r(36)),h=r(406),v=f(r(1194)),g=r(1218),y=r(334),b=r(1213),_=r(161),S=f(r(3617));function M(e,t){var a=i(e);if(n){var r=n(e);t&&(r=l(r).call(r,(function(t){return o(e,t).enumerable}))),a.push.apply(a,r)}return a}function I(e){for(var t=1;t<arguments.length;t++){var a,r=null!=arguments[t]?arguments[t]:{};if(t%2)s(a=M(Object(r),!0)).call(a,(function(t){(0,m.default)(e,t,r[t])}));else if(u)d(e,u(r));else{var i;s(i=M(Object(r))).call(i,(function(t){c(e,t,o(r,t))}))}}return e}class x extends v.default{constructor(){super(...arguments),(0,m.default)(this,"getColumns",(()=>[...(0,b.getBaseColumns)(this),...b.gpuColumns,...b.extraColumns])),(0,m.default)(this,"updateFetchParams",(e=>I(I({},e),{},{tab:"heterogeneous_computing"})))}init(){this.store=new g.FlavorStore}get policy(){return"os_compute_api:os-flavor-extra-specs:index"}get name(){var e;return(0,p.default)(e="".concat(b.flavorArchitectures.heterogeneous_computing," ")).call(e,t("Flavors"))}get hasTab(){return!0}get actionConfigs(){return this.isAdminPage?S.default:y.emptyActionConfig}get searchFilters(){return[{label:t("Name"),name:"name"},{label:t("Category"),name:"category",options:(0,_.getOptions)(b.heterogeneousCategoryList),include:!1}]}}a.Flavor=x;var A=(0,h.inject)("rootStore")((0,h.observer)(x));a.default=A},3617:function(e,t,a){"use strict";var r=a(19),i=a(21);r(t,"__esModule",{value:!0}),t.default=void 0;var n=i(a(3618)),l=i(a(1278)),o=i(a(1279)),s={rowActions:{firstAction:l.default,moreActions:[{action:o.default}]},batchActions:[l.default],primaryActions:[n.default]};t.default=s},3618:function(e,a,r){"use strict";var i=r(19),n=r(21);i(a,"__esModule",{value:!0}),a.default=void 0;var l=n(r(65)),o=n(r(36)),s=n(r(1277));class u extends s.default{static allowed(){return l.default.resolve(!0)}}a.default=u,(0,o.default)(u,"id","flavor-create"),(0,o.default)(u,"title",t("Create Flavor")),(0,o.default)(u,"path","/compute/flavor-admin/create?tab=heterogeneous_computing"),(0,o.default)(u,"policy","os_compute_api:os-flavor-manage:create")},3619:function(e,a,r){"use strict";var i=r(33),n=r(44),l=r(32),o=r(25),s=r(27),u=r(45),d=r(46),c=r(19),f=r(21);c(a,"__esModule",{value:!0}),a.default=a.Flavor=void 0;var p=f(r(81)),m=f(r(36)),h=r(406),v=f(r(1194)),g=r(1218),y=r(334),b=r(1213),_=r(161),S=f(r(3620));function M(e,t){var a=i(e);if(n){var r=n(e);t&&(r=l(r).call(r,(function(t){return o(e,t).enumerable}))),a.push.apply(a,r)}return a}function I(e){for(var t=1;t<arguments.length;t++){var a,r=null!=arguments[t]?arguments[t]:{};if(t%2)s(a=M(Object(r),!0)).call(a,(function(t){(0,m.default)(e,t,r[t])}));else if(u)d(e,u(r));else{var i;s(i=M(Object(r))).call(i,(function(t){c(e,t,o(r,t))}))}}return e}class x extends v.default{constructor(){super(...arguments),(0,m.default)(this,"getColumns",(()=>[...(0,b.getBaseColumns)(this),...b.extraColumns])),(0,m.default)(this,"updateFetchParams",(e=>I(I({},e),{},{tab:"arm_architecture"})))}init(){this.store=new g.FlavorStore}get policy(){return"os_compute_api:os-flavor-extra-specs:index"}get name(){var e;return(0,p.default)(e="".concat(b.flavorArchitectures.arm_architecture," ")).call(e,t("Flavors"))}get hasTab(){return!0}get actionConfigs(){return this.isAdminPage?S.default:y.emptyActionConfig}get searchFilters(){return[{label:t("Name"),name:"name"},{label:t("Category"),name:"category",options:(0,_.getOptions)(b.armCategoryList)}]}}a.Flavor=x;var A=(0,h.inject)("rootStore")((0,h.observer)(x));a.default=A},3620:function(e,t,a){"use strict";var r=a(19),i=a(21);r(t,"__esModule",{value:!0}),t.default=void 0;var n=i(a(3621)),l=i(a(1278)),o=i(a(1279)),s={rowActions:{firstAction:l.default,moreActions:[{action:o.default}]},batchActions:[l.default],primaryActions:[n.default]};t.default=s},3621:function(e,a,r){"use strict";var i=r(19),n=r(21);i(a,"__esModule",{value:!0}),a.default=void 0;var l=n(r(65)),o=n(r(36)),s=n(r(1277));class u extends s.default{static allowed(){return l.default.resolve(!0)}}a.default=u,(0,o.default)(u,"id","flavor-create"),(0,o.default)(u,"title",t("Create Flavor")),(0,o.default)(u,"path","/compute/flavor-admin/create?tab=arm_architecture"),(0,o.default)(u,"policy","os_compute_api:os-flavor-manage:create")},3622:function(e,a,r){"use strict";var i=r(33),n=r(44),l=r(32),o=r(25),s=r(27),u=r(45),d=r(46),c=r(19),f=r(21);c(a,"__esModule",{value:!0}),a.default=a.Flavor=void 0;var p=f(r(32)),m=f(r(90)),h=f(r(81)),v=f(r(36)),g=r(406),y=f(r(1194)),b=r(1218),_=r(334),S=r(1213),M=f(r(3623));function I(e,t){var a=i(e);if(n){var r=n(e);t&&(r=l(r).call(r,(function(t){return o(e,t).enumerable}))),a.push.apply(a,r)}return a}function x(e){for(var t=1;t<arguments.length;t++){var a,r=null!=arguments[t]?arguments[t]:{};if(t%2)s(a=I(Object(r),!0)).call(a,(function(t){(0,v.default)(e,t,r[t])}));else if(u)d(e,u(r));else{var i;s(i=I(Object(r))).call(i,(function(t){c(e,t,o(r,t))}))}}return e}class A extends y.default{constructor(){super(...arguments),(0,v.default)(this,"getColumns",(()=>{var e=[...(0,S.getBaseColumns)(this),...S.extraColumns],t=["quota:vif_outbound_average","OS-FLV-EXT-DATA:ephemeral","quota:disk_total_iops_sec"];return(0,p.default)(e).call(e,(e=>(0,m.default)(t).call(t,e.dataIndex)<0))})),(0,v.default)(this,"updateFetchParams",(e=>x(x({},e),{},{tab:"bare_metal"})))}init(){this.store=new b.FlavorStore}get policy(){return"os_compute_api:os-flavor-extra-specs:index"}get name(){var e;return(0,h.default)(e="".concat(S.flavorArchitectures.bare_metal," ")).call(e,t("Flavors"))}get hasTab(){return!0}get actionConfigs(){return this.isAdminPage?M.default:_.emptyActionConfig}get searchFilters(){return[{label:t("Name"),name:"name"}]}}a.Flavor=A;var w=(0,g.inject)("rootStore")((0,g.observer)(A));a.default=w},3623:function(e,t,a){"use strict";var r=a(19),i=a(21);r(t,"__esModule",{value:!0}),t.default=void 0;var n=i(a(3624)),l=i(a(1278)),o=i(a(1279)),s={rowActions:{firstAction:l.default,moreActions:[{action:o.default}]},batchActions:[l.default],primaryActions:[n.default]};t.default=s},3624:function(e,a,r){"use strict";var i=r(19),n=r(21);i(a,"__esModule",{value:!0}),a.default=void 0;var l=n(r(65)),o=n(r(36)),s=n(r(1277));class u extends s.default{static allowed(){return l.default.resolve(!0)}}a.default=u,(0,o.default)(u,"id","flavor-create"),(0,o.default)(u,"title",t("Create Flavor")),(0,o.default)(u,"path","/compute/flavor-admin/create?tab=bare_metal"),(0,o.default)(u,"policy","os_compute_api:os-flavor-manage:create")},3625:function(e,a,r){"use strict";var i=r(33),n=r(44),l=r(32),o=r(25),s=r(27),u=r(45),d=r(46),c=r(19),f=r(21);c(a,"__esModule",{value:!0}),a.default=a.Flavor=void 0;var p=f(r(562)),m=f(r(81)),h=f(r(36)),v=r(406),g=f(r(1194)),y=r(1218),b=r(334),_=r(1213),S=f(r(3626));function M(e,t){var a=i(e);if(n){var r=n(e);t&&(r=l(r).call(r,(function(t){return o(e,t).enumerable}))),a.push.apply(a,r)}return a}function I(e){for(var t=1;t<arguments.length;t++){var a,r=null!=arguments[t]?arguments[t]:{};if(t%2)s(a=M(Object(r),!0)).call(a,(function(t){(0,h.default)(e,t,r[t])}));else if(u)d(e,u(r));else{var i;s(i=M(Object(r))).call(i,(function(t){c(e,t,o(r,t))}))}}return e}class x extends g.default{constructor(){super(...arguments),(0,h.default)(this,"getColumns",(()=>{var e=[...(0,_.getBaseColumns)(this)];return(0,p.default)(e).call(e,1,1),[...e,..._.extraColumns]})),(0,h.default)(this,"updateFetchParams",(e=>I(I({},e),{},{tab:"custom"})))}init(){this.store=new y.FlavorStore}get policy(){return"os_compute_api:os-flavor-extra-specs:index"}get name(){var e;return(0,m.default)(e="".concat(t("Custom")," ")).call(e,t("Flavors"))}get hasTab(){return!0}get actionConfigs(){return this.isAdminPage?S.default:b.emptyActionConfig}get searchFilters(){return[{label:t("Name"),name:"name"}]}}a.Flavor=x;var A=(0,v.inject)("rootStore")((0,v.observer)(x));a.default=A},3626:function(e,t,a){"use strict";var r=a(19),i=a(21);r(t,"__esModule",{value:!0}),t.default=void 0;var n=i(a(1278)),l=i(a(1279)),o=i(a(3627)),s={rowActions:{firstAction:n.default,moreActions:[{action:l.default},{action:o.default}]},batchActions:[n.default],primaryActions:[]};t.default=s},3627:function(e,a,r){"use strict";var i=r(19),n=r(21);i(a,"__esModule",{value:!0}),a.default=a.ManageMetadata=void 0;var l=n(r(102)),o=n(r(90)),s=n(r(33)),u=n(r(27)),d=n(r(65)),c=n(r(51)),f=n(r(36)),p=n(r(559)),m=n(r(199)),h=r(406),v=n(r(1218)),g=r(1193),y=n(r(1214)),b=r(1243);class _ extends g.ModalAction{constructor(){super(...arguments),(0,f.default)(this,"checkKeyInSystem",(e=>{var t;return!!(0,l.default)(t=this.metadata).call(t,(t=>{var a,{detail:{properties:r={}}={}}=t;return(0,o.default)(a=(0,s.default)(r)).call(a,e)>=0}))})),(0,f.default)(this,"checkCustoms",(e=>!!(0,m.default)(e)||!(0,l.default)(e).call(e,(e=>{var{key:t,value:a}=e.value||{};return!t||null==a})))),(0,f.default)(this,"hasNoValue",(e=>{var t;return!!(0,l.default)(t=(0,s.default)(e)).call(t,(t=>void 0===e[t]))})),(0,f.default)(this,"onSubmit",(e=>{var t,a,{customs:r,systems:i}=this.parseExistMetadata(),{customs:n,systems:o}=e,d=[],c=[],f=[];return(0,u.default)(n).call(n,(e=>{var{key:t,value:a}=e.value||{},i=(0,l.default)(r).call(r,(e=>e.value.key===t));i?i.value.value!==a&&f.push(e.value):d.push(e.value)})),(0,u.default)(t=(0,s.default)(o)).call(t,(e=>{var t={key:e,value:o[e]};(0,p.default)(i,e)?o[e]!==i[e]&&f.push(t):d.push(t)})),(0,u.default)(r).call(r,(e=>{(0,l.default)(n).call(n,(t=>t.value.key===e.value.key))||c.push(e.value.key)})),(0,u.default)(a=(0,s.default)(i)).call(a,(e=>{(0,p.default)(o,e)||c.push(e)})),this.store.updateExtraSpecs(this.item.id,d,f,c)}))}init(){this.store=v.default,this.metadataStore=new b.MetadataStore,this.getMetadata()}get name(){return t("Manage Metadata")}static get modalSize(){return"large"}getModalSize(){return"large"}get wrapperCol(){return{xs:{span:18},sm:{span:20}}}getMetadata(){var e=this;return(0,c.default)((function*(){yield e.metadataStore.fetchList({manage:!0,resource_types:"OS::Nova::Flavor"}),e.updateDefaultValue()}))()}get metadata(){return this.metadataStore.list.data||[]}getItemMetadata(){var{extra_specs:e={},originData:t={}}=this.item||{};return(0,m.default)(t)?e:t.extra_specs||{}}parseExistMetadata(){var e=[],t={};if(this.metadata.length>0){var a,r=this.getItemMetadata();(0,u.default)(a=(0,s.default)(r)).call(a,(a=>{this.checkKeyInSystem(a)?t[a]=r[a]:e.push({index:e.length,value:{key:a,value:r[a]}})}))}return{customs:e,systems:t}}get defaultValue(){var{name:e}=this.item,{customs:t,systems:a}=this.parseExistMetadata();return{name:e,customs:t,systems:a}}get formItems(){return[{name:"name",label:t("Name"),type:"label",iconType:"aggregate"},{name:"customs",label:t("Custom Metadata"),type:"add-select",itemComponent:y.default,addText:t("Add Custom Metadata"),validator:(e,a)=>this.checkCustoms(a)?d.default.resolve():d.default.reject(t("Please enter complete key value!"))},{name:"systems",label:t("Metadata"),type:"metadata-transfer",metadata:this.metadata,validator:(e,a)=>this.hasNoValue(a)?d.default.reject(t("Please input value")):d.default.resolve()}]}}a.ManageMetadata=_,(0,f.default)(_,"id","ManageMetadata"),(0,f.default)(_,"title",t("Manage Metadata")),(0,f.default)(_,"policy",["os_compute_api:os-flavor-extra-specs:create","os_compute_api:os-flavor-extra-specs:delete","os_compute_api:os-flavor-extra-specs:update"]),(0,f.default)(_,"allowed",(()=>d.default.resolve(!0)));var S=(0,h.inject)("rootStore")((0,h.observer)(_));a.default=S},3628:function(e,a,r){"use strict";var i=r(19),n=r(21);i(a,"__esModule",{value:!0}),a.default=a.Detail=void 0;var l=r(406),o=r(1218),s=n(r(1200)),u=r(1213),d=n(r(1332)),c=r(334),f=r(161),p=n(r(3629)),m=n(r(3630));class h extends s.default{get name(){return t("flavor")}get policy(){return"os_compute_api:os-flavor-extra-specs:index"}get listUrl(){return this.getRoutePath("flavor")}get actionConfigs(){return this.isAdminPage?p.default:c.emptyActionConfig}get detailInfos(){return[{title:t("Name"),dataIndex:"name"},{title:t("Architecture"),dataIndex:"architecture",valueMap:u.flavorArchitectures},{title:t("Category"),dataIndex:"category",valueMap:u.flavorCategoryList},{title:t("CPU"),dataIndex:"vcpus",isHideable:!0},{title:t("Memory"),dataIndex:"ram",isHideable:!0,render:e=>(0,f.formatSize)(e,2)},{title:t("Public"),dataIndex:"is_public",isHideable:!0,valueRender:"yesNo"}]}get tabs(){return[{title:t("Detail"),key:"detail",component:m.default},{title:t("Instances"),key:"members",component:d.default}]}init(){this.store=new o.FlavorStore}}a.Detail=h;var v=(0,l.inject)("rootStore")((0,l.observer)(h));a.default=v},3629:function(e,t,a){"use strict";var r=a(19),i=a(21);r(t,"__esModule",{value:!0}),t.default=void 0;var n=i(a(1277)),l=i(a(1278)),o=i(a(1279)),s={rowActions:{firstAction:l.default,moreActions:[{action:o.default}]},batchActions:[l.default],primaryActions:[n.default]};t.default=s},3630:function(e,a,r){"use strict";var i=r(19),n=r(21);i(a,"__esModule",{value:!0}),a.default=a.BaseDetail=void 0;var l=n(r(32)),o=n(r(33)),s=n(r(90)),u=n(r(57)),d=n(r(81)),c=n(r(335)),f=n(r(0)),p=r(406),m=n(r(1202)),h=r(1213);class v extends m.default{get leftCards(){var{category:e,disk:t,usbType:a}=this.detailData,r=(0,h.isGpuCategory)(e),i=(0,h.isComputeOptimized)(e),n=[this.baseInfoCard];return t&&n.push(this.diskCard),r&&n.push(this.gpuCard),"-"!==a&&n.push(this.usbCard),i&&n.push(this.ComputeOptimizedCard),n}get rightCards(){return[this.jsonCard]}getBareMetalCard(){var e=[{label:t("Resource Class Properties"),dataIndex:"extra_specs_traits",render:()=>{var e,{originData:{extra_specs:t={}}={}}=this.detailData,a=(0,l.default)(e=(0,o.default)(t)).call(e,(e=>0===(0,s.default)(e).call(e,"resources:")));return(0,u.default)(a).call(a,(e=>{var a,r=t[e];return f.default.createElement("div",{key:e},(0,d.default)(a="".concat(e.replace("resources:","")," = ")).call(a,r))}))}},{label:t("Trait Properties"),dataIndex:"extra_specs_traits",render:()=>{var e,{originData:{extra_specs:t={}}={}}=this.detailData,a=(0,l.default)(e=(0,o.default)(t)).call(e,(e=>0===(0,s.default)(e).call(e,"trait:")));return(0,u.default)(a).call(a,(e=>{var a,r=t[e];return f.default.createElement("div",{key:e},(0,d.default)(a="".concat(e.replace("trait:","")," = ")).call(a,r))}))}}];return{title:t("Base Info"),options:e}}get baseInfoCard(){var{category:e,architecture:a}=this.detailData,r=(0,h.categoryHasIOPS)(e),i=(0,h.categoryHasEphemeral)(e),n=(0,h.isComputeOptimized)(e);if((0,h.isBareMetal)(a))return this.getBareMetalCard();var l=[{label:t("Internal Network Bandwidth(Gbps)"),dataIndex:"quota:vif_outbound_average",render:e=>e?e/1e3/125:"-"}];if(i&&l.push({label:t("Ephemeral Disk (GiB)"),dataIndex:"OS-FLV-EXT-DATA:ephemeral"}),r&&l.push({label:t("Storage IOPS"),dataIndex:"quota:disk_total_iops_sec",render:e=>e||"-"}),!n){var o={label:t("NUMA Node Count"),dataIndex:"hw:numa_nodes"},s={label:t("Memory Page Size"),dataIndex:"hw:mem_page_size",render:e=>e&&h.pageTypeMap[e]||e||"-"};l.push(o,s)}return{title:t("Base Info"),options:l}}get diskCard(){var e=[{label:t("Root Disk (GiB)"),dataIndex:"disk"}];return{title:t("Disk Info"),options:e}}get gpuCard(){var e=[{label:t("GPU Type"),dataIndex:"gpuType"},{label:t("GPU Count"),dataIndex:"gpuCount"}];return{title:t("GPU Info"),options:e}}get usbCard(){var e=[{label:t("Usb Controller"),dataIndex:"usbType"},{label:t("Number of Usb Controller"),dataIndex:"usbCount"}];return{title:t("USB Info"),options:e}}get ComputeOptimizedCard(){var e,a=[{label:t("NUMA Node Count"),dataIndex:"hw:numa_nodes"}],r=this.detailData["hw:numa_nodes"]||0,i=(0,u.default)(e=new Array(r)).call(e,((e,a)=>{var r,i=this.detailData["hw:numa_cpus.".concat(a)],n=this.detailData["hw:numa_mem.".concat(a)];return{label:(0,d.default)(r="".concat(t("NUMA Node"),"-")).call(r,a+1),dataIndex:"hw:numa_nodes.".concat(a),render:()=>f.default.createElement("div",{key:"hw:numa_nodes.".concat(a)},f.default.createElement("span",{style:{marginRight:16}},t("CPU")," : ",i),t("Mem")," : ",n,"MiB")}}));a.push(...i);var n=[{label:t("CPU Policy"),dataIndex:"hw:cpu_policy",valueMap:h.cpuPolicyList},{label:t("CPU Thread Policy"),dataIndex:"hw:cpu_thread_policy",valueMap:h.cpuThreadPolicyMap},{label:t("Memory Page Size"),dataIndex:"hw:mem_page_size",valueMap:h.pageTypeMap}],l=[...a,...n];return{title:t("Compute Optimized Info"),options:l}}get jsonCard(){var{originData:e}=this.detailData,a=[{label:"",content:f.default.createElement("div",null,f.default.createElement("pre",null,(0,c.default)(e,null,4)))}];return{labelCol:0,title:t("Parameter"),options:a}}}a.BaseDetail=v;var g=(0,p.inject)("rootStore")((0,p.observer)(v));a.default=g},3631:function(e,a,r){"use strict";var i=r(19),n=r(21);i(a,"__esModule",{value:!0}),a.default=a.TabImage=void 0;var l=r(406),o=n(r(1234)),s=n(r(1553));class u extends o.default{get tabs(){var e=[{title:t("Current Project Images"),key:"project",component:s.default},{title:t("Public Images"),key:"public",component:s.default},{title:t("Shared Images"),key:"shared",component:s.default}];return this.hasAdminRole&&e.push({title:t("All Images"),key:"all",component:s.default}),e}}a.TabImage=u;var d=(0,l.inject)("rootStore")((0,l.observer)(u));a.default=d},3638:function(e,a,r){"use strict";var i=r(33),n=r(44),l=r(32),o=r(25),s=r(27),u=r(45),d=r(46),c=r(19),f=r(21);c(a,"__esModule",{value:!0}),a.default=a.Edit=void 0;var p=f(r(27)),m=f(r(33)),h=f(r(65)),v=f(r(57)),g=f(r(62)),y=f(r(36)),b=f(r(111)),_=f(r(559)),S=r(406),M=r(1193),I=f(r(565)),x=r(563),A=r(1195),w=r(161),N=r(1213);function C(e,t){var a=i(e);if(n){var r=n(e);t&&(r=l(r).call(r,(function(t){return o(e,t).enumerable}))),a.push.apply(a,r)}return a}function P(e){for(var t=1;t<arguments.length;t++){var a,r=null!=arguments[t]?arguments[t]:{};if(t%2)s(a=C(Object(r),!0)).call(a,(function(t){(0,y.default)(e,t,r[t])}));else if(u)d(e,u(r));else{var i;s(i=C(Object(r))).call(i,(function(t){c(e,t,o(r,t))}))}}return e}class k extends M.ModalAction{constructor(){super(...arguments),(0,y.default)(this,"onSubmit",(e=>{var t,{more:a,protected:r=!1,visibility:i=!1,hw_cpu_policy:n,hw_cpu_thread_policy:l,min_ram:o}=e,s=P({protected:r,visibility:i?"public":"private"},(0,g.default)(e,["more","protected","visibility","hw_cpu_policy","hw_cpu_thread_policy","min_ram"]));o&&(s.min_ram=1024*o),n!==w.NoSetValue&&(s.hw_cpu_policy=n||this.item.originData.hw_cpu_policy),l!==w.NoSetValue&&(s.hw_cpu_thread_policy=l||this.item.originData.hw_cpu_thread_policy);var u=[];return(0,p.default)(t=(0,m.default)(s)).call(t,(e=>{if((0,_.default)(this.item.originData,e)&&(0,b.default)(this.item.originData,e)!==s[e]){var t={op:"replace",path:"/".concat(e),value:s[e]};u.push(t)}else if(!(0,_.default)(this.item.originData,e)&&s[e]){var a={op:"add",path:"/".concat(e),value:s[e]};u.push(a)}})),this.item.originData.hw_cpu_policy&&n===w.NoSetValue&&u.push({op:"remove",path:"/hw_cpu_policy"}),this.item.originData.hw_cpu_thread_policy&&l===w.NoSetValue&&u.push({op:"remove",path:"/hw_cpu_thread_policy"}),0===u.length?h.default.resolve():this.store.update({id:this.item.id},u)}))}init(){this.store=I.default}get name(){return t("edit image")}get enableCinder(){return this.props.rootStore.checkEndpoint("cinder")}get labelCol(){return{xs:{span:8},sm:{span:8}}}get defaultValue(){var{visibility:e,hw_qemu_guest_agent:t,hw_cpu_policy:a,hw_cpu_thread_policy:r,min_ram:i}=this.item;return P(P({},this.item),{},{protected:this.item.protected,visibility:"public"===e,hw_qemu_guest_agent:t,hw_cpu_policy:a||w.NoSetValue,hw_cpu_thread_policy:r||w.NoSetValue,min_ram:i/1024})}get osList(){var e;return(0,v.default)(e=(0,m.default)(x.imageOS)).call(e,(e=>({value:e,label:x.imageOS[e]})))}get yesNoList(){return[{value:"yes",label:t("Yes")},{value:"no",label:t("No")}]}getOptions(){return[{label:t("Protected"),value:"protected"}]}get formItems(){var{more:e}=this.state;return[{name:"name",label:t("Name"),type:"input-name",isImage:!0,required:!0},{name:"os_distro",label:t("OS"),type:"select",options:this.osList,required:!0},{name:"os_version",label:t("OS Version"),type:"input",required:!0},{name:"os_admin_user",label:t("OS Admin"),type:"input",required:!0,extra:t("In general, administrator for Windows,root for Linux, please fill by image uploading.")},{name:"min_disk",label:t("Min System Disk (GiB)"),type:"input-int",min:0,max:500,display:this.enableCinder},{name:"min_ram",label:t("Min Memory (GiB)"),type:"input-int",min:0,max:500},{name:"visibility",label:t("Visibility"),type:"check",content:t("Public"),hidden:!this.isAdminPage},{name:"protected",label:t("Protected"),type:"check",content:t("Protected")},{name:"description",label:t("Description"),type:"textarea",maxLength:255},{name:"more",label:t("Advanced Options"),type:"more"},{name:"hw_qemu_guest_agent",label:t("qemu_guest_agent enabled"),type:"radio",onlyRadio:!0,options:this.yesNoList,tip:t("It is recommended to install and use this agent. The instance created with this image can be used to modify the password (qemu_guest_agent needs to be installed when creating the image)."),hidden:!e},{name:"hw_cpu_policy",label:t("CPU Policy"),type:"select",options:(0,w.getOptionsWithNoSet)(N.cpuPolicyList),hidden:!e},{name:"hw_cpu_thread_policy",label:t("CPU Thread Policy"),type:"select",options:(0,w.getOptionsWithNoSet)(N.cpuThreadPolicyList),hidden:!e}]}}a.Edit=k,(0,y.default)(k,"id","image-edit"),(0,y.default)(k,"title",t("Edit Image")),(0,y.default)(k,"buttonText",t("Edit")),(0,y.default)(k,"policy","modify_image"),(0,y.default)(k,"allowed",((e,t)=>{var{isAdminPage:a}=t;return h.default.resolve((0,A.isActive)(e)&&(0,x.isOwner)(e)||a)}));var j=(0,S.inject)("rootStore")((0,S.observer)(k));a.default=j},3639:function(e,a,r){"use strict";var i=r(19),n=r(21);i(a,"__esModule",{value:!0}),a.default=void 0;var l=n(r(36)),o=r(1193),s=n(r(565)),u=r(563);class d extends o.ConfirmAction{constructor(){super(...arguments),(0,l.default)(this,"policy","delete_image"),(0,l.default)(this,"allowedCheckFunc",(e=>!e||this.notDeleted(e)&&this.notProtected(e)&&((0,u.isOwner)(e)||this.isAdminPage))),(0,l.default)(this,"onSubmit",(e=>s.default.delete({id:e.id})))}get id(){return"delete"}get title(){return t("Delete Image")}get isDanger(){return!0}get buttonText(){return t("Delete")}get actionName(){return t("delete image")}notDeleted(e){return"deleted"!==e.status}notProtected(e){return!e.protected}}a.default=d},3640:function(e,a,r){"use strict";var i=r(19),n=r(21);i(a,"__esModule",{value:!0}),a.default=a.StepCreate=void 0;var l=n(r(81)),o=n(r(65)),s=n(r(36)),u=r(406),d=n(r(1253)),c=r(563);class f extends d.default{static path(e){var t;return(0,l.default)(t="/compute/instance/create?image=".concat(e.id,"&os_distro=")).call(t,e.os_distro)}static allowed(e,t){var{isAdminPage:a}=t;return o.default.resolve(!a&&(0,c.canImageCreateInstance)(e))}}a.StepCreate=f,(0,s.default)(f,"id","instance-create"),(0,s.default)(f,"title",t("Create Instance")),(0,s.default)(f,"policy","os_compute_api:servers:create:trusted_certs");var p=(0,u.inject)("rootStore")((0,u.observer)(f));a.default=p},3641:function(e,a,r){"use strict";var i=r(19),n=r(21);i(a,"__esModule",{value:!0}),a.default=a.CreateIronic=void 0;var l=n(r(81)),o=n(r(65)),s=n(r(36)),u=r(406),d=n(r(1253)),c=r(563),f=r(1195);class p extends d.default{static path(e){var t;return(0,l.default)(t="/compute/ironic-instance/create?image=".concat(e.id,"&os_distro=")).call(t,e.os_distro)}static allowed(e,t){var{isAdminPage:a}=t;return o.default.resolve(!a&&(0,f.canCreateIronicByEndpoint)()&&(0,c.canImageCreateIronicInstance)(e))}}a.CreateIronic=p,(0,s.default)(p,"id","ironic-create"),(0,s.default)(p,"title",t("Create Ironic Instance")),(0,s.default)(p,"policy","os_compute_api:servers:create:trusted_certs");var m=(0,u.inject)("rootStore")((0,u.observer)(p));a.default=m},3642:function(e,a,r){"use strict";var i=r(19),n=r(21);i(a,"__esModule",{value:!0}),a.default=a.CreateVolume=void 0;var l=n(r(1204)),o=n(r(81)),s=n(r(65)),u=n(r(36)),d=r(406),c=r(1193),f=n(r(410)),p=n(r(140)),m=r(557);class h extends c.ModalAction{constructor(){super(...arguments),(0,u.default)(this,"onSubmit",(e=>{var{name:t,size:a,volume_type:r}=e,i={imageRef:this.item.id,name:t,size:a,volume_type:r};return f.default.create(i)}))}init(){this.volumeStore=f.default,this.getVolumeTypes();var e=this.getMinSize();(0,m.fetchQuota)(this,e)}getVolumeTypes(){this.volumeStore.fetchVolumeTypes()}get volumeTypes(){return this.volumeStore.volumeTypes}getMinSize(){var{min_disk:e,size:t}=this.item;return Math.max(e,Math.ceil(t/1024/1024/1024))}get name(){return t("Create Volume")}get instanceName(){return(0,l.default)(this).name}static get disableSubmit(){return(0,m.checkQuotaDisable)()}static get showQuota(){return!0}get showQuota(){return!0}get quotaInfo(){return(0,m.getQuotaInfo)(this)}get defaultValue(){var{name:e}=this.item;return{image:e,size:this.getMinSize()}}get formItems(){var e,a=this.getMinSize();return[{name:"image",label:t("Image"),type:"label",iconType:"image"},{name:"name",label:t("Name"),type:"input-name",placeholder:t("Please input name"),required:!0},{name:"volume_type",label:t("Volume Type"),type:"select",required:!0,options:this.volumeTypes,placeholder:t("Please select volume type"),onChange:m.onVolumeTypeChange},{name:"size",label:t("Capacity (GiB)"),type:"input-int",min:a,extra:(0,o.default)(e="".concat(t("Min size"),": ")).call(e,a,"GiB"),required:!0,onChange:m.onVolumeSizeChange}]}}a.CreateVolume=h,(0,u.default)(h,"id","create"),(0,u.default)(h,"title",t("Create Volume")),(0,u.default)(h,"policy","volume:create_from_image"),(0,u.default)(h,"allowed",((e,t)=>{var{isAdminPage:a}=t;return s.default.resolve(p.default.checkEndpoint("cinder")&&!a)}));var v=(0,d.inject)("rootStore")((0,d.observer)(h));a.default=v},3643:function(e,a,r){"use strict";var i=r(19),n=r(21);i(a,"__esModule",{value:!0}),a.default=a.ManageMetadata=void 0;var l=n(r(102)),o=n(r(90)),s=n(r(33)),u=n(r(27)),d=n(r(65)),c=n(r(62)),f=n(r(51)),p=n(r(36)),m=n(r(559)),h=n(r(199)),v=r(406),g=n(r(565)),y=r(1193),b=n(r(1214)),_=r(1243),S=r(563);class M extends y.ModalAction{constructor(){super(...arguments),(0,p.default)(this,"checkKeyInSystem",(e=>{var t;return!!(0,l.default)(t=this.metadata).call(t,(t=>{var a,{detail:{properties:r={}}={}}=t;return(0,o.default)(a=(0,s.default)(r)).call(a,e)>=0}))})),(0,p.default)(this,"checkCustoms",(e=>!!(0,h.default)(e)||!(0,l.default)(e).call(e,(e=>{var{key:t,value:a}=e.value||{};return!t||null==a})))),(0,p.default)(this,"hasNoValue",(e=>{var t;return!!(0,l.default)(t=(0,s.default)(e)).call(t,(t=>void 0===e[t]))})),(0,p.default)(this,"onSubmit",(e=>{var t,a,{customs:r,systems:i}=this.parseExistMetadata(),{customs:n,systems:o}=e,c=[],f=[],p=[];(0,u.default)(n).call(n,(e=>{var{key:t,value:a}=e.value||{},i=(0,l.default)(r).call(r,(e=>e.value.key===t));i?i.value.value!==a&&p.push(e.value):c.push(e.value)})),(0,u.default)(t=(0,s.default)(o)).call(t,(e=>{var t={key:e,value:o[e]};(0,m.default)(i,e)?o[e]!==i[e]&&p.push(t):c.push(t)})),(0,u.default)(r).call(r,(e=>{(0,l.default)(n).call(n,(t=>t.value.key===e.value.key))||f.push(e.value.key)})),(0,u.default)(a=(0,s.default)(i)).call(a,(e=>{(0,m.default)(o,e)||f.push(e)}));var h=[];return(0,u.default)(c).call(c,(e=>{h.push({op:"add",path:"/".concat(e.key),value:e.value})})),(0,u.default)(p).call(p,(e=>{h.push({op:"replace",path:"/".concat(e.key),value:e.value})})),(0,u.default)(f).call(f,(e=>{h.push({op:"remove",path:"/".concat(e)})})),0===h.length?d.default.resolve():this.store.update({id:this.item.id},h)}))}init(){this.store=g.default,this.metadataStore=new _.MetadataStore,this.getMetadata()}get name(){return t("Manage Metadata")}static get modalSize(){return"large"}getModalSize(){return"large"}get wrapperCol(){return{xs:{span:18},sm:{span:20}}}getMetadata(){var e=this;return(0,f.default)((function*(){yield e.metadataStore.fetchList({manage:!0,resource_types:"OS::Glance::Image"}),e.updateDefaultValue()}))()}get metadata(){return this.metadataStore.list.data||[]}getItemMetadata(){var e=this.item.originData,{container_format:t,disk_format:a,id:r,min_disk:i,min_ram:n,name:l,protected:o,tags:s,visibility:u,owner:d,created_at:f,is_public:p,updated_at:m,status:h,locations:v,file:g,size:y,image_type:b,self:_,virtual_size:S}=e;return(0,c.default)(e,["container_format","disk_format","id","min_disk","min_ram","name","protected","tags","visibility","owner","created_at","is_public","updated_at","status","locations","file","size","image_type","self","virtual_size"])}parseExistMetadata(){var e=[],t={};if(this.metadata.length>0){var a,r=this.getItemMetadata();(0,u.default)(a=(0,s.default)(r)).call(a,(a=>{this.checkKeyInSystem(a)?t[a]=r[a]:e.push({index:e.length,value:{key:a,value:r[a]}})}))}return{customs:e,systems:t}}get defaultValue(){var{name:e}=this.item,{customs:t,systems:a}=this.parseExistMetadata();return{name:e,customs:t,systems:a}}get formItems(){return[{name:"name",label:t("Name"),type:"label",iconType:"aggregate"},{name:"customs",label:t("Custom Metadata"),type:"add-select",itemComponent:b.default,addText:t("Add Custom Metadata"),validator:(e,a)=>this.checkCustoms(a)?d.default.resolve():d.default.reject(t("Please enter complete key value!"))},{name:"systems",label:t("Metadata"),type:"metadata-transfer",metadata:this.metadata,validator:(e,a)=>this.hasNoValue(a)?d.default.reject(t("Please input value")):d.default.resolve()}]}}a.ManageMetadata=M,(0,p.default)(M,"id","ManageMetadata"),(0,p.default)(M,"title",t("Manage Metadata")),(0,p.default)(M,"policy","modify_image"),(0,p.default)(M,"allowed",((e,t)=>{var{isAdminPage:a}=t;return d.default.resolve((0,S.isOwner)(e)||a)}));var I=(0,v.inject)("rootStore")((0,v.observer)(M));a.default=I},3644:function(e,a,r){"use strict";var i=r(33),n=r(44),l=r(32),o=r(25),s=r(27),u=r(45),d=r(46),c=r(19),f=r(160),p=r(21);c(a,"__esModule",{value:!0}),a.default=a.ManageAccess=void 0;var m=p(r(65)),h=p(r(32)),v=p(r(90)),g=p(r(57)),y=p(r(51)),b=p(r(36)),_=r(406),S=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var a=A(t);if(a&&a.has(e))return a.get(e);var r={},i=c&&o;for(var n in e)if("default"!==n&&Object.prototype.hasOwnProperty.call(e,n)){var l=i?o(e,n):null;l&&(l.get||l.set)?c(r,n,l):r[n]=e[n]}r.default=e,a&&a.set(e,r);return r}(r(565)),M=r(1193),I=r(407),x=r(1235);function A(e){if("function"!=typeof f)return null;var t=new f,a=new f;return(A=function(e){return e?a:t})(e)}function w(e,t){var a=i(e);if(n){var r=n(e);t&&(r=l(r).call(r,(function(t){return o(e,t).enumerable}))),a.push.apply(a,r)}return a}function N(e){for(var t=1;t<arguments.length;t++){var a,r=null!=arguments[t]?arguments[t]:{};if(t%2)s(a=w(Object(r),!0)).call(a,(function(t){(0,b.default)(e,t,r[t])}));else if(u)d(e,u(r));else{var i;s(i=w(Object(r))).call(i,(function(t){c(e,t,o(r,t))}))}}return e}class C extends M.ModalAction{constructor(){super(...arguments),(0,b.default)(this,"onSubmit",(e=>{var t,{members:a}=e;if(!a)return m.default.resolve();var{selectedRowKeys:r}=a,{id:i}=this.item,n=(0,h.default)(r).call(r,(e=>{var t;return(0,v.default)(t=this.currentMembers).call(t,e)<0})),l=(0,h.default)(t=this.currentMembers).call(t,(e=>(0,v.default)(r).call(r,e)<0));return S.default.updateMembers(i,n,l)}))}init(){this.store=new S.ImageStore,this.projectStore=new I.ProjectStore,this.getMembers(),this.getProjects()}get name(){return t("Manage Access")}static get modalSize(){return"large"}getModalSize(){return"large"}getMembers(){var e=this;return(0,y.default)((function*(){var{id:t}=e.item;yield e.store.getMembers(t),e.updateDefaultValue()}))()}getProjects(){var e=this;return(0,y.default)((function*(){yield e.projectStore.fetchList(),e.updateDefaultValue()}))()}get projects(){return this.projectStore.list.data||[]}get defaultValue(){var{name:e}=this.item;return{name:e,members:{selectedRowKeys:this.currentMembers}}}get currentMembers(){var e;return(0,g.default)(e=this.store.members||[]).call(e,(e=>e.member_id))}get formItems(){return[{name:"name",label:t("Image Name"),type:"label",iconType:"image"},N({name:"members",label:t("Project"),type:"select-table",isMulti:!0,required:!0,data:this.projects,isLoading:this.projectStore.list.isLoading},x.projectTableOptions)]}}a.ManageAccess=C,(0,b.default)(C,"id","manage-access"),(0,b.default)(C,"title",t("Manage Access")),(0,b.default)(C,"policy",["get_members","add_member","delete_member"]),(0,b.default)(C,"allowed",(e=>m.default.resolve("shared"===e.visibility)));var P=(0,_.inject)("rootStore")((0,_.observer)(C));a.default=P},3645:function(e,a,r){"use strict";var i=r(19),n=r(21);i(a,"__esModule",{value:!0}),a.default=a.Keypair=void 0;var l=n(r(36)),o=r(406),s=n(r(1194)),u=n(r(420)),d=n(r(1556));class c extends s.default{constructor(){super(...arguments),(0,l.default)(this,"getColumns",(()=>[{title:t("Name"),dataIndex:"name",idKey:"name",routeName:this.getRouteName("keypairDetail")},{title:t("Fingerprint"),dataIndex:"fingerprint"}]))}init(){this.store=u.default}get policy(){return"os_compute_api:os-keypairs:index"}get name(){return t("keypairs")}get hideCustom(){return!0}get actionConfigs(){return d.default}get rowKey(){return"name"}get searchFilters(){return[{label:t("Name"),name:"name"}]}}a.Keypair=c;var f=(0,o.inject)("rootStore")((0,o.observer)(c));a.default=f},3646:function(e,a,r){"use strict";var i=r(19),n=r(21);i(a,"__esModule",{value:!0}),a.default=void 0;var l=n(r(36)),o=r(1193),s=n(r(420));class u extends o.ConfirmAction{constructor(){super(...arguments),(0,l.default)(this,"policy","os_compute_api:os-keypairs:delete"),(0,l.default)(this,"allowedCheckFunc",(e=>!e||this.isOwnerOrAdmin(e))),(0,l.default)(this,"onSubmit",(e=>s.default.delete({id:e.name})))}get id(){return"delete"}get title(){return t("Delete Keypair")}get isDanger(){return!0}get buttonText(){return t("Delete")}get actionName(){return t("delete keypair")}isOwnerOrAdmin(e){return!!e||!0}}a.default=u},3647:function(e,a,r){"use strict";var i=r(19),n=r(21);i(a,"__esModule",{value:!0}),a.default=a.KeypairDetail=void 0;var l=r(406),o=r(420),s=n(r(1200)),u=n(r(3648)),d=n(r(1556));class c extends s.default{get name(){return t("keypair")}get policy(){return"os_compute_api:os-keypairs:show"}get listUrl(){return this.getRoutePath("keypair")}get actionConfigs(){return d.default}get detailInfos(){return[{title:t("Name"),dataIndex:"name"},{title:t("Created At"),dataIndex:"created_at",valueRender:"toLocalTime"}]}get tabs(){return[{title:t("Detail"),key:"detail",component:u.default}]}init(){this.store=new o.KeypairStore}}a.KeypairDetail=c;var f=(0,l.inject)("rootStore")((0,l.observer)(c));a.default=f},3648:function(e,a,r){"use strict";var i=r(19),n=r(21);i(a,"__esModule",{value:!0}),a.default=a.BaseDetail=void 0;var l=r(406),o=n(r(1202));class s extends o.default{get leftCards(){return[this.keypairInfoCard]}get keypairInfoCard(){var e=[{label:t("Fingerprint"),dataIndex:"fingerprint"},{label:t("Public Key"),dataIndex:"public_key",copyable:!0},{label:t("User ID"),dataIndex:"user_id"}];return{title:t("Keypair Info"),options:e}}}a.BaseDetail=s;var u=(0,l.inject)("rootStore")((0,l.observer)(s));a.default=u},3649:function(e,a,r){"use strict";var i=r(19),n=r(21);i(a,"__esModule",{value:!0}),a.default=a.ServerGroup=void 0;var l=n(r(36)),o=r(406),s=n(r(1194)),u=n(r(585)),d=n(r(1300)),c=r(161),f=n(r(1557));class p extends s.default{constructor(){super(...arguments),(0,l.default)(this,"getColumns",(()=>[{title:t("ID/Name"),dataIndex:"name",routeName:this.getRouteName("serverGroupDetail")},{title:t("Project ID/Name"),dataIndex:"project_name",isHideable:!0,hidden:!this.isAdminPage},{title:t("Member Count"),dataIndex:"members",isHideable:!0,render:e=>e.length},{title:t("Policy"),dataIndex:"policy",valueMap:d.default}]))}init(){this.store=u.default}get policy(){return this.isAdminPage,"os_compute_api:os-server-groups:index"}get name(){return t("server groups")}get adminPageHasProjectFilter(){return!0}get actionConfigs(){return this.isAdminPage?f.default.actionConfigsAdmin:f.default.actionConfigs}get searchFilters(){return[{label:t("Name"),name:"name"},{label:t("Policy"),name:"policy",options:(0,c.getOptions)(d.default)}]}}a.ServerGroup=p;var m=(0,o.inject)("rootStore")((0,o.observer)(p));a.default=m},3650:function(e,a,r){"use strict";var i=r(33),n=r(44),l=r(32),o=r(25),s=r(27),u=r(45),d=r(46),c=r(19),f=r(21);c(a,"__esModule",{value:!0}),a.default=a.Create=void 0;var p=f(r(57)),m=f(r(33)),h=f(r(65)),v=f(r(51)),g=f(r(36)),y=f(r(0)),b=r(406),_=f(r(585)),S=r(1193),M=f(r(1300)),I=f(r(407));function x(e,t){var a=i(e);if(n){var r=n(e);t&&(r=l(r).call(r,(function(t){return o(e,t).enumerable}))),a.push.apply(a,r)}return a}function A(e){for(var t=1;t<arguments.length;t++){var a,r=null!=arguments[t]?arguments[t]:{};if(t%2)s(a=x(Object(r),!0)).call(a,(function(t){(0,g.default)(e,t,r[t])}));else if(u)d(e,u(r));else{var i;s(i=x(Object(r))).call(i,(function(t){c(e,t,o(r,t))}))}}return e}class w extends S.ModalAction{constructor(){super(...arguments),(0,g.default)(this,"onSubmit",(e=>_.default.create(e)))}init(){this.state.quota={},this.state.quotaLoading=!0,this.store=_.default,this.projectStore=I.default,this.getQuota()}get name(){return t("Create server group")}static get disableSubmit(){var{novaQuota:{server_groups:{left:e=0}={}}={}}=I.default;return 0===e}static get showQuota(){return!0}get showQuota(){return!0}getQuota(){var e=this;return(0,v.default)((function*(){var t=yield e.projectStore.fetchProjectNovaQuota(),{server_groups:a={}}=t||{};e.setState({quota:a,quotaLoading:!1})}))()}get quotaInfo(){var{quota:e={},quotaLoading:a}=this.state;if(a)return[];var{left:r=0}=e,i=0===r?0:1;return[A(A({},e),{},{add:i,name:"server_groups",title:t("Server Group")})]}get formItems(){var e,a=(0,p.default)(e=(0,m.default)(M.default)).call(e,(e=>({value:e,label:M.default[e]})));return[{name:"name",label:t("Name"),type:"input-name",placeholder:t("Please input name"),required:!0},{name:"policy",label:t("Policy"),type:"select",placeholder:t("Please select policy"),options:a,required:!0,tip:y.default.createElement("div",null,y.default.createElement("p",null,t("Affinity (mandatory):")),y.default.createElement("p",null,t("The instances in the affinity group are strictly allocated to the same physical machine. When there are no more physical machines to allocate, the allocation fails.")),y.default.createElement("p",null,t("Anti-affinity (mandatory):")),y.default.createElement("p",null,t("The instances in the anti-affinity group are strictly allocated to different physical machines. When there are no more physical machines to allocate, the allocation fails.")),y.default.createElement("p",null,t("Affinity (not mandatory):")),y.default.createElement("p",null,t("The instances in the affinity group are allocated to the same physical machine as much as possible, and when there are no more physical machines to allocate, the normal allocation strategy is returned.")),y.default.createElement("p",null,t("Anti-affinity (not mandatory):")),y.default.createElement("p",null,t("The instances in the anti-affinity group are allocated to different physical machines as much as possible. When there are no more physical machines to allocate, the normal allocation strategy is returned.")))}]}}a.Create=w,(0,g.default)(w,"id","create"),(0,g.default)(w,"title",t("Create Server Group")),(0,g.default)(w,"policy","os_compute_api:os-server-groups:create"),(0,g.default)(w,"allowed",(()=>h.default.resolve(!0)));var N=(0,b.inject)("rootStore")((0,b.observer)(w));a.default=N},3651:function(e,a,r){"use strict";var i=r(19),n=r(21);i(a,"__esModule",{value:!0}),a.default=void 0;var l=n(r(36)),o=r(1193),s=n(r(585));class u extends o.ConfirmAction{constructor(){super(...arguments),(0,l.default)(this,"policy","os_compute_api:os-server-groups:delete"),(0,l.default)(this,"allowedCheckFunc",(e=>!e.members||0===e.members.length)),(0,l.default)(this,"onSubmit",(e=>{var{id:t}=e;return s.default.delete({id:t})}))}get id(){return"delete"}get title(){return t("Delete Server Group")}get isDanger(){return!0}get buttonText(){return t("Delete")}get actionName(){return t("Delete Server Group")}}a.default=u},3652:function(e,a,r){"use strict";var i=r(19),n=r(21);i(a,"__esModule",{value:!0}),a.default=a.StepCreate=void 0;var l=n(r(36)),o=r(406),s=n(r(1253));class u extends s.default{static path(e){return"/compute/instance/create?servergroup=".concat(e.id)}static allowed(){return!0}}a.StepCreate=u,(0,l.default)(u,"id","instance-create"),(0,l.default)(u,"title",t("Create Instance")),(0,l.default)(u,"policy","os_compute_api:servers:create");var d=(0,o.inject)("rootStore")((0,o.observer)(u));a.default=d},3653:function(e,a,r){"use strict";var i=r(19),n=r(21);i(a,"__esModule",{value:!0}),a.default=a.ServerGroupDetail=void 0;var l=r(406),o=r(585),s=n(r(1200)),u=n(r(1332)),d=n(r(1300)),c=n(r(1557));class f extends s.default{get name(){return t("server group")}get policy(){return"os_compute_api:os-server-groups:show"}get listUrl(){return this.getRoutePath("serverGroup")}get actionConfigs(){return this.isAdminPage?c.default.actionConfigsAdmin:c.default.actionConfigs}get detailInfos(){return[{title:t("Name"),dataIndex:"name"},{title:t("Project ID"),dataIndex:"project_id",hidden:!this.isAdminPage},{title:t("Policy"),dataIndex:"policy",valueMap:d.default},{title:t("Member Count"),dataIndex:"members",render:e=>e.length}]}get tabs(){return[{title:t("Members"),key:"members",component:u.default}]}init(){this.store=new o.ServerGroupStore}}a.ServerGroupDetail=f;var p=(0,l.inject)("rootStore")((0,l.observer)(f));a.default=p},3654:function(e,a,r){"use strict";var i=r(19),n=r(21);i(a,"__esModule",{value:!0}),a.default=a.ImageDetail=void 0;var l=n(r(198)),o=r(406),s=r(563),u=r(565),d=r(1339),c=n(r(1552)),f=n(r(1200)),p=n(r(3655)),m=n(r(1554));class h extends f.default{get name(){return this.isImageDetail?t("image"):t("instance snapshot")}get policy(){return"get_image"}get isImageDetail(){var e;return(0,l.default)(e=this.path).call(e,"image")}get listUrl(){return this.isImageDetail?this.getRoutePath("image"):this.getRoutePath("instanceSnapshot")}get actionConfigs(){return this.isImageDetail?this.isAdminPage?m.default.actionConfigsAdmin:m.default.actionConfigs:this.isAdminPage?c.default.adminConfigs:c.default.actionConfigs}get detailInfos(){return[{title:t("Name"),dataIndex:"name"},{title:t("Status"),dataIndex:"status",valueMap:s.imageStatus},{title:t("Project ID"),dataIndex:"owner"},{title:t("Description"),dataIndex:"description"},{title:t("Created At"),dataIndex:"created_at",valueRender:"toLocalTime"},{title:t("Updated At"),dataIndex:"updated_at",valueRender:"toLocalTime"}]}get tabs(){return[{title:t("Detail"),key:"detail",component:p.default}]}init(){this.store=this.isImageDetail?new u.ImageStore:new d.InstanceSnapshotStore}}a.ImageDetail=h;var v=(0,o.inject)("rootStore")((0,o.observer)(h));a.default=v},3655:function(e,a,r){"use strict";var i=r(19),n=r(21);i(a,"__esModule",{value:!0}),a.default=a.BaseDetail=void 0;var l=n(r(335)),o=n(r(198)),s=n(r(32)),u=n(r(33)),d=n(r(90)),c=n(r(57)),f=n(r(36)),p=n(r(91)),m=n(r(99)),h=r(34),v=r(406),g=r(563),y=n(r(1202));class b extends y.default{constructor(){super(...arguments),(0,f.default)(this,"getPropertyItem",((e,t,a)=>{var r=g.imageProperties[t]||t,i=(0,m.default)(r)?r.label:r,n=(0,m.default)(r)?i.filters:null,s=e[t];return{label:i,dataIndex:t,valueRender:n||null,render:n||(0,m.default)(s)||(0,p.default)(s)?e=>(0,l.default)(e):null,copyable:(0,o.default)(a).call(a,t)}}))}get isImageDetail(){var e;return(0,o.default)(e=this.path).call(e,"image")}get leftCards(){var e=[this.baseInfoCard,this.securityCard];return this.isImageDetail?e:[this.InstanceCard,...e]}get rightCards(){return[this.propertiesCard]}get baseInfoCard(){var e=[{label:t("Size"),dataIndex:"size",valueRender:"bytes"},{label:t("Min System Disk (GiB)"),dataIndex:"min_disk"},{label:t("Min Memory (GiB)"),dataIndex:"min_ram",valueRender:"GiBValue"},{label:t("Disk Format"),dataIndex:"disk_format",valueRender:"uppercase"},{label:t("OS"),dataIndex:"os_distro",valueMap:g.imageOS},{label:t("OS Version"),dataIndex:"os_version"},{label:t("Container Format"),dataIndex:"container_format",valueRender:"uppercase"}];return{title:t("Base Info"),options:e}}get securityCard(){var e=[{label:t("Owner"),dataIndex:"owner",copyable:!0},{label:t("Filename"),dataIndex:"file",copyable:!0},{label:t("Visibility"),dataIndex:"visibility",valueMap:g.imageVisibility},{label:t("Protected"),dataIndex:"protected",valueRender:"yesNo"},{label:t("Checksum"),dataIndex:"checksum",copyable:!0}];return{title:t("Security Info"),options:e}}get InstanceCard(){var e=[{label:t("Instance"),dataIndex:"instance",render:e=>{if(!e)return"-";if(e.server_name){var{server_id:t,server_name:a}=e;return this.getLinkRender("instanceDetail",a,{id:t},{tab:"snapshots"})}return e.server_id}}];return{title:t("Instance Info"),options:e}}get propertiesCard(){var e,a=["locations","file","direct_url"],r=["checksum","created_at","min_disk","min_ram","name","updated_at","status","protected","visibility","owner","disk_format","container_format","size","id"],i=(0,h.toJS)(this.detailData)||{},n=i.originData||i,l=(0,s.default)(e=(0,u.default)(n)).call(e,(e=>(0,d.default)(r).call(r,e)<0)),o=(0,c.default)(l).call(l,(e=>this.getPropertyItem(n,e,a)));return{title:t("Custom Properties Info"),options:o}}}a.BaseDetail=b;var _=(0,v.inject)("rootStore")((0,v.observer)(b));a.default=_},3656:function(e,a,r){"use strict";var i=r(19),n=r(21);i(a,"__esModule",{value:!0}),a.default=a.Hypervisors=void 0;var l=r(406),o=n(r(1234)),s=n(r(3657)),u=n(r(3658));class d extends o.default{get tabs(){return[{title:t("Hypervisors"),key:"Hypervisor",component:s.default},{title:t("Compute Hosts"),key:"ComputeHost",component:u.default}]}}a.Hypervisors=d;var c=(0,l.inject)("rootStore")((0,l.observer)(d));a.default=c},3657:function(e,a,r){"use strict";var i=r(19),n=r(21);i(a,"__esModule",{value:!0}),a.default=a.Hypervisors=void 0;var l=n(r(36)),o=r(406),s=n(r(1194)),u=n(r(586)),d=r(1337);class c extends s.default{constructor(){super(...arguments),(0,l.default)(this,"getColumns",(()=>{var e=[...d.hypervisorColumns];return e[0]={title:t("ID/Name"),dataIndex:"service_host",routeName:"hypervisorDetailAdmin",isLink:!0},e}))}init(){this.store=u.default}get policy(){return"os_compute_api:os-hypervisors:list"}get name(){return t("Hypervisors")}get hasTab(){return!0}get fetchDataByAllProjects(){return!1}get hideCustom(){return!0}get searchFilters(){return d.hypervisorFilters}}a.Hypervisors=c;var f=(0,o.inject)("rootStore")((0,o.observer)(c));a.default=f},3658:function(e,a,r){"use strict";var i=r(33),n=r(44),l=r(32),o=r(25),s=r(27),u=r(45),d=r(46),c=r(19),f=r(21);c(a,"__esModule",{value:!0}),a.default=a.ComputeHost=void 0;var p=f(r(81)),m=f(r(36)),h=r(406),v=f(r(1194)),g=r(1254),y=f(r(583)),b=r(161),_=f(r(3659));function S(e,t){var a=i(e);if(n){var r=n(e);t&&(r=l(r).call(r,(function(t){return o(e,t).enumerable}))),a.push.apply(a,r)}return a}function M(e){for(var t=1;t<arguments.length;t++){var a,r=null!=arguments[t]?arguments[t]:{};if(t%2)s(a=S(Object(r),!0)).call(a,(function(t){(0,m.default)(e,t,r[t])}));else if(u)d(e,u(r));else{var i;s(i=S(Object(r))).call(i,(function(t){c(e,t,o(r,t))}))}}return e}class I extends v.default{constructor(){super(...arguments),(0,m.default)(this,"updateFetchParams",(e=>M(M({},e),{},{binary:"nova-compute"}))),(0,m.default)(this,"getColumns",(()=>[{title:t("Host"),dataIndex:"host"},{title:t("Availability Zone"),dataIndex:"zone"},{title:t("Service Status"),dataIndex:"status",valueMap:g.serviceStatus,tip:(e,a)=>{var r,{disabled_reason:i}=a||{};return i?(0,p.default)(r="".concat(t("Reason: ")," ")).call(r,i):""}},{title:t("Service State"),dataIndex:"state",valueMap:g.serviceState},{title:t("Last Updated"),dataIndex:"updated_at",valueRender:"sinceTime",isHideable:!0}]))}init(){this.store=y.default}get policy(){return"os_compute_api:os-services:list"}get name(){return t("compute hosts")}get hasTab(){return!0}get fetchDataByAllProjects(){return!1}get actionConfigs(){return _.default}get searchFilters(){return[{label:t("Host"),name:"host"},{label:t("Service Status"),name:"status",options:(0,b.getOptions)(g.serviceStatus)},{label:t("Service State"),name:"state",options:(0,b.getOptions)(g.serviceState)}]}}a.ComputeHost=I;var x=(0,h.inject)("rootStore")((0,h.observer)(I));a.default=x},3659:function(e,t,a){"use strict";var r=a(19),i=a(21);r(t,"__esModule",{value:!0}),t.default=void 0;var n=i(a(3660)),l=i(a(3661)),o={rowActions:{moreActions:[{action:n.default},{action:l.default}]},batchActions:[],primaryActions:[]};t.default=o},3660:function(e,a,r){"use strict";var i=r(33),n=r(44),l=r(32),o=r(25),s=r(27),u=r(45),d=r(46),c=r(19),f=r(21);c(a,"__esModule",{value:!0}),a.default=a.DisableAction=void 0;var p=f(r(1204)),m=f(r(65)),h=f(r(36)),v=r(406),g=f(r(583)),y=r(1193);function b(e,t){var a=i(e);if(n){var r=n(e);t&&(r=l(r).call(r,(function(t){return o(e,t).enumerable}))),a.push.apply(a,r)}return a}function _(e){for(var t=1;t<arguments.length;t++){var a,r=null!=arguments[t]?arguments[t]:{};if(t%2)s(a=b(Object(r),!0)).call(a,(function(t){(0,h.default)(e,t,r[t])}));else if(u)d(e,u(r));else{var i;s(i=b(Object(r))).call(i,(function(t){c(e,t,o(r,t))}))}}return e}class S extends y.ModalAction{constructor(){super(...arguments),(0,h.default)(this,"onSubmit",(e=>{var{binary:t,id:a}=this.item,r=_(_({},e),{},{binary:t,id:a});return g.default.disable(r)}))}init(){this.store=g.default}get instanceName(){return this.item.host||(0,p.default)(this).host||this.item.id}get name(){return t("Disable compute host")}get defaultValue(){var{host:e,binary:t}=this.item;return{host:e,binary:t}}get tips(){return t("After disable the compute service, the new instance will not schedule to the compute node.")}get formItems(){return[{name:"host",label:t("Current Host"),type:"label",iconType:"instance"},{name:"disabled_reason",label:t("Reason"),type:"textarea",maxLength:64}]}}a.DisableAction=S,(0,h.default)(S,"id","disable-host"),(0,h.default)(S,"title",t("Disable Compute Host")),(0,h.default)(S,"buttonText",t("Disable")),(0,h.default)(S,"isDanger",!0),(0,h.default)(S,"allowed",(e=>m.default.resolve("enabled"===e.status))),(0,h.default)(S,"policy","os_compute_api:os-services:update");var M=(0,v.inject)("rootStore")((0,v.observer)(S));a.default=M},3661:function(e,a,r){"use strict";var i=r(19),n=r(21);i(a,"__esModule",{value:!0}),a.default=void 0;var l=n(r(36)),o=r(1193),s=n(r(583));class u extends o.ConfirmAction{constructor(){super(...arguments),(0,l.default)(this,"getItemName",(e=>e.host)),(0,l.default)(this,"policy","os_compute_api:os-services:update"),(0,l.default)(this,"allowedCheckFunc",(e=>!e||"disabled"===e.status)),(0,l.default)(this,"onSubmit",(()=>{var{id:e}=this.item;return s.default.enable({id:e})}))}get id(){return"enable-host"}get title(){return t("Enable Compute Host")}get buttonText(){return t("Enable")}get actionName(){return t("Enable compute host")}}a.default=u},3662:function(e,a,r){"use strict";var i=r(19),n=r(21);i(a,"__esModule",{value:!0}),a.default=a.HypervisorDetail=void 0;var l=n(r(81));r(411);var o=n(r(227)),s=n(r(0)),u=r(406),d=r(586),c=n(r(1200)),f=n(r(1332));r(173);class p extends c.default{get name(){return t("hypervisor")}get policy(){return"os_compute_api:os-hypervisors:show"}get listUrl(){return this.getRoutePath("hypervisor")}get detailInfos(){var e=[{title:t("Hostname"),dataIndex:"service_host"},{title:t("Type"),dataIndex:"hypervisor_type"},{title:t("VCPU (Core)"),dataIndex:"vcpus_used_percent",render:(e,a)=>{var r;return"ironic"===a.hypervisor_type?s.default.createElement(o.default,{title:t("vCPUs and ram are not used for bare metal scheduling")},s.default.createElement("span",null,"-")):(0,l.default)(r="".concat(a.vcpus_used," / ")).call(r,a.vcpus)}},{title:t("Configured Memory (GiB)"),dataIndex:"memory_mb_percent",render:(e,a)=>{var r;return"ironic"===a.hypervisor_type?s.default.createElement(o.default,{title:t("vCPUs and ram are not used for bare metal scheduling")},s.default.createElement("span",null,"-")):(0,l.default)(r="".concat(a.memory_mb_used_gb," / ")).call(r,a.memory_mb_gb)}}],{vgpus:a,vgpus_used:r}=this.store.detail;return a&&e.push({title:t("VGPU (Core)"),dataIndex:"vgpus",render:()=>{var e;return(0,l.default)(e="".concat(r," / ")).call(e,a)}}),e}get tabs(){return[{title:t("Members"),key:"members",component:f.default}]}init(){this.store=new d.HypervisorStore}}a.HypervisorDetail=p;var m=(0,u.inject)("rootStore")((0,u.observer)(p));a.default=m},3663:function(e,a,r){"use strict";var i=r(19),n=r(21);i(a,"__esModule",{value:!0}),a.default=a.HostAggregate=void 0;var l=r(406),o=n(r(1234)),s=n(r(3664)),u=n(r(3671));class d extends o.default{get tabs(){return[{title:t("Host Aggregate"),key:"hostAggregate",component:s.default},{title:t("Availability Zones"),key:"availabilityZone",component:u.default}]}}a.HostAggregate=d;var c=(0,l.inject)("rootStore")((0,l.observer)(d));a.default=c},3664:function(e,a,r){"use strict";var i=r(19),n=r(21);i(a,"__esModule",{value:!0}),a.default=a.HostAggregate=void 0;var l=n(r(57)),o=n(r(33)),s=n(r(81)),u=n(r(36)),d=n(r(199)),c=n(r(0)),f=r(406),p=n(r(1194)),m=n(r(1280)),h=n(r(3665));class v extends p.default{constructor(){super(...arguments),(0,u.default)(this,"getColumns",(()=>[{title:t("Name"),dataIndex:"name"},{title:t("Availability Zone"),dataIndex:"availability_zone",isHideable:!0},{title:t("Hosts"),dataIndex:"hosts",isHideable:!0,render:e=>e&&0!==e.length?(0,l.default)(e).call(e,(e=>c.default.createElement("div",{key:e},e))):"-"},{title:t("Metadata"),dataIndex:"metadata",isHideable:!0,render:e=>{var t;return!e||(0,d.default)(e)?"-":(0,l.default)(t=(0,o.default)(e)).call(t,(t=>c.default.createElement("div",{key:t},t,"=",e[t])))},stringify:e=>{var t;return!e||(0,d.default)(e)?"-":(0,l.default)(t=(0,o.default)(e)).call(t,(t=>{var a;return(0,s.default)(a="".concat(t,"=")).call(a,e[t])})).join(";")}},{title:t("Created At"),dataIndex:"created_at",valueRender:"sinceTime",isHideable:!0}]))}init(){this.store=m.default}get policy(){return"os_compute_api:os-aggregates:index"}get name(){return t("host aggregates")}get hasTab(){return!0}get actionConfigs(){return h.default}get searchFilters(){return[{label:t("Name"),name:"name"}]}}a.HostAggregate=v;var g=(0,f.inject)("rootStore")((0,f.observer)(v));a.default=g},3665:function(e,t,a){"use strict";var r=a(19),i=a(21);r(t,"__esModule",{value:!0}),t.default=void 0;var n=i(a(3666)),l=i(a(3667)),o=i(a(3668)),s=i(a(3669)),u=i(a(3670)),d={rowActions:{firstAction:l.default,moreActions:[{action:s.default},{action:u.default},{action:o.default}]},batchActions:[o.default],primaryActions:[n.default]};t.default=d},3666:function(e,a,r){"use strict";var i=r(33),n=r(44),l=r(32),o=r(25),s=r(27),u=r(45),d=r(46),c=r(19),f=r(21);c(a,"__esModule",{value:!0}),a.default=a.Create=void 0;var p=f(r(57)),m=f(r(65)),h=f(r(62)),v=f(r(36)),g=r(406),y=f(r(1280)),b=r(1193),_=f(r(1262)),S=r(161);function M(e,t){var a=i(e);if(n){var r=n(e);t&&(r=l(r).call(r,(function(t){return o(e,t).enumerable}))),a.push.apply(a,r)}return a}function I(e){for(var t=1;t<arguments.length;t++){var a,r=null!=arguments[t]?arguments[t]:{};if(t%2)s(a=M(Object(r),!0)).call(a,(function(t){(0,v.default)(e,t,r[t])}));else if(u)d(e,u(r));else{var i;s(i=M(Object(r))).call(i,(function(t){c(e,t,o(r,t))}))}}return e}class x extends b.ModalAction{constructor(){super(...arguments),(0,v.default)(this,"onSubmit",(e=>{var{isCreate:t,availabilityZone:a,newAz:r}=e,i="noSelect"!==a?a:null,n=I(I({},(0,h.default)(e,["isCreate","availabilityZone","newAz"])),{},{availability_zone:t?r:i});return y.default.create(n)}))}init(){this.store=y.default,this.azStore=_.default,this.getAvailabilityZones()}getAvailabilityZones(){this.azStore.fetchListWithoutDetail()}get azList(){var e,a=(0,p.default)(e=this.azStore.list.data||[]).call(e,(e=>({label:e.zoneName,value:e.zoneName})));return a.push({label:t("Not select"),value:"noSelect"}),a}get name(){return t("Create host aggregate")}get defaultValue(){return{isCreate:!1,availabilityZone:(this.azList[0]||[]).value}}get formItems(){var{isCreate:e=!1}=this.state,a=t("It is suggested to use the marked AZ directly, too much AZ will lead to the fragmentation of available resources"),r=t("A host aggregate can be associated with at most one AZ. Once the association is established, the AZ cannot be disassociated.");return[{name:"name",label:t("Name"),type:"input-name",placeholder:t("Please input name"),required:!0},{name:"isCreate",label:t("Create new AZ"),tip:a,type:"radio",options:(0,S.getYesNoList)()},{name:"availabilityZone",label:t("Availability Zone"),type:"select",options:this.azList,tip:r,hidden:e},{name:"newAz",label:t("New Availability Zone"),type:"input",help:a,hidden:!e}]}}a.Create=x,(0,v.default)(x,"id","create"),(0,v.default)(x,"title",t("Create Host Aggregate")),(0,v.default)(x,"policy","os_compute_api:os-aggregates:create"),(0,v.default)(x,"allowed",(()=>m.default.resolve(!0)));var A=(0,g.inject)("rootStore")((0,g.observer)(x));a.default=A},3667:function(e,a,r){"use strict";var i=r(33),n=r(44),l=r(32),o=r(25),s=r(27),u=r(45),d=r(46),c=r(19),f=r(21);c(a,"__esModule",{value:!0}),a.default=a.Edit=void 0;var p=f(r(57)),m=f(r(65)),h=f(r(62)),v=f(r(36)),g=r(406),y=f(r(1280)),b=r(1193),_=f(r(1262)),S=r(161);function M(e,t){var a=i(e);if(n){var r=n(e);t&&(r=l(r).call(r,(function(t){return o(e,t).enumerable}))),a.push.apply(a,r)}return a}class I extends b.ModalAction{constructor(){super(...arguments),(0,v.default)(this,"onSubmit",(e=>{var{id:t,hosts:a=[]}=this.item,{isCreate:r,availabilityZone:i,newAz:n}=e,l="noSelect"!==i?i:null,f=function(e){for(var t=1;t<arguments.length;t++){var a,r=null!=arguments[t]?arguments[t]:{};if(t%2)s(a=M(Object(r),!0)).call(a,(function(t){(0,v.default)(e,t,r[t])}));else if(u)d(e,u(r));else{var i;s(i=M(Object(r))).call(i,(function(t){c(e,t,o(r,t))}))}}return e}({},(0,h.default)(e,["isCreate","availabilityZone","newAz"]));return 0===a.length&&(r?f.availability_zone=n:l&&(f.availability_zone=l)),y.default.edit({id:t},f)}))}init(){this.store=y.default,this.azStore=_.default,this.getAvailabilityZones()}getAvailabilityZones(){this.azStore.fetchList()}get azList(){var e,a=(0,p.default)(e=this.azStore.list.data||[]).call(e,(e=>({label:e.zoneName,value:e.zoneName}))),{availability_zone:r}=this.item;return null===r&&a.push({label:t("Not select"),value:"noSelect"}),a}get name(){return t("Edit host aggregate")}get defaultValue(){var{name:e,availability_zone:t}=this.item;return{isCreate:!1,name:e,availabilityZone:t}}get formItems(){var{hosts:e=[]}=this.item,{isCreate:a=!1}=this.state,r=e.length>0,i=t("It is suggested to use the marked AZ directly, too much AZ will lead to the fragmentation of available resources"),n=t("A host aggregate can be associated with at most one AZ. Once the association is established, the AZ cannot be disassociated.");return[{name:"name",label:t("Name"),type:"input-name",placeholder:t("Please input name"),required:!0},{name:"isCreate",label:t("Create new AZ"),tip:i,type:"radio",options:(0,S.getYesNoList)(),hidden:r},{name:"availabilityZone",label:t("Availability Zone"),type:"select",options:this.azList,required:!0,tip:n,hidden:r||!r&&a,disabled:r},{name:"newAz",label:t("New Availability Zone"),type:"input",required:!0,help:i,hidden:r||!r&&!a,disabled:r}]}}a.Edit=I,(0,v.default)(I,"id","edit"),(0,v.default)(I,"title",t("Edit Host Aggregate")),(0,v.default)(I,"buttonText",t("Edit")),(0,v.default)(I,"policy","os_compute_api:os-aggregates:update"),(0,v.default)(I,"allowed",(()=>m.default.resolve(!0)));var x=(0,g.inject)("rootStore")((0,g.observer)(I));a.default=x},3668:function(e,a,r){"use strict";var i=r(19),n=r(21);i(a,"__esModule",{value:!0}),a.default=void 0;var l=n(r(36)),o=r(1193),s=n(r(1280));class u extends o.ConfirmAction{constructor(){super(...arguments),(0,l.default)(this,"policy","os_compute_api:os-aggregates:delete"),(0,l.default)(this,"canDelete",(e=>e&&e.hosts&&0===e.hosts.length)),(0,l.default)(this,"allowedCheckFunc",(e=>this.canDelete(e))),(0,l.default)(this,"onSubmit",(e=>{var{id:t}=e;return s.default.delete({id:t})}))}get id(){return"delete"}get title(){return t("Delete Host Aggregate")}get isDanger(){return!0}get buttonText(){return t("Delete")}get actionName(){return t("Delete Host Aggregate")}}a.default=u},3669:function(e,a,r){"use strict";var i=r(33),n=r(44),l=r(32),o=r(25),s=r(27),u=r(45),d=r(46),c=r(19),f=r(21);c(a,"__esModule",{value:!0}),a.default=a.ManageHost=void 0;var p=f(r(32)),m=f(r(90)),h=f(r(65)),v=f(r(57)),g=f(r(81)),y=f(r(36)),b=r(406),_=r(1280),S=f(r(583)),M=r(1193),I=r(1254);function x(e,t){var a=i(e);if(n){var r=n(e);t&&(r=l(r).call(r,(function(t){return o(e,t).enumerable}))),a.push.apply(a,r)}return a}function A(e){for(var t=1;t<arguments.length;t++){var a,r=null!=arguments[t]?arguments[t]:{};if(t%2)s(a=x(Object(r),!0)).call(a,(function(t){(0,y.default)(e,t,r[t])}));else if(u)d(e,u(r));else{var i;s(i=x(Object(r))).call(i,(function(t){c(e,t,o(r,t))}))}}return e}class w extends M.ModalAction{constructor(){super(...arguments),(0,y.default)(this,"onSubmit",(e=>{var{hosts:t}=e,{selectedRowKeys:a}=t,{id:r,hosts:i}=this.item,n=(0,p.default)(a).call(a,(e=>(0,m.default)(i).call(i,e)<0)),l=(0,p.default)(i).call(i,(e=>(0,m.default)(a).call(a,e)<0));return 0===n.length&&0===l.length?h.default.resolve():this.store.manageHost({id:r,adds:n,dels:l})}))}init(){this.store=new _.AggregateStore,this.getComputeHosts()}get name(){return t("Manage host")}static get modalSize(){return"large"}getModalSize(){return"large"}get tips(){return t("Add hosts to the aggregate or remove hosts from it. Hosts can be in multiple aggregates.")}getComputeHosts(){S.default.fetchList({binary:"nova-compute"})}get computeHosts(){var e;return(0,v.default)(e=S.default.list.data||[]).call(e,(e=>A(A({},e),{},{name:e.host,id:e.host})))}get defaultValue(){var{name:e,hosts:t}=this.item;return{name:e,hosts:{selectedRowKeys:t}}}get formItems(){return[{name:"name",label:t("Name"),type:"label",iconType:"aggregate"},{name:"hosts",label:t("Hosts"),type:"select-table",isMulti:!0,data:this.computeHosts,isLoading:S.default.list.isLoading,filterParams:[{label:t("Host"),name:"name"}],columns:[{title:t("Host"),dataIndex:"host"},{title:t("Availability Zone"),dataIndex:"zone"},{title:t("Admin Status"),dataIndex:"status",isHideable:!0,valueMap:I.serviceStatus,tip:(e,a)=>{var r,{disabled_reason:i}=a||{};return i?(0,g.default)(r="".concat(t("Reason: ")," ")).call(r,i):""}},{title:t("State"),dataIndex:"state",isHideable:!0,valueMap:I.serviceState},{title:t("Last Updated"),dataIndex:"updated_at",valueRender:"sinceTime",isHideable:!0}]}]}}a.ManageHost=w,(0,y.default)(w,"id","ManageHost"),(0,y.default)(w,"title",t("Manage Host")),(0,y.default)(w,"policy",["os_compute_api:os-aggregates:add_host","os_compute_api:os-aggregates:remove_host"]),(0,y.default)(w,"allowed",(()=>h.default.resolve(!0)));var N=(0,b.inject)("rootStore")((0,b.observer)(w));a.default=N},3670:function(e,a,r){"use strict";var i=r(33),n=r(44),l=r(32),o=r(25),s=r(27),u=r(45),d=r(46),c=r(19),f=r(21);c(a,"__esModule",{value:!0}),a.default=a.ManageMetadata=void 0;var p=f(r(102)),m=f(r(90)),h=f(r(33)),v=f(r(27)),g=f(r(65)),y=f(r(51)),b=f(r(36)),_=f(r(559)),S=f(r(199)),M=r(406),I=r(1280),x=r(1193),A=f(r(1214)),w=r(1243);function N(e,t){var a=i(e);if(n){var r=n(e);t&&(r=l(r).call(r,(function(t){return o(e,t).enumerable}))),a.push.apply(a,r)}return a}class C extends x.ModalAction{constructor(){super(...arguments),(0,b.default)(this,"checkKeyInSystem",(e=>{var t;return!!(0,p.default)(t=this.metadata).call(t,(t=>{var a,{detail:{properties:r={}}={}}=t;return(0,m.default)(a=(0,h.default)(r)).call(a,e)>=0}))})),(0,b.default)(this,"checkCustoms",(e=>!!(0,S.default)(e)||!(0,p.default)(e).call(e,(e=>{var{key:t,value:a}=e.value||{};return!t||null==a})))),(0,b.default)(this,"hasNoValue",(e=>{var t;return!!(0,p.default)(t=(0,h.default)(e)).call(t,(t=>void 0===e[t]))})),(0,b.default)(this,"onSubmit",(e=>{var t,{customs:a,systems:r}=e,{id:i,metadata:n}=this.item,l=function(e){for(var t=1;t<arguments.length;t++){var a,r=null!=arguments[t]?arguments[t]:{};if(t%2)s(a=N(Object(r),!0)).call(a,(function(t){(0,b.default)(e,t,r[t])}));else if(u)d(e,u(r));else{var i;s(i=N(Object(r))).call(i,(function(t){c(e,t,o(r,t))}))}}return e}({},r);return(0,v.default)(a).call(a,(e=>{l[e.value.key]=e.value.value})),(0,v.default)(t=(0,h.default)(n)).call(t,(e=>{(0,_.default)(l,e)||(l[e]=null)})),this.store.manageMetadata({id:i,metadata:l})}))}init(){this.store=new I.AggregateStore,this.metadataStore=new w.MetadataStore,this.getMetadata()}get name(){return t("Manage host")}static get modalSize(){return"large"}getModalSize(){return"large"}get wrapperCol(){return{xs:{span:18},sm:{span:20}}}getMetadata(){var e=this;return(0,y.default)((function*(){yield e.metadataStore.fetchList({manage:!0,resource_types:"OS::Nova::Aggregate"}),e.updateDefaultValue()}))()}get metadata(){return this.metadataStore.list.data||[]}parseExistMetadata(){var e=[],t={};if(this.metadata.length>0){var a,{metadata:r}=this.item;(0,v.default)(a=(0,h.default)(r)).call(a,(a=>{this.checkKeyInSystem(a)?t[a]=r[a]:e.push({index:e.length,value:{key:a,value:r[a]}})}))}return{customs:e,systems:t}}get defaultValue(){var{name:e}=this.item,{customs:t,systems:a}=this.parseExistMetadata();return{name:e,customs:t,systems:a}}get formItems(){return[{name:"name",label:t("Name"),type:"label",iconType:"aggregate"},{name:"customs",label:t("Custom Metadata"),type:"add-select",itemComponent:A.default,addText:t("Add Custom Metadata"),validator:(e,a)=>this.checkCustoms(a)?g.default.resolve():g.default.reject(t("Please enter complete key value!"))},{name:"systems",label:t("Metadata"),type:"metadata-transfer",metadata:this.metadata,validator:(e,a)=>this.hasNoValue(a)?g.default.reject(t("Please input value")):g.default.resolve()}]}}a.ManageMetadata=C,(0,b.default)(C,"id","ManageMetadata"),(0,b.default)(C,"title",t("Manage Metadata")),(0,b.default)(C,"policy","os_compute_api:os-aggregates:set_metadata"),(0,b.default)(C,"allowed",(()=>g.default.resolve(!0)));var P=(0,M.inject)("rootStore")((0,M.observer)(C));a.default=P},3671:function(e,a,r){"use strict";var i=r(19),n=r(21);i(a,"__esModule",{value:!0}),a.default=a.AvailabilityZone=void 0;var l=n(r(57)),o=n(r(33)),s=n(r(36)),u=n(r(199)),d=n(r(0)),c=r(406),f=n(r(1194)),p=n(r(1262));class m extends f.default{constructor(){super(...arguments),(0,s.default)(this,"getColumns",(()=>[{title:t("Availability Zone Name"),dataIndex:"zoneName"},{title:t("Hosts"),dataIndex:"hosts",isHideable:!0,render:e=>{var t;return!e||(0,u.default)(e)?"-":(0,l.default)(t=(0,o.default)(e)).call(t,(e=>d.default.createElement("div",{key:e},e)))},stringify:e=>!e||(0,u.default)(e)?"-":(0,o.default)(e)},{title:t("Available"),dataIndex:"available",isHideable:!0,valueRender:"yesNo"}]))}init(){this.store=p.default}get policy(){return"os_compute_api:os-availability-zone:detail"}get name(){return t("availability zones")}get rowKey(){return"zoneName"}get hasTab(){return!0}get searchFilters(){return[{label:t("Availability Zone Name"),name:"zoneName"}]}}a.AvailabilityZone=m;var h=(0,c.inject)("rootStore")((0,c.observer)(m));a.default=h},3672:function(e,a,r){"use strict";var i=r(19),n=r(21);i(a,"__esModule",{value:!0}),a.default=a.BareMetalNode=void 0;var l=n(r(62)),o=n(r(36)),s=r(406),u=n(r(1194)),d=n(r(1225)),c=r(1281),f=r(76),p=r(161),m=n(r(1558));class h extends u.default{constructor(){super(...arguments),(0,o.default)(this,"getColumns",(()=>[{title:t("Node ID/Name"),dataIndex:"name",routeName:"baremetalNodeDetailAdmin"},{title:t("Ironic Instance Name"),dataIndex:"instance_info",render:e=>{var{display_name:t=""}=e||{};return t||"-"}},{title:t("Power State"),dataIndex:"power_state",valueMap:c.powerState},{title:t("Provision State"),dataIndex:"provision_state",valueMap:c.provisioningState},{title:t("Maintained"),dataIndex:"maintenance",valueRender:"yesNo",tip:(e,t)=>t.maintenance_reason},{title:t("Number of Ports"),dataIndex:"portCount",isHideable:!0},{title:t("Driver"),dataIndex:"driver",isHideable:!0},{title:t("Created At"),dataIndex:"created_at",isHideable:!0,valueRender:"sinceTime"}])),(0,o.default)(this,"updateFetchParams",(e=>{var{all_projects:t}=e;return(0,l.default)(e,["all_projects"])}))}init(){this.store=d.default}get policy(){return"baremetal:node:get"}get name(){return t("bare metal nodes")}get rowKey(){return"uuid"}get checkEndpoint(){return!0}get endpoint(){return(0,f.ironicOriginEndpoint)()}get actionConfigs(){return m.default}get searchFilters(){return[{label:t("Name"),name:"name"},{label:t("Power State"),name:"power_state",options:(0,p.getOptions)(c.powerState)},{label:t("Provision State"),name:"provision_state",options:(0,p.getOptions)(c.provisioningState)}]}}a.BareMetalNode=h;var v=(0,s.inject)("rootStore")((0,s.observer)(h));a.default=v},3673:function(e,a,r){"use strict";var i=r(19),n=r(21);i(a,"__esModule",{value:!0}),a.default=a.ManageState=void 0;var l=n(r(36)),o=r(406),s=n(r(1225)),u=r(1193),d=r(1281),c=r(161);class f extends u.ModalAction{constructor(){super(...arguments),(0,l.default)(this,"onSubmit",(e=>{var{target:t}=e,{uuid:a,provision_state:r}=this.item,i="";if("available"===t)i="provide";else if("manageable"===t)switch(r){case"available":case"enroll":i="manage";break;default:i="delete"}var n={target:i};return s.default.changeProvision(a,n)}))}get name(){return t("Manage State")}get defaultValue(){var{name:e,uuid:t}=this.item;return{name:e||t}}get stateOptions(){var{provision_state:e}=this.item;if("available"===e||"active"===e||"enroll"===e){var t={manageable:d.provisioningState.manageable};return(0,c.getOptions)(t)}var a={available:d.provisioningState.available};return(0,c.getOptions)(a)}get formItems(){return[{name:"name",label:t("Node"),type:"label",iconType:"host"},{name:"target",label:t("State"),type:"select",required:!0,options:this.stateOptions}]}}a.ManageState=f,(0,l.default)(f,"id","ManageState"),(0,l.default)(f,"title",t("Manage State")),(0,l.default)(f,"policy","baremetal:node:set_provision_state"),(0,l.default)(f,"allowed",(e=>(0,d.canChangeStatus)(e)));var p=(0,o.inject)("rootStore")((0,o.observer)(f));a.default=p},3674:function(e,a,r){"use strict";var i=r(19),n=r(21);i(a,"__esModule",{value:!0}),a.default=void 0;var l=n(r(36)),o=r(1193),s=n(r(1225));class u extends o.ConfirmAction{constructor(){super(...arguments),(0,l.default)(this,"policy","baremetal:node:set_power_state"),(0,l.default)(this,"getItemId",(e=>e.uuid)),(0,l.default)(this,"allowedCheckFunc",(e=>"power on"===e.power_state)),(0,l.default)(this,"onSubmit",(()=>{var{uuid:e}=this.item;return s.default.changePower(e,{target:"power off"})}))}get id(){return"power-off"}get title(){return t("Power Off")}get actionName(){return t("Power Off")}get isAsyncAction(){return!0}}a.default=u},3675:function(e,a,r){"use strict";var i=r(19),n=r(21);i(a,"__esModule",{value:!0}),a.default=void 0;var l=n(r(36)),o=r(1193),s=n(r(1225));class u extends o.ConfirmAction{constructor(){super(...arguments),(0,l.default)(this,"policy","baremetal:node:set_power_state"),(0,l.default)(this,"getItemId",(e=>e.uuid)),(0,l.default)(this,"allowedCheckFunc",(e=>"power off"===e.power_state)),(0,l.default)(this,"onSubmit",(()=>{var{uuid:e}=this.item;return s.default.changePower(e,{target:"power on"})}))}get id(){return"power-on"}get title(){return t("Power On")}get actionName(){return t("Power On")}get isAsyncAction(){return!0}}a.default=u},3676:function(e,a,r){"use strict";var i=r(19),n=r(21);i(a,"__esModule",{value:!0}),a.default=a.SetMaintenance=void 0;var l=n(r(65)),o=n(r(36)),s=r(406),u=n(r(1225)),d=r(1193);class c extends d.ModalAction{constructor(){super(...arguments),(0,o.default)(this,"onSubmit",(e=>{var{reason:t}=e,{uuid:a}=this.item,r={reason:t};return u.default.setMaintenance(a,r)}))}get name(){return t("Enter Maintenance Mode")}get defaultValue(){var{name:e,uuid:t}=this.item;return{name:e||t}}get formItems(){return[{name:"name",label:t("Node"),type:"label",iconType:"host"},{name:"reason",label:t("Reason"),type:"textarea"}]}}a.SetMaintenance=c,(0,o.default)(c,"id","SetMaintenance"),(0,o.default)(c,"title",t("Enter Maintenance Mode")),(0,o.default)(c,"policy","baremetal:node:set_maintenance"),(0,o.default)(c,"allowed",(e=>l.default.resolve(!e.maintenance)));var f=(0,s.inject)("rootStore")((0,s.observer)(c));a.default=f},3677:function(e,a,r){"use strict";var i=r(19),n=r(21);i(a,"__esModule",{value:!0}),a.default=void 0;var l=n(r(36)),o=r(1193),s=n(r(1225));class u extends o.ConfirmAction{constructor(){super(...arguments),(0,l.default)(this,"policy","baremetal:node:clear_maintenance"),(0,l.default)(this,"getItemId",(e=>e.uuid)),(0,l.default)(this,"allowedCheckFunc",(e=>e.maintenance)),(0,l.default)(this,"onSubmit",(()=>{var{uuid:e}=this.item;return s.default.clearMaintenance(e)}))}get id(){return"ClearMaintenance"}get title(){return t("Leave Maintenance Mode")}get actionName(){return t("Leave Maintenance Mode")}}a.default=u},3678:function(e,a,r){"use strict";var i=r(19),n=r(21);i(a,"__esModule",{value:!0}),a.default=a.SetBootDevice=void 0;var l=n(r(57)),o=n(r(65)),s=n(r(51)),u=n(r(36)),d=r(406),c=r(1225),f=r(1193),p=r(334);class m extends f.ModalAction{constructor(){super(...arguments),(0,u.default)(this,"onSubmit",(e=>{var{boot_device:t,persistent:a}=e,{uuid:r}=this.item,i={boot_device:t,persistent:a};return this.store.setBootDevice(r,i)}))}init(){this.store=new c.IronicStore,this.getSupportedBootDevice(),this.getBootDevice()}get name(){return t("Set Boot Device")}getSupportedBootDevice(){var e=this;return(0,s.default)((function*(){yield e.store.getSupportedBootDevice(e.item.uuid),e.updateDefaultValue()}))()}getBootDevice(){var e=this;return(0,s.default)((function*(){yield e.store.getBootDevice(e.item.uuid),e.updateDefaultValue()}))()}get defaultValue(){var{name:e,uuid:t}=this.item,{boot_device:a,persistent:r=!1}=this.store.bootDevice||{};return{name:e||t,boot_device:a,persistent:r}}get deviceOptions(){var{supportedBootDevices:e=[]}=this.store;return(0,l.default)(e).call(e,(e=>({value:e,label:e})))}get formItems(){return[{name:"name",label:t("Node"),type:"label",iconType:"host"},{name:"boot_device",label:t("Boot Device"),type:"select",required:!0,options:this.deviceOptions},{name:"persistent",label:t("Persistent"),type:"radio",tip:t("Whether the boot device should be set only for the next reboot, or persistently."),options:p.yesNoOptions}]}}a.SetBootDevice=m,(0,u.default)(m,"id","SetBootDevice"),(0,u.default)(m,"title",t("Set Boot Device")),(0,u.default)(m,"policy",["baremetal:node:get_boot_device","baremetal:node:set_boot_device"]),(0,u.default)(m,"allowed",(()=>o.default.resolve(!0)));var h=(0,d.inject)("rootStore")((0,d.observer)(m));a.default=h},3679:function(e,a,r){"use strict";var i=r(19),n=r(21);i(a,"__esModule",{value:!0}),a.default=void 0;var l=n(r(36)),o=r(1193),s=n(r(1225));class u extends o.ConfirmAction{constructor(){super(...arguments),(0,l.default)(this,"policy","baremetal:node:delete"),(0,l.default)(this,"getItemId",(e=>e.uuid)),(0,l.default)(this,"allowedCheckFunc",(()=>!0)),(0,l.default)(this,"onSubmit",(e=>{var{uuid:t}=e;return s.default.delete({id:t})}))}get id(){return"delete"}get title(){return t("Delete Node")}get name(){return t("Delete Node")}get isDanger(){return!0}get buttonText(){return t("Delete")}get actionName(){return t("Delete Node")}}a.default=u},3680:function(e,a,r){"use strict";var i=r(19),n=r(21);i(a,"__esModule",{value:!0}),a.default=a.NodeInterface=void 0;var l=n(r(65)),o=n(r(36)),s=r(406),u=n(r(1201));class d extends u.default{constructor(){super(...arguments),(0,o.default)(this,"allowed",(()=>l.default.resolve()))}get bootInterfaces(){return[{value:"pxe",label:t("PXE")},{value:"ipxe",label:t("IPXE")},{value:"fake",label:t("FAKE")}]}get consoleInterfaces(){return[{value:"no-console",label:t("No Console")}]}get networkInterfaces(){return[{value:"flat",label:t("FLAT")},{value:"noop",label:t("NOOP")}]}get raidInterfaces(){return[{value:"no-raid",label:t("No Raid")},{value:"agent",label:t("Agent")}]}get storageInterfaces(){return[{value:"noop",label:t("NOOP")}]}get venderInterfaces(){return[{value:"ipmitool",label:t("IPMITool")}]}get defaultValue(){var{boot_interface:e="pxe",console_interface:t="no-console",network_interface:a="noop",raid_interface:r="no-raid",storage_interface:i="noop",vendor_interface:n="ipmitool"}=this.props.extra||{};return{boot_interface:e,console_interface:t,network_interface:a,raid_interface:r,storage_interface:i,vendor_interface:n}}get formItems(){return[{name:"boot_interface",label:t("Boot Interface"),type:"select",options:this.bootInterfaces},{name:"console_interface",label:t("Console Interface"),type:"select",options:this.consoleInterfaces},{name:"network_interface",label:t("Network Interface"),type:"select",options:this.networkInterfaces,tip:t("Which Network Interface provider to use when plumbing the network connections for this Node")},{name:"raid_interface",label:t("Raid Interface"),type:"select",options:this.raidInterfaces,tip:t("Interface used for configuring RAID on this node")},{name:"storage_interface",label:t("Storage Interface"),type:"select",options:this.storageInterfaces,tip:t("Interface used for attaching and detaching volumes on this node")},{name:"vendor_interface",label:t("Vendor Interface"),type:"select",options:this.venderInterfaces,tip:t("Interface for vendor-specific functionality on this node")}]}}a.NodeInterface=d;var c=(0,s.inject)("rootStore")((0,s.observer)(d));a.default=c},3681:function(e,a,r){"use strict";var i=r(19),n=r(21);i(a,"__esModule",{value:!0}),a.default=a.NodeInfo=void 0;var l=n(r(65)),o=n(r(57)),s=n(r(32)),u=n(r(51)),d=n(r(36)),c=r(406),f=n(r(1201)),p=r(565);class m extends f.default{constructor(){super(...arguments),(0,d.default)(this,"allowed",(()=>l.default.resolve()))}init(){this.imageStore=new p.ImageStore,this.getImages()}getImages(){var e=this;return(0,u.default)((function*(){yield e.imageStore.fetchList({all_projects:!0}),e.updateDefaultValue()}))()}get kernelImages(){var e,t=this.imageStore.list.data||[];return(0,o.default)(e=(0,s.default)(t).call(t,(e=>"aki"===e.disk_format))).call(e,(e=>({value:e.id,label:e.name})))}get ramdiskImages(){var e,t=this.imageStore.list.data||[];return(0,o.default)(e=(0,s.default)(t).call(t,(e=>"ari"===e.disk_format))).call(e,(e=>({value:e.id,label:e.name})))}get ipmiBridges(){return[{value:"no",label:t("No")}]}get ipmiPrivLevels(){return[{value:"ADMINISTRATOR",label:t("ADMINISTRATOR")},{value:"USER",label:t("USER")}]}get ipmiProtocolVersions(){return[{value:"1.5",label:"1.5"},{value:"2.0",label:"2.0"}]}get defaultValue(){var{driver_info_deploy_kernel:e,driver_info_deploy_ramdisk:t,driver_info_ipmi_address:a,driver_info_ipmi_port:r,driver_info_ipmi_username:i,driver_info_ipmi_bridge:n="no",driver_info_ipmi_priv_level:l="ADMINISTRATOR",driver_info_ipmi_protocol_version:o="2.0",driver_info_ipmi_password:s=""}=this.props.extra||{};return{driver_info_deploy_kernel:e,driver_info_deploy_ramdisk:t,driver_info_ipmi_address:a,driver_info_ipmi_port:r,driver_info_ipmi_username:i,driver_info_ipmi_password:s,driver_info_ipmi_bridge:n,driver_info_ipmi_priv_level:l,driver_info_ipmi_protocol_version:o}}get formItems(){var{more:e}=this.state;return[{name:"driver_info_deploy_kernel",label:t("Kernel Image"),type:"select",options:this.kernelImages,required:!0},{name:"driver_info_deploy_ramdisk",label:t("Ramdisk Image"),type:"select",options:this.ramdiskImages,required:!0},{name:"driver_info_ipmi_address",label:t("IPMI Address"),type:"ip-input",required:!0},{name:"driver_info_ipmi_port",label:t("IPMI Port"),type:"input-int",max:65535},{name:"driver_info_ipmi_username",label:t("IPMI Username"),type:"input",required:!0},{name:"driver_info_ipmi_password",label:t("IPMI Password"),type:"input",required:!0},{name:"more",label:t("Advanced Options"),type:"more"},{name:"driver_info_ipmi_bridge",label:t("IPMI Bridge"),type:"select",options:this.ipmiBridges,hidden:!e},{name:"driver_info_ipmi_priv_level",label:t("IPMI Privilege Level"),type:"select",options:this.ipmiPrivLevels,hidden:!e},{name:"driver_info_ipmi_protocol_version",label:t("IPMI Protocol Version"),type:"select",options:this.ipmiProtocolVersions,hidden:!e}]}}a.NodeInfo=m;var h=(0,c.inject)("rootStore")((0,c.observer)(m));a.default=h},3682:function(e,a,r){"use strict";var i=r(19),n=r(21);i(a,"__esModule",{value:!0}),a.default=a.NodeInfo=void 0;var l=n(r(90)),o=n(r(65)),s=n(r(102)),u=n(r(27)),d=n(r(588)),c=n(r(32)),f=n(r(57)),p=n(r(226)),m=n(r(51)),h=n(r(36)),v=n(r(199)),g=n(r(0)),y=r(406),b=n(r(1201)),_=n(r(1214)),S=n(r(1225)),M=e=>(0,l.default)(e).call(e,"CUSTOM_")<0;class I extends b.default{constructor(){super(...arguments),(0,h.default)(this,"allowed",(()=>o.default.resolve())),(0,h.default)(this,"checkKeyValues",(e=>!!(0,v.default)(e)||!(0,s.default)(e).call(e,(e=>{var t,{key:a,value:r}=e.value||{};return!((0,l.default)(t=this.needKeys).call(t,a)>=0)&&(!a||null==r)})))),(0,h.default)(this,"checkCustomTrait",(e=>!!(0,v.default)(e)||!(0,s.default)(e).call(e,(e=>{var{value:t}=e||{};if(!t)return!0;return!/^CUSTOM_[A-Z0-9_]{1,248}$/.test(t)})))),(0,h.default)(this,"getDefaultPropValues",(e=>{var t,a=[];return(0,u.default)(t=this.needKeys).call(t,(t=>{var r=(0,s.default)(e).call(e,(e=>e.value.key===t)),i=r?r.value.value:"";a.push({index:a.length,value:{key:t,value:i}})})),(0,u.default)(e).call(e,(e=>{var t,{key:r}=e.value;(0,l.default)(t=this.needKeys).call(t,r)<0&&a.push(e)})),a})),(0,h.default)(this,"getDefaultStandardTrait",(e=>{var t=[...e];return(0,d.default)(t).call(t),(0,c.default)(t).call(t,(e=>M(e)))})),(0,h.default)(this,"getDefaultCustomTrait",(e=>{var t,a=[...e];return(0,d.default)(a).call(a),(0,f.default)(t=(0,c.default)(a).call(a,(e=>!M(e)))).call(t,((e,t)=>({index:t,value:e})))})),(0,h.default)(this,"hasPropValues",(e=>(0,p.default)(e).call(e,(e=>{var t;return(0,l.default)(t=this.needKeys).call(t,e.value.key)&&e.value.value}))))}init(){this.getTraits()}getTraits(){var e=this;return(0,m.default)((function*(){yield S.default.getTraits(),e.updateDefaultValue()}))()}get traits(){var e,{traits:t=[]}=S.default;return(0,f.default)(e=(0,c.default)(t).call(t,(e=>M(e)))).call(e,(e=>({value:e,label:e})))}get drivers(){return[{value:"ipmi",label:"IPMI"}]}get needKeys(){return["cpus","memory_mb","local_gb","cpu_arch"]}get defaultValue(){var{extra:{driver:e="ipmi",name:t,properties:a=[],extra:r=[],traits:i=[],resource_class:n}={}}=this.props;return{name:t||void 0,driver:e,properties:this.getDefaultPropValues(a),extra:r,resource_class:n,standard_trait:this.getDefaultStandardTrait(i),custom_trait:this.getDefaultCustomTrait(i)}}get formItems(){return[{name:"name",label:t("Node Name"),type:"input-name"},{name:"driver",label:t("Node Driver"),type:"select",options:this.drivers,required:!0},{name:"properties",label:t("Properties"),type:"add-select",itemComponent:_.default,addText:t("Add Property"),minCount:this.needKeys.length,readonlyKeys:this.needKeys,tips:t('If you do not fill in parameters such as cpus, memory_mb, local_gb, cpu_arch, etc., you can automatically inject the configuration and Mac address of the physical machine by performing the "Auto Inspect" operation.'),validator:(e,a)=>this.checkKeyValues(a)?o.default.resolve():o.default.reject(t("Please enter complete key value!"))},{name:"extra",label:t("Extra Infos"),type:"add-select",itemComponent:_.default,addText:t("Add Extra Info"),validator:(e,a)=>this.checkKeyValues(a)?o.default.resolve():o.default.reject(t("Please enter complete key value!"))},{name:"standard_trait",label:t("Standard Trait"),type:"select",mode:"multiple",options:this.traits,extra:t("The trait of the scheduled node needs to correspond to the trait of the flavor used by the ironic instance; by injecting the necessary traits into the ironic instance, the computing service will only schedule the instance to the bare metal node with all the necessary traits (for example, the ironic instance which use the flavor that has HW_CPU_X86_VMX as a necessary trait, can be scheduled to the node which has the trait of HW_CPU_X86_VMX).")},{name:"custom_trait",label:t("Custom Trait"),type:"add-select",isInput:!0,extra:g.default.createElement("div",null,g.default.createElement("p",null,t("1. The name of the trait should start with CUSTOM_, can only contain uppercase letters A ~ Z, numbers 0 ~ 9 or underscores, and the length should not exceed 255 characters (for example: CUSTOM_TRAIT1).")),g.default.createElement("p",null,t("2. The trait of the scheduled node needs to correspond to the trait of the flavor used by the ironic instance; by injecting the necessary traits into the ironic instance, the computing service will only schedule the instance to the bare metal node with all the necessary traits (for example, the ironic instance which use the flavor that has CUSTOM_TRAIT1 as a necessary trait, can be scheduled to the node which has the trait of CUSTOM_TRAIT1)."))),validator:(e,a)=>this.checkCustomTrait(a)?o.default.resolve():o.default.reject(t("Please enter right format custom trait!"))},{name:"resource_class",label:t("Resource Class"),type:"input",extra:t("The resource class of the scheduled node needs to correspond to the resource class name of the flavor used by the ironic instance (for example, the resource class name of the scheduling node is baremetal.with-GPU, and the custom resource class name of the flavor is CUSTOM_BAREMETAL_WITH_GPU=1).")}]}}a.NodeInfo=I;var x=(0,y.inject)("rootStore")((0,y.observer)(I));a.default=x},3683:function(e,a,r){"use strict";var i=r(19),n=r(21);i(a,"__esModule",{value:!0}),a.default=a.Edit=void 0;var l=n(r(65)),o=n(r(36)),s=r(406),u=n(r(1406));class d extends u.default{get listUrl(){return this.getRoutePath("baremetalNode")}get name(){return t("Edit Bare Metal Node")}static allowed(){return l.default.resolve(!0)}}a.Edit=d,(0,o.default)(d,"id","edit-node"),(0,o.default)(d,"title",t("Edit Bare Metal Node")),(0,o.default)(d,"buttonText",t("Edit")),(0,o.default)(d,"path",(e=>"/compute/baremetal-node-admin/edit/".concat(e.uuid))),(0,o.default)(d,"policy","baremetal:node:update");var c=(0,s.inject)("rootStore")((0,s.observer)(d));a.default=c},3684:function(e,a,r){"use strict";var i=r(19),n=r(21);i(a,"__esModule",{value:!0}),a.default=void 0;var l=n(r(36)),o=n(r(0)),s=r(1193),u=n(r(1225));class d extends s.ConfirmAction{constructor(){super(...arguments),(0,l.default)(this,"policy","baremetal:node:set_provision_state"),(0,l.default)(this,"getItemId",(e=>e.uuid)),(0,l.default)(this,"allowedCheckFunc",(e=>"manageable"===e.provision_state&&"ipmi"!==e.driver)),(0,l.default)(this,"confirmContext",(e=>{var a=this.getName(e);return o.default.createElement("div",null,this.unescape(t("Are you sure to {action} (instance: {name})?",{action:this.actionNameDisplay||this.title,name:a})),o.default.createElement("ul",null,o.default.createElement("li",null,t("This service will automatically query the configuration (CPU, memory, etc.) and mac address of the physical machine, and the ironic-inspector service will automatically register this information in the node information.")),o.default.createElement("li",null,t("The entire inspection process takes 5 to 10 minutes, so you need to be patient. After the registration is completed, the node configuration status will return to the manageable status."))))})),(0,l.default)(this,"onSubmit",(()=>{var{uuid:e}=this.item;return u.default.changeProvision(e,{target:"inspect"})}))}get id(){return"Inspect"}get title(){return t("Auto Inspect")}get actionName(){return t("Auto Inspect")}}a.default=d},3685:function(e,a,r){"use strict";var i=r(19),n=r(21);i(a,"__esModule",{value:!0}),a.default=a.Detail=void 0;var l=r(406),o=r(1225),s=n(r(1200)),u=r(1281),d=n(r(3686)),c=n(r(3687)),f=n(r(3691)),p=n(r(1558));class m extends s.default{get name(){return t("bare metal node")}get policy(){return"baremetal:node:get"}get listUrl(){return this.getRoutePath("baremetalNode")}get actionConfigs(){return p.default}get detailInfos(){return[{title:t("Node Name"),dataIndex:"name"},{title:t("Ironic Instance Name"),dataIndex:"instance_info.display_name"},{title:t("Power State"),dataIndex:"power_state",valueMap:u.powerState},{title:t("Provision State"),dataIndex:"provision_state",valueMap:u.provisioningState},{title:t("Maintained"),dataIndex:"maintenance",valueRender:"yesNo",tip:(e,t)=>t.maintenance_reason},{title:t("Number of Ports"),dataIndex:"portsNew",render:e=>e&&e.length||"-"},{title:t("Driver"),dataIndex:"driver"},{title:t("Created At"),dataIndex:"created_at",valueRender:"toLocalTime"}]}get tabs(){return[{title:t("Base Info"),key:"base",component:d.default},{title:t("Ports"),key:"ports",component:c.default},{title:t("Port Groups"),key:"portGroups",component:f.default}]}init(){this.store=new o.IronicStore}}a.Detail=m;var h=(0,l.inject)("rootStore")((0,l.observer)(m));a.default=h},3686:function(e,a,r){"use strict";var i=r(33),n=r(44),l=r(32),o=r(25),s=r(27),u=r(45),d=r(46),c=r(19),f=r(21);c(a,"__esModule",{value:!0}),a.default=a.BaseDetail=void 0;var p=f(r(36)),m=f(r(57)),h=f(r(33)),v=f(r(0)),g=r(406),y=f(r(1202)),b=f(r(1451));function _(e,t){var a=i(e);if(n){var r=n(e);t&&(r=l(r).call(r,(function(t){return o(e,t).enumerable}))),a.push.apply(a,r)}return a}class S extends y.default{get leftCards(){return[this.baseInfoCard,this.driverCard,this.bootDeviceCard,this.propertiesCard,this.traitCard,this.resourceClassCard]}get rightCards(){return[this.validateCard]}get baseInfoCard(){var e=[{label:t("Chassis ID"),dataIndex:"chassis_uuid"},{label:t("Resource Class"),dataIndex:"resource_class"},{label:t("Management"),dataIndex:"maintenance",valueRender:"yesNo"},{label:t("Management Reason"),dataIndex:"maintenance_reason"}];return{title:t("Base Info"),options:e}}get driverCard(){var e,{driver_info:a={}}=this.detailData||{},r=(0,m.default)(e=(0,h.default)(a)).call(e,(e=>({label:e,dataIndex:e,render:()=>a[e]})));return{title:t("Driver Info"),options:r}}get bootDeviceCard(){var e=[{label:t("Boot Device"),dataIndex:"bootDevice.boot_device"},{label:t("Persistent"),dataIndex:"bootDevice.persistent",valueRender:"yesNo"}];return{title:t("Boot Device"),options:e}}get propertiesCard(){var e,{properties:a={}}=this.detailData||{},r=(0,m.default)(e=(0,h.default)(a)).call(e,(e=>({label:e,dataIndex:e,render:()=>a[e]})));return{title:t("Properties"),options:r}}get traitCard(){var e=[{label:t("Traits"),dataIndex:"traits",render:e=>e?(0,m.default)(e).call(e,(e=>v.default.createElement("div",null,e))):"-"}];return{title:t("Traits"),options:e}}get resourceClassCard(){var e=[{label:t("Resource Class"),dataIndex:"resource_class"}];return{title:t("Resource Class"),options:e}}get validateCard(){var e,{validate:a={}}=this.detailData||{},r=(0,m.default)(e=(0,h.default)(a)).call(e,(e=>function(e){for(var t=1;t<arguments.length;t++){var a,r=null!=arguments[t]?arguments[t]:{};if(t%2)s(a=_(Object(r),!0)).call(a,(function(t){(0,p.default)(e,t,r[t])}));else if(u)d(e,u(r));else{var i;s(i=_(Object(r))).call(i,(function(t){c(e,t,o(r,t))}))}}return e}({value:this.detailData["".concat(e,"_interface")],name:e},a[e]))),i=[{title:t("Name"),dataIndex:"name"},{title:t("Valid"),dataIndex:"result",valueRender:"yesNo"},{title:t("Current Interface"),dataIndex:"value"},{title:t("Reason"),dataIndex:"reason",width:300}],n=[{label:"",content:v.default.createElement(b.default,{columns:i,data:r})}];return{title:t("Interface Info"),labelCol:0,options:n}}}a.BaseDetail=S;var M=(0,g.inject)("rootStore")((0,g.observer)(S));a.default=M},3687:function(e,a,r){"use strict";var i=r(19),n=r(21);i(a,"__esModule",{value:!0}),a.default=a.BareMetalNodePort=void 0;var l=n(r(62)),o=n(r(36)),s=r(406),u=n(r(1194)),d=r(1342),c=n(r(3688));class f extends u.default{constructor(){super(...arguments),(0,o.default)(this,"getColumns",(()=>[{title:t("ID"),dataIndex:"uuid"},{title:t("Mac Address"),dataIndex:"address"},{title:t("PXE Enabled"),dataIndex:"pxe_enabled",valueRender:"yesNo"},{title:t("Port Group"),dataIndex:"portgroup_uuid"},{title:t("Created At"),dataIndex:"created_at",isHideable:!0,valueRender:"sinceTime"}])),(0,o.default)(this,"updateFetchParams",(e=>{var{all_projects:t}=e;return(0,l.default)(e,["all_projects"])}))}init(){this.store=new d.IronicPortStore}get policy(){return"baremetal:port:get"}get name(){return t("ports")}get rowKey(){return"uuid"}get actionConfigs(){return c.default}get searchFilters(){return[]}}a.BareMetalNodePort=f;var p=(0,s.inject)("rootStore")((0,s.observer)(f));a.default=p},3688:function(e,t,a){"use strict";var r=a(19),i=a(21);r(t,"__esModule",{value:!0}),t.default=void 0;var n=i(a(1559)),l=i(a(3689)),o={rowActions:{firstAction:i(a(3690)).default,moreActions:[{action:l.default}]},batchActions:[l.default],primaryActions:[n.default]};t.default=o},3689:function(e,a,r){"use strict";var i=r(19),n=r(21);i(a,"__esModule",{value:!0}),a.default=void 0;var l=n(r(36)),o=r(1193),s=n(r(1342));class u extends o.ConfirmAction{constructor(){super(...arguments),(0,l.default)(this,"policy","baremetal:port:delete"),(0,l.default)(this,"getItemId",(e=>e.uuid)),(0,l.default)(this,"allowedCheckFunc",(()=>!0)),(0,l.default)(this,"onSubmit",(e=>{var{uuid:t}=e;return s.default.delete({id:t})}))}get id(){return"delete"}get title(){return t("Delete Port")}get name(){return t("Delete Port")}get isDanger(){return!0}get buttonText(){return t("Delete")}get actionName(){return t("Delete Port")}}a.default=u},3690:function(e,a,r){"use strict";var i=r(19),n=r(21);i(a,"__esModule",{value:!0}),a.default=a.Edit=void 0;var l=n(r(27)),o=n(r(33)),s=n(r(102)),u=n(r(90)),d=n(r(65)),c=n(r(57)),f=n(r(62)),p=n(r(36)),m=n(r(111)),h=n(r(202)),v=n(r(559)),g=n(r(199)),y=r(406),b=n(r(1342)),_=r(1282),S=r(1193),M=r(334),I=n(r(1214)),x=r(556),A=r(161),w=r(1281);class N extends S.ModalAction{constructor(){super(...arguments),(0,p.default)(this,"updateItemValueToArray",((e,t)=>{var a,r=e[t]||{},i=[];(0,l.default)(a=(0,o.default)(r)).call(a,((e,t)=>{i.push({index:t,value:{key:e,value:r[e]}})})),e[t]=i})),(0,p.default)(this,"checkKeyValues",(e=>!!(0,g.default)(e)||!(0,s.default)(e).call(e,(e=>{var{key:t,value:a}=e.value||{};return!t||null==a})))),(0,p.default)(this,"getKeyPath",(e=>{var t="local_link_connection.";return 0===(0,u.default)(e).call(e,t)?"/local_link_connection/".concat(e.substring(t.length)):"/".concat(e)})),(0,p.default)(this,"onSubmit",(e=>{var t,a=[],r=[],i=[],n=(0,A.updateObjToAddSelectArray)(this.item.extra),{extra:s,node:u}=e,c=(0,f.default)(e,["extra","node"]);(0,l.default)(t=(0,o.default)(c)).call(t,(t=>{var i={value:e[t],path:this.getKeyPath(t)};if(!(0,v.default)(this.item,t)&&e[t])i.op="add",a.push(i);else{var n=(0,m.default)(this.item,t);(0,h.default)(n,e[t])||(i.op="replace",r.push(i))}}));var{adds:p,replaces:g,dels:y}=(0,w.getDifFromAddSelectValue)(s,n,"extra");a.push(...p),r.push(...g),i.push(...y);var _=[...a,...r,...i];return 0===_.length?d.default.resolve():b.default.edit({id:this.item.uuid},_)}))}init(){this.groupStore=new _.IronicPortGroupStore,this.getPortGroups()}get name(){return t("Edit Port")}get instanceName(){return this.item.uuid}getPortGroups(){var{uuid:e}=this.containerProps.detail||{};this.groupStore.fetchList({id:e})}get defaultValue(){var{name:e,uuid:t}=this.containerProps.detail||{},{port_id:a,switch_id:r,switch_info:i}=this.item.local_link_connection||{},{pxe_enabled:n,address:l,portgroup_uuid:o,extra:s={},physical_network:u}=this.item;return{node:e||t,address:l,pxe_enabled:n,portgroup_uuid:o,physical_network:u,"local_link_connection.port_id":a,"local_link_connection.switch_id":r,"local_link_connection.switch_info":i,extra:(0,A.updateObjToAddSelectArray)(s)}}get portGroups(){var e;return(0,c.default)(e=this.groupStore.list.data||[]).call(e,(e=>({value:e.uuid,label:e.name||e.uuid})))}get formItems(){return[{name:"node",label:t("Node"),type:"label",iconType:"host"},{name:"address",label:t("MAC Address"),required:!0,type:"input",validator:x.macAddressValidate},{name:"pxe_enabled",label:t("PXE Enabled"),type:"radio",options:M.yesNoOptions},{name:"portgroup_uuid",label:t("Port Group"),type:"select",options:this.portGroups},{label:t("Local Link Connection"),type:"title"},{name:"local_link_connection.port_id",label:t("Port ID"),type:"input",tip:t("Identifier of the physical port on the switch to which nodes port is connected to")},{name:"local_link_connection.switch_id",label:t("Switch ID"),type:"input",tip:t("Only a MAC address or an OpenFlow based datapath_id of the switch are accepted in this field")},{name:"local_link_connection.switch_info",label:t("Switch Info"),type:"input",tip:t("an optional string field to be used to store any vendor-specific information")},{name:"physical_network",label:t("Physical Network"),type:"input",tip:t("The name of the physical network to which a port is connected")},{name:"extra",label:t("Extra Infos"),type:"add-select",itemComponent:I.default,addText:t("Add Extra Info"),validator:(e,a)=>this.checkKeyValues(a)?d.default.resolve():d.default.reject(t("Please enter complete key value!"))}]}}a.Edit=N,(0,p.default)(N,"id","EditPort"),(0,p.default)(N,"title",t("Edit Port")),(0,p.default)(N,"buttonText",t("Edit")),(0,p.default)(N,"policy","baremetal:port:update"),(0,p.default)(N,"allowed",(()=>d.default.resolve(!0)));var C=(0,y.inject)("rootStore")((0,y.observer)(N));a.default=C},3691:function(e,a,r){"use strict";var i=r(19),n=r(21);i(a,"__esModule",{value:!0}),a.default=a.BareMetalNodePortGroup=void 0;var l=n(r(62)),o=n(r(36)),s=r(406),u=n(r(1194)),d=r(1282),c=n(r(3692));class f extends u.default{constructor(){super(...arguments),(0,o.default)(this,"getColumns",(()=>[{title:t("ID"),dataIndex:"uuid"},{title:t("Name"),dataIndex:"name"},{title:t("Mac Address"),dataIndex:"address"},{title:t("Stand Alone Ports Supported"),dataIndex:"standalone_ports_supported",valueRender:"yesNo"},{title:t("Created At"),dataIndex:"created_at",isHideable:!0,valueRender:"sinceTime"}])),(0,o.default)(this,"updateFetchParams",(e=>{var{all_projects:t}=e;return(0,l.default)(e,["all_projects"])}))}init(){this.store=new d.IronicPortGroupStore}get policy(){return"baremetal:portgroup:get"}get name(){return t("port groups")}get rowKey(){return"uuid"}get actionConfigs(){return c.default}get searchFilters(){return[]}}a.BareMetalNodePortGroup=f;var p=(0,s.inject)("rootStore")((0,s.observer)(f));a.default=p},3692:function(e,t,a){"use strict";var r=a(19),i=a(21);r(t,"__esModule",{value:!0}),t.default=void 0;var n=i(a(1560)),l=i(a(3693)),o={rowActions:{firstAction:i(a(3694)).default,moreActions:[{action:l.default}]},batchActions:[l.default],primaryActions:[n.default]};t.default=o},3693:function(e,a,r){"use strict";var i=r(19),n=r(21);i(a,"__esModule",{value:!0}),a.default=void 0;var l=n(r(36)),o=r(1193),s=n(r(1282));class u extends o.ConfirmAction{constructor(){super(...arguments),(0,l.default)(this,"policy","baremetal:portgroup:delete"),(0,l.default)(this,"getItemId",(e=>e.uuid)),(0,l.default)(this,"allowedCheckFunc",(()=>!0)),(0,l.default)(this,"onSubmit",(e=>{var{uuid:t}=e;return s.default.delete({id:t})}))}get id(){return"delete"}get title(){return t("Delete Port Group")}get name(){return t("Delete Port Group")}get isDanger(){return!0}get buttonText(){return t("Delete")}get actionName(){return t("Delete Port Group")}}a.default=u},3694:function(e,a,r){"use strict";var i=r(19),n=r(21);i(a,"__esModule",{value:!0}),a.default=a.Edit=void 0;var l=n(r(27)),o=n(r(33)),s=n(r(102)),u=n(r(90)),d=n(r(65)),c=n(r(62)),f=n(r(36)),p=n(r(111)),m=n(r(202)),h=n(r(559)),v=n(r(199)),g=r(406),y=n(r(1282)),b=r(1193),_=r(334),S=n(r(1214)),M=r(556),I=r(161),x=r(1281);class A extends b.ModalAction{constructor(){super(...arguments),(0,f.default)(this,"updateItemValueToArray",((e,t)=>{var a,r=e[t]||{},i=[];(0,l.default)(a=(0,o.default)(r)).call(a,((e,t)=>{i.push({index:t,value:{key:e,value:r[e]}})})),e[t]=i})),(0,f.default)(this,"checkKeyValues",(e=>!!(0,v.default)(e)||!(0,s.default)(e).call(e,(e=>{var{key:t,value:a}=e.value||{};return!t||null==a})))),(0,f.default)(this,"getKeyPath",(e=>{var t="local_link_connection.";return 0===(0,u.default)(e).call(e,t)?"/local_link_connection/".concat(e.substring(t.length)):"/".concat(e)})),(0,f.default)(this,"onSubmit",(e=>{var t,a=[],r=[],i=[],n=(0,I.updateObjToAddSelectArray)(this.item.extra),s=(0,I.updateObjToAddSelectArray)(this.item.properties),{properties:u,extra:f,node:v}=e,g=(0,c.default)(e,["properties","extra","node"]);(0,l.default)(t=(0,o.default)(g)).call(t,(t=>{var i={value:e[t],path:this.getKeyPath(t)};if(!(0,h.default)(this.item,t)&&e[t])i.op="add",a.push(i);else{var n=(0,p.default)(this.item,t);(0,m.default)(n,e[t])||(i.op="replace",r.push(i))}}));var{adds:b,replaces:_,dels:S}=(0,x.getDifFromAddSelectValue)(f,n,"extra"),{adds:M,replaces:A,dels:w}=(0,x.getDifFromAddSelectValue)(u,s,"properties");a.push(...M,...b),r.push(...A,..._),i.push(...w,...S);var N=[...a,...r,...i];return 0===N.length?d.default.resolve():y.default.edit({id:this.item.uuid},N)}))}get name(){return t("Edit Port Group")}get instanceName(){return this.item.uuid}get defaultValue(){var{name:e,uuid:t}=this.containerProps.detail||{},{name:a,standalone_ports_supported:r,address:i,extra:n={},properties:l={}}=this.item;return{node:e||t,name:a,address:i,standalone_ports_supported:r,extra:(0,I.updateObjToAddSelectArray)(n),properties:(0,I.updateObjToAddSelectArray)(l)}}get formItems(){return[{name:"node",label:t("Node"),type:"label",iconType:"host"},{name:"name",label:t("Name"),type:"input"},{name:"address",label:t("MAC Address"),type:"input",required:!0,validator:M.macAddressValidate},{name:"standalone_ports_supported",label:t("Stand Alone Ports Supported"),type:"radio",options:_.yesNoOptions},{name:"properties",label:t("Properties"),type:"add-select",itemComponent:S.default,addText:t("Add Property"),validator:(e,a)=>this.checkKeyValues(a)?d.default.resolve():d.default.reject(t("Please enter complete key value!"))},{name:"extra",label:t("Extra Infos"),type:"add-select",itemComponent:S.default,addText:t("Add Extra Info"),validator:(e,a)=>this.checkKeyValues(a)?d.default.resolve():d.default.reject(t("Please enter complete key value!"))}]}}a.Edit=A,(0,f.default)(A,"id","EditPortGroup"),(0,f.default)(A,"title",t("Edit Port Group")),(0,f.default)(A,"buttonText",t("Edit")),(0,f.default)(A,"policy","baremetal:portgroup:update"),(0,f.default)(A,"allowed",(()=>d.default.resolve(!0)));var w=(0,g.inject)("rootStore")((0,g.observer)(A));a.default=w}}]);