kube CSR: preload UI fields

This commit is contained in:
Mikaël Cluseau
2026-07-20 12:20:47 +02:00
parent 4d1deeb773
commit d2aefba82e
5 changed files with 76 additions and 2 deletions
+16
View File
@@ -21,6 +21,22 @@ const ClusterAccess = {
msg: null,
};
},
watch: {
'kubeSignReq.CSR'(v) {
if (v && v.includes('BEGIN CERTIFICATE REQUEST')) {
fetch(`/public/parse-kube-csr`, {
method: 'POST',
body: JSON.stringify({ csr: v }),
headers: { 'Content-Type': 'application/json' },
}).then(r => {
if (r.ok) r.json().then(d => {
if (d.user) this.kubeSignReq.User = d.user;
if (d.group) this.kubeSignReq.Group = d.group;
});
}).catch(() => {});
}
},
},
computed: {
availableAssets() {
return [