This commit is contained in:
parent
f1209d3b6b
commit
511897164e
3 changed files with 7 additions and 5 deletions
|
@ -10,5 +10,5 @@
|
|||
|
||||
<body>
|
||||
<div id="wrapper">
|
||||
<a href="/">Home</a>
|
||||
<a href="{{ $.BaseURL }}">Home</a>
|
||||
<div id="main">
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{{ template "header.html" . }}
|
||||
<header>{{ if eq .Data.lock.Name "" }}Lock #{{ .Data.lock.ID }}{{ else }}{{ .Data.lock.Name }}{{ end }}</header>
|
||||
[ <a href="/locks/{{ .Data.lock.ID }}/edit">rename</a> ]<br />
|
||||
[ <a href="{{ $.BaseURL }}/locks/{{ .Data.lock.ID }}/edit">rename</a> ]<br />
|
||||
<br />
|
||||
<table border="1">
|
||||
<tr>
|
||||
|
@ -16,7 +16,7 @@
|
|||
<td>{{ $code.Name }}</td>
|
||||
<td>{{ $code.Code }}</td>
|
||||
<td>{{ if $code.Enabled }}enabled{{ else }}disabled{{ end }}</td>
|
||||
<td>[ <a href="/locks/{{ $.Data.lock.ID }}/codes/{{ $code.Slot }}">edit</a> ]</td>
|
||||
<td>[ <a href="{{ $.BaseURL }}/locks/{{ $.Data.lock.ID }}/codes/{{ $code.Slot }}">edit</a> ]</td>
|
||||
</tr>
|
||||
{{ end }}
|
||||
</table>
|
||||
|
|
|
@ -72,7 +72,8 @@ func lockEditHandler(c echo.Context) error {
|
|||
return err
|
||||
}
|
||||
|
||||
return c.Redirect(http.StatusFound, fmt.Sprintf("/locks/%d", lockID))
|
||||
baseURL := c.Request().Header.Get("X-Ingress-Path")
|
||||
return c.Redirect(http.StatusFound, fmt.Sprintf("%s/locks/%d", baseURL, lockID))
|
||||
}
|
||||
|
||||
func lockCodeEditHandler(c echo.Context) error {
|
||||
|
@ -162,5 +163,6 @@ func lockCodeEditHandler(c echo.Context) error {
|
|||
return err
|
||||
}
|
||||
|
||||
return c.Redirect(http.StatusFound, fmt.Sprintf("/locks/%d", lockID))
|
||||
baseURL := c.Request().Header.Get("X-Ingress-Path")
|
||||
return c.Redirect(http.StatusFound, fmt.Sprintf("%s/locks/%d", baseURL, lockID))
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue