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 #34 from imRohan/develop
[Release] 1.2.0 - SEO + Status Page
- Loading branch information
Showing
24 changed files
with
335 additions
and
68 deletions.
There are no files selected for viewing
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
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,18 @@ | ||
.banner { | ||
&__container { | ||
background: $green; | ||
padding: 1em; | ||
max-width: 100%; | ||
color: $white; | ||
margin-bottom: 1em; | ||
} | ||
&--red { | ||
background: $red, | ||
} | ||
|
||
&--transparent { | ||
background: none; | ||
color: $secondary-color; | ||
border: 1px solid $secondary-color; | ||
} | ||
} |
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 |
---|---|---|
|
@@ -6,3 +6,4 @@ | |
@import 'topbar'; | ||
@import 'bottomBar'; | ||
@import 'basket'; | ||
@import 'banner' |
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,41 +1,51 @@ | ||
<div class="landing__right"> | ||
<template v-if="view === 'home'"> | ||
<h1> | ||
Unburden yourself from data storage woes. | ||
<template v-if="!showNameField"> | ||
Unburden yourself from data storage woes. | ||
</template> | ||
<template v-else> | ||
Almost there, just one more step! | ||
</template> | ||
</h1> | ||
<p> | ||
Focus your efforts on building your next project and leave | ||
the data storage to us. With free NoSQL cloud storage for you and | ||
your users, Pantry speeds up development time letting you | ||
build awesome things - fast! | ||
<template v-if="!showNameField"> | ||
Focus your efforts on building your next project and leave the | ||
data storage to us. We'll help speed up your development time | ||
letting you build awesome things fast! Try out our API, and start | ||
securely storing data on the cloud for free! | ||
</template> | ||
<template v-else> | ||
Let's give your pantry a name! This could be the name of your project | ||
or anything that means something to you. Please keep in mind that | ||
inactive pantries and their baskets will be deleted automatically. | ||
</template> | ||
</p> | ||
<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 v-if="!showNameField"> | ||
<div class="input__container"> | ||
<input v-model="signup.email" placeholder="[email protected]"> | ||
<button @click="enterPantryName" :disabled="!signupValid()"> | ||
Create a Pantry | ||
</button> | ||
</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> | ||
<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> | ||
<div class="input__container"> | ||
<input v-model="signup.accountName" placeholder=""> | ||
<button @click="createNewPantry" :disabled="!signupNameValid()"> | ||
Name your Pantry | ||
</button> | ||
</div> | ||
</transition> | ||
<p class="text--light"> | ||
Give your Pantry a creative name | ||
</p> | ||
</div> | ||
</template> | ||
|
||
<template v-if="view === 'created'"> | ||
|
@@ -87,6 +97,27 @@ <h2>Contribute</h2> | |
</a> | ||
</template> | ||
|
||
<template v-if="view === 'status'"> | ||
<h1> | ||
System Status | ||
</h1> | ||
<div :class="isStatusPositive ? 'banner--green' : 'banner--red'" | ||
class="banner__container"> | ||
{{ getStatusString() }} | ||
</div> | ||
|
||
<template v-for="(status, entity) in systemStatus"> | ||
<div class="banner__container banner--transparent"> | ||
<span class="text--bold"> | ||
{{ entity | capitalizeKey }} | ||
</span> | ||
<span :class="status ? 'text--green' : 'text--red'" class="text--right"> | ||
{{ status ? 'Operational' : 'Down' }} | ||
</span> | ||
</div> | ||
</template> | ||
</template> | ||
|
||
<template v-if="view === 'dashboard'"> | ||
<template v-if="pantry.data"> | ||
<h1> | ||
|
@@ -97,23 +128,24 @@ <h2> | |
{{pantry.data.baskets.length}} | ||
{{pantry.data.baskets.length > 1 ? 'Baskets' : 'Basket' }} | ||
in this Pantry | ||
- {{pantry.data.percentFull}}% Full | ||
</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> | ||
<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> | ||
|
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,39 @@ | ||
// Extarnal Libs | ||
|
||
// External Files | ||
import dataStore = require('../services/dataStore') | ||
import logService = require('../services/logger') | ||
|
||
// Interfaces | ||
import { ISystemStatus } from '../interfaces/system' | ||
|
||
// Logger setup | ||
const logger = new logService('System Controller') | ||
|
||
class SystemController { | ||
public static async getStatus(): Promise<ISystemStatus> { | ||
try { | ||
const _dataStoreStatus = await dataStore.ping() | ||
|
||
const _status = { | ||
website: true, | ||
api: true, | ||
dataStore: _dataStoreStatus, | ||
} | ||
|
||
logger.info('System status retrieved') | ||
return _status | ||
} catch (error) { | ||
logger.error(`System status retrieval failed: ${error.message}`) | ||
|
||
const _errorStatus = { | ||
website: true, | ||
api: true, | ||
dataStore: false, | ||
} | ||
return _errorStatus | ||
} | ||
} | ||
} | ||
|
||
export = SystemController |
Oops, something went wrong.