|
1 | 1 | <script> |
2 | 2 | import { page } from '$app/stores'; |
| 3 | + import { getTimestamp } from '$lib/common/component_utilities'; |
3 | 4 | import { displayStandardErrorAlert, getAlertErrorFromResponse } from '$lib/common/errors'; |
4 | 5 | import BooleanIcon from '$lib/components/common/BooleanIcon.svelte'; |
5 | 6 | import ConfirmActionButton from '$lib/components/common/ConfirmActionButton.svelte'; |
|
21 | 22 | let privateGroup = null; |
22 | 23 | /** @type {boolean|null} */ |
23 | 24 | let active = null; |
| 25 | + let lastUsedDateMin; |
| 26 | + let lastUsedTimeMin = ''; |
| 27 | + let lastUsedDateMax = ''; |
| 28 | + let lastUsedTimeMax = ''; |
24 | 29 |
|
25 | 30 | let searched = false; |
26 | 31 | let searching = false; |
|
65 | 70 | if (active !== null) { |
66 | 71 | url.searchParams.append('active', active.toString()); |
67 | 72 | } |
| 73 | + const lasUsedTimestampMin = getTimestamp(lastUsedDateMin, lastUsedTimeMin); |
| 74 | + if (lasUsedTimestampMin) { |
| 75 | + url.searchParams.append('timestamp_last_used_min', lasUsedTimestampMin); |
| 76 | + } |
| 77 | + const lasUsedTimestampMax = getTimestamp(lastUsedDateMax, lastUsedTimeMax); |
| 78 | + if (lasUsedTimestampMax) { |
| 79 | + url.searchParams.append('timestamp_last_used_max', lasUsedTimestampMax); |
| 80 | + } |
68 | 81 | const response = await fetch(url); |
69 | 82 | if (!response.ok) { |
70 | 83 | searchErrorAlert = displayStandardErrorAlert( |
|
88 | 101 | user_group_id = ''; |
89 | 102 | pkg_name = ''; |
90 | 103 | origin = ''; |
| 104 | + lastUsedDateMin = ''; |
| 105 | + lastUsedTimeMin = ''; |
| 106 | + lastUsedDateMax = ''; |
| 107 | + lastUsedTimeMax = ''; |
91 | 108 | privateGroup = null; |
92 | 109 | active = null; |
93 | 110 | searched = false; |
|
237 | 254 | </div> |
238 | 255 | </div> |
239 | 256 | </div> |
| 257 | +
|
| 258 | + <div class="row mt-3"> |
| 259 | + <div class="col-md-3 col-lg-2 mt-2">Last used</div> |
| 260 | + <div class="col-md-9 col-lg-10"> |
| 261 | + <div class="row row-cols-md-auto"> |
| 262 | + <div class="col-12 mt-1"> |
| 263 | + <div class="input-group"> |
| 264 | + <div class="input-group-text">Min</div> |
| 265 | + <input |
| 266 | + type="date" |
| 267 | + class="form-control" |
| 268 | + bind:value={lastUsedDateMin} |
| 269 | + id="last_used_date_min" |
| 270 | + /> |
| 271 | + <input |
| 272 | + type="time" |
| 273 | + class="form-control" |
| 274 | + bind:value={lastUsedTimeMin} |
| 275 | + id="last_used_time_min" |
| 276 | + /> |
| 277 | + </div> |
| 278 | + </div> |
| 279 | + <div class="col-12 mt-1"> |
| 280 | + <div class="input-group"> |
| 281 | + <div class="input-group-text">Max</div> |
| 282 | + <input |
| 283 | + type="date" |
| 284 | + class="form-control" |
| 285 | + bind:value={lastUsedDateMax} |
| 286 | + id="last_used_date_max" |
| 287 | + /> |
| 288 | + <input |
| 289 | + type="time" |
| 290 | + class="form-control" |
| 291 | + bind:value={lastUsedTimeMax} |
| 292 | + id="last_used_time_max" |
| 293 | + /> |
| 294 | + </div> |
| 295 | + </div> |
| 296 | + </div> |
| 297 | + </div> |
| 298 | + </div> |
240 | 299 | </div> |
241 | 300 | </div> |
242 | 301 |
|
|
405 | 464 | .row-grey { |
406 | 465 | background-color: #f2f2f2; |
407 | 466 | } |
| 467 | +
|
| 468 | + input[type='date'] { |
| 469 | + min-width: 190px; |
| 470 | + } |
408 | 471 | </style> |
0 commit comments