mirror of
https://github.com/ClusterCockpit/cc-backend
synced 2024-11-10 08:57:25 +01:00
commit
984cf46bf0
@ -1,5 +1,5 @@
|
|||||||
<script>
|
<script>
|
||||||
import { init, groupByScope, fetchMetricsStore } from './utils.js'
|
import { init, groupByScope, fetchMetricsStore, checkMetricDisabled } from './utils.js'
|
||||||
import { Row, Col, Card, Spinner, TabContent, TabPane,
|
import { Row, Col, Card, Spinner, TabContent, TabPane,
|
||||||
CardBody, CardHeader, CardTitle, Button, Icon } from 'sveltestrap'
|
CardBody, CardHeader, CardTitle, Button, Icon } from 'sveltestrap'
|
||||||
import PlotTable from './PlotTable.svelte'
|
import PlotTable from './PlotTable.svelte'
|
||||||
@ -95,7 +95,14 @@
|
|||||||
somethingMissing = missingMetrics.length > 0 || missingHosts.length > 0
|
somethingMissing = missingMetrics.length > 0 || missingHosts.length > 0
|
||||||
}
|
}
|
||||||
|
|
||||||
const orderAndMap = (grouped, selectedMetrics) => selectedMetrics.map(metric => ({ metric: metric, data: grouped.find((group) => group[0].name == metric) }))
|
const orderAndMap = (grouped, selectedMetrics) =>
|
||||||
|
selectedMetrics.map(metric => ({
|
||||||
|
metric: metric,
|
||||||
|
data: grouped.find((group) =>
|
||||||
|
group[0].name == metric
|
||||||
|
),
|
||||||
|
disabled: checkMetricDisabled(metric, $initq.data.job.cluster, $initq.data.job.subCluster)
|
||||||
|
}))
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="row" bind:clientWidth={fullWidth}></div>
|
<div class="row" bind:clientWidth={fullWidth}></div>
|
||||||
|
@ -24,14 +24,13 @@
|
|||||||
else
|
else
|
||||||
row.push({ _is_placeholder: true, ri, ci })
|
row.push({ _is_placeholder: true, ri, ci })
|
||||||
}
|
}
|
||||||
|
|
||||||
rows.push(row)
|
rows.push(row)
|
||||||
}
|
}
|
||||||
|
|
||||||
return rows
|
return rows
|
||||||
}
|
}
|
||||||
|
|
||||||
$: rows = tile(items, itemsPerRow)
|
$: rows = tile(items.filter(item => item.disabled === false), itemsPerRow)
|
||||||
$: plotWidth = (tableWidth / itemsPerRow) - (padding * itemsPerRow)
|
$: plotWidth = (tableWidth / itemsPerRow) - (padding * itemsPerRow)
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@ -39,7 +38,7 @@
|
|||||||
{#each rows as row}
|
{#each rows as row}
|
||||||
<tr>
|
<tr>
|
||||||
{#each row as item (item)}
|
{#each row as item (item)}
|
||||||
<td>
|
<td style="vertical-align:top;"> <!-- For Aligning Notice Cards -->
|
||||||
{#if !isPlaceholder(item) && plotWidth > 0}
|
{#if !isPlaceholder(item) && plotWidth > 0}
|
||||||
<slot item={item} width={plotWidth}></slot>
|
<slot item={item} width={plotWidth}></slot>
|
||||||
{/if}
|
{/if}
|
||||||
|
@ -144,7 +144,7 @@
|
|||||||
{:else if item.removed == true && item.data == null}
|
{:else if item.removed == true && item.data == null}
|
||||||
<Card body color="info">Metric '{ selectedMetric }' disabled for subcluster '{ item.subCluster }'</Card>
|
<Card body color="info">Metric '{ selectedMetric }' disabled for subcluster '{ item.subCluster }'</Card>
|
||||||
{:else}
|
{:else}
|
||||||
<Card body color="warning">Missing Data</Card>
|
<Card body color="warning">Missing Full Dataset</Card>
|
||||||
{/if}
|
{/if}
|
||||||
</PlotTable>
|
</PlotTable>
|
||||||
{/if}
|
{/if}
|
||||||
|
@ -296,3 +296,20 @@ export function stickyHeader(datatableHeaderSelector, updatePading) {
|
|||||||
document.addEventListener("scroll", onscroll);
|
document.addEventListener("scroll", onscroll);
|
||||||
onDestroy(() => document.removeEventListener("scroll", onscroll));
|
onDestroy(() => document.removeEventListener("scroll", onscroll));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function checkMetricDisabled(m, c, s) { //[m]etric, [c]luster, [s]ubcluster
|
||||||
|
const mc = getContext("metrics");
|
||||||
|
const thisConfig = mc(c, m);
|
||||||
|
let thisSCIndex = -1;
|
||||||
|
if (thisConfig) {
|
||||||
|
thisSCIndex = thisConfig.subClusters.findIndex(
|
||||||
|
(subcluster) => subcluster.name == s
|
||||||
|
);
|
||||||
|
};
|
||||||
|
if (thisSCIndex >= 0) {
|
||||||
|
if (thisConfig.subClusters[thisSCIndex].remove == true) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user