harvester-ui-extension/extensions/harvester/1.5.2-rc2/plugin/harvester-1.5.2-rc2.umd.min.395.js

2 lines
12 KiB
JavaScript

(("undefined"!==typeof self?self:this)["webpackChunkharvester_1_5_2_rc2"]=("undefined"!==typeof self?self:this)["webpackChunkharvester_1_5_2_rc2"]||[]).push([[395],{67740:function(e,t,r){"use strict";r.d(t,{A:function(){return h}});var s=r(9274);const o={class:"filter"},a={key:0,class:"banner-item bg-warning"},n={ref:"actionDropDown",class:"btn bg-primary mr-10"},i={class:"filter-popup"};function l(e,t,r,l,c,p){const d=(0,s.resolveComponent)("LabeledSelect"),u=(0,s.resolveComponent)("v-dropdown");return(0,s.openBlock)(),(0,s.createElementBlock)("div",o,[c.parentSriov?((0,s.openBlock)(),(0,s.createElementBlock)("span",a,[(0,s.createTextVNode)((0,s.toDisplayString)(c.parentSriov)+" ",1),(0,s.createElementVNode)("i",{class:"icon icon-close",onClick:t[0]||(t[0]=e=>p.remove())})])):(0,s.createCommentVNode)("",!0),(0,s.createVNode)(u,{"popper-class":"filter-parent-sriov",trigger:"click",placement:"bottom-end",distance:20},{popper:(0,s.withCtx)((()=>[(0,s.createElementVNode)("div",i,[(0,s.createElementVNode)("div",null,[(0,s.createVNode)(d,{value:c.parentSriov,"onUpdate:value":t[1]||(t[1]=e=>c.parentSriov=e),options:r.parentSriovOptions,searchable:!0,label:r.label},null,8,["value","options","label"])])])])),default:(0,s.withCtx)((()=>[(0,s.renderSlot)(e.$slots,"header",{},(()=>[(0,s.createElementVNode)("button",n,[(0,s.renderSlot)(e.$slots,"title",{},(()=>[(0,s.createTextVNode)((0,s.toDisplayString)(r.label),1)]),!0)],512)]),!0)])),_:3})])}var c=r(8077),p={name:"HarvesterFilterLabel",emits:["change-rows"],components:{LabeledSelect:c.A},props:{rows:{type:Array,required:!0},parentSriovOptions:{type:Array,required:!0},parentSriovLabel:{type:String,required:!0},label:{type:String,required:!0}},data(){return{parentSriov:this.$route.query?.parentSriov||null}},methods:{remove(){this.parentSriov=null,this.filterRows()},filterRows(){const e=this.rows.filter((e=>{if(!this.parentSriov)return!0;const t=e.labels[this.parentSriovLabel];return t===this.parentSriov}));this.$emit("change-rows",e,this.parentSriov)}},watch:{parentSriov:{deep:!0,immediate:!0,handler(){this.filterRows()}}}},d=(r(73876),r(66446),r(47433));const u=(0,d.A)(p,[["render",l],["__scopeId","data-v-f3c890e8"]]);var h=u},79428:function(e,t,r){"use strict";r.r(t),r.d(t,{default:function(){return w}});var s=r(9274);const o=["onClick"],a=["onClick"],n={key:0},i={key:1,class:"text-muted"};function l(e,t,r,l,c,p){const d=(0,s.resolveComponent)("FilterBySriov"),u=(0,s.resolveComponent)("ResourceTable"),h=(0,s.resolveDirective)("clean-html"),v=(0,s.resolveDirective)("trim-whitespace");return(0,s.openBlock)(),(0,s.createBlock)(u,{headers:c.headers,schema:r.schema,rows:c.filterRows,"use-query-params-for-simple-filtering":!0,"sort-generation-fn":p.sortGenerationFn,"rows-per-page":10},{"group-by":(0,s.withCtx)((({group:t})=>[(0,s.withDirectives)(((0,s.openBlock)(),(0,s.createElementBlock)("div",{ref:t.key,class:"group-tab"},[p.groupIsAllEnabled(t.rows)?((0,s.openBlock)(),(0,s.createElementBlock)("button",{key:0,type:"button",class:"btn btn-sm role-secondary mr-5",onClick:e=>{p.disableGroup(t.rows),e.target.blur()}},(0,s.toDisplayString)(e.t("harvester.pci.disableGroup")),9,o)):((0,s.openBlock)(),(0,s.createElementBlock)("button",{key:1,type:"button",class:"btn btn-sm role-secondary mr-5",onClick:e=>{p.enableGroup(t.rows),e.target.blur()}},(0,s.toDisplayString)(e.t("harvester.pci.enableGroup")),9,a)),(0,s.withDirectives)((0,s.createElementVNode)("span",null,null,512),[[h,t.key]])])),[[v]])])),"cell:claimed":(0,s.withCtx)((({row:e})=>[e.isEnabled?((0,s.openBlock)(),(0,s.createElementBlock)("span",n,(0,s.toDisplayString)(e.claimedBy),1)):((0,s.openBlock)(),(0,s.createElementBlock)("span",i,"—"))])),"more-header-middle":(0,s.withCtx)((()=>[(0,s.createVNode)(d,{ref:"filterByParentSRIOV","parent-sriov-options":p.parentSriovOptions,"parent-sriov-label":p.parentSriovLabel,label:e.t("harvester.sriov.parentSriov"),rows:c.rows,onChangeRows:p.changeRows},null,8,["parent-sriov-options","parent-sriov-label","label","rows","onChangeRows"])])),_:1},8,["headers","schema","rows","sort-generation-fn"])}var c=r(31400),p=r(68774),d=r(88339),u=r(2602),h=r(32766),v=r(67740),m={name:"ListPciDevices",components:{ResourceTable:c.A,FilterBySriov:v.A},inheritAttrs:!1,props:{schema:{type:Object,required:!0},devices:{type:Array,required:!0}},async fetch(){const e=this.$store.getters["currentProduct"].inStore,t={pciclaims:this.$store.dispatch(`${e}/findAll`,{type:h.rk.PCI_CLAIM}),sriovs:this.$store.dispatch(`${e}/findAll`,{type:h.rk.SR_IOV})};await(0,d.kR)(t)},data(){const e=this.$store.getters["isSingleProduct"],t=[{...p.c4},p.X0,{name:"description",labelKey:"tableHeaders.description",value:"status.description",sort:["status.description"]},{name:"node",labelKey:"tableHeaders.node",value:"status.nodeName",sort:["status.nodeName"]},{name:"address",label:"Address",value:"status.address",sort:["status.address"]},{name:"vendorid",label:"Vendor ID",value:"status.vendorId",sort:["status.vendorId","status.deviceId"]},{name:"deviceid",label:"Device ID",value:"status.deviceId",sort:["status.deviceId","status.vendorId"]}];return e||t.push({name:"claimed",label:"Claimed By",value:"passthroughClaim.userName",sort:["passthroughClaim.userName"]}),{headers:t,rows:[],parentSriov:null,filterRows:[]}},watch:{devices:{handler(e){this.rows=e,this.parentSriov?this.filterRows=this.rows.filter((e=>e.labels[this.parentSriovLabel]===this.parentSriov)):this.filterRows=this.rows},immediate:!0}},computed:{parentSriovOptions(){const e=this.$store.getters["currentProduct"].inStore,t=this.$store.getters[`${e}/all`](h.rk.SR_IOV)||[];return t.map((e=>e.id))},parentSriovLabel(){return u.r.PARENT_SRIOV}},methods:{enableGroup(e=[]){const t=e[0];t&&t.enablePassthroughBulk(e)},disableGroup(e=[]){e.forEach((e=>{e.passthroughClaim&&e.disablePassthrough()}))},groupIsAllEnabled(e=[]){return!e.find((e=>!e.passthroughClaim))},changeRows(e,t){this["filterRows"]=e,this["parentSriov"]=t},sortGenerationFn(){let e=(0,c.S)(this.schema,this.$store);return this.parentSriov&&(e+=this.parentSriov),e}}},b=r(47433);const f=(0,b.A)(m,[["render",l]]);var w=f},34529:function(e,t,r){"use strict";r.r(t),r.d(t,{default:function(){return m}});var s=r(9274);const o=["onClick"],a=["onClick"],n={key:0},i={key:1,class:"text-muted"};function l(e,t,r,l,c,p){const d=(0,s.resolveComponent)("ResourceTable"),u=(0,s.resolveDirective)("clean-html"),h=(0,s.resolveDirective)("trim-whitespace");return(0,s.openBlock)(),(0,s.createBlock)(d,{headers:c.headers,schema:r.schema,rows:c.filterRows,"use-query-params-for-simple-filtering":!0,"sort-generation-fn":p.sortGenerationFn,"rows-per-page":10},{"group-by":(0,s.withCtx)((({group:t})=>[(0,s.withDirectives)(((0,s.openBlock)(),(0,s.createElementBlock)("div",{ref:t.key,class:"group-tab"},[p.groupIsAllEnabled(t.rows)?((0,s.openBlock)(),(0,s.createElementBlock)("button",{key:0,type:"button",class:"btn btn-sm role-secondary mr-5",onClick:e=>{p.disableGroup(t.rows),e.target.blur()}},(0,s.toDisplayString)(e.t("harvester.usb.disableGroup")),9,o)):((0,s.openBlock)(),(0,s.createElementBlock)("button",{key:1,type:"button",class:"btn btn-sm role-secondary mr-5",onClick:e=>{p.enableGroup(t.rows),e.target.blur()}},(0,s.toDisplayString)(e.t("harvester.usb.enableGroup")),9,a)),(0,s.withDirectives)((0,s.createElementVNode)("span",null,null,512),[[u,t.key]])])),[[h]])])),"cell:claimed":(0,s.withCtx)((({row:e})=>[e.status.enabled?((0,s.openBlock)(),(0,s.createElementBlock)("span",n,(0,s.toDisplayString)(e.claimedBy),1)):((0,s.openBlock)(),(0,s.createElementBlock)("span",i,"—"))])),_:1},8,["headers","schema","rows","sort-generation-fn"])}var c=r(31400),p=r(32766),d=r(68774),u={name:"ListUsbDevices",components:{ResourceTable:c.A},props:{schema:{type:Object,required:!0},devices:{type:Array,required:!0}},async fetch(){const e=this.$store.getters["currentProduct"].inStore;await this.$store.dispatch(`${e}/findAll`,{type:p.rk.USB_CLAIM})},data(){const e=this.$store.getters["isSingleProduct"],t=[{...d.c4},d.X0,{name:"description",labelKey:"tableHeaders.description",value:"status.description",sort:["status.description"]},{name:"node",labelKey:"tableHeaders.node",value:"status.nodeName",sort:["status.nodeName"]},{name:"pciAddress",label:"Address",value:"status.pciAddress",sort:["status.pciAddress"]},{name:"vendorID",label:"Vendor ID",value:"status.vendorID",sort:["status.vendorID","status.productID"]},{name:"productID",label:"Product ID",value:"status.productID",sort:["status.productID","status.vendorID"]}];return e||t.push({name:"claimed",label:"Claimed By",value:"claimedBy",sort:["claimedBy"]}),{headers:t,rows:[],filterRows:[]}},watch:{devices:{handler(e){this.rows=e,this.filterRows=this.rows},immediate:!0}},methods:{enableGroup(e=[]){const t=e[0];t&&t.enablePassthroughBulk(e)},disableGroup(e=[]){e.forEach((e=>{e.passthroughClaim&&e.disablePassthrough()}))},groupIsAllEnabled(e=[]){return!e.find((e=>!e.passthroughClaim))},changeRows(e){this["filterRows"]=e},sortGenerationFn(){let e=(0,c.S)(this.schema,this.$store);return this.parentSriov&&(e+=this.parentSriov),e}},typeDisplay(){return this.t("harvester.usb.label")}},h=r(47433);const v=(0,h.A)(u,[["render",l]]);var m=v},33212:function(e,t,r){"use strict";r.r(t),r.d(t,{default:function(){return v}});var s=r(9274);function o(e,t,r,o,a,n){const i=(0,s.resolveComponent)("FilterBySriov"),l=(0,s.resolveComponent)("ResourceTable");return(0,s.openBlock)(),(0,s.createBlock)(l,{headers:a.headers,schema:r.schema,rows:a.filterRows,"use-query-params-for-simple-filtering":!0,"sort-generation-fn":n.sortGenerationFn,"rows-per-page":10},{"more-header-middle":(0,s.withCtx)((()=>[(0,s.createVNode)(i,{ref:"filterByParentSRIOV","parent-sriov-options":n.parentSriovOptions,"parent-sriov-label":n.parentSriovLabel,label:e.t("harvester.sriovgpu.parentSriov"),rows:a.rows,onChangeRows:n.changeRows},null,8,["parent-sriov-options","parent-sriov-label","label","rows","onChangeRows"])])),_:1},8,["headers","schema","rows","sort-generation-fn"])}var a=r(31400),n=r(2602),i=r(68774),l=r(88339),c=r(32766),p=r(67740),d={name:"VGpuDeviceList",components:{ResourceTable:a.A,FilterBySriov:p.A},props:{schema:{type:Object,required:!0},devices:{type:Array,required:!0}},async fetch(){const e=this.$store.getters["currentProduct"].inStore,t={sriovgpus:this.$store.dispatch(`${e}/findAll`,{type:c.rk.SR_IOVGPU_DEVICE})};await(0,l.kR)(t)},data(){const e=[{...i.c4},i.X0,{name:"vGPUTypeName",label:"vGPU Type",value:"spec.vGPUTypeName",sort:["spec.vGPUTypeName"]},{name:"node",labelKey:"tableHeaders.node",value:"spec.nodeName",sort:["spec.nodeName"]},{name:"address",label:"Address",value:"spec.address",sort:["spec.address"]}];return{headers:e,rows:[],parentSriov:null,filterRows:[]}},watch:{devices:{handler(e){this.rows=e,this.filterRows=this.rows},immediate:!0}},computed:{parentSriovOptions(){const e=this.$store.getters["currentProduct"].inStore,t=this.$store.getters[`${e}/all`](c.rk.SR_IOVGPU_DEVICE)||[];return t.map((e=>e.id))},parentSriovLabel(){return n.r.PARENT_SRIOV_GPU}},methods:{changeRows(e,t){this["filterRows"]=e,this["parentSriov"]=t},sortGenerationFn(){let e=(0,a.S)(this.schema,this.$store);return this.parentSriov&&(e+=this.parentSriov),e}}},u=r(47433);const h=(0,u.A)(d,[["render",o]]);var v=h},15508:function(e,t,r){"use strict";r.r(t);var s=r(36758),o=r.n(s),a=r(40935),n=r.n(a),i=n()(o());i.push([e.id,".filter[data-v-f3c890e8]{display:inline-block}.filter .banner-item[data-v-f3c890e8]{display:inline-block;font-size:16px;margin-right:10px;padding:6px;border-radius:2px}.filter .banner-item i[data-v-f3c890e8]{cursor:pointer;vertical-align:middle}.filter-popup[data-v-f3c890e8]{width:300px}[data-v-f3c890e8] .box{display:grid;grid-template-columns:40% 40% 10%;-moz-column-gap:1.75%;column-gap:1.75%;margin-bottom:10px}.required[data-v-f3c890e8]{color:var(--error)}",""]),t["default"]=i},56078:function(e,t,r){"use strict";r.r(t);var s=r(36758),o=r.n(s),a=r(40935),n=r.n(a),i=n()(o());i.push([e.id,".filter-parent-sriov .v-popper__arrow-container{display:none}",""]),t["default"]=i},73876:function(e,t,r){var s=r(15508);s.__esModule&&(s=s.default),"string"===typeof s&&(s=[[e.id,s,""]]),s.locals&&(e.exports=s.locals);var o=r(74825).A;o("2e55c518",s,!0,{sourceMap:!1,shadowMode:!1})},66446:function(e,t,r){var s=r(56078);s.__esModule&&(s=s.default),"string"===typeof s&&(s=[[e.id,s,""]]),s.locals&&(e.exports=s.locals);var o=r(74825).A;o("5d8b2188",s,!0,{sourceMap:!1,shadowMode:!1})}}]);
//# sourceMappingURL=harvester-1.5.2-rc2.umd.min.395.js.map