Projekt

Obecné

Profil

« Předchozí | Další » 

Revize 7a423499

Přidáno uživatelem Jan Pašek před asi 4 roky(ů)

Re #8583 - Details page subject data

Zobrazit rozdíly:

static/js/components.js
28 28
    methods: {
29 29
        // Get the certificate PEM data from the server and downloads it to users computer
30 30
        onCertificateDownload: function () {
31
            var id = this.certificate.id;
32
            axios.get(API_URL + "certificates/" + id)
33
                .then(function (response) {
34
                    if(response.data["success"]) {
35
                        download(id + ".pem", response.data["data"])
36
                    }
37
                    else
38
                        console.log("Error occurred while downloading the certificate") // TODO more action may be required
39
                })
40
                .catch(function (error) {
41
                    console.log(error);
42
                });
31
            onCertificateDownload(this.certificate.id)
43 32
        },
44
        // Get the certificate's chain of trust in PEM format from the server and downloads it to users computer
45
        onCertificateChainDownload: function () {
46
            var id = this.certificate.id;
47
            axios.get(API_URL + "certificates/" + id + "/chain")
48
                .then(function (response) {
49
                    if(response.data["success"]) {
50
                        download(id + "_chain.pem", response.data["data"])
51
                    }
52
                    else
53
                        console.log("Error occurred while downloading the certificate's chain of trust") // TODO more action may be required
54
                })
55
                .catch(function (error) {
56
                    console.log(error);
57
                });
58
        },
59
        // Get the certificate's root CA as PEM data from the server and downloads it to users computer
60
        onCertificateRootDownload: function () {
61
            var id = this.certificate.id;
62
            axios.get(API_URL + "certificates/" + id + "/root")
63
                .then(function (response) {
64
                    if(response.data["success"]) {
65
                        download(id + "_root.pem", response.data["data"])
66
                    }
67
                    else
68
                        console.log("Error occurred while downloading the certificate's root CA") // TODO more action may be required
69
                })
70
                .catch(function (error) {
71
                    console.log(error);
72
                });
73
        }
74 33
    }
75 34
});
76 35

  

Také k dispozici: Unified diff