skyline-console/skyline_console/static/Container.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
52 KiB
JavaScript

(window.webpackJsonp=window.webpackJsonp||[]).push([[2],{1211:function(e,t,a){"use strict";var n=a(33),r=a(44),l=a(32),i=a(25),o=a(27),u=a(45),s=a(46),d=a(19),c=a(21);d(t,"__esModule",{value:!0}),t.default=t.ContainersStore=void 0;var f,p=c(a(33)),m=c(a(57)),v=c(a(174)),g=c(a(1299)),h=c(a(81)),b=c(a(25)),y=c(a(36)),C=c(a(51)),_=c(a(54)),x=c(a(199)),S=c(a(53)),I=c(a(48)),k=a(34);function M(e,t){var a=n(e);if(r){var o=r(e);t&&(o=l(o).call(o,(function(t){return i(e,t).enumerable}))),a.push.apply(a,o)}return a}function w(e){for(var t=1;t<arguments.length;t++){var a,n=null!=arguments[t]?arguments[t]:{};if(t%2)o(a=M(Object(n),!0)).call(a,(function(t){(0,y.default)(e,t,n[t])}));else if(u)s(e,u(n));else{var r;o(r=M(Object(n))).call(r,(function(t){d(e,t,i(n,t))}))}}return e}var D=(f=class extends S.default{get client(){return I.default.zun.containers}create(e){var t=this;return(0,C.default)((function*(){return t.submitting(t.client.create(e))}))()}delete(e){var t=this;return(0,C.default)((function*(){var{id:a}=e;return t.client.delete(a)}))()}start(e){var t=this;return(0,C.default)((function*(){var{id:a}=e;return t.client.start(a)}))()}stop(e){var t=this;return(0,C.default)((function*(){var{id:a}=e;return t.client.stop(a)}))()}pause(e){var t=this;return(0,C.default)((function*(){var{id:a}=e;return t.client.pause(a)}))()}reboot(e){var t=this;return(0,C.default)((function*(){var{id:a}=e;return t.client.reboot(a)}))()}unpause(e){var t=this;return(0,C.default)((function*(){var{id:a}=e;return t.client.unpause(a)}))()}rebuild(e,t){var a=this;return(0,C.default)((function*(){return a.client.rebuild(e,t)}))()}kill(e,t){var a=this;return(0,C.default)((function*(){return a.client.kill(e,t)}))()}forceDelete(e){var t=this;return(0,C.default)((function*(){var{id:a}=e;return t.client.delete(a,null,{force:!0})}))()}execute(e,t){var a=this;return(0,C.default)((function*(){return a.client.execute(e,t)}))()}detailDidFetch(e){var t=this;return(0,C.default)((function*(){var{uuid:a,status:n,addresses:r={}}=e,l={};"Running"===n&&(l=(yield t.client.stats.list(a))||{});var i,o,u=(0,p.default)(r),{ports:s=[]}=e;(0,x.default)(s)&&(s=(0,m.default)(i=(0,v.default)(o=(0,g.default)(r)).call(o,((e,t)=>e=(0,h.default)(e).call(e,t)),[])).call(i,(e=>e.port)));return w(w({},e),{},{stats:l,networks:u,ports:s})}))()}fetchLogs(e){var t=this;return(0,C.default)((function*(){return yield t.client.logs.list(e)}))()}},(0,_.default)(f.prototype,"create",[k.action],(0,b.default)(f.prototype,"create"),f.prototype),(0,_.default)(f.prototype,"delete",[k.action],(0,b.default)(f.prototype,"delete"),f.prototype),(0,_.default)(f.prototype,"start",[k.action],(0,b.default)(f.prototype,"start"),f.prototype),(0,_.default)(f.prototype,"stop",[k.action],(0,b.default)(f.prototype,"stop"),f.prototype),(0,_.default)(f.prototype,"pause",[k.action],(0,b.default)(f.prototype,"pause"),f.prototype),(0,_.default)(f.prototype,"reboot",[k.action],(0,b.default)(f.prototype,"reboot"),f.prototype),(0,_.default)(f.prototype,"unpause",[k.action],(0,b.default)(f.prototype,"unpause"),f.prototype),(0,_.default)(f.prototype,"rebuild",[k.action],(0,b.default)(f.prototype,"rebuild"),f.prototype),(0,_.default)(f.prototype,"kill",[k.action],(0,b.default)(f.prototype,"kill"),f.prototype),(0,_.default)(f.prototype,"forceDelete",[k.action],(0,b.default)(f.prototype,"forceDelete"),f.prototype),(0,_.default)(f.prototype,"execute",[k.action],(0,b.default)(f.prototype,"execute"),f.prototype),f);t.ContainersStore=D;var A=new D;t.default=A},1215:function(e,a,n){"use strict";var r=n(19),l=n(21);r(a,"__esModule",{value:!0}),a.checkItemAction=a.containerTaskStatus=a.containerStatus=void 0;var i=l(n(198)),o={Creating:t("Creating"),Created:t("Created"),Running:t("Running"),Stopped:t("Stopped"),Paused:t("Paused"),Restarting:t("Restarting"),Deleting:t("Deleting"),Error:t("Error"),Unknown:t("Unknown"),Rebuilding:t("Rebuilding")};a.containerStatus=o;var u={null:t("No Task"),container_creating:t("Container Creating"),container_starting:t("Container Starting"),container_stopping:t("Container Stopping"),container_rebooting:t("Container Rebooting"),container_deleting:t("Container Deleting"),container_rebuilding:t("Container Rebuilding"),container_killing:t("Container Killing")};a.containerTaskStatus=u;var s="Error",d="Running",c="Stopped",f="Paused",p="Created",m="Deleted",v="Dead",g={update:[p,d,c,f],start:[p,c,s],stop:[d],reboot:[p,d,c,s],rebuild:[p,d,c,s],pause:[d],unpause:[f],execute:[d],kill:[d],delete:[p,s,c,m,v],delete_force:[p,"Creating",s,d,c,"Unknown",m,v,"Restarting","Rebuilding","Deleting"],delete_stop:[d,p,s,c,m,v],manage_security_groups:[p,d,c,f]};a.checkItemAction=(e,t)=>{var a;if(!e)return!1;var{status:n}=e;return(0,i.default)(a=g[t]).call(a,n)}},1365:function(e,t,a){"use strict";var n=a(19),r=a(21);n(t,"__esModule",{value:!0}),t.default=t.CapsulesStore=void 0;var l,i=r(a(25)),o=r(a(51)),u=r(a(54)),s=r(a(53)),d=r(a(48)),c=a(34),f=(l=class extends s.default{get client(){return d.default.zun.capsules}create(e){var t=this;return(0,o.default)((function*(){return t.client.create(e)}))()}delete(e){var t=this;return(0,o.default)((function*(){var{id:a}=e;return t.client.delete(a)}))()}},(0,u.default)(l.prototype,"create",[c.action],(0,i.default)(l.prototype,"create"),l.prototype),(0,u.default)(l.prototype,"delete",[c.action],(0,i.default)(l.prototype,"delete"),l.prototype),l);t.CapsulesStore=f;var p=new f;t.default=p},1626:function(e,a,n){"use strict";var r=n(19),l=n(21);r(a,"__esModule",{value:!0}),a.default=void 0;var i=l(n(1627)),o=l(n(4209)),u=l(n(4210)),s=l(n(4211)),d=l(n(4212)),c=l(n(4213)),f=l(n(4214)),p=l(n(4215)),m=l(n(4216)),v=l(n(4217)),g=l(n(4218)),h=l(n(4219)),b=[d.default,c.default,s.default,v.default,p.default],y={actionConfigs:{rowActions:{firstAction:o.default,moreActions:[{title:t("Container Status"),actions:[...b,u.default,f.default,h.default]},{action:m.default},{action:g.default}]},batchActions:[o.default],primaryActions:[i.default]},actionConfigsAdmin:{rowActions:{firstAction:o.default,moreActions:[{title:t("Container Status"),actions:b},{action:m.default},{action:g.default}]},batchActions:[o.default],primaryActions:[]}};a.default=y},1627:function(e,a,n){"use strict";var r=n(33),l=n(44),i=n(32),o=n(25),u=n(27),s=n(45),d=n(46),c=n(19),f=n(21);c(a,"__esModule",{value:!0}),a.default=a.StepCreate=void 0;var p=f(n(27)),m=f(n(427)),v=f(n(65));n(1336);var g=f(n(426)),h=f(n(51)),b=f(n(62)),y=f(n(36)),C=n(406),_=(n(173),n(1193)),x=f(n(1211)),S=f(n(407)),I=f(n(4201)),k=f(n(4202)),M=f(n(4203)),w=f(n(4207)),D=f(n(4208));function A(e,t){var a=r(e);if(l){var n=l(e);t&&(n=i(n).call(n,(function(t){return o(e,t).enumerable}))),a.push.apply(a,n)}return a}function E(e){for(var t=1;t<arguments.length;t++){var a,n=null!=arguments[t]?arguments[t]:{};if(t%2)u(a=A(Object(n),!0)).call(a,(function(t){(0,y.default)(e,t,n[t])}));else if(s)d(e,s(n));else{var r;u(r=A(Object(n))).call(r,(function(t){c(e,t,o(n,t))}))}}return e}class R extends _.StepAction{constructor(){super(...arguments),(0,y.default)(this,"onSubmit",(e=>{var t,a,n,{environmentVariables:r,labels:l,mounts:i,images:o,exitPolicy:u,maxRetry:s,networks:d,ports:c,hints:f,securityGroup:v}=e,g=(0,b.default)(e,["environmentVariables","labels","mounts","images","exitPolicy","maxRetry","networks","ports","hints","securityGroup"]),h={},y={},C=[],_={},x=[],S=[];(r&&(0,p.default)(r).call(r,(e=>{var t,a,n=(0,m.default)(t=e.value.key.toLowerCase()).call(t),r=(0,m.default)(a=e.value.value.toLowerCase()).call(a);h[n]=r})),l&&(0,p.default)(l).call(l,(e=>{var t,a,n=(0,m.default)(t=e.value.key.toLowerCase()).call(t),r=(0,m.default)(a=e.value.value.toLowerCase()).call(a);y[n]=r})),i&&(0,p.default)(i).call(i,(e=>{var{type:t,source:a,size:n,destination:r,isNewVolume:l}=e.value;l?C.push({type:t,size:n,destination:r}):C.push({type:t,source:a,destination:r})})),d)&&(0,p.default)(t=d.selectedRowKeys||[]).call(t,(e=>{x.push({network:e})}));c&&(0,p.default)(a=c.selectedRowKeys||[]).call(a,(e=>{x.push({port:e})}));v&&(0,p.default)(n=v.selectedRows||[]).call(n,(e=>{S.push(e.name)}));f&&(0,p.default)(f).call(f,(e=>{var t,a,n=(0,m.default)(t=e.value.key.toLowerCase()).call(t),r=(0,m.default)(a=e.value.value.toLowerCase()).call(a);_[n]=r}));var I=E({environment:h,labels:y,mounts:C,hints:_,nets:x,security_groups:S},g);return o&&(I.image=(o.selectedRows[0]||{}).name),u&&(I.restart_policy=E({Name:u},s?{MaximumRetryCount:s}:{})),this.store.create(I)}))}init(){this.store=x.default,this.projectStore=S.default,this.getQuota(),this.state.isLoading=!0,this.errorMsg=""}static allowed(){return v.default.resolve(!0)}get name(){return t("Create Container")}get listUrl(){return this.getRoutePath("zunContainers")}get hasConfirmStep(){return!1}get steps(){return[{title:t("Info"),component:I.default},{title:t("Spec"),component:k.default},{title:t("Volumes"),component:M.default},{title:t("Network Config"),component:w.default},{title:t("Miscellaneous"),component:D.default}]}get showQuota(){return!0}get quotaInfo(){if(this.state.isLoading)return[];var{containers:e={},cpu:a={},memory:n={},disk:r={}}=this.projectStore.zunQuota,{left:l=0}=e||{},{data:{cpu:i=0,memory:o=0,disk:u=0}={}}=this.state,s=E(E({},e),{},{add:l?1:0,name:"containers",title:t("Containers")}),{left:d=0}=a,{left:c=0}=n,{left:f=0}=r,p=l&&(-1===d||i<=d)&&(-1===c||o<=c)&&(-1===f||u<=f),m=E(E({},a),{},{add:p?i:0,name:"cpu",title:t("CPU"),type:"line"}),v=E(E({},n),{},{add:p?o:0,name:"memory",title:t("Memory (MiB)"),type:"line"}),g=E(E({},r),{},{add:p?u:0,name:"disk",title:t("Disk (GiB)"),type:"line"});return this.checkQuota(this.state.data,this.projectStore.zunQuota),[s,m,v,g]}getQuota(){var e=this;return(0,h.default)((function*(){yield e.projectStore.fetchProjectZunQuota(),e.setState({isLoading:!1})}))()}getQuotaMessage(e,a,n){return-1===a?"":0===a?t("Quota: Insufficient { name } quota to create resources.",{name:n}):e>a?t("Insufficient {name} quota to create resources(left { quota }, input { input }).",{name:n,quota:a,input:e}):""}checkQuota(e,a){var{containers:n={},cpu:r={},memory:l={},disk:i={}}=a||{},{cpu:o=0,memory:u=0,disk:s=0}=e||{},{left:d=0}=n,c=this.getQuotaMessage(1,d,t("Containers")),{left:f=0}=r,p=this.getQuotaMessage(o,f,t("CPU")),{left:m=0}=l,v=this.getQuotaMessage(u,m,t("Memory")),{left:h=0}=i,b=this.getQuotaMessage(s,h,t("Disk"));if(c||p||v||b){var y=c||p||v||b;this.errorMsg!==y&&g.default.error(y),this.errorMsg=y}else this.errorMsg=""}get disableNext(){return!!this.errorMsg}get disableSubmit(){return!!this.errorMsg}}a.StepCreate=R,(0,y.default)(R,"id","create-container"),(0,y.default)(R,"title",t("Create Container")),(0,y.default)(R,"path","/container/containers/create"),(0,y.default)(R,"policy","container:create"),(0,y.default)(R,"aliasPolicy","zun:container:create");var P=(0,C.inject)("rootStore")((0,C.observer)(R));a.default=P},1628:function(e,a,n){"use strict";n(19)(a,"__esModule",{value:!0}),a.capsuleStatus=void 0;var r={Creating:t("Creating"),Pending:t("Pending"),Running:t("Running"),Succeeded:t("Succeeded"),Failed:t("Failed"),Unknown:t("Unknown")};a.capsuleStatus=r},1629:function(e,t,a){"use strict";var n=a(19),r=a(21);n(t,"__esModule",{value:!0}),t.default=void 0;var l=r(a(4221)),i=r(a(4222)),o={rowActions:{firstAction:i.default},batchActions:[i.default],primaryActions:[l.default]};t.default=o},1630:function(e,t,a){"use strict";var n=a(33),r=a(44),l=a(32),i=a(25),o=a(27),u=a(45),s=a(46),d=a(19),c=a(21);d(t,"__esModule",{value:!0}),t.default=t.HostsStore=void 0;var f=c(a(36)),p=c(a(53)),m=c(a(48)),v=a(161);function g(e,t){var a=n(e);if(r){var o=r(e);t&&(o=l(o).call(o,(function(t){return i(e,t).enumerable}))),a.push.apply(a,o)}return a}function h(e){for(var t=1;t<arguments.length;t++){var a,n=null!=arguments[t]?arguments[t]:{};if(t%2)o(a=g(Object(n),!0)).call(a,(function(t){(0,f.default)(e,t,n[t])}));else if(u)s(e,u(n));else{var r;o(r=g(Object(n))).call(r,(function(t){d(e,t,i(n,t))}))}}return e}class b extends p.default{get client(){return m.default.zun.hosts}mapper(e){var{mem_total:t,mem_used:a,cpus:n,cpu_used:r,disk_total:l,disk_used:i}=e;return h(h({},e),{},{id:e.uuid,name:e.hostname,cpu_percent:n?(r/n*100).toFixed(2):0,memory_percent:t?(a/t*100).toFixed(2):0,mem_total_gb:(0,v.getGiBValue)(t),mem_used_gb:(0,v.getGiBValue)(a),disk_percent:l?(i/l*100).toFixed(2):0})}}t.HostsStore=b;var y=new b;t.default=y},1631:function(e,t,a){"use strict";var n=a(19),r=a(21);n(t,"__esModule",{value:!0}),t.stringifyContent=void 0;var l=r(a(335)),i=r(a(199)),o=r(a(0));t.stringifyContent=e=>(0,i.default)(e)?"-":o.default.createElement("div",null,o.default.createElement("pre",null,(0,l.default)(e,null,4)))},1632:function(e,t,a){"use strict";var n=a(33),r=a(44),l=a(32),i=a(25),o=a(27),u=a(45),s=a(46),d=a(19),c=a(21);d(t,"__esModule",{value:!0}),t.default=t.ActionsLogStore=void 0;var f=c(a(36)),p=c(a(53)),m=c(a(48));function v(e,t){var a=n(e);if(r){var o=r(e);t&&(o=l(o).call(o,(function(t){return i(e,t).enumerable}))),a.push.apply(a,o)}return a}function g(e){for(var t=1;t<arguments.length;t++){var a,n=null!=arguments[t]?arguments[t]:{};if(t%2)o(a=v(Object(n),!0)).call(a,(function(t){(0,f.default)(e,t,n[t])}));else if(u)s(e,u(n));else{var r;o(r=v(Object(n))).call(r,(function(t){d(e,t,i(n,t))}))}}return e}class h extends p.default{get client(){return m.default.zun.containers.actions}get isSubResource(){return!0}get paramsFunc(){return()=>{}}get mapper(){return e=>g(g({},e),{},{id:e.request_id})}detailFetchByClient(e){var{id:t,requestId:a}=e;return this.client.show(t,a)}}t.ActionsLogStore=h;var b=new h;t.default=b},4198:function(e,t,a){"use strict";var n=a(19),r=a(21);n(t,"__esModule",{value:!0}),t.default=void 0;var l=r(a(413)),i=r(a(4199)),o=e=>(0,l.default)(i.default,e);t.default=o},4199:function(e,t,a){"use strict";var n=a(19),r=a(21);n(t,"__esModule",{value:!0}),t.default=void 0;var l=r(a(1212)),i=r(a(567)),o=r(a(4200)),u=r(a(4220)),s=r(a(4223)),d=r(a(4224)),c=r(a(4229)),f=r(a(4231)),p=r(a(1627)),m=r(a(4233)),v="/container",g=[{path:v,component:l.default,routes:[{path:"".concat(v,"/containers"),component:o.default,exact:!0},{path:"".concat(v,"/containers/create"),component:p.default,exact:!0},{path:"".concat(v,"/containers/detail/:id"),component:d.default,exact:!0},{path:"".concat(v,"/containers-admin"),component:o.default,exact:!0},{path:"".concat(v,"/containers-admin/detail/:id"),component:d.default,exact:!0},{path:"".concat(v,"/capsules"),component:u.default,exact:!0},{path:"".concat(v,"/capsules/detail/:id"),component:c.default,exact:!0},{path:"".concat(v,"/hosts-admin"),component:s.default,exact:!0},{path:"".concat(v,"/hosts-admin/detail/:id"),component:f.default,exact:!0},{path:"".concat(v,"/services-admin"),component:m.default,exact:!0},{path:"*",component:i.default}]}];t.default=g},4200:function(e,a,n){"use strict";var r=n(19),l=n(21);r(a,"__esModule",{value:!0}),a.default=a.Containers=void 0;var i=l(n(36)),o=l(n(1194)),u=n(406),s=l(n(1211)),d=n(1215),c=l(n(1626));class f extends o.default{constructor(){super(...arguments),(0,i.default)(this,"getColumns",(()=>[{title:t("ID/Name"),dataIndex:"name",isLink:!0,routeName:this.getRouteName("zunContainerDetail"),idKey:"uuid"},{title:t("Status"),isHideable:!0,dataIndex:"status",valueMap:d.containerStatus},{title:t("Image"),isHideable:!0,dataIndex:"image"},{title:t("Task State"),isHideable:!0,dataIndex:"task_state",valueMap:d.containerTaskStatus}]))}init(){this.store=s.default,this.downloadStore=s.default}get name(){return t("containers")}get policy(){return"container:get_all"}get actionConfigs(){return this.isAdminPage?c.default.actionConfigsAdmin:c.default.actionConfigs}get rowKey(){return"uuid"}}a.Containers=f;var p=(0,u.inject)("rootStore")((0,u.observer)(f));a.default=p},4201:function(e,a,n){"use strict";var r=n(19),l=n(21);r(a,"__esModule",{value:!0}),a.default=a.StepInfo=void 0;var i=l(n(32)),o=l(n(51)),u=l(n(36)),s=l(n(1201)),d=n(406),c=l(n(565)),f=n(563);class p extends s.default{constructor(){super(...arguments),(0,u.default)(this,"onImageTabChange",(e=>{this.setState({imageTab:e})}))}init(){this.getImageList()}get title(){return t("Info")}get name(){return t("Info")}getImageList(){var e=this;return(0,o.default)((function*(){yield c.default.fetchList(),e.updateDefaultValue()}))()}get imageList(){var e,t,{imageTab:a}=this.state;return(0,i.default)(e=(0,i.default)(t=c.default.list.data||[]).call(t,(e=>e.owner===this.currentProjectId))).call(e,(e=>(0,f.getImageOS)(e)===a))}get imageColumns(){return(0,f.getImageColumns)(this)}get systemTabs(){return(0,f.getImageSystemTabs)()}get formItems(){return[{name:"name",label:t("Container Name"),type:"input",placeholder:t("Container Name")},{name:"images",label:t("Image"),type:"select-table",data:this.imageList,required:!0,isLoading:c.default.list.isLoading,filterParams:[{label:t("Name"),name:"name"}],columns:this.imageColumns,tabs:this.systemTabs,defaultTabValue:this.systemTabs[0].value,onTabChange:this.onImageTabChange},{name:"image_driver",label:t("Image Driver"),placeholder:t("Image Driver"),type:"select",options:[{label:t("Docker"),value:"docker"},{label:t("Glance"),value:"glance"}],allowClear:!0},{name:"command",label:t("Command"),type:"input",placeholder:t("A command that will be sent to the container")}]}}a.StepInfo=p;var m=(0,d.inject)("rootStore")((0,d.observer)(p));a.default=m},4202:function(e,a,n){"use strict";var r=n(19),l=n(21);r(a,"__esModule",{value:!0}),a.default=a.StepSpec=void 0;var i=l(n(57)),o=l(n(32)),u=l(n(51)),s=l(n(1201)),d=n(406),c=l(n(1262));class f extends s.default{init(){this.getAvailabilityZones(),this.state.disableRetry=!0}get title(){return t("Spec")}get name(){return t("Spec")}getAvailabilityZones(){return(0,u.default)((function*(){yield c.default.fetchListWithoutDetail()}))()}get availabilityZoneList(){var e,t;return(0,i.default)(e=(0,o.default)(t=c.default.list.data||[]).call(t,(e=>e.zoneState.available))).call(e,(e=>({value:e.zoneName,label:e.zoneName})))}get formItems(){var{disableRetry:e}=this.state;return[{name:"hostname",label:t("Hostname"),type:"input",placeholder:t("The host name of this container")},{name:"runtime",label:t("Runtime"),type:"input",placeholder:t("The container runtime tool to create container with")},{name:"cpu",label:t("CPU (Core)"),type:"input-int",tip:t("The number of virtual cpu for this container"),min:1,onChange:e=>this.updateContext({cpu:e})},{name:"memory",label:t("Memory (MiB)"),type:"input-int",tip:t("The container memory size in MiB"),min:4,onChange:e=>this.updateContext({memory:e})},{name:"disk",label:t("Disk (GiB)"),type:"input-int",tip:t("The disk size in GiB for per container"),min:1,onChange:e=>this.updateContext({disk:e})},{name:"availability_zone",label:t("Availability Zone"),type:"select",options:this.availabilityZoneList},{name:"exitPolicy",label:t("Exit Policy"),type:"select",options:[{label:t("No"),value:"no"},{label:t("On failure"),value:"on-failure"},{label:t("Always"),value:"always"},{label:t("Unless Stopped"),value:"unless-stopped"}],onChange:e=>this.setState({disableRetry:"on-failure"!==e})},{name:"maxRetry",label:t("Max Retry"),type:"input-number",tip:t("Retry times for restart on failure policy"),min:1,disabled:e},{name:"auto_heal",label:t("Enable auto heal"),type:"check"}]}}a.StepSpec=f;var p=(0,d.inject)("rootStore")((0,d.observer)(f));a.default=p},4203:function(e,a,n){"use strict";var r=n(19),l=n(21);r(a,"__esModule",{value:!0}),a.default=a.StepVolumes=void 0;var i=l(n(51)),o=l(n(57)),u=l(n(32)),s=l(n(81)),d=l(n(1201)),c=n(406),f=l(n(4204)),p=n(410);class m extends d.default{init(){this.volumeStore=new p.VolumeStore,this.getVolumes()}get volumes(){var e,t;return(0,o.default)(e=(0,u.default)(t=this.volumeStore.list.data||[]).call(t,(e=>"available"===e.status))).call(e,(e=>{var t;return{value:e.id,label:(0,s.default)(t="".concat(e.name||e.id," (")).call(t,e.id,")")}}))}getVolumes(){var e=this;return(0,i.default)((function*(){yield e.volumeStore.fetchList()}))()}get formItems(){return[{name:"mounts",label:t("Type"),type:"add-select",optionsType:[{label:t("Existing Volume"),value:"bind"},{label:t("New Volume"),value:"volume"}],optionsSource:this.volumes,itemComponent:f.default}]}}a.StepVolumes=m;var v=(0,c.inject)("rootStore")((0,c.observer)(m));a.default=v},4204:function(e,a,n){"use strict";var r=n(33),l=n(44),i=n(32),o=n(25),u=n(27),s=n(45),d=n(46),c=n(19),f=n(21);c(a,"__esModule",{value:!0}),a.default=void 0,n(1216);var p=f(n(1217));n(1198);var m=f(n(1199));n(1196);var v=f(n(1197));n(1205);var g=f(n(1206));n(560);var h=f(n(412)),b=f(n(36)),y=f(n(0)),C=(n(173),f(n(16))),_=f(n(4205)),x=f(n(1381));function S(e,t){var a=r(e);if(l){var n=l(e);t&&(n=i(n).call(n,(function(t){return o(e,t).enumerable}))),a.push.apply(a,n)}return a}function I(e){for(var t=1;t<arguments.length;t++){var a,n=null!=arguments[t]?arguments[t]:{};if(t%2)u(a=S(Object(n),!0)).call(a,(function(t){(0,b.default)(e,t,n[t])}));else if(s)d(e,s(n));else{var r;u(r=S(Object(n))).call(r,(function(t){c(e,t,o(n,t))}))}}return e}class k extends y.default.Component{constructor(e){super(e),(0,b.default)(this,"onChange",(e=>{var{onChange:t}=this.props;t&&t(e)})),(0,b.default)(this,"onTypeChange",(e=>{this.setState({isNewVolume:"volume"===e},(()=>{this.onChange(I(I({},this.state),{},{type:e}))}))})),(0,b.default)(this,"onSourceChange",(e=>{this.onChange(I(I({},this.state),{},{source:e}))})),(0,b.default)(this,"onVolumeSizeChange",(e=>{this.onChange(I(I({},this.state),{},{size:e}))})),(0,b.default)(this,"onDestinationChange",(e=>{this.onChange(I(I({},this.state),{},{destination:e.target.value}))})),this.state={type:"",source:"",destination:"",size:0,isNewVolume:!1}}static getDerivedStateFromProps(e,t){var{type:a,source:n,size:r,destination:l}=e.value||{};return a!==t.type||n!==t.source||r!==t.size||l!==t.destination?{type:a,source:n,size:r,destination:l,isNewVolume:"volume"===a}:null}render(){var{type:e,source:a,destination:n,size:r,isNewVolume:l}=this.state,i=y.default.createElement(h.default,{value:e,options:this.props.optionsType,onChange:this.onTypeChange,className:_.default.select,placeholder:t("Please select type"),required:!0}),o=y.default.createElement(h.default,{value:a,options:this.props.optionsSource,onChange:this.onSourceChange,className:_.default.select,placeholder:t("Please select source")}),u=y.default.createElement(x.default,{value:r,onChange:this.onVolumeSizeChange,style:{maxWidth:"40%"}}),s=y.default.createElement(g.default,{value:n,onChange:this.onDestinationChange,style:{maxWidth:"60%"},placeholder:t("Specify mount point."),required:!0});return y.default.createElement(p.default.Item,{className:_.default["zun-volume"]},y.default.createElement(m.default,{gutter:24},y.default.createElement(v.default,{span:8},y.default.createElement("span",{className:_.default.label},t("Type")),i),y.default.createElement(v.default,{span:8,hidden:l},y.default.createElement("span",{className:_.default.label},t("Source")),o),y.default.createElement(v.default,{span:8,hidden:!l},y.default.createElement("span",{className:_.default.label},t("Size (GiB)")),u),y.default.createElement(v.default,{span:8},y.default.createElement("span",{className:_.default.label},t("Destination")),s)))}}a.default=k,(0,b.default)(k,"propTypes",{onChange:C.default.func,value:C.default.any})},4205:function(e,t,a){var n=a(4206);"string"==typeof n&&(n=[[e.i,n,""]]);var r={hmr:!0,transform:undefined,insertInto:void 0};a(75)(n,r);n.locals&&(e.exports=n.locals)},4206:function(e,t,a){(t=e.exports=a(74)(!1)).push([e.i,".index__zun-volume--2qwhn {\n display: block;\n margin-bottom: 8px;\n}\n.index__label--1pY7p {\n margin-right: 10px;\n max-width: 20%;\n}\n.index__select--3-lS2 {\n max-width: 80%;\n}\n",""]),t.locals={"zun-volume":"index__zun-volume--2qwhn",label:"index__label--1pY7p",select:"index__select--3-lS2"}},4207:function(e,a,n){"use strict";var r=n(19),l=n(21);r(a,"__esModule",{value:!0}),a.default=a.StepNetworks=void 0;var i=l(n(0)),o=n(416),u=n(561),s=l(n(1201)),d=n(406),c=n(1210),f=n(1274),p=n(558);class m extends s.default{init(){this.portStore=new u.PortStore,this.securityGroupStore=new o.SecurityGroupStore}get title(){return t("Networks")}get name(){return t("Networks")}get nameForStateUpdate(){return["networks"]}get defaultValue(){return{networks:[]}}get formItems(){var{networks:e}=this.state;return[{name:"networks",label:t("Networks"),type:"network-select-table",isMulti:!0,onChange:e=>{var{selectedRowKeys:t=[]}=e;this.setState({networks:t})}},{name:"ports",type:"select-table",label:t("Ports"),extraParams:{project_id:this.currentProjectId,status:"DOWN"},backendPageStore:this.portStore,isMulti:!0,header:t("Ports provide extra communication channels to your instances. You can select ports instead of networks or a mix of both (The port executes its own security group rules by default)."),filterParams:c.portFilters,columns:c.portColumns},{name:"securityGroup",label:t("Security Group"),type:"select-table",backendPageStore:this.securityGroupStore,extraParams:{project_id:this.currentProjectId},isMulti:!0,hidden:!e||!e.length,header:i.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,p.getLinkRender)({key:"securityGroup",value:"".concat(t("create a new security group"),"> ")})),filterParams:f.securityGroupFilter,columns:f.securityGroupColumns}]}}a.StepNetworks=m;var v=(0,d.inject)("rootStore")((0,d.observer)(m));a.default=v},4208:function(e,a,n){"use strict";var r=n(19),l=n(21);r(a,"__esModule",{value:!0}),a.default=a.StepMiscellaneous=void 0;var i=l(n(1201)),o=n(406),u=l(n(1214));class s extends i.default{get title(){return t("Miscellaneous")}get name(){return t("Miscellaneous")}get formItems(){return[{name:"workdir",label:t("Working Directory"),type:"input",placeholder:t("The working directory for commands to run in")},{name:"environmentVariables",label:t("Environment Variables"),type:"add-select",itemComponent:u.default,addText:t("Add Environment Variable")},{name:"interactive",label:t("Enable interactive mode"),type:"check"},{type:"divider"},{name:"labels",label:t("Labels"),type:"add-select",itemComponent:u.default,addText:t("Add Label")},{type:"divider"},{name:"hints",label:t("Scheduler Hints"),type:"add-select",itemComponent:u.default,addText:t("Add scheduler hints")}]}}a.StepMiscellaneous=s;var d=(0,o.inject)("rootStore")((0,o.observer)(s));a.default=d},4209:function(e,a,n){"use strict";var r=n(19),l=n(21);r(a,"__esModule",{value:!0}),a.default=void 0;var i=l(n(36)),o=n(1193),u=l(n(1211)),s=n(1215);class d extends o.ConfirmAction{constructor(){super(...arguments),(0,i.default)(this,"policy","container:delete"),(0,i.default)(this,"aliasPolicy","zun:container:delete"),(0,i.default)(this,"allowedCheckFunc",(e=>(0,s.checkItemAction)(e,"delete"))),(0,i.default)(this,"onSubmit",(e=>u.default.delete({id:e.uuid})))}get id(){return"delete"}get title(){return t("Delete Container")}get actionName(){return t("Delete Container")}get isDanger(){return!0}get buttonText(){return t("Delete")}}a.default=d},4210:function(e,a,n){"use strict";var r=n(19),l=n(21);r(a,"__esModule",{value:!0}),a.default=void 0;var i=l(n(36)),o=n(1193),u=l(n(1211)),s=n(1215);class d extends o.ConfirmAction{constructor(){super(...arguments),(0,i.default)(this,"policy","container:pause"),(0,i.default)(this,"aliasPolicy","zun:container:pause"),(0,i.default)(this,"allowedCheckFunc",(e=>(0,s.checkItemAction)(e,"pause"))),(0,i.default)(this,"onSubmit",(e=>u.default.pause({id:e.uuid})))}get id(){return"pause"}get title(){return t("Pause Container")}get actionName(){return t("Pause Container")}get buttonText(){return t("Pause")}}a.default=d},4211:function(e,a,n){"use strict";var r=n(19),l=n(21);r(a,"__esModule",{value:!0}),a.default=void 0;var i=l(n(36)),o=n(1193),u=l(n(1211)),s=n(1215);class d extends o.ConfirmAction{constructor(){super(...arguments),(0,i.default)(this,"policy","container:reboot"),(0,i.default)(this,"aliasPolicy","zun:container:reboot"),(0,i.default)(this,"allowedCheckFunc",(e=>(0,s.checkItemAction)(e,"reboot"))),(0,i.default)(this,"onSubmit",(e=>u.default.reboot({id:e.uuid})))}get id(){return"reboot"}get title(){return t("Reboot Container")}get actionName(){return t("Reboot Container")}get buttonText(){return t("Reboot")}get isAsyncAction(){return!0}}a.default=d},4212:function(e,a,n){"use strict";var r=n(19),l=n(21);r(a,"__esModule",{value:!0}),a.default=void 0;var i=l(n(36)),o=n(1193),u=l(n(1211)),s=n(1215);class d extends o.ConfirmAction{constructor(){super(...arguments),(0,i.default)(this,"policy","container:start"),(0,i.default)(this,"aliasPolicy","zun:container:start"),(0,i.default)(this,"allowedCheckFunc",(e=>(0,s.checkItemAction)(e,"start"))),(0,i.default)(this,"onSubmit",(e=>u.default.start({id:e.uuid})))}get id(){return"start"}get title(){return t("Start Container")}get actionName(){return t("Start Container")}get buttonText(){return t("Start")}get isAsyncAction(){return!0}}a.default=d},4213:function(e,a,n){"use strict";var r=n(19),l=n(21);r(a,"__esModule",{value:!0}),a.default=void 0;var i=l(n(36)),o=n(1193),u=l(n(1211)),s=n(1215);class d extends o.ConfirmAction{constructor(){super(...arguments),(0,i.default)(this,"policy","container:stop"),(0,i.default)(this,"aliasPolicy","zun:container:stop"),(0,i.default)(this,"allowedCheckFunc",(e=>(0,s.checkItemAction)(e,"stop"))),(0,i.default)(this,"onSubmit",(e=>u.default.stop({id:e.uuid})))}get id(){return"start"}get title(){return t("Stop Container")}get actionName(){return t("Stop Container")}get buttonText(){return t("Stop")}get isAsyncAction(){return!0}}a.default=d},4214:function(e,a,n){"use strict";var r=n(19),l=n(21);r(a,"__esModule",{value:!0}),a.default=void 0;var i=l(n(36)),o=n(1193),u=l(n(1211)),s=n(1215);class d extends o.ConfirmAction{constructor(){super(...arguments),(0,i.default)(this,"policy","container:unpause"),(0,i.default)(this,"aliasPolicy","zun:container:unpause"),(0,i.default)(this,"allowedCheckFunc",(e=>(0,s.checkItemAction)(e,"unpause"))),(0,i.default)(this,"onSubmit",(e=>u.default.unpause({id:e.uuid})))}get id(){return"Unpause"}get title(){return t("Unpause Container")}get actionName(){return t("Unpause Container")}get buttonText(){return t("Unpause")}}a.default=d},4215:function(e,a,n){"use strict";var r=n(19),l=n(21);r(a,"__esModule",{value:!0}),a.default=a.RebuildContainer=void 0;var i=l(n(62)),o=l(n(36)),u=n(406),s=n(1193),d=l(n(1211)),c=n(1215);class f extends s.ModalAction{constructor(){super(...arguments),(0,o.default)(this,"aliasPolicy","zun:container:rebuild"),(0,o.default)(this,"onSubmit",(e=>{var{uuid:t}=this.item,{name:a}=e,n=(0,i.default)(e,["name"]);return d.default.rebuild(t,n)}))}get name(){return t("Rebuild Container")}get isAsyncAction(){return!0}get defaultValue(){var{name:e,image:t,image_driver:a}=this.item;return{name:e,image:t,image_driver:a}}get formItems(){return[{name:"name",label:t("Container Name"),type:"label"},{name:"image",label:t("Image"),type:"input",placeholder:t("Name or ID og the container image"),required:!0},{name:"image_driver",label:t("Image Driver"),placeholder:t("Image Driver"),type:"select",options:[{label:t("Docker"),value:"docker"},{label:t("Glance"),value:"glance"}],allowClear:!0}]}}a.RebuildContainer=f,(0,o.default)(f,"id","rebuild"),(0,o.default)(f,"title",t("Rebuild Container")),(0,o.default)(f,"buttonText",t("Rebuild")),(0,o.default)(f,"policy","container:rebuild"),(0,o.default)(f,"allowed",(e=>(0,c.checkItemAction)(e,"rebuild")));var p=(0,u.inject)("rootStore")((0,u.observer)(f));a.default=p},4216:function(e,a,n){"use strict";var r=n(19),l=n(21);r(a,"__esModule",{value:!0}),a.default=a.EditContainer=void 0;var i=l(n(36)),o=n(406),u=n(1193),s=l(n(1211)),d=n(1215);class c extends u.ModalAction{constructor(){super(...arguments),(0,i.default)(this,"onSubmit",(e=>{var{uuid:t}=this.item;return s.default.patch({id:t},e)}))}get name(){return t("Edit Container")}get defaultValue(){var{name:e,memory:t,cpu:a}=this.item;return{name:e,cpu:a,memory:t}}get formItems(){return[{name:"name",label:t("Container Name"),type:"input",placeholder:t("Container Name"),required:!0},{name:"cpu",label:t("CPU (Core)"),type:"input-int",tip:t("The number of virtual cpu for this container"),min:1},{name:"memory",label:t("Memory (MiB)"),type:"input-int",tip:t("The container memory size in MiB"),min:4}]}}a.EditContainer=c,(0,i.default)(c,"id","edit"),(0,i.default)(c,"title",t("Edit Container")),(0,i.default)(c,"buttonText",t("Edit")),(0,i.default)(c,"policy","container:update"),(0,i.default)(c,"aliasPolicy","zun:container:update"),(0,i.default)(c,"allowed",(e=>(0,d.checkItemAction)(e,"update")));var f=(0,o.inject)("rootStore")((0,o.observer)(c));a.default=f},4217:function(e,a,n){"use strict";var r=n(19),l=n(21);r(a,"__esModule",{value:!0}),a.default=a.KillContainer=void 0;var i=l(n(36)),o=n(406),u=n(1193),s=l(n(1211)),d=n(1215);class c extends u.ModalAction{constructor(){super(...arguments),(0,i.default)(this,"onSubmit",(e=>{var{uuid:t}=this.item,{signal:a}=e;return s.default.kill(t,{signal:a})}))}get name(){return t("Kill Container")}get defaultValue(){var{name:e}=this.item;return{name:e}}get formItems(){return[{name:"name",label:t("Container Name"),type:"label"},{name:"signal",label:t("Kill Signal"),type:"input",placeholder:t("The kill signal to send"),tip:t('Signal to send to the container: integer or string like SIGINT. When not set, SIGKILL is set as default value and the container will exit. The supported signals varies between platform. Besides, you can omit "SIG" prefix.')}]}}a.KillContainer=c,(0,i.default)(c,"id","kill"),(0,i.default)(c,"title",t("Kill Container")),(0,i.default)(c,"buttonText",t("Kill")),(0,i.default)(c,"policy","container:kill"),(0,i.default)(c,"aliasPolicy","zun:container:kill"),(0,i.default)(c,"allowed",(e=>(0,d.checkItemAction)(e,"kill")));var f=(0,o.inject)("rootStore")((0,o.observer)(c));a.default=f},4218:function(e,a,n){"use strict";var r=n(19),l=n(21);r(a,"__esModule",{value:!0}),a.default=void 0;var i=l(n(36)),o=n(1193),u=l(n(1211)),s=n(1215);class d extends o.ConfirmAction{constructor(){super(...arguments),(0,i.default)(this,"policy","container:delete_force"),(0,i.default)(this,"aliasPolicy","zun:container:delete_force"),(0,i.default)(this,"allowedCheckFunc",(e=>(0,s.checkItemAction)(e,"delete_force"))),(0,i.default)(this,"onSubmit",(e=>u.default.forceDelete({id:e.uuid})))}get id(){return"force-delete"}get title(){return t("Force Delete Container")}get actionName(){return t("Force Delete Container")}get buttonText(){return t("Force Delete")}get isDanger(){return!0}}a.default=d},4219:function(e,a,n){"use strict";var r=n(19),l=n(21);r(a,"__esModule",{value:!0}),a.default=a.ExecuteCommandContainer=void 0;var i=l(n(81)),o=l(n(65));n(1270);var u=l(n(1271)),s=l(n(51)),d=l(n(36)),c=l(n(0)),f=(n(173),n(406)),p=n(1193),m=l(n(1211)),v=n(1215),g=l(n(1228));class h extends p.ModalAction{constructor(){var e;super(...arguments),e=this,(0,d.default)(this,"onSubmit",function(){var a=(0,s.default)((function*(a){var{uuid:n,name:r}=e.item,{command:l}=a,{Title:s,Paragraph:d}=u.default;try{var f,p=yield m.default.execute(n,{command:l});return g.default.warn(t("Command was successfully executed at container {name}.",{name:r}),c.default.createElement(c.default.Fragment,null,c.default.createElement(s,{level:5},(0,i.default)(f="".concat(t("Command"),": ")).call(f,l)),c.default.createElement(s,{level:5},"".concat(t("Outputs"),":")),c.default.createElement(d,null,p.output?c.default.createElement("pre",null,p.output):t("No Outputs")))),o.default.resolve()}catch(e){return g.default.errorWithDetail(e),o.default.reject(e)}}));return function(e){return a.apply(this,arguments)}}())}get name(){return t("Execute Command")}get showNotice(){return!1}get defaultValue(){var{name:e}=this.item;return{name:e}}get formItems(){return[{name:"name",label:t("Container Name"),type:"label"},{name:"command",label:t("Command"),type:"input",placeholder:t("The command to execute")}]}}a.ExecuteCommandContainer=h,(0,d.default)(h,"id","execute-command"),(0,d.default)(h,"title",t("Execute Command")),(0,d.default)(h,"buttonText",t("Execute Command")),(0,d.default)(h,"policy","container:execute"),(0,d.default)(h,"aliasPolicy","zun:container:execute"),(0,d.default)(h,"allowed",(e=>(0,v.checkItemAction)(e,"execute")));var b=(0,f.inject)("rootStore")((0,f.observer)(h));a.default=b},4220:function(e,a,n){"use strict";var r=n(19),l=n(21);r(a,"__esModule",{value:!0}),a.default=a.Capsules=void 0;var i=l(n(36)),o=l(n(1194)),u=n(406),s=l(n(1365)),d=n(1628),c=l(n(1629));class f extends o.default{constructor(){super(...arguments),(0,i.default)(this,"getColumns",(()=>[{title:t("ID/Name"),dataIndex:"meta_name",isLink:!0,routeName:this.getRouteName("zunCapsuleDetail"),idKey:"uuid"},{title:t("Status"),isHideable:!0,dataIndex:"status",valueMap:d.capsuleStatus},{title:t("CPU"),isHideable:!0,dataIndex:"cpu"},{title:t("Memory"),isHideable:!0,dataIndex:"memory"}]))}init(){this.store=s.default,this.downloadStore=s.default}get name(){return t("capsules")}get policy(){return"capsule:get_all"}get actionConfigs(){return c.default}}a.Capsules=f;var p=(0,u.inject)("rootStore")((0,u.observer)(f));a.default=p},4221:function(e,a,n){"use strict";var r=n(19),l=n(21);r(a,"__esModule",{value:!0}),a.default=a.Create=void 0;var i=l(n(65)),o=l(n(36)),u=n(406),s=n(1193),d=n(1245),c=l(n(1365));class f extends s.ModalAction{constructor(){super(...arguments),(0,o.default)(this,"onSubmit",(e=>{var t=(0,d.getYaml)(e.template_file);return this.store.create({template:t})}))}init(){this.store=c.default}static get modalSize(){return"middle"}get name(){return t("Create Capsule")}get formItems(){return[{name:"template_file",label:t("Load Template from a file"),type:"textarea-from-file",rows:6,required:!0,accept:".yaml",validator:(e,a)=>a?i.default.resolve():i.default.reject(t("Please input or load Template from a file"))}]}}a.Create=f,(0,o.default)(f,"id","create-capsules"),(0,o.default)(f,"title",t("Create Capsule")),(0,o.default)(f,"allowed",(()=>i.default.resolve(!0))),(0,o.default)(f,"buttonText",t("Create Capsule")),(0,o.default)(f,"policy","capsule:create");var p=(0,u.inject)("rootStore")((0,u.observer)(f));a.default=p},4222:function(e,a,n){"use strict";var r=n(19),l=n(21);r(a,"__esModule",{value:!0}),a.default=void 0;var i=l(n(36)),o=n(1193),u=l(n(1365));class s extends o.ConfirmAction{constructor(){super(...arguments),(0,i.default)(this,"policy","capsule:delete"),(0,i.default)(this,"allowedCheckFunc",(()=>!0)),(0,i.default)(this,"onSubmit",(e=>u.default.delete({id:e.uuid})))}get id(){return"delete"}get title(){return t("Delete Capsule")}get actionName(){return t("Delete Capsule")}get buttonText(){return t("Delete")}get isDanger(){return!0}}a.default=s},4223:function(e,a,n){"use strict";var r=n(19),l=n(21);r(a,"__esModule",{value:!0}),a.default=a.Hosts=void 0;var i=l(n(81)),o=l(n(36)),u=l(n(0)),s=l(n(1194)),d=n(406),c=l(n(1630)),f=l(n(1398));class p extends s.default{constructor(){super(...arguments),(0,o.default)(this,"getColumns",(()=>[{title:t("ID/Name"),dataIndex:"name",routeName:"zuHostsDetailAdmin"},{title:t("Architecture"),dataIndex:"architecture",isHideable:!0},{title:t("Total Containers"),dataIndex:"total_containers",isHideable:!0},{title:t("CPU (Core)"),dataIndex:"cpu_percent",render:(e,t)=>{var a;return u.default.createElement(f.default,{value:e,label:(0,i.default)(a="".concat(t.cpu_used," / ")).call(a,t.cpus)})},width:180,stringify:(e,a)=>{var n,r,l,o;return(0,i.default)(n=(0,i.default)(r=(0,i.default)(l=(0,i.default)(o="".concat(e,"% (")).call(o,t("Used"),": ")).call(l,a.cpu_used," / ")).call(r,t("Total"),": ")).call(n,a.cpus,")")}},{title:t("Configured Memory (GiB)"),dataIndex:"memory_percent",render:(e,t)=>{var a;return u.default.createElement(f.default,{value:e,label:(0,i.default)(a="".concat(t.mem_used_gb," / ")).call(a,t.mem_total_gb)})},width:180,stringify:(e,a)=>{var n,r,l,o;return(0,i.default)(n=(0,i.default)(r=(0,i.default)(l=(0,i.default)(o="".concat(e,"% (")).call(o,t("Used"),": ")).call(l,a.mem_used_gb," / ")).call(r,t("Total"),": ")).call(n,a.mem_total_gb,")")}},{title:t("Configured Disk (GiB)"),dataIndex:"disk_percent",render:(e,t)=>{var a;return u.default.createElement(f.default,{value:e,label:(0,i.default)(a="".concat(t.disk_used," / ")).call(a,t.disk_total)})},width:180,stringify:(e,a)=>{var n,r,l,o;return(0,i.default)(n=(0,i.default)(r=(0,i.default)(l=(0,i.default)(o="".concat(e,"% (")).call(o,t("Used"),": ")).call(l,a.disk_used," / ")).call(r,t("Total"),": ")).call(n,a.disk_total,")")}}]))}init(){this.store=c.default,this.downloadStore=c.default}get name(){return t("hosts")}get policy(){return"host:get_all"}}a.Hosts=p;var m=(0,d.inject)("rootStore")((0,d.observer)(p));a.default=m},4224:function(e,a,n){"use strict";var r=n(19),l=n(21);r(a,"__esModule",{value:!0}),a.default=a.ContainerDetail=void 0;var i=n(406),o=l(n(1200)),u=l(n(1211)),s=n(1215),d=n(1203),c=l(n(1626)),f=l(n(4225)),p=l(n(4226)),m=l(n(4228));class v extends o.default{init(){this.store=u.default}get name(){return t("Container Detail")}get listUrl(){return this.getRoutePath("zunContainers")}get policy(){return"container:get_one"}get actionConfigs(){return this.isAdminPage?c.default.actionConfigsAdmin:c.default.actionConfigs}get detailInfos(){return[{title:t("Name"),dataIndex:"name"},{title:t("Status"),dataIndex:"status",valueMap:s.containerStatus}]}get showLogs(){return(0,d.checkPolicyRule)("container:logs")}get tabs(){var e=[{title:t("Detail"),key:"general_info",component:f.default},{title:t("Action Logs"),key:"action_logs",component:p.default}];return this.showLogs&&e.push({title:t("Logs"),key:"logs",component:m.default}),e}}a.ContainerDetail=v;var g=(0,i.inject)("rootStore")((0,i.observer)(v));a.default=g},4225:function(e,a,n){"use strict";var r=n(19),l=n(21);r(a,"__esModule",{value:!0}),a.default=a.BaseDetail=void 0;var i=l(n(57)),o=l(n(199)),u=l(n(1202)),s=l(n(0)),d=n(406),c=n(1215),f=n(1631);class p extends u.default{get leftCards(){var e=[this.baseInfoCard,this.miscellaneousCard],{stats:t}=this.detailData;return(0,o.default)(t)||e.push(this.statsCard),e}get rightCards(){return[this.specCard]}get baseInfoCard(){var e=[{label:t("Status Detail"),dataIndex:"status_detail",valueMap:c.containerStatus},{label:t("Status Reason"),dataIndex:"status_reason"},{label:t("Task State"),dataIndex:"task_state"},{label:t("Command"),dataIndex:"command",render:f.stringifyContent}];return{title:t("Base Info"),options:e}}get miscellaneousCard(){var e=[{label:t("Host"),dataIndex:"host"},{label:t("Workdir"),dataIndex:"workdir"},{label:t("Environment"),dataIndex:"environment",render:f.stringifyContent},{label:t("Interactive"),dataIndex:"interactive",valueRender:"yesNo"}];return{title:t("Miscellaneous"),options:e}}get specCard(){var e=this,a=[{label:t("Image"),dataIndex:"image"},{label:t("Image Driver"),dataIndex:"image_driver"},{label:t("Image Pull Policy"),dataIndex:"image_pull_policy"},{label:t("Hostname"),dataIndex:"hostname"},{label:t("Runtime"),dataIndex:"runtime"},{label:t("CPU (Core)"),dataIndex:"cpu"},{label:t("Memory (MiB)"),dataIndex:"memory"},{label:t("Disk (GiB)"),dataIndex:"disk"},{label:t("Restart Policy"),dataIndex:"restart_policy",render:f.stringifyContent},{label:t("Auto Remove"),dataIndex:"auto_remove"},{label:t("Auto Heal"),dataIndex:"auto_heal"},{label:t("Addresses"),dataIndex:"addresses",render:f.stringifyContent},{label:t("Networks"),dataIndex:"networks",render:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return s.default.createElement(s.default.Fragment,null,t.length?(0,i.default)(t).call(t,(t=>{var a=e.getLinkRender("networkDetail",t,{id:t});return s.default.createElement("div",{key:t},a)})):"-")}},{label:t("Ports"),dataIndex:"ports",render:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return s.default.createElement(s.default.Fragment,null,t.length?(0,i.default)(t).call(t,(t=>{var a=e.getLinkRender("portDetail",t,{id:t});return s.default.createElement("div",{key:t},a)})):"-")}},{label:t("Security Groups"),dataIndex:"security_groups",render:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return s.default.createElement(s.default.Fragment,null,t.length?(0,i.default)(t).call(t,(t=>{var a=e.getLinkRender("securityGroupDetail",t,{id:t});return s.default.createElement("div",{key:t},a)})):"-")}}];return{title:t("Spec"),labelCol:4,options:a}}get statsCard(){var e=[{label:t("BLOCK I/O(B)"),dataIndex:"stats[BLOCK I/O(B)]"},{label:t("NET I/O(B)"),dataIndex:"stats[NET I/O(B)]"},{label:t("CPU %"),dataIndex:"stats[CPU %]",render:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return e.toFixed(4)}},{label:t("MEM LIMIT (MiB)"),dataIndex:"stats[MEM LIMIT(MiB)]"},{label:t("MEM USAGE (MiB)"),dataIndex:"stats[MEM USAGE(MiB)]",render:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return e.toFixed(4)}},{label:t("MEM %"),dataIndex:"stats[MEM %]",render:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return e.toFixed(4)}}];return{title:t("Stats Information"),options:e}}}a.BaseDetail=p;var m=(0,d.inject)("rootStore")((0,d.observer)(p));a.default=m},4226:function(e,a,n){"use strict";var r=n(19),l=n(21);r(a,"__esModule",{value:!0}),a.default=a.ActionLogs=void 0;var i=l(n(36)),o=l(n(1194)),u=n(406),s=n(1632),d=n(4227);class c extends o.default{constructor(){super(...arguments),(0,i.default)(this,"getColumns",(()=>(0,d.actionColumn)(this)))}init(){this.store=new s.ActionsLogStore}get name(){return t("Action Logs")}get policy(){return"container:actions"}}a.ActionLogs=c;var f=(0,u.inject)("rootStore")((0,u.observer)(c));a.default=f},4227:function(e,a,n){"use strict";var r=n(19),l=n(21);r(a,"__esModule",{value:!0}),a.actionColumn=a.actionMap=a.actionEvent=void 0;var i=l(n(0)),o=n(1632),u=l(n(1534)),s={compute__do_container_start:t("Start Container"),compute__do_container_create:t("Create Container"),compute__do_container_stop:t("Stop Container"),compute__do_container_reboot:t("Reboot Container"),compute__do_container_restart:t("Restart Container"),compute__do_container_pause:t("Pause Container"),compute__do_container_unpause:t("Unpause Container"),compute__do_container_rebuild:t("Rebuild Container"),compute__do_container_kill:t("Kill Container"),compute__do_container_delete:t("Delete Container")};a.actionEvent=s;var d={create:t("Create"),stop:t("Stop"),reboot:t("Reboot"),start:t("Start"),restart:t("Restart"),pause:t("Pause"),unpause:t("Unpause"),resize:t("Resize"),rebuild:t("Rebuild"),kill:t("Kill"),delete:t("Delete")};a.actionMap=d;a.actionColumn=e=>[{title:t("Operation Name"),dataIndex:"action",valueMap:d},{title:t("Project ID/Name"),dataIndex:"project_name",isHideable:!0,hidden:!e.isAdminPage},{title:t("Operation Time"),dataIndex:"start_time",valueRender:"toLocalTimeMoment"},{title:t("Request ID"),dataIndex:"request_id",isHideable:!0,render:(e,t)=>i.default.createElement(i.default.Fragment,null,i.default.createElement("span",null,e),i.default.createElement(u.default,{id:t.container_uuid,requestId:e,store:new o.ActionsLogStore,actionEvent:s}))},{title:t("User ID"),dataIndex:"user_id",isHideable:!0,hidden:!e.isAdminPage,render:t=>e.getLinkRender("userDetail",t,{id:t},null)}]},4228:function(e,a,n){"use strict";var r=n(160),l=n(19),i=n(25),o=n(21);l(a,"__esModule",{value:!0}),a.default=function(e){var[a,n]=(0,s.useState)(""),[r,l]=(0,s.useState)(!0);return(0,s.useEffect)((()=>{(function(){var t=(0,u.default)((function*(){l(!0);var t=yield d.default.fetchLogs(e.detail.uuid);n(t),l(!1)}));return function(){return t.apply(this,arguments)}})()()}),[]),s.default.createElement("div",{style:{margin:"0 16px 16px",padding:16,backgroundColor:"#90a4ae",borderRadius:4,color:"#fff",fontSize:14}},a||r?s.default.createElement("pre",null,a):t("No Logs..."))};var u=o(n(51)),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=c(t);if(a&&a.has(e))return a.get(e);var n={},r=l&&i;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var u=r?i(e,o):null;u&&(u.get||u.set)?l(n,o,u):n[o]=e[o]}n.default=e,a&&a.set(e,n);return n}(n(0)),d=o(n(1211));function c(e){if("function"!=typeof r)return null;var t=new r,a=new r;return(c=function(e){return e?a:t})(e)}},4229:function(e,a,n){"use strict";var r=n(19),l=n(21);r(a,"__esModule",{value:!0}),a.default=a.CapsulesDetail=void 0;var i=n(406),o=l(n(1200)),u=l(n(1365)),s=n(1628),d=l(n(4230)),c=l(n(1629));class f extends o.default{init(){this.store=u.default}get name(){return t("Cluster Template Detail")}get listUrl(){return this.getRoutePath("zunCapsules")}get policy(){return"capsule:get_one_all_projects"}get actionConfigs(){return c.default}get detailInfos(){return[{title:t("Name"),dataIndex:"meta_name"},{title:t("Status"),dataIndex:"status",valueMap:s.capsuleStatus},{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:"general_info",component:d.default}]}}a.CapsulesDetail=f;var p=(0,i.inject)("rootStore")((0,i.observer)(f));a.default=p},4230:function(e,a,n){"use strict";var r=n(19),l=n(21);r(a,"__esModule",{value:!0}),a.default=a.BaseDetail=void 0,n(1198);var i=l(n(1199));n(1196);var o=l(n(1197)),u=l(n(57)),s=l(n(1202)),d=l(n(0)),c=n(406),f=(n(173),n(1631));class p extends s.default{get leftCards(){var{containers:e=[]}=this.detailData,t=[this.baseInfoCard];return e.length&&t.push(this.containersCard),t}get rightCards(){return[this.specCard]}get baseInfoCard(){var e=[{label:t("Status Reason"),dataIndex:"status_reason"},{label:t("Project ID"),dataIndex:"project_id"},{label:t("User ID"),dataIndex:"user_id"}];return{title:t("Capsule Type"),options:e}}get containersCard(){var e=[{label:t("Containers"),dataIndex:"containers",render:e=>(0,u.default)(e).call(e,(e=>d.default.createElement(i.default,{key:e.uuid},d.default.createElement(o.default,{style:{marginRight:8}},t("ID/Name"),":"),d.default.createElement(o.default,null,d.default.createElement("p",null,e.name),d.default.createElement("p",null,e.uuid)))))}];return{title:t("Containers Info"),options:e,labelCol:0,contentCol:24}}get specCard(){var e=[{label:t("CPU"),dataIndex:"cpu"},{label:t("Memory (MiB)"),dataIndex:"memory"},{label:t("Restart Policy"),dataIndex:"restart_policy"},{label:t("Addresses"),dataIndex:"addresses",render:f.stringifyContent}];return{title:t("Spec"),options:e}}}a.BaseDetail=p;var m=(0,c.inject)("rootStore")((0,c.observer)(p));a.default=m},4231:function(e,a,n){"use strict";var r=n(19),l=n(21);r(a,"__esModule",{value:!0}),a.default=a.HostsDetail=void 0;var i=l(n(81)),o=n(406),u=l(n(1200)),s=l(n(1630)),d=l(n(4232));class c extends u.default{init(){this.store=s.default}get name(){return t("Hosts Detail")}get listUrl(){return this.getRoutePath("zunHosts")}get policy(){return"host:get"}get detailInfos(){return[{title:t("Hostname"),dataIndex:"name"},{title:t("CPU (Core)"),dataIndex:"cpu_percent",render:(e,t)=>{var a;return(0,i.default)(a="".concat(t.cpu_used," / ")).call(a,t.cpus)}},{title:t("Configured Memory (GiB)"),dataIndex:"memory_percent",render:(e,t)=>{var a;return(0,i.default)(a="".concat(t.mem_used_gb," / ")).call(a,t.mem_total_gb)}},{title:t("Configured Disk (GiB)"),dataIndex:"disk_percent",render:(e,t)=>{var a;return(0,i.default)(a="".concat(t.disk_used," / ")).call(a,t.disk_total)}}]}get tabs(){return[{title:t("Detail"),key:"detail",component:d.default}]}}a.HostsDetail=c;var f=(0,o.inject)("rootStore")((0,o.observer)(c));a.default=f},4232:function(e,a,n){"use strict";var r=n(19),l=n(21);r(a,"__esModule",{value:!0}),a.default=a.BaseDetail=void 0;var i=l(n(1202)),o=n(406);class u extends i.default{get leftCards(){return[this.containersInfoCard,this.systemInfoCard]}get containersInfoCard(){var e=[{label:t("Total Containers"),dataIndex:"total_containers"}];return{title:t("Containers Info"),options:e}}get systemInfoCard(){var e=[{label:t("Architecture"),dataIndex:"architecture"},{label:t("Kernel Version"),dataIndex:"kernel_version"},{label:t("OS"),dataIndex:"os"},{label:t("OS Type"),dataIndex:"os_type"}];return{title:t("System Info"),options:e}}}a.BaseDetail=u;var s=(0,o.inject)("rootStore")((0,o.observer)(u));a.default=s},4233:function(e,a,n){"use strict";var r=n(19),l=n(21);r(a,"__esModule",{value:!0}),a.default=a.Services=void 0;var i=l(n(36)),o=l(n(1194)),u=n(406),s=l(n(4234)),d=n(1254);class c extends o.default{constructor(){super(...arguments),(0,i.default)(this,"getColumns",(()=>[{title:t("Name"),dataIndex:"binary"},{title:t("Hosts"),dataIndex:"host",isHideable:!0},{title:t("Availability Zone"),dataIndex:"availability_zone",isHideable:!0},{title:t("Report Count"),dataIndex:"report_count",isHideable:!0},{title:t("Forced Down"),dataIndex:"forced_down",valueRender:"yesNo",isHideable:!0},{title:t("Forbidden"),dataIndex:"disabled",valueRender:"yesNo",isHideable:!0},{title:t("Service State"),dataIndex:"state",valueMap:d.serviceState},{title:t("Last Updated"),dataIndex:"updated_at",isHideable:!0,valueRender:"sinceTime"}]))}init(){this.store=s.default,this.downloadStore=s.default}get name(){return t("services")}get policy(){return"zun-service:get_all"}}a.Services=c;var f=(0,u.inject)("rootStore")((0,u.observer)(c));a.default=f},4234:function(e,t,a){"use strict";var n=a(19),r=a(21);n(t,"__esModule",{value:!0}),t.default=t.ServicesStore=void 0;var l=r(a(53)),i=r(a(48));class o extends l.default{get client(){return i.default.zun.services}}t.ServicesStore=o;var u=new o;t.default=u}}]);