Projekt

Obecné

Profil

« Předchozí | Další » 

Revize ed76e293

Přidáno uživatelem Jan Pašek před téměř 4 roky(ů)

Re #8706 - Added status adn issuer details to certificate details view

Zobrazit rozdíly:

static/certificate.html
35 35
            <div class="row">
36 36
                <div class="col-xl-6">
37 37
                    <table class="ml-auto mr-auto mb-4">
38
                        <tr>
39
                            <td>Status:</td>
40
                            <td class="pl-3">
41
                                <h5><span class="badge badge-success" v-if="certificate.status == 'valid'">Valid</span></h5>
42
                                <h5><span class="badge badge-warning" v-if="certificate.status == 'revoked'">Revoked</span></h5>
43
                                <h5><span class="badge badge-danger" v-if="certificate.status == 'expired'">Expired</span></h5>
44
                            </td>
45
                        </tr>
38 46
                        <tr>
39 47
                            <div class="form-group">
40 48
                                <td><label for="validity_start">Validity start:</label></td>
......
126 134
                                <label class="form-check-label" for="isSSL_TLS">SSL/TLS</label><br>
127 135
                            </td>
128 136
                        </tr>
137
                        <tr>
138
                            <td colspan="2" v-if="certificate.CA != id">
139
                                <button v-on:click="onShowIssuer()" class="btn btn-outline-secondary btn-block mt-5" type="button">
140
                                    <span v-if="!displayIssuer">Show issuer</span>
141
                                    <span v-if="displayIssuer">Hide issuer</span>
142
                                </button>
143
                            </td>
144
                        </tr>
145
                        <div id="issuerCollapse">
146
                            <tr v-if="displayIssuer">
147
                                <td colspan="2"><h5 class="mt-2">Issuer</h5></td>
148
                            </tr>
149
                            <tr v-if="displayIssuer" >
150
                                <div class="form-group">
151
                                    <td><label for="subject_C">Country Code:</label></td>
152
                                    <td class="pl-3">
153
                                        <input :value="issuer.subject.C" type="text" id="subject_C" name="subject_C" class="form-control" disabled>
154
                                    </td>
155
                                </div>
156
                            </tr>
157
                            <tr v-if="displayIssuer" >
158
                                <div class="form-group">
159
                                    <td><label for="subject_ST">Province/State:</label></td>
160
                                    <td class="pl-3">
161
                                        <input :value="issuer.subject.ST" type="text" id="subject_ST" name="subject_ST" class="form-control" disabled>
162
                                    </td>
163
                                </div>
164
                            </tr>
165
                            <tr v-if="displayIssuer" >
166
                                <div class="form-group">
167
                                    <td><label for="subject_L">Locality:</label></td>
168
                                    <td class="pl-3">
169
                                        <input :value="issuer.subject.L" type="text" id="subject_L" name="subject_L" class="form-control" disabled>
170
                                    </td>
171
                                </div>
172
                            </tr>
173
                            <tr v-if="displayIssuer" >
174
                                <div class="form-group">
175
                                    <td><label for="subject_CN">Common Name:</label></td>
176
                                    <td class="pl-3">
177
                                        <input :value="issuer.subject.CN" type="text" id="subject_CN" name="subject_CN" class="form-control" disabled>
178
                                    </td>
179
                                </div>
180
                            </tr>
181
                            <tr v-if="displayIssuer" >
182
                                <div class="form-group">
183
                                    <td><label for="subject_O">Organization:</label></td>
184
                                    <td class="pl-3">
185
                                        <input :value="issuer.subject.O" type="text" id="subject_O" name="subject_O" class="form-control" disabled>
186
                                    </td>
187
                                </div>
188
                            </tr>
189
                            <tr v-if="displayIssuer" >
190
                                <div class="form-group">
191
                                    <td><label for="subject_OU">Organization Unit:</label></td>
192
                                    <td class="pl-3">
193
                                        <input :value="issuer.subject.OU" type="text" id="subject_OU" name="subject_OU" class="form-control" disabled>
194
                                    </td>
195
                                </div>
196
                            </tr>
197
                            <tr v-if="displayIssuer" >
198
                                <div class="form-group">
199
                                    <td><label for="subject_emailAddress">Email Address:</label></td>
200
                                    <td class="pl-3">
201
                                        <input :value="issuer.subject.emailAddress" type="text" id="subject_emailAddress" name="subject_emailAddress" class="form-control" disabled>
202
                                    </td>
203
                                </div>
204
                            </tr>
205
                            <tr v-if="displayIssuer" >
206
                                <td>Usage:</td>
207
                                <td class="form-check">
208
                                    <input class="form-check-input" v-model="issuer.usage.CA" type="checkbox" id="isCA" name="isCA" value="CA" disabled>
209
                                    <label class="form-check-label" for="isCA">CA</label><br>
210

  
211
                                    <input class="form-check-input" v-model="issuer.usage.digitalSignature" type="checkbox" id="isDigitalSignature" name="isDigitalSignature" value="DigitalSignature" disabled>
212
                                    <label class="form-check-label" for="isDigitalSignature">Digital Signature</label><br>
213

  
214
                                    <input class="form-check-input" v-model="issuer.usage.authentication" type="checkbox" id="isAuthentication" name="isAuthentication" value="Authentication" disabled>
215
                                    <label class="form-check-label" for="isAuthentication">Authentication</label><br>
216

  
217
                                    <input class="form-check-input" v-model="issuer.usage.SSL" type="checkbox" id="isSSL_TLS" name="isSSL_TLS" value="SSL_TLS" disabled>
218
                                    <label class="form-check-label" for="isSSL_TLS">SSL/TLS</label><br>
219
                                </td>
220
                            </tr>
221
                        </div>
129 222
                    </table>
130 223
                </div>
131 224
                <div class="col-xl-5">
static/js/certificate.js
8 8
        loading: true,
9 9
        error: false,
10 10
        id: null,
11
        displayIssuer: false,
12
        issuerLoaded: false,
11 13
        revocationReason: "unspecified",
12 14
        issuedCertificates: [],
13 15
        certificate: {
......
29 31
                SSL: false,
30 32
            },
31 33
            CA: null,
34
            status: "",
35
        },
36
        issuer: {
37
            subject: {
38
                C: "",
39
                ST: "",
40
                L: "",
41
                CN: "",
42
                O: "",
43
                OU: "",
44
                emailAddress: "",
45
            },
46
            notBefore: "",
47
            notAfter: "",
48
            usage: {
49
                CA: false,
50
                authentication: false,
51
                digitalSignature: false,
52
                SSL: false,
53
            },
54
            CA: null,
55
            status: "",
32 56
        },
33 57
        errorMessage: "",
34 58
        successMessage: "",
......
52 76
    },
53 77
    watch: {},
54 78
    methods: {
79
        onShowIssuer: async function() {
80
            this.displayIssuer = ~this.displayIssuer;
81
            if (!this.issuerLoaded) {
82
                // query certificate details
83
                try {
84
                    const response = await axios.get(API_URL + "certificates/" + this.certificate.CA + "/details");
85
                    if (response.data["success"]) {
86
                        // display certificate
87
                        certificateDetailsApp.issuer = response.data["data"];
88
                        this.issuerLoaded = true;
89
                    } else {
90
                        // certificate does not exists
91
                        console.error("Required certificate does not exists");
92
                        this.showError("Error occurred while loading issuer's details.");
93
                    }
94
                } catch (error) {
95
                    console.error(error);
96
                    this.showError("Error occurred while loading issuer's details.");
97
                }
98
            }
99
        },
55 100
        onCertificateDownload: async function () {
56 101
            await onCertificateDownload(this.id);
57 102
        },

Také k dispozici: Unified diff