Commit graph

1704 commits

Author SHA1 Message Date
ClementTsang
af4756c930 docs: add snap install option to README 2022-05-04 14:49:31 -04:00
ClementTsang
4fac7ab4fa github: fix typo in packaging issue template 2022-05-04 14:48:10 -04:00
Clement Tsang
dd9111467a
github: update packaging issue wording 2022-05-03 19:07:10 -04:00
Clement Tsang
9882a9bd08
ci: move cargo fmt step into supported job (#722)
Moves the rustfmt step into the supported job, to avoid having to wait too long for machine spinup time if they are separate jobs.
2022-05-01 17:53:08 -04:00
Clement Tsang
2629709c5d
Merge pull request #721 from ClementTsang/remove_cache_from_fmt
Removes the caching step from the cargo fmt check as it does nothing. Also adds an extra test for if the battery feature is disabled.
2022-05-01 17:40:22 -04:00
ClementTsang
715af44efc ci: create deploy feature; test in CI
This encompasses features that we want on deployment.
2022-05-01 17:30:20 -04:00
ClementTsang
798683b81f other: add test for battery flag if battery feature is off 2022-05-01 17:15:54 -04:00
ClementTsang
6e2ea8eeda ci: remove caching step from cargo fmt check 2022-05-01 17:12:20 -04:00
Clement Tsang
c44e860af8
Merge pull request #720 from ClementTsang/ci_shortening
Cleaned up and updated the primary GitHub CI workflow. Also fixes a bug caught during this check.
2022-05-01 17:08:53 -04:00
ClementTsang
a92313a5be bug: fix panic if battery feature was disabled 2022-05-01 16:57:03 -04:00
ClementTsang
8cc361e443 ci: clean up ci workflow 2022-05-01 16:56:40 -04:00
ClementTsang
a9da449cef ci: update rust-cache to 1.4.0 2022-05-01 15:47:30 -04:00
Clement Tsang
e646a76630
ci: disable debug symbols and incremental in CI, force locked #719
Disables incremental compilation and debug symbols in CI and other related workflows, since they're not used there at all. Also forces --locked as needed.
2022-04-29 18:15:49 -04:00
Clement Tsang
a516104dec
refactor: refactor some tests (#718)
Small PR to quickly refactor some recent tests to avoid too much duplication.
2022-04-29 16:02:34 -04:00
Clement Tsang
cddee9d923
Merge pull request #710 from ClementTsang/consolidate_component_drawing
Cleans up some drawing code and unifies all time graph drawing.
2022-04-29 01:12:14 -04:00
ClementTsang
2401e583fb refactor: consolidate time graph components
This consolidates all the time graph drawing to one main location, as well
as some small improvements. This is helpful in that I don't have to
reimplement the same thing across three locations if I have to make one
change that in theory should affect them all. In particular, the CPU
graph, memory graph, and network graph are all now using the same,
generic implementation for drawing, which we call (for now) a component.

Note this only affects drawing - it accepts some parameters affecting style
and labels, as well as data points, and draw similarly to how it used to
before. Widget-specific actions, or things affecting widget state,
should all be handled by the widget-specific code instead. For example,
our current implementation of x-axis autohide is still controlled by the
widget, not the component, even if some of the code is shared. Components
are, again, only responsible for drawing (at least for now). For that
matter, the graph component does not have mutable access to any form of
state outside of tui-rs' `Frame`. Note this *might* change in the
future, where we might give the component state.

Note that while functionally, the graph behaviour for now is basically
the same, a few changes were made internally other than the move to
components. The big change is that rather than using tui-rs' `Chart`
for the underlying drawing, we now use a tweaked custom `TimeChart`
tui-rs widget, which also handles all interpolation steps and some extra
customization. Personally, I don't like having to deviate from the
library's implementation, but this gives us more flexibility and allows
greater control. For example, this allows me to move away from the old
hacks required to do interpolation (where I had to mutate the existing
list to avoid having to reallocate an extra vector just to insert one
extra interpolated point). I can also finally allow customizable
legends (which will be added in the future).
2022-04-28 23:36:53 -04:00
Clement Tsang
e393078691
bug: fix choosing an out of list bounds selecting the last entry (#717)
This is a simple bug fix that changes the behaviour of a scroll select
(and column select) to only update if the updated position is _within_
the bounds of the list (0 to the max index, inclusive). Prior to this,
all the implementations but the disk implementation would just bound the
change. This was both inconsistent with the disk scroll state, but also
jarring since this meant a user could click on seemingly empty space but
it would somehow click on the very last entry.

This change also unifies the scroll calculation function between all the
scroll select functions. Ideally we get rid of the intermediary
functions but that might require more refactoring than I want for this
fairly simple bug fix.

The column select scroll calculation was also changed to fit this
behaviour, but it does not use the same logic as the other scroll
states. What could be done in the future is a generic implementation for
direction (or maybe just "increment vs. decrement") to share it all.
2022-04-28 22:39:33 -04:00
ClementTsang
17dbea9a09 docs: add back TOC 2022-04-28 20:37:41 -04:00
Clement Tsang
0d1b6a6d33
github: specify in the bug report that one should install from crates/bottom 2022-04-28 14:52:27 -04:00
ClementTsang
1f731358ba refactor: remove dead config screen code
This code was never used and might as well be removed for clarity's
sake.
2022-04-28 01:40:10 -04:00
ClementTsang
f68acc5c9d refactor: remove trait usage in component drawing
When I was newer to Rust, I got the weird impression that you couldn't
add functionality to a struct outside of the defining file without using
a trait.

That's obviously not true, so it's high time I got rid of it and just
made it part of the impl of the class itself, rather than declaring a
trait and then exporting/importing it.
2022-04-28 01:40:10 -04:00
Clement Tsang
b9a356f581
ci: lock cargo-llvm-cov install in script (#715)
Super small change, install cargo-llvm-cov with --locked.
2022-04-28 01:39:58 -04:00
Clement Tsang
8a133908f4
Merge pull request #714 from ClementTsang/switch_to_llvm_cov
Experiment with llvm-cov over tarpaulin.

Tarpaulin is supposed to be switching to something similar to how this works in the future as well, so I might switch back then if I switch now.
2022-04-28 01:33:57 -04:00
ClementTsang
19430a1a49 ci: reduce code cov skip conditions 2022-04-28 01:18:27 -04:00
ClementTsang
a6933d89b3 ci: try using llvm-cov instead of tarpaulin 2022-04-28 00:31:58 -04:00
Clement Tsang
476a4ad910
deps: update dependencies (#713)
Updates various dependencies in both Cargo.toml and Cargo.lock.
2022-04-27 19:23:34 -04:00
Clement Tsang
d43bd6147d
bug: change as_ref() to build in Rust beta 1.61.0 (#711)
This changes various as_ref() calls as needed in order for bottom to successfully build in Rust beta 1.61, as they were causing type inference issues. These calls were either removed or changed to an alternative that does build (e.g. as_slice()).

Functionally, there should be no change.

For context, see:
- https://github.com/ClementTsang/bottom/issues/708
- https://github.com/rust-lang/rust/issues/96074
2022-04-27 18:34:49 -04:00
Clement Tsang
2b893ea6aa
ci: increase codecov threshold to 5% (#712)
Increases codecov threshold to 5% for less annoying failures.
2022-04-27 18:19:48 -04:00
Clement Tsang
08bb933f38
docs: add some search features to mkdocs config (#704)
Enables some search features for the mkdocs config.
2022-04-11 03:54:21 -04:00
Clement Tsang
7c62822732
docs: update mkdocs-material to 8.2.9 (#701) 2022-04-10 23:57:42 -04:00
Clement Tsang
194a769b1d
ci: use locked builds in deploy and nightly (#700)
Adds --locked to the build process for nightly and deploy workflows.
2022-04-10 01:11:10 -04:00
Clement Tsang
44e6923a5d
ci: update cargo deb to 1.37 (#699) 2022-04-08 17:45:18 -04:00
Clement Tsang
d297ee4639
refactor: remove some simple as-casts (#697)
Remove some simple as casts that are easy to change to .into(), or easy to check.
2022-03-27 22:01:06 -04:00
Clement Tsang
747497cc8a
docs: mention discussions, fix broken link, update mkdocs req (#698)
Fixes a broken link, and mention when to use discussions over issues. Also updates mkdocs in the build process due to some broken dependencies.
2022-03-27 21:57:55 -04:00
ClementTsang
6fa04de2b7 docs: shorten some of the -h help dialog 2022-03-20 19:45:01 -04:00
Clement Tsang
5fb322b2b9
docs: remove "btm" from title due to confusion
It's caused two reports now because it's being mixed up with https://crates.io/crates/btm - going to remove it for now as it's likely the source of confusion.
2022-03-16 22:27:11 -04:00
Clement Tsang
f2b8b4e842
other: add manpage file to cargo deb config, move back to build script (#693)
Adds the asset for the manpage to cargo deb config. Also moves the generated manpage file to a .1.gz file. Also, moves back to a build script since that was causing some issues for the automatic Cargo.toml fields detection for manpage and completion generation.

To prevent compilation from happening every time, and only in CI, we use an env var to avoid generation steps.
2022-03-11 06:45:05 -05:00
Clement Tsang
8087f0b636
ci: add manpage generation, migrate build script (#692)
Adds manpage generation to the build process, as well as following the xtask concept of adding additional build scripts that only need to run on deploy/nightly as opposed to `build.rs`. Note this doesn't follow the recommended method of using workplaces because I don't really want to shift the entire repo structure just for this.

More on xtask: https://github.com/matklad/cargo-xtask
2022-03-10 05:15:48 -05:00
Clement Tsang
92ec359936
deps: update regex to 1.5.5 due to CVE (#691)
Prompted by the following CVE: https://blog.rust-lang.org/2022/03/08/cve-2022-24713.html

Addresses it by following the recommended fix of updating to 1.5.5.
2022-03-08 15:16:56 -05:00
Clement Tsang
01f6bddab6
deps: update clap to 3.x (#690)
Updates bottom to use clap 3.x, along with some small refactoring changes.
2022-03-07 22:53:02 -05:00
Clement Tsang
e682882aee
other: fix clippy lints on vector reference params (#689)
Fixes a few clippy lints around function parameters and using slices over vector references.
2022-03-07 18:44:45 -05:00
Clement Tsang
57e1a8285e
ci: update audit workflow (#685)
Manually install the audit crate as part of the audit CI since it seems to be using too old of a version of Rust.
2022-02-27 19:52:09 -05:00
ClementTsang
adf1e2b216 docs: update changelog 2022-02-25 14:32:44 -05:00
Clement Tsang
2eb865247e
deps: update dirs to 4.x (#682)
Updates the dirs dependency to 4.0.0. This is a breaking change but should not affect bottom.
2022-02-25 05:21:46 -05:00
Clement Tsang
5f042aef94
deps: update procfs and testing deps (#681) 2022-02-25 05:02:15 -05:00
Clement Tsang
c4c9130b4a
ci: enable strip on release builds with Cargo.toml (#679)
Removes the manual strip used in favour of the now native functionality in Cargo.
2022-02-25 02:18:22 -05:00
Clement Tsang
128ec81200
ci: switch to a manual cargo tarpaulin installation (#680)
Update to use a manual install of cargo tarpaulin, fixes the wrong filename being checked in the skip action.
2022-02-25 02:15:26 -05:00
Clement Tsang
c2bfcec40e
deps: update sysinfo to 0.23.4 (#678) 2022-02-24 23:12:37 -05:00
allcontributors[bot]
1642b570b8
docs: add shurizzle as a contributor for code (#677)
* docs: update README.md [skip ci]

* docs: update .all-contributorsrc [skip ci]

* fix

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
Co-authored-by: ClementTsang <cjhtsang@uwaterloo.ca>
2022-02-22 06:29:48 -05:00
Clement Tsang
39597975a7
Merge pull request #676 from shurizzle/master
Add support for nvidia GPUs
2022-02-22 03:19:44 -08:00