Allow installation of Language packages through Language Management
This commit is contained in:
@ -1,16 +1,17 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Generic;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Oqtane.Models;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Net.Http;
|
||||
using System.Threading.Tasks;
|
||||
using System.Threading;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Oqtane.Shared;
|
||||
using Oqtane.Infrastructure;
|
||||
using Oqtane.Enums;
|
||||
// ReSharper disable PartialTypeWithSinglePart
|
||||
|
||||
namespace Oqtane.Controllers
|
||||
@ -18,11 +19,15 @@ namespace Oqtane.Controllers
|
||||
[Route(ControllerRoutes.Default)]
|
||||
public class PackageController : Controller
|
||||
{
|
||||
private readonly IInstallationManager _installationManager;
|
||||
private readonly IWebHostEnvironment _environment;
|
||||
private readonly ILogManager _logger;
|
||||
|
||||
public PackageController(IWebHostEnvironment environment)
|
||||
public PackageController(IInstallationManager installationManager, IWebHostEnvironment environment, ILogManager logger)
|
||||
{
|
||||
_installationManager = installationManager;
|
||||
_environment = environment;
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
// GET: api/<controller>?tag=x
|
||||
@ -86,6 +91,14 @@ namespace Oqtane.Controllers
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[HttpGet("install")]
|
||||
[Authorize(Roles = RoleNames.Host)]
|
||||
public void InstallPackages()
|
||||
{
|
||||
_logger.Log(LogLevel.Information, this, LogFunction.Create, "Packages Installed");
|
||||
_installationManager.InstallPackages("Packages");
|
||||
}
|
||||
}
|
||||
|
||||
public partial class SearchResult
|
||||
|
Reference in New Issue
Block a user