-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathApp.vue
139 lines (131 loc) · 3.08 KB
/
App.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
<template>
<div
id="app"
style="heigth: 900px"
@click="closeHeaderDropdown($event)"
>
<network>
<span slot="online">
<transition name="fade">
<router-view />
</transition>
</span>
<span slot="offline">
<div class="hero bg-white">
<div class="hero-inner">
<div class="content content-full">
<div class="py-30 text-center">
<div class="display-3 text-danger">
<i class="fa fa-plug" />
</div>
<h1 class="h2 font-w700 mt-30 mb-10 text-danger">Oops.. You are not connected to the internet..</h1>
<h2 class="h3 font-w400 text-muted mb-50">Please connect to the internet..</h2>
</div>
</div>
</div>
</div>
</span>
</network>
<notifications
:max="3"
:duration="5000"
group="notification"
position="bottom right"
/>
<p-loading-block v-show="isLoadingBlock" />
</div>
</template>
<script>
import Network from '@/network'
import { mapGetters } from 'vuex'
import firebase from 'firebase/app'
export default {
name: 'App',
components: {
Network
},
computed: {
...mapGetters('uiHandler', ['isLoadingBlock'])
},
created () {
if (firebase.messaging.isSupported()) {
const messaging = firebase.messaging()
messaging.requestPermission().then(() => {
messaging.onMessage((payload) => {
console.log('Message received. ', payload)
})
}).catch(error => {
console.log('Unable to get permission to notify.', error)
})
} else {
console.log('Push API not supported in this browser.')
}
},
mounted () {
window.addEventListener('resize', this.handleResize)
document.getElementById('app').style.minHeight = window.innerHeight + 'px'
},
beforeDestroy: function () {
window.removeEventListener('resize', this.handleResize)
},
methods: {
closeHeaderDropdown (event) {
if (event.target.id !== 'page-header-user-dropdown') {
this.$store.dispatch('uiHandler/closeHeaderDropdown')
}
},
handleResize (event) {
document.getElementById('app').style.minHeight = window.innerHeight + 'px'
}
}
}
</script>
<style>
.no-wrap {
white-space: nowrap;
}
.vue-notification.info {
background: #0c80df;
border-left-color: #0073d1;
}
.vue-notification-group {
z-index: 9999 !important;
}
.full-width {
width: 100%;
}
.block.block-mode-loading::after {
top: 50px;
}
.block-content-inner {
padding: 0px !important;
}
/* .fade-enter-active,
.fade-leave-active {
transition: opacity 0.5s;
}
.fade-enter,
.fade-leave-to
{
opacity: 0;
transition: opacity;
} */
.card {
/* Add shadows to create the "card" effect */
box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2);
transition: 0.3s;
}
/* On mouse-over, add a deeper shadow */
.card:hover {
box-shadow: 0 8px 16px 0 rgba(0,0,0,0.2);
}
.invalid-input {
display: block;
margin-top: .25rem;
font-size: .875rem;
color: #ef5350;
}
.swal2-container {
z-index: 9060 !important;
}
</style>