mirror of
https://github.com/grafana/grafana.git
synced 2025-02-13 00:55:47 -06:00
Primarily- moving majority of the types and utils from @grafana/ui to @grafana/data * Move types from grafana-ui to grafana-data * Move valueFormats to grafana-data * Move utils from grafana-ui to grafana-data * Update imports in grafana-ui * revert data's tsconfig change * Update imports in grafana-runtime * Fix import paths in grafana-ui * Move rxjs to devDeps * Core import updates batch 1 * Import updates batch 2 * Imports fix batch 3 * Imports fixes batch i don't know * Fix imorts in grafana-toolkit * Fix imports after master merge
49 lines
1.2 KiB
TypeScript
49 lines
1.2 KiB
TypeScript
import { DataSourceSettings } from '@grafana/data';
|
|
|
|
export const getMockDataSources = (amount: number) => {
|
|
const dataSources = [];
|
|
|
|
for (let i = 0; i <= amount; i++) {
|
|
dataSources.push({
|
|
access: '',
|
|
basicAuth: false,
|
|
database: `database-${i}`,
|
|
id: i,
|
|
isDefault: false,
|
|
jsonData: { authType: 'credentials', defaultRegion: 'eu-west-2' },
|
|
name: `dataSource-${i}`,
|
|
orgId: 1,
|
|
password: '',
|
|
readOnly: false,
|
|
type: 'cloudwatch',
|
|
typeLogoUrl: 'public/app/plugins/datasource/cloudwatch/img/amazon-web-services.png',
|
|
url: '',
|
|
user: '',
|
|
});
|
|
}
|
|
|
|
return dataSources as DataSourceSettings[];
|
|
};
|
|
|
|
export const getMockDataSource = (): DataSourceSettings => {
|
|
return {
|
|
access: '',
|
|
basicAuth: false,
|
|
basicAuthUser: '',
|
|
basicAuthPassword: '',
|
|
withCredentials: false,
|
|
database: '',
|
|
id: 13,
|
|
isDefault: false,
|
|
jsonData: { authType: 'credentials', defaultRegion: 'eu-west-2' },
|
|
name: 'gdev-cloudwatch',
|
|
orgId: 1,
|
|
password: '',
|
|
readOnly: false,
|
|
type: 'cloudwatch',
|
|
typeLogoUrl: 'public/app/plugins/datasource/cloudwatch/img/amazon-web-services.png',
|
|
url: '',
|
|
user: '',
|
|
};
|
|
};
|