generated from imRohan/Typescript-Express-Vuejs-Boilerplate
-
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #17 from imRohan/develop
Adds lightweight dashboard
- Loading branch information
Showing
12 changed files
with
209 additions
and
67 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
.basket { | ||
&__container { | ||
} | ||
&__payload { | ||
&-container { | ||
padding: 1em; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,3 +5,4 @@ | |
@import 'images'; | ||
@import 'topbar'; | ||
@import 'bottomBar'; | ||
@import 'basket'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,23 +9,35 @@ <h1> | |
your users, Pantry speeds up development time letting you | ||
build awesome things - fast! | ||
</p> | ||
<div class="input__container"> | ||
<input v-model="signupEmail" placeholder="[email protected]"> | ||
<button @click="createNewPantry" :disabled="!signupValid()"> | ||
Get a Pantry | ||
</button> | ||
</div> | ||
<template v-if="signupEmail && !signupValid()"> | ||
<p class="text--light"> | ||
Sorry, but that email is invalid. | ||
</p> | ||
</template> | ||
<template v-else> | ||
<p class="text--light"> | ||
Don't worry, we'll only contact you if its important. | ||
</p> | ||
</template> | ||
<transition name="slide-fade" mode="out-in"> | ||
<div v-if="!showNameField" key="enterEmail"> | ||
<div class="input__container"> | ||
<input v-model="signup.email" placeholder="[email protected]"> | ||
<button @click="enterPantryName" :disabled="!signupValid()"> | ||
Create a Pantry | ||
</button> | ||
</div> | ||
<p v-if="signup.email && !signupValid()" class="text--light"> | ||
Sorry, but that email is invalid. | ||
</p> | ||
<p v-else class="text--light"> | ||
Don't worry, we'll only contact you if its important. | ||
</p> | ||
</div> | ||
<div v-else key="enterPantryName"> | ||
<div class="input__container"> | ||
<input v-model="signup.accountName" placeholder=""> | ||
<button @click="createNewPantry" :disabled="!signupNameValid()"> | ||
Name your Pantry | ||
</button> | ||
</div> | ||
<p class="text--light"> | ||
Give your Pantry a creative name | ||
</p> | ||
</div> | ||
</transition> | ||
</template> | ||
|
||
<template v-if="view === 'created'"> | ||
<h1> | ||
Your Pantry's Ready! | ||
|
@@ -36,7 +48,7 @@ <h2>Save your PantryID</h2> | |
Once you've saved it somewhere, hit the button below and we'll show you how to add items to your pantry. | ||
</p> | ||
<p class="text__container text--key"> | ||
{{ pantryId }} | ||
{{ pantry.id }} | ||
<span class="text__button" @click="copyPantryId"> | ||
{{ copyPantryIdMessage }} | ||
</span> | ||
|
@@ -45,36 +57,7 @@ <h2>Save your PantryID</h2> | |
Let's Get Started! | ||
</button> | ||
</template> | ||
<template v-if="view === 'getStarted'"> | ||
<h1> | ||
How to use your Pantry. | ||
</h1> | ||
<h2>Add & Update Basket</h2> | ||
<p> | ||
To add or update a basket in your pantry, send a <b>POST</b> request | ||
to our API with the <b>name</b> of your basket in the path, and the | ||
contents as the <b>payload</b> of the request. Your | ||
<b>pantryID</b> has already been added to the api path. | ||
</p> | ||
<p class="text__container text--code"> | ||
curl -XPOST -H "Content-type: application/json" -d '{ | ||
"key": "value" | ||
}' '{{apiPath}}/pantry/{{pantryId}}/basket/myNewBasket' | ||
</p> | ||
<h2>Get the contents of a Basket</h2> | ||
<p> | ||
To retrieve an basket, send a <b>GET</b> request to our API with the | ||
<b>name</b> of the basket in the url.Your <b>pantryID</b> has already | ||
been added to the api path. | ||
</p> | ||
<p class="text__container text--code"> | ||
curl -XGET -H "Content-type: application/json" | ||
'{{apiPath}}/pantry/{{pantryId}}/basket/myNewBasket' | ||
</p> | ||
<button @click="showDocs"> | ||
Show Me The API Docs! | ||
</button> | ||
</template> | ||
|
||
<template v-if="view === 'about'"> | ||
<h1> | ||
About | ||
|
@@ -103,6 +86,7 @@ <h2>Contribute</h2> | |
border-radius: 5px;" > | ||
</a> | ||
</template> | ||
|
||
<template v-if="view === 'docs'"> | ||
<h1> | ||
Api Documentation | ||
|
@@ -169,4 +153,64 @@ <h2>Get the contents of a Basket</h2> | |
Go Back | ||
</button> | ||
</template> | ||
|
||
<template v-if="view === 'dashboard'"> | ||
<template v-if="pantry.data"> | ||
<h1> | ||
{{ pantry.data.name }} | ||
</h1> | ||
<template v-if="pantry.data.baskets && pantry.data.baskets.length !== 0"> | ||
<h2> | ||
{{pantry.data.baskets.length}} | ||
{{pantry.data.baskets.length > 1 ? 'Baskets' : 'Basket' }} | ||
in this Pantry | ||
</h2> | ||
<div class="basket__container"> | ||
<ul> | ||
<template v-for="basketName in pantry.data.baskets"> | ||
<li class="text__container"> | ||
{{ basketName }} | ||
<span class="text__button" @click="toggleBasket(basketName)"> | ||
{{ activeBasket === basketName ? 'hide' : 'show' }} | ||
</span> | ||
<template v-if="activeBasket === basketName"> | ||
<div class="basket__payload-container"> | ||
<json-view | ||
:deep="1" | ||
:showLength="true" | ||
:data="basket"/> | ||
</div> | ||
</template> | ||
</li> | ||
</template> | ||
</ul> | ||
</div> | ||
</template> | ||
<template v-else> | ||
<p> | ||
Looks like your pantry is empty and currently has no baskets. | ||
</p> | ||
<p> | ||
To add a basket to your pantry, simply send a <b>POST</b> request | ||
to our API with the <b>name</b> and the <b>payload</b> of the basket | ||
</p> | ||
<p class="text__container text--code"> | ||
curl -XPOST -H "Content-type: application/json" -d '{ | ||
"key": "value" | ||
}' '{{apiPath}}/pantry/{{this.pantry.id}}/basket/testBasket' | ||
</p> | ||
<button @click="showDocs"> | ||
Show Me The API Docs! | ||
</button> | ||
</template> | ||
</template> | ||
<template v-else> | ||
<h1>Uhoh, looks like something broke.</h1> | ||
<button | ||
@click="goHome" | ||
class="button--alt"> | ||
Go Back | ||
</button> | ||
</template> | ||
</template> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
export enum IView { | ||
home = 'home', | ||
created = 'created', | ||
getStarted = 'getStarted', | ||
docs = 'docs', | ||
about = 'about', | ||
dashboard = 'dashboard', | ||
} |
Oops, something went wrong.