Add-on Directory

← Back

File viewer for Vaadin

Log viewer / glogg

Author

Rating

Popularity

300+

Log viewer/watcher glogg

This add-on works similarly to the popular log viewer software called glogg.

Enables:

  • Viewing huge files, especially logs, without performance or ram usage loss
  • Monitoring changes in displayed files and dynamically extending the content
  • File search
  • Dynamic extension of search results with changes in files (new entries)

Requires @Push enabled for stable and comfortable work

Each file is indexed before being displayed and only a part is streamed on demand (50 rows per request when scrolling). Files are not stored in memory.

Styling

Since the extension uses default vaadin components, all used components have been made available for modification via getters.

If you want to display the entire log line without text-wrapping, you need to extend your style file vaadin-grid.css about this entry:

:host([theme~='log']) [part~='cell']:not([part~='details-cell']) {
    white-space: break-spaces;
}

Additional configuration

  • You can disable/hide polling configuration and also search bar. To do that you have to pass configuration to the constructor of the FileViewer
    FileViewer viewer = new FileViewer(new FileViewerConfig(){

            @Override
            public boolean pollingEnabled() {
                return false;
            }

            @Override
            public int pollingInterval() {
                return 1;
            }

            @Override
            public boolean searchViewVisible() {
                return false;
            }
        });

Layout structure

|---------------------------------------------------------------|
|                FileViewer - VerticalLayout                    |
|  |---------------------------------------------------------|  |
|  |              PollingMenuBar  - MenuBar                  |  |
|  |---------------------------------------------------------|  |
|  |               FileTabSheet  - TabSheet                  |  |
|  |  |---------------------------------------------------|  |  |
|  |  |               FileTab  -  Div                     |  |  |
|  |  |  |---------------------------------------------|  |  |  |
|  |  |  |          FileContentGrid - Grid             |  |  |  |
|  |  |  |---------------------------------------------|  |  |  |
|  |  |  |      FileSearchLayout - VerticalLayout      |  |  |  |
|  |  |  |  |---------------------------------------|  |  |  |  |
|  |  |  |  |       SearchBarFields - MenuBar       |  |  |  |  |
|  |  |  |  |---------------------------------------|  |  |  |  |
|  |  |  |  |        SearchResultGrid - Grid        |  |  |  |  |
|  |  |  |  |---------------------------------------|  |  |  |  |
|  |  |  |                                             |  |  |  |
|  |  |  | --------------------------------------------|  |  |  |
|  |  |---------------------------------------------------|  |  |
|  |---------------------------------------------------------|  |
|---------------------------------------------------------------|

Sample code

FileViewer viewer = new FileViewer();

viewer.openFile(new File("...).toPath());
viewer.openFile(new File("...").toPath());

add(viewer);

Compatibility

(Loading compatibility data...)

Was this helpful? Need more help?
Leave a comment or a question below. You can also join the chat on Discord or ask questions on StackOverflow.

Version

  • Compilation for Vaadin24
  • Font resize allowed
  • Move to first/last line
Released
2024-02-18
Maturity
STABLE
License
Apache License 2.0

Compatibility

Framework
Vaadin 24.1+
Vaadin 23+ in 1.0.0
Browser
N/A

EnhancedDateTimePicker - Vaadin Add-on Directory

DateTimePicker with ability to format by pattern EnhancedDateTimePicker - Vaadin Add-on Directory
This component is based on [DateTimePicker component for Vaadin Flow](https://github.com/vaadin/vaadin-date-time-picker-flow) and also in [EnhancedDatePicker component](https://github.com/vaadin-component-factory/enhanced-date-picker). The idea of the EnhancedDateTimePicker component is the possibility of adding format and parse patterns for both date & time parts of a DateTimePicker. Date part uses EnhancedDatePicker component and time part is using an extension of [TimePicker component for Vaadin Flow](https://github.com/vaadin/vaadin-time-picker-flow) that adds an API for setting formatting and parsing patterns. As in EnhancedDatePicker, the formatting for the time part is done by JavaScript library [date-fns v2.0.0-beta.2](https://date-fns.org/v2.0.0-beta.2/docs/Getting-Started). More information about supported formatting paterns can be found here: https://date-fns.org/v2.0.0-beta.2/docs/format. Main methods: - to set a formatting pattern for date part EnhancedDateTimePicker#setDatePattern(String) - to set a formatting pattern for time part EnhancedDateTimePicker#setTimePattern(String) - to set a parsing patterns for date part EnhancedDateTimePicker#setDateParsers(String ...) - to set a parsing patterns for time part EnhancedDateTimePicker#setTimeParsers(String ...) For complete examples on EnhancedDateTimePicker see the demo class EnhancedDateTimePickerDemoView. Find the link to the repository in the Links section.
Online Demo
View on GitHub

EnhancedDateTimePicker version 1.0.1
Fixed group name.

EnhancedDateTimePicker version 2.0.1
Support for Vaadin20+

EnhancedDateTimePicker version 1.0.2
### Bugfixes * Prevent duplicate value changed events from EnhancedDateTimePicker.setValue (see https://github.com/vaadin/flow-components/issues/1986)

EnhancedDateTimePicker version 2.0.2
### Bugfixes * Prevent duplicate value changed events from EnhancedDateTimePicker.setValue (see https://github.com/vaadin/flow-components/issues/1986)

EnhancedDateTimePicker version 2.0.3
Bugfixes: * Last published version didn't include resources (Fixes [#8](https://github.com/vaadin-component-factory/enhanced-date-time-picker/issues/8))

EnhancedDateTimePicker version 2.0.4
### Bug Fixes: * Fix time issue in V23+ (fixes [#9](https://github.com/vaadin-component-factory/enhanced-date-time-picker/issues/9))

Online