mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-09-05 08:02:18 +00:00
fix: only show Load more when jobs count >= perPage
- Default lastFetchWentToEnd to true so Load more is hidden until a full page is confirmed - Set lastFetchWentToEnd after initial load, not just after loadExtra - Add jobs.length >= perPage guard in template to prevent flicker Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
0c739a7542
commit
cb1920fe7e
@@ -760,7 +760,7 @@
|
||||
transformInputSelectedText={(_, v) => `${pluralize(v, 'day')} lookback`}
|
||||
tooltip={'How far behind the min datetime to start considering jobs for the concurrency graph. Change this value to include jobs started before the set time window for the computation of the graph'}
|
||||
/>
|
||||
{:else if !lastFetchWentToEnd}
|
||||
{:else if !lastFetchWentToEnd && (jobs?.length ?? 0) >= (perPage.val ?? 1000)}
|
||||
<Button wrapperClasses="ml-2" unifiedSize="md" onClick={() => jobsLoader.loadExtraJobs()}>
|
||||
Load more
|
||||
<Tooltip>There are more jobs to load</Tooltip>
|
||||
|
||||
@@ -100,7 +100,7 @@ export function useJobsLoader(args: () => UseJobLoaderArgs) {
|
||||
let queue_count: Tweened<number> | undefined = $state()
|
||||
let suspended_count: Tweened<number> | undefined = $state()
|
||||
let loading = $state(false)
|
||||
let lastFetchWentToEnd = $state(false)
|
||||
let lastFetchWentToEnd = $state(true)
|
||||
|
||||
let completedJobs: CompletedJob[] | undefined = $state()
|
||||
let externalJobs: Job[] | undefined = $state()
|
||||
@@ -329,6 +329,7 @@ export function useJobsLoader(args: () => UseJobLoaderArgs) {
|
||||
jobs = sortMinDate(minTs, newJobs)
|
||||
externalJobs = []
|
||||
computeCompletedJobs()
|
||||
lastFetchWentToEnd = newJobs.length < perPage
|
||||
loading = false
|
||||
}
|
||||
)
|
||||
@@ -359,6 +360,7 @@ export function useJobsLoader(args: () => UseJobLoaderArgs) {
|
||||
externalJobs = computeExternalJobs(newExternalJobs)
|
||||
}
|
||||
computeCompletedJobs()
|
||||
lastFetchWentToEnd = newJobs.length < perPage
|
||||
loading = false
|
||||
}
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user