Revize a42ed5f4
Přidáno uživatelem Jan Pašek před téměř 4 roky(ů)
static/js/create_certificate.js | ||
---|---|---|
86 | 86 |
} |
87 | 87 |
this.certificateData.validityDays = parseInt(this.certificateData.validityDays); |
88 | 88 |
try { |
89 |
const response = await axios.post(API_URL + "certificates", this.certificateData); |
|
89 |
// create a deep copy of the certificate dataa |
|
90 |
var certificateDataCopy = JSON.parse(JSON.stringify(this.certificateData)); |
|
91 |
certificateDataCopy.usage = []; |
|
92 |
|
|
93 |
// convert usage dictionary to list |
|
94 |
if (this.certificateData.usage.CA) certificateDataCopy.usage.push("CA"); |
|
95 |
if (this.certificateData.usage.digitalSignature) certificateDataCopy.usage.push("digitalSignature"); |
|
96 |
if (this.certificateData.usage.authentication) certificateDataCopy.usage.push("authentication"); |
|
97 |
if (this.certificateData.usage.SSL) certificateDataCopy.usage.push("SSL"); |
|
98 |
|
|
99 |
// call RestAPI endpoint |
|
100 |
const response = await axios.post(API_URL + "certificates", certificateDataCopy); |
|
90 | 101 |
if (response.data["success"]) { |
91 | 102 |
window.location.href = "/static/index.html?success=Certificate+successfully+created"; |
92 | 103 |
} |
... | ... | |
95 | 106 |
createCertificateApp.showError(response.data["data"]); |
96 | 107 |
} |
97 | 108 |
} catch (error) { |
109 |
this.showError("An error occurred while creating a certificate. For more details, see console.") |
|
98 | 110 |
console.log(error); |
99 | 111 |
} |
100 | 112 |
} |
Také k dispozici: Unified diff
Re #8705 - Changed usage dict to usage list in the client application while creating certificate