mirror of
https://github.com/ClusterCockpit/cc-backend
synced 2025-10-03 13:04:32 +02:00
adapt frontend for new uiConfig keys, add nodeOverview mutation
This commit is contained in:
@@ -26,7 +26,7 @@
|
||||
/* Svelte 5 Props */
|
||||
let {
|
||||
matchedCompareJobs = $bindable(0),
|
||||
metrics = getContext("cc-config")?.plot_list_selectedMetrics,
|
||||
metrics = getContext("cc-config")?.metricConfig_jobListMetrics,
|
||||
filterBuffer = [],
|
||||
} = $props();
|
||||
|
||||
@@ -112,7 +112,7 @@
|
||||
// (Re-)query and optionally set new filters; Query will be started reactively.
|
||||
export function queryJobs(filters) {
|
||||
if (filters != null) {
|
||||
let minRunningFor = ccconfig.plot_list_hideShortRunningJobs;
|
||||
let minRunningFor = ccconfig.jobList_hideShortRunningJobs;
|
||||
if (minRunningFor && minRunningFor > 0) {
|
||||
filters.push({ minRunningFor });
|
||||
}
|
||||
@@ -229,7 +229,7 @@
|
||||
|
||||
// function updateConfiguration(value, page) {
|
||||
// updateConfigurationMutation({
|
||||
// name: "plot_list_jobsPerPage",
|
||||
// name: "jobList_jobsPerPage",
|
||||
// value: value,
|
||||
// }).subscribe((res) => {
|
||||
// if (res.fetching === false && !res.error) {
|
||||
|
@@ -32,7 +32,7 @@
|
||||
let {
|
||||
matchedListJobs = $bindable(0),
|
||||
selectedJobs = $bindable([]),
|
||||
metrics = getContext("cc-config").plot_list_selectedMetrics,
|
||||
metrics = getContext("cc-config").metricConfig_jobListMetrics,
|
||||
sorting = { field: "startTime", type: "col", order: "DESC" },
|
||||
showFootprint = false,
|
||||
filterBuffer = [],
|
||||
@@ -42,7 +42,7 @@
|
||||
const ccconfig = getContext("cc-config");
|
||||
const initialized = getContext("initialized");
|
||||
const globalMetrics = getContext("globalMetrics");
|
||||
const usePaging = ccconfig?.job_list_usePaging || false;
|
||||
const usePaging = ccconfig?.jobList_usePaging || false;
|
||||
const jobInfoColumnWidth = 250;
|
||||
const client = getContextClient();
|
||||
const query = gql`
|
||||
@@ -101,7 +101,7 @@
|
||||
let jobs = $state([]);
|
||||
let filter = $state([...filterBuffer]);
|
||||
let page = $state(1);
|
||||
let itemsPerPage = $state(usePaging ? (ccconfig?.plot_list_jobsPerPage || 10) : 10);
|
||||
let itemsPerPage = $state(usePaging ? (ccconfig?.jobList_jobsPerPage || 10) : 10);
|
||||
let triggerMetricRefresh = $state(false);
|
||||
let tableWidth = $state(0);
|
||||
|
||||
@@ -177,7 +177,7 @@
|
||||
// (Re-)query and optionally set new filters; Query will be started reactively.
|
||||
export function queryJobs(filters) {
|
||||
if (filters != null) {
|
||||
let minRunningFor = ccconfig.plot_list_hideShortRunningJobs;
|
||||
let minRunningFor = ccconfig.jobList_hideShortRunningJobs;
|
||||
if (minRunningFor && minRunningFor > 0) {
|
||||
filters.push({ minRunningFor });
|
||||
}
|
||||
@@ -207,7 +207,7 @@
|
||||
|
||||
function updateConfiguration(value, newPage) {
|
||||
updateConfigurationMutation({
|
||||
name: "plot_list_jobsPerPage",
|
||||
name: "jobList_jobsPerPage",
|
||||
value: value.toString(),
|
||||
}).subscribe((res) => {
|
||||
if (res.fetching === false && !res.error) {
|
||||
@@ -236,10 +236,6 @@
|
||||
});
|
||||
};
|
||||
|
||||
const equalsCheck = (a, b) => {
|
||||
return JSON.stringify(a) === JSON.stringify(b);
|
||||
}
|
||||
|
||||
/* Init Header */
|
||||
stickyHeader(
|
||||
".cc-table-wrapper > table.table >thead > tr > th.position-sticky:nth-child(1)",
|
||||
|
@@ -44,8 +44,8 @@
|
||||
|
||||
/* Const Init */
|
||||
const clusterCockpitConfig = getContext("cc-config");
|
||||
const lineWidth = clusterCockpitConfig?.plot_general_lineWidth / window.devicePixelRatio || 2;
|
||||
const cbmode = clusterCockpitConfig?.plot_general_colorblindMode || false;
|
||||
const lineWidth = clusterCockpitConfig?.plotConfiguration_lineWidth / window.devicePixelRatio || 2;
|
||||
const cbmode = clusterCockpitConfig?.plotConfiguration_colorblindMode || false;
|
||||
|
||||
// UPLOT SERIES INIT //
|
||||
const plotSeries = [
|
||||
|
@@ -56,9 +56,9 @@
|
||||
const resampleConfig = getContext("resampling");
|
||||
const subClusterTopology = getContext("getHardwareTopology")(cluster, subCluster);
|
||||
const metricConfig = getContext("getMetricConfig")(cluster, subCluster, metric);
|
||||
const lineWidth = clusterCockpitConfig?.plot_general_lineWidth / window.devicePixelRatio || 2;
|
||||
const lineColors = clusterCockpitConfig?.plot_general_colorscheme || ["#00bfff","#0000ff","#ff00ff","#ff0000","#ff8000","#ffff00","#80ff00"];
|
||||
const cbmode = clusterCockpitConfig?.plot_general_colorblindMode || false;
|
||||
const lineColors = clusterCockpitConfig.plotConfiguration_colorScheme;
|
||||
const lineWidth = clusterCockpitConfig.plotConfiguration_lineWidth / window.devicePixelRatio;
|
||||
const cbmode = clusterCockpitConfig?.plotConfiguration_colorblindMode || false;
|
||||
const renderSleepTime = 200;
|
||||
const normalLineColor = "#000000";
|
||||
const backgroundColors = {
|
||||
@@ -416,7 +416,7 @@
|
||||
// RETURN BG COLOR FROM THRESHOLD
|
||||
function backgroundColor() {
|
||||
if (
|
||||
clusterCockpitConfig.plot_general_colorBackground == false ||
|
||||
clusterCockpitConfig.plotConfiguration_colorBackground == false ||
|
||||
!thresholds ||
|
||||
!(series && series.every((s) => s.statistics != null))
|
||||
)
|
||||
|
@@ -80,7 +80,7 @@
|
||||
} = $props();
|
||||
|
||||
/* Const Init */
|
||||
const useCbColors = getContext("cc-config")?.plot_general_colorblindMode || false
|
||||
const useCbColors = getContext("cc-config")?.plotConfiguration_colorblindMode || false
|
||||
const options = {
|
||||
maintainAspectRatio: false,
|
||||
animation: false,
|
||||
|
@@ -41,8 +41,8 @@
|
||||
} = $props();
|
||||
|
||||
/* Const Init */
|
||||
const lineWidth = clusterCockpitConfig?.plot_general_lineWidth || 2;
|
||||
const cbmode = clusterCockpitConfig?.plot_general_colorblindMode || false;
|
||||
const lineWidth = clusterCockpitConfig.plotConfiguration_lineWidth;
|
||||
const cbmode = clusterCockpitConfig?.plotConfiguration_colorblindMode || false;
|
||||
|
||||
/* Var Init */
|
||||
let timeoutId = null;
|
||||
|
@@ -39,8 +39,8 @@
|
||||
} = $props();
|
||||
|
||||
/* Const Init */
|
||||
const lineWidth = clusterCockpitConfig?.plot_general_lineWidth || 2;
|
||||
const cbmode = clusterCockpitConfig?.plot_general_colorblindMode || false;
|
||||
const lineWidth = clusterCockpitConfig.plotConfiguration_lineWidth;
|
||||
const cbmode = clusterCockpitConfig?.plotConfiguration_colorblindMode || false;
|
||||
|
||||
/* Var Init */
|
||||
let timeoutId = null;
|
||||
|
@@ -151,8 +151,8 @@
|
||||
updateConfigurationMutation({
|
||||
name:
|
||||
!cluster
|
||||
? "plot_list_showFootprint"
|
||||
: `plot_list_showFootprint:${cluster}`,
|
||||
? "jobList_showFootprint"
|
||||
: `jobList_showFootprint:${cluster}`,
|
||||
value: JSON.stringify(showFootprint),
|
||||
}).subscribe((res) => {
|
||||
if (res.fetching === false && res.error) {
|
||||
|
@@ -51,4 +51,8 @@ export function formatTime(t, forNode = false) {
|
||||
}
|
||||
}
|
||||
|
||||
// const equalsCheck = (a, b) => {
|
||||
// return JSON.stringify(a) === JSON.stringify(b);
|
||||
// }
|
||||
|
||||
// export const dateToUnixEpoch = (rfc3339) => Math.floor(Date.parse(rfc3339) / 1000);
|
||||
|
Reference in New Issue
Block a user