App.vue 3.8 KB
Newer Older
1
<template>
janis.streib's avatar
FMT    
janis.streib committed
2
3
4
5
6
  <div id="app">
    <Navbar/>
    <div id="wrapper" :class="$store.state.show_sidebar ? 'squished' : null">
      <div id="page-content-wrapper">
        <div class="container">
janis.streib's avatar
janis.streib committed
7
          <b-alert v-if="$sysinfo.host_oper_mode.is_devel" show variant="warning">
janis.streib's avatar
FMT    
janis.streib committed
8
9
10
11
12
            <b-row>
              <b-col cols="1" style="margin-top: auto; margin-bottom: auto" class="vertical-center">
                <font-awesome-icon :icon="['fas', 'dumpster-fire']" size="3x"></font-awesome-icon>
              </b-col>
              <b-col style="margin-top: auto; margin-bottom: auto">
janis.streib's avatar
janis.streib committed
13
14
                      <span><b> WIP!</b>
                        Diese Anwendung befindet sich in aktiver Entwicklung. Einige Features könnten eingeschränkt funktionieren oder unerwartete Ergebnisse liefern.</span>
janis.streib's avatar
FMT    
janis.streib committed
15
16
17
18
19
20
              </b-col>
            </b-row>
          </b-alert>
          <b-breadcrumb :items="breadcrumbs"/>
          <router-view v-bind:key="$store.state.reload_count"/>
          <Footer/>
21
        </div>
janis.streib's avatar
FMT    
janis.streib committed
22
23
24
25
      </div>
      <b-card id="sidebar-wrapper" no-body :class="$store.state.show_sidebar ? 'hide' : null">
        <Sidebar/>
      </b-card>
26
    </div>
janis.streib's avatar
FMT    
janis.streib committed
27
  </div>
28
29
30
</template>

<script>
janis.streib's avatar
janis.streib committed
31
32
33
import Navbar from './components/Navbar'
import Footer from './components/Footer'
import Sidebar from './components/Sidebar'
34

janis.streib's avatar
janis.streib committed
35
export default {
janis.streib's avatar
FMT    
janis.streib committed
36
37
  components: {Sidebar, Footer, Navbar},
  data() {
janis.streib's avatar
janis.streib committed
38
39
40
41
42
    return {
      breadcrumbs: []
    }
  },
  watch: {
janis.streib's avatar
FMT    
janis.streib committed
43
    $route() {
janis.streib's avatar
janis.streib committed
44
45
46
47
48
49
      let m = this.$router.currentRoute.matched
      m = m[m.length - 1]
      this.breadcrumbs = this.getBreadcrumbs(m)
    }
  },
  methods: {
janis.streib's avatar
FMT    
janis.streib committed
50
51
    getBreadcrumbs(m) {
      const res = [{text: m.meta.resolveName(this.$route.params), path: m.path}]
janis.streib's avatar
janis.streib committed
52
53
54
55
56
57
58
      while ((m.meta && m.meta.resolveParents) || m.parent) {
        if (m.meta && m.meta.resolveParents) {
          const parents = m.meta.resolveParents(this.$route.params)
          for (let i = 0; i < parents.length; i++) {
            if (typeof parents[i] === 'object' && 'text' in parents[i] && 'to' in parents[i]) {
              res.unshift(parents[i])
              continue
59
            }
janis.streib's avatar
janis.streib committed
60
61
            m = this.$router.resolve(parents[i]).resolved.matched
            m = m[m.length - 1]
janis.streib's avatar
FMT    
janis.streib committed
62
            res.unshift({text: m.meta.resolveName(this.$route.params), to: parents[i]})
janis.streib's avatar
janis.streib committed
63
64
65
          }
        } else {
          m = m.parent
janis.streib's avatar
FMT    
janis.streib committed
66
          res.unshift({text: m.meta.resolveName(this.$route.params), to: m.path})
67
        }
janis.streib's avatar
janis.streib committed
68
69
      }
      return res
70
    }
janis.streib's avatar
janis.streib committed
71
  },
janis.streib's avatar
FMT    
janis.streib committed
72
  mounted() {
janis.streib's avatar
janis.streib committed
73
74
75
    window.console.log('%c ', `font-size:0px; padding: 200px; background:url(${window.location.protocol}//${window.location.hostname}:${window.location.port}/important.webp) no-repeat; background-position: center; background-size: contain;`)
  }
}
76
</script>
gj4210's avatar
gj4210 committed
77
78

<style lang="scss">
janis.streib's avatar
FMT    
janis.streib committed
79
80
81
82
83
@import '../node_modules/bootstrap/scss/bootstrap.scss';
@import '../node_modules/bootstrap-vue/dist/bootstrap-vue.css';
@import 'assets/css/net-suite.css';
@import 'assets/css/net-suite-devel.css';
@import 'assets/css/net-suite-test.css';
gj4210's avatar
gj4210 committed
84

janis.streib's avatar
FMT    
janis.streib committed
85
$sidebar-width: 380px;
gj4210's avatar
gj4210 committed
86

janis.streib's avatar
FMT    
janis.streib committed
87
88
89
90
@media screen and (min-width: 981px) {
  #wrapper {
    transition: padding-right .5s;
  }
gj4210's avatar
gj4210 committed
91

janis.streib's avatar
FMT    
janis.streib committed
92
93
94
  #wrapper.squished {
    padding-right: $sidebar-width;
  }
gj4210's avatar
gj4210 committed
95

janis.streib's avatar
FMT    
janis.streib committed
96
97
98
99
100
101
102
103
104
105
106
  #sidebar-wrapper {
    height: 100%;
    width: $sidebar-width;
    position: fixed;
    z-index: 1;
    top: 0;
    right: -$sidebar-width;
    transition: right .5s;
    padding-top: 50px;
    background: #F7F7F7;
  }
gj4210's avatar
gj4210 committed
107

janis.streib's avatar
FMT    
janis.streib committed
108
109
110
111
  #sidebar-wrapper.hide {
    right: 0px;
  }
}
gj4210's avatar
gj4210 committed
112

janis.streib's avatar
FMT    
janis.streib committed
113
114
115
116
117
118
119
120
121
122
123
@media screen and (max-width: 980px) {
  #sidebar-wrapper {
    height: 100%;
    width: 100%;
    position: fixed;
    z-index: 999;
    top: -100%;
    transition: top .5s;
    padding-top: 50px;
    background: #F7F7F7;
  }
gj4210's avatar
gj4210 committed
124

janis.streib's avatar
FMT    
janis.streib committed
125
126
127
128
  #sidebar-wrapper.hide {
    top: 0;
  }
}
129
130
131
132
133
134
135
136
137

.collapse-icon {
  transition: transform;
  transition-duration: 250ms;
}

.not-collapsed > .collapse-icon {
  transform: rotate(-180deg);
}
janis.streib's avatar
janis.streib committed
138
</style>