App.vue 2.03 KB
Newer Older
1
2
<template>
  <div id="app">
3
4
5
6
7
8
    <app-header
      :modules="modules"
      :user="user"
    />
    <router-view />
    <app-footer />
9
10
11
12
  </div>
</template>

<script>
13
14
import 'bootstrap/dist/css/bootstrap.css'
import 'bootstrap-vue/dist/bootstrap-vue.css'
15
16
17
18
import header from './components/Header.vue'
import footer from './components/Footer.vue'

export default {
19
  name: 'App',
20
21
22
23
24
25
  components: {
    'app-header': header,
    'app-footer': footer
  },
  data () {
    return {
26
27
28
29
30
      modules_logged_out: [
        { slug: 'home', title: 'Home' },
        { slug: 'credits', title: 'Credits' },
      ],
      modules_logged_in: [
31
32
33
34
35
36
37
38
39
40
41
42
43
44
        { slug: 'home', title: 'Home' },
        { slug: 'shows', title: 'Shows' },
        { slug: 'files', title: 'Files & Playlists' },
        { slug: 'settings', title: 'Settings' },
        { slug: 'credits', title: 'Credits' },
      ],
      modules_logged_in_superuser : [
        { slug: 'home', title: 'Home' },
        { slug: 'shows', title: 'Shows' },
        { slug: 'files', title: 'Files & Playlists' },
        { slug: 'emissions', title: 'Emissions' },
        { slug: 'settings', title: 'Settings' },
        { slug: 'credits', title: 'Credits' },
        { slug: 'debug', title: 'Debug' }
45
46
      ],
    }
47
48
  },
  computed: {
49
50
    userOIDC () { return this.$store.state.auth.userOIDC },
    user () { return this.$store.state.auth.user },
51
    modules: function () {
52
53
54
55
56
57
58
59
60
      if (this.user.logged_in === true) {
        if (this.user.steeringUser && this.user.steeringUser.is_superuser) {
          return this.modules_logged_in_superuser
        } else {
          return this.modules_logged_in
        }
      } else {
        return this.modules_logged_out
      }
61
62
    }
  },
63
  mounted () {
64
    this.$store.dispatch('auth/oidcInit')
65
  },
66
67
  methods: {
    signIn () {
68
      this.$store.dispatch('auth/signinRedirect')
69
70
    },
    signOut () {
71
      this.$store.dispatch('auth/signoutRedirect')
72
    },
73
74
75
76
77
78
  }
}
</script>

<style>
#app {
79
  color: #2e3436;
80
}
81
/*
82
83
84
85
86
#app .content-width {
  margin: auto;
  width: 920px;
  max-width: 920px;
}
87
*/
88
</style>