mirror of
https://github.com/harvester/harvester-ui-extension.git
synced 2026-12-01 12:48:53 +08:00
CI Build Artifacts (commit: e66b61d0d1, version: 1.10.0-dev)
This commit is contained in:
1 parent
4f9742a203
commit
779a019f49
34 files changed
+61
-61
No files matched your search
@@ -1,2 +1,2 @@
|
||||
(("undefined"!==typeof self?self:this)["webpackChunkharvester_1_10_0_dev"]=("undefined"!==typeof self?self:this)["webpackChunkharvester_1_10_0_dev"]||[]).push([[483],{74665:function(e,t,r){"use strict";r.d(t,{A:function(){return h}});var o=r(9274);const s={class:"vm-schedule-filter"},a={key:0,class:"banner-item bg-warning"},n=["disabled"],i={class:"filter-popup"};function l(e,t,r,l,c,d){const p=(0,o.resolveComponent)("RadioGroup"),u=(0,o.resolveComponent)("v-dropdown");return(0,o.openBlock)(),(0,o.createElementBlock)("div",s,[c.selected?((0,o.openBlock)(),(0,o.createElementBlock)("span",a,[(0,o.createTextVNode)((0,o.toDisplayString)(e.t("harvester.tableHeaders.vmSchedule"))+(0,o.toDisplayString)(c.selected?` = ${c.selected}`:"")+" ",1),(0,o.createElementVNode)("i",{class:"icon icon-close ml-5",onClick:t[0]||(t[0]=(...e)=>d.remove&&d.remove(...e))})])):(0,o.createCommentVNode)("",!0),(0,o.createVNode)(u,{"popper-class":"vm-schedule-dropdown",triggers:d.scheduleOptions.length?["click"]:[],placement:"bottom-end",offset:"1",distance:20},{popper:(0,o.withCtx)(()=>[(0,o.createElementVNode)("div",i,[(0,o.createVNode)(p,{value:c.selected,"onUpdate:value":[t[1]||(t[1]=e=>c.selected=e),d.onSelect],class:"mr-10 ml-10",name:"model",options:d.scheduleOptions,labels:d.scheduleOptions},null,8,["value","options","labels","onUpdate:value"])])]),default:(0,o.withCtx)(()=>[(0,o.createElementVNode)("button",{ref:"actionDropDown",class:"btn bg-primary mr-10",disabled:!d.enableFilterButton},[(0,o.renderSlot)(e.$slots,"title",{},()=>[(0,o.createTextVNode)((0,o.toDisplayString)(e.t("harvester.fields.filterSchedule")),1)],!0)],8,n)]),_:3},8,["triggers"])])}var c=r(10196),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))},enableFilterButton(){return this.rows.some(e=>void 0!==e.sourceSchedule)}},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(95249),r(44823),r(47433));const u=(0,p.A)(d,[["render",l],["__scopeId","data-v-2c7280aa"]]);var h=u},77826:function(e,t,r){"use strict";r.d(t,{A:function(){return h}});var o=r(9274);const s={class:"overview-web-console"};function a(e,t,r,a,n,i){const l=(0,o.resolveComponent)("ButtonDropdown");return(0,o.openBlock)(),(0,o.createElementBlock)("div",s,[(0,o.createVNode)(l,{disabled:i.isOff,"no-drop":i.isOff,"button-label":"Console","dropdown-options":i.options,size:"sm",onClickAction:i.handleDropdown},null,8,["disabled","no-drop","dropdown-options","onClickAction"])])}var n=r(89958),i=r(65359),l=r(50784),c=r(20652),d={name:"VMConsoleBar",components:{ButtonDropdown:n.A},props:{resourceType:{type:Object,required:!0,default:()=>({})}},computed:{...(0,i.L8)({t:"i18n/t"}),isOff(){return this.resourceType.stateDisplay===l.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,o=window.location.pathname.replace(this.$route.path,""),s=this.$route?.params,a=Math.max(800,screen.width-200),n=Math.max(600,screen.height-200),i=Math.max(0,window.screenX+Math.floor((window.outerWidth-a)/2)),l=Math.max(0,window.screenY+Math.floor((window.outerHeight-n)/2)),d=`https://${r}${o}/${c.KR}/c/${s.cluster}/console/${t}/${e}`;this.$nextTick(()=>{window.open(d,"_blank",`toolbars=0,width=${a},height=${n},left=${i},top=${l},noreferrer`)})},isEmpty(e){return void 0!==e&&0===Object.keys(e).length}}},p=(r(25248),r(47433));const u=(0,p.A)(d,[["render",a]]);var h=u},10644:function(e,t,r){"use strict";r.r(t),r.d(t,{default:function(){return u}});var o=r(9274);const s={key:0},a={key:0};function n(e,t,r,n,i,l){const c=(0,o.resolveComponent)("BadgeState");return l.migrationState?((0,o.openBlock)(),(0,o.createElementBlock)("div",s,[r.showSuccess?(0,o.createCommentVNode)("",!0):((0,o.openBlock)(),(0,o.createElementBlock)("span",a,"/")),(0,o.createVNode)(c,{label:l.migrationState,color:l.migrationBackground},null,8,["label","color"])])):(0,o.createCommentVNode)("",!0)}var i=r(41418),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["currentProduct"].inStore;return this.$store.getters[`${e}/byId`](l.rk.VMI,this.vmResource?.id)||null},migrationState(){return this.vmiResource?.mLine truncated
|
||||
(("undefined"!==typeof self?self:this)["webpackChunkharvester_1_10_0_dev"]=("undefined"!==typeof self?self:this)["webpackChunkharvester_1_10_0_dev"]||[]).push([[483],{24959:function(e,t,a){"use strict";a.d(t,{H:function(){return d},X:function(){return i}});var l=a(9274),o=a(53197),s=a(71274);const r=()=>{};function n(e,t,a){return l=>{const o=t.find(e=>e.path===l);if(!o)return[];const n=o.translationKey?e(o.translationKey):"Value",i={...(0,s.A)(e,{key:n}),...a};return o.rules.map(e=>{const t=i[e];return t||r})}}function i(e,t,a={}){const{errors:s,validate:r}=(0,o.mN)(),i=(0,l.ref)(!1);(0,l.provide)("vee-show-all-errors",i);const d=n(e,t,a),c=(0,l.computed)(()=>0===Object.keys(s.value).length),u=async(...e)=>{const t=await r(...e);return i.value=!0,t};return{getRules:d,isFormValid:c,validateForm:u,veeErrors:s,showAllErrors:i}}function d(e,t,a={}){return{getRules:n(e,t,a)}}},53338:function(e,t,a){"use strict";a.r(t);var l=a(81073),o=a(42629);describe("component: Loki",()=>{it("should display URL placeholder",()=>{const e=(0,l.Ky)(o["default"],{props:{mode:"edit",namespace:"whatever"}}),t="https://127.0.0.1:8000",a=e.find('[data-testid="loki-url"]').attributes("placeholder");expect(a).toBe(t)})})},72688:function(e,t,a){"use strict";var l=a(81073),o=a(99726),s=a(4364);const r=e=>e.$options&&"function"===typeof e.$options.fetch&&!e.$options.fetch.length,n=(e,t,a)=>{e.$options[t]?Array.isArray(e.$options[t])||"function"!==typeof e.$options[t]||(e.$options[t]=[e.$options[t]]):e.$options[t]=[],Array.isArray(e.$options[t])&&!e.$options[t].includes(a)&&e.$options[t].push(a)};var i={beforeCreate(){r(this)&&(this._fetchDelay="number"===typeof this.$options.fetchDelay?this.$options.fetchDelay:200,this.$fetch=c.bind(this),n(this,"beforeMount",d))},data(){return{state:{pending:!1,error:null,timestamp:Date.now()}}},computed:{$fetchState(){return this.state}}};function d(){if(!this._hydrated)return this.$fetch()}function c(e=!0){return e?(this._fetchPromise||(this._fetchPromise=u.call(this).then(()=>{delete this._fetchPromise})),this._fetchPromise):u.call(this)}async function u(){this.state.pending=!0,this.state.error=null,this._hydrated=!1;let e=null;const t=Date.now();try{await this.$options.fetch.call(this)}catch(l){s.error("Error in fetch():",l),e=(0,o.cQ)(l)}const a=this._fetchDelay-(Date.now()-t);a>0&&await new Promise(e=>setTimeout(e,a)),this.state.error=e,this.state.pending=!1,this.state.timestamp=Date.now()}var p=a(884);const m=["us-east-1","eu-west-1"],v=e=>(0,l.Ky)(p["default"],{props:{mode:"edit",namespace:"whatever",value:e},global:{mixins:[i],mocks:{$store:{dispatch:e=>{if("aws/defaultRegions"!==e)throw new Error(`unexpected dispatch: ${e}`);return Promise.resolve([...m])}}}}});describe("component: S3",()=>{it("should display a region select showing the configured s3_region",()=>{const e={s3_region:"us-east-1"},t=v(e),a=t.find('[data-testid="s3-region"]');expect(a.exists()).toBe(!0),expect(a.attributes("value")).toBe(e.s3_region)}),it("should write the region select back to s3_region",async()=>{const e={},t=v(e),a=t.findComponent('[data-testid="s3-region"]');await a.vm.$emit("update:value","eu-west-1"),expect(e).toStrictEqual({s3_region:"eu-west-1"})}),it("should populate the region select with the known AWS regions",async()=>{const e=v({});await e.vm.$nextTick();const t=e.findComponent('[data-testid="s3-region"]');expect(t.props("options")).toStrictEqual(m)}),it("should keep an existing region that is not a known AWS region as an option",async()=>{const e=v({s3_region:"minio-local"});await e.vm.$nextTick();const t=e.findComponent('[data-testid="s3-region"]');expect(t.props("options")).toStrictEqual(["minio-local",...m])})})},93498:function(e,t,a){"use strict";a.r(t);var l=a(81073),o=a(65359),s=a(14220),r=a(64814);const n={query:{}},i=()=>{const e=(0,o.y$)({getters:{"i18n/t":()=>jest.fn()}});return{global:{plugins:[e],mocks:{$route:n,$fetchState:{}}}}},d={known_hosts:"S05PV05fSE9TVFM=","ssh-privatekey":"dGVzdDE=","ssh-publickey":"dGVzdDE="};describe.each([s.YQ,s.G5,s.nW])("component: Ssh.vue",e=>{it(`mode: ${e}, should show input fields`,()=>{const t=(0,l.Or)(r["default"],{...i(),props:{value:{name:"foo",decodedData:d,supportsSshKnownHosts:!0},mode:e}}),a=t.find('[data-testid="ssh-public-key"]').element,o=t.find('[data-testid="ssh-private-key"]').element,s=t.find('[data-testid="ssh-known-hosts"]').element;expect(a.value).toBe("dGVzdDE="),expect(o.value).toBe("dGVzdDE="),expect(s.value).toBe("S05PV05fSE9TVFM=")}),it.each([["show",!0],["hide",!1]])(`mode: ${e}, should %p known_hosts`,(e,t)=>{const a=(0,l.Or)(r["default"],{...i(),props:{value:{name:"foo",decodedData:d,supportsSshKnownHosts:t},mode:s.G5}}),o=a.find('[data-testid="ssh-known-hosts"]');expect(o.exists()).toBe(t)})})},85992:function(e,t,a){"use strict";a.d(t,{A:function(){return S}});var l=a(9274);const o={class:"row"},s={key:0,class:"col span-12"},r={class:"helper-text mb-10"},n={class:"row mb-20"},i={class:"col span-6"},d={class:"col span-6"},c={clLine truncated
|
||||
//# sourceMappingURL=harvester-1.10.0-dev.umd.min.483.js.map
|
||||
Reference in new issue
Block a user