| 123456789101112131415161718192021222324252627282930313233 |
- define([
- 'angular',
- 'app/core/config',
- ],
- function (angular, config) {
- 'use strict';
- var module = angular.module('grafana.controllers');
- module.controller('PluginsCtrl', function($scope, $location, pluginSrv) {
- $scope.init = function() {
- $scope.plugins = {};
- $scope.getPlugins();
- };
- $scope.getPlugins = function() {
- pluginSrv.getAll().then(function(result) {
- console.log(result);
- $scope.plugins = result;
- });
- };
- $scope.update = function(plugin) {
- pluginSrv.update(plugin).then(function() {
- window.location.href = config.appSubUrl + $location.path();
- });
- };
- $scope.init();
- });
- });
|