mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-03-10 09:19:24 +01:00
parent
ebc053aca5
commit
ad89139e07
1 changed files with 36 additions and 39 deletions
|
@ -234,56 +234,53 @@
|
||||||
</div>
|
</div>
|
||||||
@{
|
@{
|
||||||
var pendingAction = Model.Commands.Any(tuple => tuple.plugin.Equals(plugin.Identifier, StringComparison.InvariantCultureIgnoreCase));
|
var pendingAction = Model.Commands.Any(tuple => tuple.plugin.Equals(plugin.Identifier, StringComparison.InvariantCultureIgnoreCase));
|
||||||
}
|
|
||||||
@if (pendingAction || (updateAvailable && x != null && !DependentOn(plugin.Identifier)))
|
|
||||||
{
|
|
||||||
var exclusivePendingAction = true;
|
var exclusivePendingAction = true;
|
||||||
<div class="card-footer border-0 pb-3 d-flex gap-2">
|
}
|
||||||
@if (pendingAction && updateAvailable)
|
<div class="card-footer border-0 pb-3 d-flex gap-2">
|
||||||
|
@if (pendingAction && updateAvailable)
|
||||||
|
{
|
||||||
|
var isUpdateAction = Model.Commands.Last(tuple => tuple.plugin.Equals(plugin.Identifier, StringComparison.InvariantCultureIgnoreCase)).command == "update";
|
||||||
|
if (isUpdateAction)
|
||||||
{
|
{
|
||||||
var isUpdateAction = Model.Commands.Last(tuple => tuple.plugin.Equals(plugin.Identifier, StringComparison.InvariantCultureIgnoreCase)).command == "update";
|
var version = PluginService.GetVersionOfPendingInstall(plugin.Identifier);
|
||||||
if (isUpdateAction)
|
exclusivePendingAction = version == x.Version;
|
||||||
{
|
|
||||||
var version = PluginService.GetVersionOfPendingInstall(plugin.Identifier);
|
|
||||||
exclusivePendingAction = version == x.Version;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@if (pendingAction)
|
}
|
||||||
|
@if (pendingAction)
|
||||||
|
{
|
||||||
|
<form asp-action="CancelPluginCommands" asp-route-plugin="@plugin.Identifier">
|
||||||
|
<button type="submit" class="btn btn-outline-secondary">Cancel pending action</button>
|
||||||
|
</form>
|
||||||
|
}
|
||||||
|
@if (!pendingAction || !exclusivePendingAction)
|
||||||
|
{
|
||||||
|
@if (updateAvailable && x != null)
|
||||||
{
|
{
|
||||||
<form asp-action="CancelPluginCommands" asp-route-plugin="@plugin.Identifier">
|
if (PluginManager.DependenciesMet(x.Dependencies, installed))
|
||||||
<button type="submit" class="btn btn-outline-secondary">Cancel pending action</button>
|
|
||||||
</form>
|
|
||||||
}
|
|
||||||
@if(!pendingAction || !exclusivePendingAction)
|
|
||||||
{
|
|
||||||
@if (updateAvailable && x != null)
|
|
||||||
{
|
{
|
||||||
if (PluginManager.DependenciesMet(x.Dependencies, installed))
|
<form asp-action="InstallPlugin" asp-route-plugin="@plugin.Identifier" asp-route-version="@x.Version" asp-route-update="true" class="me-3">
|
||||||
{
|
<button type="submit" class="btn btn-secondary">Update</button>
|
||||||
<form asp-action="InstallPlugin" asp-route-plugin="@plugin.Identifier" asp-route-version="@x.Version" asp-route-update="true" class="me-3">
|
</form>
|
||||||
<button type="submit" class="btn btn-secondary">Update</button>
|
|
||||||
</form>
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
<form asp-action="InstallPlugin" asp-route-plugin="@plugin.Identifier" asp-route-version="@x.Version" asp-route-update="true" class="me-3">
|
|
||||||
<button title="Schedule upgrade for when the dependencies have been met to ensure a smooth update" data-bs-toggle="tooltip" type="submit" class="btn btn-secondary">Schedule update</button>
|
|
||||||
</form>
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@if (DependentOn(plugin.Identifier))
|
|
||||||
{
|
|
||||||
<button type="button" class="btn btn-outline-danger" data-bs-toggle="tooltip" title="This plugin cannot be uninstalled as it is depended on by other plugins.">Uninstall <span class="fa fa-exclamation"></span></button>
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
<form asp-action="UnInstallPlugin" asp-route-plugin="@plugin.Identifier">
|
<form asp-action="InstallPlugin" asp-route-plugin="@plugin.Identifier" asp-route-version="@x.Version" asp-route-update="true" class="me-3">
|
||||||
<button type="submit" class="btn btn-outline-danger">Uninstall</button>
|
<button title="Schedule upgrade for when the dependencies have been met to ensure a smooth update" data-bs-toggle="tooltip" type="submit" class="btn btn-secondary">Schedule update</button>
|
||||||
</form>
|
</form>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</div>
|
@if (DependentOn(plugin.Identifier))
|
||||||
}
|
{
|
||||||
|
<button type="button" class="btn btn-outline-danger" data-bs-toggle="tooltip" title="This plugin cannot be uninstalled as it is depended on by other plugins.">Uninstall <span class="fa fa-exclamation"></span></button>
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
<form asp-action="UnInstallPlugin" asp-route-plugin="@plugin.Identifier">
|
||||||
|
<button type="submit" class="btn btn-outline-danger">Uninstall</button>
|
||||||
|
</form>
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue