@@ -27,21 +27,27 @@ macro_rules! file_or_include_str {
2727 } ;
2828}
2929
30- #[ get( "/" ) ]
31- async fn index ( app : & State < App > ) -> ( ContentType , String ) {
32- let html = file_or_include_str ! ( "console.html" ) ;
30+ fn replace_title ( app : & App , html : & str ) -> String {
3331 let title = if app. config . node_name . is_empty ( ) {
34- "dstack VM Management Console " . to_string ( )
32+ "dstack-vmm " . to_string ( )
3533 } else {
36- format ! ( "{} - dstack VM Management Console " , app. config. node_name)
34+ format ! ( "{} | dstack-vmm " , app. config. node_name)
3735 } ;
38- let html = html. replace ( "{{TITLE}}" , & title) ;
36+ html. replace ( "{{TITLE}}" , & title)
37+ }
38+
39+ #[ get( "/" ) ]
40+ async fn index ( app : & State < App > ) -> ( ContentType , String ) {
41+ let html = file_or_include_str ! ( "console.html" ) ;
42+ let html = replace_title ( & app, & html) ;
3943 ( ContentType :: HTML , html)
4044}
4145
4246#[ get( "/beta" ) ]
43- async fn beta ( ) -> ( ContentType , String ) {
44- ( ContentType :: HTML , file_or_include_str ! ( "console_beta.html" ) )
47+ async fn beta ( app : & State < App > ) -> ( ContentType , String ) {
48+ let html = file_or_include_str ! ( "console_beta.html" ) ;
49+ let html = replace_title ( & app, & html) ;
50+ ( ContentType :: HTML , html)
4551}
4652
4753#[ get( "/res/<path>" ) ]
0 commit comments