Skip to content

Commit

Permalink
feat: Resource usage breakdown table for cluster overview based on na…
Browse files Browse the repository at this point in the history
…mespaces
  • Loading branch information
tiithansen committed Jun 8, 2024
1 parent 50a6512 commit 24ecb2a
Show file tree
Hide file tree
Showing 5 changed files with 631 additions and 26 deletions.
14 changes: 14 additions & 0 deletions src/common/sortingHelpers.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
export type SortingDirection = 'asc' | 'desc'

export interface SortingState {
rowId: string;
direction: SortingDirection;
}

export interface SortingConfig<Row> {
[key: string]: {
local: boolean;
type: 'label' | 'value',
compare?: (a: Row, b: Row, direction: SortingDirection) => number
}
}
19 changes: 19 additions & 0 deletions src/components/Heading.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import React from "react";
import { SceneComponentProps, SceneObjectBase, SceneObjectState } from "@grafana/scenes";

export interface HeadingState extends SceneObjectState {
title: string;
}

class Heading extends SceneObjectBase<HeadingState> {
static Component = (props: SceneComponentProps<Heading>) => {

const { title } = props.model.useState();

return (
<h2 style={{marginTop: '24px'}}>{title}</h2>
)
}
}

export default Heading;
Loading

0 comments on commit 24ecb2a

Please sign in to comment.