Commit 29ccc1de authored by Robert Czechowski's avatar Robert Czechowski
Browse files

Admin interface: Add link to dbstatus containing dbstatus secret if any to admin main page

parent 55082303
......@@ -930,7 +930,11 @@ fn admin<C>(req: &mut Request) -> IronResult<Response>
where C: MedalConnection + std::marker::Send + 'static {
let session_token = req.expect_session_token()?;
let (template, data) = with_conn![core::admin_index, C, req, &session_token].aug(req)?;
let config = req.get::<Read<SharedConfiguration>>().unwrap();
let (template, mut data) = with_conn![core::admin_index, C, req, &session_token].aug(req)?;
data.insert("dbstatus_secret".to_string(), to_json(&config.dbstatus_secret));
let mut resp = Response::new();
resp.set_mut(Template::new(&template, data)).set_mut(status::Ok);
......@@ -46,8 +46,16 @@
<input type="text" name="pmsid">
<input type="submit" value="search">
<input type="submit" value="Nach PMS-ID suchen">
<a href="/admin/contest/">Wettbewerbsübersicht</a>
{{#if dbstatus_secret}}
<a href="/dbstatus?{{dbstatus_secret}}">
<a href="/dbstatus">
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment