Просмотр исходного кода

show dash icons on left panel

pull/13/head
Jonathan Cobb 4 лет назад
Родитель
Сommit
5b3ce47beb
3 измененных файлов: 46 добавлений и 6 удалений
  1. +4
    -2
      src/_store/account.module.js
  2. +35
    -4
      src/app/App.vue
  3. +7
    -0
      src/index.html

+ 4
- 2
src/_store/account.module.js Просмотреть файл

@@ -67,9 +67,11 @@ const actions = {
} }
const landing = util.getLandingPage(); const landing = util.getLandingPage();
if (landing === null) { if (landing === null) {
console.log('account.login: no landing page, systemConfigs.bubbleNode=='+systemConfigs.bubbleNode);
if (systemConfigs.bubbleNode === false) {
console.log('account.login: no landing page, systemConfigs.bubbleNode=='+systemConfigs.bubbleNode+', systemConfigs.sageLauncher=='+systemConfigs.sageLauncher);
if (systemConfigs.bubbleNode === false || systemConfigs.sageLauncher === true) {
router.replace('/bubbles'); router.replace('/bubbles');
} else if (systemConfigs.bubbleNode === true) {
router.replace('/devices');
} else { } else {
router.replace('/'); router.replace('/');
} }


+ 35
- 4
src/app/App.vue Просмотреть файл

@@ -3,9 +3,18 @@
<div class="jumbotron"> <div class="jumbotron">
<totp-modal/> <totp-modal/>


<router-link v-if="status.loggedIn && activated && path && path !== '' && path !== '/'" to="/" class="icon-dash-cell">
<div class="icon-dash-title"><i aria-hidden="true" :class="'icon-dash-app '+messages.label_menu_dashboard_icon" :title="messages.label_menu_dashboard"></i><br/>{{messages.label_menu_dashboard}}</div>
</router-link>
<table v-if="status.loggedIn && activated && path && path !== '' && path !== '/'" class="dash-icon-panel">
<tr align="center"><td align="center">
<router-link to="/" class="icon-dash-cell">
<span class="icon-dash-title"><i aria-hidden="true" :class="'icon-dash-app '+messages.label_menu_dashboard_icon" :title="messages.label_menu_dashboard"></i><br/>{{messages.label_menu_dashboard}}</span>
</router-link>
</td></tr>
<tr v-for="app in dashApps" align="center"><td align="center">
<router-link :to="app.href" class="icon-dash-cell">
<span class="icon-dash-title"><i aria-hidden="true" :class="'icon-dash-app '+app.icon" :title="app.title"></i><br/>{{app.title}}</span>
</router-link>
</td></tr>
</table>


<div class="container"> <div class="container">
<div class="row"> <div class="row">
@@ -38,7 +47,7 @@
</template> </template>


<script> <script>
import { mapState, mapActions } from 'vuex'
import {mapState, mapActions, mapGetters} from 'vuex'
import { util } from '../_helpers' import { util } from '../_helpers'


export default { export default {
@@ -55,6 +64,28 @@ export default {
...mapState({ ...mapState({
alert: state => state.alert alert: state => state.alert
}), }),
...mapGetters('system', ['dashboardApps']),
queryApp () {
if (typeof this.$route.query.app !== 'undefined' && this.$route.query.app !== null && this.$route.query.app !== '') {
return this.$route.query.app;
}
return null;
},
dashApps () {
let appView = this.dashboardApps;
const qApp = this.queryApp;
if (qApp !== null) {
const appPath = this.$route.query.app;
for (let i=0; i<appView.length; i++) {
const app = appView[i];
if (app.href === '/?app='+appPath) {
appView = app.apps;
break;
}
}
}
return appView;
},
locales () { return this.configs.locales; }, locales () { return this.configs.locales; },
path () { return this.$route.path; } path () { return this.$route.path; }
}, },


+ 7
- 0
src/index.html Просмотреть файл

@@ -85,10 +85,17 @@
} }
.icon-dash-cell { .icon-dash-cell {
font-size: xx-large; font-size: xx-large;
align-content: center;
} }
.icon-dash-app { .icon-dash-app {
font-size: xx-large; font-size: xx-large;
} }
.dash-icon-panel {
position: fixed;
top: 30px;
left: 30px;
width: auto;
}
.bubble-footer { .bubble-footer {
font-size: xx-small; font-size: xx-small;
position: fixed; position: fixed;


Загрузка…
Отмена
Сохранить