This commit is contained in:
2022-02-22 23:31:27 +00:00
parent 904dc5259f
commit e77c8283f5
5 changed files with 97 additions and 63 deletions

View File

@@ -120,7 +120,17 @@
</v-menu>
</v-toolbar>
</slot>
<slot name="main"
<div v-if="hasError" class="mx-2 mt-4 d-flex align-center">
<v-alert
data-cy="dash-error"
color="error"
icon="$ayiExclamationTriangle"
class="multi-line"
outlined
>{{ errorMessage }}</v-alert
>
</div>
<slot v-if="!hasError" name="main"
><div class="ml-4 mt-1 d-flex align-center">
<div>
<span class="grey--text"
@@ -151,7 +161,8 @@ export default {
count: { type: Number, default: 0 },
updateFrequency: { type: Number, default: 60000 },
maxListItems: { type: Number, default: 10 },
icon: { type: String, default: "$ayiTachometer" }
icon: { type: String, default: "$ayiTachometer" },
errorMessage: { type: String, default: null }
},
data() {
return {
@@ -164,6 +175,9 @@ export default {
},
translatedTitle() {
return this.$ay.t(this.title);
},
hasError() {
return this.errorMessage != null && this.errorMessage.length > 0;
}
},
created() {