fix: usdt input min validasyonu
This commit is contained in:
parent
f288eee5af
commit
43562be810
1 changed files with 6 additions and 1 deletions
|
|
@ -258,7 +258,9 @@ async function loadSymbols() {
|
||||||
onChange(value) {
|
onChange(value) {
|
||||||
const item = allSymbols.find(s => s.symbol === value);
|
const item = allSymbols.find(s => s.symbol === value);
|
||||||
if (!item) return;
|
if (!item) return;
|
||||||
document.getElementById('f-usdt').value = item.min_notional;
|
const usdtInput = document.getElementById('f-usdt');
|
||||||
|
usdtInput.value = item.min_notional;
|
||||||
|
usdtInput.min = item.min_notional;
|
||||||
document.getElementById('f-min-label').textContent = `(min ${item.min_notional} USDT)`;
|
document.getElementById('f-min-label').textContent = `(min ${item.min_notional} USDT)`;
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
@ -340,7 +342,10 @@ async function createBot() {
|
||||||
const usdt_amount = parseFloat(document.getElementById('f-usdt').value);
|
const usdt_amount = parseFloat(document.getElementById('f-usdt').value);
|
||||||
const profit_percent = parseFloat(document.getElementById('f-profit').value);
|
const profit_percent = parseFloat(document.getElementById('f-profit').value);
|
||||||
const testnet = document.getElementById('f-testnet').value === 'true';
|
const testnet = document.getElementById('f-testnet').value === 'true';
|
||||||
|
const usdtInput = document.getElementById('f-usdt');
|
||||||
|
const minNotional = parseFloat(usdtInput.min) || 0;
|
||||||
if (!name || !symbol || !usdt_amount || !profit_percent) { alert('Tüm alanları doldurun'); return; }
|
if (!name || !symbol || !usdt_amount || !profit_percent) { alert('Tüm alanları doldurun'); return; }
|
||||||
|
if (usdt_amount < minNotional) { alert(`Minimum işlem miktarı ${minNotional} USDT`); usdtInput.focus(); return; }
|
||||||
await api('POST', '/bots', { name, symbol, timeframe, usdt_amount, profit_percent, testnet });
|
await api('POST', '/bots', { name, symbol, timeframe, usdt_amount, profit_percent, testnet });
|
||||||
closeModal();
|
closeModal();
|
||||||
document.getElementById('f-name').value = '';
|
document.getElementById('f-name').value = '';
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue