Skip to content
This repository was archived by the owner on Jul 12, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 81 additions & 0 deletions cmd/server/assets/admin/mobileapps/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
{{define "admin/mobileapps/index"}}

{{$apps := .apps}}

<!doctype html>
<html lang="en">
<head>
{{template "head" .}}
</head>

<body class="tab-content">
{{template "admin/navbar" .}}

<main role="main" class="container">
{{template "flash" .}}

<div class="card mb-3 shadow-sm">
<div class="card-header">
<span class="oi oi-phone mr-2 ml-n1" aria-hidden="true"></span>
Mobile apps
</div>

<div class="card-body">
<form method="GET" action="/admin/mobileapps" id="search-form">
<div class="input-group">
<span class="input-group-prepend">
<div class="input-group-text bg-transparent">
<span class="oi oi-magnifying-glass" aria-hidden="true"></span>
</div>
</span>
<input type="search" name="q" id="search" value="{{.query}}" placeholder="Search"
autocomplete="off" class="form-control" />
</div>
</form>
</div>

{{if .apps}}
<table class="table table-bordered table-striped table-fixed table-inner-border-only border-top mb-0">
<thead>
<tr>
<th scope="col" width="40"></th>
<th scope="col">Mobile app</th>
<th scope="col" width="120">Realm</th>
</tr>
</thead>
<tbody>
{{range .apps}}
<tr>
<td class="text-center">
{{if .MobileApp.DeletedAt}}
<span class="oi oi-circle-x text-danger"
data-toggle="tooltip" title="Mobile app is disabled - it will be deleted in a few days"></span>
{{else}}
<span class="oi oi-circle-check text-success"
data-toggle="tooltip" title="Mobile app is enabled"></span>
{{end}}
</td>

<td>
<a href="/mobile-apps/{{.MobileApp.ID}}" class="text-truncate">{{.MobileApp.Name}}</a>
</td>

<td>
<a href="/admin/realms/{{.Realm.ID}}/edit">{{.Realm.Name}}</a>
</td>
</tr>
{{end}}
</tbody>
</table>
{{else}}
<p class="text-center">
<em>There are no mobile apps.</em>
</p>
{{end}}
</div>

{{template "shared/pagination" .}}
</main>
</body>
</html>
{{end}}
85 changes: 0 additions & 85 deletions cmd/server/assets/admin/mobileapps/show.html

This file was deleted.

40 changes: 18 additions & 22 deletions cmd/server/assets/admin/realms/edit.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,11 @@ <h1>Edit {{$realm.Name}}</h1>
<div class="card mb-3 shadow-sm">
<div class="card-header">Details</div>
<div class="card-body">
<div class="alert alert-warning" class="mb-4">
Only a subset of realm fields are editable after creation. Work with
the realm administrator to update these values.
</div>

<form method="POST" action="/admin/realms/{{$realm.ID}}">
{{ .csrfField }}
<input type="hidden" name="_method" value="PATCH" />

<h6 class="card-title">Name</h6>
<h6 class="mb-3">Name</h6>
<div class="form-label-group">
<input type="text" class="form-control" value="{{$realm.Name}}" disabled />
<label for="name">Realm name</label>
Expand All @@ -45,7 +40,8 @@ <h6 class="card-title">Name</h6>
</div>

{{if .supportsPerRealmSigning}}
<h6 class="card-title">Certificate</h6>
<hr>
<h6 class="mb-3">Certificate</h6>
<div class="form-group">
<select class="form-control custom-select" disabled>
<option selected>
Expand All @@ -70,7 +66,8 @@ <h6 class="card-title">Certificate</h6>
{{end}}

{{if $systemSMSConfig}}
<h6 class="card-title">SMS Config</h6>
<hr>
<h6 class="mb-3">SMS Config</h6>
<div class="form-group form-check">
<input type="checkbox" name="can_use_system_sms_config" id="can-use-system-sms-config" class="form-check-input" value="1" {{if $realm.CanUseSystemSMSConfig}} checked{{end}}>
<label class="form-check-label" for="can-use-system-sms-config">
Expand All @@ -85,22 +82,21 @@ <h6 class="card-title">SMS Config</h6>
</div>
{{end}}

<h6 class="card-title">Abuse prevention</h6>
<div class="card-text mb-3">
{{if $realm.AbusePreventionEnabled}}
<div class="card-text text-success mt-n2">Enabled</div>
{{else}}
<div class="card-text mt-n2">Disabled</div>
{{end}}
</div>
<hr>
<h6 class="mb-2">Abuse prevention</h6>
{{if $realm.AbusePreventionEnabled}}
<div class="text-success">Enabled</div>
<div>Calculated limit: <span class="text-monospace">{{.quotaLimit}}</span></div>
<div>Remaining: <span class="text-monospace">{{.quotaRemaining}}</span></div>
{{else}}
<div class="text-secondary">Disabled</div>
{{end}}

<h6 class="card-title">Mobile apps</h6>
<div class="card-text mb-3">
<div class="mt-n2">
<a href="/admin/mobileapps?q={{$realm.Name}}">Realm mobile apps</a>
</div>
</div>
<hr>
<h6 class="mb-2">Mobile apps</h6>
<a href="/admin/mobileapps?q={{$realm.Name}}">View mobile apps &rarr;</a>

<hr>
<button type="submit" class="btn btn-primary btn-block">Update realm</button>
</form>
</div>
Expand Down
78 changes: 37 additions & 41 deletions cmd/server/assets/admin/realms/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,48 +15,44 @@
{{template "flash" .}}

<div class="card mb-3 shadow-sm">
<div class="card-header">Realms</div>
<div class="card-body">
<div class="clearfix mb-3">
<a class="btn btn-outline-secondary btn-sm float-right" href="/admin/realms/new">
<span class="oi oi-plus" aria-hidden="true"></span>
New realm
</a>
</div>

{{if $realms}}
<div class="table-responsive">
<table class="table table-bordered table-striped bg-white">
<thead>
<tr>
<th scope="col" width="50" class="text-center">ID</th>
<th scope="col">Name</th>
<th scope="col" width="125">Region code</th>
<th scope="col" width="125">Signing key</th>
</tr>
</thead>
<tbody>
{{range $realms}}
<tr>
<td class="text-center">{{.ID}}</td>
<td>
<a href="/admin/realms/{{.ID}}/edit">{{.Name}}</a>
</td>
<td>{{.RegionCode}}</td>
<td>
{{if .UseRealmCertificateKey}}Realm{{else}}System{{end}}
</td>
</tr>
{{end}}
</tbody>
</table>
</div>
{{else}}
<p class="text-center">
<em>There are no realms.</em>
</p>
{{end}}
<div class="card-header">
<span class="oi oi-badge mr-2 ml-n1" aria-hidden="true"></span>
Realms
<a href="/admin/realms/new" class="float-right mr-n1 text-secondary" data-toggle="tooltip" title="New realm">
<span class="oi oi-plus small" aria-hidden="true"></span>
</a>
</div>

{{if $realms}}
<table class="table table-bordered table-striped table-fixed table-inner-border-only mb-0">
<thead>
<tr>
<th scope="col" width="50" class="text-center">ID</th>
<th scope="col">Name</th>
<th scope="col" width="100" class="text-center">Region</th>
<th scope="col" width="120" class="text-center">Signing key</th>
</tr>
</thead>
<tbody>
{{range $realms}}
<tr>
<td class="text-center">{{.ID}}</td>
<td>
<a href="/admin/realms/{{.ID}}/edit">{{.Name}}</a>
</td>
<td class="text-center">{{.RegionCode}}</td>
<td class="text-center">
{{if .UseRealmCertificateKey}}Realm{{else}}System{{end}}
</td>
</tr>
{{end}}
</tbody>
</table>
{{else}}
<p class="card-body text-center mb-0">
<em>There are no users{{if .query}} that match the query{{end}}.</em>
</p>
{{end}}
</div>
</main>
</body>
Expand Down
Loading