mirror of
https://github.com/ClusterCockpit/cc-backend
synced 2026-01-31 08:11:45 +01:00
disable forced filter reset on compare
This commit is contained in:
@@ -37,6 +37,7 @@
|
|||||||
/* Const Init */
|
/* Const Init */
|
||||||
const { query: initq } = init();
|
const { query: initq } = init();
|
||||||
const ccconfig = getContext("cc-config");
|
const ccconfig = getContext("cc-config");
|
||||||
|
const matchedJobCompareLimit = 500;
|
||||||
|
|
||||||
/* State Init */
|
/* State Init */
|
||||||
let filterComponent = $state(); // see why here: https://stackoverflow.com/questions/58287729/how-can-i-export-a-function-from-a-svelte-component-that-changes-a-value-in-the
|
let filterComponent = $state(); // see why here: https://stackoverflow.com/questions/58287729/how-can-i-export-a-function-from-a-svelte-component-that-changes-a-value-in-the
|
||||||
@@ -169,12 +170,12 @@
|
|||||||
{/if}
|
{/if}
|
||||||
<div class="mx-1"></div>
|
<div class="mx-1"></div>
|
||||||
<ButtonGroup class="w-50">
|
<ButtonGroup class="w-50">
|
||||||
<Button color="primary" disabled={(matchedListJobs >= 500 && !(selectedJobs.length != 0)) || $initq.fetching} onclick={() => {
|
<Button color="primary" disabled={(matchedListJobs >= matchedJobCompareLimit && !(selectedJobs.length != 0)) || $initq.fetching} onclick={() => {
|
||||||
if (selectedJobs.length != 0) filterComponent.updateFilters({dbId: selectedJobs}, true)
|
if (selectedJobs.length != 0) filterComponent.updateFilters({dbId: selectedJobs})
|
||||||
showCompare = !showCompare
|
showCompare = !showCompare
|
||||||
}} >
|
}} >
|
||||||
{showCompare ? 'Return to List' :
|
{showCompare ? 'Return to List' :
|
||||||
matchedListJobs >= 500 && selectedJobs.length == 0
|
matchedListJobs >= matchedJobCompareLimit && selectedJobs.length == 0
|
||||||
? 'Compare Disabled'
|
? 'Compare Disabled'
|
||||||
: 'Compare' + (selectedJobs.length != 0 ? ` ${selectedJobs.length} ` : ' ') + 'Jobs'
|
: 'Compare' + (selectedJobs.length != 0 ? ` ${selectedJobs.length} ` : ' ') + 'Jobs'
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user