Revize dd56c333
Přidáno uživatelem Jan Pašek před téměř 4 roky(ů)
static/js/index.js | ||
---|---|---|
1 |
Vue.use(VueLoading);
|
|
2 |
Vue.component('loading', VueLoading)
|
|
1 |
Vue.use(VueLoading); |
|
2 |
Vue.component('loading', VueLoading) |
|
3 | 3 |
|
4 |
// certificate listing app VUE instance
|
|
5 |
var certificateListingApp = new Vue({
|
|
6 |
el: "#certificateListingPage",
|
|
7 |
data: {
|
|
8 |
loading: true,
|
|
9 |
// list of all certificates to be displayed in the list
|
|
10 |
certificates: [],
|
|
11 |
successMessage: ''
|
|
12 |
},
|
|
13 |
mounted: function () {
|
|
14 |
const params = window.location.search;
|
|
15 |
if (params !== "") {
|
|
16 |
const urlParams = new URLSearchParams(params);
|
|
17 |
if (urlParams.get("success") != null) this.successMessage = urlParams.get("success");
|
|
4 |
// certificate listing app VUE instance |
|
5 |
var certificateListingApp = new Vue({ |
|
6 |
el: "#certificateListingPage", |
|
7 |
data: { |
|
8 |
loading: true, |
|
9 |
// list of all certificates to be displayed in the list |
|
10 |
certificates: [], |
|
11 |
successMessage: '' |
|
12 |
}, |
|
13 |
mounted: function () { |
|
14 |
const params = window.location.search; |
|
15 |
if (params !== "") { |
|
16 |
const urlParams = new URLSearchParams(params); |
|
17 |
if (urlParams.get("success") != null) this.successMessage = urlParams.get("success"); |
|
18 | 18 |
|
19 |
// the following code is necessary to dismiss the alert when the page is reloaded
|
|
20 |
const nextURL = '/static/index.html';
|
|
21 |
const nextTitle = 'X.509 Certificate Management';
|
|
22 |
const nextState = { additionalInformation: 'Updated the URL with JS' };
|
|
19 |
// the following code is necessary to dismiss the alert when the page is reloaded |
|
20 |
const nextURL = '/static/index.html'; |
|
21 |
const nextTitle = 'X.509 Certificate Management'; |
|
22 |
const nextState = {additionalInformation: 'Updated the URL with JS'};
|
|
23 | 23 |
|
24 |
// This will create a new entry in the browser's history, without reloading
|
|
25 |
window.history.pushState(nextState, nextTitle, nextURL);
|
|
24 |
// This will create a new entry in the browser's history, without reloading |
|
25 |
window.history.pushState(nextState, nextTitle, nextURL); |
|
26 | 26 |
|
27 |
// This will replace the current entry in the browser's history, without reloading |
|
28 |
window.history.replaceState(nextState, nextTitle, nextURL); |
|
29 |
} |
|
27 |
// This will replace the current entry in the browser's history, without reloading |
|
28 |
window.history.replaceState(nextState, nextTitle, nextURL); |
|
30 | 29 |
} |
31 |
}); |
|
32 | 30 |
|
33 |
// download a list of all available certificates and display them in the table |
|
34 |
axios.get(API_URL + "certificates") |
|
35 |
.then(function (response) { |
|
36 |
if (response.data["success"]) { |
|
37 |
response.data["data"].forEach(item => certificateListingApp.certificates.push(item)) |
|
38 |
} |
|
39 |
certificateListingApp.loading = false; |
|
40 |
}) |
|
41 |
.catch(function (error) { |
|
42 |
console.log(error); |
|
43 |
certificateListingApp.loading = false; |
|
44 |
}); |
|
31 |
// download a list of all available certificates and display them in the table |
|
32 |
axios.get(API_URL + "certificates") |
|
33 |
.then(function (response) { |
|
34 |
if (response.data["success"]) { |
|
35 |
response.data["data"].forEach(item => certificateListingApp.certificates.push(item)) |
|
36 |
} |
|
37 |
certificateListingApp.loading = false; |
|
38 |
}) |
|
39 |
.catch(function (error) { |
|
40 |
console.log(error); |
|
41 |
certificateListingApp.loading = false; |
|
42 |
}); |
|
43 |
} |
|
44 |
}); |
Také k dispozici: Unified diff
Re #8583 - index.js moved initialization code into mounted