2020-09-25 23:36:11 +02:00
|
|
|
import Vue from 'vue'
|
2020-10-08 15:38:36 +02:00
|
|
|
import mixins from './mixins'
|
2020-11-26 20:39:15 +01:00
|
|
|
import VueStorage from './packages/vue-storage'
|
2022-07-07 18:04:04 +02:00
|
|
|
import i18n from './langs/i18n'
|
2020-09-25 23:36:11 +02:00
|
|
|
import router from './routes'
|
|
|
|
import api from './api'
|
|
|
|
import FontAwesome from './packages/fontawesome'
|
|
|
|
import Clipboard from './packages/clipboard'
|
|
|
|
import Notifications from 'vue-notification'
|
2020-01-14 17:06:59 +01:00
|
|
|
|
2020-01-15 21:04:30 +01:00
|
|
|
import './components'
|
2019-06-24 00:29:14 +02:00
|
|
|
|
2020-09-25 23:36:11 +02:00
|
|
|
Vue.use(Notifications)
|
|
|
|
|
2019-05-20 07:37:41 +02:00
|
|
|
const app = new Vue({
|
|
|
|
el: '#app',
|
2020-03-23 17:25:53 +01:00
|
|
|
data: {
|
2022-05-10 08:57:45 +02:00
|
|
|
appSettings: window.appSettings,
|
2022-05-16 22:55:50 +02:00
|
|
|
appConfig: window.appConfig,
|
2023-02-17 17:12:53 +01:00
|
|
|
userPreferences: window.userPreferences,
|
2022-07-07 16:39:57 +02:00
|
|
|
isDemoApp: window.isDemoApp,
|
2023-02-01 17:21:55 +01:00
|
|
|
isTestingApp: window.isTestingApp,
|
2023-04-24 08:10:13 +02:00
|
|
|
prefersDarkScheme: window.matchMedia('(prefers-color-scheme: dark)').matches,
|
2023-04-24 13:09:50 +02:00
|
|
|
spinner: {
|
|
|
|
active: false,
|
|
|
|
message: 'loading'
|
|
|
|
},
|
2023-02-01 17:21:55 +01:00
|
|
|
},
|
|
|
|
|
|
|
|
computed: {
|
|
|
|
showDarkMode: function() {
|
2023-02-17 17:12:53 +01:00
|
|
|
return this.userPreferences.theme == 'dark' ||
|
|
|
|
(this.userPreferences.theme == 'system' && this.prefersDarkScheme)
|
2023-02-01 17:21:55 +01:00
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
mounted () {
|
|
|
|
this.mediaQueryList = window.matchMedia('(prefers-color-scheme: dark)')
|
|
|
|
this.$nextTick(() => {
|
|
|
|
this.mediaQueryList.addEventListener('change', this.setDarkScheme)
|
|
|
|
})
|
|
|
|
},
|
|
|
|
|
|
|
|
beforeDestroy () {
|
|
|
|
this.mediaQueryList.removeEventListener('change', this.setDarkScheme)
|
|
|
|
},
|
|
|
|
|
|
|
|
methods: {
|
|
|
|
setDarkScheme ({ matches }) {
|
|
|
|
this.prefersDarkScheme = matches
|
2023-04-24 08:10:13 +02:00
|
|
|
},
|
|
|
|
|
2023-04-24 13:09:50 +02:00
|
|
|
showSpinner(message) {
|
|
|
|
this.spinner.message = message;
|
|
|
|
this.spinner.active = true;
|
2023-04-24 08:10:13 +02:00
|
|
|
},
|
|
|
|
|
2023-04-24 09:30:23 +02:00
|
|
|
hideSpinner() {
|
2023-04-24 13:09:50 +02:00
|
|
|
this.spinner.active = false;
|
|
|
|
this.spinner.message = 'loading';
|
2023-02-01 17:21:55 +01:00
|
|
|
}
|
2020-03-23 17:25:53 +01:00
|
|
|
},
|
2020-01-12 15:12:32 +01:00
|
|
|
i18n,
|
2019-05-28 17:29:15 +02:00
|
|
|
router,
|
2023-04-24 08:10:13 +02:00
|
|
|
});
|