App.vue 4.45 KB
Newer Older
1
2
3
<template>
  <div id="app">
    <sidebar></sidebar>
4
    <service-messages v-if="messages.length > 0" />
5
    <router-view :key="$route.fullPath"></router-view>
Eliot Berriot's avatar
Eliot Berriot committed
6
    <div class="ui fitted divider"></div>
7
8
9
10
    <div id="footer" class="ui vertical footer segment">
      <div class="ui container">
        <div class="ui stackable equal height stackable grid">
          <div class="three wide column">
Bat's avatar
Bat committed
11
            <i18next tag="h4" class="ui header" path="Links"></i18next>
12
            <div class="ui link list">
13
              <router-link class="item" to="/about">
Bat's avatar
Bat committed
14
                <i18next path="About this instance" />
15
              </router-link>
16
17
18
19
20
21
22
              <a href="https://funkwhale.audio" class="item" target="_blank">{{ $t('Official website') }}</a>
              <a href="https://docs.funkwhale.audio" class="item" target="_blank">{{ $t('Documentation') }}</a>
              <a href="https://code.eliotberriot.com/funkwhale/funkwhale" class="item" target="_blank">
                <template v-if="version">{{ $t('Source code ({% version %})', {version: version}) }}</template>
                <template v-else>{{ $t('Source code') }}</template>
              </a>
              <a href="https://code.eliotberriot.com/funkwhale/funkwhale/issues" class="item" target="_blank">{{ $t('Issue tracker') }}</a>
23
24
25
            </div>
          </div>
          <div class="ten wide column">
Bat's avatar
Bat committed
26
27
28
29
30
31
32
            <i18next tag="h4" class="ui header" path="About funkwhale" />
            <p>
              <i18next path="Funkwhale is a free and open-source project run by volunteers. You can help us improve the platform by reporting bugs, suggesting features and share the project with your friends!"/>
            </p>
            <p>
              <i18next path="The funkwhale logo was kindly designed and provided by Francis Gading."/>
            </p>
33
34
35
36
          </div>
        </div>
      </div>
    </div>
Eliot Berriot's avatar
Eliot Berriot committed
37
38
39
40
    <raven
      v-if="$store.state.instance.settings.raven.front_enabled.value"
      :dsn="$store.state.instance.settings.raven.front_dsn.value">
    </raven>
Eliot Berriot's avatar
Eliot Berriot committed
41
    <playlist-modal v-if="$store.state.auth.authenticated"></playlist-modal>
42
43
44
45
  </div>
</template>

<script>
46
47
import axios from 'axios'
import _ from 'lodash'
48
import {mapState} from 'vuex'
49

50
import Sidebar from '@/components/Sidebar'
Eliot Berriot's avatar
Eliot Berriot committed
51
import Raven from '@/components/Raven'
52
import ServiceMessages from '@/components/ServiceMessages'
53

Eliot Berriot's avatar
Eliot Berriot committed
54
55
import PlaylistModal from '@/components/playlists/PlaylistModal'

56
57
export default {
  name: 'app',
Eliot Berriot's avatar
Eliot Berriot committed
58
59
  components: {
    Sidebar,
Eliot Berriot's avatar
Eliot Berriot committed
60
    Raven,
61
62
    PlaylistModal,
    ServiceMessages
Eliot Berriot's avatar
Eliot Berriot committed
63
  },
64
65
66
67
68
  data () {
    return {
      nodeinfo: null
    }
  },
69
70
  created () {
    this.$store.dispatch('instance/fetchSettings')
Eliot Berriot's avatar
Eliot Berriot committed
71
    let self = this
72
73
74
75
    setInterval(() => {
      // used to redraw ago dates every minute
      self.$store.commit('ui/computeLastDate')
    }, 1000 * 60)
76
77
78
79
80
81
82
83
84
85
86
    this.fetchNodeInfo()
  },
  methods: {
    fetchNodeInfo () {
      let self = this
      axios.get('instance/nodeinfo/2.0/').then(response => {
        self.nodeinfo = response.data
      })
    }
  },
  computed: {
87
88
89
    ...mapState({
      messages: state => state.ui.messages
    }),
90
91
92
93
94
95
    version () {
      if (!this.nodeinfo) {
        return null
      }
      return _.get(this.nodeinfo, 'software.version')
    }
96
  }
97
98
99
100
101
102
103
104
105
}
</script>

<style lang="scss">
// we do the import here instead in main.js
// as resolve order is not deterministric in webpack
// and we end up with CSS rules not applied,
// see https://github.com/webpack/webpack/issues/215
@import 'semantic/semantic.css';
106
@import 'style/vendor/media';
107
108


109
110
html, body {
  @include media("<desktop") {
111
    font-size: 90%;
112
113
  }
}
114
115
116
117
118
#app {
  font-family: 'Avenir', Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
119
.main.pusher, .footer {
120
121
122
  @include media(">desktop") {
    margin-left: 350px !important;
  }
123
  transform: none !important;
124
}
125
126
127
128
129
130
131
132
.service-messages {
  position: fixed;
  bottom: 1em;
  left: 1em;
  @include media(">desktop") {
    left: 350px;
  }
}
133
.main-pusher {
134
135
  padding: 1.5rem 0;
}
136
137
138
139
140
.ui.stripe.segment, #footer {
  padding: 2em;
  @include media(">tablet") {
    padding: 4em;
  }
141
142
}

143
144
145
146
147
148
.ellipsis {
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}

149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
.ui.small.text.container {
  max-width: 500px !important;
}

.button.icon.tiny {
    padding: 0.5em !important;
}

.sidebar {
  .logo {
    path {
      fill: white;
    }
  }
}

.discrete.link {
    color: rgba(0, 0, 0, 0.87);
}

.floated.buttons .button ~ .dropdown {
  border-left: none;
}
</style>