mirror of
https://github.com/grafana/grafana.git
synced 2025-02-20 11:48:34 -06:00
* Datasource/CloudWatch: Fix encoding of CloudWatch Logs deep link URL * Adds data links to cloudwatch logs responses for deep linking to aws console * Implements PR feedback
19 lines
451 B
TypeScript
19 lines
451 B
TypeScript
const JSURL = require('jsurl');
|
|
|
|
export interface AwsUrl {
|
|
end: string;
|
|
start: string;
|
|
timeType?: 'ABSOLUTE' | 'RELATIVE';
|
|
tz?: 'local' | 'UTC';
|
|
unit?: string;
|
|
editorString: string;
|
|
isLiveTail: boolean;
|
|
source: string[];
|
|
}
|
|
|
|
export function encodeUrl(obj: AwsUrl, region: string): string {
|
|
return `https://${region}.console.aws.amazon.com/cloudwatch/home?region=${region}#logs-insights:queryDetail=${JSURL.stringify(
|
|
obj
|
|
)}`;
|
|
}
|