1
|
|
2
|
var certificateDetailsApp = new Vue({
|
3
|
el: "#certificate-detailed-view-content",
|
4
|
data: {
|
5
|
id: null,
|
6
|
certificate: {
|
7
|
subject: {
|
8
|
C: "",
|
9
|
ST: "",
|
10
|
L: "",
|
11
|
CN: "",
|
12
|
O: "",
|
13
|
OU: "",
|
14
|
emailAddress: "",
|
15
|
},
|
16
|
notBefore: "",
|
17
|
notAfter: "",
|
18
|
usage: {
|
19
|
CA: false,
|
20
|
authentication: false,
|
21
|
digitalSignature: false,
|
22
|
SSL: false,
|
23
|
},
|
24
|
CA: null,
|
25
|
},
|
26
|
},
|
27
|
computed: {
|
28
|
startDate: function () {
|
29
|
return this.certificate.notBefore.substr(0, 16);
|
30
|
},
|
31
|
endDate: function () {
|
32
|
return this.certificate.notAfter.substr(0, 16);
|
33
|
}
|
34
|
},
|
35
|
watch: {
|
36
|
|
37
|
},
|
38
|
methods: {
|
39
|
onCertificateDownload: function () {
|
40
|
onCertificateDownload(this.id);
|
41
|
},
|
42
|
onRootDownload: function () {
|
43
|
onCertificateRootDownload(this.id);
|
44
|
},
|
45
|
onChainDownload: function () {
|
46
|
onCertificateChainDownload(this.id);
|
47
|
},
|
48
|
onPublicKeyDownload: function () {
|
49
|
onPublicKeyDownload(this.id);
|
50
|
},
|
51
|
onPrivateKeyDownload: function () {
|
52
|
onPrivateKeyDownload(this.id);
|
53
|
},
|
54
|
onRevoke: function () {
|
55
|
|
56
|
},
|
57
|
onDelete: function () {
|
58
|
|
59
|
}
|
60
|
}
|
61
|
});
|
62
|
|
63
|
// get details of the selected certificate
|
64
|
const params = window.location.search;
|
65
|
if (params !== "") {
|
66
|
const urlParams = new URLSearchParams(params);
|
67
|
if (urlParams.get("id") != null) {
|
68
|
const id = urlParams.get("id");
|
69
|
certificateDetailsApp.id = id;
|
70
|
axios.get(API_URL + "certificates/"+id+"/details")
|
71
|
.then(function (response) {
|
72
|
if (response.data["success"])
|
73
|
certificateDetailsApp.certificate = response.data["data"];
|
74
|
})
|
75
|
.catch(function (error) {
|
76
|
alert("There should be some error reaction");
|
77
|
// TODO error reaction -> display fault window
|
78
|
});
|
79
|
} else {
|
80
|
alert("There should be some error reaction");
|
81
|
// TODO error reaction -> display fault window
|
82
|
}
|
83
|
} else {
|
84
|
alert("There should be some error reaction");
|
85
|
// TODO error reaction -> display fault window
|
86
|
}
|