-
Notifications
You must be signed in to change notification settings - Fork 381
/
DeviceGroupListPanel.vue
102 lines (95 loc) · 1.93 KB
/
DeviceGroupListPanel.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
<template>
<v-card hover class="white">
<v-card-text class="group">
<div class="group-image" :style="backgroundImageStyle"></div>
<div class="group-name ellipsis title">
{{ group.name }}
</div>
<div class="group-token ellipsis subheading">
{{ group.token }}
</div>
<div class="group-description ellipsis">
{{ group.description }}
</div>
<div class="group-roles ellipsis">
Roles: <strong>{{ rolesView }}</strong>
</div>
</v-card-text>
</v-card>
</template>
<script>
export default {
data: function () {
return {
}
},
components: {
},
props: ['group'],
computed: {
rolesView: function () {
return this.group.roles.join(', ')
},
// Create background image style.
backgroundImageStyle: function () {
return {
'background-image': 'url(' + this.group.imageUrl + ')',
'background-size': 'contain',
'background-repeat': 'no-repeat',
'background-position': '50% 50%'
}
}
},
methods: {
// Fire event to have parent refresh content.
refresh: function () {
this.$emit('refresh')
}
}
}
</script>
<style scoped>
.group {
position: relative;
min-height: 120px;
overflow-x: hidden;
}
.group-image {
position: absolute;
top: 5px;
left: 5px;
bottom: 5px;
width: 90px;
background-color: #fff;
border-right: 1px solid #eee;
}
.group-name {
position: absolute;
top: 8px;
left: 110px;
right: 10px;
}
.group-token {
position: absolute;
top: 35px;
left: 110px;
right: 10px;
}
.group-description {
position: absolute;
top: 63px;
left: 110px;
right: 10px;
}
.group-roles {
position: absolute;
top: 90px;
left: 110px;
right: 10px;
}
.ellipsis {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
</style>