diff --git a/html/ui/Cluster-703dcdca97841304.js b/html/ui/Cluster-ddf1029883a9a21d.js similarity index 74% rename from html/ui/Cluster-703dcdca97841304.js rename to html/ui/Cluster-ddf1029883a9a21d.js index 2436c51..827a01f 100644 --- a/html/ui/Cluster-703dcdca97841304.js +++ b/html/ui/Cluster-ddf1029883a9a21d.js @@ -15,6 +15,7 @@ const Cluster = { Group: "system:masters", }, kubeUserCert: null, + downloadSet: null, }; }, methods: { @@ -66,6 +67,28 @@ const Cluster = { this.kubeSignReq.CSR = v; }); }, + generateDownloadSet() { + event.preventDefault() + + const hosts = (this.state.Hosts||[]).filter(h => h.Cluster == this.cluster.Name) + const items = hosts.map(h => ({ + Kind: "host", + Name: h.Name, + Assets: ["kernel", "initrd", "uki", "bootstrap.tar", "boot.img.gz", "boot.img", "boot.qcow2", "boot.iso", "boot.tar", "bootstrap-config", "config", "config.json", "ipxe"], + })) + + fetch('/sign-download-set', { + method: 'POST', + body: JSON.stringify({Expiry: this.signReqValidity, Items: items}), + headers: { 'Authorization': 'Bearer ' + this.token, 'Content-Type': 'application/json' }, + }).then((resp) => { + if (resp.ok) { + resp.json().then((set) => { this.downloadSet = set }) + } else { + resp.json().then((resp) => alert('failed to generate: '+resp.message)) + } + }).catch((e) => { alert('failed to generate: '+e) }) + }, }, template: `

Access

@@ -116,6 +139,15 @@ const Cluster = {

Downloads

+

Download set

+

Validity: time range, ie: -5m:1w, 5m, 1M, 1y, 1d-1s, etc.

+

+

+ Open download set page +
+ +

+

CAs

diff --git a/html/ui/index.html b/html/ui/index.html index 042e2c9..2b5b9c7 100644 --- a/html/ui/index.html +++ b/html/ui/index.html @@ -13,7 +13,7 @@ - + diff --git a/ui/js/Cluster.js b/ui/js/Cluster.js index 2436c51..827a01f 100644 --- a/ui/js/Cluster.js +++ b/ui/js/Cluster.js @@ -15,6 +15,7 @@ const Cluster = { Group: "system:masters", }, kubeUserCert: null, + downloadSet: null, }; }, methods: { @@ -66,6 +67,28 @@ const Cluster = { this.kubeSignReq.CSR = v; }); }, + generateDownloadSet() { + event.preventDefault() + + const hosts = (this.state.Hosts||[]).filter(h => h.Cluster == this.cluster.Name) + const items = hosts.map(h => ({ + Kind: "host", + Name: h.Name, + Assets: ["kernel", "initrd", "uki", "bootstrap.tar", "boot.img.gz", "boot.img", "boot.qcow2", "boot.iso", "boot.tar", "bootstrap-config", "config", "config.json", "ipxe"], + })) + + fetch('/sign-download-set', { + method: 'POST', + body: JSON.stringify({Expiry: this.signReqValidity, Items: items}), + headers: { 'Authorization': 'Bearer ' + this.token, 'Content-Type': 'application/json' }, + }).then((resp) => { + if (resp.ok) { + resp.json().then((set) => { this.downloadSet = set }) + } else { + resp.json().then((resp) => alert('failed to generate: '+resp.message)) + } + }).catch((e) => { alert('failed to generate: '+e) }) + }, }, template: `

Access

@@ -116,6 +139,15 @@ const Cluster = {

Downloads

+

Download set

+

Validity: time range, ie: -5m:1w, 5m, 1M, 1y, 1d-1s, etc.

+

+

+ Open download set page +
+ +

+

CAs

NameCertificateSigned certificates
NameCertificateSigned certificates