mirror of
https://github.com/ClusterCockpit/cc-backend
synced 2024-12-24 12:29:05 +01:00
Fix filter implementation in user view
This commit is contained in:
parent
37d9b5172b
commit
246ac0563f
@ -18,8 +18,9 @@
|
|||||||
export let user
|
export let user
|
||||||
export let filterPresets
|
export let filterPresets
|
||||||
|
|
||||||
let filters = []
|
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 jobList
|
let jobList;
|
||||||
|
let jobFilters = [];
|
||||||
let sorting = { field: 'startTime', order: 'DESC' }, isSortingOpen = false
|
let sorting = { field: 'startTime', order: 'DESC' }, isSortingOpen = false
|
||||||
let metrics = ccconfig.plot_list_selectedMetrics, isMetricsSelectionOpen = false
|
let metrics = ccconfig.plot_list_selectedMetrics, isMetricsSelectionOpen = false
|
||||||
let w1, w2, histogramHeight = 250
|
let w1, w2, histogramHeight = 250
|
||||||
@ -29,8 +30,8 @@
|
|||||||
$: stats = queryStore({
|
$: stats = queryStore({
|
||||||
client: client,
|
client: client,
|
||||||
query: gql`
|
query: gql`
|
||||||
query($filters: [JobFilter!]!) {
|
query($jobFilters: [JobFilter!]!) {
|
||||||
jobsStatistics(filter: $filters) {
|
jobsStatistics(filter: $jobFilters) {
|
||||||
totalJobs
|
totalJobs
|
||||||
shortJobs
|
shortJobs
|
||||||
totalWalltime
|
totalWalltime
|
||||||
@ -38,12 +39,10 @@
|
|||||||
histDuration { count, value }
|
histDuration { count, value }
|
||||||
histNumNodes { count, value }
|
histNumNodes { count, value }
|
||||||
}}`,
|
}}`,
|
||||||
variables: { filters }
|
variables: { jobFilters }
|
||||||
})
|
})
|
||||||
|
|
||||||
$: selectedCluster = filters[0]?.cluster ? filters[0].cluster.eq : null
|
onMount(() => filterComponent.update())
|
||||||
|
|
||||||
onMount(() => filters.update())
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<Row>
|
<Row>
|
||||||
@ -74,10 +73,10 @@
|
|||||||
<Filters
|
<Filters
|
||||||
filterPresets={filterPresets}
|
filterPresets={filterPresets}
|
||||||
startTimeQuickSelect={true}
|
startTimeQuickSelect={true}
|
||||||
bind:this={filters}
|
bind:this={filterComponent}
|
||||||
on:update={({ detail }) => {
|
on:update={({ detail }) => {
|
||||||
let jobFilters = [...detail.filters, { user: { eq: user.username } }]
|
jobFilters = [...detail.filters, { user: { eq: user.username } }]
|
||||||
filters = jobFilters
|
selectedCluster = jobFilters[0]?.cluster ? jobFilters[0].cluster.eq : null
|
||||||
jobList.update(jobFilters)
|
jobList.update(jobFilters)
|
||||||
}} />
|
}} />
|
||||||
</Col>
|
</Col>
|
||||||
|
Loading…
Reference in New Issue
Block a user