This commit is contained in:
Dobromir Popov
2025-10-24 23:35:45 +03:00
parent 86a579bea9
commit c28ee2c432
4 changed files with 86 additions and 72 deletions

View File

@@ -59,10 +59,11 @@
{% block extra_js %}
<script>
// Initialize application state
// IMPORTANT!!! DO NOT CHANGE {{ x }} to { { x } }
window.appState = {
currentSymbol: '{{ current_symbol }}',
currentTimeframes: {{ timeframes | tojson }},
// IMPORTANT!!! DO NOT CHANGE {{ annotations | tojson }} to { { annotations | tojson } }
annotations: {{ annotations | tojson }},
pendingAnnotation: null,
chartManager: null,
@@ -98,7 +99,7 @@
function loadInitialData() {
console.log('Loading initial chart data...');
// Fetch initial chart data with 2000 candles for training
// Fetch initial chart data with 2500 candles for training
fetch('/api/chart-data', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
@@ -107,7 +108,7 @@
timeframes: appState.currentTimeframes,
start_time: null,
end_time: null,
limit: 2000 // Load 2000 candles initially for training
limit: 2500 // Load 2500 candles initially for training
})
})
.then(response => {
@@ -453,25 +454,6 @@
console.error('✗ window.deleteAnnotation is NOT a function!');
}
// Add a test button to verify functionality (temporary)
console.log('Adding test delete function to window for debugging...');
window.testDeleteFunction = function () {
console.log('Test delete function called');
console.log('window.deleteAnnotation type:', typeof window.deleteAnnotation);
if (typeof window.deleteAnnotation === 'function') {
console.log('window.deleteAnnotation is available');
// Test with a fake ID to see if the function runs
console.log('Testing delete function with fake ID...');
try {
window.deleteAnnotation('test-fake-id');
} catch (error) {
console.error('Error in test delete:', error);
}
} else {
console.error('window.deleteAnnotation is NOT available');
}
};
// Add test button to page (temporary debugging)
const testButton = document.createElement('button');
testButton.textContent = 'Test Delete Function';