2020-10-21 09:53:05 +02:00
@using BTCPayServer.Services
2020-11-02 21:53:49 -08:00
@using BTCPayServer.Services.Mails;
2020-10-05 04:26:11 -05:00
@model BTCPayServer.Services.PoliciesSettings
2021-02-23 10:39:26 +01:00
@inject SettingsRepository _SettingsRepository
2017-09-27 14:18:09 +09:00
@{
2021-12-16 11:17:02 +01:00
ViewData.SetActivePage(ServerNavPages.Policies);
2017-09-27 14:18:09 +09:00
}
2022-01-17 17:19:27 -08:00
<h3 class="mb-4">@ViewData["Title"]</h3>
2021-02-23 10:39:26 +01:00
@if (!ViewContext.ModelState.IsValid)
2019-06-06 18:54:51 +09:00
{
2019-06-25 20:41:32 +02:00
<div asp-validation-summary="All" class="text-danger"></div>
2019-06-06 18:54:51 +09:00
}
2019-06-25 20:41:32 +02:00
<form method="post">
2021-04-08 15:32:42 +02:00
<div class="form-group mb-5">
<h4 class="mb-3">Existing User Settings</h4>
2022-04-13 21:09:37 -07:00
<div class="form-check my-3">
2021-02-23 10:39:26 +01:00
<input asp-for="AllowLightningInternalNodeForAll" type="checkbox" class="form-check-input"/>
<label asp-for="AllowLightningInternalNodeForAll" class="form-check-label"></label>
2021-10-04 13:42:31 +02:00
<a href="https://docs.btcpayserver.org/FAQ/LightningNetwork/#how-many-users-can-use-lightning-network-in-btcpay" target="_blank" rel="noreferrer noopener">
2021-04-08 15:32:42 +02:00
<span class="fa fa-question-circle-o text-secondary" title="More information..."></span>
</a>
2021-02-23 10:39:26 +01:00
<span asp-validation-for="AllowLightningInternalNodeForAll" class="text-danger"></span>
</div>
2022-04-13 21:09:37 -07:00
<div class="form-check my-3">
2021-02-23 10:39:26 +01:00
<input asp-for="AllowHotWalletForAll" type="checkbox" class="form-check-input"/>
<label asp-for="AllowHotWalletForAll" class="form-check-label"></label>
2021-07-06 10:35:42 +02:00
<a href="https://docs.btcpayserver.org/CreateWallet/#requirements-to-create-wallets" target="_blank" rel="noreferrer noopener">
2021-04-08 15:32:42 +02:00
<span class="fa fa-question-circle-o text-secondary" title="More information..."></span>
</a>
2021-02-23 10:39:26 +01:00
<span asp-validation-for="AllowHotWalletForAll" class="text-danger"></span>
</div>
2022-04-13 21:09:37 -07:00
<div class="form-check my-3">
2021-02-23 10:39:26 +01:00
<input asp-for="AllowHotWalletRPCImportForAll" type="checkbox" class="form-check-input"/>
<label asp-for="AllowHotWalletRPCImportForAll" class="form-check-label"></label>
<span asp-validation-for="AllowHotWalletRPCImportForAll" class="text-danger"></span>
</div>
</div>
2021-04-08 15:32:42 +02:00
<div class="form-group mb-5">
<h4 class="mb-3">New User Settings</h4>
2022-04-13 21:09:37 -07:00
<div class="form-check my-3">
2020-11-02 21:53:49 -08:00
@{
var emailSettings = (await _SettingsRepository.GetSettingAsync<EmailSettings>()) ?? new EmailSettings();
2021-02-23 10:39:26 +01:00
/* The "|| Model.RequiresConfirmedEmail" check is for the case when a user had checked
the checkbox without first configuring the e-mail settings so that they can uncheck it. */
2020-11-02 21:53:49 -08:00
var isEmailConfigured = emailSettings.IsComplete() || Model.RequiresConfirmedEmail;
}
2021-02-23 10:39:26 +01:00
<input asp-for="RequiresConfirmedEmail" type="checkbox" class="form-check-input" disabled="@(isEmailConfigured ? null : "disabled")"/>
2019-10-13 20:07:41 -07:00
<label asp-for="RequiresConfirmedEmail" class="form-check-label"></label>
2021-10-04 13:42:31 +02:00
<a href="https://docs.btcpayserver.org/FAQ/ServerSettings/#how-to-allow-registration-on-my-btcpay-server" target="_blank" rel="noreferrer noopener">
2021-04-08 15:32:42 +02:00
<span class="fa fa-question-circle-o text-secondary" title="More information..."></span>
</a>
2019-10-13 20:07:41 -07:00
<span asp-validation-for="RequiresConfirmedEmail" class="text-danger"></span>
2021-02-23 10:39:26 +01:00
@if (!isEmailConfigured)
{
<div class="mb-2">
2022-01-07 12:32:00 +09:00
<span class="text-secondary">Your email server has not been configured. <a asp-controller="UIServer" asp-action="Emails">Please configure it first.</a></span>
2020-11-02 21:53:49 -08:00
</div>
}
2019-10-13 20:07:41 -07:00
</div>
2022-04-13 21:09:37 -07:00
<div class="form-check my-3">
2019-10-13 20:07:41 -07:00
<input asp-for="LockSubscription" type="checkbox" class="form-check-input"/>
<label asp-for="LockSubscription" class="form-check-label"></label>
<span asp-validation-for="LockSubscription" class="text-danger"></span>
</div>
2021-02-23 10:39:26 +01:00
2022-04-13 21:09:37 -07:00
<div class="form-check my-3">
2021-02-23 10:39:26 +01:00
<input asp-for="DisableNonAdminCreateUserApi" type="checkbox" class="form-check-input"/>
<label asp-for="DisableNonAdminCreateUserApi" class="form-check-label"></label>
<span asp-validation-for="DisableNonAdminCreateUserApi" class="text-danger"></span>
2020-10-20 13:09:09 +02:00
</div>
2021-02-23 10:39:26 +01:00
</div>
2021-04-08 15:32:42 +02:00
<div class="form-group mb-5">
<h4 class="mb-3">Notification Settings</h4>
2022-04-13 21:09:37 -07:00
<div class="form-check my-3">
2020-10-20 13:09:09 +02:00
<input asp-for="DisableInstantNotifications" type="checkbox" class="form-check-input"/>
<label asp-for="DisableInstantNotifications" class="form-check-label"></label>
2021-07-06 10:35:42 +02:00
<a href="https://docs.btcpayserver.org/Notifications/#notifications" target="_blank" rel="noreferrer noopener">
2021-04-08 15:32:42 +02:00
<span class="fa fa-question-circle-o text-secondary" title="More information..."></span>
</a>
2020-10-20 13:09:09 +02:00
<span asp-validation-for="DisableInstantNotifications" class="text-danger"></span>
2020-04-13 08:48:35 +02:00
</div>
2022-04-13 21:09:37 -07:00
<div class="form-check my-3">
2020-12-04 08:08:05 +01:00
<input asp-for="DisableStoresToUseServerEmailSettings" type="checkbox" class="form-check-input"/>
<label asp-for="DisableStoresToUseServerEmailSettings" class="form-check-label"></label>
2021-07-06 10:35:42 +02:00
<a href="https://docs.btcpayserver.org/Notifications/#server-emails" target="_blank" rel="noreferrer noopener">
2021-04-08 15:32:42 +02:00
<span class="fa fa-question-circle-o text-secondary" title="More information..."></span>
</a>
2020-12-04 08:08:05 +01:00
<span asp-validation-for="DisableStoresToUseServerEmailSettings" class="text-danger"></span>
</div>
2021-02-23 10:39:26 +01:00
</div>
2021-04-08 15:32:42 +02:00
<div class="form-group mb-5">
<h4 class="mb-3">Maintenance Settings</h4>
2020-10-05 04:26:11 -05:00
@if (ViewBag.UpdateUrlPresent)
{
2022-04-13 21:09:37 -07:00
<div class="form-check my-3">
2020-10-21 09:53:05 +02:00
<input asp-for="CheckForNewVersions" type="checkbox" class="form-check-input"/>
<label asp-for="CheckForNewVersions" class="form-check-label"></label>
<span asp-validation-for="CheckForNewVersions" class="text-danger"></span>
</div>
2020-10-05 04:26:11 -05:00
}
2022-04-13 21:09:37 -07:00
<div class="form-check my-3">
2021-02-23 10:39:26 +01:00
<input asp-for="DiscourageSearchEngines" type="checkbox" class="form-check-input"/>
<label asp-for="DiscourageSearchEngines" class="form-check-label"></label>
2021-10-04 13:42:31 +02:00
<a href="https://docs.btcpayserver.org/FAQ/ServerSettings/#how-to-hide-my-btcpay-server-from-search-engines" target="_blank" rel="noreferrer noopener">
2021-04-08 15:32:42 +02:00
<span class="fa fa-question-circle-o text-secondary" title="More information..."></span>
</a>
2021-02-23 10:39:26 +01:00
<span asp-validation-for="DiscourageSearchEngines" class="text-danger"></span>
</div>
2019-08-20 17:00:50 +02:00
</div>
2021-02-23 10:39:26 +01:00
2021-04-08 15:32:42 +02:00
<h4 class="mb-3">Customization Settings</h4>
2021-02-23 10:39:26 +01:00
2019-06-25 20:41:32 +02:00
<div class="form-group">
2021-05-19 04:39:27 +02:00
<label asp-for="RootAppId" class="form-label"></label>
<select asp-for="RootAppId" asp-items="@(new SelectList(ViewBag.AppsList, nameof(SelectListItem.Value), nameof(SelectListItem.Text), Model.RootAppId))" class="form-select w-auto"></select>
2019-06-25 20:41:32 +02:00
@if (!Model.DomainToAppMapping.Any())
2020-10-21 09:53:05 +02:00
{
2022-02-07 21:18:22 +09:00
<button id="AddDomainButton" type="submit" name="command" value="add-domain" class="btn btn-link px-0">Map specific domains to specific apps</button>
2020-10-21 09:53:05 +02:00
}
2019-06-25 20:41:32 +02:00
</div>
@if (Model.DomainToAppMapping.Any())
{
2021-06-06 13:44:54 +02:00
<h5 class="mt-5 mb-0">
Domain to app mapping
2022-02-07 21:18:22 +09:00
<button id="AddDomainButton" type="submit" name="command" value="add-domain" class="btn btn-secondary btn-sm ms-2">Add domain mapping</button>
2021-06-06 13:44:54 +02:00
</h5>
<div class="list-group list-group-flush mb-2">
2019-06-25 20:41:32 +02:00
@for (var index = 0; index < Model.DomainToAppMapping.Count; index++)
{
2021-06-06 13:44:54 +02:00
<div class="list-group-item px-0 pt-3">
2019-06-25 20:41:32 +02:00
<div class="row">
2021-06-06 13:44:54 +02:00
<div class="col-12 col-lg-8">
2019-06-25 20:41:32 +02:00
<div class="form-group">
2021-05-19 04:39:27 +02:00
<label asp-for="DomainToAppMapping[index].Domain" class="form-label"></label>
2019-06-25 20:41:32 +02:00
<input asp-for="DomainToAppMapping[index].Domain" class="form-control"/>
<span asp-validation-for="DomainToAppMapping[index].Domain" class="text-danger"></span>
</div>
<div class="form-group">
2021-05-19 04:39:27 +02:00
<label asp-for="DomainToAppMapping[index].AppId" class="form-label"></label>
2019-06-25 20:41:32 +02:00
<select asp-for="DomainToAppMapping[index].AppId"
2020-10-21 09:53:05 +02:00
asp-items="@(new SelectList(ViewBag.AppsList, nameof(SelectListItem.Value), nameof(SelectListItem.Text), Model.DomainToAppMapping[index].AppId))"
2021-06-06 13:44:54 +02:00
class="form-select w-auto">
2019-06-25 20:41:32 +02:00
</select>
<span asp-validation-for="DomainToAppMapping[index].AppId" class="text-danger"></span>
</div>
</div>
2021-06-06 13:44:54 +02:00
<div class="col-12 col-lg-2 pull-right">
2019-06-25 20:41:32 +02:00
<button type="submit" title="Remove domain mapping" name="command" value="@($"remove-domain:{index}")"
2021-06-06 13:44:54 +02:00
class="d-block d-lg-none d-xl-none btn btn-danger mb-2">
2019-06-25 20:41:32 +02:00
Remove Destination
</button>
<button type="submit" title="Remove domain mapping" name="command" value="@($"remove-domain:{index}")"
2021-06-06 13:44:54 +02:00
class="d-none d-lg-block btn btn-outline-danger text-decoration-none h-100 align-middle border-0 fs-4">
<span class="fa fa-times"></span>
2019-06-25 20:41:32 +02:00
</button>
</div>
</div>
</div>
}
</div>
}
2020-10-21 09:53:05 +02:00
2021-05-19 04:39:27 +02:00
<button class="btn btn-link px-0" type="button" id="ExplorerLinksButton" data-bs-toggle="collapse" data-bs-target="#explorer-links" aria-expanded="false" aria-controls="explorer-links">
2021-02-23 10:39:26 +01:00
Override the block explorers used
</button>
<div class="mb-3">
2021-06-06 13:44:54 +02:00
<div class="collapse show collapse-on-js" id="explorer-links">
@inject BTCPayNetworkProvider BTCPayNetworkProvider
@{
var networks = BTCPayNetworkProvider.GetAll().ToArray();
}
2020-10-21 09:53:05 +02:00
2021-06-06 13:44:54 +02:00
@for (var i = 0; i < networks.Count(); i++)
{
var network = networks.ElementAt(i);
var existingOverride = Model.BlockExplorerLinks?.SingleOrDefault(tuple => tuple.CryptoCode.Equals(network.CryptoCode, StringComparison.InvariantCultureIgnoreCase));
var linkValue = existingOverride?.Link ?? network.BlockExplorerLinkDefault;
if (Model.BlockExplorerLinks.Count < i + 1)
2021-02-23 10:39:26 +01:00
{
2021-06-06 13:44:54 +02:00
Model.BlockExplorerLinks.Add(new PoliciesSettings.BlockExplorerOverrideItem() {CryptoCode = network.CryptoCode, Link = network.BlockExplorerLinkDefault});
2021-02-23 10:39:26 +01:00
}
2021-06-06 13:44:54 +02:00
<div class="form-group m-0 py-4">
<label class="form-label">@network.DisplayName (@network.CryptoCode)</label>
<input type="hidden" asp-for="BlockExplorerLinks[i].CryptoCode" value="@network.CryptoCode"/>
<div class="input-group">
2021-07-06 10:35:42 +02:00
<input type="text" class="form-control" asp-for="BlockExplorerLinks[i].Link" value="@linkValue" rel="noreferrer noopener" data-default-link="@network.BlockExplorerLinkDefault"/>
2021-06-06 13:44:54 +02:00
<button type="button" class="btn btn-secondary only-for-js" title="Revert to default">
<span class="fa fa-refresh"></span>
</button>
</div>
</div>
}
2021-02-23 10:39:26 +01:00
</div>
2020-10-21 09:53:05 +02:00
</div>
2021-02-23 10:39:26 +01:00
2022-02-07 21:18:22 +09:00
<button id="SaveButton" type="submit" class="btn btn-primary" name="command" value="Save">Save</button>
2019-06-25 20:41:32 +02:00
</form>
2017-09-27 14:18:09 +09:00
2021-05-19 04:39:27 +02:00
@section PageFootContent {
<script>
2020-10-21 09:53:05 +02:00
for (let element of document.getElementsByClassName("revert-default")) {
element.addEventListener("click", function (){
element.parentElement.previousElementSibling.value = element.parentElement.previousElementSibling.getAttribute("data-default-link")
});
}
for (let element of document.getElementsByClassName("collapse-on-js")){
if (element.classList.contains("show")){
element.classList.remove("show");
}
}
</script>
2017-10-27 17:53:04 +09:00
}