PageSourceSearch

https://cdn.selectel.ru/panel/246.ad66246961446472.js

js selectel.ru collected 2026-09-24 15:22:40 UTC 102,692 bytes, 2 lines download raw bytes

1!function(){try{var N=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},L=(new Error).stack;L&&(N._sentryDebugIds=N._sentryDebugIds||{},N._sentryDebugIds[L]="1c38d6fc-1ba0-4b33-bf83-ac81a9ca006b",N._sentryDebugIdIdentifier="sentry-dbid-1c38d6fc-1ba0-4b33-bf83-ac81a9ca006b")}catch{}}();var _global=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};_global.SENTRY_RELEASE={id:"2026.09.24-1633145"},(self.webpackChunkmy_selectel_panel=self.webpackChunkmy_selectel_panel||[]).push([[246],{70087(N,L,t){t.d(L,{E:()=>O});var d=t(3412),c=t(23723),v=t(58519),M=t(60498),u=t(84532),m=t(68147);let O=(()=>{class D extends c.PP{constructor(){super({scope:"project",catalog:"network"}),this.nzNotificationService=(0,d.WQX)(u.xY),this.translate=(0,d.WQX)(M.Nw)}internalRequest(_,T,h,n){return super.internalRequest(_,T,h,n).pipe((0,m.M)({error:$=>{n?.context?.get(v.NC)||this.handleError($)}}))}isNeutronError(_){return!!_?.error?.NeutronError}handleError(_){v.RQ.has(_.status)||this.nzNotificationService.error(this.translate(v.w0.title),this.translate(this.isNeutronError(_)?_.error.NeutronError.message:v.w0.content),{nzKey:String(_.status)})}static{this.\u0275fac=function(T){return new(T||D)}}static{this.\u0275prov=d.jDH({token:D,factory:D.\u0275fac,providedIn:"root"})}}return D})()},77340(N,L,t){t.d(L,{z:()=>u});var d=t(25777),c=t(25169),v=t(3412),M=t(70087);let u=(()=>{class m{constructor(D){this.networkHttpClient=D}query(D,y,_=!1){const T=(new d._y).set(c.R6,{isCritical:_});return this.networkHttpClient.get({region:y,projectId:D},"/v2.0/security-groups",{context:T})}getById(D,y,_){return this.networkHttpClient.get({region:y,projectId:D},`/v2.0/security-groups/${_}`)}create(D,y,_){const T=(new d._y).set(c.R6,{isCritical:!1});return this.networkHttpClient.post({region:y,projectId:D},"/v2.0/security-groups",_?{security_group:_}:null,{context:T})}delete(D,y,_){const T=(new d._y).set(c.R6,{isCritical:!1});return this.networkHttpClient.delete({region:y,projectId:D},`/v2.0/security-groups/${_}`,{context:T})}update(D,y,_,T){const h=(new d._y).set(c.R6,{isCritical:!1});return this.networkHttpClient.put({region:y,projectId:D},`/v2.0/security-groups/${_}`,{security_group:T},{context:h})}static{this.\u0275fac=function(y){return new(y||m)(v.KVO(M.E))}}static{this.\u0275prov=v.jDH({token:m,factory:m.\u0275fac,providedIn:"root"})}}return m})()},33921(N,L,t){t.d(L,{P:()=>D});var d=t(3412),c=t(23652),v=t(48120),M=t(65285),u=t(85542);let D=(()=>{class y{constructor(){this.cloudDirectPublicPortsRepository=(0,d.WQX)(M.L),this.store=(0,c.y$)({name:"cloudPorts"},(0,v.Mk)()),this.ports$=this.store.pipe((0,v.PE)())}getPorts(T){const h=this.store.query((0,v.Rk)());if(!T?.length)return h;const n=new Set(T);return h.filter($=>n.has($.id))}getPort(T){return this.store.query((0,v.QH)(T))}addPort(T){this.store.update((0,v.xD)(T))}deletePort(T){this.store.update((0,v.f3)((0,c.FG)(T))),this.cloudDirectPublicPortsRepository.deletePublicPort(T)}upsertPorts(T,h){const n=h.map(({id:$})=>$);this.store.update((0,v.ZG)(n,{updater:$=>{const P=h.find(({id:s})=>s===$.id);return(0,u.isEqual)($,P)?$:{...$,...P}},creator:$=>({...h.find(P=>P.id===$),$region:T})}))}upsertPort(T,h){this.store.update((0,v.ZG)(h.id,{updater:n=>(0,u.isEqual)(n,h)?n:{...n,...h},creator:()=>({...h,$region:T})}))}updatePort(T,h){this.store.update((0,v.pP)(T,n=>({...n,...h})))}clear(){this.store.update((0,v.oQ)())}static{this.\u0275fac=function(h){return new(h||y)}}static{this.\u0275prov=d.jDH({token:y,factory:y.\u0275fac,providedIn:"root"})}}return y})()},98776(N,L,t){t.d(L,{R:()=>O});var d=t(23652),c=t(48120),v=t(85542),u=t(3412);let O=(()=>{class D{constructor(){this.store=(0,d.y$)({name:"cloudSecurityGroupRules"},(0,c.Mk)()),this.securityGroupRules$=this.store.pipe((0,c.PE)())}getSecurityGroupRules(){return this.store.query((0,c.Rk)())}getSecurityGroupRule(_){return this.store.query((0,c.QH)(_))}addSecurityGroupRule(_){this.store.update((0,c.xD)(_))}deleteSecurityGroupRule(_){this.store.update((0,c.f3)((0,d.FG)(_)))}deleteAllSecurityGroupRules(){this.store.update((0,c.oQ)())}upsertSecurityGroupRules(_,T){const h=T.map(({id:n})=>n);this.store.update((0,c.ZG)(h,{updater:n=>{const $=T.find(({id:P})=>P===n.id);return(0,v.isEqual)(n,$)?n:{...n,...$}},creator:n=>({...T.find($=>
1$.id===n),$region:_})}))}upsertSecurityGroupRule(_,T){this.store.update((0,c.ZG)(T.id,{updater:h=>(0,v.isEqual)(h,T)?h:{...h,...T},creator:()=>({...T,$region:_})}))}clear(){this.deleteAllSecurityGroupRules()}static{this.\u0275fac=function(T){return new(T||D)}}static{this.\u0275prov=u.jDH({token:D,factory:D.\u0275fac,providedIn:"root"})}}return D})()},13426(N,L,t){t.d(L,{d:()=>O});var d=t(23652),c=t(48120),v=t(85542),u=t(3412);let O=(()=>{class D{constructor(){this.store=(0,d.y$)({name:"cloudSecurityGroups"},(0,c.Mk)()),this.securityGroups$=this.store.pipe((0,c.PE)())}getSecurityGroups(){return this.store.query((0,c.Rk)())}getSecurityGroup(_){return this.store.query((0,c.QH)(_))}addSecurityGroup(_){this.store.update((0,c.xD)(_))}deleteSecurityGroup(_){this.store.update((0,c.f3)((0,d.FG)(_)))}deleteAllSecurityGroups(){this.store.update((0,c.oQ)())}upsertSecurityGroups(_,T){const h=T.map(({id:n})=>n);this.store.update((0,c.ZG)(h,{updater:n=>{const $=T.find(({id:P})=>P===n.id);return(0,v.isEqual)(n,$)?n:{...n,...$}},creator:n=>({...T.find($=>$.id===n),$region:_})}))}upsertSecurityGroup(_,T){this.store.update((0,c.ZG)(T.id,{updater:h=>(0,v.isEqual)(h,T)?h:{...h,...T},creator:()=>({...T,$region:_})}))}clear(){this.deleteAllSecurityGroups()}static{this.\u0275fac=function(T){return new(T||D)}}static{this.\u0275prov=u.jDH({token:D,factory:D.\u0275fac,providedIn:"root"})}}return D})()},82767(N,L,t){t.d(L,{l:()=>$});var d=t(83573),c=t(68147),v=t(98734),M=t(98704),u=t(3412),m=t(11610),O=t(13426),D=t(77340),y=t(70087);let _=(()=>{class P{constructor(f){this.networkHttpClient=f}query(f,z){return this.networkHttpClient.get({region:z,projectId:f},"v2.0/extensions")}static{this.\u0275fac=function(z){return new(z||P)(u.KVO(y.E))}}static{this.\u0275prov=u.jDH({token:P,factory:P.\u0275fac,providedIn:"root"})}}return P})(),T=(()=>{class P{constructor(f,z){this.projectsService=f,this.extensionsApiService=z,this.requestsCache={}}getExtensions(f){return this.requestsCache[f]||(this.requestsCache[f]=this.extensionsApiService.query(this.projectsService.currentId,f).pipe((0,M.T)(z=>z.extensions),(0,v.t)(1))),this.requestsCache[f]}static{this.\u0275fac=function(z){return new(z||P)(u.KVO(m.iX),u.KVO(_))}}static{this.\u0275prov=u.jDH({token:P,factory:P.\u0275fac,providedIn:"root"})}}return P})();var h=t(98776);let $=(()=>{class P{constructor(f,z,U,X,i){this.projectsService=f,this.securityGroupsRepositoryService=z,this.securityGroupsApiService=U,this.extensionsService=X,this.securityGroupRulesApiService=i,this.securityGroups$=this.securityGroupsRepositoryService.securityGroups$,this.requestsCache={}}getSecurityGroups(f){return this.securityGroupsApiService.query(this.projectsService.currentId,f).pipe((0,c.M)({next:({security_groups:z})=>{this.securityGroupsRepositoryService.upsertSecurityGroups(f,z),z.forEach(U=>{this.securityGroupRulesApiService.upsertSecurityGroupRules(f,U.security_group_rules)})}}),(0,d.uC)(["cloud:networking:securityGroups:get"],{skipCache:!0}))}getSecurityGroupById(f,z){return this.securityGroupsApiService.getById(this.projectsService.currentId,f,z).pipe((0,c.M)({next:({security_group:U})=>{this.securityGroupsRepositoryService.upsertSecurityGroup(f,U),this.securityGroupRulesApiService.upsertSecurityGroupRules(f,U.security_group_rules)}}),(0,d.uC)(["cloud:networking:securityGroup:get"],{skipCache:!0}))}deleteSecurityGroup(f,z){return this.securityGroupsApiService.delete(this.projectsService.currentId,f,z).pipe((0,c.M)({next:()=>{this.securityGroupsRepositoryService.deleteSecurityGroup(z)}}),(0,d.uC)(["cloud:networking:securityGroup:delete"],{skipCache:!0}))}createSecurityGroup(f,z){return this.securityGroupsApiService.create(this.projectsService.currentId,f,z).pipe((0,c.M)({next:U=>{this.securityGroupsRepositoryService.upsertSecurityGroup(f,U.security_group)}}),(0,d.uC)(["cloud:networking:securityGroup:create"],{skipCache:!0}))}updateSecurityGroup(f,z,U){return this.securityGroupsApiService.update(this.projectsService.currentId,f,z,U).pipe((0,c.M)({next:X=>{this.securityGroupsRepositoryService.upsertSecurityGroup(f,X.security_group)}}),(0,d.uC)(["cloud:networking:securityGroup:update"],{skipCache:!0}))}getCachedSecurityGroups(f){return this.requestsCache[f]??=this.getSecurityGroups(f).pipe((0,v.t)({bufferSize:1,refCount:!0}),(0,c.M)({finalize:()=>{this.requestsCache[f]&&delete this.requestsCache[f]}}))}clear(){this.securityGroupsRepositoryService.clear()}isAvailableInRegion(f){return this.extensionsService.getExtensions(f).pipe((0,M.T)(z=>!!z.find(U=>"security-group"===U.name)))}static{this.\u0275fac=function(z){return new(z||P)(u.KVO(m.iX),u.KVO(O.d),u.KVO(D.z),u.KVO(T),u.KVO(h.R))}}static{this.\u0275prov=u.jDH({token:P,factory:P.\u0275fac,providedIn:"root"})}}return P})()},65285(N,L,t){t.d(L,{L:()=>O});
1var d=t(23652),c=t(48120),v=t(85542),u=t(3412);let O=(()=>{class D{constructor(){this.store=(0,d.y$)({name:"cloudPublicNetPorts"},(0,c.Mk)()),this.publicPorts$=this.store.pipe((0,c.PE)())}getPublicPorts(){return this.store.query((0,c.Rk)())}getPublicPort(_){return this.store.query((0,c.QH)(_))}addPublicPort(_){this.store.update((0,c.xD)(_))}deletePublicPort(_){this.store.update((0,c.f3)((0,d.FG)(_)))}deleteAllPublicPorts(){this.store.update((0,c.oQ)())}setPorts(_,T){this.store.update((0,c.a8)(T.map(h=>({...h,$region:_}))))}upsertPublicPorts(_,T){const h=T.map(({id:n})=>n);this.store.update((0,c.ZG)(h,{updater:n=>{const $=T.find(({id:P})=>P===n.id);return(0,v.isEqual)(n,$)?n:{...n,...$}},creator:n=>({...T.find($=>$.id===n),$region:_})}))}upsertPublicPort(_,T){this.store.update((0,c.ZG)(T.id,{updater:h=>(0,v.isEqual)(h,T)?h:{...h,...T},creator:()=>({...T,$region:_})}))}updatePublicPort(_,T){this.store.update((0,c.pP)(_,h=>({...h,...T})))}clear(){this.deleteAllPublicPorts()}static{this.\u0275fac=function(T){return new(T||D)}}static{this.\u0275prov=u.jDH({token:D,factory:D.\u0275fac,providedIn:"root"})}}return D})()},41758(N,L,t){t.d(L,{l:()=>d});var d=function(c){return c.v1="managed-kubernetes",c.v2="managed-kubernetes-v2",c}(d||{})},64151(N,L,t){t.d(L,{T:()=>h});var d=t(40715),c=t(88796),v=t(64855),M=t(56882),u=t(4972),m=t(63438),O=t(65454),D=t(24432),y=t(5055),_=t
1(84487),T=t(3412);let h=(()=>{class n{static{this.\u0275fac=function(s){return new(s||n)}}static{this.\u0275mod=_.$C({type:n})}static{this.\u0275inj=T.G2t({imports:[v.U,m.C,u.u,D.T,y.m,O.$,d.i6,c.LX,M.l]})}}return n})()},54747(N,L,t){t.d(L,{MQ:()=>u,QU:()=>y,YJ:()=>_,c6:()=>v,ch:()=>T,j_:()=>c,l7:()=>M,oD:()=>m});var d=t(13593);function c(h){return"available"===h.status}function v(h){return"available"===h.status}function M(h){return!(!(h.$isPublic&&h.x_sel_image_os_arch&&h.x_sel_image_os_dist&&"ubuntu-mks"!==h.x_sel_image_os_dist)||h.$isMarketplace)}function u(h){return(h.$isPrivate||h.$isShared)&&!h.$isMarketplace&&"active"===h.status}function m(h){return function O(h){return h.$isPublic&&h.x_sel_image_os_arch&&h.x_sel_image_os_dist&&"ubuntu-mks"!==h.x_sel_image_os_dist&&h.$isMarketplace}(h)||function D(h){return(h.$isPrivate||h.$isShared)&&h.$isMarketplace}(h)}function y(h){const n=h.toLowerCase();return Object.values(d._).find($=>!(!n.includes($)||$===d._.gitlab&&n.includes(d._.gitlab_runner)))}function _(h,n){const $="image"===h?.$type,P=$&&h?.$isGpuOptimized,s=$?h?.$gpuOptimized:[];return!(h&&(!$||!M(h)||P&&(!s.length||s.includes(n))))}function T(h){return[{value:"ubuntu",orientation:"vertical",customTemplateContext:{item:{name:"Ubuntu",type:"ubuntu",iconName:"sui:os-ubuntu"}}},{value:"debian",orientation:"vertical",customTemplateContext:{item:{name:"Debian",type:"debian",iconName:"sui:os-debian"}}},{value:"windows",orientation:"vertical",customTemplateContext:{item:{name:"Windows",type:"windows",iconName:"sui:os-windows"}}},{value:"coreos",orientation:"vertical",customTemplateContext:{item:{name:"Fedora Core",type:"coreos",iconName:"sui:os-fedora-core"}}},{value:"centos",orientation:"vertical",customTemplateContext:{item:{name:"CentOS",type:"centos",iconName:"sui:os-centos"}}},{value:"selectos",orientation:"vertical",customTemplateContext:{item:{name:"SelectOS",type:"selectos",iconName:"sui:os-selectos"}}},{value:"astralinux",orientation:"vertical",customTemplateContext:{item:{name:"Astra Linux",type:"astralinux",iconName:"sui:os-astra-linux"}}},{value:"redoslinux",orientation:"vertical",customTemplateContext:{item:{name:h("vpc_redos"),type:"redoslinux",iconName:"sui:os-redos"}}},{value:"almalinux",orientation:"vertical",customTemplateContext:{item:{name:"Alma Linux",type:"almalinux",iconName:"sui:os-almalinux"}}},{value:"rocky",orientation:"vertical",customTemplateContext:{item:{name:"Rocky Linux",type:"rocky",iconName:"sui:os-rocky"}}},{value:"fedora",orientation:"vertical",customTemplateContext:{item:{name:"Fedora",type:"fedora",iconName:"sui:os-fedora"}}},{value:"oraclelinux",orientation:"vertical",customTemplateContext:{item:{name:"Oracle",type:"oraclelinux",iconName:"sui:os-oracle"}}}]}},30177(N,L,t){function d(){return c=>{const{value:v}=c;return/^[A-Za-z\u0400-\u04FF_]/.test(v)?/[^\w\u0400-\u04FF-.]/.test(v)?{symbols:!0}:null:{beginning:!0}}}t.d(L,{Y:()=>d})},25484(N,L,t){t.d(L,{P:()=>h});var d=t(25777),c=t(3412),v=t(52784),M=t(60679),u=t(23152),m=t(98704),O=t(84532),D=t(23723),y=t(60498),_=t(41758),T=t(11610);let h=(()=>{class n{constructor(){this.translate=(0,c.WQX)(y.Nw),this.nzNotificationService=(0,c.WQX)(O.xY),this.projectsService=(0,c.WQX)(T.iX),this.cloudHttpClient=(0,c.WQX)(D.PP)}get projectId(){return this.projectsService.currentId}getClusters(P="ru-1",s=_.l.v2){return this.cloudHttpClient.get({scope:"project",projectId:this.projectId,region:P,catalog:s},"/clusters").pipe((0,M.W)(f=>(this.nzNotificationService.error(this.translate("vpc_Internal error"),f.error?.error?.message),(0,v.$)(()=>new Error(f.error?.error?.message)))))}createCluster(P,s="ru-1"){return this.cloudHttpClient.post({scope:"project",projectId:this.projectId,region:s,catalog:_.l.v2},"/clusters",{cluster:P}).pipe((0,M.W)(f=>this.handleError(f)))}removeCluster(P,s="ru-1",f=_.l.v2){return this.cloudHttpClient.delete({scope:"project",projectId:this.projectId,region:s,catalog:f},`/clusters/${P}`).pipe((0,M.W)(z=>this.handleError(z)))}getNodegroups(P,s="ru-1"){return this.cloudHttpClient.get({scope:"project",projectId:this.projectId,region:s,catalog:_.l.v2},`/clusters/${P}/nodegroups`).pipe((0,M.W)(f=>this.handleError(f)))}createNodegroup(P,s,f="ru-1"){return this.cloudHttpClient.post({scope:"project",projectId:this.projectId,region:f,catalog:_.l.v2},`/clusters/${P}/nodegroups`,{nodegroup:s}).pipe((0,M.W)(z=>this.handleError(z)))}deleteClusterFeedback(P,s,f){return this.cloudHttpClient.put({scope:"project",projectId:this.projectId,region:s,catalog:_.l.v1},`/feedbacks/clusters-deletion/${P}`,{feedback:f}).pipe((0,M.W)(z=>this.handleError(z)))}getAddons(P="ru-3",s=_.l.v1){return this.cloudHttpClient.get({scope:"project",projectId:this.projectId,region:P,catalog:s},"/addons").pipe((0,m.T)(f=>f.addons),(0,M.W)(f=>this.handleError(f)))}getClusterAddons(P,s="ru-3",f=_.l.v1){return this.cloudHttpClient.get({scope:"project",projectId:this.projectId,region:s,catalog:f},`/clusters/${P}/addons`).pipe((0,u.L)(3),(0,m.T)(z=>z.addons),(0,M.W)(z=>this.handleError(z)))}getNGINXIngressControllerAddonVersions(P=_.l.v1){return this.cloudHttpClient.get({scope:"project",projectId:this.projectId,catalog:P},"/addons/ingress/nginx/versions").pipe((0,m.T)(s=>s.versions),(0,M.W)(s=>this.handleError(s)))}addNGINXIngressControllerAddonToCluster(P,s,f,z=_.l.v1,U="default"){return this.cloudHttpClient.post({scope:"project",projectId:this.projectId,region:s,catalog:z},`/clusters/${P}/${U}/addons/ingress/nginx`,{version:f}).pipe((0,M.W)(X=>this.handleError(X)))}deleteNGINXIngressControllerAddonFromCluster(P,s="ru-3",f=_.l.v1,z="default"){return this.cloudHttpClient.delete({scope:"project",projectId:this.projectId,region:s,catalog:f},`/clusters/${P}/${z}/addons/ingress/nginx`).pipe((0,M.W)(U=>this.handleError(U)))}getEnvoyGatewayAPIAddonVersions(P,s=_.l.v1){return this.cloudHttpClient.get({scope:"project",projectId:this.projectId,region:P,catalog:s},"/addons/gateway/envoy/versions").pipe((0,m.T)(f=>f.versions),(0,M.W)(f=>this.handleError(f)))}addEnvoyGatewayAPIAddonToCluster(P,s,f,z=_.l.v1,U="default"){return this.cloudHttpClient.post({scope:"project",projectId:this.projectId,region:s,catalog:z},`/clusters/${P}/${U}/addons/gateway/envoy`,{version:f}).pipe((0,M.W)(X=>this.handleError(X)))}deleteEnvoyGatewayAPIAddonFromCluster(P,s="ru-3",f=_.l.v1,z="default"){return this.cloudHttpClient.delete({scope:"project",projectId:this.projectId,region:s,catalog:f},`/clusters/${P}/${z}/addons/gateway/envoy`).pipe((0,M.W)(U=>this.handleError(U)))}seidoServer(P){return this.cloudHttpClient.get({scope:"project",useCommonApiBase:!0,projectId:this.projectId},`/servers/v2/resource/${P}`).pipe((0,m.T)(({result:s})=>s??null),(0,M.W)(s=>this.handleError(s)))}handleError(P){if(P instanceof d.yz){const s=P.error?.error?.message;s&&this.nzNotificationService.error(this.translate("vpc_Internal error"),s)}throw P}static{this.\u0275fac=function(s){return new(s||n)}}static{this.\u0275prov=c.jDH({token:n,factory:n.\u0275fac,providedIn:"root"})}}return n})()},61635(N,L,t){t.d(L,{p:()=>p});var d=t(82525),c=t(3412),v=t(41269),M=t(7086),u=t(68405),m=t(56882),O=t(29712),D=t(42143),y=t(49408),_=t(38610),T=t(40715),h=t(76839),n=t(84399),$=t(79967),P=t(23691),s=t(84487),f=t(14501),z=t(21689),U=t(68926),X=t(71686),i=t(29508),k=t(22536),Q=t(12576);function B(l,E){if(1&l){const g=s.RV6();s.j41(0,"button",2),s.bIt("click",function(){c.eBV(g);const I=s.XpG();return c.Njj(I.toggleShelve("server_page_button"))}),s.nrm(1,"span",3),s.k0s()}if(2&l){const g=s.XpG(),R=s.sdS(2);s.Y8G("disabled",g.isShelveDisabled||g.IS_READER)("nzPopoverContent",R)}}function A(l,E){1&l&&(s.j41(0,"span"),s.EFF(1),s.nI1(2,"translate"),s.k0s()),2&l&&(s.R7$(),s.JRh(s.bMT(2,1,"vpc_freeze")))}let Y=(()=>{class l extends $.R{constructor(g){super(g),this.$injector=g,this.IS_INTERNAL=u.ENTRY.INTERNAL,this.IS_READER=(0,c.WQX)(n.Y).isReader}static{this.\u0275fac=function(R){return new(R||l)(s.rXU("$injector"))}}static{this.\u0275cmp=s.VBU({type:l,selectors:[["vpc-shelving-button"]],inputs:{server:"server"},features:[s.Vt3],decls:3,vars:1,consts:[["popoverContent",""],["nz-button","","type","button","nzPopoverPlacement","top",2,"width","36px","height","36px",3,"disabled","nz-popover","nzPopoverContent"],["nz-button","","type","button","nzPopoverPlacement","top",2,"width","36px","height","36px",3,"click","disabled","nz-popover","nzPopoverContent"],["suiSize","m","nz-icon","","nzType","sui:snowflake"]],template:function(R,I){1&R&&(s.nVh(0,B,2,2,"button",1),s.DNE(1,A,3,3,"ng-template",null,0,s.C5r)),2&R&&s.vxM(I.isUseLocalDisk||!I.IS_INTERNAL&&I.vpcServerShelvingService.isShelvingDisabledForExter
1nal?-1:0)},dependencies:[d.MD,m.l,D.cX,f.a,z.c,U.p,X.ou,X.Xv,y.t_t,i.Dn,y.fz$,_.Zi,k.L_,Q.D],encapsulation:2})}}return l})();var ee=t(71987),V=t(32005);function Z(l,E){if(1&l){const g=s.RV6();s.j41(0,"nz-switch",5),s.mxI("ngModelChange",function(I){c.eBV(g);const C=s.XpG();return s.DH7(C.server.$isActive,I)||(C.server.$isActive=I),c.Njj(I)}),s.bIt("click",function(){c.eBV(g);const I=s.XpG();return c.Njj(I.togglePower("server_page_button",I.isLiteVersion))}),s.k0s()}if(2&l){const g=s.XpG();s.R50("ngModel",g.server.$isActive),s.Y8G("nzControl",!0)("nzDisabled",g.isPowerDisabled||g.IS_READER)}}function F(l,E){if(1&l){const g=s.RV6();s.j41(0,"nz-switch",5),s.mxI("ngModelChange",function(I){c.eBV(g);const C=s.XpG();return s.DH7(C.server.$isActive,I)||(C.server.$isActive=I),c.Njj(I)}),s.bIt("click",function(){c.eBV(g);const I=s.XpG();return c.Njj(I.toggleUnshelve("server_page_button"))}),s.k0s()}if(2&l){const g=s.XpG();s.R50("ngModel",g.server.$isActive),s.Y8G("nzControl",!0)("nzDisabled",g.isUnshelveDisabled||g.IS_READER)}}function J(l,E){if(1&l){const g=s.RV6();s.j41(0,"nz-switch",5),s.mxI("ngModelChange",function(I){c.eBV(g);const C=s.XpG();return s.DH7(C.server.$isActive,I)||(C.server.$isActive=I),c.Njj(I)}),s.bIt("click",function(){c.eBV(g);const I=s.XpG();return c.Njj(I.toggleUnshelve("server_page_button"))}),s.k0s()}if(2&l){const g=s.XpG();s.R50("ngModel",g.server.$isActive),s.Y8G("nzControl",!0)("nzDisabled",g.isUnshelveDisabled||g.IS_READER)}}function se(l,E){if(1&l){const g=s.RV6();s.j41(0,"nz-switch",5),s.mxI("ngModelChange",function(I){c.eBV(g);const C=s.XpG();return s.DH7(C.server.$isActive,I)||(C.server.$isActive=I),c.Njj(I)}),s.bIt("click",function(){c.eBV(g);const I=s.XpG();return c.Njj(I.togglePause("server_page_button",I.isLiteVersion))}),s.k0s()}if(2&l){const g=s.XpG();s.R50("ngModel",g.server.$isActive),s.Y8G("nzControl",!0)("nzDisabled",g.isPauseDisabled||g.IS_READER)}}function ne(l,E){if(1&l&&s.nrm(0,"vpc-shelving-button",3),2&l){const g=s.XpG();s.Y8G("server",g.server)}}function re(l,E){if(1&l){const g=s.RV6();s.j41(0,"button",6),s.nI1(1,"translate"),s.bIt("click",function(){c.eBV(g);const I=s.XpG();return c.Njj(I.runAction("softReboot","server_page_button",I.isLiteVersion))}),s.nrm(2,"span",7),s.k0s()}if(2&l){const g=s.XpG();s.Y8G("disabled",g.isActionDisabled("softReboot")||g.IS_READER)("nzPopoverContent",s.bMT(1,2,"vpc_Software reboot"))}}function oe(l,E){1&l&&(s.nrm(0,"span",10),s.nI1(1,"translate")),2&l&&s.Y8G("nzPopoverContent",s.bMT(1,1,"vpc_servers_open_console"))}function e(l,E){1&l&&s.eu8(0)}function ie(l,E){if(1&l){const g=s.RV6();s.j41(0,"button",11),s.bIt("click",function(){c.eBV(g);const I=s.XpG(2);return c.Njj(I.openConsolePage())}),s.DNE(1,e,1,0,"ng-container",12),s.k0s()}if(2&l){s.XpG();const g=s.sdS(1);s.R7$(),s.Y8G("ngTemplateOutlet",g)}}function te(l,E){1&l&&s.eu8(0)}function q(l,E){if(1&l&&(s.j41(0,"button",9),s.DNE(1,te,1,0,"ng-container",12),s.k0s()),2&l){s.XpG();const g=s.sdS(1);s.Y8G("disabled",!0),s.R7$(),s.Y8G("ngTemplateOutlet",g)}}function a(l,E){if(1&l&&(s.DNE(0,oe,2,3,"ng-template",null,0,s.C5r),s.nVh(2,ie,2,1,"button",8)(3,q,2,2,"button",9)),2&l){const g=s.XpG();s.R7$(2),s.vxM(g.isDeletable&&!g.IS_READER?2:3)}}let p=(()=>{class l extends $.R{get badgeStatus(){switch(this.serverStatus){case"ACTIVE":return"success";case"SHUTOFF":case"PAUSED":case"RESCUE":return"warning";case"ERROR":return"error";default:return"default"}}constructor(g){super(g),this.$injector=g,this.activatedRoute=(0,c.WQX)(M.nX),this.analyticsService=(0,c.WQX)(P.T),this.router=(0,c.WQX)(M.Ix),this.vpcExternalRoleService=(0,c.WQX)(n.Y),this.isPage=!1,this.isLiteVersion=!1,this.IS_INTERNAL=u.ENTRY.INTERNAL,this.IS_READER=this.vpcExternalRoleService.isReader}openConsolePage(){this.isLiteVersion?this.vdsServersAnalyticsService.triggerConsoleOpen({event_place:"vds_server_list",id_server:this.server.id??""}):this.analyticsService.proceed(P.Z.CLOUD_COMPUTE_SERVER_RENAME_EVENT,{event_place:"server_list",id_server:this.server.id??""}),this.router.navigate(["../",this.server.$region,this.server.id,"console"],{relativeTo:this.activatedRoute})}static{this.\u0275fac=function(R){return new(R||l)(s.rXU("$injector"))}}static{this.\u0275cmp=s.VBU({type:l,selectors:[["vpc-server-control
1s"]],inputs:{server:"server",isPage:"isPage",isLiteVersion:"isLiteVersion"},features:[s.Vt3],decls:8,vars:8,consts:[["terminalRef",""],[1,"sui-mrl-2xs",3,"server"],["data-testid","power_toggle",3,"ngModel","nzControl","nzDisabled"],["data-testid","shelve_btn",3,"server"],["type","button","nz-button","","data-testid","soft_reboot_btn","nz-popover","","nzPopoverPlacement","top",1,"m-icon","m-bordered","button",3,"disabled","nzPopoverContent"],["data-testid","power_toggle",3,"ngModelChange","click","ngModel","nzControl","nzDisabled"],["type","button","nz-button","","data-testid","soft_reboot_btn","nz-popover","","nzPopoverPlacement","top",1,"m-icon","m-bordered","button",3,"click","disabled","nzPopoverContent"],["nz-icon","","nzType","sui:arrow-clockwise"],["type","button","nz-button","","nzType","text",1,"terminal"],["type","button","nz-button","","nzType","text",1,"terminal",3,"disabled"],["nz-icon","","nzType","sui:terminal","suiSize","l","nz-popover","","nzPopoverPlacement","top",1,"sui-flex-center-center",3,"nzPopoverContent"],["type","button","nz-button","","nzType","text",1,"terminal",3,"click"],[4,"ngTemplateOutlet"]],template:function(R,I){1&R&&(s.nrm(0,"vpc-server-status-badge",1),s.nVh(1,Z,1,3,"nz-switch",2),s.nVh(2,F,1,3,"nz-switch",2),s.nVh(3,J,1,3,"nz-switch",2),s.nVh(4,se,1,3,"nz-switch",2),s.nVh(5,ne,1,1,"vpc-shelving-button",3),s.nVh(6,re,3,4,"button",4),s.nVh(7,a,4,1)),2&R&&(s.Y8G("server",I.server),s.R7$(),s.vxM(I.server.$isShelved||I.server.$isPaused?-1:1),s.R7$(),s.vxM(I.server.$isShelvedPreemptible&&!I.isLiteVersion?2:-1),s.R7$(),s.vxM(!I.server.$isShelved||I.server.$isPreemptible||!I.IS_INTERNAL&&I.vpcServerShelvingService.isShelvingDisabledForExternal||I.isLiteVersion?-1:3),s.R7$(),s.vxM(I.server.$isPaused?4:-1),s.R7$(),s.vxM(I.isPage&&!I.isLiteVersion?5:-1),s.R7$(),s.vxM(I.isPage?6:-1),s.R7$(),s.vxM(I.isPage?-1:7))},dependencies:[d.T3,v.YN,v.BC,v.vS,O.Rr,T.i6,h.mk,V.u,y.t_t,i.Dn,y.fz$,D.cX,f.a,z.c,U.p,X.ou,X.Xv,m.l,Y,_.Zi,k.L_,ee.q,Q.D],styles:["[_nghost-%COMP%] {\n  display: flex;\n  align-items: center;\n  flex-wrap: nowrap;\n}\n.terminal[_ngcontent-%COMP%] {\n  width: 40px;\n  height: 40px;\n  padding: 0;\n}\n.button[_ngcontent-%COMP%] {\n  width: 36px;\n  height: 36px;\n}"],changeDetection:0})}}return l})()},99068(N,L,t){t.d(L,{a:()=>c});var d=t(3412);let c=(()=>{class v{constructor(){this.isLoaded=!1}reset(){this.isLoaded=!1}static{this.\u0275fac=function(m){return new(m||v)}}static{this.\u0275prov=d.jDH({token:v,factory:v.\u0275fac,providedIn:"root"})}}return v})()},34701(N,L,t){t.d(L,{P:()=>ut});var d=t(3412),c=t(32875),v=t(68405),M=t(56882),u=t(42143),m=t(99720),O=t(1264),D=t(49408),y=t(26810),_=t(84399),T=t(61420),h=t(58935),n=t(4262),$=t(68147),P=t(79967),s=t(82525),f=t(41269),z=t(85542),U=t(3038),X=t(84182),i=t(98704),k=t(33200),Q=t(13258),B=t(94357),A=t(62501),Y=t(42511),ee=t(84210),V=t(33921),Z=t(67285),F=t(68605),J=t(96156),se=t(11610),ne=t(87486),re=t(63438),oe=t(99068),e=t(84487),ie=t(91590),te=t(46431),q=t(19781),a=t(12195),p=t(71428),l=t(12576),E=t(78080);const g=r=>({"sui-bd-base border-block sui-pdh-m sui-pdv-s":r}),R=r=>({"max-width":r}),I=(r,x)=>({name:r,ipAddress:x}),C=r=>({name:r}),W=(r,x)=>x.id;function G(r,x){if(1&r&&e.nrm(0,"nz-skeleton",2),2&r){const o=e.XpG();e.Y8G("nzActive",!0)("nzParagraph",!1)("nzLoading",o.isLoading())}}function K(r,x){1&r&&e.eu8(0)}function le(r,x){if(1&r&&(e.j41(0,"label",11),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&r){const o=e.XpG(3);e.Y8G("nzIndeterminate",o.isAllIntermediate()),e.R7$(),e.JRh(e.bMT(2,2,"vpc_server_delete_select_all"))}}function pe(r,x){if(1&r&&(e.j41(0,"label",17),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&r){const o=x.$implicit;e.Y8G("nzValue",o.$floatingip.floating_ip_address),e.R7$(),e.Lme("",e.bMT(2,3,"vpc_networks_public_floating_ip")," \u2014 ",o.$floatingip.floating_ip_address)}}function ve(r,x){if(1&r&&(e.j41(0,"nz-checkbox-group",13),e.Z7z(1,pe,3,5,"label",17,W),e.k0s()),2&r){const o=e.XpG(3);e.R7$(),e.Dyx(o.floatingIps)}}function me(r,x){if(1&r&&(e.j41(0,"label",17),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&r){const o=x.$implicit;e.Y8G("nzValue",o.id),e.R7$(),e.Lme("",e.bMT(2,3,"vds_direct_public_ip")," \u2014 ",o.fixed_ips[0].ip_address)}}function he(r,x){if(1&r&&(e.j41(0,"nz-checkbox-group",14),e.Z7z(1,me,3,5,"label",17,W),e.k0s()),2&r){const o=e.XpG(3);e.R7$(),e.Dyx(o.directPublicPorts)}}function ge(r,x){if(1&r&&(e.j41(0,"label",17),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&r){const o=x.$implicit;e.Y8G("nzValue",o.$network.id),e.R7$(),e.Lme("",e.bMT(2,3,"vpc_create_public_subnet_option")," \u2014 ",o.$network.name)}}function fe(r,x){if(1&r&&(e.j41(0,"nz-checkbox-group",15),e.Z7z(1,ge,3,5,"label",17,W),e.k0s()),2&r){const o=e.XpG(3);e.R7$(),e.Dyx(o.publicSubnets)}}function Ce(r,x){1&r&&(e.EFF(0),e.nI1(1,"translate")),2&r&&e.SpI(" ",e.bMT(1,1,"vpc_Volume")," ")}function Ee(r,x){1&r&&(e.nrm(0,"span",20),e.nI1(1,"translateHtml")),2&r&&e.Y8G("innerHTML",e.bMT(1,1,"vpc_server_delete_bootable_volume"),e.npT)}function Se(r,x){if(1&r&&(e.j41(0,"label",17)(1,"div",18)(2,"div",19),e.nVh(3,Ce,2,3)(4,Ee,2,3,"span",20),e.EFF(5),e.k0s(),e.j41(6,"span"),e.EFF(7),e.nI1(8,"translate"),e.k0s()()()),2&r){const o=x.$implicit,b=e.XpG(4);e.Y8G("nzValue",o.id),e.R7$(2),e.Y8G("ngStyle",e.eq3(8,R,b.itemsForAdditionalDeleteCount>4?"330px":b.itemsForAdditionalDeleteCount>3?"356px":"390px")),e.R7$(),e.vxM(o.$isSystem?4:3),e.R7$(2),e.SpI(" \xa0",o.name," "),e.R7$(2),e.Lme("\xa0\u2014\xa0",o.size,"\xa0",e.bMT(8,6,"GB"))}}function Te(r,x){if(1&r&&(e.j41(0,"nz-checkbox-group",16),e.Z7z(1,Se,9,10,"label",17,W),e.k0s()),2&r){const o=e.XpG(3);e.R7$(),e.Dyx(o.orderedVolumes)}}function Re(r,x){if(1&r&&(e.j41(0,"div",10),e.EFF(1),e.nI1(2,"translate"),e.k0s(),e.nVh(3,le,3,4,"label",11),e.j41(4,"div",12),e.nVh(5,ve,3,0,"nz-checkbox-group",13),e.nV
1h(6,he,3,0,"nz-checkbox-group",14),e.nVh(7,fe,3,0,"nz-checkbox-group",15),e.nVh(8,Te,3,0,"nz-checkbox-group",16),e.k0s()),2&r){const o=e.XpG(2);e.R7$(),e.SpI(" ",e.bMT(2,7,"vpc_server_delete_additional_delete")," "),e.R7$(2),e.vxM(o.itemsForAdditionalDeleteCount>=4?3:-1),e.R7$(),e.Y8G("ngClass",e.eq3(9,g,o.itemsForAdditionalDeleteCount>=4)),e.R7$(),e.vxM(o.floatingIps.length?5:-1),e.R7$(),e.vxM(o.directPublicPorts.length&&!o.isVds?6:-1),e.R7$(),e.vxM(o.publicSubnets.length?7:-1),e.R7$(),e.vxM(o.volumes.length?8:-1)}}function De(r,x){1&r&&(e.EFF(0),e.nI1(1,"translate")),2&r&&e.SpI(" ",e.bMT(1,1,"vpc_Required")," ")}function Pe(r,x){1&r&&(e.EFF(0),e.nI1(1,"translate")),2&r&&e.SpI(" ",e.bMT(1,1,"vpc_entity_name_incorrect")," ")}function Me(r,x){if(1&r&&(e.j41(0,"sui-form-validation-message",21),e.nVh(1,De,2,3),e.nVh(2,Pe,2,3),e.k0s()),2&r){const o=x.$implicit;e.Y8G("control",o),e.R7$(),e.vxM(o.errors.required?1:-1),e.R7$(),e.vxM(o.errors.equal?2:-1)}}function Ie(r,x){if(1&r){const o=e.RV6();e.j41(0,"form",4),e.bIt("ngSubmit",function(){d.eBV(o);const S=e.XpG();return d.Njj(S.remove())}),e.DNE(1,K,1,0,"ng-container",5),e.nVh(2,Re,9,11),e.j41(3,"nz-form-item",6)(4,"nz-form-label",7),e.EFF(5),e.nI1(6,"translate"),e.k0s(),e.j41(7,"nz-form-control",8),e.nrm(8,"input",9),e.DNE(9,Me,3,3,"ng-template",null,1,e.C5r),e.k0s()()()}if(2&r){const o=e.sdS(10),b=e.XpG(),S=e.sdS(3);e.Y8G("formGroup",b.form),e.R7$(),e.Y8G("ngTemplateOutlet",S),e.R7$(),e.vxM(b.isHaveItemsForAdditionalDelete?2:-1),e.R7$(3),e.SpI(" ",e.bMT(6,5,"vpc_enter_server_name_to_confirm")," "),e.R7$(2),e.Y8G("nzErrorTip",o)}}function be(r,x){if(1&r&&(e.nrm(0,"div",22),e.nI1(1,"translate")),2&r){const o=e.XpG(3);e.Y8G("innerHTML",e.i5U(1,1,"vds_server_delete_description",e.l_i(4,I,(null==o.server?null:o.server.name)??"",o.directPublicIps??"")),e.npT)}}function Oe(r,x){if(1&r&&(e.nrm(0,"div",22),e.nI1(1,"translateHtml")),2&r){const o=e.XpG(3);e.Y8G("innerHTML",e.i5U(1,1,"vpc_server_deletion_with_local_disk",e.eq3(4,C,o.server.name??"")),e.npT)}}function ye(r,x){if(1&r&&e.nVh(0,be,2,7,"div",22)(1,Oe,2,6,"div",22),2&r){const o=e.XpG(2);e.vxM(o.isVds?0:1)}}function ze(r,x){if(1&r&&(e.nrm(0,"div",22),e.nI1(1,"translate")),2&r){const o=e.XpG(2);e.Y8G("innerHTML",e.i5U(1,1,"vpc_server_will_be_deleted",e.eq3(4,C,o.server.name??"")),e.npT)}}function $e(r,x){if(1&r&&(e.nrm(0,"div",22),e.nI1(1,"translateHtml")),2&r){const o=e.XpG(2);e.Y8G("innerHTML",e.i5U(1,1,"vpc_server_deletion_with_license",e.eq3(4,C,o.server.$image.name??"")),e.npT)}}function Ae(r,x){if(1&r){const o=e.RV6();e.j41(0,"div",23),e.EFF(1),e.nI1(2,"translate"),e.j41(3,"vpc-support-action",24),e.bIt("supportLinkClick",function(){d.eBV(o);const S=e.XpG(2);return d.Njj(S.openTicket())}),e.k0s()()}2&r&&(e.R7$(),e.SpI(" ",e.bMT(2,1,"vpc_server_delete_licenses_error")," "))}function xe(r,x){if(1&r&&(e.nVh(0,ye,2,1)(1,ze,2,6,"div",22),e.nVh(2,$e,2,6,"div",22),e.nVh(3,Ae,4,3,"div",23)),2&r){const o=e.XpG();e.vxM(null!=o.server.$flavor&&o.server.$flavor.disk?0:1),e.R7$(2),e.vxM("windows"===(null==o.server.$image?null:o.server.$image.os_type)&&o.hasWindowsLicenses?2:-1),e.R7$(),e.vxM(o.isError()?3:-1)}}let Le=(()=>{class r extends P.R{constructor(o){super(o),this.$injector=o,this.fb=(0,d.WQX)(f.Qk),this.destroyRef=(0,d.WQX)(d.abz),this.vpcInfoLicensesLoadStateService=(0,d.WQX)(oe.a),this.ticketsFacadeService=(0,d.WQX)(ne.n8),this.portUtilsService=(0,d.WQX)(Z.G),this.modal=(0,d.WQX)(Y.J9),this.modalData=(0,d.WQX)(Y.or),this.projectsService=(0,d.WQX)(se.iX),this.cloudPortsRepository=(0,d.WQX)(V.P),this.server=this.modalData.server,this.image=this.modalData.source,this.isVds=this.modalData.isVds,this.orderedVolumes=(0,z.orderBy)(this.server.$volumes??[],"-$isSystem"),this.volumes=this.server.$volumes??[],this.publicSubnets=this.server.$publicSubnets??[],this.floatingIps=this.server.$floatingIps??[],this.directPublicPorts=(0,z.uniqBy)([...this.cloudPortsRepository.getPorts(),...this.server.$ports??[]],b=>b.id).filter(b=>b.device_id===this.server.id&&this.portUtilsService.isDirectPublicPort(b)),this.directPublicIps=this.directPublicPorts?.map(({fixed_ips:b})=>b[0].ip_address).join(", "),this.isLoading=(0,d.vPA)(!0),this.isError=(0,d.vPA)(!1),this.isPending=(0,d.vPA)(!1),this.isAllIntermediate=(0,d.vPA)(!1),this.hasWindowsLicenses=this.server.$licenses.some(b=>b.type.includes("windows")),this.form=this.fb.group({name:this.fb.control("",[(0,J.E)(),(0,F.R)(this.server.name??"")]),selectAll:this.fb.control(!1),volumes:this.fb.control([]),floatingIps:this.fb.control([]),directIps:this.fb.control(this.isVds?this.directPublicPorts.map(b=>b.id):[]),publicSubnets:this.fb.control([])})}ngOnInit(){const{volumes:o,floatingIps:b,publicSubnets:S,directIps:j,selectAll:w}=this.form.controls;this.countItemsForAdditionalDelete(),(0,U.z)([o.valueChanges.pipe((0,X.Z)(o.value),(0,i.T)(H=>H.length)),b.valueChanges.pipe((0,X.Z)(b.value),(0,i.T)(H=>H.length)),S.valueChanges.pipe((0,X.Z)(S.value),(0,i.T)(H=>H.length)),j.valueChanges.pipe((0,X.Z)(j.value),(0,i.T)(H=>H.length))]).pipe((0,i.T)(([H,dt,pt,vt])=>H+dt+pt+vt),(0,c.pQ)(this.destroyRef)).subscribe(H=>{H===this.itemsForAdditionalDeleteCount&&this.itemsForAdditionalDeleteCount>0?(w.setValue(!0,{emitEvent:!1}),this.isAllIntermediate.set(!1)):0===H?(w.setValue(!1,{emitEvent:!1}),this.isAllIntermediate.set(!1)):(w.setValue(!1,{emitEvent:!1}),this.isAllIntermediate.set(!0))}),w.valueChanges.pipe((0,c.pQ)(this.destroyRef)).subscribe(H=>this.toggleAll(H)),this.loadWindowsLicenses()}toggleAll(o){const{volumes:b,floatingIps:S,publicSubnets:j,directIps:w}=this.form.controls;this.isAllIntermediate.set(!1),b.setValue(o?this.volumes.map(H=>H.id):[]),S.setValue(o?this.floatingIps.map(H=>H.id):[]),j.setValue(o?this.publicSubnets.map(H=>H.id):[]),w.setValue(o?this.directPublicPorts.map(H=>H.id):[])}remove(){const{volumes:o,floatingIps:b,publicSubnets:S,directIps:j,name:w}=this.form.controls;
1if(w.markAsTouched(),w.markAsDirty(),w.updateValueAndValidity(),this.form.invalid)return;this.server.metadata?.x_cloud_server_direct_public_port_id&&j.value.push(this.server.metadata?.x_cloud_server_direct_public_port_id);const H={volumesForDelete:o.value,floatingIpsForDelete:b.value,publicSubnetsForDelete:S.value,directPublicPortsForDelete:(0,z.uniq)(j.value)};this.isPending.set(!0),this.deleteServer(H,this.projectsService.currentId).then(()=>this.modal.close(H)).finally(()=>this.isPending.set(!1))}submit(o){o.stopPropagation(),this.remove()}openTicket(){this.ticketsFacadeService.prefillTicketForm({category:ne.Rm.INFRASTRUCTURE,products:["cloud"],summary:this.translate("vpc_server_delete_licenses_error_ticket")})}countItemsForAdditionalDelete(){this.itemsForAdditionalDeleteCount=this.volumes.length+this.publicSubnets.length+this.floatingIps.length,this.isVds||(this.itemsForAdditionalDeleteCount+=this.directPublicPorts.length),this.isHaveItemsForAdditionalDelete=this.itemsForAdditionalDeleteCount>0}loadWindowsLicenses(){this.image?.$isWindowsOs&&!this.vpcInfoLicensesLoadStateService.isLoaded?this.vpcRepository.callAction("resources:infoLicenses#query",this.server.$region,!0).then(()=>{this.vpcInfoLicensesLoadStateService.isLoaded=!0,this.isLoading.set(!1),this.isError.set(!1)}).catch(()=>{this.vpcInfoLicensesLoadStateService.isLoaded=!1,this.isLoading.set(!1),this.isError.set(!0)}):(this.isLoading.set(!1),this.isError.set(!1))}static{this.\u0275fac=function(b){return new(b||r)(e.rXU("$injector"))}}static{this.\u0275cmp=e.VBU({type:r,selectors:[["ng-component"]],features:[e.Vt3],decls:4,vars:1,consts:[["defaultVersionDesc",""],["nameErrorsRef",""],[3,"nzActive","nzParagraph","nzLoading"],["novalidate","","nz-form","","nzLayout","vertical",3,"formGroup"],["novalidate","","nz-form","","nzLayout","vertical",3,"ngSubmit","formGroup"],[4,"ngTemplateOutlet"],[1,"sui-mrb-0","sui-mrt-m"],[2,"white-space","nowrap"],[3,"nzErrorTip"],["data-testid","dialog_confirm_name_input","id","confirm_name","type","text","formControlName","name","nzSize","default","nz-input",""],[1,"sui-mrb-2xs"],["formControlName","selectAll","nz-checkbox","","data-testid","resource_delete_checkbox_all",1,"sui-mrb-2xs",3,"nzIndeterminate"],[1,"sui-stack-xs",3,"ngClass"],["formControlName","floatingIps"],["formControlName","directIps"],["formControlName","publicSubnets"],["formControlName","volumes"],["nz-checkbox","","data-testid","resource_delete_checkbox",3,"nzValue"],[1,"sui-flex-inline"],[1,"t-wrap",3,"ngStyle"],[3,"innerHTML"],[3,"control"],[1,"sui-mrb-m",3,"innerHTML"],["sui-alert","warning",1,"sui-mrb-m"],[3,"supportLinkClick"]],template:function(b,S){1&b&&(e.nVh(0,G,1,3,"nz-skeleton",2)(1,Ie,11,7,"form",3),e.DNE(2,xe,4,3,"ng-template",null,0,e.C5r)),2&b&&e.vxM(S.isLoading()?0:1)},dependencies:[f.X1,f.qT,f.me,f.BC,f.cb,f.j4,f.JD,s.YU,s.B3,k.Hj,ie.$g,ie.Ov,A.uY,te.Sy,B.Cn,q.Uq,q.e,a.CA,a.Ls,a.Mo,a.zS,B.s6,B.v8,Q.tJ,ee.vW,p.Bi,M.l,re.C,s.T3,l.D,E.a],styles:[".border-block[_ngcontent-%COMP%] {\n      height: 175px;\n      overflow-y: auto;\n    }"],changeDetection:0})}}return r})();var ae=t(36341),Ve=t(570),Ge=t(85219),Ue=t(63616);const ke=(r,x)=>({target:r,image:x}),ue=r=>({id:r});function je(r,x){if(1&r&&(e.j41(0,"div",5)(1,"div",6),e.EFF(2),e.nI1(3,"translate"),e.k0s(),e.j41(4,"div",7),e.EFF(5),e.k0s(),e.nrm(6,"sui-copy",8),e.k0s()),2&r){const o=e.XpG(2);e.R7$(2),e.SpI(" ",e.bMT(3,3,"vpc_New password"),": "),e.R7$(3),e.SpI(" ",o.newPassword," "),e.R7$(),e.Y8G("suiCopyContent",o.newPassword)}}function Ne(r,x){1&r&&(e.EFF(0),e.nI1(1,"translate")),2&r&&e.SpI(" ",e.bMT(1,1,"vpc_Required")," ")}function Fe(r,x){1&r&&(e.EFF(0),e.nI1(1,"translate")),2&r&&e.SpI(" ",e.bMT(1,1,"vpc_entity_name_incorrect")," ")}function Be(r,x){if(1&r&&(e.j41(0,"sui-form-validation-message",12),e.nVh(1,Ne,2,3),e.nVh(2,Fe,2,3),e.k0s()),2&r){const o=x.$implicit;e.Y8G("control",o),e.R7$(),e.vxM(o.errors.required?1:-1),e.R7$(),e.vxM(o.errors.equal?2:-1)}}function We(r,x){if(1&r&&(e.j41(0,"nz-form-item")(1,"nz-form-label",9),e.EFF(2),e.nI1(3,"translate"),e.k0s(),e.j41(4,"nz-form-control",10),e.nrm(5,"input",11),e.DNE(6,Be,3,3,"ng-template",null,0,e.C5r),e.k0s()()),2&r){const o=e.sdS(7),b=e.XpG(2);e.R7$(2),e.SpI(" ",e.bMT(3,3,"vpc_Please enter the object name to confirm")," "),e.R7$(2),e.Y8G("nzErrorTip",o),e.R7$(),e.Y8G("formControl",b.nameControl)}}function Xe(r,x){if(1&r){const o=e.RV6();e.j41(0,"form",3),e.bIt("ngSubmit",function(){d.eBV(o);const S=e.XpG();return d.Njj(S.rebuild())}
1),e.nrm(1,"div",4),e.nI1(2,"translateHtml"),e.nVh(3,je,7,5,"div",5),e.nVh(4,We,8,5,"nz-form-item"),e.k0s()}if(2&r){let o,b,S;const j=e.XpG();e.Y8G("formGroup",j.form),e.R7$(),e.Y8G("innerHTML",e.i5U(2,4,"vpc_server_dialog_rebuild_description",e.l_i(7,ke,(null==(o=j.server())?null:o.name)??"",(null==(o=j.image())?null:o.name)??"")),e.npT),e.R7$(2),e.vxM(null!=(b=j.image())&&b.$passwordDisabled?-1:3),e.R7$(),e.vxM(null!=(S=j.server())&&S.name?4:-1)}}function He(r,x){1&r&&(e.nrm(0,"a",15),e.nI1(1,"panelKbHref"),e.nI1(2,"translate")),2&r&&e.Y8G("href",e.bMT(1,2,"cloud-servers/manage/change-server-configuration"),e.B4B)("innerHTML",e.bMT(2,4,"vpc_server_dialog_rebuild_unavailable_flavor_desc_link"),e.npT)}function Ke(r,x){1&r&&(e.nrm(0,"span",13),e.nI1(1,"translate")),2&r&&e.Y8G("innerHTML",e.bMT(1,1,"vpc_server_dialog_rebuild_unavailable_flavor_desc_link"),e.npT)}function Ye(r,x){if(1&r&&(e.nrm(0,"div",14),e.nI1(1,"translateHtml"),e.j41(2,"div")(3,"span"),e.EFF(4),e.nI1(5,"translate"),e.k0s(),e.nVh(6,He,3,6,"a",15)(7,Ke,2,3,"span",13),e.nrm(8,"span",13),e.nI1(9,"translate"),e.k0s()),2&r){let o;const b=e.XpG(2);e.Y8G("innerHTML",e.i5U(1,4,"vpc_server_dialog_rebuild_unavailable_flavor",e.eq3(11,ue,null==(o=b.server())?null:o.id)),e.npT),e.R7$(4),e.JRh(e.bMT(5,7,"vpc_server_dialog_rebuild_unavailable_flavor_desc_begin")),e.R7$(2),e.vxM(b.IS_INTERNAL?6:7),e.R7$(2),e.Y8G("innerHTML",e.bMT(9,9,"vpc_server_dialog_rebuild_unavailable_flavor_desc_end"),e.npT)}}function we(r,x){1&r&&(e.nrm(0,"div",13),e.nI1(1,"translateHtml")),2&r&&e.Y8G("innerHTML",e.bMT(1,1,"vpc_server_dialog_rebuild_not_found_image"),e.npT)}function Qe(r,x){if(1&r&&(e.nrm(0,"div",13),e.nI1(1,"translateHtml")),2&r){let o;const b=e.XpG(2);e.Y8G("innerHTML",e.i5U(1,1,"vpc_server_dialog_rebuild_no_system_volume",e.eq3(4,ue,null==(o=b.server())?null:o.id)),e.npT)}}function Ze(r,x){if(1&r&&(e.j41(0,"div",2),e.nVh(1,Ye,10,13)(2,we,2,3,"div",13)(3,Qe,2,6,"div",13),e.k0s()),2&r){const o=e.XpG();e.R7$(),e.vxM(o.isFlavorAvailable()?o.isExistSystemVolume()?2:3:1)}}let Je=(()=>{class r{constructor(){this.modal=(0,d.WQX)(Y.J9),this.fb=(0,d.WQX)(f.Qk),this.server=(0,ae.hFB)(),this.image=(0,ae.hFB)(),this.isExistOriginalImage=(0,ae.hFB)(!1),this.isExistSystemVolume=(0,ae.hFB)(!1),this.isFlavorAvailable=(0,ae.hFB)(!1),this.IS_INTERNAL=v.ENTRY.INTERNAL,this.form=this.fb.group({name:this.fb.control("")}),this.newPassword=(0,Ge.A)()}get nameControl(){return this.form.controls.name}ngOnInit(){this.nameControl.setValidators([(0,J.E)(),(0,F.R)(this.server()?.name??"")]),this.nameControl.updateValueAndValidity()}rebuild(){this.nameControl.markAsUntouched(),this.nameControl.markAsDirty(),this.nameControl.updateValueAndValidity(),!this.form.invalid&&this.modal.destroy({newPassword:this.newPassword,image:this.image()})}static{this.\u0275fac=function(b){return new(b||r)}}static{this.\u0275cmp=e.VBU({type:r,selectors:[["ng-component"]],inputs:{server:[1,"server"],image:[1,"image"],isExistOriginalImage:[1,"isExistOriginalImage"],isExistSystemVolume:[1,"isExistSystemVolume"],isFlavorAvailable:[1,"isFlavorAvailable"]},decls:2,vars:1,consts:[["nameErrorsRef",""],["nz-form","","nzLayout","vertical",3,"formGroup"],["ng-switch-when","false"],["nz-form","","nzLayout","vertical",3,"ngSubmit","formGroup"],["data-testid","confirm_modal_content",1,"l-mb-l",3,"innerHTML"],["nz-flex","","layout-align","start center",1,"l-mtb-l"],["data-testid","rebuild_dialog_password",1,"l-mr-l"],["data-testid","rebuild_dialog_password_value",1,"l-mr-xxs","ym-hide-content","ph-no-capture"],[3,"suiCopyContent"],[2,"white-space","nowrap"],[3,"nzErrorTip"],["data-testid","dialog_confirm_name_input","id","confirm_name","type","text","nzSize","default","nz-input","",3,"formControl"],[3,"control"],[3,"innerHTML"],[1,"sui-mrb-s",3,"innerHTML"],["target","_blank",3,"href","innerHTML"]],template:function(b,S){1&b&&e.nVh(0,Xe,5,10,"form",1)(1,Ze,4,1,"div",2),2&b&&e.vxM(S.isExistOriginalImage()&&S.isFlavorAvailable()?0:1)},dependencies:[f.X1,f.qT,f.me,f.BC,f.cb,f.l_,f.j4,k.Hj,A.uY,te.Sy,M.l,B.Cn,q.Uq,q.e,a.CA,a.Ls,a.Mo,a.zS,B.s6,B.v8,m.tO,m.AB,Q.tJ,Ue.B,Ve.pM,l.D,E.a],encapsulation:2,changeDetection:0})}}return r})();var qe=t(54684),ce=t(44296),_e=t(76998),et=t(29508),tt=t(14501),nt=t(21689),st=t(68926),de=t(71686);function it(r,x){if(1&r){const o=e.RV6();e.j41(0,"li",25),e.bIt("click",function(){d.eBV(o);const S=e.XpG();return d.Njj(S.editTags(S.isPage?"server_page_menu":"server_list"))}),e.nrm(1,"span",26),e.EFF(2),e.nI1(3,"translate"),e.k0s()}if(2&r){const o=e.XpG();e.Y8G("nzDisabled",o.isActionDisabled("editTags")||o.IS_READER),e.R7$(2),e.SpI(" ",e.bMT(3,2,o.server.$hasNonSystemTags?"vpc_edit_tags":"vpc_add_tags")," ")}}function rt(r,x){if(1&r){const o=e.RV6();e.j41(0,"li",27),e.bIt("click",function(){d.eBV(o);const S=e.XpG();return d.Njj(S.togglePower(S.isPage?"server_page_menu":"server_list",S.isLiteVersion))}),e.nrm(1,"span",28),e.EFF(2),e.nI1(3,"translate"),e.k0s()}if(2&r){const o=e.XpG();e.Y8G("nzDisabled",o.isPowerDisabled||o.IS_READER),e.R7$(2),e.SpI(" ",e.bMT(3,2,o.server.$isActive?"vpc_Turn_off_server":"vpc_Turn_on_server")," ")}}function ot(r,x){if(1&r){const o=e.RV6();e.j41(0,"li",29),e.bIt("click",function(){d.eBV(o);const S=e.XpG();return d.Njj(S.togglePause(S.isPage?"server_page_menu":"server_list"))}),e.nrm(1,"span",30),e.EFF(2),e.nI1(3,"translate"),e.k0s()}if(2&r){const o=e.XpG();e.Y8G("nzDisabled",o.isPauseDisabled||o.IS_READER),e.R7$(2),e.SpI(" ",e.bMT(3,2,"vpc_Unpause")," ")}}function at(r,x){if(1&r){const o=e.RV6();e.j41(0,"li",31),e.bIt("click",function(){d.eBV(o);const S=e.XpG();return d.Njj(S.toggleUnshelve(S.isPage?"server_page_menu":"server_list"))}),e.nrm(1,"span",30),e.EFF(2),e.nI1(3,"translate"),e.k0s()}if(2&r){const o=e.XpG();e.Y8G("nzDisabled",o.isUnshelveDisabled||o.IS_READER),e.R7$(2),e.SpI(" ",e.bMT(3,2,"vpc_unshelve")," ")}}function lt(r,x){if(1&r){const o=e.RV6();e.j41(0,"li",32),e.bIt("click",function(){d.eBV(o);const S=e.XpG();return d.Njj(S.toggleUnshelve(S.isPage?"server_page_menu":"server_list"))}),e.nrm(1,"span",30),e.EFF(2),e.nI1(3,"translate"),e.k0s()}if(2&r){const o=e.XpG();e.Y8G("nzDisabled",o.isUnshelveDisabled||o.IS_READER),e.R7$(2),e.SpI(" ",e.bMT(3,2,"vpc_unshelve")," ")}}function ct(r,x){if(1&r){const o=e.RV6();e.j41(0,"li",33),e.bIt("click",function(){d.eBV(o);const S=e.XpG();return d.Njj(S.toggleShelve(S.isPage?"server_page_menu":"server_list"))}),e.nrm(1,"span",34),e.EFF(2),e.nI1(3,"translate"),e.k0s()}if(2&r){const o=e.XpG();e.Y8G("nzDisabled",o.isShelveDisabled||o.IS_READER),e.R7$(2),e.SpI(" ",e.bMT(3,2,"vpc_freeze")," ")}}function _t(r,x){if(1&r){const o=e.RV6();e.j41(0,"li",35),e.bIt("click",function(){d.eBV(o);const S=e.XpG();return d.Njj(S.runAction("createImage",S.isPage?"server_page":"server_list"))}),e.nrm(1,"span",36),e.EFF(2),e.nI1(3,"translate"),e.k0s()}if(2&r){const o=e.XpG();e.Y8G("nzDisabled",o.isActionDisabled("createImage")||o.IS_READER),e.R7$(2),e.SpI(" ",e.bMT(3,2,"vpc_create_local_disk_image")," ")}}let ut=(()=>{class r extends P.R{openDeleteServerDialog(){this.server.$isCluster?this.openActionWithClusterModal("delete"):this.suiModalService.create({nzTitle:this.translate("vpc_server_deletion"),nzContent:Le,primaryButton:{label:this.translate("vpc_Delete"),onClick:b=>b?.remove(),loading:b=>!!b?.isPending(),disabled:b=>!!b?.isPending()},secondaryButton:{label:this.translate("Cancel"),onClick:b=>b?.modal.close(),disabled:b=>!!b?.isPending()},nzData:{server:this.server,source:this.source,isVds:this.isLiteVersion},size:y._O.medium,nzMaskClosable:!1,nzCentered:!0}).afterClose.pipe((0,h.s)(1),(0,n.p)(Boolean),(0,$.M)(b=>{this.isLiteVersion?this.vdsAnalyticsService.triggerDelete({event_place:this.isPage?"vds_server_page":"vds_server_list",zone:this.server.$zone,config_type:`fix_${this.server.$flavor?.extra_specs?.metric_name??""}`,living_time:this.calculateLivingTime(),id_server:this.server.id,server_status:this.server.status}):this.sendDeleteEvent(this.isPage?"server_page_menu":"server_list",b.floatingIpsForDelete,b.publicSubnetsForDelete,b.volumesForDelete)}),(0,c.pQ)(this.destroyRef)).subscribe()}openRebuildServerDialog(){this.server.$isCluster?this.openActionWithClusterModal("rebuild"):this.$q.all([this.loadOriginalImageData(),this.vpcRepository.callAction("resources:flavors#query",!0,this.server.$region)]).then(([o,b])=>{const S=b.some(w=>w.availability_zones.includes(this.server.$zone)&&w.name===this.server.flavor.original_name),j=this.suiModalService.create({nzTitle:this.translate(o.isExistOriginalImage&&S?"vpc_Rebuild_server_title":"vpc_Rebuild_server_title_impossible"),nzContent:Je,...o.isExistOriginalImage&&S?{primaryButton:{label:this.translate("vpc_Rebuild"),onClick:w=>w?.rebuild()}}:{},secondaryButton:{label:this.translate(o.isExistOriginalImage&&S?"Cancel":"vpc_close"),onClick:w=>w?.modal.destroy()},size:y._O.medium,nzMaskClosable:!1});j.componentRef?.setInput("server",this.server),j.componentRef?.setInput("image",o.image),j.c
1omponentRef?.setInput("isExistOriginalImage",o.isExistOriginalImage),j.componentRef?.setInput("isExistSystemVolume",o.isExistSystemVolume),j.componentRef?.setInput("isFlavorAvailable",S),j.afterClose.pipe((0,h.s)(1),(0,n.p)(Boolean)).subscribe(w=>this.rebuildServer(w,this.isPage?"server_page_menu":"server_list"))})}constructor(o){super(o),this.$injector=o,this.serverShelvingService=(0,d.WQX)(qe.u),this.suiModalService=(0,d.WQX)(y.iE),this.destroyRef=(0,d.WQX)(d.abz),this.vdsAnalyticsService=(0,d.WQX)(T.f),this.isPage=!1,this.isLiteVersion=!1,this.renameServer=new d.bkB,this.IS_INTERNAL=v.ENTRY.INTERNAL,this.IS_READER=(0,d.WQX)(_.Y).isReader,this.isShelvingDisabledForExternal=this.serverShelvingService.isShelvingDisabledForExternal}static{this.\u0275fac=function(b){return new(b||r)(e.rXU("$injector"))}}static{this.\u0275cmp=e.VBU({type:r,selectors:[["vpc-server-menu"]],inputs:{server:"server",isPage:"isPage",isLiteVersion:"isLiteVersion"},outputs:{renameServer:"renameServer"},features:[e.Vt3],decls:43,vars:45,consts:[["dropdownMenu","nzDropdownMenu"],["type","button","nz-button","","nz-dropdown","","nzTrigger","click","nzPlacement","bottomRight","suiDropdownBtn","","data-testid","server_actions_dropdown",3,"nzType","nzDropdownMenu"],["nz-icon","","nzType","sui:kebab-menu"],["nz-menu","","data-testid","server_actions_dropdown_content"],["nz-menu-item","","data-testid","copy_uuid_option"],[3,"suiCopyCopied","suiCopyContent","suiCopyLabels"],["nz-menu-item","","data-testid","rename_option",3,"click","nzDisabled"],["nz-icon","","nzType","sui:edit","suiSize","s",1,"sui-icon-text"],["nz-menu-item","","data-testid","edit_tags_option",3,"nzDisabled"],["nz-menu-item","","data-testid","power_option",3,"nzDisabled"],["nz-menu-item","","data-testid","pause_option",3,"nzDisabled"],["nz-menu-item","","data-testid","freeze_option",3,"nzDisabled"],["nz-menu-item","","data-testid","resume_option",3,"nzDisabled"],["nz-menu-item","","data-testid","shelve_option",3,"nzDisabled"],["nz-menu-item","","data-testid","soft_reboot_option",3,"click","title","nzDisabled"],["nz-icon","","nzType","sui:arrow-clockwise","suiSize","s",1,"sui-icon-text"],["nz-menu-item","","data-testid","hard_reboot_option",3,"click","title","nzDisabled"],["nz-icon","","nzType","sui:arrows-clockwise","suiSize","s",1,"sui-icon-text"],["nz-menu-item","","data-testid","create_local_disk_image_option",3,"nzDisabled"],["nz-menu-divider",""],["nz-menu-item","","data-testid","rescue_option",3,"click","nzDisabled"],["nz-icon","","nzType","sui:tool","suiSize","s",1,"sui-icon-text"],["nz-menu-item","","data-testid","rebuild_option",3,"click","nzDisabled"],["nz-menu-item","","data-testid","delete_option",3,"click","nzDisabled"],["nz-icon","","nzType","sui:trash","suiSize","s",1,"sui-icon-text"],["nz-menu-item","","data-testid","edit_tags_option",3,"click","nzDisabled"],["nz-icon","","nzType","sui:multi-tag","suiSize","s",1,"sui-icon-text"],["nz-menu-item","","data-testid","power_option",3,"click","nzDisabled"],["nz-icon","","nzType","sui:power","suiSize","s",1,"sui-icon-text"],["nz-menu-item","","data-testid","pause_option",3,"click","nzDisabled"],["nz-icon","","nzType","sui:pause-circle","suiSize","s",1,"sui-icon-text"],["nz-menu-item","","data-testid","freeze_option",3,"click","nzDisabled"],["nz-menu-item","","data-testid","resume_option",3,"click","nzDisabled"],["nz-menu-item","","data-testid","shelve_option",3,"click","nzDisabled"],["nz-icon","","nzType","sui:snowflake","suiSize","s",1,"sui-icon-text"],["nz-menu-item","","data-testid","create_local_disk_image_option",3,"click","nzDisabled"],["nz-icon","","nzType","sui:disk","suiSize","s",1,"sui-icon-text"]],template:function(b,S){if(1&b&&(e.j41(0,"button",1),e.nrm(1,"span",2),e.k0s(),e.j41(2,"nz-dropdown-menu",null,0)(4,"ul",3)(5,"li",4)(6,"sui-copy-menu-button",5),e.nI1(7,"translate"),e.bIt("suiCopyCopied",function(){return S.sendAnalytics("copyUUID",S.isPage?"server_page_menu":"server_list",S.isLiteVersion)}),e.k0s()(),e.j41(8,"li",6),e.bIt("click",function(){return S.renameServer.emit()}),e.nrm(9,"span",7),e.EFF(10),e.nI1(11,"translate"),e.k0s(),e.nVh(12,it,4,4,"li",8),e.nVh(13,rt,4,4,"li",9),e.nVh(14,ot,4,4,"li",10),e.nVh(15,at,4,4,"li",11),e.nVh(16,lt,4,4,"li",12),e.nVh(17,ct,4,4,"li",13),e.j41(18,"li",14),e.nI1(19,"translate"),e.bIt("click",function(){return S.runAction("softReboot",S.isPage?"server_page":"server_list")}),e.nrm(20,"span",15),e.EFF(21),e.nI1(22,"translate"),e.k0s(),e.j41(23,"li",16),e.nI1(24,"translate"),e.bIt("click",function(){return S.runAction("hardReboot",S.isPage?"server_page":"server_list")}),e.nrm(25,"span",17),e.EFF(26),e.nI1(27,"translate"),e.k0s(),e.nVh(28,_t,4,4,"li",18),e.nrm(29,"li",19),e.j41(30,"li",20),e.bIt("click",function(){return S.toggleRescue(S.isPage?"server_page_menu":"server_list")}),e.nrm(31,"span",21),e.EFF(32),e.nI1(33,"translate"),e.k0s(),e.nrm(34,"li",19),e.j41(35,"li",22),e.bIt("click",function(){return S.openRebuildServerDialog()}),e.nrm(36,"span",17),e.EFF(37),e.nI1(38,"translate"),e.k0s(),e.j41(39,"li",23),e.bIt("click",function(){return S.openDeleteServerDialog()}),e.nrm(40,"span",24),e.EFF(41),e.nI1(42,"translate"),e.k0s()()()),2&b){const j=e.sdS(3);e.AVh("old-styles",S.isPage),e.Y8G("nzType",S.isPage?"default":"text")("nzDropdownMenu",j),e.R7$(6),e.Y8G("suiCopyContent",S.server.id)("suiCopyLabels",e.bMT(7,27,"vpc_Copy_UUID")),e.R7$(2),e.Y8G("nzDisabled",S.isActionDisabled("rename")||S.IS_READER),e.R7$(2),e.SpI(" ",e.bMT(11,29,"vpc_Rename_server")," "),e.R7$(2),e.vxM(S.isLiteVersion?-1:12),e.R7$(),e.vxM(S.server.$isShelved||S.server.$isPaused?-1:13),e.R7$(),e.vxM(S.server.$isPaused?14:-1),e.R7$(),e.vxM(S.server.$isShelvedPreemptible?15:-1),e.R7$(),e.vxM(!S.server.$isShelved||S.server.$isPreemptible||!S.IS_INTERNAL&&S.isShelvingDisabledForExter
1nal?-1:16),e.R7$(),e.vxM(S.server.$isShelved||S.isUseLocalDisk||S.isLiteVersion||!S.IS_INTERNAL&&S.isShelvingDisabledForExternal?-1:17),e.R7$(),e.Y8G("title",e.bMT(19,31,"vpc_Software reboot"))("nzDisabled",S.isActionDisabled("softReboot")||S.IS_READER),e.R7$(3),e.SpI(" ",e.bMT(22,33,"vpc_Software reboot")," "),e.R7$(2),e.Y8G("title",e.bMT(24,35,"vpc_Send ACPI power off event to the server"))("nzDisabled",S.isActionDisabled("hardReboot")||S.IS_READER),e.R7$(3),e.SpI(" ",e.bMT(27,37,"vpc_Hard reboot")," "),e.R7$(2),e.vxM(S.isUseLocalDisk&&!S.isLiteVersion?28:-1),e.R7$(2),e.Y8G("nzDisabled",S.isRescueDisabled||S.IS_READER),e.R7$(2),e.SpI(" ",e.bMT(33,39,S.server.$isRescue?"vpc_Exit Rescue":"vpc_Rescue")," "),e.R7$(3),e.Y8G("nzDisabled",S.isActionDisabled("rebuild")||S.IS_READER),e.R7$(2),e.SpI(" ",e.bMT(38,41,"vpc_Rebuild server")," "),e.R7$(2),e.Y8G("nzDisabled",S.isActionDisabled("delete")||S.IS_READER),e.R7$(2),e.SpI(" ",e.bMT(42,43,"vpc_Delete server")," ")}},dependencies:[O.tC,ce.jS,ce.CU,ce.sD,_e.j3,_e.wQ,_e.h4,O.rz,O.HL,O.T3,O.zT,D.t_t,et.Dn,D.fz$,u.cX,tt.a,nt.c,st.p,de.ou,de.Xv,m.$d,M.l,l.D],styles:[".old-styles[_ngcontent-%COMP%] {\n  width: 36px;\n  height: 36px;\n}"],changeDetection:0})}}return r})()},74517(N,L,t){t.d(L,{T:()=>i});var d=t(82468),c=t(82525),v=t(3412),M=t(7086),u=t(75469),m=t(68405),O=t(56882),D=t(11610),y=t(42511),_=t(84210),T=t(98704),h=t(25484),n=t(84487),$=t(71428),P=t(78080);const s=(k,Q,B)=>["/","vpc",k,"mks",Q,B];function f(k,Q){if(1&k){const B=n.RV6();n.j41(0,"a",5),n.nI1(1,"translateHtml"),n.bIt("click",function(){v.eBV(B);const Y=n.XpG(2);return v.Njj(Y.modalRef.close())}),n.k0s()}2&k&&n.Y8G("href",Q,n.B4B)("innerHtml",n.bMT(1,2,"vpc_server_dialog_node_group2"),n.npT)}function z(k,Q){1&k&&n.nrm(0,"nz-skeleton",4),2&k&&n.Y8G("nzLoading",!0)("nzActive",!0)}function U(k,Q){if(1&k&&(n.nrm(0,"span",0),n.nI1(1,"translateHtml"),n.nVh(2,f,2,4,"a",3),n.nI1(3,"async"),n.vZN(4,z,1,2,"nz-skeleton",4),n.nrm(5,"span",0),n.nI1(6,"translateHtml")),2&k){let B;const A=n.XpG();n.Y8G("innerHtml",n.bMT(1,3,"vpc_server_dialog_node_group1"),n.npT),n.R7$(2),n.vxM((B=n.bMT(3,5,A.nodeGroupLink$))?2:4,B),n.R7$(3),n.Y8G("innerHtml",n.bMT(6,7,"vpc_server_dialog_node_group3"),n.npT)}}function X(k,Q){1&k&&(n.nrm(0,"span",0),n.nI1(1,"translateHtml"),n.nrm(2,"span",0),n.nI1(3,"translateHtml"),n.nrm(4,"span",0),n.nI1(5,"translateHtml")),2&k&&(n.Y8G("innerHtml",n.bMT(1,3,"vpc_server_dialog_node_group1"),n.npT),n.R7$(2),n.Y8G("innerHtml",n.bMT(3,5,"vpc_server_dialog_node_group2"),n.npT),n.R7$(2),n.Y8G("innerHtml",n.bMT(5,7,"vpc_server_dialog_node_group3"),n.npT))}let i=(()=>{class k{constructor(){this.modalData=(0,v.WQX)(y.or),this.cluster=this.modalData.cluster,this.projectsService=(0,v.WQX)(D.iX),this.currentProjectId=this.projectsService.currentId,this.serverId=this.modalData.serverId,this.router=(0,v.WQX)(M.Ix),this.modalRef=(0,v.WQX)(y.J9),this.location=(0,v.WQX)(d.aZ),this.ENTRY=m.ENTRY,this.mksApiService=(0,v.WQX)(h.P),this.nodeGroupLink$=this.mksApiService.getNodegroups(this.cluster.id,this.cluster.region).pipe((0,T.T)(({nodegroups:B})=>{const A=B.find(ee=>ee.nodes.some(V=>V.provider_server_id===this.serverId));return A?(ee=>this.location.prepareExternalUrl(this.router.serializeUrl(this.router.createUrlTree(["/vpc",this.currentProjectId,"mks",this.cluster.region,this.cluster.id],{queryParams:{search:ee}}))))(A.id):null}))}static{this.\u0275fac=function(A){return new(A||k)}}static{this.\u0275cmp=n.VBU({type:k,selectors:[["vpc-mks-node-action"]],decls:10,vars:13,consts:[[3,"innerHtml"],["target","_blank",3,"routerLink"],[1,"sui-mrt-s"],[3,"href","innerHtml"],["suiSkeletonInline","157px",3,"nzLoading","nzActive"],[3,"click","href","innerHtml"]],template:function(A,Y){1&A&&(n.j41(0,"span"),n.nrm(1,"span",0),n.nI1(2,"translateHtml"),n.j41(3,"a",1),n.EFF(4),n.k0s(),n.nrm(5,"span",0),n.nI1(6,"translateHtml"),n.k0s(),n.j41(7,"div",2),n.nVh(8,U,7,9)(9,X,6,9),n.k0s()),2&A&&(n.R7$(),n.Y8G("innerHtml",n.bMT(2,5,"vpc_server_dialog_mks_node"),n.npT),n.R7$(2),n.Y8G("routerLink",n.sMw(9,s,Y.currentProjectId,Y.cluster.region,Y.cluster.id)),n.R7$(),n.Sp
1I(" ",Y.cluster.name," "),n.R7$(),n.Y8G("innerHtml",n.bMT(6,7,"vpc_server_dialog_mks_node2"),n.npT),n.R7$(3),n.vxM(Y.ENTRY.EXTERNAL?9:8))},dependencies:[c.MD,O.l,u.Wk,_.vW,$.Bi,_.z6,c.Jj,P.a],encapsulation:2,changeDetection:0})}}return k})()},2777(N,L,t){t.d(L,{A:()=>g});var d=t(82525),c=t(36341),v=t(3412),M=t(1749),u=t(41269),m=t(57083),O=t(56882),D=t(42143),y=t(33200),_=t(71686),T=t(13258),h=t(37123),n=t(49408),$=t(38610),P=t(74055),s=t(56453),f=t(78779),z=t(85542),X=t(79967),i=t(84487),k=t(18903),Q=t(22536),B=t(29508),A=t(14501),Y=t(21689),ee=t(68926),V=t(19781),Z=t(63616),F=t(12576);const J=R=>[R,0],se=()=>({standalone:!0});function ne(R,I){if(1&R){const C=i.RV6();i.j41(0,"nz-tag",8),i.nI1(1,"translate"),i.bIt("click",function(){v.eBV(C);const G=i.XpG(3);return v.Njj(G.findServersWithTag("preemptible"))}),i.EFF(2),i.nI1(3,"translate"),i.k0s()}2&R&&(i.Y8G("suiTagSize","s")("nzPopoverContent",i.bMT(1,3,"vpc_find_servers_with_tag")),i.R7$(2),i.SpI(" ",i.bMT(3,5,"server_preemptible")," "))}function re(R,I){if(1&R){const C=i.RV6();i.j41(0,"nz-tag",8),i.nI1(1,"translate"),i.bIt("click",function(){const G=v.eBV(C).$implicit,K=i.XpG(3);return v.Njj(K.findServersWithTag(G))}),i.j41(2,"span",9),i.EFF(3),i.k0s()()}if(2&R){const C=I.$implicit;i.Y8G("suiTagSize","s")("nzPopoverContent",i.bMT(1,7,"vpc_find_servers_with_tag")),i.R7$(2),i.BMQ("data-testid",i.VkB("server_tag_",C)),i.Y8G("title",i.mNQ(C.length>30?C:"")),i.R7$(),i.SpI(" ",C.length>30?C.substring(0,30)+"...":C," ")}}function oe(R,I){if(1&R&&(i.j41(0,"div",4),i.nVh(1,ne,4,7,"nz-tag",7),i.Z7z(2,re,4,9,"nz-tag",7,i.fX1),i.nI1(4,"slice"),i.k0s()),2&R){const C=i.XpG(2);i.Y8G("nzGap",8)("nzAlign","center")("nzWrap","wrap"),i.R7$(),i.vxM(C.server.$isPreemptible?1:-1),i.R7$(),i.Dyx(i.brH(4,4,C.tags,0,C.tags.length-C.hiddenTagsCount()))}}function e(R,I){if(1&R){const C=i.RV6();i.j41(0,"div",10),i.nI1(1,"translate"),i.nI1(2,"translate"),i.bIt("click",function(){v.eBV(C);const G=i.XpG(2);return v.Njj(G.isOpen.set(!G.isOpen()))}),i.j41(3,"span"),i.EFF(4),i.k0s(),i.nrm(5,"span",11),i.k0s()}if(2&R){const C=i.XpG(2);i.Y8G("nzPopoverContent",C.isOpen()?i.bMT(1,3,"vpc_hide_tags"):i.bMT(2,5,"vpc_show_tags")),i.R7$(4),i.SpI("+",C.hiddenTagsCount()),i.R7$(),i.Y8G("nzType",C.isOpen()?"sui:chevron-up":"sui:chevron-down")}}function ie(R,I){if(1&R){const C=i.RV6();i.j41(0,"button",14),i.bIt("click",function(){v.eBV(C);const G=i.XpG(3);return v.Njj(G.edit())}),i.EFF(1),i.nI1(2,"translate"),i.k0s()}if(2&R){const C=i.XpG(3);i.Y8G("suiSize","small")("disabled",C.isActionDisabled("editTags")),i.R7$(),i.SpI(" ",i.bMT(2,3,"vpc_add_tags")," ")}}function te(R,I){if(1&R){const C=i.RV6();
1i.j41(0,"button",13)(1,"span",15),i.nI1(2,"translate"),i.bIt("click",function(){v.eBV(C);const G=i.XpG(3);return v.Njj(G.edit())}),i.k0s()()}if(2&R){const C=i.XpG(3);i.Y8G("suiServiceButtonSize","small")("disabled",C.isActionDisabled("editTags")),i.R7$(),i.Y8G("nzPopoverContent",i.bMT(2,3,"vpc_edit_tags"))}}function q(R,I){if(1&R&&i.nVh(0,ie,3,5,"button",12)(1,te,3,5,"button",13),2&R){const C=i.XpG(2);i.vxM(C.server.$hasNonSystemTags?1:0)}}function a(R,I){if(1&R&&(i.j41(0,"div",1),i.nVh(1,oe,5,8,"div",4),i.j41(2,"div",5),i.nVh(3,e,6,7,"div",6),i.nVh(4,q,2,1),i.k0s()()),2&R){const C=i.XpG();i.R7$(),i.vxM(C.server.$isPreemptible||C.tags.length?1:-1),i.R7$(2),i.vxM(C.hiddenTagsCount()>0?3:-1),i.R7$(),i.vxM(C.isServerPage?4:-1)}}function p(R,I){if(1&R){const C=i.RV6();i.j41(0,"nz-tag",17),i.nI1(1,"translate"),i.bIt("click",function(){const G=v.eBV(C).$implicit,K=i.XpG(2);return v.Njj(K.findServersWithTag(G))}),i.j41(2,"span",9),i.EFF(3),i.k0s()()}if(2&R){const C=I.$implicit;i.Y8G("suiTagSize","s")("nzPopoverContent",i.bMT(1,5,"vpc_find_servers_with_tag")),i.R7$(2),i.Y8G("title",i.mNQ(C.length>30?C:"")),i.R7$(),i.SpI(" ",C.length>30?C.substring(0,30)+"...":C," ")}}function l(R,I){if(1&R&&(i.DNE(0,p,4,7,"nz-tag",16),i.nI1(1,"slice")),2&R){const C=i.XpG();i.Y8G("ngForOf",i.i5U(1,1,C.tags,-1*C.hiddenTagsCount()))}}function E(R,I){if(1&R){const C=i.RV6();i.j41(0,"div",3)(1,"div",18)(2,"div",19)(3,"tags-control",20),i.mxI("ngModelChange",function(G){v.eBV(C);const K=i.XpG();return i.DH7(K.tags,G)||(K.tags=G),v.Njj(G)}),i.k0s(),i.j41(4,"div",21)(5,"button",22),i.bIt("click",function(){v.eBV(C);const G=i.XpG();return v.Njj(G.save())}),i.nrm(6,"span",23),i.k0s(),i.j41(7,"button",24),i.bIt("click",function(){v.eBV(C);const G=i.XpG();return v.Njj(G.cancel())}),i.nrm(8,"span",25),i.k0s()()()()()}if(2&R){const C=i.XpG();i.R7$(),i.Y8G("nzSpan",16),i.R7$(),i.Y8G("nzGutter",i.eq3(8,J,C.GTR.xs)),i.R7$(),i.Y8G("showLabel",!1),i.R50("ngModel",C.tags),i.Y8G("ngModelOptions",i.lJ4(10,se))("suggestedTags",C.suggestedTags()),i.R7$(2),i.Y8G("nzLoading",C.isLoading()),i.R7$(2),i.Y8G("disabled",C.isLoading())}}let g=(()=>{class R extends X.R{constructor(C){super(C),this.$injector=C,this.tags=[],this.isServerPage=!1,this.servers=(0,c.hFB)([]),this.tagsChanged=new v.bkB,this.filtersChanged=new v.bkB,this.isOpen=(0,v.vPA)(!1),this.hiddenTagsCount=(0,v.vPA)(0),this.isEditing=(0,v.vPA)(!1),this.isLoading=(0,v.vPA)(!1),this.GTR=_.Nr,this.suggestedTags=(0,M.EW)(()=>{const W=new Set(this.servers()?.map(K=>K.tags).flat()??[]),G=Array.from(W).filter(K=>!(0,f.oq)(K)).map(K=>({value:K}));return this.server.$isPreemptible&&G.unshift({label:this.translate("server_preemptible"),value:"preemptible",readonly:!0}),G})}ngOnChanges(C){(C.tags||C.server)&&this.setTags(),(C.visibleTagsCount||C.tags||C.server)&&this.computeHiddenTagsCount()}findServersWithTag(C){this.filtersChanged.emit(C)}setTags(){this.tags=this.server.tags.filter(C=>!(0,f.oq)(C))}computeHiddenTagsCount(){this.hiddenTagsCount.set(!(0,z.isNil)(this.visibleTagsCount)&&this.tags.length>this.visibleTagsCount?this.tags.length-this.visibleTagsCount:0)}edit(){this.isActionDisabled("editTags")||(this.sendAnalytics(this.server.$hasNonSystemTags?"editTagsStart":"addTagsStart","server_page"),this.tags=this.server.tags.filter(W=>!(0,f.oq)(W)),this.server.$isPreemptible&&this.tags.unshift("preemptible"),this.isEditing.set(!0))}save(){if(this.isLoading())return;this.isLoading.set(!0);const C=this.tags.filter(K=>"preemptible"!==K);if(C.length>10)return void this.isLoading.set(!1);const W=this.server.tags.filter(K=>(0,f.oq)(K)),G=C.concat(W);this.server.$updateTags(G).$promise.then(K=>{this.sendAnalytics(this.server.$hasNonSystemTags?"editTagsFinish":"addTagsFinish","server_page"),this.isLoading.set(!1),this.isEditing.set(!1),this.tagsChanged.emit(K.tags)}).catch(K=>{console.log(K),this.isLoading.set(!1)})}cancel(){this.setTags(),this.isEditing.set(!1)}static{this.\u0275fac=function(W){return new(W||R)(i.rXU("$injector"))}}static{this.\u0275cmp=i.VBU({type:R,selectors:[["vpc-server-tags"]],inputs:{server:"server",tags:"tags",isServerPage:"isServerPage",visibleTagsCount:"visibleTagsCount",servers:[1,"servers"]},outputs:{tagsChanged:"tagsChanged",filtersChanged:"filtersChanged"},features:[i.Vt3,i.OA$],decls:4,vars:3,consts:[[1,"tags_wrapper"],[1,"sui-flex-start-center","sui-gap-xs"],["nzMode","checkable","nzPopoverPlacement","top",1,"sui-mrt-2xs","sui-mrr-2xs",3,"suiTagSize","nz-popover","nzPopoverContent"],["nz-row",""],["nz-flex","",3,"nzGap","nzAlign","nzWrap"],[1,"tags_controls"],["nzPopoverPlacement","top",1,"tags_count",3,"nz-popover","nzPopoverContent"],["nzMode","checkable","nzPopoverPlacement","top",3,"suiTagSize","nz-popover","nzPopoverContent"],["nzMode","checkable","nzPopoverPlacement","top",3,"click","
1suiTagSize","nz-popover","nzPopoverContent"],[3,"title"],["nzPopoverPlacement","top",1,"tags_count",3,"click","nz-popover","nzPopoverContent"],["nz-icon","",3,"nzType"],["type","button","nz-button","","data-testid","server_add_tags",3,"suiSize","disabled"],["type","button","sui-service-button","",3,"suiServiceButtonSize","disabled"],["type","button","nz-button","","data-testid","server_add_tags",3,"click","suiSize","disabled"],["nz-icon","","nzType","sui:edit","nzPopoverPlacement","top",3,"click","nz-popover","nzPopoverContent"],["nzMode","checkable","class","sui-mrt-2xs sui-mrr-2xs","nzPopoverPlacement","top",3,"suiTagSize","nz-popover","nzPopoverContent","click",4,"ngFor","ngForOf"],["nzMode","checkable","nzPopoverPlacement","top",1,"sui-mrt-2xs","sui-mrr-2xs",3,"click","suiTagSize","nz-popover","nzPopoverContent"],["nz-col","",3,"nzSpan"],["nz-row","",3,"nzGutter"],["nz-col","","nzFlex","1 0 auto",1,"tags_select",3,"ngModelChange","showLabel","ngModel","ngModelOptions","suggestedTags"],["nz-col","","nzFlex","0 0 auto",1,"sui-line-2xs"],["type","button","nz-button","","nzType","primary","suiSize","default",3,"click","nzLoading"],["nz-icon","","nzType","sui:check"],["type","button","nz-button","","nzType","default","suiSize","default",3,"click","disabled"],["nz-icon","","nzType","sui:close"]],template:function(W,G){1&W&&(i.j41(0,"div",0),i.nVh(1,a,5,3,"div",1),i.nVh(2,l,2,4,"nz-tag",2),i.k0s(),i.nVh(3,E,9,11,"div",3)),2&W&&(i.R7$(),i.vxM(G.isEditing()?-1:1),i.R7$(),i.vxM(G.isOpen()&&G.hiddenTagsCount()>0&&!G.isEditing()?2:-1),i.R7$(),i.vxM(G.isEditing()?3:-1))},dependencies:[d.MD,d.Sq,O.l,s.kJ,k.s,s.Rx,$.Zi,Q.L_,n.t_t,B.Dn,D.cX,A.a,Y.c,ee.p,_.ou,D.Hr,D.Dx,_.Xv,h.w1,V.Uq,V.e,T.tJ,Z.B,P.O_,y.Hj,u.YN,u.BC,u.vS,m.y,d.P9,F.D],styles:[".tags[_ngcontent-%COMP%] {\n  display: flex;\n  align-items: center;\n}\n.tags_wrapper[_ngcontent-%COMP%] {\n  position: relative;\n}\n.tags_controls[_ngcontent-%COMP%] {\n  display: flex;\n  align-items: flex-start;\n  flex-wrap: nowrap;\n}\n.tags_count[_ngcontent-%COMP%] {\n  display: flex;\n  flex-wrap: nowrap;\n  align-items: center;\n  cursor: pointer;\n}\n.tags_select[_ngcontent-%COMP%] {\n  max-width: calc(100% - 100px);\n}"],changeDetection:0})}}return R})()},23691(N,L,t){t.d(L,{T:()=>u,Z:()=>M});var d=t(46111),c=t(84487),v=t(3412),M=function(m){return m.CLOUD_COMPUTE_SERVER_REBOOT_SOFT_EVENT="panel_cloud_compute_server_reboot_soft",m.CLOUD_COMPUTE_SERVER_CONSOLE_OPEN_EVENT="panel_cloud_compute_server_console_open",m.CLOUD_COMPUTE_SERVER_RENAME_EVENT="panel_cloud_compute_server_rename",m.CLOUD_COMPUTE_SERVER_PAGE_OPEN="panel_cloud_compute_server_page_open",m.CLOUD_COMPUTE_SERVER_FLAVOR_UNAVAILABLE="panel_cloud_compute_server_create_open_link-ticket",m.CLOUD_COMPUTE_SERVER_SCALE_FINISH="panel_cloud_compute_server_scale_finish",m.CLOUD_COMPUTE_FLAVOR_CREATE_START="panel_cloud_compute_flavor_create-start",m.CLOUD_COMPUTE_FLAVOR_CREATE_FINISH="panel_cloud_compute_flavor_create-finish",m.CLOUD_COMPUTE_FLAVOR_DELETE="panel_cloud_compute_flavor_delete",m.CLOUD_COMPUTE_SERVER_CONFIG_SET_OPEN="panel_cloud_compute_server_config-set-open",m.CLOUD_COMPUTE_SERVER_CONFIG_SET_CLOSE="panel_cloud_compute_server_config-set-close",m.CLOUD_COMPUTE_SERVER_PORT_SETTINGS_CHANGE="panel_cloud_compute_server_port_settings_change",m.CLOUD_COMPUTE_SERVER_IP_COPY="panel_cloud_compute_server_ip_copy",m.CLOUD_COMPUTE_SERVER_CREATE_FINISH="panel_cloud_compute_server_create_finish",m.CLOUD_COMPUTE_SERVER_CREATE_NOFINISH="panel_cloud_compute_server_create_nofinish",m.CLOUD_COMPUTE_SERVER_CREATE_OPEN_LINK="panel_cloud_compute_server_create-open-link",m.CLOUD_COMPUTE_SERVER_CREATE_FINDER_POOL_OPEN="panel_cloud_compute_server_create_finder-pool-open",m.CLOUD_COMPUTE_SERVER_CREATE_FINDER_POOL_CLOSE="panel_cloud_compute_server_create_finder-pool-close",m.CLOUD_COMPUTE_SERVER_CREATE_LINE_STANDARD="panel_cloud_compute_server_create_line-standard",m.CLOUD_COMPUTE_SERVER_CREATE_LINE_GPU="panel_cloud_compute_server_create_line-gpu",m.CLOUD_COMPUTE_SERVER_CREATE_LINE_SHARED="panel_cloud_compute_server_create_line-shared",m.CLOUD_COMPUTE_SERVER_CREATE_LINE_HIGHFREQ="panel_cloud_compute_server_create_line-highfreq",m.CLOUD_COMPUTE_SERVER_CREATE_LINE_10GNET="panel_cloud_compute_server_create_line-10gnet",m.CLOUD_COMPUTE_SERVER_CREATE_LINE_DEDIC="panel_cloud_compute_server_create_line-dedic",m.CLOUD_COMPUTE_SERVER_CREATE_GPU_POOL_CHANGE="panel_cloud_compute_server_create_gpu_pool-change",m.CLOUD_COMPUTE_SERVER_CREATE_GPU_SOURCE_CHANGE="panel_cloud_compute_server_create_gpu_source-change",m.CLOUD_COMPUTE_SERVER_CREATE_GPU_FILTERS_RESET="panel_cloud_compute_server_create_gpu_filters-change",m.CLOUD_COMPUTE_SERVER_CREATE_GPU_FILTERS_TAG="panel_cloud_compute_server_create_gpu_filter-tag",m}(M||{});let u=(()=>{class m extends d.HM{proceedLineChange(D,y){let _;switch(D){case"standard":default:_=M.CLOUD_COMPUTE_SERVER_CREATE_LINE_STANDARD;break;case"gpu":_=M.CLOUD_COMPUTE_SERVER_CREATE_LINE_GPU;break;case"shared":_=M.CLOUD_COMPUTE_SERVER_CREATE_LINE_SHARED;break;case"highfreq":_=M.CLOUD_COMPUTE_SERVER_CREATE_LINE_HIGHFREQ;break;case"network_qos":_=M.CLOUD_COMPUTE_SERVER_CREATE_LINE_10GNET;break;case"dcs":_=M.CLOUD_COMPUTE_SERVER_CREATE_LINE_DEDIC}this.proceed(_,{zone:y})}static{this.\u0275fac=(()=>{let D;return function(_){return(D||(D=c.xGo(m)))(_||m)}})()}static{this.\u0275prov=v.jDH({token:m,factory:m.\u0275fac,providedIn:"root"})}}return m})()},71987(N,L,t){t.d(L,{q:()=>y});var d=t(29712),c=t(40715),v=t(79967),M=t(84487),u=t(55526),m=t(9709);function O(_,T){if(1&_&&M.nrm(0,"nz-badge",0),2&_){const h=M.XpG();M.Y8G("nzStatus",h.badgeStatus)("nzText",h.serverStatus)}}function D(_,T){1&_&&M.nrm(0,"nz-spin",1)}let y=(()=>{class _ extends v.R{get badgeStatus(){switch(this.serverStatus){case"ACTIVE":return"success";case"SHUTOFF":case"PAUSED":case"RESCUE":return"warning";
1case"ERROR":return"error";default:return"default"}}constructor(h){super(h),this.$injector=h}static{this.\u0275fac=function(n){return new(n||_)(M.rXU("$injector"))}}static{this.\u0275cmp=M.VBU({type:_,selectors:[["vpc-server-status-badge"]],inputs:{server:"server"},features:[M.Vt3],decls:2,vars:1,consts:[["suiBadgeStatusText","","data-testid","vpc_server_status",3,"nzStatus","nzText"],["nzSimple","","suiSize","small"]],template:function(n,$){1&n&&M.nVh(0,O,1,2,"nz-badge",0)(1,D,1,0,"nz-spin",1),2&n&&M.vxM($.serverStatus?0:1)},dependencies:[d.Rr,u.dz,d.GJ,c.i6,m.a,c.wi],encapsulation:2,changeDetection:0})}}return _})()},14435(N,L,t){t.d(L,{J:()=>v,y:()=>c});var d=t(49127);function c(M){try{const u=atob(M),m=Uint8Array.from(u,O=>O.charCodeAt(0));return(new TextDecoder).decode(m)}catch(u){return console.error("Base64 decoding error:",u),""}}function v(M){if(!M?.metadata?.x_sel_server_app_default_data||"ACTIVE"!==M.status||!M?.user_data)return;const u=JSON.parse(M.metadata.x_sel_server_app_default_data);try{const O=(0,d.Hh)(c(M?.user_data))?.write_files?.[0]?.content;if(!O)return;const D=(0,d.Hh)(O);if(!D)return;const y={};for(const[_,T]of Object.entries(u))T&&void 0!==D[T]&&(y[_]=String(D[T]));return y}catch(m){return void console.error("YAML parsing or Base64 decoding error:",m)}}},4876(N,L,t){t.d(L,{t:()=>c});var d=t(3412);let c=(()=>{class v{isUserPassVisible(u){return!this.isSourceBaasCheckpointItem(u)&&(this.isSourceSnapshot(u)?u.$volume.$passwordDisabled:!u?.$passwordDisabled)}isPasswordDisabled(u){return!!this.isSourceBaasCheckpointItem(u)||(this.isSourceSnapshot(u)?!!u.$volume.$passwordDisabled:!!u?.$passwordDisabled)}isSourceVolume(u){return"volume"===u?.$type}isSourceImage(u){return"image"===u?.$type}isSourceIso(u){return this.isSourceImage(u)&&"iso"===u.$format}isSourceBaasCheckpointItem(u){return"backup"===u?.$type}isSourceSnapshot(u){return"snapshot"===u?.$type}getMinDiskLimit(u){const m=this.isSourceImage(u)?u.min_disk:void 0,O=this.isSourceBaasCheckpointItem(u)?NaN:Number(m??u?.size??NaN);return isNaN(O)?0:O}getMinRamLimit(u){const m=this.isSourceImage(u)?u.min_ram:void 0,O=this.isSourceVolume(u)?u?.volume_image_metadata?.min_ram:void 0,D=this.isSourceSnapshot(u)?u.$volume.volume_image_metadata?.min_ram:void 0,y=this.isSourceBaasCheckpointItem(u)?NaN:Number(O??D??m??NaN);return isNaN(y)?0:y}getLicenseName(u,m=[]){let O;if(this.isSourceImage(u)||this.isSourceVolume(u)?O=u:this.isSourceSnapshot(u)&&(O=m.find(D=>D.id===u.volume_id)),O&&O.$byBrand&&O.$licenseName&&"windows"===O.$osType)return O.$licenseName}getImageName(u){return this.isSourceImage(u)||this.isSourceVolume(u)?u.$imageResourceName:this.isSourceSnapshot(u)?u.$volume?.$imageResourceName:void 0}getIntegerValueAccordingToDimension(u,m,O="up"){return"up"===O?Math.ceil(u/m):Math.floor(u/m)}getRecommendedSource(u,m,O,D){if(!u||!m)return"";const y=m?.ubuntu.find(_=>this.isGpuAvailableBySource({source:_,gpuCount:D,gpuName:u}))?.name??"";return O?m?.windows.find(_=>this.isGpuAvailableBySource({source:_,gpuCount:D,gpuName:u}))?.name??y:y}isGpuAvailableBySource({gpuName:u,gpuCount:m,source:O}){if(!O||!u)return!0;const D=Number(O.$optimizedGpus?.get(u));return!O.$optimizedGpus?.size||O.$optimizedGpus?.has(u)&&(!m||Number.isNaN(D)||m<=D)}static{this.\u0275fac=function(m){return new(m||v)}}static{this.\u0275prov=d.jDH({token:v,factory:v.\u0275fac,providedIn:"root"})}}return v})()},57537(N,L,t){t.d(L,{b:()=>M});var d=t(3412),c=t(1749),v=t(14435);let M=(()=>{class u{constructor(){this.serverSignal=(0,d.vPA)(void 0),this.isEditingSignal=(0,d.vPA)(!1),this.volumesAccessDeniedSignal=(0,d.vPA)(!1),this.securityGroupsSignal=(0,d.vPA)([]),this.serverStatus=(0,c.EW)(()=>this.serverSignal()?.status),this.appDefaultData=(0,c.EW)(()=>{const O=this.serverSignal();return(0,v.J)(O)}),this.serverDataLoaded=(0,d.vPA)(!1),this.isLiteVersion=(0,d.vPA)(!1)}get server(){return this.serverSignal()}set server(O){this.serverSignal.set(O)}get volumesAccessDenied(){return this.volumesAccessDeniedSignal()}set volumesAccessDenied(O){this.volumesAccessDeniedSignal.set(O)}get securityGroups(){return this.securityGroupsSignal()}set securityGroups(O){this.securityGroupsSignal.set(O)}static{this.\u0275fac=function(D){return new(D||u)}}static{this.\u0275prov=d.jDH({token:u,factory:u.\u0275fac})}}return u})()},43479(N,L,t){t.d(L,{g:()=>ee});var d=t(36341),c=t(1749),v=t(33555),M=t(99615),u=t(4525),m=t(68405),O=t(47480
1),D=t(570),y=t(56882),_=t(13593),T=t(54747),n=t(84487),$=t(3412),P=t(62189),s=t(12576);function f(V,Z){1&V&&(n.EFF(0),n.nI1(1,"translate")),2&V&&n.SpI(" ",n.bMT(1,1,"vpc_SSH_connect_helper_title_rdp")," ")}function z(V,Z){1&V&&(n.EFF(0),n.nI1(1,"translate")),2&V&&n.SpI(" ",n.bMT(1,1,"vpc_SSH_connect_helper_title_ssh")," ")}function U(V,Z){1&V&&(n.nrm(0,"span",6),n.nI1(1,"translate")),2&V&&n.Y8G("innerHTML",n.bMT(1,1,"vpc_SSH_connect_helper_link"),n.npT)}function X(V,Z){if(1&V&&(n.j41(0,"a",7),n.nrm(1,"span",6),n.nI1(2,"translate"),n.k0s()),2&V){const F=n.XpG(2);n.Y8G("panelKbHref",F.isWindows?"cloud/servers/manage/connect-to-server/#connect-via-rdp":"cloud/servers/manage/connect-to-server/#connect-via-ssh"),n.R7$(),n.Y8G("innerHTML",n.bMT(2,2,"vpc_SSH_connect_helper_link"),n.npT)}}function i(V,Z){1&V&&(n.nrm(0,"span",8),n.nI1(1,"translate")),2&V&&n.Y8G("innerHTML",n.bMT(1,1,"vpc_SSH_connect_helper_last_rdp"),n.npT)}function k(V,Z){1&V&&(n.nrm(0,"span",8),n.nI1(1,"translate")),2&V&&n.Y8G("innerHTML",n.bMT(1,1,"vpc_SSH_connect_helper_last_ssh"),n.npT)}function Q(V,Z){1&V&&(n.nrm(0,"span",9),n.nI1(1,"translate")),2&V&&n.Y8G("innerHTML",n.bMT(1,1,"vpc_SSH_connect_helper_windows"),n.npT)}function B(V,Z){if(1&V){const F=n.RV6();n.j41(0,"div",10)(1,"vpc-copy-text-block",11),n.bIt("copyAction",function(){$.eBV(F);const se=n.XpG(2);return $.Njj(se.copyCommandAction.emit())}),n.k0s()()}if(2&V){const F=n.XpG(2);n.R7$(),n.Y8G("text",F.connectCommand())}}function A(V,Z){if(1&V&&(n.j41(0,"div",2)(1,"h4",3),n.nVh(2,f,2,3)(3,z,2,3),n.k0s()(),n.j41(4,"div",4),n.nrm(5,"span",5),n.nI1(6,"translate"),n.nVh(7,U,2,3,"span",6)(8,X,3,4,"a",7),n.nVh(9,i,2,3,"span",8)(10,k,2,3,"span",8),n.k0s(),n.nVh(11,Q,2,3,"span",9)(12,B,2,1,"div",10)),2&V){const F=n.XpG();n.R7$(2),n.vxM(F.isWindows?2:3),n.R7$(3),n.Y8G("innerHTML",n.bMT(6,5,"vpc_SSH_connect_helper_first"),n.npT),n.R7$(2),n.vxM(F.ENTRY.EXTERNAL?7:8),n.R7$(2),n.vxM(F.isWindows?9:10),n.R7$(2),n.vxM(F.isWindows?11:12)}}let ee=(()=>{class V{constructor(){this.source=(0,d.hFB)(),this.floatingIp=d.hFB.required(),this.copyCommandAction=(0,d.CGW)(),this.ENTRY=m.ENTRY,this.login=(0,c.EW)(()=>function h(V){return V.includes("astra")?"astra":V.includes("redos")?"redos":"root"}(this.source().$osDist)),this.isGitLabApp=(0,c.EW)(()=>{const F=this.source(),J=F?.$isMarketplace||"true"===F?.volume_image_metadata?.x_cloud_is_market_app;return!(!F?.$imageName||!J||(0,T.QU)(F.$imageName)!==_._.gitlab)}),this.connectCommand=(0,c.EW)(()=>`ssh${this.isGitLabApp()?" -p 22022":""} ${this.login()}@${this.floatingIp()}`)}get isWindows(){return this.source()?.$isWindowsOs}static{this.\u0275fac=function(J){return new(J||V)}}static{this.\u0275cmp=n.VBU({type:V,selectors:[["vpc-ssh-connect"]],inputs:{source:[1,"source"],floatingIp:[1,"floatingIp"]},outputs:{copyCommandAction:"copyCommandAction"},decls:3,vars:2,consts:[["sshConnectHelper",""],["suiInfoBlock","",1,"sui-mrt-s","sui-mrb-m",3,"suiSize","nzMessage"],["nz-typography","",1,"sui-mrb-s"],["data-testid","ssh_helper_title"],["nz-typography",""],["data-testid","ssh_helper_msg_first",3,"innerHTML"],[3,"innerHTML"],["nz-typography","","data-testid","ssh_helper_doc_link",3,"panelKbHref"],["data-testid","ssh_helper_msg_last",3,"innerHTML"],["nz-typography","","data-testid","ssh_helper_windows_msg",3,"innerHTML"],[1,"sui-mrt-s","sui-mrb-s"],["data-testid","ssh_helper_copy_command",3,"copyAction","text"]],template:function(J,se){if(1&J&&(n.nrm(0,"nz-alert",1),n.DNE(1,A,13,7,"ng-template",null,0,n.C5r)),2&J){const ne=n.sdS(2);n.Y8G("suiSize","s")("nzMessage",ne)}},dependencies:[v.sS,P.Y,v.IS,M.R0,u._v,y.l,D.w4,O.T,s.D],encapsulation:2,changeDetection:0})}}return V})()},79967(N,L,t){t.d(L,{R:()=>te});var d=t(80902),c=t(73180),v=t(319),M=t(26810),u=t(1789),m=t(90285),O=t(74517),D=t(13442),y=t(85542),_=t(61315),T=t(58935),h=t(82525),n=t(25777),$=t(3412),P=t(41269),s=t(60498),f=t(57083),z=t(56882),U=t(42143),X=t(37123),i=t(42511),k=t(88796),Q=t(64151),B=t(78779),A=t(84487),Y=t(14501),ee=t(21689),V=t(68926),Z=t(71686),F=t(19781),J=t(12576);t(90631);const ne=()=>({standalone:!0});function re(q,a){if(1&q){const p=A.RV6();A.j41(0,"div")(1,"div",2)(2,"div",3)(3,"button",4),A.bIt("click",function(){$.eBV(p);const E=A.XpG();return $.Njj(E.destroyModal())}),A.EFF(4),A.nI1(5,"translate"),A.k0s()(),A.j41(6,"div",3)(7,"button",5),A.bIt("click",function(){$.eBV(p);const E=A.XpG();return $.Njj(E.submit())}),A.EFF(8),A.nI1(9,"translate"),A.k0s()()()()}if(2&q){const p=A.XpG();A.R7$(3),A.Y8G("disabled",p.isLoading),A.R7$(),A.SpI(" ",A.bMT(5,4,"Cancel")," "),A.R7$(3),A.Y8G("nzLoading",p.isLoading),A.R7$(),A.SpI(" ",A.bMT(9,6,"vpc_Save")," ")}}let oe=(()=>{class q{constructor(p){this.vpcRepository=p,this.modalData=(0,$.WQX)(i.or),this.modal=(0,$.WQX)(i.J9),this.translate=(0,$.WQX)(s.Nw),this.server=this.modalData.server,this.suggestedTags=(0,$.vPA)([]),this.tags=[],this.isLoading=!1}ngOnInit(){this.tags=this.server.tags.filter(E=>!(0,B.oq)(E)),this.server.$isPreemptible&&this.tags.unshift("preemptible");const p=new Set(this.vpcRepository.getModels("resources:servers")?.map(E=>
1E.tags).flat()??[]),l=Array.from(p).filter(E=>!(0,B.oq)(E)).map(E=>({value:E}));this.server.$isPreemptible&&l.unshift({label:this.translate("server_preemptible"),value:"preemptible",readonly:!0}),this.suggestedTags.set(l)}submit(){this.isLoading=!0;const p=this.tags.filter(g=>"preemptible"!==g);if(p.length>10)return void(this.isLoading=!1);const l=this.server.tags.filter(g=>(0,B.oq)(g)),E=p.concat(l);this.server.tags=E,this.server.$updateTags(E).$promise.then(()=>{this.isLoading=!1,this.modal.close(E)}).catch(g=>{console.log(g),g.status===n.kG.Forbidden&&this.modal.close(E),this.isLoading=!1})}destroyModal(){this.modal.destroy(!1)}static{this.\u0275fac=function(l){return new(l||q)(A.rXU("vpcRepository"))}}static{this.\u0275cmp=A.VBU({type:q,selectors:[["vpc-edit-server-tags-modal"]],inputs:{server:"server"},decls:2,vars:5,consts:[[3,"ngModelChange","showLabel","ngModel","ngModelOptions","suggestedTags"],[4,"nzModalFooter"],["nz-row","","nzJustify","end",1,"sui-mrt-m"],["nz-col",""],["type","button","nz-button","","nzType","default","data-testid","cancel_btn",3,"click","disabled"],["nz-button","","nzType","primary","type","submit","data-testid","submit_btn",3,"click","nzLoading"]],template:function(l,E){1&l&&(A.j41(0,"tags-control",0),A.mxI("ngModelChange",function(R){return A.DH7(E.tags,R)||(E.tags=R),R}),A.k0s(),A.DNE(1,re,10,8,"div",1)),2&l&&(A.Y8G("showLabel",!0),A.R50("ngModel",E.tags),A.Y8G("ngModelOptions",A.lJ4(4,ne))("suggestedTags",E.suggestedTags()))},dependencies:[h.MD,z.l,Q.T,M.BQ,i.Oj,U.cX,Y.a,ee.c,V.p,Z.ou,Z.Xv,k.LX,X.w1,F.Uq,F.e,P.YN,P.BC,P.vS,f.y,J.D],encapsulation:2,changeDetection:0})}}return q})();const e={stop:"CP: Server Turn Off",start:"CP: Server Turn On",softReboot:"CP: Server Reboot Soft",hardReboot:"CP: Server Reboot Hard",pause:"CP: Server Pause",unpause:"CP: Server Unpause",rescue:"CP: Server Rescue",unrescue:"CP: Server Unrescue",rebuild:"CP: Server Rebuild",rename:"CP: Server Rename",changeType:"CP: Server Type Change",shelve:"CP: Server Freeze",unshelve:"CP: Server Unshelve",copyUUID:"CP: Server ID copy",diskInfo:"CP: Server Info Disks Open",IPInfo:"CP: Server Info IPs Open",passwordChange:"CP: Password Change",passwordCopy:"CP: Password Copy",passwordChoose:"CP: Hot Key Password Choose",publicIpCopy:"CP: Public Ip Copy",configOpen:"CP: Server Config Open",disksOpen:"CP: Server Disks Open",portsOpen:"CP: Server Ports Open",settingsOpen:"CP: Server Settings Open",statisticsOpen:"CP: Server Statistics Open",syslogOpen:"CP: Server Syslog Open",consoleOpen:"CP: Server Console Open",serverGroupsOpen:"CP: Placement group Page Open",resizeStart:"CP: Server Scale Start",pageOpen:"CP: Server Page Open",addTagsStart:"CP: Server Tag Add Start",editTagsStart:"CP: Server Tag Edit Start",addTagsFinish:"CP: Server Tag Add Finish",editTagsFinish:"CP: Server Tag Edit Finish"},ie={stop:"panel_cloud_compute_server_turn_off",start:"panel_cloud_compute_server_turn_on",softReboot:"panel_cloud_compute_server_reboot_soft",hardReboot:"panel_cloud_compute_server_reboot_hard",pause:"panel_cloud_compute_server_pause",unpause:"panel_cloud_compute_server_unpause",rescue:"panel_cloud_compute_server_rescue",unrescue:"panel_cloud_compute_server_unrescue",rebuild:"panel_cloud_compute_server_rebuild",rename:"panel_cloud_compute_server_rename",changeType:"panel_cloud_compute_server_type_change",shelve:"panel_cloud_compute_server_freeze",unshelve:"panel_cloud_compute_server_unshelve",copyUUID:"panel_cloud_compute_server_id_copy",diskInfo:"panel_cloud_compute_server_info_disks_open",IPInfo:"panel_cloud_compute_server_info_ip_open",passwordChange:"panel_cloud_compute_server_password_change",passwordCopy:"panel_cloud_compute_server_password_copy",passwordChoose:"panel_cloud_compute_server_hotkey_password_choose",publicIpCopy:"panel_cloud_compute_server_ip_copy",configOpen:"panel_cloud_compute_server_config_open",disksOpen:"panel_cloud_compute_server_disks_open",portsOpen:"panel_cloud_compute_server_ports_open",settingsOpen:"panel_cloud_compute_server_settings_open",statisticsOpen:"panel_cloud_compute_server_statistics_open",syslogOpen:"panel_cloud_compute_server_syslog_open",consoleOpen:"panel_cloud_compute_server_console_open",serverGroupsOpen:"panel_cloud_compute_placement_group_page_open",resizeStart:"panel_cloud_compute_server_scale_start",pageOpen:"panel_cloud_compute_server_page_open",addTagsStart:"panel_cloud_compute_server_tag_start",editTagsStart:"panel_cloud_compute_server_tag_edit_start",addTagsFinish:"panel_cloud_compute_server_tag_finish",editTagsFinish:"panel_cloud_compute_server_tag_edit_finish"};class te{constructor(a){this.$injector=a,this.vpcRepository=this.$injector.get("vpcRepository"),this.vpcServerSyncer=this.$injector.get("vpcServerSyncer"),this.vpcExecutionsTracker=this.$injector.get("vpcExecutionsTracker"),this.vpcInfoLicenses=this.$injector.get("infoLicensesResource"),this.cachedPasswords=this.$injector.get("cachedPasswords"),this.translate=this.$injector.get("translate"),this.openConfirmModal=this.$injector.get("openConfirmModal"),this.confirmModal=this.$injector.get("confirmModal"),this.$rootScope=this.$injector.get("$rootScope"),this.$q=this.$injector.get("$q"),this.$document=this.$injector.get("$document"),this.subnets=this.$injector.get("Subnets"),this.panelMetrics=this.$injector.get("panelMetrics"),this.$mdDialog=this.$injector.get("$mdDialog"),this.notificationService=this.$injector.get("notificationService"),this.modalService=this.$injector.get("modalService"),this.vpcServerShelvingService=this.$injector.get("vpcServerShelvingService"),this.imagesAnalyticsService=this.$injector.get("imagesAnalyticsService"),this.imageCreateDialog=this.$injector.get("vpcImagesCreateDialogService"),this.$state=this.$injector.get("$state"),this.$window=this.$injector.get("$window"),this.vpcRegionStore=this.$injector.get("vpcRegionStore"),this.formbricks=this.$injector.get("formbricksService"),this.vdsServersAnalyticsService=this.$injector.get("vdsServersAnalyticsService"),this.isSourceLoading=!1,this.isSourceReady=!1,this.nameIsSaving=!1,this.isFirstMention=!0,this.isActionsLoading=!1,this.volumeComparator=this.volumeComparator.bind(this),this.portComparator=this.portComparator.bind(this)}static{this.sourcePromiseCache=new WeakMap}get sourcePromiseCache(){return te.sourcePromiseCache}get isLiteVersionServer(){return!!this.server.$flavor?.$isLiteVersion}get isServerRebuilding(){return this.vpcExecutionsTracker.isServerRebuilding(this.server.id)}get isServerResizing(){return this.serverStatus.includes("RESIZE")}get isServerExpired(){return this.serverStatus.includes("EXPIRED")}get isServerFrozen(){return this.serverStatus.includes("FROZEN")}get localDiskSize(){const a=Number(this.server.flavor?.disk);return isNaN(a)?0:a}get isUseLocalDisk(){return!!this.server.$flavor?.disk}calcResizeTime(a,p){return Math.ceil(this.localDiskSize/(a/8*60))+p}get lowerResizeTime(){return this.calcResizeTime(2,1)}get upperResizeTime(){return this.calcResizeTime(1.5,2)}get serverStatus(){return this.sendEvent(),this.server.$isShelved?this.server.$isPreemptible&&"SHELVED_OFFLOADED"!==this.server.status?this.server.$actions&&this.server.$actions.length?this.server.$actions.filter(a=>"shelve"===a.action)[0]?.user_id?"FROZEN":"EXPIRED":(this.updateServerActions(),""):"FROZEN":this.isServerRebuilding?"REBUILDING":(this.server.$state||this.server.status)?.toUpperCase()}get serverStatusClasses(){switch(this.serverStatus){case"ACTIVE":return["f-success","t-s"];case"SHUTOFF":case"PAUSED":case"RESCUE":case"DELETED":case"EXPIRED":case"FROZEN":return["f-warning-s","t-s"];case"ERROR":return["f-danger-s","t-s"];default:return["f-base-l","t-xs"]}}updateServerActions(){this.isActionsLoading||(this.isActionsLoading=!0,this.server.$getActions().$promise.then(a=>{this.server.$actions=a.instanceActions,this.isActionsLoading=!1}))}sendEvent(){if("ERROR"===this.server.status&&this.isFirstMention){c.KJ.get("serverError");const p=c.KJ.get("serverError");
1if(!p||p.id!==this.server.id){const l=(new Date).getTime();c.KJ.set("serverError",{id:this.server.id,time:l}),this.isFirstMention=!1,this.panelMetrics.ymReachGoal("vpc-server-become-error");const g=!!this.server.$flavor?.extra_specs?.["pci_passthrough:alias"];this.isLiteVersionServer?this.vdsServersAnalyticsService.triggerBecomeError({id_server:this.server.id??""}):_.Ay.capture("panel_cloud_compute_server_become_error",{id_server:this.server.id,gpu:g})}}}get volumesTotalSize(){return this.localDiskSize+(0,y.sumBy)(this.server.$volumes,a=>a.size)}get systemVolumes(){return this.server.$volumes?.filter(a=>a.$isSystem)??[]}get source(){return this.localDiskSize?this.server.$image:this.systemVolumes.find(a=>a.$isISO)||this.systemVolumes[0]}initSource(){let a;return this.server.flavor?.disk&&this.server.image?.id&&!this.server.$image?(this.isSourceLoading=!0,a=this.vpcServerSyncer.loadImage(this.server.image.id,!0,this.server.$region).catch(p=>console.warn("[ServersServerBaseController#initSource] image load error",p)),a.then(p=>this.isSourceReady=!!p).finally(()=>this.isSourceLoading=!1)):(this.isSourceReady=!0,a=this.$q.resolve(this.server.$image)),this.sourcePromiseCache.set(this.server,a),a}loadSource(){return this.sourcePromiseCache.has(this.server)?this.sourcePromiseCache.get(this.server):this.initSource()}rename(){return this.nameIsSaving=!0,this.vpcRepository.callAction("resources:servers#update",this.server,{name:this.server.name}).finally(()=>{this.nameIsSaving=!1})}get isDeletable(){const{status:a}=this.server;return"DELETED"!==a&&"deleting"!==this.server.$state}get isAllActionsDisabled(){return!!this.isServerRebuilding||!this.isDeletable}isActionEnabled(a){const{status:p}=this.server;if(this.isAllActionsDisabled)return!1;if("delete"===a)return!["IMAGE_SNAPSHOT_PENDING","IMAGE_SNAPSHOT","IMAGE_PENDING_UPLOAD","IMAGE_UPLOADING"].includes(this.serverStatus);if("ERROR"===p)return"hardReboot"===a;if(this.server.$state)return!1;switch(a){case"start":return["SHUTOFF"].includes(p);case"stop":return["ACTIVE","RESCUE"].includes(p);case"softReboot":case"pause":case"suspend":return["ACTIVE"].includes(p);case"hardReboot":return!["SHUTOFF","RESCUE","SHELVED_OFFLOADED"].includes(p);case"unpause":return["PAUSED"].includes(p);case"resume":return["SUSPENDED"].includes(p);case"rescue":return["ACTIVE","SHUTOFF"].includes(p);case"unrescue":return["RESCUE"].includes(p);case"resize":return!["RESIZE","VERIFY_RESIZE"].includes(p);case"rebuild":return!["SHELVED_OFFLOADED"].includes(p);case"rename":case"createImage":case"setIp":return!0;case"changeType":case"shelve":case"editTags":return["ACTIVE","PAUSED","SUSPENDED","SHUTOFF"].includes(p);case"unshelve":return["SHELVED_OFFLOADED"].includes(p);default:return!1}}isActionDisabled(a){return!this.isActionEnabled(a)}get isPowerDisabled(){return this.isActionDisabled(this.server.$isActive?"stop":"start")}get isPauseDisabled(){return this.isActionDisabled(this.server.$isPaused?"unpause":"pause")}get isShelveDisabled(){return this.isActionDisabled("shelve")}get isUnshelveDisabled(){return this.isActionDisabled("unshelve")}get isSuspendDisabled(){return this.isActionDisabled(this.server.$isSuspended?"resume":"suspend")}get isRescueDisabled(){return this.isActionDisabled(this.server.$isRescue?"unrescue":"rescue")}get isVolumesControlsDisabled(){return this.isServerRebuilding||["RESIZE","VERIFY_RESIZE","BUILD","DELETED"].includes(this.server.status)}runAction(a,p,l=!1){const E=this.translate("vpc_Please, confirm that you would like to {{action}} {{name}} server."),g={stop:this.translate("vpc_power off"),pause:this.translate("vpc_pause"),rescue:this.translate("vpc_enter rescue mode for"),suspend:this.translate("vpc_hibernate"),softReboot:this.translate("vpc_perform a software reboot of"),hardReboot:this.translate("vpc_perform a hard reboot of")},R={name:this.server.name,action:g[a],cluster:this.server.$clusterName};if(this.server.$isCluster&&["stop","pause","shelve","rescue"].includes(a))return this.openActionWithClusterModal(a);if(["stop","pause","shelve","rescue"].includes(a))return this.$mdDialog.show({locals:{type:a,isLiteVersion:l},template:t(86243),controller:D.E,controllerAs:"$ctrl",bindToController:!0}).then(()=>this.sendAnalytics(a,p,l)).then(()=>this.server[`$${a}`]());if("softReboot"===a)return this.openConfirmModal({confirmTitle:this.translate("vpc_server_dialog_softReboot_title"),confirmText:this.translate("vpc_server_dialog_softReboot_description"),okText:this.translate("vpc_reboot"),classes:"m-brand m-s"}).then(()=>this.sendAnalytics(a,p,l)).then(()=>this.server[`$${a}`]());if("hardReboot"===a)return this.openConfirmModal({confirmTitle:this.translate("vpc_server_dialog_hardReboot_title"),confirmText:this.translate("vpc_server_dialog_hardReboot_description"),okText:this.translate("vpc_reboot"),classes:"m-brand m-s"}).then(()=>this.sendAnalytics(a,p,l)).then(()=>this.server[`$${a}`]());if(Object.keys(g).includes(a)){const I=this.translate(E,R);return this.confirmModal(I,"m-warning m-m").then(()=>this.sendAnalytics(a,p,l)).then(()=>this.server[`$${a}`]().$promise).then(()=>this.$rootScope.$broadcast(`server_was_${a}:${this.server.id}`))}if("unshelve"===a)this.server.$getActions().$promise.then(I=>(this.server.$actions=I.instanceActions,this.sendAnalytics(a,p,l),this.server[`$${a}`]()));else{if("createImage"!==a)return this.sendAnalytics(a,p,l),this.server[`$${a}`]();this.createLocalDiskImage(p)}}openActionWithClusterModal(a){let p="";switch(a){case"stop":p=this.translate("vpc_server_dialog_stop_title");break;case"pause":p=this.translate("vpc_server_dialog_pause_title");break;case"shelve":p=this.translate("vpc_server_dialog_shelve_title");break;case"softReboot":p=this.translate("vpc_server_dialog_softReboot_title");break;case"hardReboot":p=this.translate("vpc_server_dialog_hardReboot_title");break;case"rescue":p=this.translate("vpc_server_dialog_rescue_title");break;case"rebuild":p=this.translate("vpc_Rebuild_server_title");break;case"delete":p=this.translate("vpc_server_deletion")}return this.modalService.create({nzTitle:p,nzContent:O.T,nzData:{cluster:{id:this.server.$clusterId,name:this.server.$clusterName,region:this.server.$region},serverId:this.server.id},nzOkText:null,nzCancelText:this.translate("Close")})}sendAnalytics(a,p,l=!1){const E={id_server:this.server.id};if(p&&(E.event_place=p),"changeType"===a&&(E.server_type=this.server.$isPreemptible?"preemptible":"standard"),"unshelve"===a){E.config_type=this.server.$flavor?.$isFixed&&this.server.$flavor?this.server.$flavor.$configTypeForAnalytics:"flex",E.network_disks=!!this.server.$volumes.length,E.floating=this.server.$floatingIps.length;const I=this.server.$actions?moment.utc(Math.max(...this.server.$actions.filter(C=>"shelve"===C.action).map(C=>moment.utc(C.updated_at)))):moment();E.unshelve_time=moment().diff(I,"minutes")}["addTagsFinish","editTagsFinish"].includes(a)&&(E.config_type=this.server.$flavor?.$isFixed&&this.server.$flavor?this.server.$flavor.$configTypeForAnalytics:"flex",E.server_tags=this.server.tags.length),this.getEventName(a);const R=this.getPosthogEventName(a);l?(E.event_place&&(E.event_place=`vds_${E.event_place}`),this.vdsServersAnalyticsService.triggerAction(a,E)):_.Ay.capture(R,E)}getEventName(a){return e[a]}getPosthogEventName(a){return ie[a]}createLocalDiskImage(a){this.imagesAnalyticsService.sendImageCreateStartEvent({event_place:a}),this.vpcRegionStore.storeRegion(this.server.$region);const p=`local-disk-image-for-${this.server.name}-${(new Date).toLocaleDateString("ru-RU")}`;this.imageCreateDialog.show({name:p,source:{type:m.R.VOLUME,data:{serverId:this.server.id}}},{creationFromLocalDisk:!0,openedFromServerPage:"server_page"===a}).afterClose.pipe((0,T.s)(1)).subscribe(l=>{if(!l)return;const E=this.$state.href("vpc_panel.project.images",{item:l,region:this.server.$region});this.$window.open(E,"_blank")})}editTags(a){if(this.isActionDisabled("editTags"))return;const l=this.server.$hasNonSystemTags?"editTagsFinish":"addTagsFinish";this.sendAnalytics(this.server.$hasNonSystemTags?"editTagsStart":"addTagsStart",a),this.modalService.create({nzTitle:this.translate(this.server.$hasNonSystemTags?"vpc_server_edit_tags_title":"vpc_server_add_tags_title"),nzContent:oe,nzData:{server:this.server},size:M._O.large,nzBodyStyle:{marginBottom:"0"}}).afterClose.subscribe(g=>{g&&(this.$rootScope.$broadcast("serTagsChanged",{id:this.server.id,region:this.server.$region,tags:g}),this.sendAnalytics(l,a))})}togglePower(a,p=!1){return this.runAction(this.server.$isActive?"stop":"start",a,p)}togglePause(a,p=!1){return this.runAction(this.server.$isPaused?"unpause":"pause",a,p)}toggleShelve(a){return this.runAction("shelve",a)}toggleUnshelve(a){return this.notificationService.info(this.translate("vpc_shelving_notification_title"),this.translate("vpc_shelving_notification_message"),{nzDuration:5e3}),this.runAction("unshelve",a)}toggleSuspend(){return this.runAction(this.server.$isSuspended?"resume":"suspend")}toggleRescue(a,p=!1){return this.runAction(this.server.$isRescue?"unrescue":"rescue",a,p)}loadOriginalImageData(){const a=E=>this.vpcRepository.getModels("images").find(({$region:R,$isActive:I,$imageSourceFile:C,$isPublic:W})=>R===this.server.$region&&I&&W&&C===E),p=E=>this.vpcRepository.getModels("images").find(({$region:R,id:I,$isActive:C})=>R===this.server.$region&&C&&E===I),l=(E,g)=>p(g)??(E?a(E):null);return this.loadSource().then(()=>{const E=this.source?.$imageSourceFile;return l(E,this.source?.$imageId)||this.vpcRepository.callAction("queryImages",E?{q:{x_sel_image_source_file:E},r:this.server.$region}:{r:this.server.$region}).then(()=>l(E,this.source?.$imageId))}).then(E=>({isExistOriginalImage:!!E,isExistSystemVolume:!!this.systemVolumes.length,serverId:this.server.id,image:E}))}rebuildServer({newPassword:a=null,image:p=null,isLiteVersion:l=!1}={},E=""){this.sendAnalytics("rebuild",E,l);const g={source:p,password:a};return this.$q.resolve().then(()=>this.localDiskSize?this.server.$rebuild(g).$promise:this.server.$createRebuildRun(g).$then(R=>this.vpcExecutionsTracker.addExecution(R,{serverId:this.server.id,region:this.server.$region}))).then(()=>this.server.$updatePasswordMetaAndCache(g)?.$promise).catch(R=>{console.error("Server rebuild error",R)})}deleteServer({volumesForDelete:a=[],floatingIpsForDelete:p=[],publicSubnetsForDelete:l=[],directPublicPortsForDelete:E=[]}={},g){return this.deleteServerPortsAndWindowsLicenses().then(()=>this.server.$smartDelete({delete_volume_ids:a,delete_floatingips:p,delete_public_port_ids:E,server_id:this.server.id},g).$promise).then(()=>this.cachedPasswords.deleteFromLocalStorage(this.server.id)).then(()=>{l.length>0&&this.deletePublicSubnets(l)}).catch(R=>{console.error("Server delete error",R)})}deletePublicSubnets(a){a.forEach(p=>{this.deletePublicSubnet(p)})}deletePublicSubnet(a){return this.subnets.getPublic(this.server.$region).$promise.then(p=>{const l=p?.find(E=>a===E.network_id);return l?this.subnets.deletePublic(l.id,this.server.$region).$promise:this.$q.reject("not found network id")}).catch(p=>console.error("deletePublicSubnet",p))}sendDeleteEvent(a,p,l,E){const g={event_place:a,zone:this.server.$zone,config_type:this.server.$flavor.$configTypeForAnalytics,living_time:this.calculateLivingTime(),id_server:this.server.id,network_disks:!!this.server.$volumes.length,delete_disks:E,server_status:this.server.status,floating:this.server.$floatingIps.length,delete_floating:p.length,public_network:this.server.$publicSubnets.length,delete_public_network:l.length,server_type:this.server.$isPreemptible?"preemptible":"standard",server_tags:this.server.tags.length};_.Ay.capture("panel_cloud_compute_server_delete",g),this.server.$flavor?.extra_specs?.["pci_passthrough:alias"]&&this.formbricks.track(v.K.showPanelCloudComputeServerDelete)}calculateLivingTime(){const a=(new Date).getTime(),p=new Date(this.server.created).getTime();return Math.floor((a-p)/6e4)}deleteServerPorts(){const p=this.server?.$ports.filter(l=>
1!l?.tags?.includes("public_port")||!l?.blocked).map(l=>l.$delete({r:l.$region}).$promise);return p?this.$q.all(p):this.$q.reject()}deleteServerPortsAndWindowsLicenses(){const a=this.server.id;return this.deleteServerPorts().then(()=>{const l=this.vpcRepository.getModels("resources:infoLicenses").filter(E=>E?.servers?.length&&E?.servers?.every(g=>g?.id===a)).map(E=>this.tryDeleteLicense(E));return this.$q.all(l)})}tryDeleteLicense(a,p=1){return a.$delete({skipAlerts:!0,apiRegion:a.region}).$catch(l=>10<=p?this.$q.reject(l):409===l.status?this.tryDeleteLicense(a,p+1):this.$q.reject(l))}isDefaultGateway(a){const p=this.server.$parseDefaultAddr();if(!p)return!1;const{ipv4:l,ipv6:E}=p;return a?.fixed_ips?.map(g=>g.ip_address).some(g=>g===l||g===E)}volumeComparator(a,p){if(a.$isISO!==p.$isISO)return Number(p.$isISO)-Number(a.$isISO);if(a.$isSystem!==p.$isSystem)return Number(p.$isSystem)-Number(a.$isSystem);const l=(0,y.get)(a,["attachments",0,"attached_at"],""),E=(0,y.get)(p,["attachments",0,"attached_at"],"");if(l!==E)return l?.localeCompare(E);const g=(0,y.get)(a,["attachments",0,"device"],""),R=(0,y.get)(p,["attachments",0,"device"],"");return g?.localeCompare(R)}portComparator({value:a},{value:p}){const l=new Date(a.created_at),E=new Date(p.created_at);return a.$network?.$isLicensing?1:p.$network?.$isLicensing||l>E?-1:1}}(0,d.Cg)([u.oI],te.prototype,"rename",null)}}]);
2//# sourceMappingURL=246.ad66246961446472.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.