Browse Source

init

readme
Mayank 5 years ago
commit
949d25ba59
  1. 21
      .gitignore
  2. 21
      README.md
  3. 3
      babel.config.js
  4. 55
      package.json
  5. BIN
      public/favicon.ico
  6. BIN
      public/favicon.png
  7. 23
      public/index.html
  8. 16
      src/App.vue
  9. 12
      src/assets/icon-wifi-1.svg
  10. 12
      src/assets/icon-wifi-2.svg
  11. 12
      src/assets/icon-wifi-3.svg
  12. BIN
      src/assets/logo.png
  13. 5
      src/assets/logo.svg
  14. 47
      src/components/InputPassword.vue
  15. 17
      src/global-styles/_variables.scss
  16. 56
      src/global-styles/custom.scss
  17. 10
      src/global-styles/design-system.scss
  18. 22
      src/main.js
  19. 21
      src/router/index.js
  20. 54
      src/store/index.js
  21. 276
      src/views/Home.vue
  22. 11
      vue.config.js
  23. 8330
      yarn.lock

21
.gitignore

@ -0,0 +1,21 @@
.DS_Store
node_modules
/dist
# local env files
.env.local
.env.*.local
# Log files
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

21
README.md

@ -0,0 +1,21 @@
# Umbrel Dashboard UI
## Project setup
```
yarn install
```
### Compiles and hot-reloads for development
```
yarn serve
```
### Compiles and minifies for production
```
yarn build
```
### Lints and fixes files
```
yarn lint
```

3
babel.config.js

@ -0,0 +1,3 @@
module.exports = {
presets: ["@vue/cli-plugin-babel/preset"]
};

55
package.json

@ -0,0 +1,55 @@
{
"name": "umbrel-dashboard",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint"
},
"dependencies": {
"animate.css": "^3.7.2",
"bootstrap-vue": "^2.2.2",
"core-js": "^3.4.4",
"vue": "^2.6.10",
"vue-confetti": "^2.0.7",
"vue-router": "^3.1.3",
"vuex": "^3.1.2"
},
"devDependencies": {
"@vue/cli-plugin-babel": "^4.1.0",
"@vue/cli-plugin-eslint": "^4.1.0",
"@vue/cli-plugin-router": "^4.1.0",
"@vue/cli-plugin-vuex": "^4.1.0",
"@vue/cli-service": "^4.1.0",
"@vue/eslint-config-prettier": "^5.0.0",
"babel-eslint": "^10.0.3",
"eslint": "^5.16.0",
"eslint-plugin-prettier": "^3.1.1",
"eslint-plugin-vue": "^5.0.0",
"prettier": "^1.19.1",
"sass": "^1.23.7",
"sass-loader": "^8.0.0",
"vue-template-compiler": "^2.6.10"
},
"eslintConfig": {
"root": true,
"env": {
"node": true
},
"extends": [
"plugin:vue/essential",
"@vue/prettier"
],
"rules": {
"no-console": "off"
},
"parserOptions": {
"parser": "babel-eslint"
}
},
"browserslist": [
"> 1%",
"last 2 versions"
]
}

BIN
public/favicon.ico

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
public/favicon.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

23
public/index.html

@ -0,0 +1,23 @@
<!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">
<meta name="robots" content="noindex, nofollow" />
<link rel="icon" href="<%= BASE_URL %>favicon.png">
<title>Umbrel Dashboard UI</title>
</head>
<body>
<noscript>
<strong>We're sorry but Umbrel
doesn't work properly without JavaScript enabled. Please enable it to
continue.</strong>
</noscript>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
</html>

16
src/App.vue

@ -0,0 +1,16 @@
<template>
<div id="app">
<router-view />
</div>
</template>
<style lang="scss">
@import "@/global-styles/design-system.scss";
</style>
<script>
export default {
name: "App",
mounted() {}
};
</script>

12
src/assets/icon-wifi-1.svg

@ -0,0 +1,12 @@
<svg width="21" height="21" viewBox="0 0 21 21" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0)">
<path d="M10.5495 18.4018C11.9045 18.4018 13.0029 17.3034 13.0029 15.9485C13.0029 14.5935 11.9045 13.4951 10.5495 13.4951C9.19459 13.4951 8.09619 14.5935 8.09619 15.9485C8.09619 17.3034 9.19459 18.4018 10.5495 18.4018Z" fill="#858997"/>
<path opacity="0.2" d="M16.4129 10.0379C16.3765 10.0004 16.3381 9.96706 16.3007 9.93268L16.1905 9.82852C16.1723 9.8093 16.152 9.79515 16.1288 9.77694C12.9564 6.89483 8.10132 7.0091 5.07358 10.0368L4.71863 10.3928L4.22715 10.8843C3.62848 11.483 3.63151 12.4588 4.23119 13.0585C4.83189 13.6602 5.80776 13.6612 6.40542 13.0626L7.25286 12.2151C9.17832 10.2907 12.3102 10.2907 14.2347 12.2141L14.8465 12.8067C15.4391 13.3993 16.4059 13.3983 17.0015 12.8016C17.2897 12.5144 17.4485 12.1312 17.4495 11.7236C17.4505 11.3181 17.2938 10.9348 17.0055 10.6487L16.4129 10.0379Z" fill="#858997"/>
<path opacity="0.2" d="M20.5926 7.00493L20.0829 6.49525C20.0809 6.49323 20.0799 6.49019 20.0758 6.48918L19.6733 6.08467C19.6026 6.0149 19.5257 5.95422 19.4448 5.90163C14.2742 1.36205 6.40955 1.50161 1.40377 6.31727C1.3795 6.33951 1.3522 6.35468 1.32793 6.37895L0.407675 7.30022C-0.13841 7.84529 -0.135376 8.73217 0.413742 9.28129C0.96185 9.8294 1.84873 9.83344 2.39482 9.28635L3.31507 8.36711C3.32114 8.35902 3.3262 8.35194 3.33226 8.34688C7.38037 4.43631 13.8019 4.41204 17.8824 8.26699L18.6065 8.99207C19.1515 9.53714 20.0404 9.53512 20.5885 8.98701C21.1356 8.43789 21.1377 7.55 20.5926 7.00493Z" fill="#858997"/>
</g>
<defs>
<clipPath id="clip0">
<rect width="21" height="21" fill="white"/>
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 1.6 KiB

12
src/assets/icon-wifi-2.svg

@ -0,0 +1,12 @@
<svg width="21" height="21" viewBox="0 0 21 21" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0)">
<path d="M10.5495 18.4018C11.9045 18.4018 13.0029 17.3034 13.0029 15.9485C13.0029 14.5935 11.9045 13.4951 10.5495 13.4951C9.19459 13.4951 8.09619 14.5935 8.09619 15.9485C8.09619 17.3034 9.19459 18.4018 10.5495 18.4018Z" fill="#858997"/>
<path d="M16.4129 10.0379C16.3765 10.0004 16.3381 9.96706 16.3007 9.93268L16.1905 9.82852C16.1723 9.8093 16.152 9.79515 16.1288 9.77694C12.9564 6.89483 8.10132 7.0091 5.07358 10.0368L4.71863 10.3928L4.22715 10.8843C3.62848 11.483 3.63151 12.4588 4.23119 13.0585C4.83189 13.6602 5.80776 13.6612 6.40542 13.0626L7.25286 12.2151C9.17832 10.2907 12.3102 10.2907 14.2347 12.2141L14.8465 12.8067C15.4391 13.3993 16.4059 13.3983 17.0015 12.8016C17.2897 12.5144 17.4485 12.1312 17.4495 11.7236C17.4505 11.3181 17.2938 10.9348 17.0055 10.6487L16.4129 10.0379Z" fill="#858997"/>
<path opacity="0.2" d="M20.5926 7.00493L20.0829 6.49525C20.0809 6.49323 20.0799 6.49019 20.0758 6.48918L19.6733 6.08467C19.6026 6.0149 19.5257 5.95422 19.4448 5.90163C14.2742 1.36205 6.40955 1.50161 1.40377 6.31727C1.3795 6.33951 1.3522 6.35468 1.32793 6.37895L0.407675 7.30022C-0.13841 7.84529 -0.135376 8.73217 0.413742 9.28129C0.96185 9.8294 1.84873 9.83344 2.39482 9.28635L3.31507 8.36711C3.32114 8.35902 3.3262 8.35194 3.33226 8.34688C7.38037 4.43631 13.8019 4.41204 17.8824 8.26699L18.6065 8.99207C19.1515 9.53714 20.0404 9.53512 20.5885 8.98701C21.1356 8.43789 21.1377 7.55 20.5926 7.00493Z" fill="#858997"/>
</g>
<defs>
<clipPath id="clip0">
<rect width="21" height="21" fill="white"/>
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 1.6 KiB

12
src/assets/icon-wifi-3.svg

@ -0,0 +1,12 @@
<svg width="21" height="21" viewBox="0 0 21 21" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0)">
<path d="M10.5495 18.4018C11.9045 18.4018 13.0029 17.3034 13.0029 15.9485C13.0029 14.5935 11.9045 13.4951 10.5495 13.4951C9.19459 13.4951 8.09619 14.5935 8.09619 15.9485C8.09619 17.3034 9.19459 18.4018 10.5495 18.4018Z" fill="#858997"/>
<path d="M16.4129 10.0379C16.3765 10.0004 16.3381 9.96706 16.3007 9.93268L16.1905 9.82852C16.1723 9.8093 16.152 9.79515 16.1288 9.77694C12.9564 6.89483 8.10132 7.0091 5.07358 10.0368L4.71863 10.3928L4.22715 10.8843C3.62848 11.483 3.63151 12.4588 4.23119 13.0585C4.83189 13.6602 5.80776 13.6612 6.40542 13.0626L7.25286 12.2151C9.17832 10.2907 12.3102 10.2907 14.2347 12.2141L14.8465 12.8067C15.4391 13.3993 16.4059 13.3983 17.0015 12.8016C17.2897 12.5144 17.4485 12.1312 17.4495 11.7236C17.4505 11.3181 17.2938 10.9348 17.0055 10.6487L16.4129 10.0379Z" fill="#858997"/>
<path d="M20.5926 7.00493L20.0829 6.49525C20.0809 6.49323 20.0799 6.49019 20.0758 6.48918L19.6733 6.08467C19.6026 6.0149 19.5257 5.95422 19.4448 5.90163C14.2742 1.36205 6.40955 1.50161 1.40377 6.31727C1.3795 6.33951 1.3522 6.35468 1.32793 6.37895L0.407675 7.30022C-0.13841 7.84529 -0.135376 8.73217 0.413742 9.28129C0.96185 9.8294 1.84873 9.83344 2.39482 9.28635L3.31507 8.36711C3.32114 8.35902 3.3262 8.35194 3.33226 8.34688C7.38037 4.43631 13.8019 4.41204 17.8824 8.26699L18.6065 8.99207C19.1515 9.53714 20.0404 9.53512 20.5885 8.98701C21.1356 8.43789 21.1377 7.55 20.5926 7.00493Z" fill="#858997"/>
</g>
<defs>
<clipPath id="clip0">
<rect width="21" height="21" fill="white"/>
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 1.6 KiB

BIN
src/assets/logo.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

5
src/assets/logo.svg

@ -0,0 +1,5 @@
<svg width="180" height="200" viewBox="0 0 180 200" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M90.166 200C93.4473 200 97.373 199.395 101.943 198.184C117.373 192.402 125.088 181.27 125.088 164.785V117.617C125.088 116.719 125.029 115.937 124.912 115.273C124.912 115.156 124.902 115.078 124.883 115.039C124.863 115 124.814 114.922 124.736 114.805C123.135 110.781 120.596 108.77 117.119 108.77H116.65L115.654 108.828H115.127C115.01 108.828 114.873 108.887 114.717 109.004C110.693 110.566 108.682 113.867 108.682 118.906V167.246C108.682 169.863 108.018 172.422 106.689 174.922C102.939 180.82 97.373 183.77 89.9902 183.77C84.4043 183.77 79.6777 182.031 75.8105 178.555C72.6465 175.977 71.0254 171.23 70.9473 164.316L70.8301 116.797C70.8301 116.367 70.791 115.918 70.7129 115.449C70.7129 115.293 70.7031 115.186 70.6836 115.127C70.6641 115.068 70.5957 114.961 70.4785 114.805C68.8379 110.703 66.2402 108.652 62.6855 108.652C61.5527 108.77 60.791 108.906 60.4004 109.062C56.4941 110.625 54.541 113.262 54.541 116.973L54.7168 166.25C54.7559 173.594 56.7871 180.215 60.8105 186.113C68.3105 195.371 78.0176 200 89.9316 200H90.166Z" fill="#5351FB"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M34.0267 78.2397C25.0747 78.2397 19.5903 80.8572 16.1027 84.9716C13.2457 88.3419 8.19753 88.7581 4.82721 85.9011C1.45689 83.0442 1.04072 77.996 3.89766 74.6257C11.2138 65.9949 21.7471 62.2397 34.0267 62.2397C44.3462 62.2397 53.8044 64.8604 62.1984 70.1408C70.8948 64.9859 80.0577 62.2397 89.6031 62.2397C98.9359 62.2397 107.747 64.8667 115.938 69.8647C123.248 64.9426 132.023 62.6809 141.8 62.6809C154.063 62.6809 164.865 66.2318 173.642 73.7085C177.006 76.5734 177.41 81.6226 174.545 84.9861C171.68 88.3496 166.631 88.7538 163.267 85.8888C157.773 81.2084 150.804 78.6809 141.8 78.6809C133.295 78.6809 127.181 80.9311 122.714 84.787C119.22 87.8032 114.116 88.036 110.361 85.3504L110.22 85.2494C103.457 80.448 96.6344 78.2397 89.6031 78.2397C82.445 78.2397 75.1767 80.531 67.6755 85.6062C64.1535 87.9891 59.5099 87.8844 56.099 85.3452L55.8512 85.1607C49.5737 80.5653 42.3951 78.2397 34.0267 78.2397Z" fill="#5351FB"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M133.969 32.9107C122.302 22.7916 107.261 17.6512 88.1548 18.0182C68.9596 18.3871 54.0522 23.9035 42.7387 34.0244C31.3296 44.2309 22.8201 59.7981 17.7954 81.5961C16.803 85.9015 12.5082 88.5872 8.20286 87.5947C3.89749 86.6023 1.21181 82.3076 2.20425 78.0022C7.71919 54.0773 17.4796 35.153 32.071 22.0997C46.7579 8.96082 65.5814 2.44902 87.8474 2.0212C110.203 1.59166 129.301 7.68281 144.452 20.8236C159.471 33.8502 169.858 53.1503 176.202 77.8057C177.303 82.0846 174.727 86.4459 170.448 87.5468C166.169 88.6478 161.808 86.0715 160.707 81.7926C154.876 59.1318 145.767 43.1438 133.969 32.9107Z" fill="#5351FB"/>
</svg>

After

Width:  |  Height:  |  Size: 2.7 KiB

47
src/components/InputPassword.vue

@ -0,0 +1,47 @@
<template>
<b-input-group class="card-input-group">
<!-- Todo: make it work with b-form-input + v-model -->
<input
:class="inputClass"
:placeholder="placeholder"
:type="showPassword ? 'text' : 'password'"
v-bind:value="value"
v-on:input="$emit('input', $event.target.value)"
/>
<b-input-group-append>
<b-button @click="togglePassword">
<b-icon :icon="showPassword ? 'eye-slash-fill' : 'eye-fill'"></b-icon>
</b-button>
</b-input-group-append>
</b-input-group>
</template>
<script>
export default {
props: {
value: String,
inputClass: String,
placeholder: String
},
computed: {
showPassword() {
return this.state.showPassword;
}
},
data() {
return {
state: {
showPassword: false
}
};
},
methods: {
togglePassword() {
return (this.state.showPassword = !this.state.showPassword);
}
}
};
</script>
<style lang="scss" scoped>
</style>

17
src/global-styles/_variables.scss

@ -0,0 +1,17 @@
$black: #141821;
$purple: #5351FB;
$primary: $purple;
$green: #00CD98;
$red: #F46E6E;
$spacer: 1.5rem;
$body-color: $black;
$font-family-sans-serif: Roboto, -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
$h1-font-size: $font-size-base * 5;
$h2-font-size: $font-size-base * 3;
$h3-font-size: $font-size-base * 2;
$headings-font-weight: 900;
$list-group-item-padding-y: 1.5rem;
$list-group-item-padding-x: 1.5rem;
$list-group-border-color: rgba($black, .08);
$link-hover-decoration: none;

56
src/global-styles/custom.scss

@ -0,0 +1,56 @@
// Overrides
.btn, button {
outline: 0 !important;
border: none !important;
text-transform: uppercase;
box-shadow: none !important;
}
.card {
background: #ffffff;
box-shadow: 0px 10px 30px rgba(209, 213, 223, 0.5);
border-radius: 1rem;
&:hover {
box-shadow: 0px 10px 40px rgba(209, 213, 223, 0.6);
}
border: none !important;
outline: 0 !important;
}
.card-input {
position: relative;
background: #ffffff;
box-shadow: 0px 10px 30px rgba(209, 213, 223, 0.5);
border-radius: 1rem;
height: calc(2.25em + 1.125rem + 2px);
padding: 0.5rem 1.5rem;
outline: 0 !important;
border: none !important;
&:hover,
&:focus,
&:active {
box-shadow: 0px 10px 40px rgba(209, 213, 223, 0.6);
}
}
.card-input-group {
.card-input {
padding-right: 3rem;
}
.input-group-append > .btn {
background: none !important;
color: #616877;
border: none !important;
outline: none !important;
box-shadow: none !important;
position: absolute;
top: 50%;
transform: translateY(-50%);
right: 0.5rem;
}
}
.card-list {
max-height: 15rem;
overflow-y: scroll;
}

10
src/global-styles/design-system.scss

@ -0,0 +1,10 @@
$font-size-base: 1rem;
* {
transition: 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}
@import './variables';
@import 'node_modules/bootstrap/scss/bootstrap';
@import 'node_modules/bootstrap-vue/src/index.scss';
@import './custom.scss';

22
src/main.js

@ -0,0 +1,22 @@
import Vue from "vue";
import App from "./App.vue";
import router from "./router";
import store from "./store";
import { BootstrapVue, BootstrapVueIcons } from 'bootstrap-vue';
// import "@/global-styles/designsystem.scss";
// import 'bootstrap/dist/css/bootstrap.css'
// import 'bootstrap-vue/dist/bootstrap-vue.css'
Vue.use(BootstrapVue)
Vue.use(BootstrapVueIcons)
Vue.config.productionTip = false;
new Vue({
router,
store,
render: h => h(App)
}).$mount("#app");

21
src/router/index.js

@ -0,0 +1,21 @@
import Vue from "vue";
import VueRouter from "vue-router";
import Home from "../views/Home.vue";
Vue.use(VueRouter);
const routes = [
{
path: "/",
name: "home",
component: Home
}
];
const router = new VueRouter({
mode: "history",
base: process.env.BASE_URL,
routes
});
export default router;

54
src/store/index.js

@ -0,0 +1,54 @@
import Vue from "vue";
import Vuex from "vuex";
Vue.use(Vuex);
// Initial State
const state = {
onboardingStep: 0,
selectedWifi: ""
};
// Getters
const getters = {
onboardingStep(state) {
return state.onboardingStep
},
selectWifi(state) {
return state.selectWifi;
}
}
// Mutations
const mutations = {
nextStep(state) {
state.onboardingStep++
},
prevStep(state) {
state.onboardingStep--
},
selectWifi(state, networkName) {
state.selectedWifi = networkName;
}
}
// Actions
const actions = {
nextStep(context) {
context.commit('nextStep');
},
prevStep(context) {
context.commit('prevStep');
},
selectWifi(context, networkName) {
context.commit('selectWifi', networkName);
}
}
export default new Vuex.Store({
state,
mutations,
actions,
getters,
modules: {}
});

276
src/views/Home.vue

@ -0,0 +1,276 @@
<template>
<div>
<div class="d-flex flex-column align-items-center justify-content-center min-vh-100 p-2">
<img src="@/assets/logo.svg" class="mb-2" />
<h1 class="text-center mb-2">{{ steps[onboardingStep]["heading"] }}</h1>
<p class="text-muted w-75 text-center">{{ steps[onboardingStep]["text"] }}</p>
<div class="form-container mt-3 d-flex flex-column form-container w-100 align-items-center">
<b-form-input
v-model="name"
ref="name"
placeholder="Enter your name"
v-if="onboardingStep === 1"
class="card-input w-100"
autofocus
></b-form-input>
<input-password
v-model="password"
ref="password"
v-if="onboardingStep === 2"
placeholder="Enter your password"
inputClass="card-input w-100"
/>
<input-password
v-model="confirmPassword"
ref="confirmPassword"
placeholder="Re-enter your password"
v-if="onboardingStep === 3"
inputClass="card-input w-100"
/>
<b-list-group class="card card-list w-100" v-if="onboardingStep === 4">
<b-list-group-item
class="d-flex"
button
v-for="(network) in wifiNetworks"
v-bind:key="network.name"
@click="selectWifi(network)"
>
<img :src="wifiIcons[network.strength]" class="mr-3" />
{{ network.name }}
</b-list-group-item>
</b-list-group>
<input-password
v-model="wifiPassword"
ref="wifiPassword"
:placeholder="'Enter WiFi password for ' + selectedWifi"
v-if="onboardingStep === 5"
inputClass="card-input w-100"
/>
<b-button
variant="success"
size="lg"
@click="nextStep"
v-if="onboardingStep !== 4 && onboardingStep !== 6"
:disabled="!isStepValid"
class="mt-3 px-4"
>{{ onboardingStep === 0 ? 'Start' : 'Next' }}</b-button>
<b-button
variant="success"
size="lg"
@click="finish"
v-if="onboardingStep === 6"
class="mt-3 px-4"
>Continue to Dashboard</b-button>
<b-button
variant="link"
size="sm"
@click="prevStep"
v-if="onboardingStep > 1 && onboardingStep !== 6"
class="mt-2"
>Back</b-button>
</div>
</div>
<b-progress :value="progress" height="1rem" class="onboarding-progress"></b-progress>
<p v-if="errorMessage">{{ errorMessage }}</p>
</div>
</template>
<script>
import Vue from "vue";
import VueConfetti from "vue-confetti";
import InputPassword from "@/components/InputPassword";
Vue.use(VueConfetti);
const onboardingSteps = [
{
heading: "welcome to umbrel",
text: "Your journey to become a first-class Bitcoin citizen starts now"
},
{
heading: "let's start with your name",
text:
"Your name stays on your Umbrel Node and is never shared with a 3rd party."
},
{
heading: "set your password",
text:
"You'll need this password to securely access your Umbrel Node from anywhere."
},
{
heading: "confirm your password",
text:
"You'll need this password to securely access your Umbrel Node from anywhere."
},
{
heading: "connect umbrel to wifi",
text: ""
},
{
heading: "enter wifi password",
text: ""
},
{
heading: "that's it!",
text:
"Congratulations! Your Umbrel Node is now running and synchronizing the Bitcoin blockchain."
}
];
const wifiIcons = [
require("@/assets/icon-wifi-1.svg"),
require("@/assets/icon-wifi-2.svg"),
require("@/assets/icon-wifi-3.svg")
];
export default {
data() {
return {
name: "",
password: "",
confirmPassword: "",
wifiPassword: "",
errorMessage: "",
selectedWifi: "",
steps: onboardingSteps,
wifiNetworks: [
{
name: "Interwebs@2.4Ghz",
strength: 1
},
{
name: "Interwebs@5Ghz",
strength: 0
},
{
name: "My Personal WiFi",
strength: 2
},
{
name: "Random Access Network",
strength: 1
},
{
name: "Interwebs 2020",
strength: 2
},
{
name: "Sneaky Neighbour 4309",
strength: 0
},
{
name: "Zoya Home NEW",
strength: 1
}
],
wifiIcons
};
},
computed: {
onboardingStep() {
return this.$store.getters.onboardingStep;
},
isStepValid() {
const { onboardingStep } = this.$store.getters;
if (onboardingStep === 1) {
if (!/^[A-Za-z ]+$/.test(this.name)) {
return false;
}
if (this.name.length < 3) {
return false;
}
}
if (onboardingStep === 2) {
if (this.password.length < 6) {
return false;
}
}
if (onboardingStep === 3) {
if (this.confirmPassword !== this.password) {
return false;
}
}
if (onboardingStep === 4) {
if (this.selectedWifi === "") {
return false;
}
}
if (onboardingStep === 5) {
return !!this.wifiPassword;
}
return true;
},
progress() {
const { onboardingStep } = this.$store.getters;
const totalSteps = onboardingSteps.length;
return onboardingStep === 0
? 0
: Math.round((onboardingStep * 100) / (totalSteps - 1));
}
},
methods: {
nextStep() {
if (this.$store.getters.onboardingStep === 5) {
this.$confetti.start({
particles: [
{
type: "rect"
}
]
});
window.setTimeout(() => {
this.$confetti.stop();
}, 3000);
}
return this.$store.dispatch("nextStep");
},
prevStep() {
return this.$store.dispatch("prevStep");
},
finish() {
return alert("You've reached the end of onboarding.");
},
selectWifi({ name }) {
this.selectedWifi = name;
this.$store.dispatch("selectWifi", name);
return this.$store.dispatch("nextStep");
}
},
components: {
InputPassword
}
};
</script>
<style lang="scss" scoped>
.form-container {
max-width: 500px;
}
.onboarding-progress {
position: absolute;
width: 100%;
top: 0;
left: 0;
border-radius: 0;
background: transparent;
}
</style>

11
vue.config.js

@ -0,0 +1,11 @@
module.exports = {
// css: {
// loaderOptions: {
// sass: {
// prependData: `
// @import "@/global-styles/designs-ystem.scss";
// `
// }
// }
// }
}

8330
yarn.lock

File diff suppressed because it is too large
Loading…
Cancel
Save