extern crate askama;
use std::{ sync::Mutex, env::args, fs::File, io::prelude::* };
extern crate askama;
use std::{ sync::Mutex, env::args, fs::File, io::prelude::* };
use actix_files as fs;
use actix_web::{ get, web, Responder, middleware, App, HttpServer };
use askama::Template;
use actix_files as fs;
use actix_web::{ get, web, Responder, middleware, App, HttpServer };
use askama::Template;
const VALUE_UNKNOWN: &str = "-";
#[cached(size = 1, time = 10)]
const VALUE_UNKNOWN: &str = "-";
#[cached(size = 1, time = 10)]
-fn get_minecraft_executable_information_cached(world_path: String, backup_path: String) -> Option<minecraft_controller::MinecraftExe> {
- minecraft_controller::get_minecraft_executable_information(&world_path, &backup_path)
+fn get_minecraft_executable_information_cached(world_path: String, backup_path: String, rcon_password: String) -> Option<minecraft_controller::MinecraftExe> {
+ minecraft_controller::get_minecraft_executable_information(&world_path, &backup_path, &rcon_password)
}
#[get("/")]
async fn main_page(config_shared: web::Data<Mutex<Config>>) -> impl Responder {
let config = config_shared.lock().unwrap();
}
#[get("/")]
async fn main_page(config_shared: web::Data<Mutex<Config>>) -> impl Responder {
let config = config_shared.lock().unwrap();
memory: info.format_memory(),
load_average: info.format_load_average(),
uptime: info.format_uptime(),
memory: info.format_memory(),
load_average: info.format_load_average(),
uptime: info.format_uptime(),
let value_unknown = String::from(VALUE_UNKNOWN);
MainTemplate {
text_status: String::from("Minecraft server is down :("),
let value_unknown = String::from(VALUE_UNKNOWN);
MainTemplate {
text_status: String::from("Minecraft server is down :("),
memory: value_unknown.clone(),
load_average: value_unknown.clone(),
uptime: value_unknown.clone(),
world_size: value_unknown.clone(),
active_players: value_unknown.clone(),
memory: value_unknown.clone(),
load_average: value_unknown.clone(),
uptime: value_unknown.clone(),
world_size: value_unknown.clone(),
active_players: value_unknown.clone(),
- println!("{:?}", minecraft_controller::get_minecraft_executable_information(&config.world_path, &config.backup_path));
+ println!("{:?}", minecraft_controller::get_minecraft_executable_information(&config.world_path, &config.backup_path, &config.rcon_password));