-
Notifications
You must be signed in to change notification settings - Fork 630
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9d82692
commit f401a7c
Showing
5 changed files
with
128 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,17 @@ | ||
import { DataSourceInstanceSettings } from '@grafana/data'; | ||
import { DataSourceWithBackend } from '@grafana/runtime'; | ||
import { MyDataSourceOptions, MyQuery } from './types'; | ||
import { MyDataSourceOptions, Query, ProfileType } from './types'; | ||
|
||
export class DataSource extends DataSourceWithBackend<MyQuery, MyDataSourceOptions> { | ||
export class DataSource extends DataSourceWithBackend<Query, MyDataSourceOptions> { | ||
constructor(instanceSettings: DataSourceInstanceSettings<MyDataSourceOptions>) { | ||
super(instanceSettings); | ||
} | ||
|
||
getProfileTypes(): Promise<ProfileType[]> { | ||
return super.getResource("profileTypes").then((response): ProfileType[] => { | ||
return response.map((profileType: any) => { | ||
return new ProfileType(profileType.ID, profileType.name, profileType.periodType, profileType.periodUnit, profileType.sampleType, profileType.sampleUnit); | ||
}); | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters