mirror of
https://github.com/mimblewimble/grin.git
synced 2025-02-01 08:51:08 +03:00
Update Cursive to 0.14 and update backend. (#3291)
* Update Cursive to 0.14 * Replace ncurses backend with crossterm * Update to latest Cursive code * Remove git patch
This commit is contained in:
parent
cf128eb220
commit
4024ee3839
10 changed files with 175 additions and 162 deletions
|
@ -1,13 +0,0 @@
|
|||
diff --git a/Cargo.toml b/Cargo.toml
|
||||
index d4cda375..3e3124e9 100644
|
||||
--- a/Cargo.toml
|
||||
+++ b/Cargo.toml
|
||||
@@ -45,8 +45,6 @@ cursive = { version = "0.12", default-features = false, features = ["pancurses-b
|
||||
[target.'cfg(windows)'.dependencies.pancurses]
|
||||
version = "0.16.0"
|
||||
features = ["win32"]
|
||||
-[target.'cfg(unix)'.dependencies]
|
||||
-cursive = "0.12"
|
||||
|
||||
[build-dependencies]
|
||||
built = "0.3"
|
105
Cargo.lock
generated
105
Cargo.lock
generated
|
@ -5,6 +5,14 @@ name = "adler32"
|
|||
version = "1.0.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
||||
[[package]]
|
||||
name = "ahash"
|
||||
version = "0.2.18"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"const-random 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "aho-corasick"
|
||||
version = "0.7.6"
|
||||
|
@ -43,7 +51,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||
|
||||
[[package]]
|
||||
name = "array-macro"
|
||||
version = "1.0.3"
|
||||
version = "1.0.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
||||
[[package]]
|
||||
|
@ -88,6 +96,11 @@ name = "autocfg"
|
|||
version = "0.1.7"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
||||
[[package]]
|
||||
name = "autocfg"
|
||||
version = "1.0.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
||||
[[package]]
|
||||
name = "backtrace"
|
||||
version = "0.3.40"
|
||||
|
@ -305,6 +318,24 @@ dependencies = [
|
|||
"bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "const-random"
|
||||
version = "0.1.8"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"const-random-macro 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"proc-macro-hack 0.5.11 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "const-random-macro"
|
||||
version = "0.1.8"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"getrandom 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"proc-macro-hack 0.5.11 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "constant_time_eq"
|
||||
version = "0.1.4"
|
||||
|
@ -354,10 +385,11 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "crossbeam-channel"
|
||||
version = "0.3.9"
|
||||
version = "0.4.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"crossbeam-utils 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"crossbeam-utils 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"maybe-uninit 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -369,6 +401,16 @@ dependencies = [
|
|||
"lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "crossbeam-utils"
|
||||
version = "0.7.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"autocfg 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "crypto-mac"
|
||||
version = "0.6.2"
|
||||
|
@ -397,29 +439,27 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "cursive"
|
||||
version = "0.12.0"
|
||||
version = "0.14.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"ahash 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"chrono 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"crossbeam-channel 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"enum-map 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"crossbeam-channel 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"enum-map 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"enumset 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"hashbrown 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"maplit 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"ncurses 5.99.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"num 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"owning_ref 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"pancurses 0.16.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"signal-hook 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"signal-hook 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"term_size 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"toml 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"unicode-segmentation 1.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"unicode-width 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"xi-unicode 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"xi-unicode 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -507,11 +547,11 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "enum-map"
|
||||
version = "0.5.0"
|
||||
version = "0.6.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"array-macro 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"enum-map-derive 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"enum-map-internals 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -524,14 +564,6 @@ dependencies = [
|
|||
"syn 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "enum-map-internals"
|
||||
version = "0.1.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"array-macro 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "enum_primitive"
|
||||
version = "0.1.1"
|
||||
|
@ -800,7 +832,7 @@ dependencies = [
|
|||
"chrono 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"clap 2.33.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"ctrlc 3.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"cursive 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"cursive 0.14.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"failure 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"failure_derive 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"grin_api 4.0.0-alpha.1",
|
||||
|
@ -814,7 +846,6 @@ dependencies = [
|
|||
"grin_util 4.0.0-alpha.1",
|
||||
"humansize 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"pancurses 0.16.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde_json 1.0.44 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"term 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
|
@ -1083,11 +1114,6 @@ dependencies = [
|
|||
"tokio-util 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "hashbrown"
|
||||
version = "0.3.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
||||
[[package]]
|
||||
name = "heck"
|
||||
version = "0.3.1"
|
||||
|
@ -2321,7 +2347,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||
|
||||
[[package]]
|
||||
name = "signal-hook"
|
||||
version = "0.1.12"
|
||||
version = "0.1.13"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
|
@ -2919,7 +2945,7 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "xi-unicode"
|
||||
version = "0.1.0"
|
||||
version = "0.2.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
||||
[[package]]
|
||||
|
@ -2965,19 +2991,21 @@ dependencies = [
|
|||
|
||||
[metadata]
|
||||
"checksum adler32 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "5d2e7343e7fc9de883d1b0341e0b13970f764c14101234857d2ddafa1cb1cac2"
|
||||
"checksum ahash 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)" = "6f33b5018f120946c1dcf279194f238a9f146725593ead1c08fa47ff22b0b5d3"
|
||||
"checksum aho-corasick 0.7.6 (registry+https://github.com/rust-lang/crates.io-index)" = "58fb5e95d83b38284460a5fda7d6470aa0b8844d283a0b614b8535e880800d2d"
|
||||
"checksum ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b"
|
||||
"checksum antidote 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "34fde25430d87a9388dadbe6e34d7f72a462c8b43ac8d309b42b0a8505d7e2a5"
|
||||
"checksum anyhow 1.0.26 (registry+https://github.com/rust-lang/crates.io-index)" = "7825f6833612eb2414095684fcf6c635becf3ce97fe48cf6421321e93bfbd53c"
|
||||
"checksum arc-swap 0.3.11 (registry+https://github.com/rust-lang/crates.io-index)" = "bc4662175ead9cd84451d5c35070517777949a2ed84551764129cedb88384841"
|
||||
"checksum arc-swap 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "d7b8a9123b8027467bce0099fe556c628a53c8d83df0507084c31e9ba2e39aff"
|
||||
"checksum array-macro 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "7c4ff37a25fb442a1fecfd399be0dde685558bca30fb998420532889a36852d2"
|
||||
"checksum array-macro 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "7d034edd76d4e7adc314c95400941dedc89bd4337d565bf87f6b69d3b20dc4de"
|
||||
"checksum arrayref 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "0d382e583f07208808f6b1249e60848879ba3543f57c32277bf52d69c2f0f0ee"
|
||||
"checksum arrayvec 0.3.25 (registry+https://github.com/rust-lang/crates.io-index)" = "06f59fe10306bb78facd90d28c2038ad23ffaaefa85bac43c8a434cde383334f"
|
||||
"checksum arrayvec 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)" = "cd9fd44efafa8690358b7408d253adf110036b88f55672a933f01d616ad9b1b9"
|
||||
"checksum arrayvec 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cff77d8686867eceff3105329d4698d96c2391c176d5d03adc90c7389162b5b8"
|
||||
"checksum atty 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)" = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8"
|
||||
"checksum autocfg 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "1d49d90015b3c36167a20fe2810c5cd875ad504b39cff3d4eae7977e6b7c1cb2"
|
||||
"checksum autocfg 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f8aac770f1885fd7e387acedd76065302551364496e46b3dd00860b2f8359b9d"
|
||||
"checksum backtrace 0.3.40 (registry+https://github.com/rust-lang/crates.io-index)" = "924c76597f0d9ca25d762c25a4d369d51267536465dc5064bdf0eb073ed477ea"
|
||||
"checksum backtrace-sys 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)" = "5d6575f128516de27e3ce99689419835fce9643a9b215a14d2b5b685be018491"
|
||||
"checksum base64 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0b25d992356d2eb0ed82172f5248873db5560c4721f564b13cb5193bda5e668e"
|
||||
|
@ -3003,18 +3031,21 @@ dependencies = [
|
|||
"checksum clang-sys 0.28.1 (registry+https://github.com/rust-lang/crates.io-index)" = "81de550971c976f176130da4b2978d3b524eaa0fd9ac31f3ceb5ae1231fb4853"
|
||||
"checksum clap 2.33.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5067f5bb2d80ef5d68b4c87db81601f0b75bca627bc2ef76b141d7b846a3c6d9"
|
||||
"checksum cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f"
|
||||
"checksum const-random 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "2f1af9ac737b2dd2d577701e59fd09ba34822f6f2ebdb30a7647405d9e55e16a"
|
||||
"checksum const-random-macro 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "25e4c606eb459dd29f7c57b2e0879f2b6f14ee130918c2b78ccb58a9624e6c7a"
|
||||
"checksum constant_time_eq 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "995a44c877f9212528ccc74b21a232f66ad69001e40ede5bcee2ac9ef2657120"
|
||||
"checksum core-foundation 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)" = "25b9e03f145fd4f2bf705e07b900cd41fc636598fe5dc452fd0db1441c3f496d"
|
||||
"checksum core-foundation-sys 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e7ca8a5221364ef15ce201e8ed2f609fc312682a8f4e0e3d4aa5879764e0fa3b"
|
||||
"checksum crc32fast 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ba125de2af0df55319f41944744ad91c71113bf74a4646efff39afe1f6842db1"
|
||||
"checksum croaring-mw 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)" = "bcdee571ce4bf3e49c382de29c38bd33b9fa871e1358c7749b9dcc5dc2776221"
|
||||
"checksum croaring-sys-mw 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)" = "ea52c177269fa54c526b054dac8e623721de18143ebfd2ea84ffc023d6c271ee"
|
||||
"checksum crossbeam-channel 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "c8ec7fcd21571dc78f96cc96243cab8d8f035247c3efd16c687be154c3fa9efa"
|
||||
"checksum crossbeam-channel 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "cced8691919c02aac3cb0a1bc2e9b73d89e832bf9a06fc579d4e71b68a2da061"
|
||||
"checksum crossbeam-utils 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)" = "04973fa96e96579258a5091af6003abde64af786b860f18622b82e026cca60e6"
|
||||
"checksum crossbeam-utils 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)" = "c3c7c73a2d1e9fc0886a08b93e98eb643461230d5f1925e4036204d5f2e261a8"
|
||||
"checksum crypto-mac 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7afa06d05a046c7a47c3a849907ec303504608c927f4e85f7bfff22b7180d971"
|
||||
"checksum ct-logs 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4d3686f5fa27dbc1d76c751300376e167c5a43387f44bb451fd1c24776e49113"
|
||||
"checksum ctrlc 3.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "c7dfd2d8b4c82121dfdff120f818e09fc4380b0b7e17a742081a89b94853e87f"
|
||||
"checksum cursive 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b7ecc7282b5361471b607c26f44148205607e26d48a2fc65bd16e7619b1ebb78"
|
||||
"checksum cursive 0.14.0 (registry+https://github.com/rust-lang/crates.io-index)" = "341b03eec276c30c6cdc640d8bd8c08eac9605064c3f9c4838f958dac06973bb"
|
||||
"checksum darling 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)" = "0d706e75d87e35569db781a9b5e2416cff1236a47ed380831f959382ccd5f858"
|
||||
"checksum darling_core 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f0c960ae2da4de88a91b2d920c2a7233b400bc33cb28453a2987822d8392519b"
|
||||
"checksum darling_macro 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)" = "d9b5a2f4ac4969822c62224815d069952656cadc7084fdca9751e6d959189b72"
|
||||
|
@ -3024,9 +3055,8 @@ dependencies = [
|
|||
"checksum dtoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "ea57b42383d091c85abcc2706240b94ab2a8fa1fc81c10ff23c4de06e2a90b5e"
|
||||
"checksum easy-jsonrpc-mw 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)" = "d3b1a91569d50e3bba3c9febb22ef54d78c6e8a8d8dd91ae859896c8ba05f4e3"
|
||||
"checksum easy-jsonrpc-proc-macro-mw 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a6368dbd2c6685fb84fc6e6a4749917ddc98905793fd06341c7e11a2504f2724"
|
||||
"checksum enum-map 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ccd9b2d5e0eb5c2ff851791e2af90ab4531b1168cfc239d1c0bf467e60ba3c89"
|
||||
"checksum enum-map 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "70a375f899a53b9848ad9fb459b5bf90e4851ae5d9fea89134b062dc1828b26e"
|
||||
"checksum enum-map-derive 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "e57001dfb2532f5a103ff869656887fae9a8defa7d236f3e39d2ee86ed629ad7"
|
||||
"checksum enum-map-internals 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "d2436d68e28d1ec1646f3e54003c6b4c4e192785532a687d52a3d2ba56c346bb"
|
||||
"checksum enum_primitive 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "be4551092f4d519593039259a9ed8daedf0da12e5109c5280338073eaeb81180"
|
||||
"checksum enumset 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "57b811aef4ff1cc938f13bbec348f0ecbfc2bb565b7ab90161c9f0b2805edc8a"
|
||||
"checksum enumset_derive 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "b184c2d0714bbeeb6440481a19c78530aa210654d99529f13d2f860a1b447598"
|
||||
|
@ -3059,7 +3089,6 @@ dependencies = [
|
|||
"checksum glob 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574"
|
||||
"checksum grin_secp256k1zkp 0.7.9 (registry+https://github.com/rust-lang/crates.io-index)" = "a4c2e7431d1999f02112c2383c9d33e7a6212947abfba92c87ab7283ba667a8b"
|
||||
"checksum h2 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b9433d71e471c1736fd5a61b671fc0b148d7a2992f666c958d03cd8feb3b88d1"
|
||||
"checksum hashbrown 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "29fba9abe4742d586dfd0c06ae4f7e73a1c2d86b856933509b269d82cdf06e18"
|
||||
"checksum heck 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "20564e78d53d2bb135c343b3f47714a56af2061f1c928fdb541dc7b9fdd94205"
|
||||
"checksum hermit-abi 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "eff2656d88f158ce120947499e971d743c05dbcbed62e5bd2f38f1698bbc3772"
|
||||
"checksum hmac 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)" = "733e1b3ac906631ca01ebb577e9bb0f5e37a454032b9036b5eaea4013ed6f99a"
|
||||
|
@ -3200,7 +3229,7 @@ dependencies = [
|
|||
"checksum serde_yaml 0.8.11 (registry+https://github.com/rust-lang/crates.io-index)" = "691b17f19fc1ec9d94ec0b5864859290dff279dbd7b03f017afda54eb36c3c35"
|
||||
"checksum sha2 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)" = "9eb6be24e4c23a84d7184280d2722f7f2731fcdd4a9d886efbfe4413e4847ea0"
|
||||
"checksum shlex 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7fdf1b9db47230893d76faad238fd6097fd6d6a9245cd7a4d90dbd639536bbd2"
|
||||
"checksum signal-hook 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)" = "7a9c17dd3ba2d36023a5c9472ecddeda07e27fd0b05436e8c1e0c8f178185652"
|
||||
"checksum signal-hook 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)" = "10b9f3a1686a29f53cfd91ee5e3db3c12313ec02d33765f02c1a9645a1811e2c"
|
||||
"checksum signal-hook-registry 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "94f478ede9f64724c5d173d7bb56099ec3e2d9fc2774aac65d34b8b890405f41"
|
||||
"checksum siphasher 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "0b8de496cf83d4ed58b6be86c3a275b8602f6ffe98d3024a869e124147a9a3ac"
|
||||
"checksum slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "c111b5bd5695e56cffe5129854aa230b39c93a305372fdbb2668ca2394eea9f8"
|
||||
|
@ -3274,7 +3303,7 @@ dependencies = [
|
|||
"checksum wincolor 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "96f5016b18804d24db43cebf3c77269e7569b8954a8464501c216cc5e070eaa9"
|
||||
"checksum winreg 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a27a759395c1195c4cc5cda607ef6f8f6498f64e78f7900f5de0a127a424704a"
|
||||
"checksum ws2_32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d59cefebd0c892fa2dd6de581e937301d8552cb44489cdff035c6187cb63fa5e"
|
||||
"checksum xi-unicode 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "12ea8eda4b1eb72f02d148402e23832d56a33f55d8c1b2d5bcdde91d79d47cb1"
|
||||
"checksum xi-unicode 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7395cdb9d0a6219fa0ea77d08c946adf9c1984c72fcd443ace30365f3daadef7"
|
||||
"checksum yaml-rust 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "e66366e18dc58b46801afbf2ca7661a9f59cc8c5962c29892b6039b4f86fa992"
|
||||
"checksum yaml-rust 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "65923dd1784f44da1d2c3dbbc5e822045628c590ba72123e1c73d3c230c4434d"
|
||||
"checksum zeroize 0.9.3 (registry+https://github.com/rust-lang/crates.io-index)" = "45af6a010d13e4cf5b54c94ba5a2b2eba5596b9e46bf5875612d332a1f2b3f86"
|
||||
|
|
11
Cargo.toml
11
Cargo.toml
|
@ -41,13 +41,10 @@ grin_p2p = { path = "./p2p", version = "4.0.0-alpha.1" }
|
|||
grin_servers = { path = "./servers", version = "4.0.0-alpha.1" }
|
||||
grin_util = { path = "./util", version = "4.0.0-alpha.1" }
|
||||
|
||||
[target.'cfg(windows)'.dependencies]
|
||||
cursive = { version = "0.12", default-features = false, features = ["pancurses-backend"] }
|
||||
[target.'cfg(windows)'.dependencies.pancurses]
|
||||
version = "0.16.0"
|
||||
features = ["win32"]
|
||||
[target.'cfg(unix)'.dependencies]
|
||||
cursive = "0.12"
|
||||
[dependencies.cursive]
|
||||
version = "0.14"
|
||||
default-features = false
|
||||
features = ["pancurses-backend"]
|
||||
|
||||
[build-dependencies]
|
||||
built = "0.3"
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
use cursive::theme::{BaseColor, Color, ColorStyle};
|
||||
use cursive::traits::Identifiable;
|
||||
use cursive::view::View;
|
||||
use cursive::views::BoxView;
|
||||
use cursive::views::ResizedView;
|
||||
use cursive::{Cursive, Printer};
|
||||
|
||||
use crate::tui::constants::VIEW_LOGS;
|
||||
|
@ -29,12 +29,12 @@ pub struct TUILogsView;
|
|||
|
||||
impl TUILogsView {
|
||||
pub fn create() -> Box<dyn View> {
|
||||
let logs_view = BoxView::with_full_screen(LogBufferView::new(200).with_id("logs"));
|
||||
Box::new(logs_view.with_id(VIEW_LOGS))
|
||||
let logs_view = ResizedView::with_full_screen(LogBufferView::new(200).with_name("logs"));
|
||||
Box::new(logs_view.with_name(VIEW_LOGS))
|
||||
}
|
||||
|
||||
pub fn update(c: &mut Cursive, entry: LogEntry) {
|
||||
c.call_on_id("logs", |t: &mut LogBufferView| {
|
||||
c.call_on_name("logs", |t: &mut LogBufferView| {
|
||||
t.update(entry);
|
||||
});
|
||||
}
|
||||
|
|
|
@ -20,7 +20,7 @@ use cursive::event::{EventResult, Key};
|
|||
use cursive::view::Identifiable;
|
||||
use cursive::view::View;
|
||||
use cursive::views::{
|
||||
BoxView, LinearLayout, OnEventView, SelectView, StackView, TextView, ViewRef,
|
||||
LinearLayout, OnEventView, ResizedView, SelectView, StackView, TextView, ViewRef,
|
||||
};
|
||||
use cursive::Cursive;
|
||||
|
||||
|
@ -30,7 +30,7 @@ use crate::tui::constants::{
|
|||
};
|
||||
|
||||
pub fn create() -> Box<dyn View> {
|
||||
let mut main_menu = SelectView::new().h_align(HAlign::Left).with_id(MAIN_MENU);
|
||||
let mut main_menu = SelectView::new().h_align(HAlign::Left).with_name(MAIN_MENU);
|
||||
main_menu
|
||||
.get_mut()
|
||||
.add_item("Basic Status", VIEW_BASIC_STATUS);
|
||||
|
@ -45,8 +45,8 @@ pub fn create() -> Box<dyn View> {
|
|||
return;
|
||||
}
|
||||
|
||||
let _ = s.call_on_id(ROOT_STACK, |sv: &mut StackView| {
|
||||
let pos = sv.find_layer_from_id(v).unwrap();
|
||||
let _ = s.call_on_name(ROOT_STACK, |sv: &mut StackView| {
|
||||
let pos = sv.find_layer_from_name(v).unwrap();
|
||||
sv.move_to_front(pos);
|
||||
});
|
||||
};
|
||||
|
@ -56,22 +56,22 @@ pub fn create() -> Box<dyn View> {
|
|||
.get_mut()
|
||||
.set_on_submit(|c: &mut Cursive, v: &str| {
|
||||
if v == VIEW_MINING {
|
||||
let _ = c.focus_id(SUBMENU_MINING_BUTTON);
|
||||
let _ = c.focus_name(SUBMENU_MINING_BUTTON);
|
||||
}
|
||||
});
|
||||
let main_menu = OnEventView::new(main_menu)
|
||||
.on_pre_event('j', move |c| {
|
||||
let mut s: ViewRef<SelectView<&str>> = c.find_id(MAIN_MENU).unwrap();
|
||||
let mut s: ViewRef<SelectView<&str>> = c.find_name(MAIN_MENU).unwrap();
|
||||
s.select_down(1)(c);
|
||||
Some(EventResult::Consumed(None));
|
||||
})
|
||||
.on_pre_event('k', move |c| {
|
||||
let mut s: ViewRef<SelectView<&str>> = c.find_id(MAIN_MENU).unwrap();
|
||||
let mut s: ViewRef<SelectView<&str>> = c.find_name(MAIN_MENU).unwrap();
|
||||
s.select_up(1)(c);
|
||||
Some(EventResult::Consumed(None));
|
||||
})
|
||||
.on_pre_event(Key::Tab, move |c| {
|
||||
let mut s: ViewRef<SelectView<&str>> = c.find_id(MAIN_MENU).unwrap();
|
||||
let mut s: ViewRef<SelectView<&str>> = c.find_name(MAIN_MENU).unwrap();
|
||||
if s.selected_id().unwrap() == s.len() - 1 {
|
||||
s.set_selection(0)(c);
|
||||
} else {
|
||||
|
@ -80,7 +80,7 @@ pub fn create() -> Box<dyn View> {
|
|||
Some(EventResult::Consumed(None));
|
||||
});
|
||||
let main_menu = LinearLayout::new(Orientation::Vertical)
|
||||
.child(BoxView::with_full_height(main_menu))
|
||||
.child(ResizedView::with_full_height(main_menu))
|
||||
.child(TextView::new("------------------"))
|
||||
.child(TextView::new("Tab/Arrow : Cycle "))
|
||||
.child(TextView::new("Enter : Select"))
|
||||
|
|
|
@ -22,7 +22,7 @@ use cursive::event::Key;
|
|||
use cursive::traits::{Boxable, Identifiable};
|
||||
use cursive::view::View;
|
||||
use cursive::views::{
|
||||
BoxView, Button, Dialog, LinearLayout, OnEventView, Panel, StackView, TextView,
|
||||
Button, Dialog, LinearLayout, OnEventView, Panel, ResizedView, StackView, TextView,
|
||||
};
|
||||
use cursive::Cursive;
|
||||
use std::time;
|
||||
|
@ -169,15 +169,15 @@ impl TUIStatusListener for TUIMiningView {
|
|||
/// Create the mining view
|
||||
fn create() -> Box<dyn View> {
|
||||
let devices_button = Button::new_raw("Mining Server Status", |s| {
|
||||
let _ = s.call_on_id("mining_stack_view", |sv: &mut StackView| {
|
||||
let pos = sv.find_layer_from_id("mining_device_view").unwrap();
|
||||
let _ = s.call_on_name("mining_stack_view", |sv: &mut StackView| {
|
||||
let pos = sv.find_layer_from_name("mining_device_view").unwrap();
|
||||
sv.move_to_front(pos);
|
||||
});
|
||||
})
|
||||
.with_id(SUBMENU_MINING_BUTTON);
|
||||
.with_name(SUBMENU_MINING_BUTTON);
|
||||
let difficulty_button = Button::new_raw("Difficulty", |s| {
|
||||
let _ = s.call_on_id("mining_stack_view", |sv: &mut StackView| {
|
||||
let pos = sv.find_layer_from_id("mining_difficulty_view").unwrap();
|
||||
let _ = s.call_on_name("mining_stack_view", |sv: &mut StackView| {
|
||||
let pos = sv.find_layer_from_name("mining_difficulty_view").unwrap();
|
||||
sv.move_to_front(pos);
|
||||
});
|
||||
});
|
||||
|
@ -212,61 +212,61 @@ impl TUIStatusListener for TUIMiningView {
|
|||
let status_view = LinearLayout::new(Orientation::Vertical)
|
||||
.child(
|
||||
LinearLayout::new(Orientation::Horizontal)
|
||||
.child(TextView::new(" ").with_id("stratum_config_status")),
|
||||
.child(TextView::new(" ").with_name("stratum_config_status")),
|
||||
)
|
||||
.child(
|
||||
LinearLayout::new(Orientation::Horizontal)
|
||||
.child(TextView::new(" ").with_id("stratum_is_running_status")),
|
||||
.child(TextView::new(" ").with_name("stratum_is_running_status")),
|
||||
)
|
||||
.child(
|
||||
LinearLayout::new(Orientation::Horizontal)
|
||||
.child(TextView::new(" ").with_id("stratum_num_workers_status")),
|
||||
.child(TextView::new(" ").with_name("stratum_num_workers_status")),
|
||||
)
|
||||
.child(
|
||||
LinearLayout::new(Orientation::Horizontal)
|
||||
.child(TextView::new(" ").with_id("stratum_block_height_status")),
|
||||
.child(TextView::new(" ").with_name("stratum_block_height_status")),
|
||||
)
|
||||
.child(
|
||||
LinearLayout::new(Orientation::Horizontal)
|
||||
.child(TextView::new(" ").with_id("stratum_network_difficulty_status")),
|
||||
.child(TextView::new(" ").with_name("stratum_network_difficulty_status")),
|
||||
)
|
||||
.child(
|
||||
LinearLayout::new(Orientation::Horizontal)
|
||||
.child(TextView::new(" ").with_id("stratum_network_hashrate")),
|
||||
.child(TextView::new(" ").with_name("stratum_network_hashrate")),
|
||||
)
|
||||
.child(
|
||||
LinearLayout::new(Orientation::Horizontal)
|
||||
.child(TextView::new(" ").with_id("stratum_edge_bits_status")),
|
||||
.child(TextView::new(" ").with_name("stratum_edge_bits_status")),
|
||||
);
|
||||
|
||||
let mining_device_view = LinearLayout::new(Orientation::Vertical)
|
||||
.child(status_view)
|
||||
.child(BoxView::with_full_screen(
|
||||
Dialog::around(table_view.with_id(TABLE_MINING_STATUS).min_size((50, 20)))
|
||||
.child(ResizedView::with_full_screen(
|
||||
Dialog::around(table_view.with_name(TABLE_MINING_STATUS).min_size((50, 20)))
|
||||
.title("Mining Workers"),
|
||||
))
|
||||
.with_id("mining_device_view");
|
||||
.with_name("mining_device_view");
|
||||
|
||||
let diff_status_view = LinearLayout::new(Orientation::Vertical)
|
||||
.child(
|
||||
LinearLayout::new(Orientation::Horizontal)
|
||||
.child(TextView::new("Tip Height: "))
|
||||
.child(TextView::new("").with_id("diff_cur_height")),
|
||||
.child(TextView::new("").with_name("diff_cur_height")),
|
||||
)
|
||||
.child(
|
||||
LinearLayout::new(Orientation::Horizontal)
|
||||
.child(TextView::new("Difficulty Adjustment Window: "))
|
||||
.child(TextView::new("").with_id("diff_adjust_window")),
|
||||
.child(TextView::new("").with_name("diff_adjust_window")),
|
||||
)
|
||||
.child(
|
||||
LinearLayout::new(Orientation::Horizontal)
|
||||
.child(TextView::new("Average Block Time: "))
|
||||
.child(TextView::new("").with_id("diff_avg_block_time")),
|
||||
.child(TextView::new("").with_name("diff_avg_block_time")),
|
||||
)
|
||||
.child(
|
||||
LinearLayout::new(Orientation::Horizontal)
|
||||
.child(TextView::new("Average Difficulty: "))
|
||||
.child(TextView::new("").with_id("diff_avg_difficulty")),
|
||||
.child(TextView::new("").with_name("diff_avg_difficulty")),
|
||||
);
|
||||
|
||||
let diff_table_view = TableView::<DiffBlock, DiffColumn>::new()
|
||||
|
@ -284,51 +284,51 @@ impl TUIStatusListener for TUIMiningView {
|
|||
|
||||
let mining_difficulty_view = LinearLayout::new(Orientation::Vertical)
|
||||
.child(diff_status_view)
|
||||
.child(BoxView::with_full_screen(
|
||||
.child(ResizedView::with_full_screen(
|
||||
Dialog::around(
|
||||
diff_table_view
|
||||
.with_id(TABLE_MINING_DIFF_STATUS)
|
||||
.with_name(TABLE_MINING_DIFF_STATUS)
|
||||
.min_size((50, 20)),
|
||||
)
|
||||
.title("Mining Difficulty Data"),
|
||||
))
|
||||
.with_id("mining_difficulty_view");
|
||||
.with_name("mining_difficulty_view");
|
||||
|
||||
let view_stack = StackView::new()
|
||||
.layer(mining_difficulty_view)
|
||||
.layer(mining_device_view)
|
||||
.with_id("mining_stack_view");
|
||||
.with_name("mining_stack_view");
|
||||
|
||||
let mining_view = LinearLayout::new(Orientation::Vertical)
|
||||
.child(mining_submenu)
|
||||
.child(view_stack);
|
||||
|
||||
let mining_view = OnEventView::new(mining_view).on_pre_event(Key::Esc, move |c| {
|
||||
let _ = c.focus_id(MAIN_MENU);
|
||||
let _ = c.focus_name(MAIN_MENU);
|
||||
});
|
||||
|
||||
Box::new(mining_view.with_id(VIEW_MINING))
|
||||
Box::new(mining_view.with_name(VIEW_MINING))
|
||||
}
|
||||
|
||||
/// update
|
||||
fn update(c: &mut Cursive, stats: &ServerStats) {
|
||||
c.call_on_id("diff_cur_height", |t: &mut TextView| {
|
||||
c.call_on_name("diff_cur_height", |t: &mut TextView| {
|
||||
t.set_content(stats.diff_stats.height.to_string());
|
||||
});
|
||||
c.call_on_id("diff_adjust_window", |t: &mut TextView| {
|
||||
c.call_on_name("diff_adjust_window", |t: &mut TextView| {
|
||||
t.set_content(stats.diff_stats.window_size.to_string());
|
||||
});
|
||||
let dur = time::Duration::from_secs(stats.diff_stats.average_block_time);
|
||||
c.call_on_id("diff_avg_block_time", |t: &mut TextView| {
|
||||
c.call_on_name("diff_avg_block_time", |t: &mut TextView| {
|
||||
t.set_content(format!("{} Secs", dur.as_secs()).to_string());
|
||||
});
|
||||
c.call_on_id("diff_avg_difficulty", |t: &mut TextView| {
|
||||
c.call_on_name("diff_avg_difficulty", |t: &mut TextView| {
|
||||
t.set_content(stats.diff_stats.average_difficulty.to_string());
|
||||
});
|
||||
|
||||
let mut diff_stats = stats.diff_stats.last_blocks.clone();
|
||||
diff_stats.reverse();
|
||||
let _ = c.call_on_id(
|
||||
let _ = c.call_on_name(
|
||||
TABLE_MINING_DIFF_STATUS,
|
||||
|t: &mut TableView<DiffBlock, DiffColumn>| {
|
||||
t.set_items(diff_stats);
|
||||
|
@ -351,28 +351,28 @@ impl TUIStatusListener for TUIMiningView {
|
|||
);
|
||||
let stratum_edge_bits = format!("Cuckoo Size: {}", stratum_stats.edge_bits);
|
||||
|
||||
c.call_on_id("stratum_config_status", |t: &mut TextView| {
|
||||
c.call_on_name("stratum_config_status", |t: &mut TextView| {
|
||||
t.set_content(stratum_enabled);
|
||||
});
|
||||
c.call_on_id("stratum_is_running_status", |t: &mut TextView| {
|
||||
c.call_on_name("stratum_is_running_status", |t: &mut TextView| {
|
||||
t.set_content(stratum_is_running);
|
||||
});
|
||||
c.call_on_id("stratum_num_workers_status", |t: &mut TextView| {
|
||||
c.call_on_name("stratum_num_workers_status", |t: &mut TextView| {
|
||||
t.set_content(stratum_num_workers);
|
||||
});
|
||||
c.call_on_id("stratum_block_height_status", |t: &mut TextView| {
|
||||
c.call_on_name("stratum_block_height_status", |t: &mut TextView| {
|
||||
t.set_content(stratum_block_height);
|
||||
});
|
||||
c.call_on_id("stratum_network_difficulty_status", |t: &mut TextView| {
|
||||
c.call_on_name("stratum_network_difficulty_status", |t: &mut TextView| {
|
||||
t.set_content(stratum_network_difficulty);
|
||||
});
|
||||
c.call_on_id("stratum_network_hashrate", |t: &mut TextView| {
|
||||
c.call_on_name("stratum_network_hashrate", |t: &mut TextView| {
|
||||
t.set_content(stratum_network_hashrate);
|
||||
});
|
||||
c.call_on_id("stratum_edge_bits_status", |t: &mut TextView| {
|
||||
c.call_on_name("stratum_edge_bits_status", |t: &mut TextView| {
|
||||
t.set_content(stratum_edge_bits);
|
||||
});
|
||||
let _ = c.call_on_id(
|
||||
let _ = c.call_on_name(
|
||||
TABLE_MINING_STATUS,
|
||||
|t: &mut TableView<WorkerStats, StratumWorkerColumn>| {
|
||||
t.set_items(worker_stats);
|
||||
|
|
|
@ -25,7 +25,7 @@ use cursive::direction::Orientation;
|
|||
use cursive::event::Key;
|
||||
use cursive::traits::{Boxable, Identifiable};
|
||||
use cursive::view::View;
|
||||
use cursive::views::{BoxView, Dialog, LinearLayout, OnEventView, TextView};
|
||||
use cursive::views::{Dialog, LinearLayout, OnEventView, ResizedView, TextView};
|
||||
use cursive::Cursive;
|
||||
|
||||
use crate::tui::constants::{MAIN_MENU, TABLE_PEER_STATUS, VIEW_PEER_SYNC};
|
||||
|
@ -136,28 +136,28 @@ impl TUIStatusListener for TUIPeerView {
|
|||
})
|
||||
.column(PeerColumn::Version, "Proto", |c| c.width_percent(6))
|
||||
.column(PeerColumn::UserAgent, "User Agent", |c| c.width_percent(18));
|
||||
let peer_status_view = BoxView::with_full_screen(
|
||||
let peer_status_view = ResizedView::with_full_screen(
|
||||
LinearLayout::new(Orientation::Vertical)
|
||||
.child(
|
||||
LinearLayout::new(Orientation::Horizontal)
|
||||
.child(TextView::new(" ").with_id("peers_total")),
|
||||
.child(TextView::new(" ").with_name("peers_total")),
|
||||
)
|
||||
.child(
|
||||
LinearLayout::new(Orientation::Horizontal)
|
||||
.child(TextView::new("Longest Chain: "))
|
||||
.child(TextView::new(" ").with_id("longest_work_peer")),
|
||||
.child(TextView::new(" ").with_name("longest_work_peer")),
|
||||
)
|
||||
.child(TextView::new(" "))
|
||||
.child(
|
||||
Dialog::around(table_view.with_id(TABLE_PEER_STATUS).min_size((50, 20)))
|
||||
Dialog::around(table_view.with_name(TABLE_PEER_STATUS).min_size((50, 20)))
|
||||
.title("Connected Peers"),
|
||||
),
|
||||
)
|
||||
.with_id(VIEW_PEER_SYNC);
|
||||
.with_name(VIEW_PEER_SYNC);
|
||||
|
||||
let peer_status_view =
|
||||
OnEventView::new(peer_status_view).on_pre_event(Key::Esc, move |c| {
|
||||
let _ = c.focus_id(MAIN_MENU);
|
||||
let _ = c.focus_name(MAIN_MENU);
|
||||
});
|
||||
|
||||
Box::new(peer_status_view)
|
||||
|
@ -179,13 +179,13 @@ impl TUIStatusListener for TUIPeerView {
|
|||
.to_string(),
|
||||
None => "".to_string(),
|
||||
};
|
||||
let _ = c.call_on_id(
|
||||
let _ = c.call_on_name(
|
||||
TABLE_PEER_STATUS,
|
||||
|t: &mut TableView<PeerStats, PeerColumn>| {
|
||||
t.set_items(stats.peer_stats.clone());
|
||||
},
|
||||
);
|
||||
let _ = c.call_on_id("peers_total", |t: &mut TextView| {
|
||||
let _ = c.call_on_name("peers_total", |t: &mut TextView| {
|
||||
t.set_content(format!(
|
||||
"Total Peers: {} (Outbound: {})",
|
||||
stats.peer_stats.len(),
|
||||
|
@ -196,7 +196,7 @@ impl TUIStatusListener for TUIPeerView {
|
|||
.count(),
|
||||
));
|
||||
});
|
||||
let _ = c.call_on_id("longest_work_peer", |t: &mut TextView| {
|
||||
let _ = c.call_on_name("longest_work_peer", |t: &mut TextView| {
|
||||
t.set_content(lp_str);
|
||||
});
|
||||
}
|
||||
|
|
|
@ -18,7 +18,7 @@ use chrono::prelude::Utc;
|
|||
use cursive::direction::Orientation;
|
||||
use cursive::traits::Identifiable;
|
||||
use cursive::view::View;
|
||||
use cursive::views::{BoxView, LinearLayout, TextView};
|
||||
use cursive::views::{LinearLayout, ResizedView, TextView};
|
||||
use cursive::Cursive;
|
||||
|
||||
use crate::tui::constants::VIEW_BASIC_STATUS;
|
||||
|
@ -137,22 +137,22 @@ impl TUIStatusView {
|
|||
impl TUIStatusListener for TUIStatusView {
|
||||
/// Create basic status view
|
||||
fn create() -> Box<dyn View> {
|
||||
let basic_status_view = BoxView::with_full_screen(
|
||||
let basic_status_view = ResizedView::with_full_screen(
|
||||
LinearLayout::new(Orientation::Vertical)
|
||||
.child(
|
||||
LinearLayout::new(Orientation::Horizontal)
|
||||
.child(TextView::new("Current Status: "))
|
||||
.child(TextView::new("Starting").with_id("basic_current_status")),
|
||||
.child(TextView::new("Starting").with_name("basic_current_status")),
|
||||
)
|
||||
.child(
|
||||
LinearLayout::new(Orientation::Horizontal)
|
||||
.child(TextView::new("Connected Peers: "))
|
||||
.child(TextView::new("0").with_id("connected_peers")),
|
||||
.child(TextView::new("0").with_name("connected_peers")),
|
||||
)
|
||||
.child(
|
||||
LinearLayout::new(Orientation::Horizontal)
|
||||
.child(TextView::new("Disk Usage (GB): "))
|
||||
.child(TextView::new("0").with_id("disk_usage")),
|
||||
.child(TextView::new("0").with_name("disk_usage")),
|
||||
)
|
||||
.child(
|
||||
LinearLayout::new(Orientation::Horizontal).child(TextView::new(
|
||||
|
@ -162,22 +162,22 @@ impl TUIStatusListener for TUIStatusView {
|
|||
.child(
|
||||
LinearLayout::new(Orientation::Horizontal)
|
||||
.child(TextView::new("Header Tip Hash: "))
|
||||
.child(TextView::new(" ").with_id("basic_header_tip_hash")),
|
||||
.child(TextView::new(" ").with_name("basic_header_tip_hash")),
|
||||
)
|
||||
.child(
|
||||
LinearLayout::new(Orientation::Horizontal)
|
||||
.child(TextView::new("Header Chain Height: "))
|
||||
.child(TextView::new(" ").with_id("basic_header_chain_height")),
|
||||
.child(TextView::new(" ").with_name("basic_header_chain_height")),
|
||||
)
|
||||
.child(
|
||||
LinearLayout::new(Orientation::Horizontal)
|
||||
.child(TextView::new("Header Cumulative Difficulty: "))
|
||||
.child(TextView::new(" ").with_id("basic_header_total_difficulty")),
|
||||
.child(TextView::new(" ").with_name("basic_header_total_difficulty")),
|
||||
)
|
||||
.child(
|
||||
LinearLayout::new(Orientation::Horizontal)
|
||||
.child(TextView::new("Header Tip Timestamp: "))
|
||||
.child(TextView::new(" ").with_id("basic_header_timestamp")),
|
||||
.child(TextView::new(" ").with_name("basic_header_timestamp")),
|
||||
)
|
||||
.child(
|
||||
LinearLayout::new(Orientation::Horizontal).child(TextView::new(
|
||||
|
@ -187,22 +187,22 @@ impl TUIStatusListener for TUIStatusView {
|
|||
.child(
|
||||
LinearLayout::new(Orientation::Horizontal)
|
||||
.child(TextView::new("Chain Tip Hash: "))
|
||||
.child(TextView::new(" ").with_id("tip_hash")),
|
||||
.child(TextView::new(" ").with_name("tip_hash")),
|
||||
)
|
||||
.child(
|
||||
LinearLayout::new(Orientation::Horizontal)
|
||||
.child(TextView::new("Chain Height: "))
|
||||
.child(TextView::new(" ").with_id("chain_height")),
|
||||
.child(TextView::new(" ").with_name("chain_height")),
|
||||
)
|
||||
.child(
|
||||
LinearLayout::new(Orientation::Horizontal)
|
||||
.child(TextView::new("Chain Cumulative Difficulty: "))
|
||||
.child(TextView::new(" ").with_id("basic_total_difficulty")),
|
||||
.child(TextView::new(" ").with_name("basic_total_difficulty")),
|
||||
)
|
||||
.child(
|
||||
LinearLayout::new(Orientation::Horizontal)
|
||||
.child(TextView::new("Chain Tip Timestamp: "))
|
||||
.child(TextView::new(" ").with_id("chain_timestamp")),
|
||||
.child(TextView::new(" ").with_name("chain_timestamp")),
|
||||
)
|
||||
.child(
|
||||
LinearLayout::new(Orientation::Horizontal).child(TextView::new(
|
||||
|
@ -212,17 +212,17 @@ impl TUIStatusListener for TUIStatusView {
|
|||
.child(
|
||||
LinearLayout::new(Orientation::Horizontal)
|
||||
.child(TextView::new("Transaction Pool Size: "))
|
||||
.child(TextView::new("0").with_id("tx_pool_size"))
|
||||
.child(TextView::new("0").with_name("tx_pool_size"))
|
||||
.child(TextView::new(" ("))
|
||||
.child(TextView::new("0").with_id("tx_pool_kernels"))
|
||||
.child(TextView::new("0").with_name("tx_pool_kernels"))
|
||||
.child(TextView::new(")")),
|
||||
)
|
||||
.child(
|
||||
LinearLayout::new(Orientation::Horizontal)
|
||||
.child(TextView::new("Stem Pool Size: "))
|
||||
.child(TextView::new("0").with_id("stem_pool_size"))
|
||||
.child(TextView::new("0").with_name("stem_pool_size"))
|
||||
.child(TextView::new(" ("))
|
||||
.child(TextView::new("0").with_id("stem_pool_kernels"))
|
||||
.child(TextView::new("0").with_name("stem_pool_kernels"))
|
||||
.child(TextView::new(")")),
|
||||
)
|
||||
.child(
|
||||
|
@ -232,67 +232,67 @@ impl TUIStatusListener for TUIStatusView {
|
|||
)
|
||||
.child(
|
||||
LinearLayout::new(Orientation::Horizontal)
|
||||
.child(TextView::new(" ").with_id("basic_mining_config_status")),
|
||||
.child(TextView::new(" ").with_name("basic_mining_config_status")),
|
||||
)
|
||||
.child(
|
||||
LinearLayout::new(Orientation::Horizontal)
|
||||
.child(TextView::new(" ").with_id("basic_mining_status")),
|
||||
.child(TextView::new(" ").with_name("basic_mining_status")),
|
||||
)
|
||||
.child(
|
||||
LinearLayout::new(Orientation::Horizontal)
|
||||
.child(TextView::new(" ").with_id("basic_network_info")),
|
||||
.child(TextView::new(" ").with_name("basic_network_info")),
|
||||
), //.child(logo_view)
|
||||
);
|
||||
Box::new(basic_status_view.with_id(VIEW_BASIC_STATUS))
|
||||
Box::new(basic_status_view.with_name(VIEW_BASIC_STATUS))
|
||||
}
|
||||
|
||||
fn update(c: &mut Cursive, stats: &ServerStats) {
|
||||
let basic_status = TUIStatusView::update_sync_status(stats.sync_status);
|
||||
|
||||
c.call_on_id("basic_current_status", |t: &mut TextView| {
|
||||
c.call_on_name("basic_current_status", |t: &mut TextView| {
|
||||
t.set_content(basic_status);
|
||||
});
|
||||
c.call_on_id("connected_peers", |t: &mut TextView| {
|
||||
c.call_on_name("connected_peers", |t: &mut TextView| {
|
||||
t.set_content(stats.peer_count.to_string());
|
||||
});
|
||||
c.call_on_id("disk_usage", |t: &mut TextView| {
|
||||
c.call_on_name("disk_usage", |t: &mut TextView| {
|
||||
t.set_content(stats.disk_usage_gb.clone());
|
||||
});
|
||||
c.call_on_id("tip_hash", |t: &mut TextView| {
|
||||
c.call_on_name("tip_hash", |t: &mut TextView| {
|
||||
t.set_content(stats.chain_stats.last_block_h.to_string() + "...");
|
||||
});
|
||||
c.call_on_id("chain_height", |t: &mut TextView| {
|
||||
c.call_on_name("chain_height", |t: &mut TextView| {
|
||||
t.set_content(stats.chain_stats.height.to_string());
|
||||
});
|
||||
c.call_on_id("basic_total_difficulty", |t: &mut TextView| {
|
||||
c.call_on_name("basic_total_difficulty", |t: &mut TextView| {
|
||||
t.set_content(stats.chain_stats.total_difficulty.to_string());
|
||||
});
|
||||
c.call_on_id("chain_timestamp", |t: &mut TextView| {
|
||||
c.call_on_name("chain_timestamp", |t: &mut TextView| {
|
||||
t.set_content(stats.chain_stats.latest_timestamp.to_string());
|
||||
});
|
||||
c.call_on_id("basic_header_tip_hash", |t: &mut TextView| {
|
||||
c.call_on_name("basic_header_tip_hash", |t: &mut TextView| {
|
||||
t.set_content(stats.header_stats.last_block_h.to_string() + "...");
|
||||
});
|
||||
c.call_on_id("basic_header_chain_height", |t: &mut TextView| {
|
||||
c.call_on_name("basic_header_chain_height", |t: &mut TextView| {
|
||||
t.set_content(stats.header_stats.height.to_string());
|
||||
});
|
||||
c.call_on_id("basic_header_total_difficulty", |t: &mut TextView| {
|
||||
c.call_on_name("basic_header_total_difficulty", |t: &mut TextView| {
|
||||
t.set_content(stats.header_stats.total_difficulty.to_string());
|
||||
});
|
||||
c.call_on_id("basic_header_timestamp", |t: &mut TextView| {
|
||||
c.call_on_name("basic_header_timestamp", |t: &mut TextView| {
|
||||
t.set_content(stats.header_stats.latest_timestamp.to_string());
|
||||
});
|
||||
if let Some(tx_stats) = &stats.tx_stats {
|
||||
c.call_on_id("tx_pool_size", |t: &mut TextView| {
|
||||
c.call_on_name("tx_pool_size", |t: &mut TextView| {
|
||||
t.set_content(tx_stats.tx_pool_size.to_string());
|
||||
});
|
||||
c.call_on_id("stem_pool_size", |t: &mut TextView| {
|
||||
c.call_on_name("stem_pool_size", |t: &mut TextView| {
|
||||
t.set_content(tx_stats.stem_pool_size.to_string());
|
||||
});
|
||||
c.call_on_id("tx_pool_kernels", |t: &mut TextView| {
|
||||
c.call_on_name("tx_pool_kernels", |t: &mut TextView| {
|
||||
t.set_content(tx_stats.tx_pool_kernels.to_string());
|
||||
});
|
||||
c.call_on_id("stem_pool_kernels", |t: &mut TextView| {
|
||||
c.call_on_name("stem_pool_kernels", |t: &mut TextView| {
|
||||
t.set_content(tx_stats.stem_pool_kernels.to_string());
|
||||
});
|
||||
}
|
||||
|
|
|
@ -26,7 +26,7 @@ use cursive::theme::{BaseColor, BorderStyle, Color, Theme};
|
|||
use cursive::traits::Boxable;
|
||||
use cursive::traits::Identifiable;
|
||||
use cursive::utils::markup::StyledString;
|
||||
use cursive::views::{CircularFocus, Dialog, LinearLayout, Panel, StackView, TextView, ViewBox};
|
||||
use cursive::views::{BoxedView, CircularFocus, Dialog, LinearLayout, Panel, StackView, TextView};
|
||||
use cursive::Cursive;
|
||||
use std::sync::mpsc;
|
||||
|
||||
|
@ -88,7 +88,7 @@ impl UI {
|
|||
.layer(peer_view)
|
||||
.layer(logs_view)
|
||||
.layer(status_view)
|
||||
.with_id(ROOT_STACK)
|
||||
.with_name(ROOT_STACK)
|
||||
.full_height();
|
||||
|
||||
let mut title_string = StyledString::new();
|
||||
|
@ -105,7 +105,7 @@ impl UI {
|
|||
.child(Panel::new(TextView::new(title_string).full_width()))
|
||||
.child(
|
||||
LinearLayout::new(Orientation::Horizontal)
|
||||
.child(Panel::new(ViewBox::new(main_menu)))
|
||||
.child(Panel::new(BoxedView::new(main_menu)))
|
||||
.child(Panel::new(root_stack)),
|
||||
);
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
use cursive::direction::Orientation;
|
||||
use cursive::traits::Identifiable;
|
||||
use cursive::view::View;
|
||||
use cursive::views::{BoxView, LinearLayout, TextView};
|
||||
use cursive::views::{LinearLayout, ResizedView, TextView};
|
||||
use cursive::Cursive;
|
||||
|
||||
use crate::tui::constants::VIEW_VERSION;
|
||||
|
@ -32,13 +32,13 @@ impl TUIStatusListener for TUIVersionView {
|
|||
/// Create basic status view
|
||||
fn create() -> Box<dyn View> {
|
||||
let (basic_info, detailed_info) = info_strings();
|
||||
let basic_status_view = BoxView::with_full_screen(
|
||||
let basic_status_view = ResizedView::with_full_screen(
|
||||
LinearLayout::new(Orientation::Vertical)
|
||||
.child(TextView::new(basic_info))
|
||||
.child(TextView::new(" "))
|
||||
.child(TextView::new(detailed_info)),
|
||||
);
|
||||
Box::new(basic_status_view.with_id(VIEW_VERSION))
|
||||
Box::new(basic_status_view.with_name(VIEW_VERSION))
|
||||
}
|
||||
|
||||
/// update
|
||||
|
|
Loading…
Reference in a new issue