Add caching to GitHub star badge to reduce API calls

Co-authored-by: cute-omega <92797441+cute-omega@users.noreply.github.com>
pull/534/head
copilot-swe-agent[bot] 2025-11-15 13:22:41 +00:00
parent 7351f98f0b
commit 5dda806cb8
1 changed files with 9 additions and 5 deletions

View File

@ -50,6 +50,11 @@ export default {
}
return false
},
githubStarBadgeUrl () {
// API
const today = new Date().toISOString().split('T')[0] // YYYY-MM-DD
return `https://img.shields.io/github/stars/docmirror/dev-sidecar?logo=github&cacheSeconds=86400&t=${today}`
},
},
async created () {
await this.doCheckRootCa()
@ -352,11 +357,10 @@ export default {
如果它解决了你的问题请不要吝啬你的star哟点这里
<a-icon style="margin-right:10px;" type="arrow-right" theme="outlined" />
</div>
<a @click="openExternal('https://github.com/docmirror/dev-sidecar')">
<a-button type="primary" icon="star">
Star on GitHub
</a-button>
</a>
<a @click="openExternal('https://github.com/docmirror/dev-sidecar')"><img
alt="GitHub stars"
:src="githubStarBadgeUrl"
></a>
</div>
</div>
</div>