1
1
mirror of https://github.com/kokonect-link/cherrypick synced 2024-11-30 07:48:57 +09:00
This commit is contained in:
syuilo 2018-10-19 11:10:49 +09:00
parent f028800a96
commit f14c372f5e
No known key found for this signature in database
GPG Key ID: BDC4C49D06AB9D69
7 changed files with 55 additions and 20 deletions

View File

@ -836,6 +836,7 @@ desktop/views/components/settings.vue:
api-via-stream-desc: "この設定をオンにすると、websocket接続を経由してAPIリクエストが行われます(パフォーマンス向上が期待できます)。オフにすると、ネイティブの fetch APIが利用されます。この設定はこのデバイスのみ有効です。" api-via-stream-desc: "この設定をオンにすると、websocket接続を経由してAPIリクエストが行われます(パフォーマンス向上が期待できます)。オフにすると、ネイティブの fetch APIが利用されます。この設定はこのデバイスのみ有効です。"
deck-nav: "デッキ内ナビゲーション" deck-nav: "デッキ内ナビゲーション"
deck-nav-desc: "デッキを使用しているとき、ナビゲーションが発生する際にページ遷移を行わずに一時的なカラムで受けるようにします。" deck-nav-desc: "デッキを使用しているとき、ナビゲーションが発生する際にページ遷移を行わずに一時的なカラムで受けるようにします。"
deck-default: "デッキをデフォルトのUIにする"
display: "デザインと表示" display: "デザインと表示"
customize: "ホームをカスタマイズ" customize: "ホームをカスタマイズ"

View File

@ -21,6 +21,7 @@ import updateAvatar from './api/update-avatar';
import updateBanner from './api/update-banner'; import updateBanner from './api/update-banner';
import MkIndex from './views/pages/index.vue'; import MkIndex from './views/pages/index.vue';
import MkHome from './views/pages/home.vue';
import MkDeck from './views/pages/deck/deck.vue'; import MkDeck from './views/pages/deck/deck.vue';
import MkAdmin from './views/pages/admin/admin.vue'; import MkAdmin from './views/pages/admin/admin.vue';
import MkStats from './views/pages/stats/stats.vue'; import MkStats from './views/pages/stats/stats.vue';
@ -54,6 +55,7 @@ init(async (launch) => {
mode: 'history', mode: 'history',
routes: [ routes: [
{ path: '/', name: 'index', component: MkIndex }, { path: '/', name: 'index', component: MkIndex },
{ path: '/home', name: 'home', component: MkHome },
{ path: '/deck', name: 'deck', component: MkDeck }, { path: '/deck', name: 'deck', component: MkDeck },
{ path: '/admin', name: 'admin', component: MkAdmin }, { path: '/admin', name: 'admin', component: MkAdmin },
{ path: '/stats', name: 'stats', component: MkStats }, { path: '/stats', name: 'stats', component: MkStats },

View File

@ -97,6 +97,9 @@
<ui-radio v-model="navbar" value="left">%i18n:@navbar-position-left%</ui-radio> <ui-radio v-model="navbar" value="left">%i18n:@navbar-position-left%</ui-radio>
<ui-radio v-model="navbar" value="right">%i18n:@navbar-position-right%</ui-radio> <ui-radio v-model="navbar" value="right">%i18n:@navbar-position-right%</ui-radio>
</section> </section>
<section>
<ui-switch v-model="deckDefault">%i18n:@deck-default%</ui-switch>
</section>
<section> <section>
<ui-switch v-model="darkmode">%i18n:@dark-mode%</ui-switch> <ui-switch v-model="darkmode">%i18n:@dark-mode%</ui-switch>
<ui-switch v-model="useShadow">%i18n:@use-shadow%</ui-switch> <ui-switch v-model="useShadow">%i18n:@use-shadow%</ui-switch>
@ -366,6 +369,11 @@ export default Vue.extend({
set(value) { this.$store.commit('device/set', { key: 'deckColumnAlign', value }); } set(value) { this.$store.commit('device/set', { key: 'deckColumnAlign', value }); }
}, },
deckDefault: {
get() { return this.$store.state.device.deckDefault; },
set(value) { this.$store.commit('device/set', { key: 'deckDefault', value }); }
},
enableSounds: { enableSounds: {
get() { return this.$store.state.device.enableSounds; }, get() { return this.$store.state.device.enableSounds; },
set(value) { this.$store.commit('device/set', { key: 'enableSounds', value }); } set(value) { this.$store.commit('device/set', { key: 'enableSounds', value }); }

View File

@ -2,18 +2,22 @@
<div class="nav"> <div class="nav">
<ul> <ul>
<template v-if="$store.getters.isSignedIn"> <template v-if="$store.getters.isSignedIn">
<li class="home" :class="{ active: $route.name == 'index' }" @click="goToTop"> <template v-if="$store.state.device.deckDefault">
<router-link to="/"> <li class="deck" :class="{ active: $route.name == 'deck' || $route.name == 'index' }" @click="goToTop">
%fa:home% <router-link to="/">%fa:columns%<p>%i18n:@deck%</p></router-link>
<p>%i18n:@home%</p> </li>
</router-link> <li class="home" :class="{ active: $route.name == 'home' }" @click="goToTop">
</li> <router-link to="/home">%fa:home%<p>%i18n:@home%</p></router-link>
<li class="deck" :class="{ active: $route.name == 'deck' }" @click="goToTop"> </li>
<router-link to="/deck"> </template>
%fa:columns% <template v-else>
<p>%i18n:@deck%</p> <li class="home" :class="{ active: $route.name == 'home' || $route.name == 'index' }" @click="goToTop">
</router-link> <router-link to="/">%fa:home%<p>%i18n:@home%</p></router-link>
</li> </li>
<li class="deck" :class="{ active: $route.name == 'deck' }" @click="goToTop">
<router-link to="/deck">%fa:columns%<p>%i18n:@deck%</p></router-link>
</li>
</template>
<li class="messaging"> <li class="messaging">
<a @click="messaging"> <a @click="messaging">
%fa:comments% %fa:comments%

View File

@ -6,12 +6,22 @@
</div> </div>
<div class="nav" v-if="$store.getters.isSignedIn"> <div class="nav" v-if="$store.getters.isSignedIn">
<div class="home" :class="{ active: $route.name == 'index' }" @click="goToTop"> <template v-if="$store.state.device.deckDefault">
<router-link to="/">%fa:home%</router-link> <div class="deck" :class="{ active: $route.name == 'deck' || $route.name == 'index' }" @click="goToTop">
</div> <router-link to="/">%fa:columns%</router-link>
<div class="deck" :class="{ active: $route.name == 'deck' }" @click="goToTop"> </div>
<router-link to="/deck">%fa:columns%</router-link> <div class="home" :class="{ active: $route.name == 'home' }" @click="goToTop">
</div> <router-link to="/home">%fa:home%</router-link>
</div>
</template>
<template v-else>
<div class="home" :class="{ active: $route.name == 'home' || $route.name == 'index' }" @click="goToTop">
<router-link to="/">%fa:home%</router-link>
</div>
<div class="deck" :class="{ active: $route.name == 'deck' }" @click="goToTop">
<router-link to="/deck">%fa:columns%</router-link>
</div>
</template>
<div class="messaging"> <div class="messaging">
<a @click="messaging">%fa:comments%<template v-if="hasUnreadMessagingMessage">%fa:circle%</template></a> <a @click="messaging">%fa:comments%<template v-if="hasUnreadMessagingMessage">%fa:circle%</template></a>
</div> </div>

View File

@ -1,16 +1,25 @@
<template> <template>
<component :is="$store.getters.isSignedIn ? 'home' : 'welcome'"></component> <component :is="page"></component>
</template> </template>
<script lang="ts"> <script lang="ts">
import Vue from 'vue'; import Vue from 'vue';
import Home from './home.vue'; import Home from './home.vue';
import Welcome from './welcome.vue'; import Welcome from './welcome.vue';
import Deck from './deck/deck.vue';
export default Vue.extend({ export default Vue.extend({
components: { components: {
Home, Home,
Deck,
Welcome Welcome
},
computed: {
page(): string {
if (!this.$store.getters.isSignedIn) return 'welcome';
return this.$store.state.device.deckDefault ? 'deck' : 'home';
}
} }
}); });
</script> </script>

View File

@ -60,7 +60,8 @@ const defaultDeviceSettings = {
navbar: 'top', navbar: 'top',
deckColumnAlign: 'center', deckColumnAlign: 'center',
mobileNotificationPosition: 'bottom', mobileNotificationPosition: 'bottom',
deckTemporaryColumn: null deckTemporaryColumn: null,
deckDefault: false
}; };
export default (os: MiOS) => new Vuex.Store({ export default (os: MiOS) => new Vuex.Store({