27
27
<status-icon :status =" statusIcon(value)" />
28
28
{{ value }}
29
29
</template >
30
-
30
+ <!-- Toggle identify LED -->
31
+ <template #cell (identifyLed)="row">
32
+ <b-form-checkbox
33
+ v-if =" hasIdentifyLed(row.item.identifyLed)"
34
+ v-model =" row.item.identifyLed"
35
+ name =" switch"
36
+ switch
37
+ @change =" toggleIdentifyLedValue(row.item)"
38
+ >
39
+ <span v-if =" row.item.identifyLed" >
40
+ {{ $t('global.status.on') }}
41
+ </span >
42
+ <span v-else > {{ $t('global.status.off') }} </span >
43
+ </b-form-checkbox >
44
+ <div v-else >--</div >
45
+ </template >
31
46
<template #row-details =" { item } " >
32
47
<b-container fluid >
33
48
<b-row >
34
- <b-col sm =" 6" xl =" 4 " >
49
+ <b-col class = " mt-2 " sm =" 6" xl =" 6 " >
35
50
<dl >
36
- <!-- Chassis type -->
37
- <dt >{{ $t('pageHardwareStatus.table.chassisType') }}:</dt >
38
- <dd >{{ tableFormatter(item.chassisType) }}</dd >
39
- <!-- Manufacturer -->
40
- <dt >{{ $t('pageHardwareStatus.table.manufacturer') }}:</dt >
41
- <dd >{{ tableFormatter(item.manufacturer) }}</dd >
42
- <!-- Power state -->
43
- <dt >{{ $t('pageHardwareStatus.table.powerState') }}:</dt >
44
- <dd >{{ tableFormatter(item.powerState) }}</dd >
51
+ <!-- Name -->
52
+ <dt >{{ $t('pageHardwareStatus.table.name') }}:</dt >
53
+ <dd >{{ tableFormatter(item.name) }}</dd >
54
+ <!-- Part number -->
55
+ <dt >{{ $t('pageHardwareStatus.table.partNumber') }}:</dt >
56
+ <dd >{{ tableFormatter(item.partNumber) }}</dd >
57
+ <!-- Serial Number -->
58
+ <dt >{{ $t('pageHardwareStatus.table.serialNumber') }}:</dt >
59
+ <dd >{{ tableFormatter(item.serialNumber) }}</dd >
60
+ <!-- Model -->
61
+ <dt >{{ $t('pageHardwareStatus.table.model') }}:</dt >
62
+ <dd class =" mb-2" >
63
+ {{ tableFormatter(item.model) }}
64
+ </dd >
65
+ <!-- Asset tag -->
66
+ <dt >{{ $t('pageHardwareStatus.table.assetTag') }}:</dt >
67
+ <dd class =" mb-2" >
68
+ {{ tableFormatter(item.assetTag) }}
69
+ </dd >
45
70
</dl >
46
71
</b-col >
47
- <b-col sm =" 6" xl =" 4 " >
72
+ <b-col class = " mt-2 " sm =" 6" xl =" 6 " >
48
73
<dl >
49
- <!-- Health rollup -->
50
- <dt >
51
- {{ $t('pageHardwareStatus.table.statusHealthRollup') }}:
52
- </dt >
53
- <dd >{{ tableFormatter(item.healthRollup) }}</dd >
54
74
<!-- Status state -->
55
75
<dt >{{ $t('pageHardwareStatus.table.statusState') }}:</dt >
56
76
<dd >{{ tableFormatter(item.statusState) }}</dd >
77
+ <!-- Power state -->
78
+ <dt >{{ $t('pageHardwareStatus.table.power') }}:</dt >
79
+ <dd >{{ tableFormatter(item.power) }}</dd >
80
+ <!-- Health rollup -->
81
+ <dt >{{ $t('pageHardwareStatus.table.healthRollup') }}:</dt >
82
+ <dd >{{ tableFormatter(item.healthRollup) }}</dd >
83
+ </dl >
84
+ </b-col >
85
+ </b-row >
86
+ <div class =" section-divider mb-3 mt-3" ></div >
87
+ <b-row >
88
+ <b-col class =" mt-2" sm =" 6" xl =" 6" >
89
+ <dl >
90
+ <!-- Manufacturer -->
91
+ <dt >{{ $t('pageHardwareStatus.table.manufacturer') }}:</dt >
92
+ <dd >{{ tableFormatter(item.manufacturer) }}</dd >
93
+ <!-- Chassis Type -->
94
+ <dt >{{ $t('pageHardwareStatus.table.chassisType') }}:</dt >
95
+ <dd >{{ tableFormatter(item.chassisType) }}</dd >
96
+ </dl >
97
+ </b-col >
98
+ <b-col class =" mt-2" sm =" 6" xl =" 6" >
99
+ <dl >
100
+ <!-- Min power -->
101
+ <dt >{{ $t('pageHardwareStatus.table.minPowerWatts') }}:</dt >
102
+ <dd >{{ tableFormatter(item.minPowerWatts) }}</dd >
103
+ <!-- Max power -->
104
+ <dt >{{ $t('pageHardwareStatus.table.maxPowerWatts') }}:</dt >
105
+ <dd >{{ tableFormatter(item.maxPowerWatts) }}</dd >
57
106
</dl >
58
107
</b-col >
59
108
</b-row >
66
115
<script >
67
116
import PageSection from ' @/components/Global/PageSection' ;
68
117
import IconChevron from ' @carbon/icons-vue/es/chevron--down/20' ;
69
-
118
+ import BVToastMixin from ' @/components/Mixins/BVToastMixin ' ;
70
119
import StatusIcon from ' @/components/Global/StatusIcon' ;
71
120
72
121
import TableRowExpandMixin, {
@@ -76,7 +125,7 @@ import TableDataFormatterMixin from '@/components/Mixins/TableDataFormatterMixin
76
125
77
126
export default {
78
127
components: { IconChevron, PageSection, StatusIcon },
79
- mixins: [TableRowExpandMixin, TableDataFormatterMixin],
128
+ mixins: [BVToastMixin, TableRowExpandMixin, TableDataFormatterMixin],
80
129
data () {
81
130
return {
82
131
fields: [
@@ -97,13 +146,13 @@ export default {
97
146
tdClass: ' text-nowrap' ,
98
147
},
99
148
{
100
- key: ' partNumber ' ,
101
- label: this .$t (' pageHardwareStatus.table.partNumber ' ),
149
+ key: ' locationNumber ' ,
150
+ label: this .$t (' pageHardwareStatus.table.locationNumber ' ),
102
151
formatter: this .tableFormatter ,
103
152
},
104
153
{
105
- key: ' serialNumber ' ,
106
- label: this .$t (' pageHardwareStatus.table.serialNumber ' ),
154
+ key: ' identifyLed ' ,
155
+ label: this .$t (' pageHardwareStatus.table.identifyLed ' ),
107
156
formatter: this .tableFormatter ,
108
157
},
109
158
],
@@ -121,5 +170,19 @@ export default {
121
170
this .$root .$emit (' hardware-status-chassis-complete' );
122
171
});
123
172
},
173
+ methods: {
174
+ toggleIdentifyLedValue (row ) {
175
+ this .$store
176
+ .dispatch (' chassis/updateIdentifyLedValue' , {
177
+ uri: row .uri ,
178
+ identifyLed: row .identifyLed ,
179
+ })
180
+ .catch (({ message }) => this .errorToast (message));
181
+ },
182
+ // TO DO: Remove this method when the LocationIndicatorActive is added from backend.
183
+ hasIdentifyLed (identifyLed ) {
184
+ return typeof identifyLed === ' boolean' ;
185
+ },
186
+ },
124
187
};
125
188
</script >
0 commit comments