Merge pull request #164 from Jorys-Paulin/feature/welcome
Tweaks to the welcome page
This commit is contained in:
@@ -1,45 +1,57 @@
|
|||||||
<main role="main" id="app" style="max-width: 600px; margin: 0 auto">
|
<main role="main" id="app" style="max-width: 600px; margin: 0 auto">
|
||||||
<div class="container-parent">
|
<header>
|
||||||
<div class="container py-3">
|
|
||||||
<h1 class="mb-0">Welcome to Sunshine!</h1>
|
<h1 class="mb-0">Welcome to Sunshine!</h1>
|
||||||
<p class="mb-0 align-self-start">
|
<p class="mb-0 align-self-start">
|
||||||
Before Getting Started, write down below these credentials
|
Before Getting Started, write down below these credentials
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</header>
|
||||||
</div>
|
|
||||||
<div class="alert alert-warning">
|
<div class="alert alert-warning">
|
||||||
These Credentials down below are needed to access the rest of the
|
These Credentials down below are needed to access the rest of the
|
||||||
application.<br />
|
application.<br />
|
||||||
Keep them safe, since <b>you will never see them again!</b>
|
Keep them safe, since <b>you will never see them again!</b>
|
||||||
</div>
|
</div>
|
||||||
<form @submit.prevent="save" class="card p-4" style="width: 100%">
|
<form @submit.prevent="save">
|
||||||
<div class="mb-2">
|
<div class="mb-2">
|
||||||
<label for="" class="form-label">Username: </label>
|
<label for="usernameInput" class="form-label">Username:</label>
|
||||||
<input
|
<input
|
||||||
type="text"
|
type="text"
|
||||||
class="form-control"
|
class="form-control"
|
||||||
|
id="usernameInput"
|
||||||
|
autocomplete="username"
|
||||||
v-model="passwordData.newUsername"
|
v-model="passwordData.newUsername"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div class="mb-2">
|
<div class="mb-2">
|
||||||
<label for="" class="form-label">Password: </label>
|
<label for="passwordInput" class="form-label">Password:</label>
|
||||||
<input
|
<input
|
||||||
type="password"
|
type="password"
|
||||||
class="form-control"
|
class="form-control"
|
||||||
|
id="passwordInput"
|
||||||
|
autocomplete="new-password"
|
||||||
v-model="passwordData.newPassword"
|
v-model="passwordData.newPassword"
|
||||||
required
|
required
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div class="mb-2">
|
<div class="mb-2">
|
||||||
<label for="" class="form-label">Password: </label>
|
<label for="confirmPasswordInput" class="form-label"
|
||||||
|
>Password (confirm):</label
|
||||||
|
>
|
||||||
<input
|
<input
|
||||||
type="password"
|
type="password"
|
||||||
class="form-control"
|
class="form-control"
|
||||||
|
id="confirmPasswordInput"
|
||||||
|
autocomplete="new-password"
|
||||||
v-model="passwordData.confirmNewPassword"
|
v-model="passwordData.confirmNewPassword"
|
||||||
required
|
required
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<button class="mb-2 btn btn-primary" style="margin: 1em auto">Login</button>
|
<button
|
||||||
|
type="submit"
|
||||||
|
class="btn btn-primary w-100 mb-2"
|
||||||
|
v-bind:disabled="loading"
|
||||||
|
>
|
||||||
|
Login
|
||||||
|
</button>
|
||||||
<div class="alert alert-danger" v-if="error"><b>Error: </b>{{error}}</div>
|
<div class="alert alert-danger" v-if="error"><b>Error: </b>{{error}}</div>
|
||||||
<div class="alert alert-success" v-if="success">
|
<div class="alert alert-success" v-if="success">
|
||||||
<b>Success! </b>This page will reload soon, your browser will ask you for
|
<b>Success! </b>This page will reload soon, your browser will ask you for
|
||||||
@@ -55,6 +67,7 @@
|
|||||||
return {
|
return {
|
||||||
error: null,
|
error: null,
|
||||||
success: false,
|
success: false,
|
||||||
|
loading: false,
|
||||||
passwordData: {
|
passwordData: {
|
||||||
newUsername: "sunshine",
|
newUsername: "sunshine",
|
||||||
newPassword: "",
|
newPassword: "",
|
||||||
@@ -65,10 +78,12 @@
|
|||||||
methods: {
|
methods: {
|
||||||
save() {
|
save() {
|
||||||
this.error = null;
|
this.error = null;
|
||||||
|
this.loading = true;
|
||||||
fetch("/api/password", {
|
fetch("/api/password", {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
body: JSON.stringify(this.passwordData),
|
body: JSON.stringify(this.passwordData),
|
||||||
}).then((r) => {
|
}).then((r) => {
|
||||||
|
this.loading = false;
|
||||||
if (r.status == 200) {
|
if (r.status == 200) {
|
||||||
r.json().then((rj) => {
|
r.json().then((rj) => {
|
||||||
if (rj.status.toString() === "true") {
|
if (rj.status.toString() === "true") {
|
||||||
|
|||||||
Reference in New Issue
Block a user