feat(app/web): update ratelimit and placeholders (#826)

This commit is contained in:
Simon Lecoq
2022-01-28 02:22:42 +01:00
committed by GitHub
parent 9f4e255c85
commit 3945af02d1
12 changed files with 3124 additions and 28 deletions

View File

@@ -93,6 +93,10 @@
}
finally {
this.pending = false
try {
const { data: requests } = await axios.get("/.requests")
this.requests = requests
} catch {}
}
},
},
@@ -111,6 +115,7 @@
return this.metrics?.rendered.plugins.followup ?? null
},
habits() {
console.log(this.metrics?.rendered.plugins.habits.commits.hours)
return this.metrics?.rendered.plugins.habits.commits.hours ?? null
},
isocalendar() {
@@ -142,6 +147,10 @@
preview() {
return /-preview$/.test(this.version)
},
rlreset() {
const reset = new Date(Math.max(this.requests.graphql.reset, this.requests.rest.reset))
return `${reset.getHours()}:${reset.getMinutes()}`
}
},
//Data initialization
data: {
@@ -151,7 +160,7 @@
embed: false,
localstorage: false,
searchable: false,
requests: { limit: 0, used: 0, remaining: 0, reset: 0 },
requests: {rest:{limit:0, used:0, remaining:0, reset:NaN}, graphql:{limit:0, used:0, remaining:0, reset:NaN}},
palette: "light",
metrics: null,
pending: false,