You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
113 lines
2.3 KiB
113 lines
2.3 KiB
2 years ago
|
import { DatasourceType } from '@corpglory/tsdb-kit';
|
||
|
|
||
|
export interface DataSourceRef {
|
||
|
/** The plugin type-id */
|
||
|
type?: string;
|
||
|
/** Specific datasource instance */
|
||
|
uid?: string;
|
||
|
}
|
||
|
|
||
|
export interface DataQuery {
|
||
|
/**
|
||
|
* A - Z
|
||
|
*/
|
||
|
refId: string;
|
||
|
/**
|
||
|
* true if query is disabled (ie should not be returned to the dashboard)
|
||
|
*/
|
||
|
hide?: boolean;
|
||
|
/**
|
||
|
* Unique, guid like, string used in explore mode
|
||
|
*/
|
||
|
key?: string;
|
||
|
/**
|
||
|
* Specify the query flavor
|
||
|
*/
|
||
|
queryType?: string;
|
||
|
/**
|
||
|
* For mixed data sources the selected datasource is on the query level.
|
||
|
* For non mixed scenarios this is undefined.
|
||
|
*/
|
||
|
datasource?: DataSourceRef | null;
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* Data Source instance edit model. This is returned from:
|
||
|
* /api/datasources
|
||
|
*/
|
||
|
export interface DataSourceSettings {
|
||
|
id: number;
|
||
|
uid: string;
|
||
|
orgId: number;
|
||
|
name: string;
|
||
|
typeLogoUrl: string;
|
||
|
type: DatasourceType;
|
||
|
typeName: string;
|
||
|
access: string;
|
||
|
url: string;
|
||
|
user: string;
|
||
|
database: string;
|
||
|
basicAuth: boolean;
|
||
|
basicAuthUser: string;
|
||
|
isDefault: boolean;
|
||
|
jsonData: any;
|
||
|
secureJsonData?: any;
|
||
|
secureJsonFields: any;
|
||
|
readOnly: boolean;
|
||
|
withCredentials: boolean;
|
||
|
version?: number;
|
||
|
accessControl?: any;
|
||
|
}
|
||
|
|
||
|
export interface PanelModel {
|
||
|
/** ID of the panel within the current dashboard */
|
||
|
id: number;
|
||
|
/** Panel title */
|
||
|
title?: string;
|
||
|
/** Description */
|
||
|
description?: string;
|
||
|
/** Panel options */
|
||
|
options: any;
|
||
|
/** Field options configuration */
|
||
|
fieldConfig: any;
|
||
|
/** Version of the panel plugin */
|
||
|
pluginVersion?: string;
|
||
|
/** The datasource used in all targets */
|
||
|
datasource?: DataSourceRef | null;
|
||
|
/** The queries in a panel */
|
||
|
targets?: DataQuery[];
|
||
|
/** alerting v1 object */
|
||
|
alert?: any;
|
||
|
}
|
||
|
|
||
1 year ago
|
export enum ExportStatus {
|
||
|
EXPORTING = 'exporting',
|
||
|
FINISHED = 'finished',
|
||
|
ERROR = 'error',
|
||
|
}
|
||
|
|
||
|
export type ExportProgress = {
|
||
|
time: number;
|
||
|
exportedRowsCount: number;
|
||
|
progress: number;
|
||
|
status: ExportStatus;
|
||
|
errorMessage?: string;
|
||
2 years ago
|
};
|
||
|
|
||
1 year ago
|
export type ExportTask = {
|
||
2 years ago
|
username: string;
|
||
1 year ago
|
queries: DashboardQuery[];
|
||
|
timeRange: {
|
||
|
from: number;
|
||
|
to: number;
|
||
|
};
|
||
|
progress?: ExportProgress;
|
||
|
id?: string;
|
||
|
};
|
||
|
|
||
|
export type DashboardQuery = DataQuery & {
|
||
|
selected: boolean;
|
||
|
panel: PanelModel;
|
||
|
datasource: DataSourceSettings;
|
||
2 years ago
|
};
|