Skip to content

Commit ce28409

Browse files
dixsierfrandse
authored andcommitted
Fix deconfig records defects (#246)
Resolves: - SW550750 by removing option to delete logs based on demo feedback - SW551637 show severity of manual records Demo notes/conclusions: - Critical guard record cannot be deleted or resolved, - manually guarded entries can be deleted - warning entries can be deleted - can only be deleted when powered off - "clear all" is used to "resolve" all the records at once - deconfig records page is mostly if not all critical errors - hardware deconfig page handles manual records & manual actions The following will be addressed in another commit - SW550334 show Location code to identify the Dimm or Core - SW549785 display SRC field Signed-off-by: Dixsie Wolmers <[email protected]>
1 parent 921083f commit ce28409

File tree

2 files changed

+19
-114
lines changed

2 files changed

+19
-114
lines changed

src/store/modules/Logs/DeconfigurationRecordsStore.js

+15-46
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import api, { getResponseCount } from '@/store/api';
1+
import api from '@/store/api';
22
import i18n from '@/i18n';
33

44
const DeconfigurationRecordsStore = {
@@ -31,24 +31,31 @@ const DeconfigurationRecordsStore = {
3131
EntryType,
3232
} = log;
3333
return {
34-
id: Id,
35-
type: EntryType,
36-
srcDetails: EventId,
37-
severity: Severity,
34+
additionalDataUri: AdditionalDataURI,
3835
date: new Date(Created),
3936
description: Message,
40-
name: Name,
4137
filterByStatus: Resolved ? 'Resolved' : 'Unresolved',
38+
id: Id,
39+
name: Name,
40+
srcDetails: EventId,
4241
status: Resolved, //true or false
42+
type: EntryType,
4343
uri: log['@odata.id'],
44-
additionalDataUri: AdditionalDataURI,
44+
severity:
45+
Severity === 'Warning' && AdditionalDataURI
46+
? 'Predictive'
47+
: Severity === 'Critical'
48+
? 'Fatal'
49+
: Severity === 'Warning' && !AdditionalDataURI
50+
? 'Manual'
51+
: '--',
4552
};
4653
});
4754
commit('setDeconfigurationRecordInfo', deconfigRecords);
4855
})
4956
.catch((error) => console.log(error));
5057
},
51-
async deleteAllEntries({ dispatch }, data) {
58+
async clearAllEntries({ dispatch }, data) {
5259
return await api
5360
.post(
5461
'/redfish/v1/Systems/system/LogServices/HardwareIsolation/Actions/LogService.ClearLog'
@@ -64,44 +71,6 @@ const DeconfigurationRecordsStore = {
6471
);
6572
});
6673
},
67-
async deleteRecords({ dispatch }, uris = []) {
68-
const promises = uris.map((uri) =>
69-
api.delete(uri).catch((error) => {
70-
console.log(error);
71-
return error;
72-
})
73-
);
74-
return await api
75-
.all(promises)
76-
.then((response) => {
77-
dispatch('getDeconfigurationRecordInfo');
78-
return response;
79-
})
80-
.then(
81-
api.spread((...responses) => {
82-
const { successCount, errorCount } = getResponseCount(responses);
83-
const toastMessages = [];
84-
85-
if (successCount) {
86-
const message = i18n.tc(
87-
'pageDeconfigurationRecords.toast.successDelete',
88-
successCount
89-
);
90-
toastMessages.push({ type: 'success', message });
91-
}
92-
93-
if (errorCount) {
94-
const message = i18n.tc(
95-
'pageDeconfigurationRecords.toast.errorDelete',
96-
errorCount
97-
);
98-
toastMessages.push({ type: 'error', message });
99-
}
100-
101-
return toastMessages;
102-
})
103-
);
104-
},
10574
},
10675
};
10776

src/views/Logs/DeconfigurationRecords/DeconfigurationRecords.vue

+4-68
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<b-button
1414
variant="link"
1515
:disabled="allEntries.length === 0"
16-
@click="deleteAllEntries"
16+
@click="clearAllEntries"
1717
>
1818
<icon-delete /> {{ $t('global.action.clearAll') }}
1919
</b-button>
@@ -32,9 +32,7 @@
3232
<table-toolbar
3333
ref="toolbar"
3434
:selected-items-count="selectedRows.length"
35-
:actions="batchActions"
3635
@clear-selected="clearSelectedRows($refs.table)"
37-
@batch-action="onBatchAction"
3836
>
3937
<template #toolbar-buttons>
4038
<table-toolbar-export
@@ -127,27 +125,6 @@
127125
<span class="sr-only">{{ $t('global.table.selectItem') }}</span>
128126
</b-form-checkbox>
129127
</template>
130-
<!-- Severity column -->
131-
<template #cell(severity)="row">
132-
<span v-if="row.item.severity === 'Critical'">
133-
{{ $t('pageDeconfigurationRecords.fatal') }}
134-
</span>
135-
<span
136-
v-if="
137-
row.item.severity === 'Warning' && row.item.additionalDataUri
138-
"
139-
>
140-
{{ $t('pageDeconfigurationRecords.predictive') }}
141-
</span>
142-
<span
143-
v-if="
144-
row.item.severity === 'Warning' &&
145-
row.item.additionalDataUri === 'undefined'
146-
"
147-
>
148-
{{ $t('pageDeconfigurationRecords.manual') }}
149-
</span>
150-
</template>
151128
<!-- Date column -->
152129
<template #cell(date)="{ value }">
153130
<p class="mb-0">{{ value | formatDate }}</p>
@@ -278,7 +255,7 @@ export default {
278255
{
279256
key: 'severity',
280257
label: this.$t('pageDeconfigurationRecords.table.severity'),
281-
sortable: false,
258+
sortable: true,
282259
},
283260
{
284261
key: 'type',
@@ -304,12 +281,6 @@ export default {
304281
},
305282
],
306283
activeFilters: [],
307-
batchActions: [
308-
{
309-
value: 'delete',
310-
label: this.$t('global.action.delete'),
311-
},
312-
],
313284
selectedRows: selectedRows,
314285
tableHeaderCheckboxModel: tableHeaderCheckboxModel,
315286
tableHeaderCheckboxIndeterminate: tableHeaderCheckboxIndeterminate,
@@ -342,7 +313,7 @@ export default {
342313
.finally(() => this.endLoader());
343314
},
344315
methods: {
345-
deleteAllEntries() {
316+
clearAllEntries() {
346317
this.$bvModal
347318
.msgBoxConfirm(
348319
this.$t('pageDeconfigurationRecords.modal.deleteAllMessage'),
@@ -357,7 +328,7 @@ export default {
357328
if (deleteConfirmed) {
358329
this.$store
359330
.dispatch(
360-
'deconfigurationRecords/deleteAllEntries',
331+
'deconfigurationRecords/clearAllEntries',
361332
this.allEntries
362333
)
363334
.then((message) => this.successToast(message))
@@ -422,41 +393,6 @@ export default {
422393
});
423394
}
424395
},
425-
onBatchAction(action) {
426-
if (action === 'delete') {
427-
const uris = this.selectedRows.map((row) => row.uri);
428-
this.$bvModal
429-
.msgBoxConfirm(
430-
this.$tc(
431-
'pageDeconfigurationRecords.modal.deleteMessage',
432-
this.selectedRows.length
433-
),
434-
{
435-
title: this.$tc(
436-
'pageDeconfigurationRecords.modal.deleteTitle',
437-
this.selectedRows.length
438-
),
439-
okTitle: this.$t('global.action.delete'),
440-
cancelTitle: this.$t('global.action.cancel'),
441-
}
442-
)
443-
.then((deleteConfirmed) => {
444-
if (deleteConfirmed) {
445-
if (this.selectedRows.length === this.allEntries.length) {
446-
this.$store
447-
.dispatch(
448-
'deconfigurationRecords/deleteAllEntries',
449-
this.selectedRows.length
450-
)
451-
.then((message) => this.successToast(message))
452-
.catch(({ message }) => this.errorToast(message));
453-
} else {
454-
this.deleteRecords(uris);
455-
}
456-
}
457-
});
458-
}
459-
},
460396
},
461397
};
462398
</script>

0 commit comments

Comments
 (0)