Free cookie consent management tool by TermsFeed Policy Generator

source: branches/RefactorPluginInfrastructure-2522/HeuristicLab.Services.WebApp/3.3/WebApp/plugins/plugins/pluginsCtrl.js @ 13332

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

#2394:

HeuristicLab.Services.WebApp-3.3:

  • added exception property
  • added an icon and exception message in the plugin app
File size: 2.0 KB
Line 
1(function () {
2    var module = appPluginsPlugin.getAngularModule();
3    module.controller('app.plugins.ctrl',
4        ['$scope', '$modal', 'app.plugins.service', function ($scope, $modal, 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            $scope.open = function (pluginName, exception) {
30                $scope.pluginName = pluginName;
31                $scope.exception = exception;
32                $modal.open({
33                    animation: true,
34                    templateUrl: 'pluginsExceptionDialog',
35                    controller: 'app.plugins.pluginsExceptionCtrl',
36                    resolve: {
37                        pluginName: function () {
38                            return $scope.pluginName;
39                        },
40                        exception: function () {
41                            return $scope.exception;
42                        }
43                    }
44                });
45            };
46
47            getPlugins();
48        }]
49    );
50})();
Note: See TracBrowser for help on using the repository browser.