Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 35 additions & 8 deletions IntelliTrader.Web/Views/Home/Dashboard.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -27,25 +27,27 @@
</div>
</div>

<!-- Дополнительные настройки звука -->
<!-- Дополнительные настройки звука и порогов уведоления -->
<div class="row align-items-center mt-2 pt-2" style="border-top: 1px solid var(--card-border); font-size: 13px;">
<div class="col-md-5 d-flex align-items-center mb-2 mb-md-0">
<div class="col-md-4 d-flex align-items-center mb-2 mb-md-0">
<i class="fas fa-sliders-h mr-2" style="color: #7aa2f7;"></i>
<span class="mr-2" style="white-space: nowrap;">Громкость:</span>
<input type="range" id="soundVolumeSlider" min="0" max="1" step="0.05" value="0.5" style="flex-grow: 1; height: 4px; background: var(--bg-color); outline: none; transition: background 450ms ease-in-out; -webkit-appearance: none; cursor: pointer;" />
<span id="soundVolumeValue" class="ml-2" style="font-weight: bold; color: #7aa2f7; min-width: 40px; text-align: right;">50%</span>
</div>
<div class="col-md-5 d-flex align-items-center mb-2 mb-md-0">
<div class="col-md-4 d-flex align-items-center mb-2 mb-md-0">
<i class="fas fa-music mr-2" style="color: #bb9af3;"></i>
<span class="mr-2" style="white-space: nowrap;">Профиль звука:</span>
<span class="mr-2" style="white-space: nowrap;">Профиль:</span>
<select id="soundProfileSelect" class="form-control form-control-sm" style="background-color: var(--input-bg); color: var(--text-color); border: 1px solid var(--input-border); border-radius: 4px; height: 28px; padding: 2px 8px; font-size: 12px; width: auto;">
<option value="chime">Приятный звон (Chime)</option>
<option value="beep">Высокий писк (Beep)</option>
<option value="arcade">Ретро аркада (Arcade)</option>
</select>
</div>
<div class="col-md-2 text-md-right text-muted" style="font-size: 11px;">
Настройки звука
<div class="col-md-4 d-flex align-items-center mb-2 mb-md-0">
<i class="fas fa-dollar-sign mr-2" style="color: #e0af68;"></i>
<span class="mr-2" style="white-space: nowrap;">Мин. порог (USDT):</span>
<input type="number" id="minTradeSizeInput" min="0" step="1" value="0" placeholder="0" class="form-control form-control-sm" style="background-color: var(--input-bg); color: var(--text-color); border: 1px solid var(--input-border); border-radius: 4px; height: 28px; padding: 2px 8px; font-size: 12px; width: 90px;" />
</div>
</div>
</div>
Expand All @@ -59,10 +61,32 @@
const soundVolumeSlider = document.getElementById("soundVolumeSlider");
const soundVolumeValue = document.getElementById("soundVolumeValue");
const soundProfileSelect = document.getElementById("soundProfileSelect");
const minTradeSizeInput = document.getElementById("minTradeSizeInput");
const notificationContainer = document.getElementById("notificationContainer");

let isSoundEnabled = localStorage.getItem("realtime_sound_enabled") !== "false";

// Load minimum trade size with fallback to 0
let minTradeSizeThreshold = parseFloat(localStorage.getItem("realtime_min_trade_size")) || 0;
if (minTradeSizeInput) {
minTradeSizeInput.value = minTradeSizeThreshold;
minTradeSizeInput.addEventListener("input", function() {
let val = parseFloat(minTradeSizeInput.value) || 0;
if (val < 0) val = 0;
minTradeSizeThreshold = val;
localStorage.setItem("realtime_min_trade_size", val);
const event = new CustomEvent("minTradeSizeChanged", { detail: { minTradeSize: val } });
document.dispatchEvent(event);
});

document.addEventListener("minTradeSizeChanged", function(e) {
if (minTradeSizeInput && parseFloat(minTradeSizeInput.value) !== e.detail.minTradeSize) {
minTradeSizeInput.value = e.detail.minTradeSize;
minTradeSizeThreshold = e.detail.minTradeSize;
}
});
}

// Load volume with fallback to 0.5
let soundVolume = localStorage.getItem("realtime_sound_volume");
if (soundVolume === null) {
Expand Down Expand Up @@ -332,8 +356,11 @@
knownTrades.add(tradeId);

if (!isFirstLoad) {
hasNewTrade = true;
showToastNotification(trade);
const tradeCostUsdt = (parseFloat(trade.Amount) || 0) * (parseFloat(trade.SellPrice) || 0);
if (tradeCostUsdt >= minTradeSizeThreshold) {
hasNewTrade = true;
showToastNotification(trade);
}
}
}
});
Expand Down
26 changes: 25 additions & 1 deletion IntelliTrader.Web/Views/Home/Settings.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,19 @@
<button class="btn btn-info settings-btn" onclick="restartServices();" @if (Model.ReadOnlyMode) { <text>disabled</text> }>Restart Services</button>

<div class="configs mt-4" style="background-color: var(--card-bg) !important; border: 1px solid var(--border-color) !important; color: var(--text-color) !important; padding: 20px; border-radius: 4px; margin-top: 20px;">
<h2>Оформление</h2>
<h2>Оформление и уведомления</h2>
<div style="margin-bottom: 15px; display: flex; align-items: center;">
<label style="margin-right: 15px; margin-bottom: 0; font-weight: bold;">Тема оформления:</label>
<select id="settingsThemeSelect" class="form-control form-control-sm" style="width: auto; background-color: var(--input-bg); color: var(--text-color); border: 1px solid var(--input-border); border-radius: 4px;">
<option value="dark">Темная (по умолчанию)</option>
<option value="light">Светлая</option>
</select>
</div>
<div style="margin-bottom: 15px; display: flex; align-items: center;">
<label style="margin-right: 15px; margin-bottom: 0; font-weight: bold;" for="settingsMinTradeSizeInput">Мин. порог сделки для уведомлений (USDT):</label>
<input type="number" id="settingsMinTradeSizeInput" min="0" step="1" value="0" class="form-control form-control-sm" style="width: 110px; background-color: var(--input-bg); color: var(--text-color); border: 1px solid var(--input-border); border-radius: 4px;" />
<span style="font-size: 12px; color: #7aa2f7; margin-left: 10px;">(0 = уведомления для всех сделок)</span>
</div>
</div>

<script>
Expand Down Expand Up @@ -87,6 +92,25 @@
}
});
}

const minTradeInput = document.getElementById("settingsMinTradeSizeInput");
if (minTradeInput) {
let currentMinTrade = localStorage.getItem("realtime_min_trade_size") || "0";
minTradeInput.value = currentMinTrade;
minTradeInput.addEventListener("input", function() {
let val = parseFloat(minTradeInput.value) || 0;
if (val < 0) val = 0;
localStorage.setItem("realtime_min_trade_size", val);
const event = new CustomEvent("minTradeSizeChanged", { detail: { minTradeSize: val } });
document.dispatchEvent(event);
});

document.addEventListener("minTradeSizeChanged", function(e) {
if (minTradeInput && parseFloat(minTradeInput.value) !== e.detail.minTradeSize) {
minTradeInput.value = e.detail.minTradeSize;
}
});
}
});
</script>

Expand Down
33 changes: 32 additions & 1 deletion magda_agent_system/agent_tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@
},
{
"id": "web-dashboard-custom-alerts",
"status": "todo",
"status": "done",
"area": "web",
"risk": "low",
"title": "Add custom notification threshold settings on Dashboard",
Expand All @@ -473,6 +473,37 @@
"acceptance": [
"Order caching mechanism is integrated and avoids frequent disk reads for historical trade logs."
]
},
{
"id": "web-dashboard-export-csv-trades",
"status": "todo",
"area": "web",
"risk": "low",
"title": "Add CSV export button for trade logs on Web Dashboard",
"description": "Add an export button on the trades view in the Web Dashboard allowing users to download historical trades in standard CSV format.",
"allowed_paths": [
"IntelliTrader.Web/Controllers/**",
"IntelliTrader.Web/Views/**",
"magda_agent_system/agent_tasks.json"
],
"acceptance": [
"Web Dashboard includes a CSV export action for completed trade records."
]
},
{
"id": "trading-signal-filter-enhancement",
"status": "todo",
"area": "trading",
"risk": "low",
"title": "Enhance signal rule evaluators with volume spike filters",
"description": "Add optional volume spike threshold evaluation in signal rules to prevent buy signals on low volume fakeouts.",
"allowed_paths": [
"IntelliTrader.Rules/Services/**",
"magda_agent_system/agent_tasks.json"
],
"acceptance": [
"ConditionEvaluators supports volume condition filtering in signal rules."
]
}
]
}