mirror of
https://github.com/harvester/harvester-ui-extension.git
synced 2026-11-26 02:20:49 +08:00
CI Build Artifacts (commit: b34d618c7c, version: 1.9.0-dev)
This commit is contained in:
1 parent
1eec0c1a9d
commit
0fd3ee7047
28 files changed
+29
-34
No files matched your search
@@ -1,2 +1,2 @@
|
||||
"use strict";(("undefined"!==typeof self?self:this)["webpackChunkharvester_1_9_0_dev"]=("undefined"!==typeof self?self:this)["webpackChunkharvester_1_9_0_dev"]||[]).push([[431],{73975:function(e,t,s){s.d(t,{v6:function(){return u},wM:function(){return S}});var a=s(5159),i=s(20246),r=s.n(i),n=s(46343),o=s.n(n),c=s(76978),l=s(35664),m=s(2602),d=s(32766),h=s(66490),p=s(48249);const u={package_update:!0,packages:["qemu-guest-agent"],runcmd:[["systemctl","enable","--now","qemu-guest-agent.service"]]},g={default:"qemu-guest-agent.service"},S=[{bus:"usb",name:"tablet",type:"tablet"}],f={EXISTING_ALL:"EXISTING_ALL",EXISTING_ONLY_ANNOTATION:"EXISTING_ANNOTATION",EXISTING_ONLY_CLOUD:"EXISTING_CLOUD"};t.Ay={methods:{hasCloudConfigComment(e){const t=e?a.Ay.parseDocument(e):a.Ay.parseDocument({}),s=t?.contents?.items||[];let i=!1;return("cloud-config"===t?.comment||t?.comment?.includes("cloud-config\n"))&&(i=!0),("cloud-config"===t?.commentBefore||t?.commentBefore?.includes("cloud-config\n"))&&(i=!0),s.map(e=>{const t=e.key;("cloud-config"===t?.commentBefore||t?.commentBefore?.includes("cloud-config\n"))&&(i=!0)}),i},getSSHValue(e){const t=this.$store.getters["currentProduct"].inStore,s=this.$store.getters[`${t}/all`](d.rk.SSH)||[];return s.find(t=>t.id===e)?.spec?.publicKey||void 0},getOsType(e){return e.metadata?.labels?.[m.r.OS]},getMatchQGA(e){const t=(0,c.o8)(u);let s=!1;return p.OS.forEach(t=>{t.match&&(s=t.match.find(t=>t===e))}),t.runcmd[0][3]=s?g[e]:g["default"],t},getSimilarRuncmd(e){const t=(0,c.o8)(u);return t.runcmd[0][3]="openSUSE"===e?g["default"]:g["suse"],t.runcmd[0]},hasInstallAgent(e,t,s){let a={};const i=this.getMatchQGA(t);try{a=r().load(e)||{}}catch(n){return new Error("Function(hasInstallAgent) error"),s}return a?.packages?.includes("qemu-guest-agent")&&!!a?.runcmd?.find(e=>Array.isArray(e)&&e.join("-")===i.runcmd[0].join("-"))},isInstallUSBTablet(e){const t=e?.template?.spec?.domain?.devices?.inputs;return!!Array.isArray(t)&&!!t.find(e=>o()(e,S[0]))},isEfiEnabled(e){return!!e?.template?.spec?.domain?.firmware?.bootloader?.efi},isTpmEnabled(e){return!!e?.template?.spec?.domain?.devices?.tpm},isTPMPersistentStateEnabled(e){return!!e?.template?.spec?.domain?.devices?.tpm?.persistent},isEFIPersistentStateEnabled(e){return!!e?.template?.spec?.domain?.firmware?.bootloader?.efi?.persistent},isSecureBoot(e){return!!e?.template?.spec?.domain?.firmware?.bootloader?.efi?.secureBoot},isCpuPinning(e){return!!e?.template?.spec?.domain?.cpu?.dedicatedCpuPlacement},getCloudInitNoCloud(e){const t=this.getSecret(e);let s=t?.decodedData?.userdata,a=t?.decodedData?.networkdata;const i=e?.template?.spec?.volumes?.find(e=>"cloudinitdisk"===e.name)?.cloudInitNoCloud||{};return i?.userData&&(s=i.userData,this.saveUserDataAsClearText=!0),i?.networkData&&(a=i.networkData,this.saveNetworkDataAsClearText=!0),{userData:s,networkData:a}},getSecret(e){const t=e?.template?.spec?.volumes?.find(e=>"cloudinitdisk"===e.name)?.cloudInitNoCloud||{},s=this.$store.getters["currentProduct"].inStore,a=this.$store.getters[`${s}/all`](l.bB)||[],i=t?.secretRef?.name||t?.networkDataSecretRef?.name,r=a.find(e=>e.metadata.name===i);return r},getAccessCredentials(e){const t=this.$store.getters["currentProduct"].inStore,s=this.$store.getters[`${t}/all`](l.bB)||[],a=e?.template?.spec?.accessCredentials||[],i=JSON.parse(e.template.metadata?.annotations?.[m.r.DYNAMIC_SSHKEYS_NAMES]||"[]");return a.map(e=>{const t=e.userPassword?"userPassword":"sshPublicKey",a=e[t]?.source?.secret?.secretName,r=s.find(e=>e.metadata.name===a),n={source:t,username:"",newPassword:"",users:[],sshkeys:[],secretName:a,secretRef:r};if(r)if("userPassword"===t){const e=Object.keys(r?.data)[0],t=r.decodedData[e];n.username=e,n.newPassword=t}else{const s=e[t].propagationMethod.qemuGuestAgent.users,r=i?.[a];n.users=s,n.sshkeys=r}else n.secretRef=void 0;return n})},getRootImageId(e){const t=(0,h.v)(e);return t?.[0]?.metadata?.annotations?.[m.r.IMAGE_ID]||""},getSSHFromAnnotation(e){const t=e?.template?.metadata?.annotations?.[m.r.SSH_NAMES]||"[]";return JSON.parse(t)},convertToJson(e=""){let t={};try{t=r().load(e)}catch(s){new Error("Function(convertToJson) error")}return t},getSSHFromUserData(e){return this.convertToJson(e)?.ssh_authorized_keys||[]},compareSSHValue(e="",t=""){const s=/(\r\n\t|\n|\r\t)|(\s*)/gm;return e.replace(s,"")===t.replace(s,"")},mergeAllSSHs(e){const t=this.getSSHFromAnnotation(e),{userScript:s}=this.getCloudInitNoCloud(e);if(!t?.length<0&&!s)return[];let a=[];const i=this.$store.getters["currentProduct"].inStore,r=this.$store.getters[`${i}/all`](d.rk.SSH)||[];a=(t||[]).map(e=>{const t=r.find(t=>t.id===e);return t?{id:t.id,data:t,type:f.EXISTING_ALL}:{id:e,data:e,type:f.EXISTING_ONLY_ANNOTATION}});const n=this.getSSHFromUserData(s);return n.map(e=>{const t=r.find(t=>this.compareSSHValue(e,t.spec?.publicKey));t&&!a.find(e=>e.id===t.id)?a.push({id:t.id,data:t,type:f.EXISTING_ALL}):t||a.push({id:"Unknown",data:e,type:f.EXISTING_ONLY_CLOUD})}),a}}}},48249:fuLine truncated
|
||||
"use strict";(("undefined"!==typeof self?self:this)["webpackChunkharvester_1_9_0_dev"]=("undefined"!==typeof self?self:this)["webpackChunkharvester_1_9_0_dev"]||[]).push([[431],{73975:function(e,t,s){s.d(t,{v6:function(){return u},wM:function(){return f}});var a=s(5159),i=s(20246),r=s.n(i),n=s(46343),o=s.n(n),c=s(76978),l=s(35664),m=s(2602),d=s(32766),h=s(66490),p=s(48249);const u={package_update:!0,packages:["qemu-guest-agent"],runcmd:[["systemctl","enable","--now","qemu-guest-agent.service"]]},g={default:"qemu-guest-agent.service"},f=[{bus:"usb",name:"tablet",type:"tablet"}],S={EXISTING_ALL:"EXISTING_ALL",EXISTING_ONLY_ANNOTATION:"EXISTING_ANNOTATION",EXISTING_ONLY_CLOUD:"EXISTING_CLOUD"};t.Ay={methods:{hasCloudConfigComment(e){const t=e?a.Ay.parseDocument(e):a.Ay.parseDocument({}),s=t?.contents?.items||[];let i=!1;return("cloud-config"===t?.comment||t?.comment?.includes("cloud-config\n"))&&(i=!0),("cloud-config"===t?.commentBefore||t?.commentBefore?.includes("cloud-config\n"))&&(i=!0),s.map(e=>{const t=e.key;("cloud-config"===t?.commentBefore||t?.commentBefore?.includes("cloud-config\n"))&&(i=!0)}),i},getSSHValue(e){const t=this.$store.getters["currentProduct"].inStore,s=this.$store.getters[`${t}/all`](d.rk.SSH)||[];return s.find(t=>t.id===e)?.spec?.publicKey||void 0},getOsType(e){return e.metadata?.labels?.[m.r.OS]},getMatchQGA(e){const t=(0,c.o8)(u);let s=!1;return p.OS.forEach(t=>{t.match&&(s=t.match.find(t=>t===e))}),t.runcmd[0][3]=s?g[e]:g["default"],t},getSimilarRuncmd(e){const t=(0,c.o8)(u);return t.runcmd[0][3]="openSUSE"===e?g["default"]:g["suse"],t.runcmd[0]},hasInstallAgent(e,t,s){let a={};const i=this.getMatchQGA(t);try{a=r().load(e)||{}}catch(n){return new Error("Function(hasInstallAgent) error"),s}return a?.packages?.includes("qemu-guest-agent")&&!!a?.runcmd?.find(e=>Array.isArray(e)&&e.join("-")===i.runcmd[0].join("-"))},isInstallUSBTablet(e){const t=e?.template?.spec?.domain?.devices?.inputs;return!!Array.isArray(t)&&!!t.find(e=>o()(e,f[0]))},isEfiEnabled(e){return!!e?.template?.spec?.domain?.firmware?.bootloader?.efi},isTpmEnabled(e){return!!e?.template?.spec?.domain?.devices?.tpm},isTPMPersistentStateEnabled(e){return!!e?.template?.spec?.domain?.devices?.tpm?.persistent},isEFIPersistentStateEnabled(e){return!!e?.template?.spec?.domain?.firmware?.bootloader?.efi?.persistent},isSecureBoot(e){return!!e?.template?.spec?.domain?.firmware?.bootloader?.efi?.secureBoot},isCpuPinning(e){return!!e?.template?.spec?.domain?.cpu?.dedicatedCpuPlacement},getCloudInitNoCloud(e){const t=this.getSecret(e);let s=t?.decodedData?.userdata,a=t?.decodedData?.networkdata;const i=e?.template?.spec?.volumes?.find(e=>"cloudinitdisk"===e.name)?.cloudInitNoCloud||{};return i?.userData&&(s=i.userData,this.saveUserDataAsClearText=!0),i?.networkData&&(a=i.networkData,this.saveNetworkDataAsClearText=!0),{userData:s,networkData:a}},getSecret(e){const t=e?.template?.spec?.volumes?.find(e=>"cloudinitdisk"===e.name)?.cloudInitNoCloud||{},s=this.$store.getters["currentProduct"].inStore,a=this.$store.getters[`${s}/all`](l.bB)||[],i=t?.secretRef?.name||t?.networkDataSecretRef?.name,r=a.find(e=>e.metadata.name===i);return r},getAccessCredentials(e){const t=this.$store.getters["currentProduct"].inStore,s=this.$store.getters[`${t}/all`](l.bB)||[],a=e?.template?.spec?.accessCredentials||[],i=JSON.parse(e.template.metadata?.annotations?.[m.r.DYNAMIC_SSHKEYS_NAMES]||"[]");return a.map(e=>{const t=e.userPassword?"userPassword":"sshPublicKey",a=e[t]?.source?.secret?.secretName,r=s.find(e=>e.metadata.name===a),n={source:t,username:"",newPassword:"",users:[],sshkeys:[],secretName:a,secretRef:r};if(r)if("userPassword"===t){const e=Object.keys(r?.data)[0],t=r.decodedData[e];n.username=e,n.newPassword=t}else{const s=e[t].propagationMethod.qemuGuestAgent.users,r=i?.[a];n.users=s,n.sshkeys=r}else n.secretRef=void 0;return n})},getRootImageId(e){const t=(0,h.v)(e);return t?.[0]?.metadata?.annotations?.[m.r.IMAGE_ID]||""},getSSHFromAnnotation(e){const t=e?.template?.metadata?.annotations?.[m.r.SSH_NAMES]||"[]";return JSON.parse(t)},convertToJson(e=""){let t={};try{t=r().load(e)}catch(s){new Error("Function(convertToJson) error")}return t},getSSHFromUserData(e){return this.convertToJson(e)?.ssh_authorized_keys||[]},compareSSHValue(e="",t=""){const s=/(\r\n\t|\n|\r\t)|(\s*)/gm;return e.replace(s,"")===t.replace(s,"")},mergeAllSSHs(e){const t=this.getSSHFromAnnotation(e),{userScript:s}=this.getCloudInitNoCloud(e);if(!t?.length<0&&!s)return[];let a=[];const i=this.$store.getters["currentProduct"].inStore,r=this.$store.getters[`${i}/all`](d.rk.SSH)||[];a=(t||[]).map(e=>{const t=r.find(t=>t.id===e);return t?{id:t.id,data:t,type:S.EXISTING_ALL}:{id:e,data:e,type:S.EXISTING_ONLY_ANNOTATION}});const n=this.getSSHFromUserData(s);return n.map(e=>{const t=r.find(t=>this.compareSSHValue(e,t.spec?.publicKey));t&&!a.find(e=>e.id===t.id)?a.push({id:t.id,data:t,type:S.EXISTING_ALL}):t||a.push({id:"Unknown",data:e,type:S.EXISTING_ONLY_CLOUD})}),a}}}},48249:fuLine truncated
|
||||
//# sourceMappingURL=harvester-1.9.0-dev.umd.min.431.js.map
|
||||
Reference in new issue
Block a user