Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
bwinf
medal
Commits
29ccc1de
Commit
29ccc1de
authored
Oct 19, 2020
by
Robert Czechowski
Browse files
Admin interface: Add link to dbstatus containing dbstatus secret if any to admin main page
parent
55082303
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/webfw_iron.rs
View file @
29ccc1de
...
...
@@ -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
);
...
...
templates/default/admin.hbs
View file @
29ccc1de
...
...
@@ -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>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment