Add world size
[valheim_web.git] / backend / src / main.rs
index 88424da..f14592e 100644 (file)
@@ -21,8 +21,9 @@ mod valheim_controller;
 struct MainTemplate {
     text_status: String,
     memory: String,
-    cpu: String,
-    uptime: String
+    load_average: String,
+    uptime: String,
+    world_size: String
 }
 
 #[derive(Deserialize)]
@@ -41,12 +42,13 @@ async fn main_page(/*key_shared: web::Data<Mutex<String>>,*/ query: Query<Reques
             MainTemplate {
                 text_status: String::from("Valheim server is up and running :)"),
                 memory: info.format_memory(),
-                cpu: info.format_cpu_usage(),
-                uptime: info.format_uptime()
+                load_average: info.format_load_average(),
+                uptime: info.format_uptime(),
+                world_size: info.format_world_size()
             },
         None => {
             let value_unknown = String::from(VALUE_UNKNOWN);
-            MainTemplate { text_status: String::from("Valheim server is down :("), memory: value_unknown.clone(), cpu: value_unknown.clone(), uptime: value_unknown.clone() }
+            MainTemplate { text_status: String::from("Valheim server is down :("), memory: value_unknown.clone(), load_average: value_unknown.clone(), uptime: value_unknown.clone(), world_size: value_unknown.clone() }
         }
     }