Skip to content

Commit efbf0b3

Browse files
committed
feat(cc-logs-app-runtime): handle cc-logs-clear event to clear displayed logs
Wires the clear button (added in e04781b) to the app-runtime smart controller so users can drop the currently displayed logs without interrupting the live stream. Resets the visible log tracking alongside the component clear so overflow detection stays accurate.
1 parent 740ef7d commit efbf0b3

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

src/components/cc-logs-app-runtime/cc-logs-app-runtime.smart.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,10 @@ defineSmartComponent({
6262
controller.setNewInstanceSelection(instances);
6363
});
6464

65+
onEvent('cc-logs-clear', () => {
66+
controller.clearVisibleLogs();
67+
});
68+
6569
onEvent('cc-logs-loading-pause', () => {
6670
controller.pause();
6771
});
@@ -218,6 +222,11 @@ class SmartController extends LogsStream {
218222
this._updateState({ type: 'loadingInstances' });
219223
}
220224

225+
clearVisibleLogs() {
226+
this.resetVisible();
227+
this._component.clear();
228+
}
229+
221230
/**
222231
* @param {DateRange} dateRange
223232
* @param {Array<string>} selection

0 commit comments

Comments
 (0)