rozetko
2 years ago
6 changed files with 192 additions and 61 deletions
@ -0,0 +1,97 @@
|
||||
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; |
||||
} |
||||
|
||||
export type Task = DataQuery & { |
||||
selected: boolean; |
||||
panel: PanelModel; |
||||
datasource: DataSourceSettings; |
||||
}; |
||||
|
||||
export type TaskTableRowConfig = { |
||||
timestamp: number; |
||||
user: string; |
||||
datasourceRef: DataSourceRef; |
||||
rowsCount: number; |
||||
progress: number; |
||||
status: string; |
||||
downloadLink: string; |
||||
}; |
@ -1,12 +1,8 @@
|
||||
import { Datasource } from '@corpglory/tsdb-kit'; |
||||
import { DataSourceSettings, PanelModel } from '.'; |
||||
|
||||
export class Target { |
||||
constructor( |
||||
public panelUrl: string, |
||||
public panelTitle: string, |
||||
public panelId: number, |
||||
public datasource: Datasource, |
||||
public targets: Array<object>, |
||||
public datasourceName: string, |
||||
public panel: PanelModel, |
||||
public datasource: DataSourceSettings, |
||||
) {} |
||||
} |
||||
|
Loading…
Reference in new issue