Skip to content

Commit e655e84

Browse files
authored
Reports section performance improvements (#307)
1 parent c96d53f commit e655e84

File tree

10 files changed

+202
-61
lines changed

10 files changed

+202
-61
lines changed

resources/dist/build/assets/cp-c6df7fbd.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

resources/dist/build/assets/cp-fd4a5639.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

resources/dist/build/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"css": [
1313
"assets/cp-56146771.css"
1414
],
15-
"file": "assets/cp-fd4a5639.js",
15+
"file": "assets/cp-c6df7fbd.js",
1616
"isEntry": true,
1717
"src": "resources/js/cp.js"
1818
}
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
<template>
2+
3+
<div>
4+
<div v-if="score">
5+
<seo-pro-status-icon :status="status" class="inline-block ml-1 mr-3"></seo-pro-status-icon>
6+
{{ score }}%
7+
</div>
8+
<loading-graphic v-else :text="null" :inline="true" />
9+
</div>
10+
11+
</template>
12+
13+
14+
<script>
15+
export default {
16+
17+
props: [
18+
'id',
19+
'initialStatus',
20+
'initialScore',
21+
],
22+
23+
data() {
24+
return {
25+
status: this.initialStatus,
26+
score: this.initialScore,
27+
}
28+
},
29+
30+
created() {
31+
if (! this.score) this.updateScore();
32+
},
33+
34+
methods: {
35+
updateScore() {
36+
Statamic.$request.get(cp_url(`seo-pro/reports/${this.id}`)).then(response => {
37+
if (response.data.status === 'pending' || response.data.status === 'generating') {
38+
setTimeout(() => this.updateScore(), 1000);
39+
return;
40+
}
41+
42+
this.status = response.data.status;
43+
this.score = response.data.score;
44+
});
45+
},
46+
},
47+
48+
}
49+
</script>

0 commit comments

Comments
 (0)