kube CSR: preload UI fields
This commit is contained in:
@@ -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 [
|
||||
|
||||
Reference in New Issue
Block a user