1
1
<script setup lang="ts">
2
+ import { computed } from ' vue'
2
3
import EmptyTable from ' @/components/EmptyTable.vue'
3
4
4
5
import { useUsersStore } from ' @/stores/users'
@@ -17,6 +18,13 @@ instanceDetails.load(true)
17
18
18
19
const usersStore = useUsersStore ()
19
20
usersStore .load (false )
21
+
22
+ const allUsers = computed (() => usersStore .users ?? [])
23
+ const usersLackingMfa = computed (() => allUsers .value .filter ((x ) => (x .mfa_type == ' ' || x .mfa_type == ' unset' ) ))
24
+
25
+ const allDevices = computed (() => devicesStore .devices ?? [])
26
+ const lockedDevices = computed (() => allDevices .value .filter ((x ) => x .is_locked ))
27
+
20
28
</script >
21
29
22
30
<template >
@@ -25,32 +33,39 @@ usersStore.load(false)
25
33
<div class =" mt-6 flex flex-wrap gap-6" >
26
34
<div class =" flex w-full gap-4" >
27
35
<div class =" flex grid w-1/2 grid-cols-2 gap-4 min-w-[405px]" >
28
- <router-link to =" /management/users" class =" card-compact bg-base-100 shadow-xl" >
29
- <div class =" card-body" >
36
+ <router-link to =" /management/users" class =" card-compact bg-base-100 shadow-xl border-l-4" :class =" usersLackingMfa.length == 0? 'border-primary' : 'border-error'" >
37
+ <div class =" card-body" v-if =" usersLackingMfa.length == 0" >
38
+ <h5 class =" card-title" >Manage Users</h5 >
39
+ <div >{{ allUsers.length == 0 ? 'No users' : allUsers.length + ' users' }}</div >
40
+ </div >
41
+ <div class =" card-body" v-else >
30
42
<h5 class =" card-title" >Manage MFA</h5 >
31
-
32
- <div >{{ usersStore.users?.length == 0 ? 'No users' : usersStore.users?.length + ' users' }}</div >
43
+ <div >{{ usersLackingMfa.length + " user have not completed MFA registration" }}</div >
33
44
</div >
34
45
</router-link >
35
- <router-link to =" /management/devices" class =" card-compact bg-base-100 shadow-xl" >
36
- <div class =" card-body" >
46
+ <router-link to =" /management/devices" class =" card-compact bg-base-100 shadow-xl border-l-4 " :class = " lockedDevices.length == 0? 'border-primary' : 'border-error' " >
47
+ <div class =" card-body" v-if = " lockedDevices.length == 0 " >
37
48
<h5 class =" card-title" >Manage Devices</h5 >
38
49
<div >{{ devicesStore.numDevices() == 0 ? 'No devices' : devicesStore.numDevices() }}</div >
39
50
</div >
51
+ <div class =" card-body" v-else >
52
+ <h5 class =" card-title" >Unlock Device{{ lockedDevices.length > 1? "s" : "" }}</h5 >
53
+ <div >{{ lockedDevices.length + " locked device" + (lockedDevices.length > 1? "s" : "")}}</div >
54
+ </div >
40
55
</router-link >
41
- <router-link to =" /management/devices" class =" card-compact bg-base-100 shadow-xl" >
56
+ <router-link to =" /management/devices" class =" card-compact bg-base-100 shadow-xl border-l-4 border-primary " >
42
57
<div class =" card-body" >
43
58
<h5 class =" card-title" >View Active Sessions</h5 >
44
59
<div >
45
60
{{
46
- devicesStore.devices? .filter(e => {
61
+ allDevices .filter(e => {
47
62
e.active
48
63
}).length ?? 0 + ' active sessions'
49
64
}}
50
65
</div >
51
66
</div >
52
67
</router-link >
53
- <router-link to =" /management/registration_tokens" class =" card-compact bg-base-100 shadow-xl" >
68
+ <router-link to =" /management/registration_tokens" class =" card-compact bg-base-100 shadow-xl border-l-4 " :class = " registrationTokensStore.tokens?.length == 0 ? 'border-primary': 'border-warning' " >
54
69
<div class =" card-body" >
55
70
<h5 class =" card-title" >Registration Tokens</h5 >
56
71
<div >
0 commit comments