mirror of
https://github.com/pomerium/pomerium.git
synced 2025-05-31 09:57:17 +02:00
internal/frontend : serve static assets (#392)
Signed-off-by: Bobby DeSimone <bobbydesimone@gmail.com>
This commit is contained in:
parent
f20d913abe
commit
ebee64b70b
24 changed files with 700 additions and 502 deletions
237
internal/frontend/assets/html/dashboard.go.html
Normal file
237
internal/frontend/assets/html/dashboard.go.html
Normal file
|
@ -0,0 +1,237 @@
|
|||
{{define "dashboard.html"}}
|
||||
<!DOCTYPE html>
|
||||
<html lang="en" charset="utf-8">
|
||||
<head>
|
||||
<title>Pomerium</title>
|
||||
{{template "header.html"}}
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="main">
|
||||
<div id="info-box">
|
||||
<div class="card">
|
||||
{{if .Session.Picture }}
|
||||
<img class="icon" src="{{.Session.Picture}}" alt="user image" />
|
||||
{{else}}
|
||||
<img
|
||||
class="icon"
|
||||
src="/.pomerium/assets/img/account_circle-24px.svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
width="24"
|
||||
height="24"
|
||||
/>
|
||||
{{end}}
|
||||
|
||||
<form method="POST" action="/.pomerium/sign_out">
|
||||
<section>
|
||||
<h2>Current user</h2>
|
||||
<p class="message">Your current session details.</p>
|
||||
<fieldset>
|
||||
{{if .Session.Name}}
|
||||
<label>
|
||||
<span>Name</span>
|
||||
<input
|
||||
type="text"
|
||||
class="field"
|
||||
value="{{.Session.Name}}"
|
||||
title="{{.Session.Name}}"
|
||||
disabled
|
||||
/>
|
||||
</label>
|
||||
{{else}} {{if .Session.GivenName}}
|
||||
<label>
|
||||
<span>Given Name</span>
|
||||
<input
|
||||
type="text"
|
||||
class="field"
|
||||
value="{{.Session.GivenName}}"
|
||||
title="{{.Session.GivenName}}"
|
||||
disabled
|
||||
/>
|
||||
</label>
|
||||
{{end}} {{if .Session.FamilyName}}
|
||||
<label>
|
||||
<span>Family Name</span>
|
||||
<input
|
||||
type="text"
|
||||
class="field"
|
||||
value="{{.Session.FamilyName}}"
|
||||
title="{{.Session.FamilyName}}"
|
||||
disabled
|
||||
/>
|
||||
</label>
|
||||
{{end}} {{end}} {{if .Session.Subject}}
|
||||
<label>
|
||||
<span>UserID</span>
|
||||
<input
|
||||
type="text"
|
||||
class="field"
|
||||
value="{{.Session.Subject}}"
|
||||
title="{{.Session.Subject}}"
|
||||
disabled
|
||||
/>
|
||||
</label>
|
||||
{{end}} {{if .Session.Email}}
|
||||
<label>
|
||||
<span>Email</span>
|
||||
<input
|
||||
type="email"
|
||||
class="field"
|
||||
value="{{.Session.Email}}"
|
||||
title="{{.Session.Email}}"
|
||||
disabled
|
||||
/>
|
||||
</label>
|
||||
{{end}} {{if .Session.User}}
|
||||
<label>
|
||||
<span>User</span>
|
||||
<input
|
||||
type="text"
|
||||
class="field"
|
||||
value="{{.Session.User}}"
|
||||
title="{{.Session.User}}"
|
||||
disabled
|
||||
/>
|
||||
</label>
|
||||
{{end}} {{range $i,$_:= .Session.Groups}}
|
||||
<label>
|
||||
{{if eq $i 0}}
|
||||
<span>Group</span>
|
||||
{{else}}
|
||||
<span></span>
|
||||
{{end}}
|
||||
<input
|
||||
type="text"
|
||||
class="field"
|
||||
value="{{.}}"
|
||||
title="{{.}}"
|
||||
disabled
|
||||
/>
|
||||
</label>
|
||||
{{end}} {{if .Session.Expiry}}
|
||||
<label>
|
||||
<span>Expiry</span>
|
||||
<input
|
||||
type="text"
|
||||
class="field"
|
||||
value="{{.Session.Expiry.Time}}"
|
||||
title="{{.Session.Expiry.Time}}"
|
||||
disabled
|
||||
/>
|
||||
</label>
|
||||
{{end}} {{if .Session.IssuedAt}}
|
||||
<label>
|
||||
<span>Issued</span>
|
||||
<input
|
||||
type="text"
|
||||
class="field"
|
||||
value="{{.Session.IssuedAt.Time}}"
|
||||
title="{{.Session.IssuedAt.Time}}"
|
||||
disabled
|
||||
/>
|
||||
</label>
|
||||
{{end}} {{if .Session.Issuer}}
|
||||
<label>
|
||||
<span>Issuer</span>
|
||||
<input
|
||||
type="text"
|
||||
class="field"
|
||||
value="{{ .Session.Issuer}}"
|
||||
title="{{ .Session.Issuer}}"
|
||||
disabled
|
||||
/>
|
||||
</label>
|
||||
{{end}} {{range $i, $_:= .Session.Audience}}
|
||||
<label>
|
||||
{{if eq $i 0}}
|
||||
<span>Audience</span>
|
||||
{{else}}
|
||||
<span></span>
|
||||
{{end}}
|
||||
<input
|
||||
type="text"
|
||||
class="field"
|
||||
title="{{ . }}"
|
||||
value="{{ . }}"
|
||||
disabled
|
||||
/>
|
||||
</label>
|
||||
{{end}} {{if .Session.ImpersonateEmail}}
|
||||
<label>
|
||||
<span>Impersonating Email</span>
|
||||
<input
|
||||
type="text"
|
||||
class="field"
|
||||
value="{{.Session.ImpersonateEmail}}"
|
||||
disabled
|
||||
/>
|
||||
</label>
|
||||
{{end}} {{range $i,$_:= .Session.ImpersonateGroups}}
|
||||
<label>
|
||||
{{if eq $i 0}}
|
||||
<span>Impersonating Group</span>
|
||||
{{else}}
|
||||
<span></span>
|
||||
{{end}}
|
||||
<input
|
||||
type="text"
|
||||
class="field"
|
||||
value="{{.}}"
|
||||
title="{{.}}"
|
||||
disabled
|
||||
/>
|
||||
</label>
|
||||
{{end}}
|
||||
</fieldset>
|
||||
</section>
|
||||
<div class="flex">
|
||||
{{ .csrfField }}
|
||||
<button class="button full" type="submit">Sign Out</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
{{if .IsAdmin}}
|
||||
<form method="POST" action="/.pomerium/impersonate">
|
||||
<section>
|
||||
<h2>Sign-in-as</h2>
|
||||
<p class="message">
|
||||
Administrators can temporarily impersonate another user.
|
||||
</p>
|
||||
<fieldset>
|
||||
<label>
|
||||
<span>Email</span>
|
||||
<input
|
||||
name="email"
|
||||
type="email"
|
||||
class="field"
|
||||
value=""
|
||||
placeholder="user@example.com"
|
||||
/>
|
||||
</label>
|
||||
<label>
|
||||
<span>Group</span>
|
||||
<input
|
||||
name="group"
|
||||
type="text"
|
||||
class="field"
|
||||
value=""
|
||||
placeholder="engineering"
|
||||
/>
|
||||
</label>
|
||||
</fieldset>
|
||||
</section>
|
||||
<div class="flex">
|
||||
{{ .csrfField }}
|
||||
<button class="button full" type="submit">
|
||||
Impersonate session
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
{{ end }}
|
||||
</div>
|
||||
</div>
|
||||
{{template "footer.html"}}
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
{{end}}
|
Loading…
Add table
Add a link
Reference in a new issue