using System.Diagnostics;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using bitforum.Models;

namespace bitforum.Controllers.Setting
{
    [Authorize]
    [Route("Setting")]
    public class EnvsController : Controller
    {
        private readonly ILogger<EnvsController> _logger;
        private readonly IHostEnvironment _env;

        public EnvsController(ILogger<EnvsController> logger, IHostEnvironment env)
        {
            _logger = logger;
            _env = env;
        }

        [HttpGet("Envs")]
        public IActionResult Index()
        {
            ViewBag.EnvVars = Environment.GetEnvironmentVariables(); ;

            return View("~/Views/Setting/Envs.cshtml");
        }

        [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
        public IActionResult Error()
        {
            return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier });
        }
    }
}
