Add documentation link to plugins (#4329)

* Add documentation link to plugins

* Minor UI updates

Co-authored-by: Dennis Reimann <mail@dennisreimann.de>
This commit is contained in:
Nicolas Dorier
2022-11-22 19:06:23 +09:00
committed by GitHub
parent bd3710a60f
commit d959f5096b
4 changed files with 39 additions and 15 deletions

View File

@@ -33,13 +33,17 @@ namespace BTCPayServer.Controllers
});
availablePlugins = Array.Empty<PluginService.AvailablePlugin>();
}
var docsByIdentifier = new Dictionary<string, string>();
foreach (var p in availablePlugins.Where(p => !string.IsNullOrEmpty(p.Documentation)))
docsByIdentifier.TryAdd(p.Identifier, p.Documentation);
var res = new ListPluginsViewModel()
{
Installed = pluginService.LoadedPlugins,
Available = availablePlugins,
Commands = pluginService.GetPendingCommands(),
Disabled = pluginService.GetDisabledPlugins(),
CanShowRestart = btcPayServerOptions.DockerDeployment
CanShowRestart = btcPayServerOptions.DockerDeployment,
DocsByIdentifier = docsByIdentifier
};
return View(res);
}
@@ -51,6 +55,7 @@ namespace BTCPayServer.Controllers
public (string command, string plugin)[] Commands { get; set; }
public bool CanShowRestart { get; set; }
public string[] Disabled { get; set; }
public Dictionary<string, string> DocsByIdentifier { get; set; } = new Dictionary<string, string>();
}
[HttpPost("server/plugins/uninstall")]