Skip to content

Commit

Permalink
Added onboarding wizard
Browse files Browse the repository at this point in the history
  • Loading branch information
zklosko committed Mar 30, 2022
1 parent e5905bb commit b5941bc
Show file tree
Hide file tree
Showing 4 changed files with 213 additions and 8 deletions.
27 changes: 27 additions & 0 deletions webapp/public/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 1 addition & 8 deletions webapp/src/components/NavigationDrawer.vue
Original file line number Diff line number Diff line change
@@ -1,16 +1,9 @@
<template>
<v-navigation-drawer app permanent width="200">
<v-container>
<v-img
class="align-sm-center child-flex"
src="../../assets/logo.png"
max-height="100"
max-width="100"
contain
/>
<v-img class="mb-4" src="/logo.png" height="70" contain />
</v-container>
<v-btn color="secondary" block> Upload </v-btn>
<p class="text-overline">Dashboard</p>
<v-list dense nav>
<v-list-item
v-for="dashnav in dashnavitems"
Expand Down
5 changes: 5 additions & 0 deletions webapp/src/router/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,11 @@ const router = createRouter({
},
],
},
{
path: "/setup",
name: "setup",
component: () => import("@/views/SetupWizard.vue"),
},
],
});

Expand Down
180 changes: 180 additions & 0 deletions webapp/src/views/SetupWizard.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,180 @@
<template>
<v-container fluid>
<v-sheet class="pa-5">
<div></div>
<v-sheet
:elevation="6"
:rounded="true"
class="mx-auto"
height="350"
width="350"
>
<v-card class="mx-auto" max-width="500">
<v-card-title
class="text-h6 font-weight-regular justify-space-between"
>
<span>{{ currentTitle }}</span>
<v-avatar color="primary" size="24" v-text="state.step"></v-avatar>
</v-card-title>

<v-window v-model="state.step">
<v-window-item :value="1">
<v-card-text>
<v-text-field
v-model="db.username"
label="username"
placeholder="libretime"
></v-text-field>
<v-text-field
v-model="db.password"
label="password"
placeholder="libretime"
></v-text-field>
<v-text-field
v-model="db.dbName"
label="Database Name"
placeholder="libretime"
></v-text-field>
<v-text-field
v-model="db.host"
label="password"
placeholder="localhost"
></v-text-field>
<span class="text-caption grey--text text--darken-1">
Enter your Libretime database settings here.
</span>
</v-card-text>
</v-window-item>

<v-window-item :value="2">
<v-card-text>
<v-text-field label="Password" type="password"></v-text-field>
<v-text-field
label="Confirm Password"
type="password"
></v-text-field>
<span class="text-caption grey--text text--darken-1">
Please enter a password for your account
</span>
</v-card-text>
</v-window-item>

<v-window-item :value="3">
<v-text-field
v-model="general.host"
label="Webserver Host"
placeholder="localhost"
></v-text-field>
<v-text-field
v-model="general.port"
label="Webserver Port"
placeholder="80"
></v-text-field>
<span class="text-caption grey--text text--darken-1">
These settings are automatically pulled from your web server. In
most circumstances you won't need to change them.
</span>
</v-window-item>

<v-window-item :value="4">
<v-text-field
v-model="media.folder"
label="Media Folder"
></v-text-field>
<span class="text-caption grey--text text--darken-1">
Here you can set your default media directory for Libretime.
</span>
</v-window-item>

<v-window-item :value="5">
<div class="pa-4 text-center">
<v-img
class="mb-4"
contain
height="128"
src="/logo.svg"
></v-img>
<h3 class="text-h6 font-weight-light mb-2">
Welcome to Libretime
</h3>
<span class="text-caption grey--text"
>Let's get you on the air!</span
>
</div>
</v-window-item>
</v-window>

<v-divider></v-divider>

<v-card-actions>
<v-btn v-if="state.step > 1" text @click="prevPage"> Back </v-btn>
<v-spacer></v-spacer>
<v-btn
v-if="state.step < 5"
color="primary"
depressed
@click="nextPage"
>
Next
</v-btn>
<router-link to="/">
<v-btn v-if="state.step == 5" color="primary" depressed> Login </v-btn>
</router-link>
</v-card-actions>
</v-card>
</v-sheet>
</v-sheet>
</v-container>
</template>

<script lang="ts">
import { defineComponent, reactive, computed } from "vue";
export default defineComponent({
name: "SetupWizard",
setup() {
const state = reactive({ step: 1 });
function nextPage() {
state.step++;
}
function prevPage() {
state.step--;
}
const currentTitle = computed(() => {
switch (state.step) {
case 1:
return "Database Settings";
case 2:
return "RabbitMQ Settings";
case 3:
return "General Settings";
case 4:
return "Media Settings";
default:
return "Manual Step: Start Libretime Services";
}
});
const db = reactive({
username: "libretime",
password: "libretime",
dbName: "libretime",
host: "localhost",
});
const general = reactive({
host: "localhost",
port: "80",
});
const media = reactive({
folder: "",
});
return { state, nextPage, prevPage, currentTitle, db, general, media };
},
});
</script>

0 comments on commit b5941bc

Please sign in to comment.