chore: merge release-v0.2.5 into main
This commit is contained in:
@@ -7,8 +7,7 @@
|
|||||||
"args": {
|
"args": {
|
||||||
// Use the VARIANT arg to pick a Debian OS version: buster, bullseye
|
// Use the VARIANT arg to pick a Debian OS version: buster, bullseye
|
||||||
// Use bullseye when on local on arm64/Apple Silicon.
|
// Use bullseye when on local on arm64/Apple Silicon.
|
||||||
"VARIANT": "bullseye",
|
"VARIANT": "bullseye"
|
||||||
"BUILDKIT_INLINE_CACHE": "0"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"runArgs": [
|
"runArgs": [
|
||||||
@@ -22,6 +21,9 @@
|
|||||||
"mounts": [
|
"mounts": [
|
||||||
"source=/etc/timezone,target=/etc/timezone,type=bind,readonly"
|
"source=/etc/timezone,target=/etc/timezone,type=bind,readonly"
|
||||||
],
|
],
|
||||||
|
"containerEnv": {
|
||||||
|
"CARGO_REGISTRIES_CRATES_IO_PROTOCOL": "sparse"
|
||||||
|
},
|
||||||
|
|
||||||
"customizations": {
|
"customizations": {
|
||||||
"vscode": {
|
"vscode": {
|
||||||
|
|||||||
+14
-16
@@ -1,27 +1,25 @@
|
|||||||
### 2023-03-02
|
### 2023-03-13
|
||||||
|
|
||||||
### Chores
|
### Chores
|
||||||
+ dependencies updated, [aac3ef2b1def3345d749d813d9b76020d6b5e5ca], [4723be7fb2eb101024bb9d5a514e2c6cc51eb6f6], [c69ab4f7c3b873f25ea46958add37be78d23e9cf], [ba6437862dae0f422660a602aeabd6217d023fac], [2bb4c338903e09856053894d9646307e31d32f1c]
|
+ Rust 1.68.0 clippy linting, [5582c45403413d3355bbcd629cfad559296f5e5b]
|
||||||
+ dev container install x86 musl toolchain, [e650034d50f01a7598876d4f2887df691700e06a]
|
+ devcontainer use sparse protocol index, [20b79e9cd5bf75bb253158c0b590284139e0291d]
|
||||||
|
+ dependencies updated, [0c07d4b40607a0eba003b6dcd0345ec0543c6264], [601a73d2c830043a25d64922c4d4aa38f8801912], [5aaa3c1ab08b0c85df9bfce18a3e60206556fa58], [7a1563030e48499da7f41033673c70deefe3de8a], [457157755baa1f9e9cfef9315a7940c357b0953d]
|
||||||
### Docs
|
|
||||||
+ typos removed, [23ad9a5fb3cacf3fb8cb70c65ca9133ed9949e45], [cebb975cb82f653407ec801fd8c726ca6ed68289], [fdc67c9249a239bac97a78b20c9378472865209c]
|
|
||||||
+ comments improved, [ec962295a8789ff8010604e974969bf618ea7108]
|
|
||||||
|
|
||||||
### Features
|
### Features
|
||||||
+ mouse capture is now more specific, should have substantial performance impact, 10x reduction in cpu usage when mouse is moved observed, as well as fixing intermittent mouse events output bug, [0a1b53111627206cc7436589e5b7212e1b72edb8], [93f7c07f708885f8870da5dfb6d57c62f93c9c78], [c74f6c1179b5f62989eb74f395a56b43a8781b03]
|
+ increase mpsc channel size from 16 to 32 messages, [924f14e998f79f731447a2eded038eab51f2e932]
|
||||||
+ improve the styling of the help information popup, [28de74b866f07c8543e46be3cab929eff28953fd]
|
+ KeyEvents send modifier, so can quit on `ctrl + c`, [598f67c6f6a8713102bcc415f0409911763bb914]
|
||||||
+ use checked_sub & checked_div for bounds checks, [72279e26ae996353c95a75527f704bac1e4bcf4d]
|
+ only send relevant mouse events to input handler, [507660d835d0beaa8cd021110401ecc58c0613c6]
|
||||||
|
|
||||||
### Fixes
|
### Fixes
|
||||||
+ correctly set gui error, [340893a860e99ec4029d12613f2a6de3cb7b47e2]
|
+ GitHub workflow on SEMEVR tag only, [140773865165bf006e74f9d436fc744220f5eae7]
|
||||||
|
|
||||||
### Refactors
|
### Refactors
|
||||||
+ dead code removed, [b8f5792d1865d3a398cd7f23aa9473a55dc6ea44]
|
+ replace `unwrap_or(())` with `.ok()`, [8ba37a165bb89277ab957194da6464bdb35be2e6]
|
||||||
+ improve the get_width function, [04c26fe8fc7c79506921b9cff42825b1ee132737]
|
+ use `unwrap_or_default()`, [79de92c3921702417bb2df1f44939a7b09cb7fa0]
|
||||||
+ place ui methods into a Ui struct, [3437df59884f084624031fceb34ea3012a8e2251]
|
+ Result return, [d9f0bd5566e27218b8c8eaba6ece237907771c1d]
|
||||||
+ get_horizotal/vertical constraints into single method, [e8f5cf9c6f8cd5f807a05fb61e31d7cd1426486f]
|
|
||||||
+ docker update_everything variables, [074cb957f274675a468f08fecb1c43ff7453217d]
|
### Reverts
|
||||||
|
+ temporary devcontainer buildkit fix removed, [d1497a4451f4de54d3cc26c5a3957cd636c29118]
|
||||||
|
|
||||||
|
|
||||||
see <a href='https://github.com/mrjackwills/oxker/blob/main/CHANGELOG.md'>CHANGELOG.md</a> for more details
|
see <a href='https://github.com/mrjackwills/oxker/blob/main/CHANGELOG.md'>CHANGELOG.md</a> for more details
|
||||||
|
|||||||
@@ -1,8 +1,6 @@
|
|||||||
name: Release CI
|
name: Release CI
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branch:
|
|
||||||
- 'main'
|
|
||||||
tags:
|
tags:
|
||||||
- 'v[0-9]+.[0-9]+.[0-9]+'
|
- 'v[0-9]+.[0-9]+.[0-9]+'
|
||||||
jobs:
|
jobs:
|
||||||
|
|||||||
@@ -1,3 +1,27 @@
|
|||||||
|
# <a href='https://github.com/mrjackwills/oxker/releases/tag/v0.2.5'>v0.2.5</a>
|
||||||
|
### 2023-03-13
|
||||||
|
|
||||||
|
### Chores
|
||||||
|
+ Rust 1.68.0 clippy linting, [5582c454](https://github.com/mrjackwills/oxker/commit/5582c45403413d3355bbcd629cfad559296f5e5b)
|
||||||
|
+ devcontainer use sparse protocol index, [20b79e9c](https://github.com/mrjackwills/oxker/commit/20b79e9cd5bf75bb253158c0b590284139e0291d)
|
||||||
|
+ dependencies updated, [0c07d4b4](https://github.com/mrjackwills/oxker/commit/0c07d4b40607a0eba003b6dcd0345ec0543c6264), [601a73d2](https://github.com/mrjackwills/oxker/commit/601a73d2c830043a25d64922c4d4aa38f8801912), [5aaa3c1a](https://github.com/mrjackwills/oxker/commit/5aaa3c1ab08b0c85df9bfce18a3e60206556fa58), [7a156303](https://github.com/mrjackwills/oxker/commit/7a1563030e48499da7f41033673c70deefe3de8a), [45715775](https://github.com/mrjackwills/oxker/commit/457157755baa1f9e9cfef9315a7940c357b0953d)
|
||||||
|
|
||||||
|
### Features
|
||||||
|
+ increase mpsc channel size from 16 to 32 messages, [924f14e9](https://github.com/mrjackwills/oxker/commit/924f14e998f79f731447a2eded038eab51f2e932)
|
||||||
|
+ KeyEvents send modifier, so can quit on `ctrl + c`, [598f67c6](https://github.com/mrjackwills/oxker/commit/598f67c6f6a8713102bcc415f0409911763bb914)
|
||||||
|
+ only send relevant mouse events to input handler, [507660d8](https://github.com/mrjackwills/oxker/commit/507660d835d0beaa8cd021110401ecc58c0613c6)
|
||||||
|
|
||||||
|
### Fixes
|
||||||
|
+ GitHub workflow on SEMEVR tag only, [14077386](https://github.com/mrjackwills/oxker/commit/140773865165bf006e74f9d436fc744220f5eae7)
|
||||||
|
|
||||||
|
### Refactors
|
||||||
|
+ replace `unwrap_or(())` with `.ok()`, [8ba37a16](https://github.com/mrjackwills/oxker/commit/8ba37a165bb89277ab957194da6464bdb35be2e6)
|
||||||
|
+ use `unwrap_or_default()`, [79de92c3](https://github.com/mrjackwills/oxker/commit/79de92c3921702417bb2df1f44939a7b09cb7fa0)
|
||||||
|
+ Result return, [d9f0bd55](https://github.com/mrjackwills/oxker/commit/d9f0bd5566e27218b8c8eaba6ece237907771c1d)
|
||||||
|
|
||||||
|
### Reverts
|
||||||
|
+ temporary devcontainer buildkit fix removed, [d1497a44](https://github.com/mrjackwills/oxker/commit/d1497a4451f4de54d3cc26c5a3957cd636c29118)
|
||||||
|
|
||||||
# <a href='https://github.com/mrjackwills/oxker/releases/tag/v0.2.4'>v0.2.4</a>
|
# <a href='https://github.com/mrjackwills/oxker/releases/tag/v0.2.4'>v0.2.4</a>
|
||||||
### 2023-03-02
|
### 2023-03-02
|
||||||
|
|
||||||
|
|||||||
Generated
+77
-77
@@ -118,9 +118,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "chrono"
|
name = "chrono"
|
||||||
version = "0.4.23"
|
version = "0.4.24"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "16b0a3d9ed01224b22057780a37bb8c5dbfe1be8ba48678e7bf57ec4b385411f"
|
checksum = "4e3c5919066adf22df73762e50cffcde3a758f2a848b113b586d1f86728b673b"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"iana-time-zone",
|
"iana-time-zone",
|
||||||
"num-integer",
|
"num-integer",
|
||||||
@@ -227,9 +227,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cxx"
|
name = "cxx"
|
||||||
version = "1.0.91"
|
version = "1.0.92"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "86d3488e7665a7a483b57e25bdd90d0aeb2bc7608c8d0346acf2ad3f1caf1d62"
|
checksum = "9a140f260e6f3f79013b8bfc65e7ce630c9ab4388c6a89c71e07226f49487b72"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cc",
|
"cc",
|
||||||
"cxxbridge-flags",
|
"cxxbridge-flags",
|
||||||
@@ -239,9 +239,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cxx-build"
|
name = "cxx-build"
|
||||||
version = "1.0.91"
|
version = "1.0.92"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "48fcaf066a053a41a81dfb14d57d99738b767febb8b735c3016e469fac5da690"
|
checksum = "da6383f459341ea689374bf0a42979739dc421874f112ff26f829b8040b8e613"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cc",
|
"cc",
|
||||||
"codespan-reporting",
|
"codespan-reporting",
|
||||||
@@ -254,15 +254,15 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cxxbridge-flags"
|
name = "cxxbridge-flags"
|
||||||
version = "1.0.91"
|
version = "1.0.92"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "a2ef98b8b717a829ca5603af80e1f9e2e48013ab227b68ef37872ef84ee479bf"
|
checksum = "90201c1a650e95ccff1c8c0bb5a343213bdd317c6e600a93075bca2eff54ec97"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cxxbridge-macro"
|
name = "cxxbridge-macro"
|
||||||
version = "1.0.91"
|
version = "1.0.92"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "086c685979a698443656e5cf7856c95c642295a38599f12fb1ff76fb28d19892"
|
checksum = "0b75aed41bb2e6367cae39e6326ef817a851db13c13e4f3263714ca3cfb8de56"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
@@ -307,24 +307,24 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "futures-channel"
|
name = "futures-channel"
|
||||||
version = "0.3.26"
|
version = "0.3.27"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "2e5317663a9089767a1ec00a487df42e0ca174b61b4483213ac24448e4664df5"
|
checksum = "164713a5a0dcc3e7b4b1ed7d3b433cabc18025386f9339346e8daf15963cf7ac"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"futures-core",
|
"futures-core",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "futures-core"
|
name = "futures-core"
|
||||||
version = "0.3.26"
|
version = "0.3.27"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "ec90ff4d0fe1f57d600049061dc6bb68ed03c7d2fbd697274c41805dcb3f8608"
|
checksum = "86d7a0c1aa76363dac491de0ee99faf6941128376f1cf96f07db7603b7de69dd"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "futures-macro"
|
name = "futures-macro"
|
||||||
version = "0.3.26"
|
version = "0.3.27"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "95a73af87da33b5acf53acfebdc339fe592ecf5357ac7c0a7734ab9d8c876a70"
|
checksum = "3eb14ed937631bd8b8b8977f2c198443447a8355b6e3ca599f38c975e5a963b6"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
@@ -333,21 +333,21 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "futures-sink"
|
name = "futures-sink"
|
||||||
version = "0.3.26"
|
version = "0.3.27"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "f310820bb3e8cfd46c80db4d7fb8353e15dfff853a127158425f31e0be6c8364"
|
checksum = "ec93083a4aecafb2a80a885c9de1f0ccae9dbd32c2bb54b0c3a65690e0b8d2f2"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "futures-task"
|
name = "futures-task"
|
||||||
version = "0.3.26"
|
version = "0.3.27"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "dcf79a1bf610b10f42aea489289c5a2c478a786509693b80cd39c44ccd936366"
|
checksum = "fd65540d33b37b16542a0438c12e6aeead10d4ac5d05bd3f805b8f35ab592879"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "futures-util"
|
name = "futures-util"
|
||||||
version = "0.3.26"
|
version = "0.3.27"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "9c1d6de3acfef38d2be4b1f543f553131788603495be83da675e180c8d6b7bd1"
|
checksum = "3ef6b17e481503ec85211fed8f39d1970f128935ca1f814cd32ac4a6842e84ab"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"futures-core",
|
"futures-core",
|
||||||
"futures-macro",
|
"futures-macro",
|
||||||
@@ -456,9 +456,9 @@ checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "hyper"
|
name = "hyper"
|
||||||
version = "0.14.24"
|
version = "0.14.25"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "5e011372fa0b68db8350aa7a248930ecc7839bf46d8485577d69f117a75f164c"
|
checksum = "cc5e554ff619822309ffd57d8734d77cd5ce6238bc956f037ea06c58238c9899"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bytes",
|
"bytes",
|
||||||
"futures-channel",
|
"futures-channel",
|
||||||
@@ -538,9 +538,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "io-lifetimes"
|
name = "io-lifetimes"
|
||||||
version = "1.0.5"
|
version = "1.0.6"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "1abeb7a0dd0f8181267ff8adc397075586500b81b28a73e8a0208b00fc170fb3"
|
checksum = "cfa919a82ea574332e2de6e74b4c36e74d41982b335080fa59d4ef31be20fdf3"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"libc",
|
"libc",
|
||||||
"windows-sys",
|
"windows-sys",
|
||||||
@@ -560,9 +560,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "itoa"
|
name = "itoa"
|
||||||
version = "1.0.5"
|
version = "1.0.6"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "fad582f4b9e86b6caa621cabeb0963332d92eea04729ab12892c2533951e6440"
|
checksum = "453ad9f582a441959e5f0d088b02ce04cfe8d51a8eaf077f12ac6d3e94164ca6"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "js-sys"
|
name = "js-sys"
|
||||||
@@ -581,9 +581,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "libc"
|
name = "libc"
|
||||||
version = "0.2.139"
|
version = "0.2.140"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "201de327520df007757c1f0adce6e827fe8562fbc28bfd9c15571c66ca1f5f79"
|
checksum = "99227334921fae1a979cf0bfdfcc6b3e5ce376ef57e16fb6fb3ea2ed6095f80c"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "link-cplusplus"
|
name = "link-cplusplus"
|
||||||
@@ -696,7 +696,7 @@ checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "oxker"
|
name = "oxker"
|
||||||
version = "0.2.4"
|
version = "0.2.5"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"bollard",
|
"bollard",
|
||||||
@@ -805,18 +805,18 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "proc-macro2"
|
name = "proc-macro2"
|
||||||
version = "1.0.51"
|
version = "1.0.52"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "5d727cae5b39d21da60fa540906919ad737832fe0b1c165da3a34d6548c849d6"
|
checksum = "1d0e1ae9e836cc3beddd63db0df682593d7e2d3d891ae8c9083d2113e1744224"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"unicode-ident",
|
"unicode-ident",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "quote"
|
name = "quote"
|
||||||
version = "1.0.23"
|
version = "1.0.26"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "8856d8364d252a14d474036ea1358d63c9e6965c8e5c1885c18f73d70bff9c7b"
|
checksum = "4424af4bf778aae2051a77b60283332f386554255d722233d09fbfc7e30da2fc"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
]
|
]
|
||||||
@@ -862,9 +862,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "rustix"
|
name = "rustix"
|
||||||
version = "0.36.8"
|
version = "0.36.9"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "f43abb88211988493c1abb44a70efa56ff0ce98f233b7b276146f1f3f7ba9644"
|
checksum = "fd5c6ff11fecd55b40746d1995a02f2eb375bf8c00d192d521ee09f42bef37bc"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags",
|
"bitflags",
|
||||||
"errno",
|
"errno",
|
||||||
@@ -876,9 +876,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ryu"
|
name = "ryu"
|
||||||
version = "1.0.12"
|
version = "1.0.13"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "7b4b9743ed687d4b4bcedf9ff5eaa7398495ae14e61cba0a295704edbc7decde"
|
checksum = "f91339c0467de62360649f8d3e185ca8de4224ff281f66000de5eb2a77a79041"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "scopeguard"
|
name = "scopeguard"
|
||||||
@@ -888,24 +888,24 @@ checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "scratch"
|
name = "scratch"
|
||||||
version = "1.0.3"
|
version = "1.0.5"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "ddccb15bcce173023b3fedd9436f882a0739b8dfb45e4f6b6002bee5929f61b2"
|
checksum = "1792db035ce95be60c3f8853017b3999209281c24e2ba5bc8e59bf97a0c590c1"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "serde"
|
name = "serde"
|
||||||
version = "1.0.152"
|
version = "1.0.155"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "bb7d1f0d3021d347a83e556fc4683dea2ea09d87bccdf88ff5c12545d89d5efb"
|
checksum = "71f2b4817415c6d4210bfe1c7bfcf4801b2d904cb4d0e1a8fdb651013c9e86b8"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"serde_derive",
|
"serde_derive",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "serde_derive"
|
name = "serde_derive"
|
||||||
version = "1.0.152"
|
version = "1.0.155"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "af487d118eecd09402d70a5d72551860e788df87b464af30e5ea6a38c75c541e"
|
checksum = "d071a94a3fac4aff69d023a7f411e33f40f3483f8c5190b1953822b6b76d7630"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
@@ -914,9 +914,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "serde_json"
|
name = "serde_json"
|
||||||
version = "1.0.93"
|
version = "1.0.94"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "cad406b69c91885b5107daf2c29572f6c8cdb3c66826821e286c533490c0bc76"
|
checksum = "1c533a59c9d8a93a09c6ab31f0fd5e5f4dd1b8fc9434804029839884765d04ea"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"itoa",
|
"itoa",
|
||||||
"ryu",
|
"ryu",
|
||||||
@@ -925,9 +925,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "serde_repr"
|
name = "serde_repr"
|
||||||
version = "0.1.10"
|
version = "0.1.11"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "9a5ec9fa74a20ebbe5d9ac23dac1fc96ba0ecfe9f50f2843b52e537b10fbcb4e"
|
checksum = "395627de918015623b32e7669714206363a7fc00382bf477e72c1f7533e8eafc"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
@@ -948,9 +948,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "serde_with"
|
name = "serde_with"
|
||||||
version = "2.2.0"
|
version = "2.3.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "30d904179146de381af4c93d3af6ca4984b3152db687dacb9c3c35e86f39809c"
|
checksum = "85456ffac572dc8826334164f2fb6fb40a7c766aebe195a2a21ee69ee2885ecf"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"base64 0.13.1",
|
"base64 0.13.1",
|
||||||
"chrono",
|
"chrono",
|
||||||
@@ -1017,9 +1017,9 @@ checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "socket2"
|
name = "socket2"
|
||||||
version = "0.4.7"
|
version = "0.4.9"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "02e2d2db9033d13a1567121ddd7a095ee144db4e1ca1b1bda3419bc0da294ebd"
|
checksum = "64a4a911eed85daf18834cfaa86a79b7d266ff93ff5ba14005426219480ed662"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"libc",
|
"libc",
|
||||||
"winapi",
|
"winapi",
|
||||||
@@ -1053,18 +1053,18 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "thiserror"
|
name = "thiserror"
|
||||||
version = "1.0.38"
|
version = "1.0.39"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "6a9cd18aa97d5c45c6603caea1da6628790b37f7a34b6ca89522331c5180fed0"
|
checksum = "a5ab016db510546d856297882807df8da66a16fb8c4101cb8b30054b0d5b2d9c"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"thiserror-impl",
|
"thiserror-impl",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "thiserror-impl"
|
name = "thiserror-impl"
|
||||||
version = "1.0.38"
|
version = "1.0.39"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "1fb327af4685e4d03fa8cbcf1716380da910eeb2bb8be417e7f9fd3fb164f36f"
|
checksum = "5420d42e90af0c38c3290abcca25b9b3bdf379fc9f55c528f53a269d9c9a267e"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
@@ -1262,15 +1262,15 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "unicode-bidi"
|
name = "unicode-bidi"
|
||||||
version = "0.3.10"
|
version = "0.3.11"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "d54675592c1dbefd78cbd98db9bacd89886e1ca50692a0692baefffdeb92dd58"
|
checksum = "524b68aca1d05e03fdf03fcdce2c6c94b6daf6d16861ddaa7e4f2b6638a9052c"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "unicode-ident"
|
name = "unicode-ident"
|
||||||
version = "1.0.6"
|
version = "1.0.8"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "84a22b9f218b40614adcb3f4ff08b703773ad44fa9423e4e0d346d5db86e4ebc"
|
checksum = "e5464a87b239f13a63a501f2701565754bae92d243d4bb7eb12f6d57d2269bf4"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "unicode-normalization"
|
name = "unicode-normalization"
|
||||||
@@ -1438,9 +1438,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "windows-targets"
|
name = "windows-targets"
|
||||||
version = "0.42.1"
|
version = "0.42.2"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "8e2522491fbfcd58cc84d47aeb2958948c4b8982e9a2d8a2a35bbaed431390e7"
|
checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"windows_aarch64_gnullvm",
|
"windows_aarch64_gnullvm",
|
||||||
"windows_aarch64_msvc",
|
"windows_aarch64_msvc",
|
||||||
@@ -1453,42 +1453,42 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "windows_aarch64_gnullvm"
|
name = "windows_aarch64_gnullvm"
|
||||||
version = "0.42.1"
|
version = "0.42.2"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "8c9864e83243fdec7fc9c5444389dcbbfd258f745e7853198f365e3c4968a608"
|
checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "windows_aarch64_msvc"
|
name = "windows_aarch64_msvc"
|
||||||
version = "0.42.1"
|
version = "0.42.2"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "4c8b1b673ffc16c47a9ff48570a9d85e25d265735c503681332589af6253c6c7"
|
checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "windows_i686_gnu"
|
name = "windows_i686_gnu"
|
||||||
version = "0.42.1"
|
version = "0.42.2"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "de3887528ad530ba7bdbb1faa8275ec7a1155a45ffa57c37993960277145d640"
|
checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "windows_i686_msvc"
|
name = "windows_i686_msvc"
|
||||||
version = "0.42.1"
|
version = "0.42.2"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "bf4d1122317eddd6ff351aa852118a2418ad4214e6613a50e0191f7004372605"
|
checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "windows_x86_64_gnu"
|
name = "windows_x86_64_gnu"
|
||||||
version = "0.42.1"
|
version = "0.42.2"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "c1040f221285e17ebccbc2591ffdc2d44ee1f9186324dd3e84e99ac68d699c45"
|
checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "windows_x86_64_gnullvm"
|
name = "windows_x86_64_gnullvm"
|
||||||
version = "0.42.1"
|
version = "0.42.2"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "628bfdf232daa22b0d64fdb62b09fcc36bb01f05a3939e20ab73aaf9470d0463"
|
checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "windows_x86_64_msvc"
|
name = "windows_x86_64_msvc"
|
||||||
version = "0.42.1"
|
version = "0.42.2"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "447660ad36a13288b1db4d4248e857b510e8c3a225c822ba4fb748c0aafecffd"
|
checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0"
|
||||||
|
|||||||
+1
-2
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "oxker"
|
name = "oxker"
|
||||||
version = "0.2.4"
|
version = "0.2.5"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
authors = ["Jack Wills <email@mrjackwills.com>"]
|
authors = ["Jack Wills <email@mrjackwills.com>"]
|
||||||
description = "A simple tui to view & control docker containers"
|
description = "A simple tui to view & control docker containers"
|
||||||
@@ -34,4 +34,3 @@ panic = 'abort'
|
|||||||
strip=true
|
strip=true
|
||||||
debug = false
|
debug = false
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+3
-1
@@ -561,7 +561,9 @@ impl AppData {
|
|||||||
|
|
||||||
let id = ContainerId::from(id);
|
let id = ContainerId::from(id);
|
||||||
|
|
||||||
let created = i.created.map_or(0, |i| u64::try_from(i).unwrap_or(0));
|
let created = i
|
||||||
|
.created
|
||||||
|
.map_or(0, |i| u64::try_from(i).unwrap_or_default());
|
||||||
// If container info already in containers Vec, then just update details
|
// If container info already in containers Vec, then just update details
|
||||||
if let Some(item) = self.get_container_by_id(&id) {
|
if let Some(item) = self.get_container_by_id(&id) {
|
||||||
if item.name != name {
|
if item.name != name {
|
||||||
|
|||||||
@@ -109,8 +109,8 @@ impl DockerData {
|
|||||||
.take(1);
|
.take(1);
|
||||||
|
|
||||||
while let Some(Ok(stats)) = stream.next().await {
|
while let Some(Ok(stats)) = stream.next().await {
|
||||||
let mem_stat = stats.memory_stats.usage.unwrap_or(0);
|
let mem_stat = stats.memory_stats.usage.unwrap_or_default();
|
||||||
let mem_limit = stats.memory_stats.limit.unwrap_or(0);
|
let mem_limit = stats.memory_stats.limit.unwrap_or_default();
|
||||||
|
|
||||||
let op_key = stats
|
let op_key = stats
|
||||||
.networks
|
.networks
|
||||||
@@ -402,7 +402,6 @@ impl DockerData {
|
|||||||
self.spawns
|
self.spawns
|
||||||
.lock()
|
.lock()
|
||||||
.values()
|
.values()
|
||||||
.into_iter()
|
|
||||||
.for_each(tokio::task::JoinHandle::abort);
|
.for_each(tokio::task::JoinHandle::abort);
|
||||||
self.is_running
|
self.is_running
|
||||||
.store(false, std::sync::atomic::Ordering::SeqCst);
|
.store(false, std::sync::atomic::Ordering::SeqCst);
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
use crossterm::event::{KeyCode, MouseEvent};
|
use crossterm::event::{KeyCode, KeyModifiers, MouseEvent};
|
||||||
|
|
||||||
#[derive(Debug, Clone, Copy)]
|
#[derive(Debug, Clone, Copy)]
|
||||||
pub enum InputMessages {
|
pub enum InputMessages {
|
||||||
ButtonPress(KeyCode),
|
ButtonPress((KeyCode, KeyModifiers)),
|
||||||
MouseEvent(MouseEvent),
|
MouseEvent(MouseEvent),
|
||||||
}
|
}
|
||||||
|
|||||||
+25
-21
@@ -4,7 +4,7 @@ use std::sync::{
|
|||||||
};
|
};
|
||||||
|
|
||||||
use crossterm::{
|
use crossterm::{
|
||||||
event::{DisableMouseCapture, KeyCode, MouseButton, MouseEvent, MouseEventKind},
|
event::{DisableMouseCapture, KeyCode, KeyModifiers, MouseButton, MouseEvent, MouseEventKind},
|
||||||
execute,
|
execute,
|
||||||
};
|
};
|
||||||
use parking_lot::Mutex;
|
use parking_lot::Mutex;
|
||||||
@@ -60,7 +60,7 @@ impl InputHandler {
|
|||||||
async fn start(&mut self) {
|
async fn start(&mut self) {
|
||||||
while let Some(message) = self.rec.recv().await {
|
while let Some(message) = self.rec.recv().await {
|
||||||
match message {
|
match message {
|
||||||
InputMessages::ButtonPress(key_code) => self.button_press(key_code).await,
|
InputMessages::ButtonPress(key) => self.button_press(key.0, key.1).await,
|
||||||
InputMessages::MouseEvent(mouse_event) => {
|
InputMessages::MouseEvent(mouse_event) => {
|
||||||
let error_or_help = self
|
let error_or_help = self
|
||||||
.gui_state
|
.gui_state
|
||||||
@@ -135,11 +135,17 @@ impl InputHandler {
|
|||||||
|
|
||||||
/// Handle any keyboard button events
|
/// Handle any keyboard button events
|
||||||
#[allow(clippy::too_many_lines)]
|
#[allow(clippy::too_many_lines)]
|
||||||
async fn button_press(&mut self, key_code: KeyCode) {
|
async fn button_press(&mut self, key_code: KeyCode, key_modififer: KeyModifiers) {
|
||||||
// TODO - refactor this to a single call, maybe return Error, Help or Normal
|
// TODO - refactor this to a single call, maybe return Error, Help or Normal
|
||||||
let contains_error = self.gui_state.lock().status_contains(&[Status::Error]);
|
let contains_error = self.gui_state.lock().status_contains(&[Status::Error]);
|
||||||
let contains_help = self.gui_state.lock().status_contains(&[Status::Help]);
|
let contains_help = self.gui_state.lock().status_contains(&[Status::Help]);
|
||||||
|
|
||||||
|
// Quit on Ctrl + c/C
|
||||||
|
let is_c = || key_code == KeyCode::Char('c') || key_code == KeyCode::Char('C');
|
||||||
|
if key_modififer == KeyModifiers::CONTROL && is_c() {
|
||||||
|
self.quit().await;
|
||||||
|
}
|
||||||
|
|
||||||
if contains_error {
|
if contains_error {
|
||||||
match key_code {
|
match key_code {
|
||||||
KeyCode::Char('q' | 'Q') => self.quit().await,
|
KeyCode::Char('q' | 'Q') => self.quit().await,
|
||||||
@@ -157,7 +163,11 @@ impl InputHandler {
|
|||||||
_ => (),
|
_ => (),
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
// let abc = KeyEvent::new(KeyCode::Char('d'), KeyModifiers::Ctrl);
|
||||||
match key_code {
|
match key_code {
|
||||||
|
// KeyCode::Ctrl('c') => {
|
||||||
|
// self.quit().await;
|
||||||
|
// }
|
||||||
KeyCode::Char('0') => self.app_data.lock().reset_sorted(),
|
KeyCode::Char('0') => self.app_data.lock().reset_sorted(),
|
||||||
KeyCode::Char('1') => self.sort(Header::State),
|
KeyCode::Char('1') => self.sort(Header::State),
|
||||||
KeyCode::Char('2') => self.sort(Header::Status),
|
KeyCode::Char('2') => self.sort(Header::Status),
|
||||||
@@ -241,32 +251,26 @@ impl InputHandler {
|
|||||||
};
|
};
|
||||||
if let Some(id) = option_id {
|
if let Some(id) = option_id {
|
||||||
match command {
|
match command {
|
||||||
DockerControls::Pause => self
|
DockerControls::Pause => {
|
||||||
.docker_sender
|
self.docker_sender.send(DockerMessage::Pause(id)).await.ok()
|
||||||
.send(DockerMessage::Pause(id))
|
}
|
||||||
.await
|
|
||||||
.unwrap_or(()),
|
|
||||||
DockerControls::Unpause => self
|
DockerControls::Unpause => self
|
||||||
.docker_sender
|
.docker_sender
|
||||||
.send(DockerMessage::Unpause(id))
|
.send(DockerMessage::Unpause(id))
|
||||||
.await
|
.await
|
||||||
.unwrap_or(()),
|
.ok(),
|
||||||
DockerControls::Start => self
|
DockerControls::Start => {
|
||||||
.docker_sender
|
self.docker_sender.send(DockerMessage::Start(id)).await.ok()
|
||||||
.send(DockerMessage::Start(id))
|
}
|
||||||
.await
|
DockerControls::Stop => {
|
||||||
.unwrap_or(()),
|
self.docker_sender.send(DockerMessage::Stop(id)).await.ok()
|
||||||
DockerControls::Stop => self
|
}
|
||||||
.docker_sender
|
|
||||||
.send(DockerMessage::Stop(id))
|
|
||||||
.await
|
|
||||||
.unwrap_or(()),
|
|
||||||
DockerControls::Restart => self
|
DockerControls::Restart => self
|
||||||
.docker_sender
|
.docker_sender
|
||||||
.send(DockerMessage::Restart(id))
|
.send(DockerMessage::Restart(id))
|
||||||
.await
|
.await
|
||||||
.unwrap_or(()),
|
.ok(),
|
||||||
}
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+12
-11
@@ -1,13 +1,12 @@
|
|||||||
#![forbid(unsafe_code)]
|
#![forbid(unsafe_code)]
|
||||||
#![warn(
|
#![warn(
|
||||||
|
clippy::expect_used,
|
||||||
clippy::nursery,
|
clippy::nursery,
|
||||||
clippy::pedantic,
|
clippy::pedantic,
|
||||||
clippy::expect_used,
|
|
||||||
clippy::todo,
|
clippy::todo,
|
||||||
clippy::unused_async,
|
clippy::unused_async,
|
||||||
clippy::unwrap_used
|
clippy::unwrap_used
|
||||||
)]
|
)]
|
||||||
// Warning - These are indeed pedantic
|
|
||||||
#![allow(
|
#![allow(
|
||||||
clippy::module_name_repetitions,
|
clippy::module_name_repetitions,
|
||||||
clippy::doc_markdown,
|
clippy::doc_markdown,
|
||||||
@@ -23,7 +22,10 @@ use docker_data::DockerData;
|
|||||||
use input_handler::InputMessages;
|
use input_handler::InputMessages;
|
||||||
use parking_lot::Mutex;
|
use parking_lot::Mutex;
|
||||||
use parse_args::CliArgs;
|
use parse_args::CliArgs;
|
||||||
use std::sync::{atomic::AtomicBool, Arc};
|
use std::sync::{
|
||||||
|
atomic::{AtomicBool, Ordering},
|
||||||
|
Arc,
|
||||||
|
};
|
||||||
use tokio::sync::mpsc::{Receiver, Sender};
|
use tokio::sync::mpsc::{Receiver, Sender};
|
||||||
use tracing::{info, Level};
|
use tracing::{info, Level};
|
||||||
|
|
||||||
@@ -52,10 +54,7 @@ fn setup_tracing() {
|
|||||||
/// An ENV is set in the ./containerised/Dockerfile, if this is ENV found, then sleep for 250ms, else the container, for as yet unknown reasons, will close immediately
|
/// An ENV is set in the ./containerised/Dockerfile, if this is ENV found, then sleep for 250ms, else the container, for as yet unknown reasons, will close immediately
|
||||||
/// returns a bool, so that the `update_all_containers()` won't bother to check the entry point unless running via a container
|
/// returns a bool, so that the `update_all_containers()` won't bother to check the entry point unless running via a container
|
||||||
fn check_if_containerised() -> bool {
|
fn check_if_containerised() -> bool {
|
||||||
if std::env::vars()
|
if std::env::vars().any(|x| x == (ENV_KEY.into(), ENV_VALUE.into())) {
|
||||||
.into_iter()
|
|
||||||
.any(|x| x == (ENV_KEY.into(), ENV_VALUE.into()))
|
|
||||||
{
|
|
||||||
std::thread::sleep(std::time::Duration::from_millis(250));
|
std::thread::sleep(std::time::Duration::from_millis(250));
|
||||||
true
|
true
|
||||||
} else {
|
} else {
|
||||||
@@ -124,8 +123,8 @@ async fn main() {
|
|||||||
let app_data = Arc::new(Mutex::new(AppData::default(args)));
|
let app_data = Arc::new(Mutex::new(AppData::default(args)));
|
||||||
let gui_state = Arc::new(Mutex::new(GuiState::default()));
|
let gui_state = Arc::new(Mutex::new(GuiState::default()));
|
||||||
let is_running = Arc::new(AtomicBool::new(true));
|
let is_running = Arc::new(AtomicBool::new(true));
|
||||||
let (docker_sx, docker_rx) = tokio::sync::mpsc::channel(16);
|
let (docker_sx, docker_rx) = tokio::sync::mpsc::channel(32);
|
||||||
let (input_sx, input_rx) = tokio::sync::mpsc::channel(16);
|
let (input_sx, input_rx) = tokio::sync::mpsc::channel(32);
|
||||||
|
|
||||||
docker_init(&app_data, containerised, docker_rx, &gui_state, &is_running).await;
|
docker_init(&app_data, containerised, docker_rx, &gui_state, &is_running).await;
|
||||||
|
|
||||||
@@ -134,14 +133,16 @@ async fn main() {
|
|||||||
if args.gui {
|
if args.gui {
|
||||||
Ui::create(app_data, docker_sx, gui_state, is_running, input_sx).await;
|
Ui::create(app_data, docker_sx, gui_state, is_running, input_sx).await;
|
||||||
} else {
|
} else {
|
||||||
// Debug mode for testing, mostly pointless, doesn't take terminal
|
|
||||||
info!("in debug mode");
|
info!("in debug mode");
|
||||||
|
while is_running.load(Ordering::SeqCst) {
|
||||||
|
// Debug mode for testing, mostly pointless, doesn't take terminal
|
||||||
loop {
|
loop {
|
||||||
docker_sx.send(DockerMessage::Update).await.unwrap_or(());
|
docker_sx.send(DockerMessage::Update).await.ok();
|
||||||
tokio::time::sleep(std::time::Duration::from_millis(u64::from(
|
tokio::time::sleep(std::time::Duration::from_millis(u64::from(
|
||||||
args.docker_interval,
|
args.docker_interval,
|
||||||
)))
|
)))
|
||||||
.await;
|
.await;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -482,7 +482,6 @@ pub fn heading_bar<B: Backend>(
|
|||||||
/// From a given &str, return the maximum number of chars on a single line
|
/// From a given &str, return the maximum number of chars on a single line
|
||||||
fn max_line_width(text: &str) -> usize {
|
fn max_line_width(text: &str) -> usize {
|
||||||
text.lines()
|
text.lines()
|
||||||
.into_iter()
|
|
||||||
.map(|i| i.chars().count())
|
.map(|i| i.chars().count())
|
||||||
.max()
|
.max()
|
||||||
.unwrap_or_default()
|
.unwrap_or_default()
|
||||||
@@ -530,7 +529,6 @@ impl HelpInfo {
|
|||||||
fn gen_name() -> Self {
|
fn gen_name() -> Self {
|
||||||
let mut spans = NAME_TEXT
|
let mut spans = NAME_TEXT
|
||||||
.lines()
|
.lines()
|
||||||
.into_iter()
|
|
||||||
.map(|i| Spans::from(Self::white_span(i)))
|
.map(|i| Spans::from(Self::white_span(i)))
|
||||||
.collect::<Vec<_>>();
|
.collect::<Vec<_>>();
|
||||||
spans.insert(0, Self::empty_span());
|
spans.insert(0, Self::empty_span());
|
||||||
|
|||||||
+15
-19
@@ -44,15 +44,14 @@ pub struct Ui {
|
|||||||
impl Ui {
|
impl Ui {
|
||||||
/// Enable mouse capture, but don't enable capture of all the mouse movements, doing so will improve performance, and is part of the fix for the weird mouse event output bug
|
/// Enable mouse capture, but don't enable capture of all the mouse movements, doing so will improve performance, and is part of the fix for the weird mouse event output bug
|
||||||
pub fn enable_mouse_capture() -> Result<()> {
|
pub fn enable_mouse_capture() -> Result<()> {
|
||||||
io::stdout().write_all(
|
Ok(io::stdout().write_all(
|
||||||
concat!(
|
concat!(
|
||||||
crossterm::csi!("?1000h"),
|
crossterm::csi!("?1000h"),
|
||||||
crossterm::csi!("?1015h"),
|
crossterm::csi!("?1015h"),
|
||||||
crossterm::csi!("?1006h"),
|
crossterm::csi!("?1006h"),
|
||||||
)
|
)
|
||||||
.as_bytes(),
|
.as_bytes(),
|
||||||
)?;
|
)?)
|
||||||
Ok(())
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Create a new Ui struct, and execute the drawing loop
|
/// Create a new Ui struct, and execute the drawing loop
|
||||||
@@ -112,8 +111,7 @@ impl Ui {
|
|||||||
DisableMouseCapture
|
DisableMouseCapture
|
||||||
)?;
|
)?;
|
||||||
disable_raw_mode()?;
|
disable_raw_mode()?;
|
||||||
self.terminal.show_cursor()?;
|
Ok(self.terminal.show_cursor()?)
|
||||||
Ok(())
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Draw the the error message ui, for 5 seconds, with a countdown
|
/// Draw the the error message ui, for 5 seconds, with a countdown
|
||||||
@@ -128,9 +126,6 @@ impl Ui {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// This is a fix for mouse-events being printed to screen
|
|
||||||
self.nullify_event_read();
|
|
||||||
|
|
||||||
if self
|
if self
|
||||||
.terminal
|
.terminal
|
||||||
.draw(|f| draw_blocks::error(f, AppError::DockerConnect, Some(seconds)))
|
.draw(|f| draw_blocks::error(f, AppError::DockerConnect, Some(seconds)))
|
||||||
@@ -159,26 +154,27 @@ impl Ui {
|
|||||||
if let Ok(event) = event::read() {
|
if let Ok(event) = event::read() {
|
||||||
if let Event::Key(key) = event {
|
if let Event::Key(key) = event {
|
||||||
self.sender
|
self.sender
|
||||||
.send(InputMessages::ButtonPress(key.code))
|
.send(InputMessages::ButtonPress((key.code, key.modifiers)))
|
||||||
.await
|
.await
|
||||||
.unwrap_or(());
|
.ok();
|
||||||
} else if let Event::Mouse(m) = event {
|
} else if let Event::Mouse(m) = event {
|
||||||
self.sender
|
match m.kind {
|
||||||
.send(InputMessages::MouseEvent(m))
|
event::MouseEventKind::Down(_)
|
||||||
.await
|
| event::MouseEventKind::ScrollDown
|
||||||
.unwrap_or(());
|
| event::MouseEventKind::ScrollUp => {
|
||||||
|
self.sender.send(InputMessages::MouseEvent(m)).await.ok();
|
||||||
|
}
|
||||||
|
_ => (),
|
||||||
|
}
|
||||||
} else if let Event::Resize(_, _) = event {
|
} else if let Event::Resize(_, _) = event {
|
||||||
self.gui_state.lock().clear_area_map();
|
self.gui_state.lock().clear_area_map();
|
||||||
self.terminal.autoresize().unwrap_or(());
|
self.terminal.autoresize().ok();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if self.now.elapsed() >= update_duration {
|
if self.now.elapsed() >= update_duration {
|
||||||
self.docker_sx
|
self.docker_sx.send(DockerMessage::Update).await.ok();
|
||||||
.send(DockerMessage::Update)
|
|
||||||
.await
|
|
||||||
.unwrap_or(());
|
|
||||||
self.now = Instant::now();
|
self.now = Instant::now();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user