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