mirror of
https://github.com/ClusterCockpit/cc-backend
synced 2024-11-10 08:57:25 +01:00
Adapt user jobview to new version, fix refresher
- add manually triggered refresh function to jobList - Changing displayed metrics requires hard refresh (F5) to load data -> Under investigation
This commit is contained in:
parent
760d3dec0f
commit
b5a5def3a6
@ -53,15 +53,19 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const updateConfiguration = ({ name, value }) => {
|
const client = getContextClient();
|
||||||
result = mutationStore({
|
const query = gql`
|
||||||
client: getContextClient(),
|
mutation($name: String!, $value: String!) {
|
||||||
query: gql`mutation($name: String!, $value: String!) {
|
|
||||||
updateConfiguration(name: $name, value: $value)
|
updateConfiguration(name: $name, value: $value)
|
||||||
}`,
|
|
||||||
variables: {name, value}
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
`;
|
||||||
|
|
||||||
|
const updateConfiguration = ({ name, value }) => {
|
||||||
|
mutationStore({
|
||||||
|
client,
|
||||||
|
query,
|
||||||
|
variables: { name, value },
|
||||||
|
})}
|
||||||
|
|
||||||
let columnHovering = null
|
let columnHovering = null
|
||||||
|
|
||||||
@ -92,10 +96,6 @@
|
|||||||
name: cluster == null ? configName : `${configName}:${cluster}`,
|
name: cluster == null ? configName : `${configName}:${cluster}`,
|
||||||
value: JSON.stringify(metrics)
|
value: JSON.stringify(metrics)
|
||||||
})
|
})
|
||||||
.then(res => {
|
|
||||||
if (res.error)
|
|
||||||
console.error(res.error)
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
@ -34,19 +34,8 @@
|
|||||||
let paging = { itemsPerPage, page };
|
let paging = { itemsPerPage, page };
|
||||||
let filter = [];
|
let filter = [];
|
||||||
|
|
||||||
// $: {
|
const client = getContextClient();
|
||||||
// console.log('CHANGED FILTERS IN JOBLIST TO')
|
const query = gql`
|
||||||
// console.log('filter:', ...filter.map(f => Object.entries(f)).flat(2))
|
|
||||||
// }
|
|
||||||
|
|
||||||
// $: {
|
|
||||||
// console.log('CHANGED PAGING IN JOBLIST TO')
|
|
||||||
// console.log(paging)
|
|
||||||
// }
|
|
||||||
|
|
||||||
$: jobs = queryStore({
|
|
||||||
client: getContextClient(),
|
|
||||||
query: gql`
|
|
||||||
query (
|
query (
|
||||||
$filter: [JobFilter!]!
|
$filter: [JobFilter!]!
|
||||||
$sorting: OrderByInput!
|
$sorting: OrderByInput!
|
||||||
@ -89,7 +78,11 @@
|
|||||||
count
|
count
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
`,
|
`;
|
||||||
|
|
||||||
|
$: jobs = queryStore({
|
||||||
|
client,
|
||||||
|
query,
|
||||||
variables: { paging, sorting, filter },
|
variables: { paging, sorting, filter },
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -109,8 +102,8 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
const updateConfiguration = ({ value, page }) => {
|
const updateConfiguration = ({ value, page }) => {
|
||||||
configValue = value;
|
configValue = value; // Trigger mutation
|
||||||
paging = { itemsPerPage: value, page: page };
|
paging = { itemsPerPage: value, page: page }; // Trigger reload of jobList
|
||||||
};
|
};
|
||||||
|
|
||||||
// $: $jobs.variables = { ...$jobs.variables, sorting, paging }
|
// $: $jobs.variables = { ...$jobs.variables, sorting, paging }
|
||||||
@ -131,6 +124,16 @@
|
|||||||
paging = paging = { page, itemsPerPage };
|
paging = paging = { page, itemsPerPage };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Force refresh list with existing unchanged variables (== usually would not trigger reactivity)
|
||||||
|
export function refresh() {
|
||||||
|
queryStore({
|
||||||
|
client,
|
||||||
|
query,
|
||||||
|
variables: { paging, sorting, filter },
|
||||||
|
requestPolicy: 'network-only'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
let tableWidth = null;
|
let tableWidth = null;
|
||||||
let jobInfoColumnWidth = 250;
|
let jobInfoColumnWidth = 250;
|
||||||
$: plotWidth = Math.floor(
|
$: plotWidth = Math.floor(
|
||||||
|
Loading…
Reference in New Issue
Block a user