Changeset View
Changeset View
Standalone View
Standalone View
src/resources/vue/Widgets/StatusMessage.vue
<template> | <template> | ||||
<div v-if="statusLabel()" :class="statusClass()"> | <div v-if="statusLabel()" :class="statusClass()"> | ||||
<div v-if="status == 'init'" class="app-loader small"> | <div v-if="status == 'init'" class="app-loader small"> | ||||
<div class="spinner-border" role="status"></div> | <div class="spinner-border" role="status"></div> | ||||
</div> | </div> | ||||
<span v-if="status == 'init'">{{ $t(statusLabel()) }}</span> | <span v-if="status == 'init'">{{ $t(statusLabel()) }}</span> | ||||
<svg-icon v-if="status != 'init' && statusLabel()" :icon="Number(status) >= 400 ? 'exclamation-circle' : 'info-circle'"></svg-icon> | <svg-icon v-if="status != 'init' && statusLabel()" :icon="Number(status) >= 400 ? 'circle-exclamation' : 'circle-info'"></svg-icon> | ||||
<span v-if="status != 'init' && statusLabel()">{{ $t(statusLabel()) }}</span> | <span v-if="status != 'init' && statusLabel()">{{ $t(statusLabel()) }}</span> | ||||
</div> | </div> | ||||
</template> | </template> | ||||
<script> | <script> | ||||
import { library } from '@fortawesome/fontawesome-svg-core' | |||||
library.add( | |||||
require('@fortawesome/free-solid-svg-icons/faCircleInfo').definition, | |||||
require('@fortawesome/free-solid-svg-icons/faCircleExclamation').definition, | |||||
) | |||||
const defaultLabels = { | const defaultLabels = { | ||||
init: 'msg.loading', | init: 'msg.loading', | ||||
404: 'msg.notfound' | 404: 'msg.notfound' | ||||
} | } | ||||
export default { | export default { | ||||
props: { | props: { | ||||
status: { type: [String, Number], default: 'init' }, | status: { type: [String, Number], default: 'init' }, | ||||
Show All 28 Lines |