Skip to content

Commit

Permalink
feat: Improve Daemonset page
Browse files Browse the repository at this point in the history
  • Loading branch information
tiithansen committed Jun 17, 2024
1 parent dcb38d5 commit dd3e878
Showing 1 changed file with 22 additions and 3 deletions.
25 changes: 22 additions & 3 deletions src/pages/Workloads/pages/DaemonSetPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import { Metrics } from "metrics/metrics";
import Heading from "components/Heading";
import { CPUUsagePanel } from "../components/CPUUsagePanel";
import { MemoryUsagePanel } from "../components/MemoryUsagePanel";
import { AlertsTable } from "components/AlertsTable";
import { LegendDisplayMode } from "@grafana/schema";

function getPods(daemonset: string, namespace: string) {
const staticLabelFilters: LabelFilters = [
Expand Down Expand Up @@ -86,6 +88,7 @@ function getNumberPanel(daemonset: string, namespace: string) {
builder.matchFieldsByQuery('available_replicas')
.overrideCustomFieldConfig('fillOpacity', 10)
})
.setOption('legend', { displayMode: LegendDisplayMode.Table, calcs: ['mean', 'last', 'max'] })
.build()
}

Expand All @@ -109,7 +112,7 @@ function getScene(daemonset: string, namespace = '$namespace') {
children: [
new SceneFlexItem({
height: 'auto',
width: `${(1/3) * 100}%`,
width: `25%`,
body: createResourceLabels('daemonset', [{
label: 'daemonset',
op: '=',
Expand All @@ -122,8 +125,17 @@ function getScene(daemonset: string, namespace = '$namespace') {
}),
new SceneFlexItem({
height: 200,
width: `${(2/3) * 100}%`,
body: getNumberPanel(daemonset, namespace),
body: AlertsTable([
{
label: 'pod',
op: '=~',
value: `${daemonset}.*`,
}, {
label: 'namespace',
op: '=',
value: namespace,
}
], false, false)
})
]
}),
Expand Down Expand Up @@ -163,6 +175,13 @@ function getScene(daemonset: string, namespace = '$namespace') {
new Heading({ title: 'Pods'})
]
}),
new SceneFlexLayout({
direction: 'row',
height: 300,
children: [
getNumberPanel(daemonset, namespace),
]
}),
new SceneFlexLayout({
direction: 'row',
children: [
Expand Down

0 comments on commit dd3e878

Please sign in to comment.