Show a Welcome Page if credentials are created the first time Sunshine is started

This commit is contained in:
Elia Zammuto
2021-07-29 18:55:34 +02:00
parent c243e82047
commit 28fecbc50c
7 changed files with 112 additions and 3 deletions

View File

@@ -0,0 +1,17 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Sunshine</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-wEmeIV1mKuiNpC+IOBjI7aAzPcEZeedi5yW5f2yOq55WWLwNGmvvx4Um1vskeMj0" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0/dist/js/bootstrap.bundle.min.js"
integrity="sha384-p34f1UUtsS3wqzfto5wAAmdvj+osOnFyQFpp4Ua3gs/ZVWx6oOypYoCJhGGScy+8" crossorigin="anonymous">
</script>
<script src="https://cdn.jsdelivr.net/npm/vue@2.6.12/dist/vue.js"></script>
</head>
<body>

30
assets/web/welcome.html Normal file
View File

@@ -0,0 +1,30 @@
<main role="main" id="app" style="max-width: 600px;margin: 0 auto;">
<div class="container-parent">
<div class="container py-3">
<h1 class="mb-0">Welcome to Sunshine!</h1>
<p class="mb-0 align-self-start">Before Getting Started, write down below these credentials</p>
</div>
</div>
<div class="alert alert-warning">These Credentials down below are needed to access the rest of the application.<br> Keep them safe, since <b>you will never see them again!</b></div>
<div class="card p-4" style="width: 100%;">
<div class="mb-2">
<label for="" class="form-label">Username: </label>
<input type="text" class="form-control" disabled id="username">
</div>
<div class="mb-2">
<label for="" class="form-label">Password: </label>
<input type="text" class="form-control" disabled id="password">
</div>
<a href="/" class="mb-2 btn btn-primary" style="margin: 1em auto;">Login</a>
</div>
</div>
</main>
<script>
fetch("/api/setup/password").then(r => r.json()).then(r => {
if(r.status === "true"){
document.querySelector("#username").value = r.username;
document.querySelector("#password").value = r.password;
}
})
</script>