orhun / systeroid Goto Github PK
View Code? Open in Web Editor NEWA more powerful alternative to sysctl(8) with a terminal user interface ๐ง
Home Page: https://systeroid.cli.rs
License: Apache License 2.0
A more powerful alternative to sysctl(8) with a terminal user interface ๐ง
Home Page: https://systeroid.cli.rs
License: Apache License 2.0
Is your feature request related to a problem? Please describe.
When an unexpected error happens, the terminal is messed up.
Describe the solution you'd like
Add a custom panic hook. See: ratatui-org/templates#13
The code changes on this PR will add a panic hook, so if a problem happens and the program panics, before the program closes it will run the code inside the panic hook that will leave alternate screen and disable raw mode. This way, you won't have your terminal messed up if an unexpected error happens.
Describe alternatives you've considered
None.
Additional context
The implementation might be the same as the linked pull request above.
Is your feature request related to a problem? Please describe.
Right now the default background color of systeroid-tui
is black which is not great when it comes to different color schemes.
Describe the solution you'd like
Make transparent background as default - i.e. do not set a color (aka reset
)
The default behavior should be the same as:
$ systeroid-tui --bg-color reset
One thing to note is this is a style-wise breaking change and potentially should be noted in README.md.
Describe alternatives you've considered
None.
Additional context
See #153
Is your feature request related to a problem? Please describe.
According to sysctl.d(5), following configuration entry should be supported:
key.pattern.*.with.glob = whatever
Describe the solution you'd like
Implement the functionality with using the globwalk
or regex
crate.
Describe alternatives you've considered
-
Additional context
In my tests, sysctl
does not work properly as well while preloading the following configuration:
# contents of sysctl.conf
net.ipv4.conf.*.rp_filter = 2
$ sysctl -p sysctl.conf
sysctl: cannot stat /proc/sys/net/ipv4/conf/*/rp_filter: No such file or directory
$ systeroid -p sysctl.conf
systeroid: cannot stat /proc/sys/net/ipv4/conf/*/rp_filter: No such file or directory
systeroid: ambiguous parameter name: net.ipv4.conf.*.rp_filter
It would be nice to be able to set transparent background or, if already possible, documented how to.
Or, maybe the background shouldn't be overridden with the default black, if that would be a way?
Describe the bug
Current regex for parsing the documentation gives false results sometimes.
To reproduce
Here is a few examples:
$ systeroid -E fs.mount-max
mount-max
=========
This denotes the maximum number of mounts that may exist
in a mount namespace.
# rest is irrelevant
2. /proc/sys/fs/binfmt_misc
===========================
# ...
$ systeroid -E net.mptcp.enabled
# completely irrelevant
seg6_enabled - BOOL
===================
Accept or drop SR-enabled IPv6 packets on this interface.
# ...
Expected behavior
Correct part of the documentation is parsed for the given parameter.
Screenshots / Logs
-
Software information
Additional context
-
Compiler is stable, rustc 1.72.0 (5680fa18f 2023-08-23)
Just a guess, maybe the pinned dependency version for ratatui has required an update? I see it's pinned to "=0.22.0" in systeroid-tui-0.4.3, but clearly I'm seeing 0.23.0 for some reason in the logs below.
Compiling systeroid-tui v0.4.3
error[E0308]: mismatched types
--> /home/d/.cargo/registry/src/index.crates.io-6f17d22bba15001f/systeroid-tui-0.4.3/src/ui.rs:485:22
|
485 | .style_trace(Style::default().fg(TuiColor::DarkGray))
| ----------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `ratatui::style::Style`, found `Style`
| |
| arguments to this method are incorrect
|
= note: `Style` and `ratatui::style::Style` have similar names, but are actually distinct types
note: `Style` is defined in crate `ratatui`
--> /home/d/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ratatui-0.22.0/src/style.rs:252:1
|
252 | pub struct Style {
| ^^^^^^^^^^^^^^^^
note: `ratatui::style::Style` is defined in crate `ratatui`
--> /home/d/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ratatui-0.23.0/src/style.rs:253:1
|
253 | pub struct Style {
| ^^^^^^^^^^^^^^^^
= note: perhaps two different versions of crate `ratatui` are being used?
note: method defined here
--> /home/d/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tui-logger-0.9.6/src/lib.rs:1338:12
|
1338 | pub fn style_trace(mut self, style: Style) -> Self {
| ^^^^^^^^^^^
error[E0308]: mismatched types
--> /home/d/.cargo/registry/src/index.crates.io-6f17d22bba15001f/systeroid-tui-0.4.3/src/ui.rs:486:22
|
486 | .style_debug(Style::default().fg(TuiColor::Blue))
| ----------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `ratatui::style::Style`, found `Style`
| |
| arguments to this method are incorrect
|
= note: `Style` and `ratatui::style::Style` have similar names, but are actually distinct types
note: `Style` is defined in crate `ratatui`
--> /home/d/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ratatui-0.22.0/src/style.rs:252:1
|
252 | pub struct Style {
| ^^^^^^^^^^^^^^^^
note: `ratatui::style::Style` is defined in crate `ratatui`
--> /home/d/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ratatui-0.23.0/src/style.rs:253:1
|
253 | pub struct Style {
| ^^^^^^^^^^^^^^^^
= note: perhaps two different versions of crate `ratatui` are being used?
note: method defined here
--> /home/d/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tui-logger-0.9.6/src/lib.rs:1342:12
|
1342 | pub fn style_debug(mut self, style: Style) -> Self {
| ^^^^^^^^^^^
error[E0308]: mismatched types
--> /home/d/.cargo/registry/src/index.crates.io-6f17d22bba15001f/systeroid-tui-0.4.3/src/ui.rs:487:21
|
487 | .style_warn(Style::default().fg(TuiColor::Yellow))
| ---------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `ratatui::style::Style`, found `Style`
| |
| arguments to this method are incorrect
|
= note: `Style` and `ratatui::style::Style` have similar names, but are actually distinct types
note: `Style` is defined in crate `ratatui`
--> /home/d/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ratatui-0.22.0/src/style.rs:252:1
|
252 | pub struct Style {
| ^^^^^^^^^^^^^^^^
note: `ratatui::style::Style` is defined in crate `ratatui`
--> /home/d/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ratatui-0.23.0/src/style.rs:253:1
|
253 | pub struct Style {
| ^^^^^^^^^^^^^^^^
= note: perhaps two different versions of crate `ratatui` are being used?
note: method defined here
--> /home/d/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tui-logger-0.9.6/src/lib.rs:1330:12
|
1330 | pub fn style_warn(mut self, style: Style) -> Self {
| ^^^^^^^^^^
error[E0308]: mismatched types
--> /home/d/.cargo/registry/src/index.crates.io-6f17d22bba15001f/systeroid-tui-0.4.3/src/ui.rs:488:22
|
488 | .style_error(Style::default().fg(TuiColor::Red))
| ----------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `ratatui::style::Style`, found `Style`
| |
| arguments to this method are incorrect
|
= note: `Style` and `ratatui::style::Style` have similar names, but are actually distinct types
note: `Style` is defined in crate `ratatui`
--> /home/d/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ratatui-0.22.0/src/style.rs:252:1
|
252 | pub struct Style {
| ^^^^^^^^^^^^^^^^
note: `ratatui::style::Style` is defined in crate `ratatui`
--> /home/d/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ratatui-0.23.0/src/style.rs:253:1
|
253 | pub struct Style {
| ^^^^^^^^^^^^^^^^
= note: perhaps two different versions of crate `ratatui` are being used?
note: method defined here
--> /home/d/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tui-logger-0.9.6/src/lib.rs:1326:12
|
1326 | pub fn style_error(mut self, style: Style) -> Self {
| ^^^^^^^^^^^
error[E0308]: mismatched types
--> /home/d/.cargo/registry/src/index.crates.io-6f17d22bba15001f/systeroid-tui-0.4.3/src/ui.rs:489:21
|
489 | .style_info(Style::default().fg(TuiColor::Green))
| ---------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `ratatui::style::Style`, found `Style`
| |
| arguments to this method are incorrect
|
= note: `Style` and `ratatui::style::Style` have similar names, but are actually distinct types
note: `Style` is defined in crate `ratatui`
--> /home/d/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ratatui-0.22.0/src/style.rs:252:1
|
252 | pub struct Style {
| ^^^^^^^^^^^^^^^^
note: `ratatui::style::Style` is defined in crate `ratatui`
--> /home/d/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ratatui-0.23.0/src/style.rs:253:1
|
253 | pub struct Style {
| ^^^^^^^^^^^^^^^^
= note: perhaps two different versions of crate `ratatui` are being used?
note: method defined here
--> /home/d/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tui-logger-0.9.6/src/lib.rs:1334:12
|
1334 | pub fn style_info(mut self, style: Style) -> Self {
| ^^^^^^^^^^
error[E0308]: mismatched types
--> /home/d/.cargo/registry/src/index.crates.io-6f17d22bba15001f/systeroid-tui-0.4.3/src/ui.rs:490:26
|
490 | .highlight_style(colors.get_fg_style())
| --------------- ^^^^^^^^^^^^^^^^^^^^^ expected `ratatui::style::Style`, found `Style`
| |
| arguments to this method are incorrect
|
= note: `Style` and `ratatui::style::Style` have similar names, but are actually distinct types
note: `Style` is defined in crate `ratatui`
--> /home/d/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ratatui-0.22.0/src/style.rs:252:1
|
252 | pub struct Style {
| ^^^^^^^^^^^^^^^^
note: `ratatui::style::Style` is defined in crate `ratatui`
--> /home/d/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ratatui-0.23.0/src/style.rs:253:1
|
253 | pub struct Style {
| ^^^^^^^^^^^^^^^^
= note: perhaps two different versions of crate `ratatui` are being used?
note: method defined here
--> /home/d/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tui-logger-0.9.6/src/lib.rs:1310:12
|
1310 | pub fn highlight_style(mut self, style: Style) -> Self {
| ^^^^^^^^^^^^^^^
error[E0308]: mismatched types
--> /home/d/.cargo/registry/src/index.crates.io-6f17d22bba15001f/systeroid-tui-0.4.3/src/ui.rs:491:23
|
491 | .border_style(colors.get_fg_style())
| ------------ ^^^^^^^^^^^^^^^^^^^^^ expected `ratatui::style::Style`, found `Style`
| |
| arguments to this method are incorrect
|
= note: `Style` and `ratatui::style::Style` have similar names, but are actually distinct types
note: `Style` is defined in crate `ratatui`
--> /home/d/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ratatui-0.22.0/src/style.rs:252:1
|
252 | pub struct Style {
| ^^^^^^^^^^^^^^^^
note: `ratatui::style::Style` is defined in crate `ratatui`
--> /home/d/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ratatui-0.23.0/src/style.rs:253:1
|
253 | pub struct Style {
| ^^^^^^^^^^^^^^^^
= note: perhaps two different versions of crate `ratatui` are being used?
note: method defined here
--> /home/d/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tui-logger-0.9.6/src/lib.rs:1314:12
|
1314 | pub fn border_style(mut self, style: Style) -> Self {
| ^^^^^^^^^^^^
error[E0308]: mismatched types
--> /home/d/.cargo/registry/src/index.crates.io-6f17d22bba15001f/systeroid-tui-0.4.3/src/ui.rs:492:22
|
492 | .border_type(BorderType::Rounded)
| ----------- ^^^^^^^^^^^^^^^^^^^ expected `BorderType`, found a different `BorderType`
| |
| arguments to this method are incorrect
|
= note: `BorderType` and `BorderType` have similar names, but are actually distinct types
note: `BorderType` is defined in crate `ratatui`
--> /home/d/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ratatui-0.22.0/src/widgets/block.rs:14:1
|
14 | pub enum BorderType {
| ^^^^^^^^^^^^^^^^^^^
note: `BorderType` is defined in crate `ratatui`
--> /home/d/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ratatui-0.23.0/src/widgets/block.rs:16:1
|
16 | pub enum BorderType {
| ^^^^^^^^^^^^^^^^^^^
= note: perhaps two different versions of crate `ratatui` are being used?
note: method defined here
--> /home/d/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tui-logger-0.9.6/src/lib.rs:1318:12
|
1318 | pub fn border_type(mut self, border_type: BorderType) -> Self {
| ^^^^^^^^^^^
error[E0308]: mismatched types
--> /home/d/.cargo/registry/src/index.crates.io-6f17d22bba15001f/systeroid-tui-0.4.3/src/ui.rs:493:16
|
493 | .style(colors.get_bg_style())
| ----- ^^^^^^^^^^^^^^^^^^^^^ expected `ratatui::style::Style`, found `Style`
| |
| arguments to this method are incorrect
|
= note: `Style` and `ratatui::style::Style` have similar names, but are actually distinct types
note: `Style` is defined in crate `ratatui`
--> /home/d/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ratatui-0.22.0/src/style.rs:252:1
|
252 | pub struct Style {
| ^^^^^^^^^^^^^^^^
note: `ratatui::style::Style` is defined in crate `ratatui`
--> /home/d/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ratatui-0.23.0/src/style.rs:253:1
|
253 | pub struct Style {
| ^^^^^^^^^^^^^^^^
= note: perhaps two different versions of crate `ratatui` are being used?
note: method defined here
--> /home/d/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tui-logger-0.9.6/src/lib.rs:1322:12
|
1322 | pub fn style(mut self, style: Style) -> Self {
| ^^^^^
error[E0277]: the trait bound `TuiLoggerSmartWidget<'_>: Widget` is not satisfied
--> /home/d/.cargo/registry/src/index.crates.io-6f17d22bba15001f/systeroid-tui-0.4.3/src/ui.rs:501:25
|
501 | frame.render_widget(logger_widget, rect);
| ------------- ^^^^^^^^^^^^^ the trait `Widget` is not implemented for `TuiLoggerSmartWidget<'_>`
| |
| required by a bound introduced by this call
|
= help: the following other types implement trait `Widget`:
Canvas<'a, F>
LineGauge<'a>
BarChart<'a>
ratatui::widgets::Block<'a>
Chart<'a>
Clear
Gauge<'a>
List<'a>
and 4 others
note: required by a bound in `Frame::<'a, B>::render_widget`
--> /home/d/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ratatui-0.22.0/src/terminal.rs:89:12
|
87 | pub fn render_widget<W>(&mut self, widget: W, area: Rect)
| ------------- required by a bound in this associated function
88 | where
89 | W: Widget,
| ^^^^^^ required by this bound in `Frame::<'a, B>::render_widget`
Some errors have detailed explanations: E0277, E0308.
For more information about an error, try `rustc --explain E0277`.
error: could not compile `systeroid-tui` (lib) due to 10 previous errors
warning: build failed, waiting for other jobs to finish...
error: failed to compile `systeroid-tui v0.4.3`, intermediate artifacts can be found at `/tmp/cargo-installGz8EVJ`.
To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.
Describe the bug
In TUI mode, vector of integers are not correctly separated.
To reproduce
systeroid-tui -q net.ipv4.tcp_mem
Expected behavior
tcp_mem is a vector of 3 intergers, 182769243695365538
should be displayed as 182769 243695 365538
Screenshots / Logs
Software information
Is your feature request related to a problem? Please describe.
ratatui is the actively maintained fork of tui-rs and it would be nice to switch to it.
Describe the solution you'd like
Update Cargo.{toml,lock}
according to the instructions.
Describe alternatives you've considered
None.
Additional context
ratatui
had a new release recently and there is a bug fix release on the way. It would be nice to wait until ratatui-org/ratatui#110 is merged.
Describe the bug
For sub sections, x.y
or deeper, systeroid
does not show the expected output but instead a false error message, as in that the directory with the information is there.
To reproduce
Run systeroid net.ipv4
, for example.
Expected behavior
Show all sub/child variables of net.ipv4
(for example) as sysctl net.ipv4
does, or as is currently shown by passing the -r
flag to systeroid, systeroid -r net.ipv4
.
Screenshots / Logs
$ systeroid net.ipv4
systeroid: cannot stat /proc/sys/net/ipv4: No such file or directory
$ ls -ld /proc/sys/net/ipv4
dr-xr-xr-x - root 4 Sep 22:18 /proc/sys/net/ipv4/
Software information
Is your feature request related to a problem? Please describe.
Currently there is no way to configure the default settings of systeroid
other than using the command-line arguments. These settings include kernel section colors, TUI foreground/background colors and default argument values.
Describe the solution you'd like
Support configuring the settings with a configuration file. INI format could be used.
Describe alternatives you've considered
-
Additional context
There is already a config
module in the core library. This struct type could potentially be used while implementing.
xml-rs is Unmaintained
Details | |
---|---|
Status | unmaintained |
Package | xml-rs |
Version | 0.8.4 |
URL | https://github.com/netvl/xml-rs/issues |
Date | 2022-01-26 |
xml-rs is a XML parser has open issues around parsing including integer
overflows / panics that may or may not be an issue with untrusted data.
Together with these open issues with Unmaintained status xml-rs
may or may not be suited to parse untrusted data.
See advisory page for additional details.
Describe the solution you'd like
Support saving changed values to a specified file, i.e. 99-local.conf (possibly specified in a config file in RFE #12)
Describe alternatives you've considered
Could also dump changed values to terminal in a format suitable for copy/paste
Is your feature request related to a problem? Please describe.
Printing to stdout is not possible while running TUI since the output is locked by the terminal backend (termion
). This causes verbose logging to be suppressed.
Describe the solution you'd like
Add a new command-line flag named --verbose
and somehow enable verbose logging while running the TUI.
Describe alternatives you've considered
-
Additional context
This will be useful when some of the parameters cannot be retrieved due to insufficient permissions and error logs are printed. Right now there is no way of telling when the parameter list is fetched without errors when the TUI is launched.
Describe the bug
Panic handler for termion does not work correctly, as we implemented new one within orhun/kmon#141
To reproduce
You can inject panic!()
somewhere in the systeroid-tui(I did it within lib.rs file) and it will basically mess up your terminal emulator.
Expected behavior
As it is implemented in orhun/kmon#141, panic handler should work same and correctly to not to mess up terminal.
Software information
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.