Changeset 12523 for trunk/sources
- Timestamp:
- 06/26/15 13:58:34 (10 years ago)
- Location:
- trunk/sources/HeuristicLab.Services.WebApp/3.3
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Services.WebApp/3.3/Controllers/DataTransfer/Plugin.cs
r12435 r12523 28 28 public DateTime? LastReload { get; set; } 29 29 public int Reloads { get; set; } 30 public string Exception { get; set; } 30 31 } 31 32 } -
trunk/sources/HeuristicLab.Services.WebApp/3.3/Controllers/PluginController.cs
r12514 r12523 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 } -
trunk/sources/HeuristicLab.Services.WebApp/3.3/HeuristicLab.Services.WebApp-3.3.csproj
r12428 r12523 178 178 <CopyToOutputDirectory>Always</CopyToOutputDirectory> 179 179 </Content> 180 <Content Include="WebApp\plugins\plugins\pluginsExceptionCtrl.js" /> 180 181 <Content Include="WebApp\plugins\plugins\plugins.js"> 181 182 <CopyToOutputDirectory>Always</CopyToOutputDirectory> -
trunk/sources/HeuristicLab.Services.WebApp/3.3/Plugin.cs
r12514 r12523 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 } -
trunk/sources/HeuristicLab.Services.WebApp/3.3/WebApp/plugins/plugins/plugins.cshtml
r12428 r12523 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> -
trunk/sources/HeuristicLab.Services.WebApp/3.3/WebApp/plugins/plugins/plugins.js
r12428 r12523 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'; -
trunk/sources/HeuristicLab.Services.WebApp/3.3/WebApp/plugins/plugins/pluginsCtrl.js
r12428 r12523 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.