Module: lib/util

    Interfaces

    Type aliases

    DateParam

    Ƭ DateParam: string | number | Date

    Defined in

    lib/util.ts:20

    Variables

    CLUSTER_ACTION_GRACE_PERIOD

    CLUSTER_ACTION_GRACE_PERIOD: 5000

    Defined in

    lib/util.ts:18

    Functions

    filterResource

    filterResource(item, filter, matchCriteria?): boolean

    Parameters

    Name Type
    item KubeObjectInterface
    filter FilterState
    matchCriteria? string[]

    Returns

    boolean

    Defined in

    lib/util.ts:85


    getCluster

    getCluster(): string | null

    Returns

    string | null

    Defined in

    lib/util.ts:154


    getClusterPrefixedPath

    getClusterPrefixedPath(path?): string

    Parameters

    Name Type
    path? null | string

    Returns

    string

    Defined in

    lib/util.ts:146


    getPercentStr

    getPercentStr(value, total): null | string

    Parameters

    Name Type
    value number
    total number

    Returns

    null | string

    Defined in

    lib/util.ts:34


    getReadyReplicas

    getReadyReplicas(item): any

    Parameters

    Name Type
    item Workload

    Returns

    any

    Defined in

    lib/util.ts:43


    getResourceMetrics

    getResourceMetrics(item, metrics, resourceType): any[]

    Parameters

    Name Type
    item Node
    metrics KubeMetrics []
    resourceType "cpu" | "memory"

    Returns

    any[]

    Defined in

    lib/util.ts:61


    getResourceStr

    getResourceStr(value, resourceType): string

    Parameters

    Name Type
    value number
    resourceType "cpu" | "memory"

    Returns

    string

    Defined in

    lib/util.ts:51


    getTotalReplicas

    getTotalReplicas(item): any

    Parameters

    Name Type
    item Workload

    Returns

    any

    Defined in

    lib/util.ts:47


    localeDate

    localeDate(date): string

    Parameters

    Name Type
    date DateParam

    Returns

    string

    Defined in

    lib/util.ts:26


    timeAgo

    timeAgo(date): string

    Parameters

    Name Type
    date DateParam

    Returns

    string

    Defined in

    lib/util.ts:22


    useErrorState

    useErrorState(dependentSetter?): any[]

    Parameters

    Name Type
    dependentSetter? (…args: any) => void

    Returns

    any[]

    Defined in

    lib/util.ts:166


    useFilterFunc

    useFilterFunc(matchCriteria?): (item: KubeObjectInterface ) => boolean

    Parameters

    Name Type
    matchCriteria? string[]

    Returns

    fn

    ▸ (item): boolean

    Parameters
    Name Type
    item KubeObjectInterface
    Returns

    boolean

    Defined in

    lib/util.ts:141