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]]
|
[[package]]
|
||||||
name = "centralex"
|
name = "centralex"
|
||||||
version = "0.1.0"
|
version = "1.0.1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"async-stream",
|
"async-stream",
|
||||||
"bytemuck",
|
"bytemuck",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "centralex"
|
name = "centralex"
|
||||||
version = "0.1.0"
|
version = "1.0.1"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
[profile.release]
|
[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-->")
|
.split_once("<!--INSERT HEAD CONTENT HERE-->")
|
||||||
.expect("did not find head split point in html");
|
.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(
|
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(),
|
&minify_html::Cfg::spec_compliant(),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
<div id="header">
|
<div id="header">
|
||||||
<p id="free_ports" />
|
<p id="free_ports" />
|
||||||
<div id="connected" class="hidden"><!--INSERT SVG HERE--></div>
|
<div id="connected" class="hidden"><!--INSERT SVG HERE--></div>
|
||||||
<p id="last_ping" />
|
<p id="last_ping" title="v#INSERT VERSION HERE#" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<table id="table">
|
<table id="table">
|
||||||
|
@ -149,6 +149,7 @@ window.onload = () => {
|
|||||||
table = [];
|
table = [];
|
||||||
|
|
||||||
for (let number in data.allocated_ports) {
|
for (let number in data.allocated_ports) {
|
||||||
|
try {
|
||||||
let port = data.allocated_ports[number];
|
let port = data.allocated_ports[number];
|
||||||
number = +number;
|
number = +number;
|
||||||
|
|
||||||
@ -183,6 +184,9 @@ window.onload = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
table.push({ port, number, status, last_change, rejector, name });
|
table.push({ port, number, status, last_change, rejector, name });
|
||||||
|
} catch (error) {
|
||||||
|
console.error(error);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (let [timestamp, port] of data.errored_ports) {
|
for (let [timestamp, port] of data.errored_ports) {
|
||||||
|
Loading…
Reference in New Issue
Block a user