Skip to content

Commit

Permalink
Default routing: use the modules
Browse files Browse the repository at this point in the history
  • Loading branch information
NickCraver committed Nov 2, 2016
1 parent c3fd3af commit a1451b2
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions Opserver/Controllers/StatusController.cs
Expand Up @@ -2,6 +2,10 @@
using System.Net;
using System.Web.Mvc;
using Jil;
using StackExchange.Opserver.Data.Elastic;
using StackExchange.Opserver.Data.Exceptions;
using StackExchange.Opserver.Data.HAProxy;
using StackExchange.Opserver.Data.Redis;
using StackExchange.Opserver.Data.SQL;
using StackExchange.Opserver.Views.Shared;
using StackExchange.Profiling;
Expand Down Expand Up @@ -80,18 +84,19 @@ public ActionResult DefaultAction()
{
var s = Current.Settings;

// TODO: Plugin registrations
// TODO: Plugin registrations - middleware?
// Order could be interesting here, needs to be tied to top tabs
if (s.Dashboard.Enabled && s.Dashboard.HasAccess())
return RedirectToAction(nameof(DashboardController.Dashboard), "Dashboard");
if (SQLModule.Enabled && s.SQL.HasAccess())
return RedirectToAction(nameof(SQLController.Dashboard), "SQL");
if (s.Redis.Enabled && s.Redis.HasAccess())
if (RedisModule.Enabled && s.Redis.HasAccess())
return RedirectToAction(nameof(RedisController.Dashboard), "Redis");
if (s.Elastic.Enabled && s.Elastic.HasAccess())
if (ElasticModule.Enabled && s.Elastic.HasAccess())
return RedirectToAction(nameof(ElasticController.Dashboard), "Elastic");
if (s.Exceptions.Enabled && s.Exceptions.HasAccess())
if (ExceptionsModule.Enabled && s.Exceptions.HasAccess())
return RedirectToAction(nameof(ExceptionsController.Exceptions), "Exceptions");
if (s.HAProxy.Enabled && s.HAProxy.HasAccess())
if (HAProxyModule.Enabled && s.HAProxy.HasAccess())
return RedirectToAction(nameof(HAProxyController.Dashboard), "HAProxy");

return View("NoConfiguration");
Expand Down

0 comments on commit a1451b2

Please sign in to comment.