Plugins: Load plugins by order, aesthetic plugin dependency system (#2020)

* Plugins: Load plugins by order, aesthetic plugin dependency system

Introduces plugins loading in order of installation, BTCPay itself shows up as a system plugin, and that plugins can define other plugins as dependencies.

* use a proper type for plugin dependencies

* rebase fixes

* message when cannot install
This commit is contained in:
Andrew Camilleri
2020-11-05 15:43:14 +01:00
committed by GitHub
parent 38fb64130d
commit 31738c465d
8 changed files with 299 additions and 38 deletions

View File

@@ -79,12 +79,20 @@ namespace BTCPayServer.Controllers
[HttpPost("server/plugins/install")]
public async Task<IActionResult> InstallPlugin(
[FromServices] PluginService pluginService, string plugin)
[FromServices] PluginService pluginService, string plugin , bool update = false)
{
try
{
await pluginService.DownloadRemotePlugin(plugin);
pluginService.InstallPlugin(plugin);
if (update)
{
pluginService.UpdatePlugin(plugin);
}
else
{
pluginService.InstallPlugin(plugin);
}
TempData.SetStatusMessageModel(new StatusMessageModel()
{
Message = "Plugin scheduled to be installed.",