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/utilities.js
25 25
    var local = new Date(this);
26 26
    local.setMinutes(this.getMinutes() - this.getTimezoneOffset());
27 27
    return local.toJSON().slice(0,10);
28
});
28
});
29

  
30
// Get the certificate PEM data from the server and downloads it to users computer
31
function onCertificateDownload(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
            } else
37
                console.log("Error occurred while downloading the certificate") // TODO more action may be required
38
        })
39
        .catch(function (error) {
40
            console.log(error);
41
        });
42
}
43

  
44
// Get the certificate's chain of trust in PEM format from the server and downloads it to users computer
45
function onCertificateChainDownload(id) {
46
    axios.get(API_URL + "certificates/" + id + "/chain")
47
        .then(function (response) {
48
            if(response.data["success"]) {
49
                download(id + "_chain.pem", response.data["data"])
50
            }
51
            else
52
                console.log("Error occurred while downloading the certificate's chain of trust") // TODO more action may be required
53
        })
54
        .catch(function (error) {
55
            console.log(error);
56
        });
57
}
58

  
59
// Get the certificate's root CA as PEM data from the server and downloads it to users computer
60
function onCertificateRootDownload(id) {
61
    axios.get(API_URL + "certificates/" + id + "/root")
62
        .then(function (response) {
63
            if(response.data["success"]) {
64
                download(id + "_root.pem", response.data["data"])
65
            }
66
            else
67
                console.log("Error occurred while downloading the certificate's root CA") // TODO more action may be required
68
        })
69
        .catch(function (error) {
70
            console.log(error);
71
        });
72
}

Také k dispozici: Unified diff