diff --git a/vmm/src/config.rs b/vmm/src/config.rs index 999b4a211..343652263 100644 --- a/vmm/src/config.rs +++ b/vmm/src/config.rs @@ -265,6 +265,10 @@ pub struct Config { /// The URL of the KMS server pub kms_url: String, + /// Node name (optional, used as prefix in UI title) + #[serde(default)] + pub node_name: String, + /// CVM configuration pub cvm: CvmConfig, /// Gateway configuration diff --git a/vmm/src/console.html b/vmm/src/console.html index c07a6f4e1..f9d0bd78e 100644 --- a/vmm/src/console.html +++ b/vmm/src/console.html @@ -10,7 +10,7 @@ - dstack VM Management Console + {{TITLE}} (ContentType, String) { - (ContentType::HTML, file_or_include_str!("console.html")) +async fn index(app: &State) -> (ContentType, String) { + let html = file_or_include_str!("console.html"); + let title = if app.config.node_name.is_empty() { + "dstack VM Management Console".to_string() + } else { + format!("{} - dstack VM Management Console", app.config.node_name) + }; + let html = html.replace("{{TITLE}}", &title); + (ContentType::HTML, html) } #[get("/res/")]