Adapted to vuetify 0.14.6

Added message to know if development or not
This commit is contained in:
Kylart 2017-07-26 00:53:10 +02:00
parent f1b697ca09
commit 81f6d20d78
14 changed files with 99 additions and 61 deletions

View File

@ -82,6 +82,8 @@
</transition>
</main>
<env v-if="$store.getters.env"></env>
<!-- Displayed if an error occurred -->
<v-snackbar
:timeout="5000"
@ -249,16 +251,6 @@
font-family: "Hiragino Mincho Pro", serif;
font-size: 30px !important;
}
.open-in-browser
{
margin-top: 6px !important;
}
.modal-container .title
{
line-height: 25px;
}
</style>
<style lang="stylus">

View File

@ -62,6 +62,10 @@ $theme := {
/**
Custom rules which will be applied globally, allows overriding
*/
.application--toolbar.application--footer > main > .container
margin-top 24px
min-height calc(100vh - (48px + 24px))
.toolbar__content
max-height 48px
@ -76,4 +80,4 @@ div.dialog--fullscreen
div.tabs__items
border-width 0
border-style none
border-style none

View File

@ -1,3 +1,4 @@
import Env from './env.vue'
import ChoiceWindow from './choiceWindow.vue'
import HistoryModal from './historyModal.vue'
import InfoModal from './infoModal.vue'
@ -5,6 +6,7 @@ import Loader from './loader.vue'
import Settings from './settings.vue'
export default {
Env,
ChoiceWindow,
HistoryModal,
InfoModal,

View File

@ -11,14 +11,14 @@
<v-checkbox v-model="selected"
:value="options[i - 1].value"
:label="options[i - 1].label"
class="option">
class="option primary--text">
</v-checkbox>
</v-flex>
<v-flex v-else xs6 class="checkbox-container">
<v-checkbox v-model="selected"
:value="options[i - 1].value"
:label="options[i - 1].label"
class="option">
class="option primary--text">
</v-checkbox>
</v-flex>
</template>

27
components/env.vue Normal file
View File

@ -0,0 +1,27 @@
<template>
<div id="container">
<span class="text white--text">Development mode</span>
</div>
</template>
<style scoped>
#container
{
height: 24px;
width: 100%;
position: fixed;
top: 0;
z-index: 100;
display: flex;
justify-content: center;
align-items: center;
}
.text
{
font-size: 12px;
font-style: italic;
font-weight: 300;
letter-spacing: 1px;
}
</style>

View File

@ -45,7 +45,7 @@
class="ripple"
ripple
:to="subItem.href"
key="subItem.title">
:key="subItem.title">
<v-list-tile-action>
<v-icon>{{ subItem.action }}</v-icon>
</v-list-tile-action>

View File

@ -1,5 +1,5 @@
<template xmlns:v-tooltip="http://www.w3.org/1999/xhtml" xmlns:v-bind="http://www.w3.org/1999/xhtml">
<v-container fluid class="container pa-0" style="min-height: 92vh">
<v-container fluid class="container pa-0">
<transition name="fade" v-if="releases.length">
<v-layout row wrap style="margin: 0 1% 0 1%;">
<v-flex md4 sm4 xs12 class="time-container">
@ -246,30 +246,26 @@
margin-bottom: 0;
}
.select
div.input-group
{
margin: 10px 0 5px 0;
padding-bottom: 5px !important;
padding-top: 8px !important;
}
/* ----- Refresh button ----- */
.refresh-button-container
{
display: inline-block;
margin-top: 5px;
margin-bottom: 2px;
text-align: center;
padding: 0;
align-self: center;
}
.refresh-button
{
display: inline-block;
}
.time-container
{
align-self: center;
height: 70px;
display: flex;
align-items: center;
}
.update-time

View File

@ -46,7 +46,7 @@
<v-layout row wrap class="elem-container">
<v-flex xs7
v-tooltip:top="{ html: item.name }">
<h6 class="title ellipsis">{{ item.name }}</h6>
<h6 class="elem-title ellipsis white--text">{{ item.name }}</h6>
</v-flex>
<v-flex xs2
v-tooltip:top="{ html: 'Episode ' + item.ep }"
@ -153,8 +153,8 @@
</v-layout>
</v-flex>
<v-flex xs12 class="empty-message">
<h3>Wow such empty!</h3>
<h4>Start downloading anime
<h3 class="white--text">Wow such empty!</h3>
<h4 class="white--text">Start downloading anime
<nuxt-link to="/downloader" class="green--text">here</nuxt-link>
or
<nuxt-link to="/" class="cyan--text">here!</nuxt-link>
@ -283,7 +283,6 @@
h6
{
color: rgba(255, 255, 255, 0.8);
margin-top: 0.7rem;
margin-bottom: 0;
}
@ -303,7 +302,7 @@
.page-container
{
min-height: 92vh !important;
padding-top: 0;
padding-left: 0;
padding-right: 0;
}
@ -316,7 +315,6 @@
.menu-eps-text
{
color: rgba(255, 255, 255, 0.8);
font-size: 16px;
font-weight: 800;
margin-top: 12px;
@ -343,7 +341,6 @@
/* -------------- ELEMS -------------- */
.elem
{
color: rgba(255, 255, 255, 0.8);
margin-bottom: 10px;
display: inline-block;
}
@ -370,7 +367,7 @@
padding-top: 5px;
}
.title
.elem-title
{
padding-left: 10px;
line-height: 30px;
@ -474,11 +471,6 @@
text-align: center;
}
.empty-message h3, h4
{
color: rgba(255, 255, 255, 0.8);
}
.empty-bg
{
position: absolute;

View File

@ -81,7 +81,6 @@
}
/* Needed */
/*noinspection CssUnusedSymbol*/
.icon--large
{
height: 2.5rem;

View File

@ -244,6 +244,12 @@
margin: 0;
}
div.input-group
{
padding-bottom: 5px !important;
margin-top: 8px !important;
}
.text
{
text-align: justify;
@ -252,6 +258,13 @@
font-size: 16px;
}
.refresh-button
{
display: flex;
align-items: center;
}
.query
{
margin: 30px 0 0;

View File

@ -16,7 +16,7 @@
<v-card-text>
<v-layout row wrap class="list-container">
<v-flex xs12>
<v-layout row wrap justify-center class="top-form">
<v-layout row wrap align-center justify-center class="top-form">
<v-flex md3 sm4 xs9>
<v-btn icon flat
@click="selectAll(i)"
@ -76,11 +76,11 @@
:class="item.split(' ').join('-')">
<v-card class="elem-content elevation-3" v-ripple="true">
<v-layout row wrap>
<v-flex xs1 class="box" @click.capture="select(item, i)">
<v-flex xs2 class="box" @click.capture="select(item, i)">
<v-checkbox label="" accent v-model="selected[i]" disabled :value="item" dark/>
</v-flex>
<v-flex xs9 v-tooltip:top="{ html: item }" @click.capture="select(item, i)">
<h6 class="ellipsis elem-title">{{ item }}</h6>
<v-flex xs8 v-tooltip:top="{ html: item }" @click.capture="select(item, i)">
<h6 class="ellipsis elem-title white--text">{{ item }}</h6>
</v-flex>
<v-flex xs2>
<v-menu bottom right>
@ -314,7 +314,6 @@
h6
{
margin: 0;
color: rgba(255, 255, 255, 0.8);
}
span
@ -322,6 +321,11 @@
width: 100%;
}
.card__text
{
padding-top: 0;
}
.ellipsis
{
overflow: hidden;
@ -362,15 +366,14 @@
0 3px 14px 2px rgba(0, 0, 0, 0.12) !important;
}
/*noinspection CssUnusedSymbol*/
.input-group
.elem .input-group
{
margin: 0;
padding: 0;
}
.top-form
{
margin-bottom: 10px;
padding-left: 15px;
}
@ -382,6 +385,8 @@
.add-button-container
{
padding-right: 2%;
display: flex;
align-items: center;
}
.box
@ -398,7 +403,6 @@
padding-left: 10px;
}
/*noinspection CssUnusedSymbol*/
.selected
{
background-color: #2E7D32;

View File

@ -213,9 +213,12 @@ const routes = {
res.status(200).send()
})
},
'_getPlatform': (app) => {
app.get('/_platform', (req, res) => {
res.status(200).send(process.platform)
'_getEnv': (app) => {
app.get('/_env', (req, res) => {
res.status(200).send({
platform: process.platform,
NODE_ENV: process.env.NODE_ENV
})
})
}
}

View File

@ -12,6 +12,7 @@ const log = (message) => {
export function createStore () {
return new Vuex.Store({
state: {
NODE_ENV: '',
platform: '',
drawer: false,
autoRefreshReleases: true,
@ -75,7 +76,7 @@ export function createStore () {
commit('init', data.config)
} catch (e) { void e }
dispatch('getPlatform').catch(err => { void err })
dispatch('getEnv').catch(err => { void err })
dispatch('releasesInit').catch(err => { void (err) })
dispatch('seasonsInit').catch(err => { void (err) })
dispatch('newsInit').catch(err => { void (err) })
@ -83,10 +84,10 @@ export function createStore () {
dispatch('listInit').catch(err => { void (err) })
dispatch('getHistory').catch(err => { void (err) })
},
async getPlatform ({commit}) {
const {data} = await axios.get('_platform')
async getEnv ({commit}) {
const {data} = await axios.get('_env')
commit('setPlatform', data)
commit('setEnv', data)
},
async releasesInit ({state, commit, dispatch}) {
// TODO refactor this since it is a bit hard coded
@ -465,8 +466,9 @@ export function createStore () {
},
mutations: {
setPlatform (state, data) {
state.platform = data
setEnv (state, data) {
state.platform = data.platform
state.NODE_ENV = data.NODE_ENV
},
init (state, data) {
const config = data
@ -623,6 +625,10 @@ export function createStore () {
}
},
getters: {}
getters: {
env (state) {
return state.NODE_ENV
}
}
})
}

View File

@ -410,11 +410,11 @@ test('/getInfoFromMal route exits and return an object with name', async t => {
t.is(data.title, 'Sakura Trick')
})
test('/_platform route exits and return string containing platform\'s name', async t => {
const { data, status } = await axios.get(`${uri}/_platform`)
test('/_env route exits and return string containing platform\'s name', async t => {
const { data, status } = await axios.get(`${uri}/_env`)
t.is(status, 200)
t.is(typeof data, 'string')
t.is(typeof data.platform, 'string')
})
// Close server