Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved: Added a function to set the ion-badge color based on log status and updated the 'Failed Records' icon properties (#680) #745

Merged
merged 3 commits into from
Nov 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 16 additions & 3 deletions src/views/DataManagerLogDetails.vue
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,12 @@
<p>{{ translate('Finished') }}</p>
</ion-label>

<ion-badge v-if="log.statusId" :color="log.statusId === 'SERVICE_FAILED' ? 'danger' : 'success'">{{ translate(getStatusDesc(log.statusId)) }}</ion-badge>
<ion-badge v-if="log.statusId" :color="getLogStatusColor(log.statusId)">{{ translate(getStatusDesc(log.statusId)) }}</ion-badge>

<div class="ion-text-center" lines="none" v-if="log.errorRecordContentId" button @click="downloadErrorRecordFile(log)">
<ion-icon slot="start" :icon="cloudDownloadOutline" />
<div class="ion-text-center" lines="none" v-if="log.errorRecordContentId">
<ion-button fill="clear" color="medium" @click="downloadErrorRecordFile(log)">
<ion-icon slot="icon-only" :icon="cloudDownloadOutline" />
</ion-button>
<ion-label>
<p>{{ translate('Failed records') }}</p>
</ion-label>
Expand Down Expand Up @@ -257,6 +259,17 @@ export default defineComponent ({
} catch (error) {
logger.error(error);
}
},
getLogStatusColor(statusId) {
if (statusId === 'SERVICE_FINISHED') {
return 'success';
} else if (statusId === 'SERVICE_RUNNING') {
return 'dark';
} else if (statusId === 'SERVICE_FAILED') {
return 'danger';
} else {
return 'medium';
}
}
},
setup() {
Expand Down
Loading