User and Project List with 30d filter plus label

- Readable labels for other quick select ranges also
- Note: URL not reformatted for copy-bility
This commit is contained in:
Christoph Kluge
2023-06-19 17:59:44 +02:00
parent c8068f45eb
commit 5ba84efab6
2 changed files with 46 additions and 43 deletions

View File

@@ -24,6 +24,16 @@
export let type;
export let filterPresets;
// By default, look at the jobs of the last 30 days:
if (filterPresets?.startTime == null) {
if (filterPresets == null)
filterPresets = {}
const lastMonth = (new Date(Date.now() - (30*24*60*60*1000))).toISOString()
const now = (new Date(Date.now())).toISOString()
filterPresets.startTime = { from: lastMonth, to: now, text: 'Last 30 Days', url: 'last30d' }
}
console.assert(
type == "USER" || type == "PROJECT",
"Invalid list type provided!"