2021-11-23 22:56:22 +01:00
|
|
|
using Microsoft.AspNetCore.Mvc;
|
2021-11-29 18:25:50 +01:00
|
|
|
using zero.Api.Controllers;
|
2021-11-23 22:56:22 +01:00
|
|
|
|
|
|
|
|
namespace zero.Backoffice.Controllers;
|
|
|
|
|
|
|
|
|
|
[ZeroAuthorize(false)]
|
|
|
|
|
[DisableBrowserCache]
|
2021-11-29 00:38:55 +01:00
|
|
|
public class ZeroIndexController : Controller
|
2021-11-23 22:56:22 +01:00
|
|
|
{
|
|
|
|
|
IZeroVue ZeroVue { get; set; }
|
|
|
|
|
IZeroOptions Options { get; set; }
|
|
|
|
|
|
|
|
|
|
public ZeroIndexController(IZeroVue zeroVue, IZeroOptions options)
|
|
|
|
|
{
|
|
|
|
|
ZeroVue = zeroVue;
|
|
|
|
|
Options = options;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public IActionResult Index()
|
|
|
|
|
{
|
|
|
|
|
if (Options.Version.IsNullOrEmpty())
|
|
|
|
|
{
|
|
|
|
|
return RedirectToAction("ZeroBackoffice", "Setup");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return View("Views/Zero/Index.cshtml", new ZeroBackofficeModel()
|
|
|
|
|
{
|
|
|
|
|
Port = Options.For<BackofficeOptions>().DevServer.Port,
|
|
|
|
|
Vue = ZeroVue
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public class ZeroBackofficeModel
|
|
|
|
|
{
|
|
|
|
|
public int Port { get; set; }
|
|
|
|
|
|
|
|
|
|
public IZeroVue Vue { get; set; }
|
|
|
|
|
}
|