- Timestamp:
- 06/10/15 14:05:24 (9 years ago)
- Location:
- branches/HiveStatistics/sources
- Files:
-
- 6 added
- 2 deleted
- 27 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HiveStatistics/sources/HeuristicLab.Services.WebApp.Status/HeuristicLab.Services.WebApp.Status.csproj
r12419 r12425 97 97 <Project>{9fac0b23-2730-452a-9ba0-d7ca1746c541}</Project> 98 98 <Name>HeuristicLab.Services.Access-3.3</Name> 99 <Private>False</Private> 99 100 </ProjectReference> 100 101 <ProjectReference Include="..\HeuristicLab.Services.Hive.DataAccess\3.3\HeuristicLab.Services.Hive.DataAccess-3.3.csproj"> -
branches/HiveStatistics/sources/HeuristicLab.Services.WebApp.Status/WebApp/history/history.cshtml
r12419 r12425 34 34 35 35 36 <div id="history">36 <div class="default-view-container"> 37 37 <div class="row"> 38 38 <div class="col-lg-12"> -
branches/HiveStatistics/sources/HeuristicLab.Services.WebApp.Status/WebApp/history/historyCtrl.js
r12419 r12425 1 1 (function () { 2 var module = appStatus Module.getAngularModule();2 var module = appStatusPlugin.getAngularModule(); 3 3 module.controller('app.status.historyCtrl', 4 4 ['$scope', '$interval', 'app.status.data.service', -
branches/HiveStatistics/sources/HeuristicLab.Services.WebApp.Status/WebApp/services/statusService.js
r12419 r12425 1 1 (function () { 2 var module = appStatus Module.getAngularModule();2 var module = appStatusPlugin.getAngularModule(); 3 3 var apiUrl = 'api/Status/Data/'; 4 4 module.factory('app.status.data.service', -
branches/HiveStatistics/sources/HeuristicLab.Services.WebApp.Status/WebApp/status.css
r12419 r12425 1 #status { 2 padding: 30px; 3 } 4 5 #history-header { 1 #history-header { 6 2 padding: 30px; 7 3 background: #F5F5F5; 8 4 border-bottom: 1px solid #D3D3D3; 9 5 } 10 11 #history {12 padding: 30px;13 } -
branches/HiveStatistics/sources/HeuristicLab.Services.WebApp.Status/WebApp/status/status.cshtml
r12419 r12425 10 10 </header> 11 11 12 <div id="status">12 <div class="default-view-container"> 13 13 <div class="row"> 14 14 <div class="col-lg-3 col-md-6"> -
branches/HiveStatistics/sources/HeuristicLab.Services.WebApp.Status/WebApp/status/statusCtrl.js
r12419 r12425 1 1 (function () { 2 var module = appStatus Module.getAngularModule();2 var module = appStatusPlugin.getAngularModule(); 3 3 module.controller('app.status.ctrl', 4 4 ['$scope', '$interval', 'app.status.data.service', -
branches/HiveStatistics/sources/HeuristicLab.Services.WebApp.Status/status.js
r12419 r12425 1 var appStatus Module = app.registerModule('status');1 var appStatusPlugin = app.registerPlugin('status'); 2 2 (function () { 3 var module = appStatusModule;4 module.dependencies = ['ngResource', 'ui.knob', 'ui.bootstrap'];5 module.files = [3 var plugin = appStatusPlugin; 4 plugin.dependencies = ['ngResource', 'ui.knob', 'ui.bootstrap']; 5 plugin.files = [ 6 6 'WebApp/status.css', 7 7 'WebApp/services/statusService.js', … … 9 9 'WebApp/history/historyCtrl.js' 10 10 ]; 11 module.view = 'WebApp/status/status.cshtml';12 module.controller = 'app.status.ctrl';13 module.routes = [11 plugin.view = 'WebApp/status/status.cshtml'; 12 plugin.controller = 'app.status.ctrl'; 13 plugin.routes = [ 14 14 new Route('history', 'WebApp/history/history.cshtml', 'app.status.historyCtrl') 15 15 ]; -
branches/HiveStatistics/sources/HeuristicLab.Services.WebApp/Configs/BundleConfig.cs
r12419 r12425 61 61 "~/WebApp/app.css" 62 62 )); 63 AddOrUpdateWebAppBundle(); 64 } 63 65 66 public static void AddOrUpdateWebAppBundle() { 67 var jsBundle = BundleTable.Bundles.GetBundleFor("~/Bundles/WebApp/js"); 68 if (jsBundle != null) { 69 BundleTable.Bundles.Remove(jsBundle); 70 } 64 71 var jsFiles = new List<string> { 65 72 "~/WebApp/helper.js", 66 "~/WebApp/ module.js"73 "~/WebApp/app.js" 67 74 }; 68 75 var directories = Directory.GetDirectories(string.Format(@"{0}WebApp\plugins", HttpRuntime.AppDomainAppPath)); 69 76 jsFiles.AddRange(directories.Select(Path.GetFileName).Select(directory => string.Format("~/WebApp/plugins/{0}/{0}.js", directory))); 70 jsFiles.Add("~/WebApp/app.js"); 71 72 var jsBundle = new ScriptBundle("~/Bundles/WebApp/js"); 77 jsFiles.Add("~/WebApp/main.js"); 78 jsBundle = new ScriptBundle("~/Bundles/WebApp/js"); 73 79 jsBundle.Include(jsFiles.ToArray()); 74 80 jsBundle.IncludeDirectory("~/WebApp/shared/", "*.js", true); 75 bundles.Add(jsBundle);81 BundleTable.Bundles.Add(jsBundle); 76 82 } 77 83 } -
branches/HiveStatistics/sources/HeuristicLab.Services.WebApp/Controllers/AppController.cs
r12419 r12425 1 1 using System.Web.Mvc; 2 using HeuristicLab.Services.WebApp.Configs; 2 3 3 4 namespace HeuristicLab.Services.WebApp.Controllers { … … 9 10 return RedirectPermanent(Request.Url + "/"); 10 11 } 12 BundleConfig.AddOrUpdateWebAppBundle(); 11 13 return View("~/WebApp/shared/layout/layout.cshtml"); 12 14 } -
branches/HiveStatistics/sources/HeuristicLab.Services.WebApp/Controllers/AuthenticationController.cs
r12419 r12425 23 23 return true; 24 24 } 25 26 25 } 27 26 } -
branches/HiveStatistics/sources/HeuristicLab.Services.WebApp/Controllers/WebAppControllerSelector.cs
r12419 r12425 2 2 using System.Collections.Concurrent; 3 3 using System.Collections.Generic; 4 using System.IO;5 4 using System.Linq; 6 5 using System.Net.Http; 7 6 using System.Reflection; 8 using System.Web;9 7 using System.Web.Http; 10 8 using System.Web.Http.Controllers; … … 14 12 public class WebAppHttpControllerSelector : DefaultHttpControllerSelector { 15 13 private readonly HttpConfiguration configuration; 16 private readonly IDictionary<string, IDictionary<string, HttpControllerDescriptor>> plugins; 14 private readonly IDictionary<string, HttpControllerDescriptor> controllers; 15 private readonly PluginManager pluginManager = PluginManager.Instance; 17 16 18 17 public WebAppHttpControllerSelector(HttpConfiguration configuration) 19 18 : base(configuration) { 20 19 this.configuration = configuration; 21 plugins = new ConcurrentDictionary<string, IDictionary<string, HttpControllerDescriptor>>(); 20 pluginManager.Configuration = configuration; 21 controllers = new ConcurrentDictionary<string, HttpControllerDescriptor>(); 22 LoadAppControllers(); 23 } 24 25 private void LoadAppControllers() { 26 var assembly = Assembly.GetExecutingAssembly(); 27 var assemblyTypes = assembly.GetTypes(); 28 var apiControllers = assemblyTypes.Where(c => typeof(ApiController).IsAssignableFrom(c)).ToList(); 29 foreach (var apiController in apiControllers) { 30 var apiControllerName = apiController.Name.Remove(apiController.Name.Length - 10).ToLower(); 31 controllers.Add(apiControllerName, new HttpControllerDescriptor(configuration, apiControllerName, apiController)); 32 } 22 33 } 23 34 … … 31 42 throw new ArgumentException("invalid request path"); 32 43 } 33 string pluginName = parts[startIndex + 1] ;44 string pluginName = parts[startIndex + 1].ToLower(); 34 45 string controllerName = parts[startIndex + 2].ToLower(); 35 IDictionary<string, HttpControllerDescriptor> controllers; 36 if (!plugins.TryGetValue(pluginName, out controllers)) { 37 var assembly = Assembly.GetExecutingAssembly(); 38 try { 39 if (pluginName != "App") { 40 string directory = string.Format(@"{0}WebApp\plugins\{1}\", HttpRuntime.AppDomainAppPath, pluginName); 41 string[] assemblies = Directory.GetFiles(directory, string.Format("HeuristicLab.Services.WebApp.{0}*.dll", pluginName)); 42 if (assemblies.Length < 1) { 43 throw new ArgumentException("invalid plugin '{0}'", pluginName); 44 } 45 assembly = Assembly.Load(File.ReadAllBytes(assemblies.First())); 46 } 47 var assemblyTypes = assembly.GetTypes(); 48 var apiControllers = assemblyTypes.Where(c => typeof(ApiController).IsAssignableFrom(c)).ToList(); 49 if (apiControllers.Any()) { 50 controllers = new ConcurrentDictionary<string, HttpControllerDescriptor>(); 51 foreach (var apiController in apiControllers) { 52 var apiControllerName = apiController.Name.Remove(apiController.Name.Length - 10).ToLower(); 53 controllers.Add(apiControllerName, new HttpControllerDescriptor(configuration, apiControllerName, apiController)); 54 } 55 plugins.Add(pluginName, controllers); 56 } 57 } 58 catch (Exception) { 59 throw new ArgumentException("error loading plugin '{0}'", pluginName); 60 } 46 // load controller 47 if (pluginName == "app") { 48 // from main app 49 HttpControllerDescriptor controller; 50 controllers.TryGetValue(controllerName, out controller); 51 return controller; 61 52 } 62 if (controllers == null) { 63 throw new ArgumentException("invalid plugin '{0}'", pluginName); 53 // from plugin 54 var plugin = pluginManager.GetPlugin(pluginName); 55 if (plugin == null) { 56 throw new ArgumentException(string.Format("invalid plugin '{0}'", pluginName)); 64 57 } 65 HttpControllerDescriptor controller; 66 controllers.TryGetValue(controllerName, out controller); 67 return controller; 58 return plugin.GetController(controllerName); 68 59 } 69 60 } -
branches/HiveStatistics/sources/HeuristicLab.Services.WebApp/HeuristicLab.Services.WebApp.csproj
r12419 r12425 129 129 <Compile Include="Controllers\AppController.cs" /> 130 130 <Compile Include="Controllers\AuthenticationController.cs" /> 131 <Compile Include="Controllers\DataTransfer\Plugin.cs" /> 131 132 <Compile Include="Controllers\DataTransfer\User.cs" /> 133 <Compile Include="Controllers\PluginController.cs" /> 132 134 <Compile Include="Controllers\WebAppControllerSelector.cs" /> 133 135 <Compile Include="Global.asax.cs"> 134 136 <DependentUpon>Global.asax</DependentUpon> 135 137 </Compile> 138 <Compile Include="Plugin.cs" /> 139 <Compile Include="PluginManager.cs" /> 136 140 <Compile Include="Properties\AssemblyInfo.cs" /> 137 141 </ItemGroup> 138 142 <ItemGroup> 139 143 <Content Include="WebApp\app.css" /> 140 <Content Include="WebApp\app.js" />141 144 <Content Include="favicon.ico" /> 142 145 <Content Include="Global.asax" /> 146 <Content Include="WebApp\main.js" /> 143 147 <Content Include="WebApp\helper.js" /> 144 148 <Content Include="WebApp\HeuristicLab.ico" /> … … 163 167 <Content Include="WebApp\libs\misc\respond.min.js" /> 164 168 <Content Include="WebApp\libs\smoothScroll\smoothScroll.js" /> 165 <Content Include="WebApp\ module.js" />169 <Content Include="WebApp\app.js" /> 166 170 <Content Include="WebApp\plugins\login\login.css"> 167 171 <CopyToOutputDirectory>Always</CopyToOutputDirectory> … … 179 183 <CopyToOutputDirectory>Always</CopyToOutputDirectory> 180 184 </Content> 185 <Content Include="WebApp\plugins\plugins\pluginsService.js" /> 181 186 <Content Include="WebApp\shared\directives\flot.js" /> 182 187 <Content Include="WebApp\libs\angularjs\angular-ui\ui-bootstrap-tpls-0.13.0.min.js" /> … … 240 245 </ItemGroup> 241 246 <ItemGroup> 247 <ProjectReference Include="..\HeuristicLab.Services.Access\3.3\HeuristicLab.Services.Access-3.3.csproj"> 248 <Project>{9fac0b23-2730-452a-9ba0-d7ca1746c541}</Project> 249 <Name>HeuristicLab.Services.Access-3.3</Name> 250 </ProjectReference> 242 251 <ProjectReference Include="..\HeuristicLab.Services.Hive.DataAccess\3.3\HeuristicLab.Services.Hive.DataAccess-3.3.csproj"> 243 252 <Project>{ec2c8109-6e1e-4c88-9a2b-908cff2ef4ac}</Project> -
branches/HiveStatistics/sources/HeuristicLab.Services.WebApp/WebApp/app.css
r12419 r12425 314 314 text-shadow: none !important; 315 315 } 316 317 318 .default-view-container { 319 padding: 30px; 320 } -
branches/HiveStatistics/sources/HeuristicLab.Services.WebApp/WebApp/app.js
r12419 r12425 1 var appMainModule = app.registerModule(appName); 2 appMainModule.dependencies = ['oc.lazyLoad', 'ui.router', 'angular-loading-bar', 'ngResource']; 3 appMainModule.loadModule(); 4 (function () { 5 'use strict'; 6 var module = appMainModule.getAngularModule(); 1 // app configuration 2 var appName = 'app'; 3 var appPath = 'WebApp'; 7 4 8 module.config(['$ocLazyLoadProvider', function ($ocLazyLoadProvider) { 9 app.modules.forEach(function (module) { 10 $ocLazyLoadProvider.config({ 11 modules: [{ 12 name: module.getFullModuleName(), 13 files: module.getFiles() 14 }] 5 // route, plugin, menu, section and main app 6 var Route = function (name, view, controller) { 7 this.name = name; 8 this.view = view; 9 this.controller = controller; 10 }; 11 12 var Plugin = function (pluginName) { 13 this.name = pluginName; 14 this.parent = appName; 15 this.view = ''; 16 this.controller = ''; 17 this.dependencies = []; 18 this.routes = []; 19 this.files = []; 20 21 this.getPluginDirectory = function () { 22 return appPath + '/plugins/' + this.name + '/'; 23 }; 24 25 this.getFullPluginName = function() { 26 if (this.name.localeCompare(appName) == 0) { 27 return this.name; 28 } 29 return this.parent + '.' + this.name; 30 }; 31 32 this.getRouteName = function() { 33 return '/' + this.name; 34 }; 35 36 this.getAngularModule = function() { 37 return angular.module(this.getFullPluginName()); 38 }; 39 40 this.getFilePath = function (file) { 41 return this.getPluginDirectory() + file; 42 }; 43 44 this.getViewUrl = function (view) { 45 return 'plugin=' + this.name + '&view=' + view; 46 }; 47 48 // getFiles is used in the lazy loading provider 49 this.getFiles = function () { 50 var plugin = this; 51 var filesToLoad = []; 52 plugin.files.forEach(function (file) { 53 filesToLoad.push(plugin.getFilePath(file)); 54 }); 55 return filesToLoad; 56 }; 57 58 this.configureRoutes = function ($stateProvider) { 59 var plugin = this; 60 this.routes.forEach(function (route) { 61 $stateProvider.state(plugin.name + route.name, { 62 url: '/' + plugin.name + '/' + route.name, 63 controller: route.controller, 64 templateUrl: plugin.getViewUrl(route.view), 65 cache: false, 66 resolve: { 67 loadPlugin: ['$ocLazyLoad', 'cfpLoadingBar', function ($ocLazyLoad, cfpLoadingBar) { 68 cfpLoadingBar.start(); 69 var retVal = plugin.load($ocLazyLoad); 70 cfpLoadingBar.complete(); 71 return retVal; 72 }] 73 } 15 74 }); 16 75 }); 17 } ]);76 }; 18 77 19 module.config([ 20 '$stateProvider', '$urlRouterProvider', 21 function ($stateProvider, $urlRouterProvider) { 22 $urlRouterProvider.otherwise('/status'); 23 // load module routes 24 app.modules.forEach(function (module) { 25 // home route 26 $stateProvider.state(module.name, { 27 url: module.getRouteName(), 28 controller: module.getController(), 29 templateUrl: module.getViewUrl(module.getView()), 30 cache: false, 31 resolve: { 32 loadModule: ['$ocLazyLoad', 'cfpLoadingBar', function ($ocLazyLoad, cfpLoadingBar) { 33 cfpLoadingBar.start(); 34 var retVal = module.loadModule($ocLazyLoad); 35 cfpLoadingBar.complete(); 36 return retVal; 37 }] 38 } 39 }); 40 // sub-routes 41 module.configureRoutes($stateProvider); 78 this.load = function ($ocLazyLoad) { 79 var plugin = this; 80 var params = []; 81 var lazyLoadingFiles = []; 82 plugin.dependencies.forEach(function (dependency) { 83 params.push(dependency); 84 }); 85 plugin.files.forEach(function (file) { 86 lazyLoadingFiles.push(plugin.getFilePath(file)); 87 }); 88 // load required files 89 var lazyLoaded = null; 90 if (!($ocLazyLoad === undefined || $ocLazyLoad === null)) { 91 lazyLoaded = $ocLazyLoad.load(plugin.getFullPluginName()); 92 } 93 // load angular module 94 angular.module(this.getFullPluginName(), params); 95 return lazyLoaded; 96 }; 97 }; 98 99 var Section = function (name, index) { 100 this.name = name; 101 this.index = index; 102 this.entries = []; 103 104 this.addEntry = function (entry) { 105 this.entries.push(entry); 106 }; 107 }; 108 109 var Menu = function () { 110 this.sections = []; 111 this.nextIndex = 0; 112 113 this.getSection = function (name, index) { 114 var length = this.sections.length; 115 for (var i = 0; i < length; ++i) { 116 var section = this.sections[i]; 117 if (section.name == name) { 118 return section; 119 } 120 } 121 if (index === undefined || index === null) { 122 this.nextIndex++; 123 index = this.nextIndex; 124 } else { 125 if (index > this.nextIndex) { 126 this.nextIndex = index; 127 } 128 } 129 var newSection = new Section(name, index); 130 this.sections.push(newSection); 131 return newSection; 132 }; 133 134 this.getMenuEntries = function () { 135 var entries = []; 136 this.sections.sort(function (a, b) { 137 return parseFloat(a.index) - parseFloat(b.index); 138 }); 139 this.sections.forEach(function (section) { 140 entries.push({ name: section.name, isCategory: true, route: '?' }); 141 section.entries.sort(function(a, b) { 142 return parseFloat(a.index) - parseFloat(b.index); 42 143 }); 144 section.entries.forEach(function (entry) { 145 entries.push(entry); 146 }); 147 }); 148 return entries; 149 }; 150 }; 151 152 // app that holds references to plugins and menu 153 var app = new function () { 154 this.plugins = []; 155 this.registerPlugin = function (name) { 156 var plugin = new Plugin(name); 157 if (name.localeCompare(appName) != 0) { 158 this.plugins.push(plugin); 43 159 } 44 ]); 160 return plugin; 161 }; 45 162 46 module.config([ 47 '$httpProvider', function ($httpProvider) { 48 $httpProvider.interceptors.push(['$q', function ($q) { 49 return { 50 'request': function (config) { 51 if (endsWith(config.url, '.cshtml')) { 52 config.url = 'App/LoadPluginView?' + config.url + "&dateTime=" + Date.now().toString(); 53 } 54 return config; 55 } 56 }; 57 }]); 58 } 59 ]); 60 61 function endsWith(str, suffix) { 62 if (suffix.length > str.length) { 63 return false; 64 } 65 return str.indexOf(suffix, str.length - suffix.length) !== -1; 66 } 67 68 })(); 163 this.menu = new Menu(); 164 this.getMenu = function () { 165 return this.menu; 166 }; 167 }; -
branches/HiveStatistics/sources/HeuristicLab.Services.WebApp/WebApp/helper.js
r12419 r12425 32 32 return year + '-' + month + '-' + day + 'T23:59:59.000Z'; 33 33 }; 34 35 36 var CSharpDateToString = function (datetime) { 37 var date = new Date(Date.parse(datetime)); 38 var day = date.getDate().zeropad(2); 39 var month = (1 + date.getMonth()).zeropad(2); 40 var year = date.getFullYear(); 41 var hour = date.getHours().zeropad(2); 42 var minute = date.getMinutes().zeropad(2); 43 var second = date.getSeconds().zeropad(2); 44 return day + '.' + month + '.' + year + ' ' + hour + ':' + minute + ':' + second; 45 }; -
branches/HiveStatistics/sources/HeuristicLab.Services.WebApp/WebApp/plugins/login/login.cshtml
r12419 r12425 1 @using System.Web.Security 2 <div id="login"> 1 <div class="default-view-container"> 3 2 <div class="row"> 4 3 <div class="col-md-6 center-block" style="float: none"> … … 27 26 </div> 28 27 <div class="form-group"> 29 <input type="submit" value="Login" href="#" class="btn btn-default pull-right" data-ng-click="login()" />28 <input type="submit" value="Login" href="#" class="btn btn-default pull-right" data-ng-click="login()" /> 30 29 </div> 31 30 </form> -
branches/HiveStatistics/sources/HeuristicLab.Services.WebApp/WebApp/plugins/login/login.css
r12419 r12425 1 #login { 2 padding: 30px; 3 } 4 5 .loginError { 1 .loginError { 6 2 padding: 15px; 7 3 } -
branches/HiveStatistics/sources/HeuristicLab.Services.WebApp/WebApp/plugins/login/login.js
r12419 r12425 1 var appLogin Module = app.registerModule('login');1 var appLoginPlugin = app.registerPlugin('login'); 2 2 (function () { 3 var module = appLoginModule;4 module.dependencies = ['ngResource', 'ui.bootstrap'];5 module.files = [3 var plugin = appLoginPlugin; 4 plugin.dependencies = ['ngResource', 'ui.bootstrap']; 5 plugin.files = [ 6 6 'loginCtrl.js', 7 7 'login.css' 8 8 ]; 9 module.view = 'login.cshtml';10 module.controller = appLoginModule.getControllerName();11 module.routes = [];9 plugin.view = 'login.cshtml'; 10 plugin.controller = 'app.login.ctrl'; 11 plugin.routes = []; 12 12 })(); -
branches/HiveStatistics/sources/HeuristicLab.Services.WebApp/WebApp/plugins/login/loginCtrl.js
r12419 r12425 1 1 (function () { 2 var moduleName = appLoginModule.getFullModuleName(); 3 var module = appLoginModule.getAngularModule(); 4 module.controller(appLoginModule.getControllerName(), 2 var module = appLoginPlugin.getAngularModule(); 3 module.controller('app.login.ctrl', 5 4 ['$scope', '$window', 'app.authentication.service', function ($scope, $window, authService) { 6 5 $scope.login = function () { -
branches/HiveStatistics/sources/HeuristicLab.Services.WebApp/WebApp/plugins/plugins/plugins.cshtml
r12419 r12425 1 <h1>{{test}}</h1> 1 <div class="default-view-container"> 2 <div class="row"> 3 <div class="col-lg-12"> 4 <div class="panel panel-default"> 5 <div class="panel-heading"> 6 <h3 class="panel-title">WebApp Plugins</h3> 7 </div> 8 <div class="panel-body"> 9 <table class="table table-hover table-condensed"> 10 <thead> 11 <tr> 12 <th>#</th> 13 <th>Name</th> 14 <th>Assembly</th> 15 <th>Last reload</th> 16 <th></th> 17 </tr> 18 </thead> 19 <tr ng-repeat="plugin in plugins"> 20 <td>{{$index + 1}}</td> 21 <td>{{plugin.Name}}</td> 22 <td>{{plugin.AssemblyName}}</td> 23 <td>{{plugin.LastReload}}</td> 24 <td> 25 <a ng-href="" data-ng-click="reloadPlugin(plugin.Name)">Reload</a> 26 </td> 27 </tr> 28 </table> 29 </div> 30 </div> 31 </div> 32 </div> 33 </div> -
branches/HiveStatistics/sources/HeuristicLab.Services.WebApp/WebApp/plugins/plugins/plugins.js
r12419 r12425 1 var appPlugins Module = app.registerModule('plugins');1 var appPluginsPlugin = app.registerPlugin('plugins'); 2 2 (function () { 3 var module = appPluginsModule; 4 module.dependencies = ['ngResource', 'ui.bootstrap']; 5 module.files = ['pluginsCtrl.js']; 6 module.view = 'plugins.cshtml'; 7 module.controller = 'app.plugins.ctrl'; 8 module.routes = []; 3 var plugin = appPluginsPlugin; 4 plugin.dependencies = ['ngResource', 'ui.bootstrap']; 5 plugin.files = [ 6 'pluginsService.js', 7 'pluginsCtrl.js' 8 ]; 9 plugin.view = 'plugins.cshtml'; 10 plugin.controller = 'app.plugins.ctrl'; 11 plugin.routes = []; 9 12 10 13 var menu = app.getMenu(); 11 14 var section = menu.getSection('Administration', -1); 12 15 section.addEntry({ 16 index: 10, 13 17 name: 'Plugins', 14 18 route: '#/plugins', -
branches/HiveStatistics/sources/HeuristicLab.Services.WebApp/WebApp/plugins/plugins/pluginsCtrl.js
r12419 r12425 1 1 (function () { 2 var module = appPlugins Module.getAngularModule();2 var module = appPluginsPlugin.getAngularModule(); 3 3 module.controller('app.plugins.ctrl', 4 ['$scope', function ($scope) { 5 $scope.test = "a test message"; 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(); 6 30 }] 7 31 ); -
branches/HiveStatistics/sources/HeuristicLab.Services.WebApp/WebApp/shared/directives/flot.js
r12419 r12425 1 1 (function () { 2 var module = appMain Module.getAngularModule();2 var module = appMainPlugin.getAngularModule(); 3 3 module.directive('flot', function () { 4 4 return { … … 41 41 chart.setupGrid(); 42 42 chart.draw(); 43 44 43 } 45 44 }); -
branches/HiveStatistics/sources/HeuristicLab.Services.WebApp/WebApp/shared/layout/layout.cshtml
r12419 r12425 1 <!DOCTYPE html> 1 @using HeuristicLab.Services.WebApp.Configs 2 <!DOCTYPE html> 2 3 <html lang="en" ng-app="app"> 3 4 <head> … … 25 26 <div id="app"> 26 27 <header id="toolbar" class="navbar navbar-default navbar-static-top no-border no-padding-margin" 27 ng-controller="app.menu ">28 ng-controller="app.menu.ctrl"> 28 29 <nav> 29 30 <div class="container-fluid"> … … 61 62 </header> 62 63 63 <aside id="menu" ng-controller="app.menu ">64 <aside id="menu" ng-controller="app.menu.ctrl"> 64 65 <ul class="nav nav-sidebar" 65 66 ng-include="'App/LoadSharedView?directory=menu&view=menu.cshtml&dateTime=@DateTime.Now'" -
branches/HiveStatistics/sources/HeuristicLab.Services.WebApp/WebApp/shared/menu/menuCtrl.js
r12419 r12425 1 1 (function () { 2 var module = appMain Module.getAngularModule();3 module.controller('app.menu ',2 var module = appMainPlugin.getAngularModule(); 3 module.controller('app.menu.ctrl', 4 4 ['$scope', '$timeout', '$location', '$window', 'app.authentication.service', 5 5 function ($scope, $timeout, $location, $window, authService) { -
branches/HiveStatistics/sources/HeuristicLab.Services.WebApp/WebApp/shared/services/authenticationService.js
r12419 r12425 1 1 (function () { 2 2 var apiUrl = 'api/App/Authentication/'; 3 var module = appMain Module.getAngularModule();3 var module = appMainPlugin.getAngularModule(); 4 4 module.factory('app.authentication.service', 5 5 ['$resource', function ($resource) {
Note: See TracChangeset
for help on using the changeset viewer.