2023-09-15 13:06:31 +01:00
|
|
|
<!DOCTYPE html>
|
|
|
|
<html lang="en">
|
|
|
|
<head>
|
|
|
|
<title>{{.ServiceName}}</title>
|
2023-12-17 16:03:13 +00:00
|
|
|
<link rel="stylesheet" href="/theme/style.css">
|
2023-10-10 18:06:43 +01:00
|
|
|
<script>
|
|
|
|
window.addEventListener("load", function () {
|
|
|
|
selectText("app-secret");
|
|
|
|
});
|
|
|
|
|
|
|
|
// Thanks again: https://stackoverflow.com/a/987376
|
|
|
|
function selectText(nodeId) {
|
|
|
|
const node = document.getElementById(nodeId);
|
|
|
|
|
|
|
|
if (document.body.createTextRange) {
|
|
|
|
const range = document.body.createTextRange();
|
|
|
|
range.moveToElementText(node);
|
|
|
|
range.select();
|
|
|
|
} else if (window.getSelection) {
|
|
|
|
const selection = window.getSelection();
|
|
|
|
const range = document.createRange();
|
|
|
|
range.selectNodeContents(node);
|
|
|
|
selection.removeAllRanges();
|
|
|
|
selection.addRange(range);
|
|
|
|
} else {
|
|
|
|
console.warn("Could not select text in node: Unsupported browser.");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
2023-09-15 13:06:31 +01:00
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<header>
|
|
|
|
<h1>{{.ServiceName}}</h1>
|
|
|
|
</header>
|
|
|
|
<main>
|
|
|
|
<form method="GET" action="/">
|
|
|
|
<button type="submit">Home</button>
|
|
|
|
</form>
|
|
|
|
|
2023-10-10 18:06:43 +01:00
|
|
|
{{if .NewAppSecret}}
|
|
|
|
<div>New application secret: <span id="app-secret">{{.NewAppSecret}}</span> for {{.NewAppName}}</div>
|
|
|
|
{{end}}
|
|
|
|
|
2024-06-02 12:23:22 +01:00
|
|
|
<h2>Manage Client Applications</h2>
|
|
|
|
<form method="GET" action="/manage/apps/create">
|
|
|
|
<button type="submit">New Client Application</button>
|
|
|
|
</form>
|
|
|
|
|
|
|
|
{{if eq (len .Apps) 0}}
|
|
|
|
<div>No client applications found</div>
|
2023-09-15 13:06:31 +01:00
|
|
|
{{else}}
|
2024-06-02 12:23:22 +01:00
|
|
|
<table>
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<th>ID</th>
|
|
|
|
<th>Name</th>
|
|
|
|
<th>Domain</th>
|
|
|
|
<th>Public</th>
|
|
|
|
<th>SSO</th>
|
|
|
|
<th>Active</th>
|
|
|
|
<th>Owner</th>
|
|
|
|
<th>Actions</th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
{{range .Apps}}
|
2023-09-15 13:06:31 +01:00
|
|
|
<tr>
|
2024-06-02 12:23:22 +01:00
|
|
|
<td>{{.Subject}}</td>
|
|
|
|
<td>{{.Name}}</td>
|
|
|
|
<td>{{.Domain}}</td>
|
|
|
|
<td>{{.Public}}</td>
|
|
|
|
<td>{{.Sso}}</td>
|
|
|
|
<td>{{.Active}}</td>
|
|
|
|
<td>{{.Owner}}</td>
|
|
|
|
<td>
|
|
|
|
<form method="GET" action="/manage/apps">
|
|
|
|
<input type="hidden" name="offset" value="{{$.Offset}}"/>
|
|
|
|
<input type="hidden" name="edit" value="{{.Subject}}"/>
|
|
|
|
<button type="submit">Edit</button>
|
|
|
|
</form>
|
|
|
|
<form method="POST" action="/manage/apps?offset={{$.Offset}}">
|
|
|
|
<input type="hidden" name="action" value="secret"/>
|
|
|
|
<input type="hidden" name="offset" value="{{$.Offset}}"/>
|
|
|
|
<input type="hidden" name="subject" value="{{.Subject}}"/>
|
|
|
|
<button type="submit">Reset Secret</button>
|
|
|
|
</form>
|
|
|
|
</td>
|
2023-09-15 13:06:31 +01:00
|
|
|
</tr>
|
|
|
|
{{end}}
|
2024-06-02 12:23:22 +01:00
|
|
|
</tbody>
|
|
|
|
</table>
|
2023-09-15 13:06:31 +01:00
|
|
|
{{end}}
|
|
|
|
</main>
|
|
|
|
</body>
|
|
|
|
</html>
|