/usr/share/grafana/public/app/plugins/datasource/graphite
type LegacyAnnotation = { target?: string; tags?: string; }; // this becomes the target in the migrated annotations const migrateLegacyAnnotation = (json: LegacyAnnotation) => { // return the target annotation if (typeof json.target === 'string' && json.target) { return { fromAnnotations: true, target: json.target, textEditor: true, }; } // return the tags annotation return { queryType: 'tags', tags: (json.tags || '').split(' '), fromAnnotations: true, }; }; // eslint-ignore-next-line export const prepareAnnotation = (json: any) => { // annotation attributes are either 'tags' or 'target'(a graphite query string) // because the new annotations will also have a target attribute, {} // we need to handle the ambiguous 'target' when migrating legacy annotations // so, to migrate legacy annotations // we check that target is a string // or // there is a tags attribute with no target const resultingTarget = json.target && typeof json.target !== 'string' ? json.target : migrateLegacyAnnotation(json); json.target = resultingTarget; return json; };
.
Edit
..
Edit
CHANGELOG.md
Edit
README.md
Edit
components
Edit
configuration
Edit
dashboards
Edit
datasource.test.ts
Edit
datasource.ts
Edit
datasource_integration.test.ts
Edit
dist
Edit
gfunc.test.ts
Edit
gfunc.ts
Edit
graphite_query.ts
Edit
img
Edit
jest-setup.js
Edit
jest.config.js
Edit
lexer.ts
Edit
meta.test.ts
Edit
meta.ts
Edit
migrations.ts
Edit
module.ts
Edit
package.json
Edit
parser.ts
Edit
plugin.json
Edit
project.json
Edit
query_help.md
Edit
specs
Edit
state
Edit
tsconfig.json
Edit
types.ts
Edit
utils.test.ts
Edit
utils.ts
Edit
versions.ts
Edit
webpack.config.ts
Edit