mirror of
https://github.com/lukaszraczylo/ghtracker.git
synced 2026-10-16 01:08:03 +00:00
feat: refresh a single repository from its own button (#2)
* feat(refresh): refresh a single repository with POST /refresh?repo= The endpoint refreshes one configured repository and returns the full state plus the repo name. Each repository has a 60-second cooldown that is separate from the full-refresh limit. A running full refresh or a refresh of the same repository returns 409. An unknown repository returns 404. Cross-site and disabled-config behaviour stay the same. The collector reuses its fetch path and replaces only that repository. * feat(ui): add a refresh button beside each repository The button appears in the project list and in each attention group header. It stays hidden when the server disables manual refresh. The button shows a spinner while its repository refreshes and reports refusals in the notice line. The store swaps in the returned state, so no extra fetch follows.
This commit is contained in:
+12
@@ -17,6 +17,8 @@ const {
|
||||
state,
|
||||
error,
|
||||
notice,
|
||||
announcement,
|
||||
refreshingRepos,
|
||||
scanning,
|
||||
blocks,
|
||||
visibleBlocks,
|
||||
@@ -91,6 +93,8 @@ onBeforeUnmount(() => {
|
||||
{{ notice }}
|
||||
</p>
|
||||
|
||||
<p class="sr-only" role="status" data-test="announcement">{{ announcement }}</p>
|
||||
|
||||
<LoadingScreen
|
||||
v-if="!state || !state.loaded"
|
||||
:done="state?.scan.done ?? 0"
|
||||
@@ -123,7 +127,11 @@ onBeforeUnmount(() => {
|
||||
:facets="facets"
|
||||
:owners="owners"
|
||||
:active="activeFilters"
|
||||
:manual-refresh="state.manualRefresh"
|
||||
:refreshing="refreshingRepos"
|
||||
:scanning="scanning"
|
||||
@clear="store.clearFilters()"
|
||||
@refresh="store.refreshRepo"
|
||||
/>
|
||||
<aside class="lg:sticky lg:top-6 lg:self-start">
|
||||
<ProjectList
|
||||
@@ -131,7 +139,11 @@ onBeforeUnmount(() => {
|
||||
:total="state.repos.length"
|
||||
:focused="filters.repo"
|
||||
:now-ms="nowMs"
|
||||
:manual-refresh="state.manualRefresh"
|
||||
:refreshing="refreshingRepos"
|
||||
:scanning="scanning"
|
||||
@select="store.toggleRepo"
|
||||
@refresh="store.refreshRepo"
|
||||
/>
|
||||
</aside>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user