Skip to content

Commit

Permalink
Added incremental id in history items (#142)
Browse files Browse the repository at this point in the history
* Added incremental id in history items

* Switches to basic counter for incremental_id

---------

Co-authored-by: M Starch <[email protected]>
  • Loading branch information
SMorettini and LeStarch authored Oct 24, 2023
1 parent 7c018ce commit c9ac315
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/fprime_gds/flask/static/js/datastore.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ class HistoryHelper {
this.active_key = active_key;
this.consumers = [];
this.active_timeout = null;
this.counter = 0;
}

/**
Expand Down Expand Up @@ -58,7 +59,8 @@ class HistoryHelper {
// Break our when no new items returned
if (new_items.length === 0) { return; }
new_items.filter((item) => item.time).forEach((item) => {
item.datetime = timeToDate(item.time)
item.datetime = timeToDate(item.time);
item.incremental_id = this.counter++;
});
this.consumers.forEach((consumer) => {
try {
Expand Down
2 changes: 1 addition & 1 deletion src/fprime_gds/flask/static/js/vue-support/event.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ Vue.component("event-list", {
* @return {string} unique key
*/
keyify(item) {
return "evt-" + item.id + "-" + item.time.seconds + "-"+ item.time.microseconds;
return "evt-" + item.id + "-" + item.time.seconds + "-"+ item.time.microseconds + "-" + item.incremental_id;
},
/**
* A function to clear events out of the data store. This is to reset the events entirely.
Expand Down

0 comments on commit c9ac315

Please sign in to comment.