-
Notifications
You must be signed in to change notification settings - Fork 0
/
GoogleAppsDashboard.vue
93 lines (86 loc) · 2.74 KB
/
GoogleAppsDashboard.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
<template>
<div id="google_apps_users_dashboard">
<div class="row">
<div class="col-md-3 col-sm-6 col-xs-12">
<div class="info-box">
<span class="info-box-icon"><i class="fa" :class="[connectionStatusIcon, connectionStatusColor]"></i></span>
<div class="info-box-content">
<span class="info-box-text">Status</span>
<span class="info-box-number" style="word-break: break-all;">{{ connectionStatus }}</span>
</div>
</div>
</div>
<div class="col-md-6 col-sm-12 col-xs-12">
<div class="info-box">
<span class="info-box-icon bg-yellow"><i class="ion ion-ios-people-outline"></i></span>
<div class="info-box-content">
<span class="info-box-text">Admin User</span>
<span class="info-box-number"> {{userAdmin}} </span>
</div>
</div>
</div>
<div class="col-md-3 col-sm-6 col-xs-12">
<div class="info-box">
<span class="info-box-icon bg-yellow"><i class="fa fa-envelope"></i></span>
<div class="info-box-content">
<span class="info-box-text">Pending Invitations</span>
<span class="info-box-number">TODO</span>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
import store from '../Store'
import Form from 'acacha-forms'
export default {
data() {
return {
connected: false
}
},
props: {
uri: {
type: String,
default: '-google'
},
userAdmin: {
type: String,
required: true
},
},
computed: {
connectionStatus: function() {
if (this.connected) return "Connected"
return "Disconnected"
},
connectionStatusIcon: function() {
if (this.connected) return "fa-check"
return "fa-times"
},
connectionStatusColor: function() {
if (this.connected) return "text-success"
return "text-danger"
}
},
methods: {
checkConnection() {
let component = this
let dashboardRequest = new Form({}, true)
let apiUri = store.apiUri + this.uri + '/check'
dashboardRequest.get(apiUri)
.then(response => {
if (response.data.state == 'connected') component.connected = true
})
},
boostrapDashboard() {
this.checkConnection()
}
},
mounted() {
console.log();
this.boostrapDashboard()
}
}
</script>