batch header row symbol added

This commit is contained in:
David Brazda
2023-11-30 14:55:05 +01:00
parent d06faa4c9b
commit 116700f3e4
3 changed files with 15 additions and 4 deletions

View File

@ -57,7 +57,7 @@
<!-- <script src="https://code.jquery.com/jquery-3.5.1.js"></script> -->
<link rel="stylesheet" href="/static/main.css?v=1.05">
<link rel="stylesheet" href="/static/main.css?v=1.06">
<!-- <script src="https://cdnjs.cloudflare.com/ajax/libs/mousetrap/1.4.6/mousetrap.min.js"></script> -->
<script src="/static/js/libs/mousetrap.min.js"></script>
@ -866,7 +866,7 @@
<!-- <script src="/static/js/archivetables.js?v=1.05"></script> -->
<!-- archiveTables split into separate files -->
<script src="/static/js/tables/archivetable/init.js?v=1.05"></script>
<script src="/static/js/tables/archivetable/init.js?v=1.06"></script>
<script src="/static/js/tables/archivetable/functions.js?v=1.05"></script>
<script src="/static/js/tables/archivetable/modals.js?v=1.05"></script>
<script src="/static/js/tables/archivetable/handlers.js?v=1.05"></script>

View File

@ -256,6 +256,7 @@ function initialize_archiveRecords() {
var profit = '';
var started = null;
var stratinId = null;
var symbol = null;
// // Process each item only once
// archiveRecords.rows({ search: 'applied' }).every(function (rowIdx, tableLoop, rowLoop) {
@ -290,7 +291,8 @@ function initialize_archiveRecords() {
period = firstRowData.note ? firstRowData.note.substring(0, 14) : '';
started = firstRowData.started
stratinId = firstRowData.strat_id
var newBatchHeader = {batch_id:group, profit:profit, itemCount:itemCount, period:period, started:started, stratinId:stratinId}
symbol = firstRowData.symbol
var newBatchHeader = {batch_id:group, profit:profit, itemCount:itemCount, period:period, started:started, stratinId:stratinId, symbol:symbol};
batchHeaders.push(newBatchHeader)
}
//uz je v poli, ale mame novejsi (pribyl v ramci backtestu napr.) - updatujeme
@ -300,6 +302,7 @@ function initialize_archiveRecords() {
period = firstRowData.note ? firstRowData.note.substring(0, 14) : '';
started = firstRowData.started
stratinId = firstRowData.id
symbol = firstRowData.symbol
existingBatch.itemCount = itemCount;
existingBatch.profit = profit;
existingBatch.period = period;
@ -312,6 +315,7 @@ function initialize_archiveRecords() {
period = existingBatch.period
started = existingBatch.started
stratinId = existingBatch.stratinId
symbol = existingBatch.symbol
}
}
@ -350,7 +354,7 @@ function initialize_archiveRecords() {
//console.log(group, groupId, stratinId)
//var groupHeaderContent = '<span class="batchheader-batch-id">'+(group ? '<span class="color-tag" style="background-color:' + getColorForId(stratinId) + ';"></span>Batch ID: ' + group: 'No Batch')+'</span>';
var groupHeaderContent = '<span class="batchheader-batch-id">'+ icon + (group ? 'Batch ID: ' + group: 'No Batch')+'</span>';
groupHeaderContent += (group ? ' <span class="batchheader-count-info">(' + itemCount + ')</span>' + ' <span class="batchheader-period-info">' + period + '</span> <span class="batchheader-profit-info" style="color:'+profit_icon_color+'">Profit: ' + profit + '</span>' : '');
groupHeaderContent += (group ? '<span class="batchheader-symbol-info" style="color:'+icon_color+'">' + symbol + '</span><span class="batchheader-count-info">(' + itemCount + ')</span>' + ' <span class="batchheader-period-info">' + period + '</span> <span class="batchheader-profit-info" style="color:'+profit_icon_color+'">Profit: ' + profit + '</span>' : '');
groupHeaderContent += group ? tools : ""
return $('<tr/>')
.append('<td colspan="18">' + groupHeaderContent + '</td>')

View File

@ -377,6 +377,13 @@ table.dataTable thead>tr>th.sorting_asc:before, table.dataTable thead>tr>th.sort
/* font-weight: bold; */
}
.group-header .batchheader-symbol-info {
font-weight: 600;
vertical-align: super;
margin-left: 2px;
margin-right: 2px;
}
.group-header .batchheader-batch-id {
color: #a1a1a1; /* Highlight period info */
font-weight: 400;