- Timestamp:
- 06/26/15 18:02:03 (9 years ago)
- Location:
- branches/HiveStatistics/sources/HeuristicLab.Services.WebApp/3.3
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HiveStatistics/sources/HeuristicLab.Services.WebApp/3.3/Controllers/DataTransfer/Plugin.cs
r12435 r12525 28 28 public DateTime? LastReload { get; set; } 29 29 public int Reloads { get; set; } 30 public string Exception { get; set; } 30 31 } 31 32 } -
branches/HiveStatistics/sources/HeuristicLab.Services.WebApp/3.3/Controllers/PluginController.cs
r12515 r12525 38 38 Name = plugin.Name, 39 39 AssemblyName = plugin.AssemblyName, 40 LastReload = plugin.LastReload 40 LastReload = plugin.LastReload, 41 Exception = plugin.Exception 41 42 }); 42 43 } -
branches/HiveStatistics/sources/HeuristicLab.Services.WebApp/3.3/HeuristicLab.Services.WebApp-3.3.csproj
r12515 r12525 177 177 </Content> 178 178 <Content Include="WebApp\plugins\login\loginCtrl.js"> 179 <CopyToOutputDirectory>Always</CopyToOutputDirectory> 180 </Content> 181 <Content Include="WebApp\plugins\plugins\pluginsExceptionCtrl.js"> 179 182 <CopyToOutputDirectory>Always</CopyToOutputDirectory> 180 183 </Content> -
branches/HiveStatistics/sources/HeuristicLab.Services.WebApp/3.3/Plugin.cs
r12515 r12525 34 34 public string Directory { get; set; } 35 35 public string AssemblyName { get; set; } 36 public string Exception { get; set; } 36 37 public DateTime? LastReload { get; set; } 37 38 … … 66 67 public void ReloadControllers() { 67 68 AssemblyName = null; 69 Exception = null; 68 70 Controllers.Clear(); 69 71 LastReload = DateTime.Now; … … 76 78 return; 77 79 var assemblyPath = assemblies.First(); 80 AssemblyName = Path.GetFileName(assemblyPath); 78 81 var assembly = Assembly.Load(File.ReadAllBytes(assemblyPath)); 79 82 var assemblyTypes = assembly.GetTypes(); … … 83 86 Controllers.Add(controllerName, new HttpControllerDescriptor(configuration, controllerName, apiController)); 84 87 } 85 AssemblyName = Path.GetFileName(assemblyPath);86 88 } 87 catch (Exception ) {88 AssemblyName = "Error loading assembly";89 catch (Exception e) { 90 Exception = e.ToString(); 89 91 Controllers.Clear(); 90 92 } -
branches/HiveStatistics/sources/HeuristicLab.Services.WebApp/3.3/WebApp/plugins/plugins/plugins.cshtml
r12428 r12525 1 1 <div class="default-view-container"> 2 <script type="text/ng-template" id="pluginsExceptionDialog"> 3 <div class="modal-header"> 4 <button type="button" ng-click="close()" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button> 5 <h4 class="modal-title">Plugin {{pluginName}}</h4> 6 </div> 7 <div class="modal-body"> 8 {{exception}} 9 </div> 10 </script> 2 11 <div class="row"> 3 12 <div class="col-lg-12"> … … 14 23 <th>Assembly</th> 15 24 <th>Last reload</th> 25 <th>Status</th> 16 26 <th></th> 17 27 </tr> … … 22 32 <td>{{plugin.AssemblyName}}</td> 23 33 <td>{{plugin.LastReload}}</td> 34 <td> 35 <span ng-hide="plugin.Exception" class="glyphicon glyphicon glyphicon-ok" style="color: green"></span> 36 <span ng-show="plugin.Exception" class="glyphicon glyphicon glyphicon-remove" style="color: darkred" 37 ng-click="open(plugin.Name, plugin.Exception)"></span> 38 </td> 24 39 <td> 25 40 <a ng-href="" data-ng-click="reloadPlugin(plugin.Name)">Reload</a> -
branches/HiveStatistics/sources/HeuristicLab.Services.WebApp/3.3/WebApp/plugins/plugins/plugins.js
r12428 r12525 5 5 plugin.files = [ 6 6 'pluginsService.js', 7 'pluginsCtrl.js' 7 'pluginsCtrl.js', 8 'pluginsExceptionCtrl.js' 8 9 ]; 9 10 plugin.view = 'plugins.cshtml'; -
branches/HiveStatistics/sources/HeuristicLab.Services.WebApp/3.3/WebApp/plugins/plugins/pluginsCtrl.js
r12428 r12525 2 2 var module = appPluginsPlugin.getAngularModule(); 3 3 module.controller('app.plugins.ctrl', 4 ['$scope', ' app.plugins.service', function ($scope, pluginService) {4 ['$scope', '$modal', 'app.plugins.service', function ($scope, $modal, pluginService) { 5 5 var getPlugins = function () { 6 6 pluginService.getPlugins({}, function (plugins) { … … 22 22 23 23 $scope.reloadPlugin = function (name) { 24 pluginService.reloadPlugin({ name: name }, function () {24 pluginService.reloadPlugin({ name: name }, function () { 25 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 } 26 44 }); 27 45 };
Note: See TracChangeset
for help on using the changeset viewer.