mirror of
https://github.com/grafana/grafana.git
synced 2025-02-12 00:25:46 -06:00
- extends handlers for panel menu and keypress 'x' - in a mixed-datasource panel finds first datasource that supports explore and collects its targets - passes those targets to the found datasource to be serialized for explore state - removed `supportMetrics` and `supportsExplore` - use datasource metadata instead (set in plugin.json) - Use angular timeout to wrap url change for explore jump - Extract getExploreUrl into core/utils/explore
13 lines
375 B
TypeScript
13 lines
375 B
TypeScript
import config from 'app/core/config';
|
|
|
|
export const stripBaseFromUrl = url => {
|
|
const appSubUrl = config.appSubUrl;
|
|
const stripExtraChars = appSubUrl.endsWith('/') ? 1 : 0;
|
|
const urlWithoutBase =
|
|
url.length > 0 && url.indexOf(appSubUrl) === 0 ? url.slice(appSubUrl.length - stripExtraChars) : url;
|
|
|
|
return urlWithoutBase;
|
|
};
|
|
|
|
export default { stripBaseFromUrl };
|