feat: Bot management improvements with wallet configuration and duplicate detection
This commit is contained in:
@@ -49,6 +49,63 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card mb-3">
|
||||
<div class="card-header">
|
||||
<h5 class="mb-0">💰 Payment Wallets</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<p class="text-muted">Configure cryptocurrency wallet addresses for direct payments. These are used as fallback when payment gateway is unavailable.</p>
|
||||
@{
|
||||
var wallets = new Dictionary<string, string>();
|
||||
try
|
||||
{
|
||||
var settings = System.Text.Json.JsonSerializer.Deserialize<Dictionary<string, System.Text.Json.JsonElement>>(@settingsJson);
|
||||
if (settings != null && settings.ContainsKey("wallets"))
|
||||
{
|
||||
wallets = System.Text.Json.JsonSerializer.Deserialize<Dictionary<string, string>>(settings["wallets"].GetRawText()) ?? new Dictionary<string, string>();
|
||||
}
|
||||
}
|
||||
catch { }
|
||||
|
||||
var supportedCurrencies = new[] {
|
||||
new { Code = "BTC", Name = "Bitcoin", Placeholder = "bc1q... or 1... or 3..." },
|
||||
new { Code = "XMR", Name = "Monero", Placeholder = "4... (primary address)" },
|
||||
new { Code = "LTC", Name = "Litecoin", Placeholder = "ltc1q... or L... or M..." },
|
||||
new { Code = "DOGE", Name = "Dogecoin", Placeholder = "D..." },
|
||||
new { Code = "ETH", Name = "Ethereum", Placeholder = "0x..." },
|
||||
new { Code = "ZEC", Name = "Zcash", Placeholder = "t1... or zs1..." },
|
||||
new { Code = "DASH", Name = "Dash", Placeholder = "X..." }
|
||||
};
|
||||
}
|
||||
|
||||
<form asp-action="UpdateWallets" asp-route-id="@Model.Id" method="post" id="walletsForm">
|
||||
@Html.AntiForgeryToken()
|
||||
@foreach (var currency in supportedCurrencies)
|
||||
{
|
||||
<div class="mb-3">
|
||||
<label for="wallet_@currency.Code" class="form-label">
|
||||
<strong>@currency.Code</strong> - @currency.Name
|
||||
</label>
|
||||
<input type="text"
|
||||
name="wallets[@currency.Code]"
|
||||
id="wallet_@currency.Code"
|
||||
class="form-control font-monospace"
|
||||
placeholder="@currency.Placeholder"
|
||||
value="@(wallets.ContainsKey(currency.Code) ? wallets[currency.Code] : "")" />
|
||||
</div>
|
||||
}
|
||||
|
||||
<div class="alert alert-info">
|
||||
<strong>Note:</strong> Only configured wallets will be available as payment options. Leave blank to disable direct payments for that cryptocurrency.
|
||||
</div>
|
||||
|
||||
<button type="submit" class="btn btn-primary w-100">
|
||||
<i class="bi bi-wallet2"></i> Save Wallet Addresses
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h5 class="mb-0">Bot Configuration (JSON)</h5>
|
||||
|
||||
Reference in New Issue
Block a user