本文整理汇总了TypeScript中app/core/services/backend_srv.BackendSrv.get方法的典型用法代码示例。如果您正苦于以下问题:TypeScript BackendSrv.get方法的具体用法?TypeScript BackendSrv.get怎么用?TypeScript BackendSrv.get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app/core/services/backend_srv.BackendSrv
的用法示例。
在下文中一共展示了BackendSrv.get方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: constructor
/** @ngInject */
constructor($scope: any, backendSrv: BackendSrv, navModelSrv: NavModelSrv) {
this.navModel = navModelSrv.getNav('admin', 'server-settings');
backendSrv.get('/api/admin/settings').then((settings: any) => {
$scope.settings = settings;
});
}
示例2:
$scope.getUser = (id: number) => {
backendSrv.get('/api/users/' + id).then((user: User) => {
$scope.user = user;
$scope.user_id = id;
$scope.permissions.isGrafanaAdmin = user.isGrafanaAdmin;
});
};
示例3: callback
$scope.searchOrgs = (queryStr: any, callback: any) => {
if ($scope.orgsSearchCache.length > 0) {
callback(_.map($scope.orgsSearchCache, 'name'));
return;
}
backendSrv.get('/api/orgs', { query: '' }).then((result: any) => {
$scope.orgsSearchCache = result;
callback(_.map(result, 'name'));
});
};
示例4: loadNotifications
loadNotifications() {
this.backendSrv.get(`/api/alert-notifications`).then((result: any) => {
this.notifications = result;
});
}
示例5:
$scope.getOrgs = () => {
backendSrv.get('/api/orgs').then((orgs: any) => {
$scope.orgs = orgs;
});
};
示例6:
$scope.getOrgUsers = (id: number) => {
backendSrv.get('/api/orgs/' + id + '/users').then((orgUsers: any) => {
$scope.orgUsers = orgUsers;
});
};