mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
* Replace icons in dashboard and settings * Replace icons in alerting * Update batch of icons * Implement icons accross various files * Style updates * Search: Fix recent and starred icons * Update styling and details * Replace new icon created by unicons * Fix e2e test, styling * Minor styling updates Co-authored-by: Clarity-89 <homes89@ukr.net>
34 lines
999 B
TypeScript
34 lines
999 B
TypeScript
import { ContextMenuItem } from '../components/ContextMenu/ContextMenu';
|
|
import { LinkModelSupplier } from '@grafana/data';
|
|
|
|
export const DataLinkBuiltInVars = {
|
|
keepTime: '__url_time_range',
|
|
timeRangeFrom: '__from',
|
|
timeRangeTo: '__to',
|
|
includeVars: '__all_variables',
|
|
seriesName: '__series.name',
|
|
fieldName: '__field.name',
|
|
valueTime: '__value.time',
|
|
valueNumeric: '__value.numeric',
|
|
valueText: '__value.text',
|
|
valueRaw: '__value.raw',
|
|
// name of the calculation represented by the value
|
|
valueCalc: '__value.calc',
|
|
};
|
|
|
|
/**
|
|
* Delays creating links until we need to open the ContextMenu
|
|
*/
|
|
export const linkModelToContextMenuItems: (links: LinkModelSupplier<any>) => ContextMenuItem[] = links => {
|
|
return links.getLinks().map(link => {
|
|
return {
|
|
label: link.title,
|
|
// TODO: rename to href
|
|
url: link.href,
|
|
target: link.target,
|
|
icon: `${link.target === '_self' ? 'link' : 'external-link-alt'}`,
|
|
onClick: link.onClick,
|
|
};
|
|
});
|
|
};
|