@prefecthq/prefect-ui-library
Version:
This library is the Vue and Typescript component library for [Prefect 2](https://github.com/PrefectHQ/prefect) and [Prefect Cloud 2](https://www.prefect.io/cloud/). _The components and utilities in this project are not meant to be used independently_.
31 lines (26 loc) • 800 B
text/typescript
import { removePrefectEventLabelPrefix } from '@/utilities/events'
export type WorkspaceEventsCountable = 'day' | 'event' | 'workspace' | 'actor' | 'resource'
export type IWorkspaceEventsCount = {
count: number,
label: string,
value: string,
startTime: Date,
endTime: Date,
}
export class WorkspaceEventsCount implements IWorkspaceEventsCount {
public count: number
public label: string
public value: string
public startTime: Date
public endTime: Date
public constructor(count: IWorkspaceEventsCount) {
this.count = count.count
this.label = count.label
this.value = count.value
this.startTime = count.startTime
this.endTime = count.endTime
}
public get eventPrefectWithoutPrefix(): string {
return removePrefectEventLabelPrefix(this.label)
}
}