Free cookie consent management tool by TermsFeed Policy Generator

source: branches/HiveStatistics/sources/HeuristicLab.Services.WebApp/WebApp/plugins/plugins/pluginsCtrl.js @ 12425

Last change on this file since 12425 was 12425, checked in by dglaser, 9 years ago

#2388: Added PluginManager and updated WebApp project

File size: 1.3 KB
Line 
1(function () {
2    var module = appPluginsPlugin.getAngularModule();
3    module.controller('app.plugins.ctrl',
4        ['$scope', 'app.plugins.service', function ($scope, pluginService) {
5            var getPlugins = function () {
6                pluginService.getPlugins({}, function (plugins) {
7                    $scope.plugins = plugins;
8                    var length = $scope.plugins.length;
9                    for (var i = 0; i < length; ++i) {
10                        if (!isDefined($scope.plugins[i].AssemblyName)) {
11                            $scope.plugins[i].AssemblyName = 'Not found';
12                        }
13                        var datetime = $scope.plugins[i].LastReload;
14                        if (isDefined(datetime)) {
15                            $scope.plugins[i].LastReload = CSharpDateToString(datetime);
16                        } else {
17                            $scope.plugins[i].LastReload = 'Never';
18                        }
19                    }
20                });
21            };
22
23            $scope.reloadPlugin = function (name) {
24                pluginService.reloadPlugin({ name: name }, function() {
25                    getPlugins();
26                });
27            };
28
29            getPlugins();
30        }]
31    );
32})();
Note: See TracBrowser for help on using the repository browser.