File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -265,6 +265,10 @@ pub struct Config {
265265 /// The URL of the KMS server
266266 pub kms_url : String ,
267267
268+ /// Node name (optional, used as prefix in UI title)
269+ #[ serde( default ) ]
270+ pub node_name : String ,
271+
268272 /// CVM configuration
269273 pub cvm : CvmConfig ,
270274 /// Gateway configuration
Original file line number Diff line number Diff line change 1010< head >
1111 < meta charset ="UTF-8 ">
1212 < meta name ="viewport " content ="width=device-width, initial-scale=1.0 ">
13- < title > dstack VM Management Console </ title >
13+ < title > {{TITLE}} </ title >
1414 < script src ="https://unpkg.com/vue@3.0.0/dist/vue.global.js "> </ script >
1515 < script src ="/res/x25519.js "> </ script >
1616 < link rel ="stylesheet " href ="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css "
Original file line number Diff line number Diff line change @@ -28,8 +28,15 @@ macro_rules! file_or_include_str {
2828}
2929
3030#[ get( "/" ) ]
31- async fn index ( ) -> ( ContentType , String ) {
32- ( ContentType :: HTML , file_or_include_str ! ( "console.html" ) )
31+ async fn index ( app : & State < App > ) -> ( ContentType , String ) {
32+ let html = file_or_include_str ! ( "console.html" ) ;
33+ let title = if app. config . node_name . is_empty ( ) {
34+ "dstack VM Management Console" . to_string ( )
35+ } else {
36+ format ! ( "{} - dstack VM Management Console" , app. config. node_name)
37+ } ;
38+ let html = html. replace ( "{{TITLE}}" , & title) ;
39+ ( ContentType :: HTML , html)
3340}
3441
3542#[ get( "/res/<path>" ) ]
You can’t perform that action at this time.
0 commit comments