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

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 @@
PMS-ID:<br>
<input type="text" name="pmsid">
<br><br>
<input type="submit" value="search">
<input type="submit" value="Nach PMS-ID suchen">
</form>
</p>
<h2>Wettbewerbs-Export</h2>
<a href="/admin/contest/">Wettbewerbsübersicht</a>
<h2>Datenbankstatus</h2>
{{#if dbstatus_secret}}
<a href="/dbstatus?{{dbstatus_secret}}">
{{else}}
<a href="/dbstatus">
{{/if}}
Datenbankstatus</a>
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