Start rust version of trace viewer.
This commit is contained in:
parent
321fe4caa6
commit
10f8abd5bf
4
.gitignore
vendored
4
.gitignore
vendored
@ -21,3 +21,7 @@
|
|||||||
npm-debug.log*
|
npm-debug.log*
|
||||||
yarn-debug.log*
|
yarn-debug.log*
|
||||||
yarn-error.log*
|
yarn-error.log*
|
||||||
|
/target
|
||||||
|
/pkg
|
||||||
|
|
||||||
|
/dist/
|
||||||
|
|||||||
845
Cargo.lock
generated
Normal file
845
Cargo.lock
generated
Normal file
@ -0,0 +1,845 @@
|
|||||||
|
# This file is automatically @generated by Cargo.
|
||||||
|
# It is not intended for manual editing.
|
||||||
|
version = 3
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "autocfg"
|
||||||
|
version = "1.0.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "base-x"
|
||||||
|
version = "0.2.8"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "a4521f3e3d031370679b3b140beb36dfe4801b09ac77e30c61941f97df3ef28b"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "bitflags"
|
||||||
|
version = "1.2.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "bumpalo"
|
||||||
|
version = "3.6.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "63396b8a4b9de3f4fdfb320ab6080762242f66a8ef174c49d8e19b674db4cdbe"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "cfg-if"
|
||||||
|
version = "0.1.10"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "cfg-if"
|
||||||
|
version = "1.0.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "console_error_panic_hook"
|
||||||
|
version = "0.1.6"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "b8d976903543e0c48546a91908f21588a680a8c8f984df9a5d69feccb2b2a211"
|
||||||
|
dependencies = [
|
||||||
|
"cfg-if 0.1.10",
|
||||||
|
"wasm-bindgen",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "const_fn"
|
||||||
|
version = "0.4.6"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "076a6803b0dacd6a88cfe64deba628b01533ff5ef265687e6938280c1afd0a28"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "cookie"
|
||||||
|
version = "0.14.4"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "03a5d7b21829bc7b4bf4754a978a241ae54ea55a40f92bb20216e54096f4b951"
|
||||||
|
dependencies = [
|
||||||
|
"percent-encoding",
|
||||||
|
"time",
|
||||||
|
"version_check 0.9.3",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "dbg"
|
||||||
|
version = "1.0.4"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "4677188513e0e9d7adced5997cf9a1e7a3c996c994f90093325c5332c1a8b221"
|
||||||
|
dependencies = [
|
||||||
|
"version_check 0.1.5",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "discard"
|
||||||
|
version = "1.0.4"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "212d0f5754cb6769937f4501cc0e67f4f4483c8d2c3e1e922ee9edbe4ab4c7c0"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "enclose"
|
||||||
|
version = "1.1.8"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "1056f553da426e9c025a662efa48b52e62e0a3a7648aa2d15aeaaf7f0d329357"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "futures"
|
||||||
|
version = "0.3.13"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "7f55667319111d593ba876406af7c409c0ebb44dc4be6132a783ccf163ea14c1"
|
||||||
|
dependencies = [
|
||||||
|
"futures-channel",
|
||||||
|
"futures-core",
|
||||||
|
"futures-executor",
|
||||||
|
"futures-io",
|
||||||
|
"futures-sink",
|
||||||
|
"futures-task",
|
||||||
|
"futures-util",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "futures-channel"
|
||||||
|
version = "0.3.13"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "8c2dd2df839b57db9ab69c2c9d8f3e8c81984781937fe2807dc6dcf3b2ad2939"
|
||||||
|
dependencies = [
|
||||||
|
"futures-core",
|
||||||
|
"futures-sink",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "futures-core"
|
||||||
|
version = "0.3.13"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "15496a72fabf0e62bdc3df11a59a3787429221dd0710ba8ef163d6f7a9112c94"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "futures-executor"
|
||||||
|
version = "0.3.13"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "891a4b7b96d84d5940084b2a37632dd65deeae662c114ceaa2c879629c9c0ad1"
|
||||||
|
dependencies = [
|
||||||
|
"futures-core",
|
||||||
|
"futures-task",
|
||||||
|
"futures-util",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "futures-io"
|
||||||
|
version = "0.3.13"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "d71c2c65c57704c32f5241c1223167c2c3294fd34ac020c807ddbe6db287ba59"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "futures-macro"
|
||||||
|
version = "0.3.13"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "ea405816a5139fb39af82c2beb921d52143f556038378d6db21183a5c37fbfb7"
|
||||||
|
dependencies = [
|
||||||
|
"proc-macro-hack",
|
||||||
|
"proc-macro2",
|
||||||
|
"quote",
|
||||||
|
"syn",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "futures-sink"
|
||||||
|
version = "0.3.13"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "85754d98985841b7d4f5e8e6fbfa4a4ac847916893ec511a2917ccd8525b8bb3"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "futures-task"
|
||||||
|
version = "0.3.13"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "fa189ef211c15ee602667a6fcfe1c1fd9e07d42250d2156382820fba33c9df80"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "futures-util"
|
||||||
|
version = "0.3.13"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "1812c7ab8aedf8d6f2701a43e1243acdbcc2b36ab26e2ad421eb99ac963d96d1"
|
||||||
|
dependencies = [
|
||||||
|
"futures-channel",
|
||||||
|
"futures-core",
|
||||||
|
"futures-io",
|
||||||
|
"futures-macro",
|
||||||
|
"futures-sink",
|
||||||
|
"futures-task",
|
||||||
|
"memchr",
|
||||||
|
"pin-project-lite",
|
||||||
|
"pin-utils",
|
||||||
|
"proc-macro-hack",
|
||||||
|
"proc-macro-nested",
|
||||||
|
"slab",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "getopts"
|
||||||
|
version = "0.2.21"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "14dbbfd5c71d70241ecf9e6f13737f7b5ce823821063188d7e46c41d371eebd5"
|
||||||
|
dependencies = [
|
||||||
|
"unicode-width",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "getrandom"
|
||||||
|
version = "0.1.16"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce"
|
||||||
|
dependencies = [
|
||||||
|
"cfg-if 1.0.0",
|
||||||
|
"js-sys",
|
||||||
|
"libc",
|
||||||
|
"wasi 0.9.0+wasi-snapshot-preview1",
|
||||||
|
"wasm-bindgen",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "getrandom"
|
||||||
|
version = "0.2.2"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "c9495705279e7140bf035dde1f6e750c162df8b625267cd52cc44e0b156732c8"
|
||||||
|
dependencies = [
|
||||||
|
"cfg-if 1.0.0",
|
||||||
|
"js-sys",
|
||||||
|
"libc",
|
||||||
|
"wasi 0.10.2+wasi-snapshot-preview1",
|
||||||
|
"wasm-bindgen",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "gloo-events"
|
||||||
|
version = "0.1.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "088514ec8ef284891c762c88a66b639b3a730134714692ee31829765c5bc814f"
|
||||||
|
dependencies = [
|
||||||
|
"wasm-bindgen",
|
||||||
|
"web-sys",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "gloo-file"
|
||||||
|
version = "0.1.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "8f9fecfe46b5dc3cc46f58e98ba580cc714f2c93860796d002eb3527a465ef49"
|
||||||
|
dependencies = [
|
||||||
|
"futures-channel",
|
||||||
|
"gloo-events",
|
||||||
|
"js-sys",
|
||||||
|
"wasm-bindgen",
|
||||||
|
"web-sys",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "gloo-timers"
|
||||||
|
version = "0.2.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "47204a46aaff920a1ea58b11d03dec6f704287d27561724a4631e450654a891f"
|
||||||
|
dependencies = [
|
||||||
|
"futures-channel",
|
||||||
|
"futures-core",
|
||||||
|
"js-sys",
|
||||||
|
"wasm-bindgen",
|
||||||
|
"web-sys",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "hashbrown"
|
||||||
|
version = "0.9.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "d7afe4a420e3fe79967a00898cc1f4db7c8a49a9333a29f8a4bd76a253d5cd04"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "indexmap"
|
||||||
|
version = "1.6.2"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "824845a0bf897a9042383849b02c1bc219c2383772efcd5c6f9766fa4b81aef3"
|
||||||
|
dependencies = [
|
||||||
|
"autocfg",
|
||||||
|
"hashbrown",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "itoa"
|
||||||
|
version = "0.4.7"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "dd25036021b0de88a0aff6b850051563c6516d0bf53f8638938edbb9de732736"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "js-sys"
|
||||||
|
version = "0.3.50"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "2d99f9e3e84b8f67f846ef5b4cbbc3b1c29f6c759fcbce6f01aa0e73d932a24c"
|
||||||
|
dependencies = [
|
||||||
|
"wasm-bindgen",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "lazy_static"
|
||||||
|
version = "1.4.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "libc"
|
||||||
|
version = "0.2.92"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "56d855069fafbb9b344c0f962150cd2c1187975cb1c22c1522c240d8c4986714"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "log"
|
||||||
|
version = "0.4.14"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710"
|
||||||
|
dependencies = [
|
||||||
|
"cfg-if 1.0.0",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "memchr"
|
||||||
|
version = "2.3.4"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "0ee1c47aaa256ecabcaea351eae4a9b01ef39ed810004e298d2511ed284b1525"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "percent-encoding"
|
||||||
|
version = "2.1.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "pin-project-lite"
|
||||||
|
version = "0.2.6"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "dc0e1f259c92177c30a4c9d177246edd0a3568b25756a977d0632cf8fa37e905"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "pin-utils"
|
||||||
|
version = "0.1.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "ppv-lite86"
|
||||||
|
version = "0.2.10"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "ac74c624d6b2d21f425f752262f42188365d7b8ff1aff74c82e45136510a4857"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "proc-macro-hack"
|
||||||
|
version = "0.5.19"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "dbf0c48bc1d91375ae5c3cd81e3722dff1abcf81a30960240640d223f59fe0e5"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "proc-macro-nested"
|
||||||
|
version = "0.1.7"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "bc881b2c22681370c6a780e47af9840ef841837bc98118431d4e1868bd0c1086"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "proc-macro2"
|
||||||
|
version = "1.0.51"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "5d727cae5b39d21da60fa540906919ad737832fe0b1c165da3a34d6548c849d6"
|
||||||
|
dependencies = [
|
||||||
|
"unicode-ident",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "pulldown-cmark"
|
||||||
|
version = "0.8.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "ffade02495f22453cd593159ea2f59827aae7f53fa8323f756799b670881dcf8"
|
||||||
|
dependencies = [
|
||||||
|
"bitflags",
|
||||||
|
"getopts",
|
||||||
|
"memchr",
|
||||||
|
"unicase",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "quote"
|
||||||
|
version = "1.0.9"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "c3d0b9745dc2debf507c8422de05d7226cc1f0644216dfdfead988f9b1ab32a7"
|
||||||
|
dependencies = [
|
||||||
|
"proc-macro2",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "rand"
|
||||||
|
version = "0.7.3"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03"
|
||||||
|
dependencies = [
|
||||||
|
"getrandom 0.1.16",
|
||||||
|
"libc",
|
||||||
|
"rand_chacha",
|
||||||
|
"rand_core",
|
||||||
|
"rand_hc",
|
||||||
|
"rand_pcg",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "rand_chacha"
|
||||||
|
version = "0.2.2"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402"
|
||||||
|
dependencies = [
|
||||||
|
"ppv-lite86",
|
||||||
|
"rand_core",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "rand_core"
|
||||||
|
version = "0.5.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19"
|
||||||
|
dependencies = [
|
||||||
|
"getrandom 0.1.16",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "rand_hc"
|
||||||
|
version = "0.2.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c"
|
||||||
|
dependencies = [
|
||||||
|
"rand_core",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "rand_pcg"
|
||||||
|
version = "0.2.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "16abd0c1b639e9eb4d7c50c0b8100b0d0f849be2349829c740fe8e6eb4816429"
|
||||||
|
dependencies = [
|
||||||
|
"rand_core",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "rustc_version"
|
||||||
|
version = "0.2.3"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a"
|
||||||
|
dependencies = [
|
||||||
|
"semver",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "ryu"
|
||||||
|
version = "1.0.5"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86e"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "scoped-tls"
|
||||||
|
version = "1.0.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "ea6a9290e3c9cf0f18145ef7ffa62d68ee0bf5fcd651017e586dc7fd5da448c2"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "seed"
|
||||||
|
version = "0.8.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "3b599be9cc57456f4b7fc99b8abfb154d4819f7b6c147e80be5580663dad4536"
|
||||||
|
dependencies = [
|
||||||
|
"console_error_panic_hook",
|
||||||
|
"cookie",
|
||||||
|
"dbg",
|
||||||
|
"enclose",
|
||||||
|
"futures",
|
||||||
|
"gloo-file",
|
||||||
|
"gloo-timers",
|
||||||
|
"indexmap",
|
||||||
|
"js-sys",
|
||||||
|
"pulldown-cmark",
|
||||||
|
"rand",
|
||||||
|
"serde",
|
||||||
|
"serde_json",
|
||||||
|
"uuid",
|
||||||
|
"version_check 0.9.3",
|
||||||
|
"wasm-bindgen",
|
||||||
|
"wasm-bindgen-futures",
|
||||||
|
"web-sys",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "semver"
|
||||||
|
version = "0.9.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403"
|
||||||
|
dependencies = [
|
||||||
|
"semver-parser",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "semver-parser"
|
||||||
|
version = "0.7.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "serde"
|
||||||
|
version = "1.0.152"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "bb7d1f0d3021d347a83e556fc4683dea2ea09d87bccdf88ff5c12545d89d5efb"
|
||||||
|
dependencies = [
|
||||||
|
"serde_derive",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "serde_derive"
|
||||||
|
version = "1.0.152"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "af487d118eecd09402d70a5d72551860e788df87b464af30e5ea6a38c75c541e"
|
||||||
|
dependencies = [
|
||||||
|
"proc-macro2",
|
||||||
|
"quote",
|
||||||
|
"syn",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "serde_json"
|
||||||
|
version = "1.0.64"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "799e97dc9fdae36a5c8b8f2cae9ce2ee9fdce2058c57a93e6099d919fd982f79"
|
||||||
|
dependencies = [
|
||||||
|
"itoa",
|
||||||
|
"ryu",
|
||||||
|
"serde",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "sha1"
|
||||||
|
version = "0.6.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "2579985fda508104f7587689507983eadd6a6e84dd35d6d115361f530916fa0d"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "slab"
|
||||||
|
version = "0.4.2"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "c111b5bd5695e56cffe5129854aa230b39c93a305372fdbb2668ca2394eea9f8"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "standback"
|
||||||
|
version = "0.2.17"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "e113fb6f3de07a243d434a56ec6f186dfd51cb08448239fe7bcae73f87ff28ff"
|
||||||
|
dependencies = [
|
||||||
|
"version_check 0.9.3",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "stdweb"
|
||||||
|
version = "0.4.20"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "d022496b16281348b52d0e30ae99e01a73d737b2f45d38fed4edf79f9325a1d5"
|
||||||
|
dependencies = [
|
||||||
|
"discard",
|
||||||
|
"rustc_version",
|
||||||
|
"stdweb-derive",
|
||||||
|
"stdweb-internal-macros",
|
||||||
|
"stdweb-internal-runtime",
|
||||||
|
"wasm-bindgen",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "stdweb-derive"
|
||||||
|
version = "0.5.3"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "c87a60a40fccc84bef0652345bbbbbe20a605bf5d0ce81719fc476f5c03b50ef"
|
||||||
|
dependencies = [
|
||||||
|
"proc-macro2",
|
||||||
|
"quote",
|
||||||
|
"serde",
|
||||||
|
"serde_derive",
|
||||||
|
"syn",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "stdweb-internal-macros"
|
||||||
|
version = "0.2.9"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "58fa5ff6ad0d98d1ffa8cb115892b6e69d67799f6763e162a1c9db421dc22e11"
|
||||||
|
dependencies = [
|
||||||
|
"base-x",
|
||||||
|
"proc-macro2",
|
||||||
|
"quote",
|
||||||
|
"serde",
|
||||||
|
"serde_derive",
|
||||||
|
"serde_json",
|
||||||
|
"sha1",
|
||||||
|
"syn",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "stdweb-internal-runtime"
|
||||||
|
version = "0.1.5"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "213701ba3370744dcd1a12960caa4843b3d68b4d1c0a5d575e0d65b2ee9d16c0"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "syn"
|
||||||
|
version = "1.0.107"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "1f4064b5b16e03ae50984a5a8ed5d4f8803e6bc1fd170a3cda91a1be4b18e3f5"
|
||||||
|
dependencies = [
|
||||||
|
"proc-macro2",
|
||||||
|
"quote",
|
||||||
|
"unicode-ident",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "thiserror"
|
||||||
|
version = "1.0.38"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "6a9cd18aa97d5c45c6603caea1da6628790b37f7a34b6ca89522331c5180fed0"
|
||||||
|
dependencies = [
|
||||||
|
"thiserror-impl",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "thiserror-impl"
|
||||||
|
version = "1.0.38"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "1fb327af4685e4d03fa8cbcf1716380da910eeb2bb8be417e7f9fd3fb164f36f"
|
||||||
|
dependencies = [
|
||||||
|
"proc-macro2",
|
||||||
|
"quote",
|
||||||
|
"syn",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "time"
|
||||||
|
version = "0.2.26"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "08a8cbfbf47955132d0202d1662f49b2423ae35862aee471f3ba4b133358f372"
|
||||||
|
dependencies = [
|
||||||
|
"const_fn",
|
||||||
|
"libc",
|
||||||
|
"standback",
|
||||||
|
"stdweb",
|
||||||
|
"time-macros",
|
||||||
|
"version_check 0.9.3",
|
||||||
|
"winapi",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "time-macros"
|
||||||
|
version = "0.1.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "957e9c6e26f12cb6d0dd7fc776bb67a706312e7299aed74c8dd5b17ebb27e2f1"
|
||||||
|
dependencies = [
|
||||||
|
"proc-macro-hack",
|
||||||
|
"time-macros-impl",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "time-macros-impl"
|
||||||
|
version = "0.1.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "e5c3be1edfad6027c69f5491cf4cb310d1a71ecd6af742788c6ff8bced86b8fa"
|
||||||
|
dependencies = [
|
||||||
|
"proc-macro-hack",
|
||||||
|
"proc-macro2",
|
||||||
|
"quote",
|
||||||
|
"standback",
|
||||||
|
"syn",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "tracerviewer"
|
||||||
|
version = "0.1.0"
|
||||||
|
dependencies = [
|
||||||
|
"seed",
|
||||||
|
"serde",
|
||||||
|
"thiserror",
|
||||||
|
"wasm-bindgen-test",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "unicase"
|
||||||
|
version = "2.6.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "50f37be617794602aabbeee0be4f259dc1778fabe05e2d67ee8f79326d5cb4f6"
|
||||||
|
dependencies = [
|
||||||
|
"version_check 0.9.3",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "unicode-ident"
|
||||||
|
version = "1.0.6"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "84a22b9f218b40614adcb3f4ff08b703773ad44fa9423e4e0d346d5db86e4ebc"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "unicode-width"
|
||||||
|
version = "0.1.8"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "9337591893a19b88d8d87f2cec1e73fad5cdfd10e5a6f349f498ad6ea2ffb1e3"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "uuid"
|
||||||
|
version = "0.8.2"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "bc5cf98d8186244414c848017f0e2676b3fcb46807f6668a97dfe67359a3c4b7"
|
||||||
|
dependencies = [
|
||||||
|
"getrandom 0.2.2",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "version_check"
|
||||||
|
version = "0.1.5"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "914b1a6776c4c929a602fafd8bc742e06365d4bcbe48c30f9cca5824f70dc9dd"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "version_check"
|
||||||
|
version = "0.9.3"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "5fecdca9a5291cc2b8dcf7dc02453fee791a280f3743cb0905f8822ae463b3fe"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "wasi"
|
||||||
|
version = "0.9.0+wasi-snapshot-preview1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "wasi"
|
||||||
|
version = "0.10.2+wasi-snapshot-preview1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "wasm-bindgen"
|
||||||
|
version = "0.2.73"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "83240549659d187488f91f33c0f8547cbfef0b2088bc470c116d1d260ef623d9"
|
||||||
|
dependencies = [
|
||||||
|
"cfg-if 1.0.0",
|
||||||
|
"serde",
|
||||||
|
"serde_json",
|
||||||
|
"wasm-bindgen-macro",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "wasm-bindgen-backend"
|
||||||
|
version = "0.2.73"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "ae70622411ca953215ca6d06d3ebeb1e915f0f6613e3b495122878d7ebec7dae"
|
||||||
|
dependencies = [
|
||||||
|
"bumpalo",
|
||||||
|
"lazy_static",
|
||||||
|
"log",
|
||||||
|
"proc-macro2",
|
||||||
|
"quote",
|
||||||
|
"syn",
|
||||||
|
"wasm-bindgen-shared",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "wasm-bindgen-futures"
|
||||||
|
version = "0.4.23"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "81b8b767af23de6ac18bf2168b690bed2902743ddf0fb39252e36f9e2bfc63ea"
|
||||||
|
dependencies = [
|
||||||
|
"cfg-if 1.0.0",
|
||||||
|
"js-sys",
|
||||||
|
"wasm-bindgen",
|
||||||
|
"web-sys",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "wasm-bindgen-macro"
|
||||||
|
version = "0.2.73"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "3e734d91443f177bfdb41969de821e15c516931c3c3db3d318fa1b68975d0f6f"
|
||||||
|
dependencies = [
|
||||||
|
"quote",
|
||||||
|
"wasm-bindgen-macro-support",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "wasm-bindgen-macro-support"
|
||||||
|
version = "0.2.73"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "d53739ff08c8a68b0fdbcd54c372b8ab800b1449ab3c9d706503bc7dd1621b2c"
|
||||||
|
dependencies = [
|
||||||
|
"proc-macro2",
|
||||||
|
"quote",
|
||||||
|
"syn",
|
||||||
|
"wasm-bindgen-backend",
|
||||||
|
"wasm-bindgen-shared",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "wasm-bindgen-shared"
|
||||||
|
version = "0.2.73"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "d9a543ae66aa233d14bb765ed9af4a33e81b8b58d1584cf1b47ff8cd0b9e4489"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "wasm-bindgen-test"
|
||||||
|
version = "0.3.23"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "e972e914de63aa53bd84865e54f5c761bd274d48e5be3a6329a662c0386aa67a"
|
||||||
|
dependencies = [
|
||||||
|
"console_error_panic_hook",
|
||||||
|
"js-sys",
|
||||||
|
"scoped-tls",
|
||||||
|
"wasm-bindgen",
|
||||||
|
"wasm-bindgen-futures",
|
||||||
|
"wasm-bindgen-test-macro",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "wasm-bindgen-test-macro"
|
||||||
|
version = "0.3.23"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "ea6153a8f9bf24588e9f25c87223414fff124049f68d3a442a0f0eab4768a8b6"
|
||||||
|
dependencies = [
|
||||||
|
"proc-macro2",
|
||||||
|
"quote",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "web-sys"
|
||||||
|
version = "0.3.50"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "a905d57e488fec8861446d3393670fb50d27a262344013181c2cdf9fff5481be"
|
||||||
|
dependencies = [
|
||||||
|
"js-sys",
|
||||||
|
"wasm-bindgen",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "winapi"
|
||||||
|
version = "0.3.9"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419"
|
||||||
|
dependencies = [
|
||||||
|
"winapi-i686-pc-windows-gnu",
|
||||||
|
"winapi-x86_64-pc-windows-gnu",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "winapi-i686-pc-windows-gnu"
|
||||||
|
version = "0.4.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "winapi-x86_64-pc-windows-gnu"
|
||||||
|
version = "0.4.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
|
||||||
29
Cargo.toml
Normal file
29
Cargo.toml
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
[package]
|
||||||
|
version = "0.1.0"
|
||||||
|
name = "tracerviewer"
|
||||||
|
repository = "https://github.com/seed-rs/seed-quickstart"
|
||||||
|
authors = ["Bill Thiede <git@xinu.tv>"]
|
||||||
|
description = "App Description"
|
||||||
|
categories = ["category"]
|
||||||
|
license = "MIT"
|
||||||
|
readme = "./README.md"
|
||||||
|
edition = "2018"
|
||||||
|
|
||||||
|
[lib]
|
||||||
|
crate-type = ["cdylib"]
|
||||||
|
|
||||||
|
[dev-dependencies]
|
||||||
|
wasm-bindgen-test = "0.3.18"
|
||||||
|
|
||||||
|
[dependencies]
|
||||||
|
seed = "0.8.0"
|
||||||
|
serde = "1.0.152"
|
||||||
|
thiserror = "1.0.38"
|
||||||
|
|
||||||
|
[profile.release]
|
||||||
|
lto = true
|
||||||
|
opt-level = 'z'
|
||||||
|
codegen-units = 1
|
||||||
|
|
||||||
|
[package.metadata.wasm-pack.profile.release]
|
||||||
|
wasm-opt = ['-Os']
|
||||||
71
Makefile.toml
Normal file
71
Makefile.toml
Normal file
@ -0,0 +1,71 @@
|
|||||||
|
[env]
|
||||||
|
PORT = "8000"
|
||||||
|
|
||||||
|
[config]
|
||||||
|
skip_core_tasks = true
|
||||||
|
|
||||||
|
# ---- BASIC ----
|
||||||
|
|
||||||
|
[tasks.watch]
|
||||||
|
description = "Watch files and recompile the project on change"
|
||||||
|
run_task = [
|
||||||
|
{ name = "build" },
|
||||||
|
]
|
||||||
|
watch = true
|
||||||
|
|
||||||
|
[tasks.serve]
|
||||||
|
description = "Start server"
|
||||||
|
install_crate = { crate_name = "microserver", binary = "microserver", test_arg = "-h" }
|
||||||
|
command = "microserver"
|
||||||
|
args = ["--port", "${PORT}"]
|
||||||
|
|
||||||
|
[tasks.verify]
|
||||||
|
description = "Format, lint with Clippy and run tests"
|
||||||
|
dependencies = ["fmt", "clippy", "test_h_firefox"]
|
||||||
|
|
||||||
|
# ---- BUILD ----
|
||||||
|
|
||||||
|
[tasks.build]
|
||||||
|
description = "Build with wasm-pack"
|
||||||
|
install_crate = { crate_name = "wasm-pack", binary = "wasm-pack", test_arg = "-V" }
|
||||||
|
command = "wasm-pack"
|
||||||
|
args = ["build", "--target", "web", "--out-name", "package", "--dev"]
|
||||||
|
|
||||||
|
[tasks.build_release]
|
||||||
|
description = "Build with wasm-pack in release mode"
|
||||||
|
install_crate = { crate_name = "wasm-pack", binary = "wasm-pack", test_arg = "-V" }
|
||||||
|
command = "wasm-pack"
|
||||||
|
args = ["build", "--target", "web", "--out-name", "package"]
|
||||||
|
|
||||||
|
# ---- LINT ----
|
||||||
|
|
||||||
|
[tasks.clippy]
|
||||||
|
description = "Lint with Clippy"
|
||||||
|
install_crate = { rustup_component_name = "clippy", binary = "cargo-clippy", test_arg = "--help" }
|
||||||
|
command = "cargo"
|
||||||
|
args = ["clippy", "--all-features", "--", "--deny", "warnings", "--deny", "clippy::pedantic", "--deny", "clippy::nursery"]
|
||||||
|
|
||||||
|
[tasks.fmt]
|
||||||
|
description = "Format with rustfmt"
|
||||||
|
install_crate = { rustup_component_name = "rustfmt", binary = "rustfmt", test_arg = "-V" }
|
||||||
|
command = "cargo"
|
||||||
|
args = ["fmt"]
|
||||||
|
|
||||||
|
|
||||||
|
# ---- TEST ----
|
||||||
|
|
||||||
|
[tasks.test_h]
|
||||||
|
description = "Run headless tests. Ex: 'cargo make test_h firefox'. Test envs: [chrome, firefox, safari]"
|
||||||
|
extend = "test"
|
||||||
|
args = ["test", "--headless", "--${@}"]
|
||||||
|
|
||||||
|
[tasks.test_h_firefox]
|
||||||
|
description = "Run headless tests with Firefox."
|
||||||
|
extend = "test"
|
||||||
|
args = ["test", "--headless", "--firefox"]
|
||||||
|
|
||||||
|
[tasks.test]
|
||||||
|
description = "Run tests. Ex: 'cargo make test firefox'. Test envs: [chrome, firefox, safari]"
|
||||||
|
install_crate = { crate_name = "wasm-pack", binary = "wasm-pack", test_arg = "-V" }
|
||||||
|
command = "wasm-pack"
|
||||||
|
args = ["test", "--${@}"]
|
||||||
98
README.md
98
README.md
@ -1,68 +1,76 @@
|
|||||||
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
|
# Seed Quickstart
|
||||||
|
|
||||||
## Available Scripts
|
> Basic Rust-only template for your new Seed app.
|
||||||
|
|
||||||
In the project directory, you can run:
|
## 1. Create a new project
|
||||||
|
|
||||||
### `yarn start`
|
1. You can use [cargo generate](https://github.com/ashleygwilliams/cargo-generate) to use this template.
|
||||||
|
|
||||||
Runs the app in the development mode.<br />
|
```bash
|
||||||
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
|
$ cargo generate --git https://github.com/seed-rs/seed-quickstart.git --name my-project
|
||||||
|
$ cd my-project
|
||||||
|
```
|
||||||
|
|
||||||
The page will reload if you make edits.<br />
|
1. Alternatively, simply click on the green button **Use this template** on the GitHub [profile](https://github.com/seed-rs/seed-quickstart) of this quickstart.
|
||||||
You will also see any lint errors in the console.
|
|
||||||
|
|
||||||
### `yarn test`
|
1. Make sure Git doesn't automatically convert your newlines to CRLF because linters don't like it.
|
||||||
|
- Run `$ git config --global core.autocrlf` in your terminal and it should return `input` or `false`. See [Git docs](https://git-scm.com/book/en/v2/Customizing-Git-Git-Configuration) for more info.
|
||||||
|
|
||||||
Launches the test runner in the interactive watch mode.<br />
|
1. Clone your new repository to your local machine. I use [GitKraken](https://www.gitkraken.com/), but you are probably a better developer than me - use your favorite terminal.
|
||||||
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
|
|
||||||
|
|
||||||
### `yarn build`
|
## 2. Install / check required tools
|
||||||
|
|
||||||
Builds the app for production to the `build` folder.<br />
|
1. Make sure you have basic tools installed:
|
||||||
It correctly bundles React in production mode and optimizes the build for the best performance.
|
|
||||||
|
|
||||||
The build is minified and the filenames include the hashes.<br />
|
- [Rust](https://www.rust-lang.org)
|
||||||
Your app is ready to be deployed!
|
- Check: `$ rustc -V` => `rustc 1.43.1 (8d69840ab 2020-05-04)`
|
||||||
|
- Install: https://www.rust-lang.org/tools/install
|
||||||
|
- [cargo-make](https://sagiegurari.github.io/cargo-make/)
|
||||||
|
- Check: `$ cargo make -V` => `cargo-make 0.30.7`
|
||||||
|
- Install: `$ cargo install cargo-make`
|
||||||
|
|
||||||
See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
|
1. Platform-specific tools like `ssl` and `pkg-config`:
|
||||||
|
- Follow recommendations in build errors (during the next chapter).
|
||||||
|
- _Note_: Don't hesitate to write notes or a tutorial for your platform and create a PR .
|
||||||
|
|
||||||
### `yarn eject`
|
## 3. Prepare your project for work
|
||||||
|
|
||||||
**Note: this is a one-way operation. Once you `eject`, you can’t go back!**
|
1. Open the project in your favorite IDE (I recommend [VS Code](https://code.visualstudio.com/) + [Rust Analyzer](https://rust-analyzer.github.io/)).
|
||||||
|
1. Open a new terminal tab / window and run: `cargo make serve`
|
||||||
|
1. Open a second terminal tab and run: `cargo make watch`
|
||||||
|
1. If you see errors, try to fix them or write on our [chat](https://discord.gg/JHHcHp5) or [forum](https://seed.discourse.group/).
|
||||||
|
1. Modify files like `README.md` and `Cargo.toml` as you wish.
|
||||||
|
|
||||||
If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
|
## 4. Write your website
|
||||||
|
|
||||||
Instead, it will copy all the configuration files and the transitive dependencies (Webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.
|
1. Open [localhost:8000](http://localhost:8000) in a browser (I recommend Firefox and Chrome).
|
||||||
|
1. Modify source files (e.g. `/src/lib.rs` or `/index.html`).
|
||||||
|
1. Watch compilation in the terminal tab where you run `cargo make watch`.
|
||||||
|
1. You can watch dev-server responses in the tab where you run `cargo make serve`.
|
||||||
|
1. Refresh your browser and see changes.
|
||||||
|
1. Go to step 2.
|
||||||
|
|
||||||
You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.
|
## 5. Prepare your project for deploy
|
||||||
|
|
||||||
## Learn More
|
1. Run `cargo make verify` in your terminal to format and lint the code.
|
||||||
|
1. Run `cargo make build_release`.
|
||||||
|
1. Upload `index.html` and `pkg` into your server's public folder.
|
||||||
|
- Don't forget to upload also configuration files for your hosting, see the [Netlify](https://www.netlify.com/) one below.
|
||||||
|
|
||||||
You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
|
```toml
|
||||||
|
# netlify.toml
|
||||||
|
[[redirects]]
|
||||||
|
from = "/*"
|
||||||
|
to = "/index.html"
|
||||||
|
status = 200
|
||||||
|
```
|
||||||
|
|
||||||
To learn React, check out the [React documentation](https://reactjs.org/).
|
## Other Seed quickstarts and projects
|
||||||
|
|
||||||
### Code Splitting
|
- [seed-rs/awesome-seed-rs](https://github.com/seed-rs/awesome-seed-rs)
|
||||||
|
|
||||||
This section has moved here: https://facebook.github.io/create-react-app/docs/code-splitting
|
---
|
||||||
|
|
||||||
### Analyzing the Bundle Size
|
**!!! New Rust-only quickstart in development! => [Seeder](https://github.com/MartinKavik/seeder) !!!**
|
||||||
|
|
||||||
This section has moved here: https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size
|
---
|
||||||
|
|
||||||
### Making a Progressive Web App
|
|
||||||
|
|
||||||
This section has moved here: https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app
|
|
||||||
|
|
||||||
### Advanced Configuration
|
|
||||||
|
|
||||||
This section has moved here: https://facebook.github.io/create-react-app/docs/advanced-configuration
|
|
||||||
|
|
||||||
### Deployment
|
|
||||||
|
|
||||||
This section has moved here: https://facebook.github.io/create-react-app/docs/deployment
|
|
||||||
|
|
||||||
### `yarn build` fails to minify
|
|
||||||
|
|
||||||
This section has moved here: https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify
|
|
||||||
|
|||||||
8
Trunk.toml
Normal file
8
Trunk.toml
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
[serve]
|
||||||
|
# The address to serve on.
|
||||||
|
address = "0.0.0.0"
|
||||||
|
# The port to serve on.
|
||||||
|
port = 4444
|
||||||
|
|
||||||
|
[[proxy]]
|
||||||
|
backend="https://nixos-07.z.xinu.tv/www/tracer/"
|
||||||
19
index.html
Normal file
19
index.html
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||||
|
<link rel="modulepreload" href="/pkg/package.js" as="script" type="text/javascript">
|
||||||
|
<link rel="preload" href="/pkg/package_bg.wasm" as="fetch" type="application/wasm" crossorigin="anonymous">
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<section id="app"></section>
|
||||||
|
<script type="module">
|
||||||
|
import init from '/pkg/package.js';
|
||||||
|
init('/pkg/package_bg.wasm');
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
|
||||||
|
</html>
|
||||||
35
package.json
35
package.json
@ -1,35 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "tracerviewer",
|
|
||||||
"version": "0.1.0",
|
|
||||||
"private": true,
|
|
||||||
"dependencies": {
|
|
||||||
"babel-loader": "8.0.6",
|
|
||||||
"moment": "^2.24.0",
|
|
||||||
"react": "^16.10.2",
|
|
||||||
"react-bulma-components": "3.1.3",
|
|
||||||
"react-dom": "^16.10.2",
|
|
||||||
"react-scripts": "3.2.0",
|
|
||||||
"transformation-matrix": "^2.1.1"
|
|
||||||
},
|
|
||||||
"scripts": {
|
|
||||||
"start": "react-scripts start",
|
|
||||||
"build": "react-scripts build",
|
|
||||||
"test": "react-scripts test",
|
|
||||||
"eject": "react-scripts eject"
|
|
||||||
},
|
|
||||||
"eslintConfig": {
|
|
||||||
"extends": "react-app"
|
|
||||||
},
|
|
||||||
"browserslist": {
|
|
||||||
"production": [
|
|
||||||
">0.2%",
|
|
||||||
"not dead",
|
|
||||||
"not op_mini all"
|
|
||||||
],
|
|
||||||
"development": [
|
|
||||||
"last 1 chrome version",
|
|
||||||
"last 1 firefox version",
|
|
||||||
"last 1 safari version"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 22 KiB |
@ -1,43 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8" />
|
|
||||||
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
||||||
<meta name="theme-color" content="#000000" />
|
|
||||||
<meta
|
|
||||||
name="description"
|
|
||||||
content="Web site created using create-react-app"
|
|
||||||
/>
|
|
||||||
<link rel="apple-touch-icon" href="logo192.png" />
|
|
||||||
<!--
|
|
||||||
manifest.json provides metadata used when your web app is installed on a
|
|
||||||
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
|
|
||||||
-->
|
|
||||||
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
|
|
||||||
<!--
|
|
||||||
Notice the use of %PUBLIC_URL% in the tags above.
|
|
||||||
It will be replaced with the URL of the `public` folder during the build.
|
|
||||||
Only files inside the `public` folder can be referenced from the HTML.
|
|
||||||
|
|
||||||
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
|
|
||||||
work correctly both with client-side routing and a non-root public URL.
|
|
||||||
Learn how to configure a non-root public URL by running `npm run build`.
|
|
||||||
-->
|
|
||||||
<title>Tracer Debug App</title>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<noscript>You need to enable JavaScript to run this app.</noscript>
|
|
||||||
<div id="root"></div>
|
|
||||||
<!--
|
|
||||||
This HTML file is a template.
|
|
||||||
If you open it directly in the browser, you will see an empty page.
|
|
||||||
|
|
||||||
You can add webfonts, meta tags, or analytics to this file.
|
|
||||||
The build step will place the bundled scripts into the <body> tag.
|
|
||||||
|
|
||||||
To begin the development, run `npm start` or `yarn start`.
|
|
||||||
To create a production bundle, use `npm run build` or `yarn build`.
|
|
||||||
-->
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 8.4 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 22 KiB |
@ -1,25 +0,0 @@
|
|||||||
{
|
|
||||||
"short_name": "React App",
|
|
||||||
"name": "Create React App Sample",
|
|
||||||
"icons": [
|
|
||||||
{
|
|
||||||
"src": "favicon.ico",
|
|
||||||
"sizes": "64x64 32x32 24x24 16x16",
|
|
||||||
"type": "image/x-icon"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"src": "logo192.png",
|
|
||||||
"type": "image/png",
|
|
||||||
"sizes": "192x192"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"src": "logo512.png",
|
|
||||||
"type": "image/png",
|
|
||||||
"sizes": "512x512"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"start_url": ".",
|
|
||||||
"display": "standalone",
|
|
||||||
"theme_color": "#000000",
|
|
||||||
"background_color": "#ffffff"
|
|
||||||
}
|
|
||||||
@ -1,2 +0,0 @@
|
|||||||
# https://www.robotstxt.org/robotstxt.html
|
|
||||||
User-agent: *
|
|
||||||
23
src/App.css
23
src/App.css
@ -1,23 +0,0 @@
|
|||||||
.App {
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.frame {
|
|
||||||
display: inline-block;
|
|
||||||
color: #fff;
|
|
||||||
text-shadow: 0 0 4px #000, 0 0 8px #000 ;
|
|
||||||
cursor: crosshair;
|
|
||||||
}
|
|
||||||
|
|
||||||
.frame .name {
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.value {
|
|
||||||
text-align: center;
|
|
||||||
border: 1px solid #888;
|
|
||||||
}
|
|
||||||
|
|
||||||
.menu {
|
|
||||||
margin: .5em;
|
|
||||||
}
|
|
||||||
329
src/App.js
329
src/App.js
@ -1,329 +0,0 @@
|
|||||||
import React from 'react';
|
|
||||||
import moment from 'moment';
|
|
||||||
import './App.css';
|
|
||||||
import {
|
|
||||||
Columns,
|
|
||||||
Footer,
|
|
||||||
Heading,
|
|
||||||
Table,
|
|
||||||
} from 'react-bulma-components';
|
|
||||||
|
|
||||||
|
|
||||||
const ROOT = process.env.PUBLIC_URL + '/tracer/';
|
|
||||||
const DATA_URL = ROOT + 'data.json';
|
|
||||||
const MAX_ZOOM_FACTOR = 32;
|
|
||||||
|
|
||||||
const Sidebar = (props) => {
|
|
||||||
let {
|
|
||||||
renderTimeSeconds, binary, binaryMax, scene, imageMetadata, zoomFactor, mouseX, mouseY,
|
|
||||||
onZoom,
|
|
||||||
} = props;
|
|
||||||
let samples = imageMetadata.map((md) => {
|
|
||||||
let pix = binary[md.name];
|
|
||||||
if (pix === undefined) { return <p key={md.name}>Loading...</p>; }
|
|
||||||
let max = binaryMax[md.name];
|
|
||||||
let [w, h] = md.size;
|
|
||||||
let xOff = Math.min(mouseX,w-1); // Math.min(w, Math.max(0, Math.round(x*w)));
|
|
||||||
let yOff = Math.min(mouseY,h-1); // Math.min(h, Math.max(0, Math.round(y*h)));
|
|
||||||
let v = pix[xOff+yOff*w];
|
|
||||||
let color = "#fff";
|
|
||||||
let rgb = "";
|
|
||||||
let value = "";
|
|
||||||
if (md.format === "RGB01") {
|
|
||||||
let r = Math.round(v[0]*255);
|
|
||||||
let g = Math.round(v[1]*255);
|
|
||||||
let b = Math.round(v[2]*255);
|
|
||||||
value = `${r}, ${g}, ${b}`;
|
|
||||||
rgb = `rgb(${value})`;
|
|
||||||
color = `rgb(${255^r}, ${255^g}, ${255^b})`;
|
|
||||||
} else {
|
|
||||||
let c = 255*v/max;
|
|
||||||
rgb = `rgb(${c}, ${c}, ${c})`;
|
|
||||||
color = `rgb(${255^c}, ${255^c}, ${255^c})`;
|
|
||||||
value = v;
|
|
||||||
}
|
|
||||||
return <li className="sample" key={md.name}>
|
|
||||||
<p>{md.name}</p>
|
|
||||||
<p className="value" style={{
|
|
||||||
color,
|
|
||||||
backgroundColor: rgb,
|
|
||||||
}}>{value}</p>
|
|
||||||
</li>
|
|
||||||
});
|
|
||||||
let sceneInfo = <ul className="menu-list">
|
|
||||||
<Table>
|
|
||||||
<tbody>
|
|
||||||
<tr>
|
|
||||||
<td>render time</td>
|
|
||||||
<td>{renderTimeSeconds}s</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>subsamples</td>
|
|
||||||
<td>{scene.subsamples || "default"}</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>adaptive subsampling</td>
|
|
||||||
<td>{scene.adaptiveSubsampling || "default"}</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>numThreads</td>
|
|
||||||
<td>{scene.numThreads || "default"}</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>width</td>
|
|
||||||
<td>{scene.width}</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>height</td>
|
|
||||||
<td>{scene.height}</td>
|
|
||||||
</tr>
|
|
||||||
</tbody>
|
|
||||||
</Table>
|
|
||||||
</ul>;
|
|
||||||
return <aside className="menu">
|
|
||||||
<p className="menu-label">
|
|
||||||
Controls
|
|
||||||
</p>
|
|
||||||
<ul className="menu-list">
|
|
||||||
<li>
|
|
||||||
<p>Zoom:</p>
|
|
||||||
<input
|
|
||||||
id="zoom"
|
|
||||||
type="range"
|
|
||||||
min="1" max={MAX_ZOOM_FACTOR}
|
|
||||||
value={zoomFactor}
|
|
||||||
onChange={onZoom}
|
|
||||||
step="0.1"/>
|
|
||||||
<p className="value">{Math.round(zoomFactor*100)/100}x</p>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
<p className="menu-label">
|
|
||||||
Samples
|
|
||||||
</p>
|
|
||||||
<ul className="menu-list">
|
|
||||||
{samples}
|
|
||||||
</ul>
|
|
||||||
<p className="menu-label">
|
|
||||||
Scene
|
|
||||||
</p>
|
|
||||||
{sceneInfo}
|
|
||||||
</aside>;
|
|
||||||
}
|
|
||||||
|
|
||||||
const ELEMENT_WIDTH = 384;
|
|
||||||
class App extends React.Component {
|
|
||||||
constructor(props) {
|
|
||||||
super(props);
|
|
||||||
this.state = {
|
|
||||||
data: null,
|
|
||||||
binary: {},
|
|
||||||
binaryMax: {},
|
|
||||||
isFetching: false,
|
|
||||||
isFrozen: false,
|
|
||||||
isMouseDown: false,
|
|
||||||
isZoomed: true,
|
|
||||||
zoomFactor: 4,
|
|
||||||
mouseX: 0,
|
|
||||||
mouseY: 0,
|
|
||||||
offsetX: -1.5*ELEMENT_WIDTH,
|
|
||||||
offsetY: -1.5*ELEMENT_WIDTH,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
componentDidMount() {
|
|
||||||
this.fetchTracerData()
|
|
||||||
this.timer = setInterval(() => this.fetchTracerData(), 1000);
|
|
||||||
}
|
|
||||||
componentWillUnmount() {
|
|
||||||
this.timer = null;
|
|
||||||
}
|
|
||||||
fetchTracerData() {
|
|
||||||
this.setState({...this.state, isFetching: true})
|
|
||||||
const max = (acc, cur) => Math.max(acc, cur);
|
|
||||||
fetch(DATA_URL)
|
|
||||||
.then(response => response.json())
|
|
||||||
.then(result => {
|
|
||||||
let {data} = this.state;
|
|
||||||
if ((data === null) ||
|
|
||||||
(data.timestamp !== result.timestamp)) {
|
|
||||||
this.setState({data: result, isFetching: false});
|
|
||||||
result.imageMetadata.forEach((md) => {
|
|
||||||
let binaryUrl = ROOT + md.binary;
|
|
||||||
fetch(binaryUrl)
|
|
||||||
.then(response => response.json())
|
|
||||||
.then(result => {
|
|
||||||
let curBinary = this.state.binary;
|
|
||||||
let curBinaryMax = this.state.binaryMax;
|
|
||||||
let binaryMax = result.reduce(max);
|
|
||||||
this.setState({
|
|
||||||
binary: {
|
|
||||||
[md.name]: result,
|
|
||||||
...curBinary
|
|
||||||
},
|
|
||||||
binaryMax: {
|
|
||||||
[md.name]: binaryMax,
|
|
||||||
...curBinaryMax
|
|
||||||
}
|
|
||||||
});
|
|
||||||
})
|
|
||||||
.catch(e => console.log(e));
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
this.setState({isFetching: false});
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.catch(e => console.log(e));
|
|
||||||
}
|
|
||||||
render() {
|
|
||||||
let images = [];
|
|
||||||
let {
|
|
||||||
binary,
|
|
||||||
binaryMax,
|
|
||||||
data,
|
|
||||||
isFrozen,
|
|
||||||
isMouseDown,
|
|
||||||
isZoomed,
|
|
||||||
mouseX,
|
|
||||||
mouseY,
|
|
||||||
offsetX,
|
|
||||||
offsetY,
|
|
||||||
zoomFactor,
|
|
||||||
} = this.state;
|
|
||||||
let mainContent = <h1>Loading</h1>;
|
|
||||||
let sidebarContent = <h1>Loading</h1>;
|
|
||||||
if (data !== null) {
|
|
||||||
let {timestamp, renderTimeSeconds, imageMetadata, scene} = data;
|
|
||||||
const mouseEnter = (e) => {
|
|
||||||
if (isFrozen) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
this.setState({isZoomed: true});
|
|
||||||
};
|
|
||||||
const mouseLeave = (e) => {
|
|
||||||
this.setState({isMouseDown: false});
|
|
||||||
};
|
|
||||||
const onZoom = (e) => this.setState({
|
|
||||||
zoomFactor: Number(e.target.value)
|
|
||||||
});
|
|
||||||
|
|
||||||
images = imageMetadata.map((metadata) => {
|
|
||||||
let {name, ratio, image, size} = metadata;
|
|
||||||
let width = ELEMENT_WIDTH;
|
|
||||||
let height = (width/ratio).toFixed();
|
|
||||||
let url = ROOT + image + '?t=' + timestamp;
|
|
||||||
|
|
||||||
const clamp = (offsetX, offsetY) => {
|
|
||||||
let minX = width - width * zoomFactor;
|
|
||||||
let minY = height - height * zoomFactor;
|
|
||||||
let maxX = 0;//width * zoomFactor - width;
|
|
||||||
let maxY = 0;//height * zoomFactor - height;
|
|
||||||
offsetX = Math.max(minX, Math.min(maxX, offsetX));
|
|
||||||
offsetY = Math.max(minY, Math.min(maxY, offsetY));
|
|
||||||
this.setState({offsetX, offsetY});
|
|
||||||
};
|
|
||||||
|
|
||||||
const pointerDown = (e) => {
|
|
||||||
// TODO(wathiede): figure out how to grab a ref and
|
|
||||||
// setPointerCapture on that.
|
|
||||||
//this.setPointerCapture(e.pointerId);
|
|
||||||
this.setState({isMouseDown: true});
|
|
||||||
};
|
|
||||||
|
|
||||||
const pointerUp = (e) => {
|
|
||||||
// TODO(wathiede): figure out how to grab a ref and
|
|
||||||
// releasePointerCapture on that.
|
|
||||||
//this.releasePointerCapture(e.pointerId);
|
|
||||||
this.setState({isMouseDown: false});
|
|
||||||
};
|
|
||||||
|
|
||||||
const pointerMove = (e) => {
|
|
||||||
if (isMouseDown) {
|
|
||||||
offsetX += e.movementX;
|
|
||||||
offsetY += e.movementY;
|
|
||||||
clamp(offsetX, offsetY);
|
|
||||||
|
|
||||||
} else {
|
|
||||||
let rect = e.currentTarget.getBoundingClientRect();
|
|
||||||
let screenX = e.clientX - rect.left;
|
|
||||||
let screenY = e.clientY - rect.top;
|
|
||||||
let viewW = size[0] / zoomFactor;
|
|
||||||
let viewH = size[1] / zoomFactor;
|
|
||||||
let xOff = (-offsetX*size[0])/(zoomFactor * width) + (screenX / width) * viewW;
|
|
||||||
let yOff = (-offsetY*size[1])/(zoomFactor * height) + (screenY / height) * viewH;
|
|
||||||
this.setState({mouseX: Math.round(xOff), mouseY: Math.round(yOff)});
|
|
||||||
}
|
|
||||||
e.preventDefault();
|
|
||||||
};
|
|
||||||
|
|
||||||
const mouseScroll = (e) => {
|
|
||||||
let localOffsetX = this.state.offsetX;
|
|
||||||
let localOffsetY = this.state.offsetY;
|
|
||||||
let delta = parseFloat(-e.deltaY/100.0);
|
|
||||||
let zoomFactor = delta + this.state.zoomFactor;
|
|
||||||
if (zoomFactor < 1) { zoomFactor = 1; }
|
|
||||||
if (zoomFactor > MAX_ZOOM_FACTOR) {
|
|
||||||
zoomFactor = MAX_ZOOM_FACTOR;
|
|
||||||
}
|
|
||||||
this.setState({
|
|
||||||
zoomFactor: zoomFactor,
|
|
||||||
isZoomed: true
|
|
||||||
});
|
|
||||||
|
|
||||||
clamp(offsetX, offsetY);
|
|
||||||
};
|
|
||||||
let style = {
|
|
||||||
width: width + 'px',
|
|
||||||
height: height + 'px',
|
|
||||||
imageRendering: isZoomed ? 'pixelated' : 'auto',
|
|
||||||
backgroundSize: isZoomed ? zoomFactor * width + 'px ' + zoomFactor * height + 'px' : 'contain',
|
|
||||||
backgroundPosition: isZoomed ? offsetX + 'px ' + offsetY + 'px' : 'center center',
|
|
||||||
};
|
|
||||||
console.log('offset', offsetX, offsetY);
|
|
||||||
return (
|
|
||||||
<div key={name}
|
|
||||||
onPointerDown={pointerDown}
|
|
||||||
onPointerUp={pointerUp}
|
|
||||||
onPointerMove={pointerMove}
|
|
||||||
//onMouseEnter={mouseEnter}
|
|
||||||
onMouseLeave={mouseLeave}
|
|
||||||
onWheel={mouseScroll}
|
|
||||||
className="frame"
|
|
||||||
style={{backgroundImage: 'url("' + url + '")', ...style}}>
|
|
||||||
<p className="name"><a href={url}>{name}</a></p>
|
|
||||||
</div>)
|
|
||||||
});
|
|
||||||
let time = moment.unix(timestamp);
|
|
||||||
mainContent = <div>
|
|
||||||
<Heading>
|
|
||||||
Run @ {time.format("llll")}
|
|
||||||
</Heading>
|
|
||||||
<Heading subtitle>
|
|
||||||
{time.fromNow()}
|
|
||||||
</Heading>
|
|
||||||
{images}
|
|
||||||
</div>;
|
|
||||||
|
|
||||||
sidebarContent = <Sidebar
|
|
||||||
scene={scene}
|
|
||||||
renderTimeSeconds={renderTimeSeconds}
|
|
||||||
imageMetadata={imageMetadata}
|
|
||||||
zoomFactor={zoomFactor}
|
|
||||||
mouseX={mouseX}
|
|
||||||
mouseY={mouseY}
|
|
||||||
binary={binary}
|
|
||||||
binaryMax={binaryMax}
|
|
||||||
onZoom={onZoom} />;
|
|
||||||
}
|
|
||||||
return (
|
|
||||||
<Columns>
|
|
||||||
<Columns.Column size="one-quarter">
|
|
||||||
{sidebarContent}
|
|
||||||
</Columns.Column>
|
|
||||||
<Columns.Column>
|
|
||||||
{mainContent}
|
|
||||||
</Columns.Column>
|
|
||||||
</Columns>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export default App;
|
|
||||||
@ -1,9 +0,0 @@
|
|||||||
import React from 'react';
|
|
||||||
import ReactDOM from 'react-dom';
|
|
||||||
import App from './App';
|
|
||||||
|
|
||||||
it('renders without crashing', () => {
|
|
||||||
const div = document.createElement('div');
|
|
||||||
ReactDOM.render(<App />, div);
|
|
||||||
ReactDOM.unmountComponentAtNode(div);
|
|
||||||
});
|
|
||||||
6
src/bulmaswatch.min.css
vendored
6
src/bulmaswatch.min.css
vendored
File diff suppressed because one or more lines are too long
@ -1,24 +0,0 @@
|
|||||||
body {
|
|
||||||
margin: 0;
|
|
||||||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen",
|
|
||||||
"Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue",
|
|
||||||
sans-serif;
|
|
||||||
-webkit-font-smoothing: antialiased;
|
|
||||||
-moz-osx-font-smoothing: grayscale;
|
|
||||||
}
|
|
||||||
|
|
||||||
code {
|
|
||||||
font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New",
|
|
||||||
monospace;
|
|
||||||
}
|
|
||||||
|
|
||||||
html {
|
|
||||||
background-color: #000;
|
|
||||||
}
|
|
||||||
|
|
||||||
html, body, #root {
|
|
||||||
background-color: #000;
|
|
||||||
color: #fff;
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
14
src/index.js
14
src/index.js
@ -1,14 +0,0 @@
|
|||||||
import React from 'react';
|
|
||||||
import ReactDOM from 'react-dom';
|
|
||||||
import 'react-bulma-components/dist/react-bulma-components.min.css';
|
|
||||||
import './bulmaswatch.min.css';
|
|
||||||
import './index.css';
|
|
||||||
import App from './App';
|
|
||||||
import * as serviceWorker from './serviceWorker';
|
|
||||||
|
|
||||||
ReactDOM.render(<App />, document.getElementById('root'));
|
|
||||||
|
|
||||||
// If you want your app to work offline and load faster, you can change
|
|
||||||
// unregister() to register() below. Note this comes with some pitfalls.
|
|
||||||
// Learn more about service workers: https://bit.ly/CRA-PWA
|
|
||||||
serviceWorker.unregister();
|
|
||||||
141
src/lib.rs
Normal file
141
src/lib.rs
Normal file
@ -0,0 +1,141 @@
|
|||||||
|
// (Lines like the one below ignore selected Clippy rules
|
||||||
|
// - it's useful when you want to check your code with `cargo make verify`
|
||||||
|
// but some rules are too "annoying" or are not applicable for your case.)
|
||||||
|
#![allow(clippy::wildcard_imports)]
|
||||||
|
|
||||||
|
use std::sync::Arc;
|
||||||
|
|
||||||
|
use seed::{prelude::*, *};
|
||||||
|
use thiserror::Error;
|
||||||
|
|
||||||
|
#[derive(Clone, Error, Debug)]
|
||||||
|
pub enum AppError {
|
||||||
|
#[error("fetch error")]
|
||||||
|
FetchError(Arc<FetchError>),
|
||||||
|
}
|
||||||
|
|
||||||
|
// ------ ------
|
||||||
|
// Init
|
||||||
|
// ------ ------
|
||||||
|
|
||||||
|
// `init` describes what should happen when your app started.
|
||||||
|
fn init(_: Url, orders: &mut impl Orders<Msg>) -> Model {
|
||||||
|
let timer_handle = orders.stream_with_handle(streams::interval(1000, || Msg::OnCheck));
|
||||||
|
Model {
|
||||||
|
counter: 0,
|
||||||
|
timer_handle,
|
||||||
|
data: None,
|
||||||
|
error: None,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ------ ------
|
||||||
|
// Model
|
||||||
|
// ------ ------
|
||||||
|
|
||||||
|
// `Model` describes our app state.
|
||||||
|
struct Model {
|
||||||
|
counter: i32,
|
||||||
|
timer_handle: StreamHandle,
|
||||||
|
data: Option<Data>,
|
||||||
|
error: Option<AppError>,
|
||||||
|
}
|
||||||
|
|
||||||
|
// ------ ------
|
||||||
|
// Update
|
||||||
|
// ------ ------
|
||||||
|
|
||||||
|
// (Remove the line below once any of your `Msg` variants doesn't implement `Copy`.)
|
||||||
|
#[derive(Clone)]
|
||||||
|
// `Msg` describes the different events you can modify state with.
|
||||||
|
enum Msg {
|
||||||
|
Increment,
|
||||||
|
OnCheck,
|
||||||
|
OnError(AppError),
|
||||||
|
Received(Data),
|
||||||
|
}
|
||||||
|
|
||||||
|
// `update` describes how to handle each `Msg`.
|
||||||
|
fn update(msg: Msg, model: &mut Model, orders: &mut impl Orders<Msg>) {
|
||||||
|
match msg {
|
||||||
|
Msg::Increment => model.counter += 1,
|
||||||
|
Msg::OnError(e) => model.error = Some(e),
|
||||||
|
Msg::OnCheck => {
|
||||||
|
orders.skip(); // No need to rerender
|
||||||
|
orders.perform_cmd(async {
|
||||||
|
let response = fetch("/www/tracer/data.json")
|
||||||
|
.await
|
||||||
|
.expect("HTTP request failed");
|
||||||
|
|
||||||
|
match response
|
||||||
|
.check_status() // ensure we've got 2xx status
|
||||||
|
.expect("status check failed")
|
||||||
|
.json::<Data>()
|
||||||
|
.await
|
||||||
|
{
|
||||||
|
Ok(data) => Msg::Received(data),
|
||||||
|
Err(e) => Msg::OnError(AppError::FetchError(Arc::new(e))),
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
Msg::Received(data) => model.data = Some(data),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
|
#[derive(Clone, Debug, Deserialize, Serialize)]
|
||||||
|
struct ImageMetadata {
|
||||||
|
name: String,
|
||||||
|
image: String,
|
||||||
|
binary: String,
|
||||||
|
ratio: f32,
|
||||||
|
size: (usize, usize),
|
||||||
|
format: ImageType,
|
||||||
|
}
|
||||||
|
#[derive(Clone, Debug, Deserialize, Serialize)]
|
||||||
|
#[serde(rename_all = "camelCase")]
|
||||||
|
struct Data {
|
||||||
|
timestamp: i64,
|
||||||
|
render_time_seconds: f32,
|
||||||
|
scene: Scene,
|
||||||
|
image_metadata: Vec<ImageMetadata>,
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO(wathiede): implement the skips and then the renderer could use json as an input file type.
|
||||||
|
#[derive(Clone, Debug, Deserialize, Serialize)]
|
||||||
|
#[serde(rename_all = "camelCase")]
|
||||||
|
pub struct Scene {
|
||||||
|
pub subsamples: usize,
|
||||||
|
/// overrides subsamples setting.
|
||||||
|
pub adaptive_subsampling: Option<f32>,
|
||||||
|
pub num_threads: Option<usize>,
|
||||||
|
pub width: usize,
|
||||||
|
pub height: usize,
|
||||||
|
pub global_illumination: bool,
|
||||||
|
}
|
||||||
|
#[derive(Clone, Copy, Debug, Deserialize, Serialize)]
|
||||||
|
pub enum ImageType {
|
||||||
|
RGB01,
|
||||||
|
Grey01,
|
||||||
|
GreyNormalized,
|
||||||
|
}
|
||||||
|
|
||||||
|
// ------ ------
|
||||||
|
// View
|
||||||
|
// ------ ------
|
||||||
|
|
||||||
|
// `view` describes what to display.
|
||||||
|
fn view(model: &Model) -> Node<Msg> {
|
||||||
|
div!["Data", pre![format!("{:#?}", model.data)],]
|
||||||
|
}
|
||||||
|
|
||||||
|
// ------ ------
|
||||||
|
// Start
|
||||||
|
// ------ ------
|
||||||
|
|
||||||
|
// (This function is invoked by `init` function in `index.html`.)
|
||||||
|
#[wasm_bindgen(start)]
|
||||||
|
pub fn start() {
|
||||||
|
// Mount the `app` to the element with the `id` "app".
|
||||||
|
App::start("app", init, update, view);
|
||||||
|
}
|
||||||
File diff suppressed because one or more lines are too long
|
Before Width: | Height: | Size: 8.0 KiB |
@ -1,135 +0,0 @@
|
|||||||
// This optional code is used to register a service worker.
|
|
||||||
// register() is not called by default.
|
|
||||||
|
|
||||||
// This lets the app load faster on subsequent visits in production, and gives
|
|
||||||
// it offline capabilities. However, it also means that developers (and users)
|
|
||||||
// will only see deployed updates on subsequent visits to a page, after all the
|
|
||||||
// existing tabs open on the page have been closed, since previously cached
|
|
||||||
// resources are updated in the background.
|
|
||||||
|
|
||||||
// To learn more about the benefits of this model and instructions on how to
|
|
||||||
// opt-in, read https://bit.ly/CRA-PWA
|
|
||||||
|
|
||||||
const isLocalhost = Boolean(
|
|
||||||
window.location.hostname === 'localhost' ||
|
|
||||||
// [::1] is the IPv6 localhost address.
|
|
||||||
window.location.hostname === '[::1]' ||
|
|
||||||
// 127.0.0.1/8 is considered localhost for IPv4.
|
|
||||||
window.location.hostname.match(
|
|
||||||
/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
export function register(config) {
|
|
||||||
if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {
|
|
||||||
// The URL constructor is available in all browsers that support SW.
|
|
||||||
const publicUrl = new URL(process.env.PUBLIC_URL, window.location.href);
|
|
||||||
if (publicUrl.origin !== window.location.origin) {
|
|
||||||
// Our service worker won't work if PUBLIC_URL is on a different origin
|
|
||||||
// from what our page is served on. This might happen if a CDN is used to
|
|
||||||
// serve assets; see https://github.com/facebook/create-react-app/issues/2374
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
window.addEventListener('load', () => {
|
|
||||||
const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;
|
|
||||||
|
|
||||||
if (isLocalhost) {
|
|
||||||
// This is running on localhost. Let's check if a service worker still exists or not.
|
|
||||||
checkValidServiceWorker(swUrl, config);
|
|
||||||
|
|
||||||
// Add some additional logging to localhost, pointing developers to the
|
|
||||||
// service worker/PWA documentation.
|
|
||||||
navigator.serviceWorker.ready.then(() => {
|
|
||||||
console.log(
|
|
||||||
'This web app is being served cache-first by a service ' +
|
|
||||||
'worker. To learn more, visit https://bit.ly/CRA-PWA'
|
|
||||||
);
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
// Is not localhost. Just register service worker
|
|
||||||
registerValidSW(swUrl, config);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function registerValidSW(swUrl, config) {
|
|
||||||
navigator.serviceWorker
|
|
||||||
.register(swUrl)
|
|
||||||
.then(registration => {
|
|
||||||
registration.onupdatefound = () => {
|
|
||||||
const installingWorker = registration.installing;
|
|
||||||
if (installingWorker == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
installingWorker.onstatechange = () => {
|
|
||||||
if (installingWorker.state === 'installed') {
|
|
||||||
if (navigator.serviceWorker.controller) {
|
|
||||||
// At this point, the updated precached content has been fetched,
|
|
||||||
// but the previous service worker will still serve the older
|
|
||||||
// content until all client tabs are closed.
|
|
||||||
console.log(
|
|
||||||
'New content is available and will be used when all ' +
|
|
||||||
'tabs for this page are closed. See https://bit.ly/CRA-PWA.'
|
|
||||||
);
|
|
||||||
|
|
||||||
// Execute callback
|
|
||||||
if (config && config.onUpdate) {
|
|
||||||
config.onUpdate(registration);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
// At this point, everything has been precached.
|
|
||||||
// It's the perfect time to display a
|
|
||||||
// "Content is cached for offline use." message.
|
|
||||||
console.log('Content is cached for offline use.');
|
|
||||||
|
|
||||||
// Execute callback
|
|
||||||
if (config && config.onSuccess) {
|
|
||||||
config.onSuccess(registration);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
};
|
|
||||||
})
|
|
||||||
.catch(error => {
|
|
||||||
console.error('Error during service worker registration:', error);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function checkValidServiceWorker(swUrl, config) {
|
|
||||||
// Check if the service worker can be found. If it can't reload the page.
|
|
||||||
fetch(swUrl)
|
|
||||||
.then(response => {
|
|
||||||
// Ensure service worker exists, and that we really are getting a JS file.
|
|
||||||
const contentType = response.headers.get('content-type');
|
|
||||||
if (
|
|
||||||
response.status === 404 ||
|
|
||||||
(contentType != null && contentType.indexOf('javascript') === -1)
|
|
||||||
) {
|
|
||||||
// No service worker found. Probably a different app. Reload the page.
|
|
||||||
navigator.serviceWorker.ready.then(registration => {
|
|
||||||
registration.unregister().then(() => {
|
|
||||||
window.location.reload();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
// Service worker found. Proceed as normal.
|
|
||||||
registerValidSW(swUrl, config);
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.catch(() => {
|
|
||||||
console.log(
|
|
||||||
'No internet connection found. App is running in offline mode.'
|
|
||||||
);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
export function unregister() {
|
|
||||||
if ('serviceWorker' in navigator) {
|
|
||||||
navigator.serviceWorker.ready.then(registration => {
|
|
||||||
registration.unregister();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Loading…
x
Reference in New Issue
Block a user