mirror of
https://github.com/ClusterCockpit/cc-backend
synced 2025-05-13 20:51:43 +02:00
add filterBuffer for seamless view switch
This commit is contained in:
parent
df497d5952
commit
1c84bcae35
@ -36,6 +36,7 @@
|
||||
export let roles;
|
||||
|
||||
let filterComponent; // 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 filterBuffer = [];
|
||||
let jobList,
|
||||
jobCompare,
|
||||
matchedListJobs,
|
||||
@ -100,6 +101,7 @@
|
||||
selectedCluster = detail.filters[0]?.cluster
|
||||
? detail.filters[0].cluster.eq
|
||||
: null;
|
||||
filterBuffer = [...detail.filters]
|
||||
if (showCompare) {
|
||||
jobCompare.queryJobs(detail.filters);
|
||||
} else {
|
||||
@ -131,7 +133,7 @@
|
||||
<Button color="primary" on:click={() => {
|
||||
showCompare = !showCompare
|
||||
}} >
|
||||
{showCompare ? 'Compare' : 'List'} Jobs
|
||||
{showCompare ? 'List' : 'Compare'} Jobs
|
||||
</Button>
|
||||
</Col>
|
||||
</Row>
|
||||
@ -146,12 +148,14 @@
|
||||
bind:sorting
|
||||
bind:matchedListJobs
|
||||
bind:showFootprint
|
||||
{filterBuffer}
|
||||
/>
|
||||
{:else}
|
||||
<JobCompare
|
||||
bind:this={jobCompare}
|
||||
bind:metrics
|
||||
bind:matchedCompareJobs
|
||||
{filterBuffer}
|
||||
/>
|
||||
{/if}
|
||||
</Col>
|
||||
|
@ -32,9 +32,10 @@
|
||||
}
|
||||
|
||||
export let matchedCompareJobs = 0;
|
||||
export let filterBuffer = [];
|
||||
export let metrics = ccconfig.plot_list_selectedMetrics;
|
||||
|
||||
let filter = [];
|
||||
let filter = [...filterBuffer];
|
||||
const sorting = { field: "startTime", type: "col", order: "DESC" };
|
||||
|
||||
/* GQL */
|
||||
|
@ -38,12 +38,13 @@
|
||||
export let matchedListJobs = 0;
|
||||
export let metrics = ccconfig.plot_list_selectedMetrics;
|
||||
export let showFootprint;
|
||||
export let filterBuffer = [];
|
||||
|
||||
let usePaging = ccconfig.job_list_usePaging
|
||||
let itemsPerPage = usePaging ? ccconfig.plot_list_jobsPerPage : 10;
|
||||
let page = 1;
|
||||
let paging = { itemsPerPage, page };
|
||||
let filter = [];
|
||||
let filter = [...filterBuffer];
|
||||
let lastFilter = [];
|
||||
let lastSorting = null;
|
||||
let triggerMetricRefresh = false;
|
||||
|
Loading…
x
Reference in New Issue
Block a user