harvester-ui-extension/extensions/harvester/1.0.0/plugin/harvester-1.0.0.umd.min.588.js
Francesco Torchia 1cb57b8998
build
Signed-off-by: Francesco Torchia <francesco.torchia@suse.com>
2024-11-13 11:30:25 +01:00

2 lines
12 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

(("undefined"!==typeof self?self:this)["webpackChunkharvester_1_0_0"]=("undefined"!==typeof self?self:this)["webpackChunkharvester_1_0_0"]||[]).push([[588],{69760:function(e,t,r){"use strict";r.r(t),r.d(t,{default:function(){return p}});var a=r(9274);const o={key:0},s={key:0};function n(e,t,r,n,i,l){const c=(0,a.resolveComponent)("BadgeState");return l.migrationState?((0,a.openBlock)(),(0,a.createElementBlock)("div",o,[r.showSuccess?(0,a.createCommentVNode)("",!0):((0,a.openBlock)(),(0,a.createElementBlock)("span",s,"/")),(0,a.createVNode)(c,{label:l.migrationState,color:l.migrationBackground},null,8,["label","color"])])):(0,a.createCommentVNode)("",!0)}var i=r(77809),l=r(32766),c={emits:["state-changed"],components:{BadgeState:i.j},props:{vmResource:{type:Object,required:!0},showSuccess:{type:Boolean,default:!0}},computed:{vmiResource(){const e=this.$store.getters["harvester/all"](l.rk.VMI)||[],t=e.find((e=>e?.metadata?.ownerReferences?.[0]?.uid===this.vmResource?.metadata?.uid));return t},migrationState(){return this.vmiResource?.migrationState?.status||""},migrationBackground(){return this.vmiResource?.migrationStateBackground||""}},watch:{migrationState(e){this.$emit("state-changed",e)}}},d=(r(50002),r(47433));const u=(0,d.A)(c,[["render",n],["__scopeId","data-v-9e992d88"]]);var p=u},98993:function(e,t,r){"use strict";r.r(t),r.d(t,{default:function(){return g}});var a=r(9274);const o=e=>((0,a.pushScopeId)("data-v-216558d8"),e=e(),(0,a.popScopeId)(),e),s={class:"state"},n=o((()=>(0,a.createElementVNode)("i",{class:"icon icon-warning icon-lg text-warning"},null,-1))),i=[n];function l(e,t,r,o,n,l){const c=(0,a.resolveComponent)("HarvesterMigrationState"),d=(0,a.resolveComponent)("VMState"),u=(0,a.resolveComponent)("v-dropdown");return(0,a.openBlock)(),(0,a.createElementBlock)("span",null,[(0,a.withDirectives)((0,a.createVNode)(c,{"vm-resource":r.row,onStateChanged:l.migrationStateChanged},null,8,["vm-resource","onStateChanged"]),[[a.vShow,n.isMigrating]]),(0,a.withDirectives)((0,a.createElementVNode)("div",s,[(0,a.createVNode)(d,{row:r.row},null,8,["row"]),l.warningMessage.length?((0,a.openBlock)(),(0,a.createBlock)(u,{key:0,ref:"popover",trigger:"manual",offset:"16"},{popper:(0,a.withCtx)((()=>[(0,a.createElementVNode)("div",{onMouseenter:t[3]||(t[3]=e=>l.showMessage(!0)),onMouseleave:t[4]||(t[4]=e=>l.showMessage(!1))},[((0,a.openBlock)(!0),(0,a.createElementBlock)(a.Fragment,null,(0,a.renderList)(l.warningMessage,((o,s)=>((0,a.openBlock)(),(0,a.createElementBlock)("p",{key:s},[(0,a.createTextVNode)((0,a.toDisplayString)(s+1)+". ",1),l.canMiss(r.row,o)?((0,a.openBlock)(),(0,a.createElementBlock)("a",{key:0,class:"text-link",role:"button",onClick:t[2]||(t[2]=(...e)=>l.dismiss&&l.dismiss(...e))},(0,a.toDisplayString)(e.t("harvester.upgradePage.dismissMessage")),1)):(0,a.createCommentVNode)("",!0),(0,a.createTextVNode)(" "+(0,a.toDisplayString)(o),1)])))),128))],32)])),default:(0,a.withCtx)((()=>[(0,a.createElementVNode)("span",{class:"tooltip-target",onMouseenter:t[0]||(t[0]=e=>l.showMessage(!0)),onMouseleave:t[1]||(t[1]=e=>l.delayClose())},i,32)])),_:1},512)):(0,a.createCommentVNode)("",!0)],512),[[a.vShow,!n.isMigrating]])])}var c=r(7493),d=r(69760),u={components:{VMState:c.A,HarvesterMigrationState:d["default"]},props:{value:{type:String,default:""},row:{type:Object,required:!0},allNodeNetwork:{type:Array,default:()=>[]},allClusterNetwork:{type:Array,default:()=>[]}},data(){return{isMigrating:!1,timer:null}},beforeUnmount(){this.timer&&clearTimeout(this.timer)},computed:{warningMessage(){const e=[];if("VM error"===this.row?.actualState&&this.row.warningMessage?.message&&e.push(this.row.warningMessage?.message),this.row?.migrationMessage&&e.push(this.row?.migrationMessage.message),this.row.warningMessage?.message)if(this.row.warningMessage?.pod){const t=this.row.warningMessage.pod;t.metadata?.state?.error&&!/pod has unbound immediate PersistentVolumeClaims/.test(t.metadata?.state?.message)&&e.push(t.metadata?.state?.message)}else e.push(this.row.warningMessage?.message);return e}},methods:{migrationStateChanged(e){this.isMigrating="Failed"!==e&&!!e},showMessage(e){this.timer&&clearTimeout(this.timer),this.$refs.popover&&(e?this.$refs.popover.show():this.$refs.popover.hide())},delayClose(){this.timer=setTimeout((()=>{this.showMessage(!1)}),500)},async dismiss(){try{await this.row.doAction("dismissInsufficientResourceQuota")}catch(e){400!==e?._status&&503!==e?._status||this.$store.dispatch("growl/error",{title:this.t("harvester.notification.title.error"),message:e?.errors[0]},{root:!0})}},canMiss(e,t){return e.warningMessage?.message===t&&e.warningMessage?.canDismiss}}},p=(r(84326),r(47433));const m=(0,p.A)(u,[["render",l],["__scopeId","data-v-216558d8"]]);var g=m},7844:function(e,t,r){"use strict";r.d(t,{A:function(){return E}});var a=r(9274);const o={class:"consumption-gauge"},s={key:0},n={class:"numbers"},i={key:0},l={key:1},c={class:"numbers-stats"},d={class:"percentage"},u=(0,a.createElementVNode)("i",null,"/ ",-1),p={class:"mt-10"};function m(e,t,r,m,g,h){const f=(0,a.resolveComponent)("PercentageBar");return(0,a.openBlock)(),(0,a.createElementBlock)("div",o,[r.resourceName&&!r.usedAsResourceName?((0,a.openBlock)(),(0,a.createElementBlock)("h3",s,(0,a.toDisplayString)(r.resourceName),1)):(0,a.createCommentVNode)("",!0),(0,a.createElementVNode)("div",n,[(0,a.renderSlot)(e.$slots,"title",{amountTemplateValues:h.amountTemplateValues,formattedPercentage:h.formattedPercentage},(()=>[r.usedAsResourceName?((0,a.openBlock)(),(0,a.createElementBlock)("h4",i,(0,a.toDisplayString)(r.resourceName),1)):((0,a.openBlock)(),(0,a.createElementBlock)("span",l,(0,a.toDisplayString)(e.t("node.detail.glance.consumptionGauge.used")),1)),(0,a.createElementVNode)("span",c,[(0,a.createTextVNode)((0,a.toDisplayString)(e.t("node.detail.glance.consumptionGauge.amount",h.amountTemplateValues))+" ",1),(0,a.createElementVNode)("span",d,[u,(0,a.createTextVNode)((0,a.toDisplayString)(h.formattedPercentage),1)])])]))]),(0,a.createElementVNode)("div",p,[(0,a.createVNode)(f,{modelValue:h.percentageBarValue,"color-stops":r.colorStops},null,8,["modelValue","color-stops"])])])}const g={class:"percentage-bar"},h={key:0,class:"ml-5 percentage-value"};function f(e,t,r,o,s,n){const i=(0,a.resolveComponent)("Bar");return(0,a.openBlock)(),(0,a.createElementBlock)("span",g,[(0,a.createVNode)(i,{percentage:r.modelValue,"primary-color":n.primaryColor,slices:r.slices},null,8,["percentage","primary-color","slices"]),r.showPercentage?((0,a.openBlock)(),(0,a.createElementBlock)("span",h,(0,a.toDisplayString)(n.formattedPercentage),1)):(0,a.createCommentVNode)("",!0)])}function v(e,t,r,o,s,n){return(0,a.openBlock)(),(0,a.createElementBlock)("div",{class:"bar",style:(0,a.normalizeStyle)(n.barStyle)},[(0,a.createElementVNode)("div",{class:"indicator",style:(0,a.normalizeStyle)(n.indicatorStyle)},null,4),((0,a.openBlock)(!0),(0,a.createElementBlock)(a.Fragment,null,(0,a.renderList)(n.sliceStyles,((e,t)=>((0,a.openBlock)(),(0,a.createElementBlock)("div",{key:t,class:"slice",style:(0,a.normalizeStyle)(e)},null,4)))),128))],4)}var y={props:{percentage:{type:Number,required:!0},primaryColor:{type:String,default:"--primary"},secondaryColor:{type:String,default:"--border"},slices:{type:Array,default:()=>[]}},computed:{indicatorStyle(){return{width:`${this.percentage}%`,backgroundColor:`var(${this.primaryColor})`}},barStyle(){return{backgroundColor:`var(${this.secondaryColor})`}},sliceStyles(){return this.slices.map((e=>({left:`${e}%`,visibility:e<this.percentage?"visible":"hidden"})))}}},w=(r(90627),r(47433));const b=(0,w.A)(y,[["render",v],["__scopeId","data-v-a1eb8c28"]]);var k=b,S=r(13451);const M={LESS:"LESS",MORE:"MORE"};var B={components:{Bar:k},props:{modelValue:{type:Number,required:!0,validator(e){return e>=0}},preferredDirection:{type:String,default:M.LESS},showPercentage:{type:Boolean,default:!1},colorStops:{type:Object,default:null},slices:{type:Array,default:()=>[]}},computed:{primaryColor(){const e=this.preferredDirection===M.LESS;if(this.colorStops){const t=Object.keys(this.colorStops).sort();if(e){let e=t.length-1;while(this.modelValue<t[e])e--;return this.colorStops[t[e]]}{let e=0;while(this.modelValue>t[e])e++;return this.colorStops[t[e]]}}const t=e?80:20,r=e?this.modelValue:t,a=e?t:this.modelValue;return r<=a?"--primary":"--error"},formattedPercentage(){return(0,S.l9)(this.modelValue)}}};r(56094);const V=(0,w.A)(B,[["render",f],["__scopeId","data-v-370f3cae"]]);var N=V,x={components:{PercentageBar:N},props:{resourceName:{type:String,default:""},capacity:{type:Number,required:!0},used:{type:Number,required:!0},units:{type:String,default:""},numberFormatter:{type:Function,default:e=>Number.isInteger(e)?e:e.toFixed(2)},colorStops:{type:Object,default:null},usedAsResourceName:{type:Boolean,defaut:!1}},computed:{displayUnits(){return this.units?` ${this.units}`:""},percentageBarValue(){return this.used&&this.capacity?100*this.used/this.capacity:0},amountTemplateValues(){return{used:this.numberFormatter(this.used||0),total:this.numberFormatter(this.capacity||0),unit:this.displayUnits}},formattedPercentage(){return(0,S.l9)(this.percentageBarValue)}}};r(87899);const C=(0,w.A)(x,[["render",m]]);var E=C},99826:function(e,t,r){"use strict";r.r(t);var a=r(36758),o=r.n(a),s=r(40935),n=r.n(s),i=n()(o());i.push([e.id,".badge-state[data-v-9e992d88]{padding:5px 10px;border:1px solid transparent;border-radius:20px}.badge-state.bg-info[data-v-9e992d88]{border-color:var(--primary)}.badge-state.bg-error[data-v-9e992d88]{border-color:var(--error)}.badge-state.bg-warning[data-v-9e992d88]{border-color:var(--warning)}.badge-state.bg-success[data-v-9e992d88]{color:var(--success);border-color:var(--success);background:transparent}.sortable-table TD .badge-state[data-v-9e992d88]{text-overflow:ellipsis;overflow:hidden;white-space:nowrap;word-wrap:break-word;display:inline-block;max-width:100%;position:relative;padding:2px 10px 1px 10px;font-size:1em;max-width:200px;font-size:.85em;vertical-align:middle}",""]),t["default"]=i},21126:function(e,t,r){"use strict";r.r(t);var a=r(36758),o=r.n(a),s=r(40935),n=r.n(s),i=n()(o());i.push([e.id,".state[data-v-216558d8]{display:flex;justify-content:space-between}.state .icon-warning[data-v-216558d8]{margin-top:2px}",""]),t["default"]=i},71003:function(e,t,r){"use strict";r.r(t);var a=r(36758),o=r.n(a),s=r(40935),n=r.n(s),i=n()(o());i.push([e.id,".consumption-gauge .numbers{display:flex;flex-direction:row;justify-content:space-between}.consumption-gauge .numbers-stats{display:flex;flex-direction:row;align-items:center;gap:10px;align-self:baseline}.consumption-gauge .numbers .percentage{font-weight:700}.consumption-gauge .numbers .percentage i{margin-right:10px}",""]),t["default"]=i},96798:function(e,t,r){"use strict";r.r(t);var a=r(36758),o=r.n(a),s=r(40935),n=r.n(s),i=n()(o());i.push([e.id,".percentage-bar[data-v-370f3cae]{display:flex;flex-direction:row}.percentage-bar .percentage-value[data-v-370f3cae]{word-break:keep-all}",""]),t["default"]=i},19363:function(e,t,r){"use strict";r.r(t);var a=r(36758),o=r.n(a),s=r(40935),n=r.n(s),i=n()(o());i.push([e.id,".bar[data-v-a1eb8c28]{width:100%;height:15px;border-radius:7.5px;overflow:hidden;position:relative}.bar .indicator[data-v-a1eb8c28]{height:100%}.bar .slice[data-v-a1eb8c28]{position:absolute;top:0;bottom:0;width:1px;background-color:var(--body-bg)}",""]),t["default"]=i},50002:function(e,t,r){var a=r(99826);a.__esModule&&(a=a.default),"string"===typeof a&&(a=[[e.id,a,""]]),a.locals&&(e.exports=a.locals);var o=r(74825).A;o("3657a623",a,!0,{sourceMap:!1,shadowMode:!1})},84326:function(e,t,r){var a=r(21126);a.__esModule&&(a=a.default),"string"===typeof a&&(a=[[e.id,a,""]]),a.locals&&(e.exports=a.locals);var o=r(74825).A;o("390707e0",a,!0,{sourceMap:!1,shadowMode:!1})},87899:function(e,t,r){var a=r(71003);a.__esModule&&(a=a.default),"string"===typeof a&&(a=[[e.id,a,""]]),a.locals&&(e.exports=a.locals);var o=r(74825).A;o("632d6336",a,!0,{sourceMap:!1,shadowMode:!1})},56094:function(e,t,r){var a=r(96798);a.__esModule&&(a=a.default),"string"===typeof a&&(a=[[e.id,a,""]]),a.locals&&(e.exports=a.locals);var o=r(74825).A;o("cb4b2066",a,!0,{sourceMap:!1,shadowMode:!1})},90627:function(e,t,r){var a=r(19363);a.__esModule&&(a=a.default),"string"===typeof a&&(a=[[e.id,a,""]]),a.locals&&(e.exports=a.locals);var o=r(74825).A;o("9962433e",a,!0,{sourceMap:!1,shadowMode:!1})}}]);
//# sourceMappingURL=harvester-1.0.0.umd.min.588.js.map