Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
06/12/15 14:59:54 (9 years ago)
Author:
dglaser
Message:

#2394: Improved PluginManager and updated hive status monitor.

Location:
trunk/sources/HeuristicLab.Services.WebApp/3.3
Files:
18 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Services.WebApp/3.3/Configs/BundleConfig.cs

    r12428 r12435  
    1 using System.Collections.Generic;
     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.Collections.Generic;
    223using System.IO;
    3 using System.Linq;
    4 using System.Web;
    524using System.Web.Optimization;
    625
    726namespace HeuristicLab.Services.WebApp.Configs {
    827  public class BundleConfig {
     28
    929    public static void RegisterBundles(BundleCollection bundles) {
    1030      bundles.IgnoreList.Clear();
     
    6181        "~/WebApp/app.css"
    6282      ));
    63       AddOrUpdateWebAppBundle();
     83
     84      bundles.Add(new ScriptBundle("~/Bundles/WebApp/Main").Include(
     85        "~/WebApp/main.js"
     86      ));
     87
     88      bundles.Add(new ScriptBundle("~/Bundles/WebApp/Shared")
     89        .IncludeDirectory("~/WebApp/shared/services", "*.js", true)
     90        .IncludeDirectory("~/WebApp/shared/directives", "*.js", true)
     91        .IncludeDirectory("~/WebApp/shared/menu", "*.js", true)
     92      );
    6493    }
    6594
    66     public static void AddOrUpdateWebAppBundle() {
    67       var jsBundle = BundleTable.Bundles.GetBundleFor("~/Bundles/WebApp/js");
    68       if (jsBundle != null) {
    69         BundleTable.Bundles.Remove(jsBundle);
     95    public static IEnumerable<string> GetWebAppScripts() {
     96      var jsFiles = new List<string> {
     97        "WebApp/helper.js",
     98        "WebApp/app.js"
     99      };
     100      PluginManager pluginManager = PluginManager.Instance;
     101      foreach (var plugin in pluginManager.GetPlugins()) {
     102        if (File.Exists(string.Format(@"{0}\{1}\{1}.js", PluginManager.PluginsDirectory, plugin.Name))) {
     103          jsFiles.Add(string.Format("WebApp/plugins/{0}/{0}.js", plugin.Name));
     104        }
    70105      }
    71       var jsFiles = new List<string> {
    72         "~/WebApp/helper.js",
    73         "~/WebApp/app.js"
    74       };
    75       var directories = Directory.GetDirectories(string.Format(@"{0}WebApp\plugins", HttpRuntime.AppDomainAppPath));
    76       jsFiles.AddRange(directories.Select(Path.GetFileName).Select(directory => string.Format("~/WebApp/plugins/{0}/{0}.js", directory)));
    77       jsFiles.Add("~/WebApp/main.js");
    78       jsBundle = new ScriptBundle("~/Bundles/WebApp/js");
    79       jsBundle.Include(jsFiles.ToArray());
    80       jsBundle.IncludeDirectory("~/WebApp/shared/", "*.js", true);
    81       BundleTable.Bundles.Add(jsBundle);
     106      jsFiles.Add("WebApp/main.js");
     107      return jsFiles;
    82108    }
    83109  }
  • trunk/sources/HeuristicLab.Services.WebApp/3.3/Configs/FilterConfig.cs

    r12428 r12435  
    1 using System.Web.Mvc;
     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.Mvc;
    223
    324namespace HeuristicLab.Services.WebApp.Configs {
  • trunk/sources/HeuristicLab.Services.WebApp/3.3/Configs/RouteConfig.cs

    r12428 r12435  
    1 using System.Web.Mvc;
     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.Mvc;
    223using System.Web.Routing;
    324
  • trunk/sources/HeuristicLab.Services.WebApp/3.3/Configs/WebApiConfig.cs

    r12428 r12435  
    1 
     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
    222using System.Net.Http.Formatting;
    323using System.Web.Http;
  • trunk/sources/HeuristicLab.Services.WebApp/3.3/Controllers/AppController.cs

    r12428 r12435  
    2121
    2222using System.Web.Mvc;
    23 using HeuristicLab.Services.WebApp.Configs;
    2423
    2524namespace HeuristicLab.Services.WebApp.Controllers {
     
    3130        return RedirectPermanent(Request.Url + "/");
    3231      }
    33       BundleConfig.AddOrUpdateWebAppBundle();
    3432      return View("~/WebApp/shared/layout/layout.cshtml");
    3533    }
  • trunk/sources/HeuristicLab.Services.WebApp/3.3/Controllers/AuthenticationController.cs

    r12428 r12435  
    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.Security;
    324using HeuristicLab.Services.WebApp.Controllers.DataTransfer;
  • trunk/sources/HeuristicLab.Services.WebApp/3.3/Controllers/DataTransfer/Plugin.cs

    r12428 r12435  
    1 using System;
     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;
    223
    324namespace HeuristicLab.Services.WebApp.Controllers.DataTransfer {
  • trunk/sources/HeuristicLab.Services.WebApp/3.3/Controllers/DataTransfer/User.cs

    r12428 r12435  
    1 namespace HeuristicLab.Services.WebApp.Controllers.DataTransfer {
     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
     22namespace HeuristicLab.Services.WebApp.Controllers.DataTransfer {
    223  public class User {
    324    public string Username { get; set; }
  • trunk/sources/HeuristicLab.Services.WebApp/3.3/Controllers/PluginController.cs

    r12428 r12435  
    1 using System.Collections.Generic;
     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.Collections.Generic;
    223using System.Linq;
    324using System.Web.Http;
     25using HeuristicLab.Services.Hive;
    426using DTO = HeuristicLab.Services.WebApp.Controllers.DataTransfer;
    527
    628namespace HeuristicLab.Services.WebApp.Controllers {
    729
    8   [Authorize(Roles = "Hive Administrator")]
     30  [Authorize(Roles = HiveRoles.Administrator)]
    931  public class PluginController : ApiController {
    1032
     
    2143
    2244    public bool ReloadPlugin(string name) {
    23       var plugin = PluginManager.Instance.GetPlugin(name);
     45      var plugin = pluginManager.GetPlugin(name);
     46      if (plugin == null)
     47        return false;
    2448      plugin.ReloadControllers();
    2549      return true;
  • trunk/sources/HeuristicLab.Services.WebApp/3.3/Controllers/WebAppControllerSelector.cs

    r12428 r12435  
    1 using System;
     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;
    223using System.Collections.Concurrent;
    324using System.Collections.Generic;
     
    1839      : base(configuration) {
    1940      this.configuration = configuration;
    20       pluginManager.Configuration = configuration;
    2141      controllers = new ConcurrentDictionary<string, HttpControllerDescriptor>();
    2242      LoadAppControllers();
  • trunk/sources/HeuristicLab.Services.WebApp/3.3/Global.asax.cs

    r12428 r12435  
    88  public class MvcApplication : System.Web.HttpApplication {
    99    protected void Application_Start() {
     10      var pluginManager = PluginManager.Instance;
     11      pluginManager.Configuration = GlobalConfiguration.Configuration;
     12      pluginManager.DiscoverPlugins();
    1013      AreaRegistration.RegisterAllAreas();
    1114      GlobalConfiguration.Configure(WebApiConfig.Register);
  • trunk/sources/HeuristicLab.Services.WebApp/3.3/Plugin.cs

    r12428 r12435  
    1 using System;
     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;
    223using System.Collections.Concurrent;
    324using System.Collections.Generic;
     
    526using System.Linq;
    627using System.Reflection;
    7 using System.Text;
    828using System.Web.Http;
    929using System.Web.Http.Controllers;
     
    5676        AssemblyName = Path.GetFileName(assemblyPath);
    5777      }
    58       catch (ReflectionTypeLoadException ex) {
    59         StringBuilder sb = new StringBuilder();
    60         foreach (Exception exSub in ex.LoaderExceptions) {
    61           sb.AppendLine(exSub.Message);
    62           FileNotFoundException exFileNotFound = exSub as FileNotFoundException;
    63           if (exFileNotFound != null) {
    64             if (!string.IsNullOrEmpty(exFileNotFound.FusionLog)) {
    65               sb.AppendLine("Fusion Log:");
    66               sb.AppendLine(exFileNotFound.FusionLog);
    67             }
    68           }
    69           sb.AppendLine();
    70         }
    71         AssemblyName = "Error loading assembly: " + sb.ToString();
     78      catch (Exception) {
     79        AssemblyName = "Error loading assembly";
    7280        Controllers.Clear();
    7381      }
  • trunk/sources/HeuristicLab.Services.WebApp/3.3/PluginManager.cs

    r12428 r12435  
    1 using System.Collections.Concurrent;
     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.Collections.Concurrent;
    223using System.Collections.Generic;
    324using System.IO;
     
    1738    public HttpConfiguration Configuration { get; set; }
    1839
    19     private string PluginsDirectory {
     40    public static string PluginsDirectory {
    2041      get { return string.Format(@"{0}WebApp\plugins", HttpRuntime.AppDomainAppPath); }
    2142    }
     
    2344    public PluginManager() {
    2445      plugins = new ConcurrentDictionary<string, Plugin>();
     46      var fileWatcher = new FileSystemWatcher(PluginsDirectory, "*") {
     47        IncludeSubdirectories = true,
     48        EnableRaisingEvents = true
     49      };
     50      fileWatcher.Created += OnFilesChanged;
     51      fileWatcher.Changed += OnFilesChanged;
     52      fileWatcher.Deleted += OnFilesChanged;
     53      fileWatcher.Renamed += OnFilesChanged;
     54    }
     55
     56    private void OnFilesChanged(object sender, FileSystemEventArgs args) {
     57      string path = args.FullPath.Remove(0, PluginsDirectory.Length + 1);
     58      var pathParts = path.Split('\\');
     59      string pluginName = pathParts[0];
     60      if (pathParts.Length == 1) {
     61        switch (args.ChangeType) {
     62          case WatcherChangeTypes.Created:
     63            GetPlugin(pluginName);
     64            break;
     65
     66          case WatcherChangeTypes.Deleted:
     67            plugins.Remove(pluginName);
     68            break;
     69
     70          case WatcherChangeTypes.Renamed:
     71            RenamedEventArgs renamedArgs = (RenamedEventArgs)args;
     72            string oldPath = renamedArgs.OldFullPath.Remove(0, PluginsDirectory.Length + 1);
     73            var oldPathParts = oldPath.Split('\\');
     74            string oldPluginName = oldPathParts[0];
     75            plugins.Remove(oldPluginName);
     76            GetPlugin(pluginName);
     77            break;
     78
     79          case WatcherChangeTypes.Changed:
     80            Plugin plugin = LookupPlugin(pluginName);
     81            if (plugin != null) {
     82              plugin.ReloadControllers();
     83            }
     84            break;
     85        }
     86      }
    2587    }
    2688
    2789    public Plugin GetPlugin(string name) {
    28       Plugin plugin;
    29       plugins.TryGetValue(name, out plugin);
     90      Plugin plugin = LookupPlugin(name);
    3091      if (plugin == null) {
    3192        string directory = string.Format(@"{0}\{1}", PluginsDirectory, name);
     
    43104
    44105    public IEnumerable<Plugin> GetPlugins() {
    45       DiscoverPlugins();
    46106      return plugins.Values;
    47107    }
    48108
    49     private void DiscoverPlugins() {
     109    public void DiscoverPlugins() {
    50110      var pluginDirectories = Directory.GetDirectories(PluginsDirectory);
    51111      foreach (var directory in pluginDirectories) {
    52112        string pluginName = Path.GetFileName(directory);
    53         Plugin plugin;
    54         plugins.TryGetValue(pluginName, out plugin);
     113        Plugin plugin = LookupPlugin(pluginName);
    55114        if (plugin == null) {
    56115          plugin = new Plugin {
     
    63122      }
    64123    }
     124
     125    private Plugin LookupPlugin(string name) {
     126      Plugin plugin;
     127      plugins.TryGetValue(name, out plugin);
     128      return plugin;
     129    }
    65130  }
    66131}
  • trunk/sources/HeuristicLab.Services.WebApp/3.3/WebApp/app.css

    r12428 r12435  
    7979
    8080#menu {
    81   position: absolute;
    82   min-height: inherit;
    83   width: 250px;
     81  position: relative;
    8482  background: #FAFAFA;
    8583  display: block;
    8684  overflow: hidden;
    87   border-right: 1px solid #D3D3D3;
     85  z-index: 10000;
     86  width: 100%;
    8887}
    8988
     
    101100#view {
    102101  position: relative;
    103   left: 0px;
    104   margin-left: 250px;
     102  left: 0;
     103  margin-left: 0px;
    105104  display: block;
    106105  overflow: hidden;
    107106}
     107
    108108
    109109.view-header {
     
    124124}
    125125
    126 .navbar-header{
    127   width: 250px;
     126.navbar-header {
     127  width: 100%;
    128128  background: #3c3a39;
    129129  color: #FFFFFF;
     130  float: left;
     131}
     132
     133
     134@media (min-width: 768px) {
     135  #view {
     136    margin-left: 250px;
     137  }
     138
     139  #menu {
     140    visibility: visible;
     141    position: absolute;
     142    width: 250px;
     143    min-height: inherit;
     144    border-right: 1px solid #D3D3D3;
     145    z-index: 0;
     146  }
     147
     148  .navbar-header {
     149    width: 250px;
     150  }
     151}
     152.container-fluid .navbar-header {
     153  margin: 0;
     154  padding: 0;
     155}
     156
     157.navbar-nav {
     158  margin: 0;
     159  padding: 0;
     160}
     161
     162.navbar-right {
     163  float: right!important
     164}
     165
     166.navbar-nav>li>a {
     167  padding-top: 15px;
     168  padding-bottom: 15px;
     169}
     170
     171.navbar-content {
     172  padding-right: 15px;
     173}
     174
     175.navbar-nav > li {
     176  float: left;
    130177}
    131178
     
    140187.nav-sidebar {
    141188  font-size: 12px;
     189  padding-bottom: 30px;
    142190}
    143191
     
    279327}
    280328
     329.table-no-border>thead>tr>th,
     330.table-no-border>tbody>tr>th,
     331.table-no-border>tfoot>tr>th,
     332.table-no-border>thead>tr>td,
     333.table-no-border>tbody>tr>td,
     334.table-no-border>tfoot>tr>td,
     335.table-no-border>tbody,
     336.table-no-border>thead,
     337.table-no-border>tfoot{
     338  border-top: none !important;
     339  border-bottom: none !important;
     340}
     341
     342.table-auto-width {
     343  width: auto !important;
     344}
     345
     346.center-element {
     347  margin: 0 auto;
     348}
     349
     350.table-content {
     351  margin-bottom: 0;
     352}
    281353
    282354#top-navbar {
     
    311383
    312384.navbar-default .navbar-text {
     385  display: block;
    313386  color: #ffffff;
    314387  text-shadow: none !important;
    315 }
    316 
     388  margin: 0;
     389  padding: 15px;
     390}
     391
     392.navbar-nav {
     393  float:left;
     394  margin:0
     395}
     396
     397.navbar-nav>li {
     398  float:left
     399}
     400
     401.navbar-nav>li>a {
     402  padding-top:15px;
     403  padding-bottom:15px
     404}
     405
     406.navbar-toggle {
     407  border: none !important;
     408}
     409
     410.navbar-toggle:focus {
     411  background-color: transparent !important;
     412}
     413
     414.navbar-toggle:hover {
     415  background-color: #D3D3D3 !important;
     416}
     417
     418#menu .navbar-collapse {
     419  padding: 0;
     420  margin: 0;
     421}
    317422
    318423.default-view-container {
    319424  padding: 30px;
    320425}
     426
     427.panel-heading a:after {
     428    font-family:'Glyphicons Halflings';
     429    content:"\e114";
     430    float: right;
     431    color: grey;
     432}
     433.panel-heading a.collapsed:after {
     434    content:"\e080";
     435}
     436
     437.panel-heading a:focus, a:hover {
     438  text-decoration: none;
     439}
  • trunk/sources/HeuristicLab.Services.WebApp/3.3/WebApp/shared/directives/flot.js

    r12428 r12435  
    66            link: function (scope, element, attrs) {
    77                var chart = null, opts = scope[attrs.options];
     8                var div = null;
    89
    910                scope.$watchCollection(attrs.dataset, function (newData, oldData) {
    1011                    if (!chart) {
    11                         var div = element.append("<div>");
     12                        div = element.append("<div>");
    1213                        div.bind("plotselected", function (event, ranges) {
    1314                            $.each(chart.getXAxes(), function (_, axis) {
  • trunk/sources/HeuristicLab.Services.WebApp/3.3/WebApp/shared/layout/layout.cshtml

    r12428 r12435  
    1 @using HeuristicLab.Services.WebApp.Configs
     1@* HeuristicLab
     2 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 *
     4 * This file is part of HeuristicLab.
     5 *
     6 * HeuristicLab is free software: you can redistribute it and/or modify
     7 * it under the terms of the GNU General Public License as published by
     8 * the Free Software Foundation, either version 3 of the License, or
     9 * (at your option) any later version.
     10 *
     11 * HeuristicLab is distributed in the hope that it will be useful,
     12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
     13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     14 * GNU General Public License for more details.
     15 *
     16 * You should have received a copy of the GNU General Public License
     17 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
     18*@
     19
     20@using HeuristicLab.Services.WebApp.Configs
    221<!DOCTYPE html>
    322<html lang="en" ng-app="app">
     
    1534    <![endif]-->
    1635    @Scripts.Render("~/Bundles/Vendors/js")
    17     @{
    18         BundleTable.EnableOptimizations = false;
     36    @foreach (var script in BundleConfig.GetWebAppScripts()) {
     37        <script src="@script"></script>
    1938    }
    20     @Scripts.Render("~/Bundles/WebApp/js")
    21     @{
    22         BundleTable.EnableOptimizations = true;
    23     }
     39
     40    @Scripts.Render("~/Bundles/WebApp/Shared")
    2441</head>
    25 <body>
    26     <div id="app">
    27         <header id="toolbar" class="navbar navbar-default navbar-static-top no-border no-padding-margin"
    28                 ng-controller="app.menu.ctrl">
    29             <nav>
    30                 <div class="container-fluid">
    31                     <div class="navbar-header">
    32                         <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#top-navbar">
     42<body ngcloak>
     43<div id="app">
     44    <header id="toolbar" class="navbar navbar-default navbar-static-top no-border no-padding-margin"
     45            ng-controller="app.menu.ctrl">
     46        <nav>
     47            <div class="container-fluid">
     48                <div class="navbar-header">
     49                    <div class="center-block">
     50                        <a class="navbar-brand" href="#">
     51                            <img src="~/WebApp/shared/images/HeuristicLab-Logo.png" style="float: left; height: 100%; margin-right: 5px;"/>
     52                            <span style="color: #f7921d">HeuristicLab</span>
     53                        </a>
     54                        <button class="navbar-toggle collapsed" type="button" data-toggle="collapse" data-target="#menu .navbar-collapse">
    3355                            <span class="sr-only">Toggle navigation</span>
    3456                            <span class="icon-bar"></span>
     
    3658                            <span class="icon-bar"></span>
    3759                        </button>
    38                         <a class="navbar-brand" href="#">
    39                             <img src="~/WebApp/shared/images/HeuristicLab-Logo.png" style="float: left; height: 100%; margin-left: 25px; margin-right: 5px;" />
    40                             Heuristic<span style="color: #f7921d">Lab</span>
    41                         </a>
    42                     </div>
    43 
    44                     <div class="collapse navbar-collapse" id="top-navbar">
    45                         <ul class="nav navbar-nav navbar-right">
    46                             @if (Request.IsAuthenticated) {
    47                                 <li>
    48                                     <p class="navbar-text">Hello @User.Identity.Name!</p>
    49                                 </li>
    50                                 <li>
    51                                     <a ng-href="" data-ng-click="logout()">Logout</a>
    52                                 </li>
    53                             } else {
    54                                 <li>
    55                                     <a ng-href="#/login">Login</a>
    56                                 </li>
    57                             }
    58                         </ul>
    5960                    </div>
    6061                </div>
    61             </nav>
    62         </header>
    6362
    64         <aside id="menu" ng-controller="app.menu.ctrl">
     63                <div class="navbar-content">
     64                    <ul class="nav navbar-nav navbar-right">
     65                        @if (Request.IsAuthenticated)
     66                        {
     67                            <li>
     68                                <span class="navbar-text">Hello @User.Identity.Name!</span>
     69                            </li>
     70                            <li>
     71                                <a ng-href="" data-ng-click="logout()">Logout</a>
     72                            </li>
     73                        }
     74                        else
     75                        {
     76                            <li>
     77                                <a ng-href="#/login" data-ng-click="hideMenu()">Login</a>
     78                            </li>
     79                        }
     80                    </ul>
     81                </div>
     82            </div>
     83        </nav>
     84    </header>
     85
     86    <aside id="menu" ng-controller="app.menu.ctrl">
     87        <div class="navbar-collapse collapse">
    6588            <ul class="nav nav-sidebar"
    6689                ng-include="'App/LoadSharedView?directory=menu&view=menu.cshtml&dateTime=@DateTime.Now'"
    6790                ng-init="entries = menuEntries;"></ul>
    68         </aside>
     91        </div>
     92    </aside>
    6993
    70         <section id="view">
    71             <ui-view/>
    72         </section>
    73     </div>
     94    <section id="view">
     95        <ui-view/>
     96    </section>
     97</div>
    7498</body>
    7599</html>
  • trunk/sources/HeuristicLab.Services.WebApp/3.3/WebApp/shared/menu/menu.cshtml

    r12428 r12435  
    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">
     2    <a ng-href="{{section.route}}" ng-if="!section.isCategory"
     3       data-toggle="collapse" data-target="#menu .navbar-collapse">
    34        <span ng-if="section.icon != ''" ng-class="section.icon" style="padding-right: 10px;"></span>
    45        <span>{{section.name}}</span>
  • trunk/sources/HeuristicLab.Services.WebApp/3.3/WebApp/shared/menu/menuCtrl.js

    r12428 r12435  
    2727                });
    2828            };
     29
     30            $scope.hideMenu = function() {
     31                $(".navbar-collapse").collapse('hide');
     32            };
    2933        }]
    3034    );
Note: See TracChangeset for help on using the changeset viewer.