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