Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions vmm/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion vmm/src/console.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>dstack VM Management Console</title>
<title>{{TITLE}}</title>
<script src="https://unpkg.com/vue@3.0.0/dist/vue.global.js"></script>
<script src="/res/x25519.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css"
Expand Down
11 changes: 9 additions & 2 deletions vmm/src/main_routes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,15 @@ macro_rules! file_or_include_str {
}

#[get("/")]
async fn index() -> (ContentType, String) {
(ContentType::HTML, file_or_include_str!("console.html"))
async fn index(app: &State<App>) -> (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/<path>")]
Expand Down