add favicon support
This commit is contained in:
parent
d7c4fac34c
commit
983ac7021e
1 changed files with 6 additions and 0 deletions
|
|
@ -12,6 +12,7 @@ struct MinecraftStatusResponse<'a> {
|
||||||
players: u32,
|
players: u32,
|
||||||
max_players: u32,
|
max_players: u32,
|
||||||
enforces_secure_chat: bool,
|
enforces_secure_chat: bool,
|
||||||
|
favicon: Option<&'a String>,
|
||||||
motd: String,
|
motd: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -127,6 +128,7 @@ env!("CARGO_PKG_VERSION"));
|
||||||
players: status.players.online,
|
players: status.players.online,
|
||||||
max_players: status.players.max,
|
max_players: status.players.max,
|
||||||
enforces_secure_chat: status.enforces_secure_chat(),
|
enforces_secure_chat: status.enforces_secure_chat(),
|
||||||
|
favicon: status.favicon.as_ref(),
|
||||||
motd: status.parse_description(),
|
motd: status.parse_description(),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -134,12 +136,15 @@ env!("CARGO_PKG_VERSION"));
|
||||||
"<hr/>
|
"<hr/>
|
||||||
<h2>Server Details</h2>
|
<h2>Server Details</h2>
|
||||||
<p>
|
<p>
|
||||||
|
<strong>Favicon:</strong></br>
|
||||||
|
<img width=\"64\" height=\"64\" src=\"{}\"></br>
|
||||||
<strong>Version:</strong> <code>{}</code><br/>
|
<strong>Version:</strong> <code>{}</code><br/>
|
||||||
<strong>Players:</strong> <code>{}/{}</code><br/>
|
<strong>Players:</strong> <code>{}/{}</code><br/>
|
||||||
<strong>Enforces Secure Chat:</strong> <code>{}</code></br>
|
<strong>Enforces Secure Chat:</strong> <code>{}</code></br>
|
||||||
<strong>MOTD:</strong>
|
<strong>MOTD:</strong>
|
||||||
</p>
|
</p>
|
||||||
<pre id=\"motd\"><code>{}</code></pre>",
|
<pre id=\"motd\"><code>{}</code></pre>",
|
||||||
|
sanitize_html(&minecraft_status.favicon.map_or("", |s| s).to_string()),
|
||||||
sanitize_html(minecraft_status.version).to_string(),
|
sanitize_html(minecraft_status.version).to_string(),
|
||||||
minecraft_status.players,
|
minecraft_status.players,
|
||||||
minecraft_status.max_players,
|
minecraft_status.max_players,
|
||||||
|
|
@ -194,6 +199,7 @@ env!("CARGO_PKG_VERSION"));
|
||||||
players: status.players.online,
|
players: status.players.online,
|
||||||
max_players: status.players.max,
|
max_players: status.players.max,
|
||||||
enforces_secure_chat: status.enforces_secure_chat(),
|
enforces_secure_chat: status.enforces_secure_chat(),
|
||||||
|
favicon: status.favicon.as_ref(),
|
||||||
motd: status.parse_description(),
|
motd: status.parse_description(),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue