(("undefined"!==typeof self?self:this)["webpackChunkharvester_1_0_1"]=("undefined"!==typeof self?self:this)["webpackChunkharvester_1_0_1"]||[]).push([[62],{59817:function(e,t,r){"use strict";r.d(t,{A:function(){return h}});var a=r(9274);const o={class:"vm-schedule-filter"},n={key:0,class:"banner-item bg-warning"},s={ref:"actionDropDown",class:"btn bg-primary mr-10"},l={class:"filter-popup"};function i(e,t,r,i,c,d){const p=(0,a.resolveComponent)("RadioGroup"),u=(0,a.resolveComponent)("v-dropdown");return(0,a.openBlock)(),(0,a.createElementBlock)("div",o,[(0,a.createElementVNode)("template",null,[c.selected?((0,a.openBlock)(),(0,a.createElementBlock)("span",n,[(0,a.createTextVNode)((0,a.toDisplayString)(e.t("harvester.tableHeaders.vmSchedule"))+(0,a.toDisplayString)(c.selected?` = ${c.selected}`:""),1),(0,a.createElementVNode)("i",{class:"icon icon-close ml-5",onClick:t[0]||(t[0]=(...e)=>d.remove&&d.remove(...e))})])):(0,a.createCommentVNode)("",!0)]),(0,a.createVNode)(u,{triggers:d.scheduleOptions.length?["click"]:[],placement:"bottom-end",offset:"1"},{popper:(0,a.withCtx)((()=>[(0,a.createElementVNode)("div",l,[(0,a.createVNode)(p,{value:c.selected,"onUpdate:value":t[1]||(t[1]=e=>c.selected=e),class:"mr-10 ml-10",name:"model",options:d.scheduleOptions,labels:d.scheduleOptions,onInput:d.onSelect},null,8,["value","options","labels","onInput"])])])),default:(0,a.withCtx)((()=>[(0,a.createElementVNode)("button",s,[(0,a.renderSlot)(e.$slots,"title",{},(()=>[(0,a.createTextVNode)((0,a.toDisplayString)(e.t("harvester.fields.filterSchedule")),1)]),!0)],512)])),_:3},8,["triggers"])])}var c=r(18699),d={name:"HarvesterFilterVMSchedule",emits:["change-rows"],components:{RadioGroup:c.z},props:{rows:{type:Array,required:!0}},data(){return{selected:""}},computed:{scheduleOptions(){const e=this.rows.map((e=>e.sourceSchedule)).filter((e=>e));return Array.from(new Set(e))}},methods:{onSelect(e){this.selected=e,this.filterRows()},remove(){this.selected="",this.filterRows()},filterRows(){if(!this.selected)return void this.$emit("change-rows",this.rows);const e=this.rows.filter((e=>e.sourceSchedule===this.selected));this.$emit("change-rows",e,this.selected)}},watch:{rows:{deep:!0,immediate:!1,handler(){this.filterRows()}}}},p=(r(66251),r(47433));const u=(0,p.A)(d,[["render",i],["__scopeId","data-v-73bbeb06"]]);var h=u},58784:function(e,t,r){"use strict";r.d(t,{A:function(){return h}});var a=r(9274);const o={class:"overview-web-console"};function n(e,t,r,n,s,l){const i=(0,a.resolveComponent)("ButtonDropdown");return(0,a.openBlock)(),(0,a.createElementBlock)("div",o,[(0,a.createVNode)(i,{disabled:l.isOff,"no-drop":l.isOff,"button-label":"Console","dropdown-options":l.options,size:"sm",onClickAction:l.handleDropdown},null,8,["disabled","no-drop","dropdown-options","onClickAction"])])}var s=r(56345),l=r(65359),i=r(50784),c=r(20652),d={name:"VMConsoleBar",components:{ButtonDropdown:s.A},props:{resourceType:{type:Object,required:!0,default:()=>({})}},computed:{...(0,l.L8)({t:"i18n/t"}),isOff(){return this.resourceType.stateDisplay===i.OFF},options(){return[{label:this.t("harvester.virtualMachine.console.novnc"),value:"vnc"},{label:this.t("harvester.virtualMachine.console.serial"),value:"serial"}]}},methods:{handleDropdown(e){this.show(e.value)},show(e){let t=this.resourceType.metadata?.ownerReferences?.[0]?.uid;void 0===t&&(t=this.resourceType.metadata.uid);const r=window.location.host,a=window.location.pathname.replace(this.$route.path,""),o=this.$route?.params,n=`https://${r}${a}/${c.KR}/c/${o.cluster}/console/${t}/${e}`;window.open(n,"_blank",`toolbars=0,width=${screen.width-200},height=${screen.height-200},left=0,top=0,noreferrer`)},isEmpty(e){return void 0!==e&&0===Object.keys(e).length}}},p=(r(93969),r(47433));const u=(0,p.A)(d,[["render",n]]);var h=u},9470:function(e,t,r){"use strict";r.r(t),r.d(t,{NETWORK_HEADERS:function(){return b},default:function(){return $}});var a=r(9274);const o=e=>((0,a.pushScopeId)("data-v-3a727eb5"),e=e(),(0,a.popScopeId)(),e),n={key:1},s={class:"state"},l=o((()=>(0,a.createElementVNode)("span",{class:"tooltip-target"},[(0,a.createElementVNode)("i",{class:"icon icon-warning icon-lg text-warning"})],-1)));function i(e,t,r,o,i,c){const d=(0,a.resolveComponent)("Loading"),p=(0,a.resolveComponent)("router-link"),u=(0,a.resolveComponent)("Banner"),h=(0,a.resolveComponent)("BadgeState"),m=(0,a.resolveComponent)("v-dropdown"),f=(0,a.resolveComponent)("ResourceTable");return e.$fetchState.pending?((0,a.openBlock)(),(0,a.createBlock)(d,{key:0})):((0,a.openBlock)(),(0,a.createElementBlock)("div",n,[c.abnormalNetwork.length?((0,a.openBlock)(!0),(0,a.createElementBlock)(a.Fragment,{key:0},(0,a.renderList)(c.abnormalNetwork,((e,t)=>((0,a.openBlock)(),(0,a.createBlock)(u,{key:t,color:"error"},{default:(0,a.withCtx)((()=>[(0,a.createVNode)(p,{to:e.to},{default:(0,a.withCtx)((()=>[(0,a.createTextVNode)((0,a.toDisplayString)(e.name)+": ",1)])),_:2},1032,["to"]),(0,a.createTextVNode)(" "+(0,a.toDisplayString)(e.message),1)])),_:2},1024)))),128)):(0,a.createCommentVNode)("",!0),(0,a.createVNode)(f,(0,a.mergeProps)(e.$attrs,{headers:c.headers,"default-sort-by":"age",schema:c.schema,groupable:!0,rows:c.filterRows,"key-field":"_key"}),{"cell:state":(0,a.withCtx)((({row:e})=>[(0,a.createElementVNode)("div",s,[(0,a.createVNode)(h,{row:e},null,8,["row"]),e.clusterNetworkErrorMessage?((0,a.openBlock)(),(0,a.createBlock)(m,{key:0,trigger:"hover",offset:"16"},{popper:(0,a.withCtx)((()=>[(0,a.createElementVNode)("p",null,(0,a.toDisplayString)(e.clusterNetworkErrorMessage),1)])),default:(0,a.withCtx)((()=>[l])),_:2},1024)):(0,a.createCommentVNode)("",!0)])])),_:1},16,["headers","schema","rows"])]))}var c=r(35711),d=r(39053),p=r(25769),u=r(32810),h=r(94385),m=r(21835),f=r(29694),v=r(2602),g=r(32766);const y={id:g.rk.NETWORK_ATTACHMENT,type:m.yx,attributes:{kind:g.rk.NETWORK_ATTACHMENT,namespaced:!0},metadata:{name:g.rk.NETWORK_ATTACHMENT}},b=[h.o_,h.CU,{name:"type",value:"vlanType",sort:"spec.config",labelKey:"tableHeaders.networkType"},{name:"vlan",value:"vlanId",sort:"spec.config",labelKey:"tableHeaders.networkVlan"},{name:"connectivity",value:"connectivity",labelKey:"tableHeaders.routeConnectivity",formatter:"BadgeStateFormatter",formatterOpts:{arbitrary:!0},width:130},h.K];var k={name:"HarvesterListNetworks",components:{ResourceTable:p.A,Banner:c.l,Loading:d.A,BadgeState:u.A},async fetch(){const e=this.$store.getters["currentCluster"],t=e.isHarvester?"harvester":"cluster",r={rows:this.$store.dispatch(`${t}/findAll`,{type:m.XG})};this.$store.getters[`${t}/schemaFor`](g.rk.NODE_NETWORK)&&(r.hostNetworks=this.$store.dispatch(`${t}/findAll`,{type:g.rk.NODE_NETWORK})),this.$store.getters[`${t}/schemaFor`](g.rk.CLUSTER_NETWORK)&&(r.clusterNetworks=this.$store.dispatch(`${t}/findAll`,{type:g.rk.CLUSTER_NETWORK}));const a=await(0,f.kR)(r);this.rows=a.rows,this.hostNetworks=a.hostNetworks||[]},data(){return{hash:{},rows:[],hosts:[],hostNetworks:[]}},computed:{headers(){return[h.c4,h.o_,h.CU,{name:"type",value:"vlanType",sort:"spec.config",labelKey:"tableHeaders.networkType"},{name:"clusterNetwork",value:"clusterNetwork",sort:"clusterNetwork",labelKey:"harvester.network.clusterNetwork.label"},{name:"vlan",value:"vlanId",sort:"spec.config",labelKey:"tableHeaders.networkVlan"},{name:"connectivity",value:"connectivity",labelKey:"tableHeaders.routeConnectivity",formatter:"NetworkRouteConnectivity",formatterOpts:{arbitrary:!0},width:130},h.K]},schema(){return y},abnormalNetwork(){const e=this.hostNetworks.filter((e=>!e.isReady));return e.map((e=>e.linkMessage))},filterRows(){return this.rows.filter((e=>!e.metadata?.annotations?.[v.r.STORAGE_NETWORK]))}},typeDisplay(){return this.$store.getters["type-map/labelFor"](y,99)}},w=(r(55336),r(47433));const N=(0,w.A)(k,[["render",i],["__scopeId","data-v-3a727eb5"]]);var $=N},61117:function(e,t,r){"use strict";r.r(t),r.d(t,{default:function(){return k},schema:function(){return v}});var a=r(9274);const o={key:1},n={key:1};function s(e,t,r,s,l,i){const c=(0,a.resolveComponent)("Loading"),d=(0,a.resolveComponent)("Masthead"),p=(0,a.resolveComponent)("FilterVMSchedule"),u=(0,a.resolveComponent)("router-link"),h=(0,a.resolveComponent)("ResourceTable");return e.$fetchState.pending?((0,a.openBlock)(),(0,a.createBlock)(c,{key:0})):((0,a.openBlock)(),(0,a.createElementBlock)("div",o,[(0,a.createVNode)(d,{schema:null,resource:l.resource,"type-display":i.typeDisplay,"create-button-label":e.t("harvester.vmSnapshot.createText")},null,8,["resource","type-display","create-button-label"]),(0,a.createVNode)(h,(0,a.mergeProps)(e.$attrs,{headers:i.headers,groupable:!0,rows:i.filteredRows,schema:i.schema,"sort-generation-fn":i.sortGenerationFn,"key-field":"_key","default-sort-by":"age"}),(0,a.createSlots)({"col:name":(0,a.withCtx)((({row:e})=>[(0,a.createElementVNode)("td",null,[(0,a.createElementVNode)("span",null,[e.status&&e.status.source?((0,a.openBlock)(),(0,a.createBlock)(u,{key:0,to:e.detailLocation},{default:(0,a.withCtx)((()=>[(0,a.createTextVNode)((0,a.toDisplayString)(e.nameDisplay),1)])),_:2},1032,["to"])):((0,a.openBlock)(),(0,a.createElementBlock)("span",n,(0,a.toDisplayString)(e.nameDisplay),1))])])])),_:2},[i.schedulingVMBackupFeatureEnabled?{name:"more-header-middle",fn:(0,a.withCtx)((()=>[(0,a.createVNode)(p,{rows:i.getRawRows,onChangeRows:i.changeRows},null,8,["rows","onChangeRows"])])),key:"0"}:void 0]),1040,["headers","rows","schema","sort-generation-fn"])]))}var l=r(39053),i=r(43761),c=r(25769),d=r(21835),p=r(29694),u=r(59817),h=r(94385),m=r(32766),f=r(41837);const v={id:m.rk.VM_SNAPSHOT,type:d.yx,attributes:{kind:m.rk.VM_SNAPSHOT,namespaced:!0},metadata:{name:m.rk.VM_SNAPSHOT}};var g={name:"HarvesterListVMSnapshot",components:{ResourceTable:c.A,Loading:l.A,Masthead:i.A,FilterVMSchedule:u.A},async fetch(){const e=this.$store.getters["currentProduct"].inStore,t=await(0,p.kR)({vms:this.$store.dispatch(`${e}/findAll`,{type:m.rk.VM}),rows:this.$store.dispatch(`${e}/findAll`,{type:m.rk.BACKUP})}),r=this.$store.getters[`${e}/schemaFor`](m.rk.BACKUP);r?.collectionMethods.find((e=>"post"===e.toLowerCase()))||this.$store.dispatch("type-map/configureType",{match:m.rk.VM_SNAPSHOT,isCreatable:!1}),this.rows=t.rows,this.snapshots=t.rows},data(){const e={...this.$route.params},t=e.resource;return{rows:[],snapshots:[],searchSchedule:"",resource:t}},computed:{headers(){const e=[h.c4,h.o_,h.CU,{name:"targetVM",labelKey:"harvester.tableHeaders.targetVm",value:"attachVM",align:"left",sort:"attachVM",formatter:"AttachVMWithName"}];return this.schedulingVMBackupFeatureEnabled&&e.push({name:"backupCreatedFrom",labelKey:"harvester.tableHeaders.vmSchedule",value:"sourceSchedule",sort:"sourceSchedule",formatter:"BackupCreatedFrom"}),e.push({name:"readyToUse",labelKey:"tableHeaders.readyToUse",value:"status.readyToUse",align:"center",sort:"status.readyToUse",formatter:"Checked"},h.K),e},schedulingVMBackupFeatureEnabled(){return this.$store.getters["harvester-common/getFeatureEnabled"]("schedulingVMBackup")},getRawRows(){return this.rows.filter((e=>e.spec?.type===f.a.SNAPSHOT))},schema(){return v},typeDisplay(){return this.$store.getters["type-map/labelFor"](v,99)},filteredRows(){return this.snapshots.filter((e=>e.spec?.type!==f.a.BACKUP))}},methods:{changeRows(e,t){this["searchSchedule"]=t,this["snapshots"]=e},sortGenerationFn(){let e=(0,c.S)(this.schema,this.$store);return e+=this.searchSchedule,e}}},y=r(47433);const b=(0,y.A)(g,[["render",s]]);var k=b},29809:function(e,t,r){"use strict";r.r(t),r.d(t,{VM_HEADERS:function(){return y},default:function(){return N}});var a=r(9274);const o={key:1},n={class:"state"},s={class:"name-console"},l={key:1};function i(e,t,r,i,c,d){const p=(0,a.resolveComponent)("Loading"),u=(0,a.resolveComponent)("HarvesterVmState"),h=(0,a.resolveComponent)("router-link"),m=(0,a.resolveComponent)("ConsoleBar"),f=(0,a.resolveComponent)("ResourceTable"),v=(0,a.resolveDirective)("tooltip");return e.$fetchState.pending?((0,a.openBlock)(),(0,a.createBlock)(p,{key:0})):((0,a.openBlock)(),(0,a.createElementBlock)("div",o,[(0,a.createVNode)(f,(0,a.mergeProps)(e.$attrs,{headers:d.headers,"default-sort-by":"age",rows:d.rows,schema:r.schema,groupable:!0,"key-field":"_key"}),{"cell:state":(0,a.withCtx)((e=>[(0,a.createElementVNode)("div",n,[(0,a.createVNode)(u,{class:"vmstate",row:e.row,"all-node-network":c.allNodeNetworks,"all-cluster-network":c.allClusterNetworks},null,8,["row","all-node-network","all-cluster-network"])])])),"cell:name":(0,a.withCtx)((e=>[(0,a.createElementVNode)("div",s,[e.row.type!==c.HCI.VMI?((0,a.openBlock)(),(0,a.createBlock)(h,{key:0,to:e.row.detailLocation},{default:(0,a.withCtx)((()=>[(0,a.createTextVNode)((0,a.toDisplayString)(e.row.metadata.name)+" ",1),d.lockIconTooltipMessage(e.row)?(0,a.withDirectives)(((0,a.openBlock)(),(0,a.createElementBlock)("i",{key:0,class:(0,a.normalizeClass)(["icon icon-lock",{"green-icon":"all"===e.row.encryptedVolumeType,"yellow-icon":"partial"===e.row.encryptedVolumeType}])},null,2)),[[v,d.lockIconTooltipMessage(e.row)]]):(0,a.createCommentVNode)("",!0)])),_:2},1032,["to"])):((0,a.openBlock)(),(0,a.createElementBlock)("span",l,(0,a.toDisplayString)(e.row.metadata.name),1)),(0,a.createVNode)(m,{"resource-type":e.row,class:"console mr-10 ml-10"},null,8,["resource-type"])])])),_:1},16,["headers","rows","schema"])]))}var c=r(25769),d=r(94385),p=r(21835),u=r(29694),h=r(39053),m=r(18872),f=r(32766),v=r(98993),g=r(58784);const y=[d.c4,{...d.o_,width:350},d.CU,{name:"CPU",label:"CPU",sort:["spec.template.spec.domain.cpu.cores"],value:"spec.template.spec.domain.cpu.cores",align:"center",dashIfEmpty:!0},{name:"Memory",value:"displayMemory",sort:["memorySort"],align:"center",labelKey:"tableHeaders.memory",formatter:"Si",formatterOpts:{opts:{increment:1024,addSuffix:!0,maxExponent:3,minExponent:3,suffix:"i"},needParseSi:!0}},{name:"ip",label:"IP Address",value:"id",formatter:"HarvesterIpAddress",labelKey:"tableHeaders.ipAddress",sort:["id"]},{...d.K,sort:"metadata.creationTimestamp:desc"}];var b={name:"HarvesterListVM",components:{Loading:h.A,HarvesterVmState:v["default"],ConsoleBar:g.A,ResourceTable:c.A},props:{schema:{type:Object,required:!0}},async fetch(){const e=this.$store.getters["currentProduct"].inStore,t={vms:this.$store.dispatch(`${e}/findAll`,{type:f.rk.VM}),pod:this.$store.dispatch(`${e}/findAll`,{type:p.Sm}),pvcs:this.$store.dispatch(`${e}/findAll`,{type:p.YH}),pvs:this.$store.dispatch(`${e}/findAll`,{type:p.PV}),images:this.$store.dispatch(`${e}/findAll`,{type:f.rk.IMAGE}),restore:this.$store.dispatch(`${e}/findAll`,{type:f.rk.RESTORE}),backups:this.$store.dispatch(`${e}/findAll`,{type:f.rk.BACKUP}),storage:this.$store.dispatch(`${e}/findAll`,{type:p.fJ})};this.$store.getters[`${e}/schemaFor`](f.rk.RESOURCE_QUOTA)&&(t.resourceQuotas=this.$store.dispatch(`${e}/findAll`,{type:f.rk.RESOURCE_QUOTA})),this.$store.getters[`${e}/schemaFor`](p.NW)&&(t.nodes=this.$store.dispatch(`${e}/findAll`,{type:p.NW}),this.hasNode=!0),this.$store.getters[`${e}/schemaFor`](f.rk.NODE_NETWORK)&&(t.nodeNetworks=this.$store.dispatch(`${e}/findAll`,{type:f.rk.NODE_NETWORK})),this.$store.getters[`${e}/schemaFor`](f.rk.CLUSTER_NETWORK)&&(t.clusterNetworks=this.$store.dispatch(`${e}/findAll`,{type:f.rk.CLUSTER_NETWORK}));const r=await(0,u.kR)(t);this.allVMs=r.vms,this.allNodeNetworks=r.nodeNetworks||[],this.allClusterNetworks=r.clusterNetworks||[]},data(){return{hasNode:!1,allVMs:[],allVMIs:[],allNodeNetworks:[],allClusterNetworks:[],HCI:f.rk}},computed:{headers(){const e={name:"restoreProgress",labelKey:"harvester.tableHeaders.restore",value:"restoreProgress",align:"left",formatter:"HarvesterBackupProgressBar",width:200},t={name:"node",label:"Node",value:"nodeName",sort:["realAttachNodeName"],formatter:"HarvesterHost",labelKey:"harvester.tableHeaders.vm.node"},r=(0,m.o8)(y);return this.hasNode&&r.splice(-1,0,t),this.hasBackUpRestoreInProgress&&r.splice(-1,0,e),r},rows(){const e=this.allVMIs.filter((e=>!this.allVMs.find((t=>t.id===e.id))));return[...this.allVMs,...e]},hasBackUpRestoreInProgress(){return!!this.rows.find((e=>e.restoreResource&&!e.restoreResource.fromSnapshot&&!e.restoreResource.isComplete))}},async created(){const e=this.$store.getters["currentProduct"].inStore,t=await this.$store.dispatch(`${e}/findAll`,{type:f.rk.VMI});await this.$store.dispatch(`${e}/findAll`,{type:f.rk.VMIM}),this["allVMIs"]=t},methods:{lockIconTooltipMessage(e){const t="";return"all"===e.encryptedVolumeType?this.t("harvester.virtualMachine.volume.lockTooltip.all"):"partial"===e.encryptedVolumeType?this.t("harvester.virtualMachine.volume.lockTooltip.partial"):t}}},k=(r(76945),r(47433));const w=(0,k.A)(b,[["render",i],["__scopeId","data-v-731b1bf3"]]);var N=w},47488:function(e,t,r){"use strict";r.d(t,{A:function(){return H}});var a=r(9274);const o={class:"graph-options mb-10"},n={class:"info"};function s(e,t,r,s,l,i){const c=(0,a.resolveComponent)("DashboardOptions"),d=(0,a.resolveComponent)("GrafanaDashboard");return(0,a.openBlock)(),(0,a.createElementBlock)("div",{class:(0,a.normalizeClass)(["dashboard-metrics",!r.hasSummaryAndDetail&&"external-link-pull-left"])},[(0,a.createElementVNode)("div",o,[(0,a.createVNode)(c,{value:l.graphOptions,"onUpdate:value":t[0]||(t[0]=e=>l.graphOptions=e),"has-summary-and-detail":r.hasSummaryAndDetail},null,8,["value","has-summary-and-detail"])]),(0,a.createElementVNode)("div",n,[(0,a.renderSlot)(e.$slots,"default",{},void 0,!0)]),(0,a.createElementVNode)("div",{class:"graphs",style:(0,a.normalizeStyle)({height:r.graphHeight})},["detail"===l.graphOptions.type?((0,a.openBlock)(),(0,a.createBlock)(d,{key:"'detail'",class:"col span-12 detail","background-color":i.graphBackgroundColor,theme:i.theme,"refresh-rate":l.graphOptions.refreshRate,range:l.graphOptions.range,url:r.detailUrl,vars:r.vars,"modify-prefix":r.modifyPrefix},null,8,["background-color","theme","refresh-rate","range","url","vars","modify-prefix"])):((0,a.openBlock)(),(0,a.createBlock)(d,{key:"'summary'",class:"col span-12 summary","background-color":i.graphBackgroundColor,theme:i.theme,"refresh-rate":l.graphOptions.refreshRate,range:l.graphOptions.range,url:r.summaryUrl,vars:r.vars,"modify-prefix":r.modifyPrefix},null,8,["background-color","theme","refresh-rate","range","url","vars","modify-prefix"]))],4)],2)}const l=e=>((0,a.pushScopeId)("data-v-25448064"),e=e(),(0,a.popScopeId)(),e),i={class:"graph-options"},c={key:0},d={key:1},p=l((()=>(0,a.createElementVNode)("div",null,null,-1))),u=[p],h={class:"range-refresh"};function m(e,t,r,o,n,s){const l=(0,a.resolveComponent)("ButtonGroup"),p=(0,a.resolveComponent)("LabeledSelect");return(0,a.openBlock)(),(0,a.createElementBlock)("div",i,[r.hasSummaryAndDetail?((0,a.openBlock)(),(0,a.createElementBlock)("div",c,[(0,a.createVNode)(l,{value:r.value.type,"onUpdate:value":t[0]||(t[0]=e=>r.value.type=e),options:n.detailSummaryOptions},null,8,["value","options"])])):((0,a.openBlock)(),(0,a.createElementBlock)("div",d,u)),(0,a.createElementVNode)("div",h,[(0,a.createVNode)(p,{value:r.value.range,"onUpdate:value":t[1]||(t[1]=e=>r.value.range=e),options:n.rangeOptions,label:e.t("graphOptions.range")},null,8,["value","options","label"]),(0,a.createVNode)(p,{value:r.value.refreshRate,"onUpdate:value":t[2]||(t[2]=e=>r.value.refreshRate=e),options:n.refreshOptions,label:e.t("graphOptions.refresh")},null,8,["value","options","label"])])])}var f=r(67226),v=r(77720),g={components:{ButtonGroup:f.A,LabeledSelect:v.A},props:{value:{type:Object,required:!0},hasSummaryAndDetail:{type:Boolean,default:!0}},data(){return{range:null,rangeOptions:[{label:this.t("generic.units.time.5m"),value:"5m"},{label:this.t("generic.units.time.1h"),value:"1h"},{label:this.t("generic.units.time.6h"),value:"6h"},{label:this.t("generic.units.time.1d"),value:"1d"},{label:this.t("generic.units.time.7d"),value:"7d"},{label:this.t("generic.units.time.30d"),value:"30d"}],refreshOptions:[{label:this.t("generic.units.time.5s"),value:"5s"},{label:this.t("generic.units.time.10s"),value:"10s"},{label:this.t("generic.units.time.30s"),value:"30s"},{label:this.t("generic.units.time.1m"),value:"1m"},{label:this.t("generic.units.time.5m"),value:"5m"},{label:this.t("generic.units.time.15m"),value:"15m"},{label:this.t("generic.units.time.30m"),value:"30m"},{label:this.t("generic.units.time.1h"),value:"1h"},{label:this.t("generic.units.time.2h"),value:"2h"},{label:this.t("generic.units.time.1d"),value:"1d"}],detailSummaryOptions:[{label:this.t("graphOptions.detail"),value:"detail"},{label:this.t("graphOptions.summary"),value:"summary"}]}}},y=(r(85319),r(47433));const b=(0,y.A)(g,[["render",m],["__scopeId","data-v-25448064"]]);var k=b;const w=e=>((0,a.pushScopeId)("data-v-6f5ce7d8"),e=e(),(0,a.popScopeId)(),e),N={class:"grafana-graph"},$={class:"text-center"},C=["src"],S={key:1},V={key:2,class:"external-link"},A=["href"],E=w((()=>(0,a.createElementVNode)("i",{class:"icon icon-external-link"},null,-1)));function x(e,t,r,o,n,s){const l=(0,a.resolveComponent)("Banner"),i=(0,a.resolveComponent)("Loading");return(0,a.openBlock)(),(0,a.createElementBlock)("div",N,[n.error?((0,a.openBlock)(),(0,a.createBlock)(l,{key:0,color:"error",style:{"z-index":"1000"}},{default:(0,a.withCtx)((()=>[(0,a.createElementVNode)("div",$,[(0,a.createTextVNode)((0,a.toDisplayString)(e.t("grafanaDashboard.failedToLoad"))+" ",1),(0,a.createElementVNode)("a",{href:"#",onClick:t[0]||(t[0]=(...e)=>s.reload&&s.reload(...e))},(0,a.toDisplayString)(e.t("grafanaDashboard.reload")),1)])])),_:1})):(0,a.createCommentVNode)("",!0),(0,a.withDirectives)((0,a.createElementVNode)("iframe",{ref:"frame",class:(0,a.normalizeClass)({loading:n.loading,frame:!0}),src:s.currentUrl,frameborder:"0",scrolling:"no"},null,10,C),[[a.vShow,!n.error]]),n.loading?((0,a.openBlock)(),(0,a.createElementBlock)("div",S,[(0,a.createVNode)(i)])):(0,a.createCommentVNode)("",!0),n.loading||n.error?(0,a.createCommentVNode)("",!0):((0,a.openBlock)(),(0,a.createElementBlock)("div",V,[(0,a.createElementVNode)("a",{href:s.grafanaUrl,target:"_blank",rel:"noopener nofollow"},[(0,a.createTextVNode)((0,a.toDisplayString)(e.t("grafanaDashboard.grafana"))+" ",1),E],8,A)]))])}var B=r(39053),T=r(35711),M=r(92201),R=r(21835),_={components:{Banner:T.l,Loading:B.A},props:{url:{type:String,required:!0},vars:{type:Object,default:()=>({})},range:{type:String,default:null},refreshRate:{type:String,default:null},modifyPrefix:{type:Boolean,default:!0},backgroundColor:{type:String,default:"#1b1c21"},theme:{type:String,default:"dark"}},async fetch(){const e=this.$store.getters["currentProduct"].inStore;if(this.$store.getters[`${e}/canList`](R.W8.APP))try{const t=await this.$store.dispatch(`${e}/find`,{type:R.W8.APP,id:"cattle-monitoring-system/rancher-monitoring"});this.monitoringVersion=t?.currentVersion}catch(t){}},data(){return{loading:!1,error:!1,interval:null,errorTimer:null,monitoringVersion:""}},computed:{currentUrl(){return this.computeUrl()},grafanaUrl(){return this.currentUrl.replace("&kiosk","")},graphWindow(){return this.$refs.frame?.contentWindow},graphHistory(){return this.graphWindow?.history},graphDocument(){return this.graphWindow?.document}},watch:{currentUrl(e){this.graphHistory&&this.graphWindow?.angular&&this.graphWindow.location.replace(e)},error(e){e?this.errorTimer=setInterval((()=>{this.reload()}),45e3):(clearInterval(this.errorTimer),this.errorTimer=null)}},mounted(){this.$refs.frame.onload=this.inject,this.poll()},beforeUnmount(){this.interval&&clearInterval(this.interval),this.errorTimer&&clearInterval(this.errorTimer)},methods:{poll(){this.interval&&(clearInterval(this.interval),this.interval=null),this.interval=setInterval((()=>{try{const e=this.$refs.frame?.contentWindow,t=e.document.querySelectorAll('[class$="alert-error'),r=e.document.querySelectorAll('[class$="panel-info-corner--error'),a=e.document.querySelectorAll('[class$="panel-in-fullscreen'),o=e.document.querySelectorAll('[class$="panel-container'),n=t.length>0||r.length>0,s=a.length>0||o.length>0,l=e.document.getElementsByTagName("pre"),i=l.length>0?l[0].innerText:"",c=i.includes('"status": "Failure"');if(n)throw new Error("An error was detected in the iframe");this["loading"]=!s,this["error"]=c}catch(e){this["error"]=!0,this["loading"]=!1,clearInterval(this.interval),this.interval=null}}),100)},computeFromTo(){return{from:`now-${this.range}`,to:"now"}},computeUrl(){const e=this.url,t=this.$store.getters["currentCluster"].id,r=this.computeParams();return(0,M.l9)(this.monitoringVersion,e,t,r,this.modifyPrefix)},computeParams(){const e={},t=this.computeFromTo();return t.from&&(e.from=t.from),t.to&&(e.to=t.to),this.refreshRate&&(e.refresh=this.refreshRate),Object.keys(this.vars).length>0&&Object.entries(this.vars).forEach((t=>{const r=`var-${t[0]}`;e[r]=t[1]})),e.theme=this.theme,e},reload(e){e&&e.preventDefault(),this.$refs.frame.contentWindow.location.reload(),this.poll()},injectCss(){const e=document.createElement("style");e.innerHTML=`\n body .grafana-app .dashboard-content {\n background: ${this.backgroundColor};\n padding: 0;\n }\n\n body .grafana-app .layout {\n background: ${this.backgroundColor};\n }\n\n\n body .grafana-app .dashboard-content .panel-container {\n background-color: initial;\n border: none;\n }\n\n body .grafana-app .dashboard-content .panel-wrapper {\n height: 100%;\n }\n\n body .grafana-app .panel-menu-container {\n display: none;\n }\n\n body .grafana-app .panel-title {\n cursor: default;\n }\n\n body .grafana-app .panel-title .panel-title-text div {\n display: none;\n }\n `;const t=this.$refs.frame?.contentWindow,r=t?.document;r.head&&r.head.appendChild(e)},inject(){this.injectCss()}}};r(88128);const O=(0,y.A)(_,[["render",x],["__scopeId","data-v-6f5ce7d8"]]);var I=O,P=r(97e3),D={components:{DashboardOptions:k,GrafanaDashboard:I},props:{detailUrl:{type:String,required:!0},summaryUrl:{type:String,default:""},vars:{type:Object,default:()=>({})},graphHeight:{type:String,required:!0},hasSummaryAndDetail:{type:Boolean,default:!0},modifyPrefix:{type:Boolean,default:!0}},data(){return{graphOptions:{range:"5m",refreshRate:"30s",type:"detail"}}},computed:{...(0,P.L8)(["prefs/theme"]),graphBackgroundColor(){return"dark"===this.theme?"#2e3035":"#f3f4f9"},theme(){return this["prefs/theme"]}}};r(96678);const U=(0,y.A)(D,[["render",s],["__scopeId","data-v-a6c417a4"]]);var H=U},53707:function(e,t,r){"use strict";r.r(t);var a=r(36758),o=r.n(a),n=r(40935),s=r.n(n),l=s()(o());l.push([e.id,".vm-schedule-filter[data-v-73bbeb06]{display:inline-block}.vm-schedule-filter .banner-item[data-v-73bbeb06]{display:inline-block;font-size:16px;margin-right:10px;padding:6px;border-radius:2px}.vm-schedule-filter .banner-item i[data-v-73bbeb06]{cursor:pointer;vertical-align:middle}.filter-popup[data-v-73bbeb06]{width:-moz-max-content;width:max-content}",""]),t["default"]=l},37201:function(e,t,r){"use strict";r.r(t);var a=r(36758),o=r.n(a),n=r(40935),s=r.n(n),l=s()(o());l.push([e.id,".overview-web-console .btn{line-height:24px;min-height:24px}",""]),t["default"]=l},62376:function(e,t,r){"use strict";r.r(t);var a=r(36758),o=r.n(a),n=r(40935),s=r.n(n),l=s()(o());l.push([e.id,".state[data-v-3a727eb5]{display:flex;justify-content:space-between}.state .icon-warning[data-v-3a727eb5]{margin-top:2px}",""]),t["default"]=l},60049:function(e,t,r){"use strict";r.r(t);var a=r(36758),o=r.n(a),n=r(40935),s=r.n(n),l=s()(o());l.push([e.id,".state[data-v-731b1bf3]{display:flex}.state .vmstate[data-v-731b1bf3]{margin-right:6px}.green-icon[data-v-731b1bf3]{color:var(--success)}.yellow-icon[data-v-731b1bf3]{color:var(--warning)}.name-console[data-v-731b1bf3]{display:flex;align-items:center;justify-content:space-between}.name-console span[data-v-731b1bf3]{padding-right:4px;line-height:26px;white-space:nowrap}",""]),t["default"]=l},60838:function(e,t,r){"use strict";r.r(t);var a=r(36758),o=r.n(a),n=r(40935),s=r.n(n),l=s()(o());l.push([e.id,".dashboard-metrics[data-v-a6c417a4] .external-link{position:absolute;left:200px;top:-45px}.dashboard-metrics[data-v-a6c417a4] .frame{top:0}.dashboard-metrics.external-link-pull-left[data-v-a6c417a4] .external-link{position:absolute;left:10px;top:-47px}",""]),t["default"]=l},83111:function(e,t,r){"use strict";r.r(t);var a=r(36758),o=r.n(a),n=r(40935),s=r.n(n),l=s()(o());l.push([e.id,".graph-options[data-v-25448064],.graph-options .range-refresh[data-v-25448064]{display:flex;flex-direction:row;justify-content:flex-end}.graph-options[data-v-25448064]{justify-content:space-between;align-items:center}.graph-options .labeled-select[data-v-25448064]{width:100px;margin-left:10px}",""]),t["default"]=l},65664:function(e,t,r){"use strict";r.r(t);var a=r(36758),o=r.n(a),n=r(40935),s=r.n(n),l=s()(o());l.push([e.id,".grafana-graph[data-v-6f5ce7d8]{position:relative;min-height:100%;min-width:100%}.grafana-graph[data-v-6f5ce7d8] .content{position:relative;display:flex;flex-direction:column;justify-content:center;align-items:center;width:100%;height:100%;padding:0}.grafana-graph[data-v-6f5ce7d8] .overlay{position:static;background-color:initial}.grafana-graph iframe[data-v-6f5ce7d8]{position:absolute;left:0;right:0;top:20px;bottom:0;width:100%;height:100%;overflow:hidden}.grafana-graph iframe.loading[data-v-6f5ce7d8]{visibility:hidden}",""]),t["default"]=l},5662:function(e,t,r){"use strict";function a(e){const t=Object.keys(e),r=Object.values(e);return Promise.allSettled(r).then((e=>{const r={};for(let a=0;a{}),this.pollRateMs=t,this.maxRetries=r}start(){this.stop(),this._intervalMethod(),this.intervalId=setInterval((()=>this._intervalMethod()),this.pollRateMs)}stop(){this.intervalId&&(clearInterval(this.intervalId),this.intervalId=void 0)}async _intervalMethod(){try{await this.fn(),this.tryCount=0}catch(e){a.error("Error encountered while polling",e),++this.tryCount>=this.maxRetries&&this.stop()}}}const i=3e4,c=2;var d={data(){return{metricPoller:null}},mounted(){this.metricPoller=new l(this.loadMetrics,i,c),this.metricPoller.start()},beforeUnmount(){this.metricPoller.stop()}}},92201:function(e,t,r){"use strict";r.d(t,{Qr:function(){return d},l9:function(){return i}});var a=r(96291),o=r(17250),n=r(21835);const s=["100.2.0+up40.1.2","102.0.0+up40.1.2"];function l(e,t){return s.includes(e)?`/k8s/clusters/${t}`:"local"===t?"":`/k8s/clusters/${t}`}function i(e,t,r,a,n=!0){const s=(0,o.qg)(t);let i=n?`${l(e,r)}${s.path}`:s.path;return s.query.viewPanel&&(i=(0,o.R_)(i,"viewPanel",s.query.viewPanel)),i=(0,o.R_)(i,"orgId",s.query.orgId),i=(0,o.R_)(i,"kiosk",null),Object.entries(a).forEach((e=>{i=(0,o.R_)(i,e[0],e[1])})),i}async function c(e,t,r,n,s="cluster",i=null){if(!(0,a.de)(t.getters))return!1;const c=(0,o.qg)(n);let d=`${l(e,r)}/api/v1/namespaces/cattle-monitoring-system/services/http:rancher-monitoring-grafana:80/proxy/`,p="http:rancher-monitoring-grafana:80/proxy/";i&&(d=`${l(e,r)}/api/v1/namespaces/cattle-project-${i}-monitoring/services/http:cattle-project-${i}-monitoring-grafana:80/proxy/`,p=`http:cattle-project-${i}-monitoring-grafana:80/proxy/`);const u=c.path.split(p)[1],h=u.split("/")[1],m=`${d}api/dashboards/uid/${h}`;try{return await t.dispatch(`${s}/request`,{url:m,redirectUnauthorized:!1}),!0}catch(f){return!1}}async function d(e,t,r,a="cluster",o=null){let s,l="";if(!o&&e.getters[`${a}/canList`](n.W8.APP)){try{s=await e.dispatch(`${a}/find`,{type:n.W8.APP,id:"cattle-monitoring-system/rancher-monitoring"})}catch(d){}l=s?.currentVersion}const i=r.map((r=>c(l,e,t,r,a,o)));return(await Promise.all(i)).every((e=>e))}},66251:function(e,t,r){var a=r(53707);a.__esModule&&(a=a.default),"string"===typeof a&&(a=[[e.id,a,""]]),a.locals&&(e.exports=a.locals);var o=r(74825).A;o("5fa013cd",a,!0,{sourceMap:!1,shadowMode:!1})},93969:function(e,t,r){var a=r(37201);a.__esModule&&(a=a.default),"string"===typeof a&&(a=[[e.id,a,""]]),a.locals&&(e.exports=a.locals);var o=r(74825).A;o("84bb1b30",a,!0,{sourceMap:!1,shadowMode:!1})},55336:function(e,t,r){var a=r(62376);a.__esModule&&(a=a.default),"string"===typeof a&&(a=[[e.id,a,""]]),a.locals&&(e.exports=a.locals);var o=r(74825).A;o("526396c4",a,!0,{sourceMap:!1,shadowMode:!1})},76945:function(e,t,r){var a=r(60049);a.__esModule&&(a=a.default),"string"===typeof a&&(a=[[e.id,a,""]]),a.locals&&(e.exports=a.locals);var o=r(74825).A;o("52385cd1",a,!0,{sourceMap:!1,shadowMode:!1})},96678:function(e,t,r){var a=r(60838);a.__esModule&&(a=a.default),"string"===typeof a&&(a=[[e.id,a,""]]),a.locals&&(e.exports=a.locals);var o=r(74825).A;o("ee9a19c0",a,!0,{sourceMap:!1,shadowMode:!1})},85319:function(e,t,r){var a=r(83111);a.__esModule&&(a=a.default),"string"===typeof a&&(a=[[e.id,a,""]]),a.locals&&(e.exports=a.locals);var o=r(74825).A;o("5cce545c",a,!0,{sourceMap:!1,shadowMode:!1})},88128:function(e,t,r){var a=r(65664);a.__esModule&&(a=a.default),"string"===typeof a&&(a=[[e.id,a,""]]),a.locals&&(e.exports=a.locals);var o=r(74825).A;o("cd7d6506",a,!0,{sourceMap:!1,shadowMode:!1})}}]); //# sourceMappingURL=harvester-1.0.1.umd.min.62.js.map