first output draft of app navigation with sections
This commit is contained in:
@@ -9,9 +9,11 @@ namespace zero.Web.Controllers
|
||||
[AllowAnonymous]
|
||||
public class IndexController : BackofficeController
|
||||
{
|
||||
private ZeroOptions Options { get; set; }
|
||||
|
||||
public IndexController(IZeroConfiguration config, IOptionsMonitor<ZeroOptions> options) : base(config)
|
||||
{
|
||||
|
||||
Options = options.CurrentValue;
|
||||
}
|
||||
|
||||
|
||||
@@ -22,7 +24,7 @@ namespace zero.Web.Controllers
|
||||
return RedirectToAction("Index", "Setup");
|
||||
}
|
||||
|
||||
return View("/Views/Index.cshtml");
|
||||
return View("/Views/Index.cshtml", Options);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -7,11 +7,11 @@ using zero.Core;
|
||||
namespace zero.Web.Controllers
|
||||
{
|
||||
[AllowAnonymous]
|
||||
public class SectionController : BackofficeController
|
||||
public class SectionsController : BackofficeController
|
||||
{
|
||||
private ZeroOptions Options { get; set; }
|
||||
|
||||
public SectionController(IZeroConfiguration config, IOptionsMonitor<ZeroOptions> options) : base(config)
|
||||
public SectionsController(IZeroConfiguration config, IOptionsMonitor<ZeroOptions> options) : base(config)
|
||||
{
|
||||
Options = options.CurrentValue;
|
||||
}
|
||||
@@ -2,6 +2,7 @@
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.AspNetCore.Identity;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.Extensions.Options;
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
@@ -21,18 +22,21 @@ namespace zero.Web.Setup
|
||||
|
||||
protected IWebHostEnvironment Environment { get; private set; }
|
||||
|
||||
protected ZeroOptions Options { get; private set; }
|
||||
|
||||
public SetupController(IZeroConfiguration config, ISetupApi api, IWebHostEnvironment env) : base(config) // UserManager<User> userManager
|
||||
|
||||
public SetupController(IZeroConfiguration config, ISetupApi api, IWebHostEnvironment env, IOptionsMonitor<ZeroOptions> options) : base(config) // UserManager<User> userManager
|
||||
{
|
||||
Api = api;
|
||||
Environment = env;
|
||||
Options = options.CurrentValue;
|
||||
}
|
||||
|
||||
public IActionResult Index()
|
||||
{
|
||||
if (!Configuration.ZeroVersion.IsNullOrEmpty())
|
||||
{
|
||||
return RedirectToAction("Index", "Index");
|
||||
return Redirect(Options.BackofficePath);
|
||||
}
|
||||
|
||||
return View("/Views/Setup.cshtml");
|
||||
|
||||
Reference in New Issue
Block a user