Fix requests display for web instance
This commit is contained in:
@@ -89,7 +89,7 @@
|
|||||||
let requests = {limit:0, used:0, remaining:0, reset:NaN}
|
let requests = {limit:0, used:0, remaining:0, reset:NaN}
|
||||||
if (!conf.settings.notoken) {
|
if (!conf.settings.notoken) {
|
||||||
requests = (await rest.rateLimit.get()).data.rate
|
requests = (await rest.rateLimit.get()).data.rate
|
||||||
setInterval(async() => requests = (await rest.rateLimit.get()).data.rate, 30*1000)
|
setInterval(async() => requests = (await rest.rateLimit.get()).data.rate, 5*60*1000)
|
||||||
}
|
}
|
||||||
//Web
|
//Web
|
||||||
app.get("/", limiter, (req, res) => res.sendFile(`${conf.paths.statics}/index.html`))
|
app.get("/", limiter, (req, res) => res.sendFile(`${conf.paths.statics}/index.html`))
|
||||||
|
|||||||
@@ -23,10 +23,6 @@
|
|||||||
//GitHub limit tracker
|
//GitHub limit tracker
|
||||||
const {data:requests} = await axios.get("/.requests")
|
const {data:requests} = await axios.get("/.requests")
|
||||||
this.requests = requests
|
this.requests = requests
|
||||||
setInterval(async () => {
|
|
||||||
const {data:requests} = await axios.get("/.requests")
|
|
||||||
this.requests = requests
|
|
||||||
}, 15000)
|
|
||||||
//Generate placeholder
|
//Generate placeholder
|
||||||
this.mock({timeout:200})
|
this.mock({timeout:200})
|
||||||
setInterval(() => {
|
setInterval(() => {
|
||||||
|
|||||||
@@ -49,7 +49,7 @@
|
|||||||
<button @click="generate" :disabled="(!user)||(generated.pending)">
|
<button @click="generate" :disabled="(!user)||(generated.pending)">
|
||||||
{{ generated.pending ? 'Working on it :)' : 'Generate your metrics!' }}
|
{{ generated.pending ? 'Working on it :)' : 'Generate your metrics!' }}
|
||||||
</button>
|
</button>
|
||||||
<small>{{ requests.limit }} GitHub requests remaining</small>
|
<small>{{ requests.remaining }} GitHub requests remaining</small>
|
||||||
|
|
||||||
<div class="configuration">
|
<div class="configuration">
|
||||||
<b>🖼️ Template</b>
|
<b>🖼️ Template</b>
|
||||||
|
|||||||
Reference in New Issue
Block a user