grafana/public/app/features/datasources/utils.ts
Ieva 9a3b2937aa
Data sources: Refactor logic for naming new data sources (#78479)
* move the name finding logic for new data sources from frontend to backend

* cleanup and fix test

* linting

* change the way the number after the ds type is incremented - keep incrementing it without adding more hyphens

* enterprise spec updates (unrelated to the PR)
2023-11-22 09:57:26 +00:00

9 lines
424 B
TypeScript

import { DataSourceJsonData, DataSourceSettings, urlUtil, locationUtil } from '@grafana/data';
export const constructDataSourceExploreUrl = (dataSource: DataSourceSettings<DataSourceJsonData, {}>) => {
const exploreState = JSON.stringify({ datasource: dataSource.name, context: 'explore' });
const exploreUrl = urlUtil.renderUrl(locationUtil.assureBaseUrl('/explore'), { left: exploreState });
return exploreUrl;
};