2020-03-22 14:47:59 +01:00
|
|
|
using Microsoft.AspNetCore.Authorization;
|
|
|
|
|
using Microsoft.AspNetCore.Mvc;
|
2020-04-05 00:29:26 +02:00
|
|
|
using Microsoft.Extensions.Options;
|
2020-03-25 23:24:58 +01:00
|
|
|
using zero.Core;
|
|
|
|
|
using zero.Core.Extensions;
|
2020-03-22 14:47:59 +01:00
|
|
|
|
2020-03-24 23:09:29 +01:00
|
|
|
namespace zero.Web.Controllers
|
2020-03-22 14:47:59 +01:00
|
|
|
{
|
|
|
|
|
[AllowAnonymous]
|
|
|
|
|
public class IndexController : BackofficeController
|
|
|
|
|
{
|
2020-04-05 13:05:39 +02:00
|
|
|
private ZeroOptions Options { get; set; }
|
|
|
|
|
|
2020-04-05 00:29:26 +02:00
|
|
|
public IndexController(IZeroConfiguration config, IOptionsMonitor<ZeroOptions> options) : base(config)
|
2020-03-25 23:24:58 +01:00
|
|
|
{
|
2020-04-05 13:05:39 +02:00
|
|
|
Options = options.CurrentValue;
|
2020-03-25 23:24:58 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2020-03-22 14:47:59 +01:00
|
|
|
public IActionResult Index()
|
|
|
|
|
{
|
2020-03-25 23:24:58 +01:00
|
|
|
if (Configuration.ZeroVersion.IsNullOrEmpty())
|
|
|
|
|
{
|
|
|
|
|
return RedirectToAction("Index", "Setup");
|
|
|
|
|
}
|
|
|
|
|
|
2020-04-05 13:05:39 +02:00
|
|
|
return View("/Views/Index.cshtml", Options);
|
2020-03-22 14:47:59 +01:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|