MCPcopy Create free account
hub / github.com/elastic/devfiler / update

Method update

src/ui/tabs/log.rs:31–77  ·  view source on GitHub ↗
(
        &mut self,
        ui: &mut Ui,
        _cfg: &DevfilerConfig,
        _kind: SampleKind,
        _start: UtcTimestamp,
        _end: UtcTimestamp,
    )

Source from the content-addressed store, hash-verified

29 }
30
31 fn update(
32 &mut self,
33 ui: &mut Ui,
34 _cfg: &DevfilerConfig,
35 _kind: SampleKind,
36 _start: UtcTimestamp,
37 _end: UtcTimestamp,
38 ) -> Option<TabAction> {
39 let table = TableBuilder::new(ui)
40 .striped(true)
41 .resizable(true)
42 .cell_layout(Layout::left_to_right(Align::Center))
43 .column(Column::auto())
44 .column(Column::auto())
45 .column(Column::auto())
46 .column(Column::remainder().clip(true))
47 .max_scroll_height(f32::INFINITY);
48
49 let messages = crate::log::tail(1000);
50
51 table
52 .header(20.0, |mut header| {
53 for text in ["Time", "Level", "Source", "Message"] {
54 header.col(|ui| {
55 ui.strong(text);
56 });
57 }
58 })
59 .body(|body| {
60 body.rows(20.0, messages.len(), |mut row| {
61 let msg = &messages[row.index()];
62 row.col(|ui| {
63 ui.label(msg.time.to_string());
64 });
65 row.col(|ui| {
66 ui.label(msg.level.to_string());
67 });
68 row.col(|ui| {
69 ui.label(msg.target.to_string());
70 });
71 row.col(|ui| {
72 ui.label(msg.message.to_string());
73 });
74 })
75 });
76 None
77 }
78
79 fn show_tab_selector(&self, _cfg: &DevfilerConfig) -> bool {
80 true

Callers

nothing calls this directly

Calls 1

tailFunction · 0.85

Tested by

no test coverage detected