@@ -7,6 +7,7 @@ import { CButton } from '@coreui/react'
7
7
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
8
8
import { faEdit , faEllipsisV } from '@fortawesome/free-solid-svg-icons'
9
9
import { CippActionsOffcanvas } from 'src/components/utilities'
10
+ import { cellGenericFormatter } from 'src/components/tables/CellGenericFormat'
10
11
11
12
const DevicesList = ( ) => {
12
13
const [ tenantColumnSet , setTenantColumn ] = useState ( true )
@@ -28,6 +29,13 @@ const DevicesList = () => {
28
29
{ label : 'Unique ID' , value : `${ row . id ?? ' ' } ` } ,
29
30
] }
30
31
actions = { [
32
+ {
33
+ label : 'Enable Device' ,
34
+ color : 'info' ,
35
+ modal : true ,
36
+ modalUrl : `/api/ExecDeviceDelete?TenantFilter=${ tenant . defaultDomainName } &ID=${ row . id } &Action=Enable` ,
37
+ modalMessage : 'Are you sure you want to enable this device.' ,
38
+ } ,
31
39
{
32
40
label : 'Disable Device' ,
33
41
color : 'info' ,
@@ -39,7 +47,7 @@ const DevicesList = () => {
39
47
label : 'Delete Device' ,
40
48
color : 'warning' ,
41
49
modal : true ,
42
- modalUrl : `/api/ExecGroupsDelete ?TenantFilter=${ tenant . defaultDomainName } &ID=${ row . id } &Action=Enable ` ,
50
+ modalUrl : `/api/ExecDeviceDelete ?TenantFilter=${ tenant . defaultDomainName } &ID=${ row . id } &Action=Delete ` ,
43
51
modalMessage : 'Are you sure you want to delete this device.' ,
44
52
} ,
45
53
] }
@@ -75,6 +83,13 @@ const DevicesList = () => {
75
83
cell : ( row ) => CellTip ( row [ 'displayName' ] ) ,
76
84
exportSelector : 'displayName' ,
77
85
} ,
86
+ {
87
+ selector : ( row ) => row [ 'accountEnabled' ] ,
88
+ name : 'Enabled' ,
89
+ sortable : true ,
90
+ cell : cellGenericFormatter ( ) ,
91
+ exportSelector : 'accountEnabled' ,
92
+ } ,
78
93
{
79
94
selector : ( row ) => row [ 'deviceOwnership' ] ,
80
95
name : 'Device Ownership' ,
@@ -146,6 +161,29 @@ const DevicesList = () => {
146
161
$format : 'application/json' ,
147
162
} ,
148
163
columns,
164
+ tableProps : {
165
+ selectableRows : true ,
166
+ actionsList : [
167
+ {
168
+ label : 'Enable Device' ,
169
+ modal : true ,
170
+ modalUrl : `/api/ExecDeviceDelete?TenantFilter=!Tenant&ID=!id&Action=Enable` ,
171
+ modalMessage : 'Are you sure you want to enable this device?' ,
172
+ } ,
173
+ {
174
+ label : 'Disable Device' ,
175
+ modal : true ,
176
+ modalUrl : `/api/ExecDeviceDelete?TenantFilter=!Tenant&ID=!id&Action=Disable` ,
177
+ modalMessage : 'Are you sure you want to disable this device?' ,
178
+ } ,
179
+ {
180
+ label : 'Delete Device' ,
181
+ modal : true ,
182
+ modalUrl : `/api/ExecDeviceDelete?TenantFilter=!Tenant&ID=!id&Action=Delete` ,
183
+ modalMessage : 'Are you sure you want to delete this device?' ,
184
+ } ,
185
+ ] ,
186
+ } ,
149
187
} }
150
188
/>
151
189
)
0 commit comments