Changeset 12514


Ignore:
Timestamp:
06/25/15 18:02:47 (4 years ago)
Author:
dglaser
Message:

#2394:

HeuristicLab.Services.WebApp-3.3:

  • implemented review comments
  • fixed a bug which caused the sidebar menu to collapse on non mobile devices

HeuristicLab.Services.WebApp.Status-3.3:

  • fixed calculation of calculating cores
Location:
trunk/sources
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Services.WebApp.Status/3.3/WebApi/DataController.cs

    r12445 r12514  
    8181            FreeCores = onlineSlaves.Sum(s => s.FreeCores ?? 0), // temporary for old chart data
    8282            ActiveCores = activeSlaves.Sum(s => s.Cores ?? 0),
    83             CalculatingCores = calculatingSlaves.Sum(s => s.Cores ?? 0)
     83            CalculatingCores = calculatingSlaves.Sum(s => s.Cores ?? 0) - calculatingSlaves.Sum(s => s.FreeCores ?? 0)
    8484          },
    8585          CpuUtilizationStatus = new DTO.CpuUtilizationStatus {
  • trunk/sources/HeuristicLab.Services.WebApp/3.3/Configs/BundleConfig.cs

    r12435 r12514  
    9999      };
    100100      PluginManager pluginManager = PluginManager.Instance;
    101       foreach (var plugin in pluginManager.GetPlugins()) {
     101      foreach (var plugin in pluginManager.Plugins) {
    102102        if (File.Exists(string.Format(@"{0}\{1}\{1}.js", PluginManager.PluginsDirectory, plugin.Name))) {
    103103          jsFiles.Add(string.Format("WebApp/plugins/{0}/{0}.js", plugin.Name));
  • trunk/sources/HeuristicLab.Services.WebApp/3.3/Controllers/PluginController.cs

    r12435 r12514  
    3434
    3535    public IEnumerable<DTO.Plugin> GetPlugins() {
    36       var plugins = pluginManager.GetPlugins();
     36      var plugins = pluginManager.Plugins;
    3737      return plugins.Select(plugin => new DTO.Plugin {
    3838        Name = plugin.Name,
  • trunk/sources/HeuristicLab.Services.WebApp/3.3/Global.asax

    r12428 r12514  
    1 <%@ Application Codebehind="Global.asax.cs" Inherits="HeuristicLab.Services.WebApp.MvcApplication" Language="C#" %>
     1<%@ Application Codebehind="Global.asax.cs" Inherits="HeuristicLab.Services.WebApp.HeuristicLabWebApp" Language="C#" %>
  • trunk/sources/HeuristicLab.Services.WebApp/3.3/Global.asax.cs

    r12435 r12514  
    1 using System.Web.Http;
     1#region License Information
     2/* HeuristicLab
     3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     4 *
     5 * This file is part of HeuristicLab.
     6 *
     7 * HeuristicLab is free software: you can redistribute it and/or modify
     8 * it under the terms of the GNU General Public License as published by
     9 * the Free Software Foundation, either version 3 of the License, or
     10 * (at your option) any later version.
     11 *
     12 * HeuristicLab is distributed in the hope that it will be useful,
     13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
     14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     15 * GNU General Public License for more details.
     16 *
     17 * You should have received a copy of the GNU General Public License
     18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
     19 */
     20#endregion
     21
     22using System.Web.Http;
    223using System.Web.Mvc;
    324using System.Web.Optimization;
     
    627
    728namespace HeuristicLab.Services.WebApp {
    8   public class MvcApplication : System.Web.HttpApplication {
     29  public class HeuristicLabWebApp : System.Web.HttpApplication {
    930    protected void Application_Start() {
    1031      var pluginManager = PluginManager.Instance;
  • trunk/sources/HeuristicLab.Services.WebApp/3.3/Plugin.cs

    r12435 r12514  
    3131namespace HeuristicLab.Services.WebApp {
    3232  public class Plugin {
    33     private HttpConfiguration configuration;
    3433    public string Name { get; set; }
    3534    public string Directory { get; set; }
    3635    public string AssemblyName { get; set; }
    3736    public DateTime? LastReload { get; set; }
     37
     38    private HttpConfiguration configuration;
     39    public HttpConfiguration Configuration {
     40      get { return configuration; }
     41      set {
     42        if (configuration != value) {
     43          configuration = value;
     44          ReloadControllers();
     45        }
     46      }
     47    }
    3848
    3949    private IDictionary<string, HttpControllerDescriptor> controllers;
     
    4252    }
    4353
    44     public void Configure(HttpConfiguration configuration) {
    45       if (this.configuration != configuration) {
    46         this.configuration = configuration;
    47         ReloadControllers();
    48       }
     54    public Plugin(string name, string directory, HttpConfiguration configuration) {
     55      Name = name;
     56      Directory = directory;
     57      Configuration = configuration;
    4958    }
    5059
  • trunk/sources/HeuristicLab.Services.WebApp/3.3/PluginManager.cs

    r12435 r12514  
    3838    public HttpConfiguration Configuration { get; set; }
    3939
     40    public IEnumerable<Plugin> Plugins {
     41      get { return plugins.Values; }
     42    }
     43
    4044    public static string PluginsDirectory {
    4145      get { return string.Format(@"{0}WebApp\plugins", HttpRuntime.AppDomainAppPath); }
     
    5660    private void OnFilesChanged(object sender, FileSystemEventArgs args) {
    5761      string path = args.FullPath.Remove(0, PluginsDirectory.Length + 1);
    58       var pathParts = path.Split('\\');
     62      var pathParts = path.Split(Path.PathSeparator);
    5963      string pluginName = pathParts[0];
    6064      if (pathParts.Length == 1) {
     
    7175            RenamedEventArgs renamedArgs = (RenamedEventArgs)args;
    7276            string oldPath = renamedArgs.OldFullPath.Remove(0, PluginsDirectory.Length + 1);
    73             var oldPathParts = oldPath.Split('\\');
     77            var oldPathParts = oldPath.Split(Path.PathSeparator);
    7478            string oldPluginName = oldPathParts[0];
    7579            plugins.Remove(oldPluginName);
     
    9296        string directory = string.Format(@"{0}\{1}", PluginsDirectory, name);
    9397        if (Directory.Exists(directory)) {
    94           plugin = new Plugin {
    95             Name = name,
    96             Directory = directory
    97           };
    98           plugin.Configure(Configuration);
     98          plugin = new Plugin(name, directory, Configuration);
    9999          plugins.Add(name, plugin);
    100100        }
     
    113113        Plugin plugin = LookupPlugin(pluginName);
    114114        if (plugin == null) {
    115           plugin = new Plugin {
    116             Name = pluginName,
    117             Directory = directory
    118           };
    119           plugin.Configure(Configuration);
     115          plugin = new Plugin(pluginName, directory, Configuration);
    120116          plugins.Add(pluginName, plugin);
    121117        }
  • trunk/sources/HeuristicLab.Services.WebApp/3.3/WebApp/app.css

    r12435 r12514  
    33     -moz-border-radius: 0 !important;
    44          border-radius: 0 !important;
    5     /* -webkit-box-shadow: none !important;
    6         -moz-box-shadow: none !important;
    7           -o-box-shadow: none !important;
    8              box-shadow: none !important;*/
    95  font-family: "Open Sans", Helvetica, Arial, sans-serif;
    106}
  • trunk/sources/HeuristicLab.Services.WebApp/3.3/WebApp/shared/layout/layout.cshtml

    r12435 r12514  
    9696    </section>
    9797</div>
     98<script type="text/javascript">
     99$('.navbar-collapse').on('click', 'li a', function () {
     100    $('.navbar-collapse').collapse('hide');
     101});
     102</script>
    98103</body>
    99104</html>
  • trunk/sources/HeuristicLab.Services.WebApp/3.3/WebApp/shared/menu/menu.cshtml

    r12435 r12514  
    11<li ng-repeat="section in entries" ng-class="{'category':section.isCategory === true, 'active': isActive(section.route)}">
    2     <a ng-href="{{section.route}}" ng-if="!section.isCategory"
    3        data-toggle="collapse" data-target="#menu .navbar-collapse">
     2    <a ng-href="{{section.route}}" ng-if="!section.isCategory">
    43        <span ng-if="section.icon != ''" ng-class="section.icon" style="padding-right: 10px;"></span>
    54        <span>{{section.name}}</span>
Note: See TracChangeset for help on using the changeset viewer.