import ReactGridLayout from 'react-grid-layout'; import Cls from '.'; export interface RemoveDashboardInputs { name?: string; id?: string; } export declare enum DashboardChartType { table = 'table', graph = 'graph', bar = 'bar', stat = 'stat', gauge = 'gauge', pie = 'pie', sankey = 'sankey', map = 'map', tMap = 'tMap', row = 'row', 'add-panel' = 'add-panel', } export declare namespace Raw { export const regionId2Name: Record; export const regionName2Id: Record; export interface DashboardChartTarget { RegionId: number; LogsetId: string; TopicId: string; Query: string; /** 图表数据处理参数 */ ChartAxis?: { xAxisKey?: string; yAxisKey?: string; aggregateKey?: string; }; } type FieldConfigSource = unknown; export interface DashboardChart { id: string; title: string; description?: string; gridPos: Partial; /** 图表类型 */ type: DashboardChartType; /** 数据请求涉及参数 */ target: DashboardChartTarget; /** * 图表配置,和图表的类型有关,每个图表类型都有独立的配置 */ options?: unknown; chartConfig?: unknown; /** * filed配置,包含默认配置和针对某个filed的override情况,对数值的处理、特殊显示、link、mappings都属于此类 * 和具体的图表类型无关,配置修改的是dataFrame本身 */ fieldConfig?: FieldConfigSource; } export interface Dashboard { CreateTime: string; DashboardId: string; DashboardName: string; data: string; } export {}; } export interface LogsetConfig { region: string; logsetId: string; topicId: string; } export interface DashboardChart { id: string; title: string; description?: string; type: DashboardChartType; query: string; xAxisKey?: string; yAxisKey?: string; aggregateKey?: string; } export declare type DeployDashChartInputs = Omit; export interface DeployDashboardInputs { name: string; charts: DeployDashChartInputs[]; } export interface Dashboard { createTime: string; id: string; name: string; charts: DashboardChart[]; } export declare class ClsDashboard { cls: Cls; constructor(cls: Cls); getList(): Promise; getDetail({ name, id }: { name?: string; id?: string }): Promise; remove({ id, name }: RemoveDashboardInputs): Promise; deploy( inputs: DeployDashboardInputs, logsetConfig: LogsetConfig, ): Promise<{ id: string; name: string; charts: DeployDashChartInputs[]; }>; }