add version to debug page
This commit is contained in:
parent
19c334a974
commit
dd7b0ca839
2
Cargo.lock
generated
2
Cargo.lock
generated
@ -213,7 +213,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "centralex"
|
||||
version = "0.1.0"
|
||||
version = "1.0.1"
|
||||
dependencies = [
|
||||
"async-stream",
|
||||
"bytemuck",
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "centralex"
|
||||
version = "0.1.0"
|
||||
version = "1.0.1"
|
||||
edition = "2021"
|
||||
|
||||
[profile.release]
|
||||
|
9
build.rs
9
build.rs
@ -42,8 +42,15 @@ fn pack_debug_page() -> Result<(), Box<dyn std::error::Error>> {
|
||||
.split_once("<!--INSERT HEAD CONTENT HERE-->")
|
||||
.expect("did not find head split point in html");
|
||||
|
||||
let (body_a, body_b) = body
|
||||
.split_once("#INSERT VERSION HERE#")
|
||||
.expect("did not find version split point in html");
|
||||
|
||||
let version = env!("CARGO_PKG_VERSION");
|
||||
|
||||
let html = minify_html::minify(
|
||||
format!("{head}<style>{css}</style><script>{js}</script>{body}").as_bytes(),
|
||||
format!("{head}<style>{css}</style><script>{js}</script>{body_a}{version}{body_b}")
|
||||
.as_bytes(),
|
||||
&minify_html::Cfg::spec_compliant(),
|
||||
);
|
||||
|
||||
|
@ -15,7 +15,7 @@
|
||||
<div id="header">
|
||||
<p id="free_ports" />
|
||||
<div id="connected" class="hidden"><!--INSERT SVG HERE--></div>
|
||||
<p id="last_ping" />
|
||||
<p id="last_ping" title="v#INSERT VERSION HERE#" />
|
||||
</div>
|
||||
|
||||
<table id="table">
|
||||
|
@ -149,6 +149,7 @@ window.onload = () => {
|
||||
table = [];
|
||||
|
||||
for (let number in data.allocated_ports) {
|
||||
try {
|
||||
let port = data.allocated_ports[number];
|
||||
number = +number;
|
||||
|
||||
@ -183,6 +184,9 @@ window.onload = () => {
|
||||
}
|
||||
|
||||
table.push({ port, number, status, last_change, rejector, name });
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
}
|
||||
}
|
||||
|
||||
for (let [timestamp, port] of data.errored_ports) {
|
||||
|
Loading…
Reference in New Issue
Block a user