mirror of
https://github.com/ClusterCockpit/cc-backend
synced 2026-02-24 11:27:30 +01:00
Remove schedState and metaData from metricHealth table
This commit is contained in:
@@ -32,15 +32,6 @@
|
|||||||
|
|
||||||
/* Const Init */
|
/* Const Init */
|
||||||
const client = getContextClient();
|
const client = getContextClient();
|
||||||
const stateOptions = [
|
|
||||||
"all",
|
|
||||||
"allocated",
|
|
||||||
"idle",
|
|
||||||
"down",
|
|
||||||
"mixed",
|
|
||||||
"reserved",
|
|
||||||
"unknown",
|
|
||||||
];
|
|
||||||
const healthOptions = [
|
const healthOptions = [
|
||||||
"all",
|
"all",
|
||||||
"full",
|
"full",
|
||||||
@@ -52,12 +43,10 @@
|
|||||||
let pieWidth = $state(0);
|
let pieWidth = $state(0);
|
||||||
let querySorting = $state({ field: "startTime", type: "col", order: "DESC" })
|
let querySorting = $state({ field: "startTime", type: "col", order: "DESC" })
|
||||||
let tableHostFilter = $state("");
|
let tableHostFilter = $state("");
|
||||||
let tableStateFilter = $state(stateOptions[0]);
|
|
||||||
let tableHealthFilter = $state(healthOptions[0]);
|
let tableHealthFilter = $state(healthOptions[0]);
|
||||||
let healthTableSorting = $state(
|
let healthTableSorting = $state(
|
||||||
{
|
{
|
||||||
schedulerState: { dir: "down", active: true },
|
healthState: { dir: "up", active: true },
|
||||||
healthState: { dir: "down", active: false },
|
|
||||||
hostname: { dir: "down", active: false },
|
hostname: { dir: "down", active: false },
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
@@ -79,9 +68,7 @@
|
|||||||
hostname
|
hostname
|
||||||
cluster
|
cluster
|
||||||
subCluster
|
subCluster
|
||||||
schedulerState
|
|
||||||
healthState
|
healthState
|
||||||
metaData
|
|
||||||
healthData
|
healthData
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -102,7 +89,7 @@
|
|||||||
let healthTableData = $derived.by(() => {
|
let healthTableData = $derived.by(() => {
|
||||||
if ($statusQuery?.data) {
|
if ($statusQuery?.data) {
|
||||||
return [...$statusQuery.data.nodes.items].sort((n1, n2) => {
|
return [...$statusQuery.data.nodes.items].sort((n1, n2) => {
|
||||||
return n1['schedulerState'].localeCompare(n2['schedulerState'])
|
return n1['healthState'].localeCompare(n2['healthState'])
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
return [];
|
return [];
|
||||||
@@ -114,21 +101,12 @@
|
|||||||
if (tableHostFilter != "") {
|
if (tableHostFilter != "") {
|
||||||
pendingTableData = pendingTableData.filter((e) => e.hostname.includes(tableHostFilter))
|
pendingTableData = pendingTableData.filter((e) => e.hostname.includes(tableHostFilter))
|
||||||
}
|
}
|
||||||
if (tableStateFilter != "all") {
|
|
||||||
pendingTableData = pendingTableData.filter((e) => e.schedulerState.includes(tableStateFilter))
|
|
||||||
}
|
|
||||||
if (tableHealthFilter != "all") {
|
if (tableHealthFilter != "all") {
|
||||||
pendingTableData = pendingTableData.filter((e) => e.healthState.includes(tableHealthFilter))
|
pendingTableData = pendingTableData.filter((e) => e.healthState.includes(tableHealthFilter))
|
||||||
}
|
}
|
||||||
return pendingTableData
|
return pendingTableData
|
||||||
});
|
});
|
||||||
|
|
||||||
const refinedStateData = $derived.by(() => {
|
|
||||||
return $statusQuery?.data?.nodeStates.
|
|
||||||
filter((e) => ['allocated', 'reserved', 'idle', 'mixed','down', 'unknown'].includes(e.state)).
|
|
||||||
sort((a, b) => b.count - a.count)
|
|
||||||
});
|
|
||||||
|
|
||||||
const refinedHealthData = $derived.by(() => {
|
const refinedHealthData = $derived.by(() => {
|
||||||
return $statusQuery?.data?.nodeStates.
|
return $statusQuery?.data?.nodeStates.
|
||||||
filter((e) => ['full', 'partial', 'failed'].includes(e.state)).
|
filter((e) => ['full', 'partial', 'failed'].includes(e.state)).
|
||||||
@@ -296,7 +274,7 @@
|
|||||||
<thead>
|
<thead>
|
||||||
<!-- Header Row 1: Titles and Sorting -->
|
<!-- Header Row 1: Titles and Sorting -->
|
||||||
<tr>
|
<tr>
|
||||||
<th style="width: 9%; min-width: 100px; max-width:10%;" onclick={() => sortBy('hostname')}>
|
<th style="width: 10%; min-width: 100px; max-width:12%;" onclick={() => sortBy('hostname')}>
|
||||||
Hosts ({filteredTableData.length})
|
Hosts ({filteredTableData.length})
|
||||||
<Icon
|
<Icon
|
||||||
name="caret-{healthTableSorting['hostname'].dir}{healthTableSorting['hostname']
|
name="caret-{healthTableSorting['hostname'].dir}{healthTableSorting['hostname']
|
||||||
@@ -305,16 +283,7 @@
|
|||||||
: ''}"
|
: ''}"
|
||||||
/>
|
/>
|
||||||
</th>
|
</th>
|
||||||
<th style="width: 9%; min-width: 100px; max-width:10%;" onclick={() => sortBy('schedulerState')}>
|
<th style="width: 10%; min-width: 100px; max-width:12%;" onclick={() => sortBy('healthState')}>
|
||||||
Scheduler State
|
|
||||||
<Icon
|
|
||||||
name="caret-{healthTableSorting['schedulerState'].dir}{healthTableSorting['schedulerState']
|
|
||||||
.active
|
|
||||||
? '-fill'
|
|
||||||
: ''}"
|
|
||||||
/>
|
|
||||||
</th>
|
|
||||||
<th style="width: 9%; min-width: 100px; max-width:10%;" onclick={() => sortBy('healthState')}>
|
|
||||||
Health State
|
Health State
|
||||||
<Icon
|
<Icon
|
||||||
name="caret-{healthTableSorting['healthState'].dir}{healthTableSorting['healthState']
|
name="caret-{healthTableSorting['healthState'].dir}{healthTableSorting['healthState']
|
||||||
@@ -324,7 +293,6 @@
|
|||||||
/>
|
/>
|
||||||
</th>
|
</th>
|
||||||
<th>Metric Availability</th>
|
<th>Metric Availability</th>
|
||||||
<th>Meta Information</th>
|
|
||||||
</tr>
|
</tr>
|
||||||
<!-- Header Row 2: Filters -->
|
<!-- Header Row 2: Filters -->
|
||||||
<tr>
|
<tr>
|
||||||
@@ -337,53 +305,27 @@
|
|||||||
</InputGroup>
|
</InputGroup>
|
||||||
</th>
|
</th>
|
||||||
<th>
|
<th>
|
||||||
<InputGroup size="sm">
|
<Input size="sm" type="select" bind:value={tableHealthFilter}>
|
||||||
<Input type="select" bind:value={tableStateFilter}>
|
|
||||||
{#each stateOptions as so}
|
|
||||||
<option value={so}>{so}</option>
|
|
||||||
{/each}
|
|
||||||
</Input>
|
|
||||||
<InputGroupText>
|
|
||||||
<Icon name="search"></Icon>
|
|
||||||
</InputGroupText>
|
|
||||||
</InputGroup>
|
|
||||||
</th>
|
|
||||||
<th>
|
|
||||||
<InputGroup size="sm">
|
|
||||||
<Input type="select" bind:value={tableHealthFilter}>
|
|
||||||
{#each healthOptions as ho}
|
{#each healthOptions as ho}
|
||||||
<option value={ho}>{ho}</option>
|
<option value={ho}>{ho}</option>
|
||||||
{/each}
|
{/each}
|
||||||
</Input>
|
</Input>
|
||||||
<InputGroupText>
|
|
||||||
<Icon name="search"></Icon>
|
|
||||||
</InputGroupText>
|
|
||||||
</InputGroup>
|
|
||||||
</th>
|
</th>
|
||||||
<th></th>
|
<th></th>
|
||||||
<th></th>
|
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{#each filteredTableData as host (host.hostname)}
|
{#each filteredTableData as host (host.hostname)}
|
||||||
<tr>
|
<tr>
|
||||||
<th scope="row"><b><a href="/monitoring/node/{cluster}/{host.hostname}" target="_blank">{host.hostname}</a></b></th>
|
<th scope="row"><b><a href="/monitoring/node/{cluster}/{host.hostname}" target="_blank">{host.hostname}</a></b></th>
|
||||||
<td>{host.schedulerState}</td>
|
|
||||||
<td>{host.healthState}</td>
|
<td>{host.healthState}</td>
|
||||||
<td style="max-width: 250px;">
|
<td style="max-width: 76%;">
|
||||||
{#each Object.keys(host.healthData) as hkey}
|
{#each Object.keys(host.healthData) as hkey}
|
||||||
<p>
|
<p>
|
||||||
<b>{hkey}</b>: {host.healthData[hkey]}
|
<b>{hkey}</b>: {host.healthData[hkey]}
|
||||||
</p>
|
</p>
|
||||||
{/each}
|
{/each}
|
||||||
</td>
|
</td>
|
||||||
<td style="max-width: 250px;">
|
|
||||||
{#each Object.keys(host.metaData) as mkey}
|
|
||||||
<p>
|
|
||||||
<b>{mkey}</b>: {host.metaData[mkey]}
|
|
||||||
</p>
|
|
||||||
{/each}
|
|
||||||
</td>
|
|
||||||
</tr>
|
</tr>
|
||||||
{/each}
|
{/each}
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|||||||
Reference in New Issue
Block a user