mirror of
https://github.com/ClusterCockpit/cc-backend
synced 2025-07-27 06:36:07 +02: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:
@@ -34,62 +34,55 @@
|
||||
let paging = { itemsPerPage, page };
|
||||
let filter = [];
|
||||
|
||||
// $: {
|
||||
// console.log('CHANGED FILTERS IN JOBLIST TO')
|
||||
// console.log('filter:', ...filter.map(f => Object.entries(f)).flat(2))
|
||||
// }
|
||||
|
||||
// $: {
|
||||
// console.log('CHANGED PAGING IN JOBLIST TO')
|
||||
// console.log(paging)
|
||||
// }
|
||||
const client = getContextClient();
|
||||
const query = gql`
|
||||
query (
|
||||
$filter: [JobFilter!]!
|
||||
$sorting: OrderByInput!
|
||||
$paging: PageRequest!
|
||||
) {
|
||||
jobs(filter: $filter, order: $sorting, page: $paging) {
|
||||
items {
|
||||
id
|
||||
jobId
|
||||
user
|
||||
project
|
||||
jobName
|
||||
cluster
|
||||
subCluster
|
||||
startTime
|
||||
duration
|
||||
numNodes
|
||||
numHWThreads
|
||||
numAcc
|
||||
walltime
|
||||
resources {
|
||||
hostname
|
||||
}
|
||||
SMT
|
||||
exclusive
|
||||
partition
|
||||
arrayJobId
|
||||
monitoringStatus
|
||||
state
|
||||
tags {
|
||||
id
|
||||
type
|
||||
name
|
||||
}
|
||||
userData {
|
||||
name
|
||||
}
|
||||
metaData
|
||||
}
|
||||
count
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
$: jobs = queryStore({
|
||||
client: getContextClient(),
|
||||
query: gql`
|
||||
query (
|
||||
$filter: [JobFilter!]!
|
||||
$sorting: OrderByInput!
|
||||
$paging: PageRequest!
|
||||
) {
|
||||
jobs(filter: $filter, order: $sorting, page: $paging) {
|
||||
items {
|
||||
id
|
||||
jobId
|
||||
user
|
||||
project
|
||||
jobName
|
||||
cluster
|
||||
subCluster
|
||||
startTime
|
||||
duration
|
||||
numNodes
|
||||
numHWThreads
|
||||
numAcc
|
||||
walltime
|
||||
resources {
|
||||
hostname
|
||||
}
|
||||
SMT
|
||||
exclusive
|
||||
partition
|
||||
arrayJobId
|
||||
monitoringStatus
|
||||
state
|
||||
tags {
|
||||
id
|
||||
type
|
||||
name
|
||||
}
|
||||
userData {
|
||||
name
|
||||
}
|
||||
metaData
|
||||
}
|
||||
count
|
||||
}
|
||||
}
|
||||
`,
|
||||
client,
|
||||
query,
|
||||
variables: { paging, sorting, filter },
|
||||
});
|
||||
|
||||
@@ -109,8 +102,8 @@
|
||||
}
|
||||
|
||||
const updateConfiguration = ({ value, page }) => {
|
||||
configValue = value;
|
||||
paging = { itemsPerPage: value, page: page };
|
||||
configValue = value; // Trigger mutation
|
||||
paging = { itemsPerPage: value, page: page }; // Trigger reload of jobList
|
||||
};
|
||||
|
||||
// $: $jobs.variables = { ...$jobs.variables, sorting, paging }
|
||||
@@ -131,6 +124,16 @@
|
||||
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 jobInfoColumnWidth = 250;
|
||||
$: plotWidth = Math.floor(
|
||||
|
Reference in New Issue
Block a user