summaryrefslogtreecommitdiff
path: root/src/components/Mixins/BVToastMixin.js
diff options
context:
space:
mode:
authorYoshie Muranaka <yoshiemuranaka@gmail.com>2020-02-12 22:30:49 +0300
committerYoshie Muranaka <yoshiemuranaka@gmail.com>2020-02-22 00:32:15 +0300
commit183c27548046e12b94354aa598b5bcf956d31103 (patch)
tree4168e439d3554427648b7898a706d8a7aed84e10 /src/components/Mixins/BVToastMixin.js
parentc11d38945b8a51e4181142c2b8852ffcb30338d9 (diff)
downloadwebui-vue-183c27548046e12b94354aa598b5bcf956d31103.tar.xz
Add batch actions to local user table
- Create TableToolbar component for table batch actions - Added Toast warning type and toast title message translations - Update vue-i18n package to latest v8.15.3 to use improved pluarlization features Signed-off-by: Yoshie Muranaka <yoshiemuranaka@gmail.com> Change-Id: I455beba4f56b8209b1201bbc5ff3f616e960d189
Diffstat (limited to 'src/components/Mixins/BVToastMixin.js')
-rw-r--r--src/components/Mixins/BVToastMixin.js19
1 files changed, 15 insertions, 4 deletions
diff --git a/src/components/Mixins/BVToastMixin.js b/src/components/Mixins/BVToastMixin.js
index 489173c9..a46f5e50 100644
--- a/src/components/Mixins/BVToastMixin.js
+++ b/src/components/Mixins/BVToastMixin.js
@@ -1,22 +1,33 @@
+import i18n from '../../i18n';
+
const BVToastMixin = {
methods: {
- successToast(message) {
+ successToast(message, title = i18n.t('global.response.success')) {
this.$root.$bvToast.toast(message, {
- title: 'Success',
+ title,
variant: 'success',
autoHideDelay: 10000, //auto hide in milliseconds
isStatus: true,
solid: true
});
},
- errorToast(message) {
+ errorToast(message, title = i18n.t('global.response.error')) {
this.$root.$bvToast.toast(message, {
- title: 'Error',
+ title,
variant: 'danger',
noAutoHide: true,
isStatus: true,
solid: true
});
+ },
+ warningToast(message, title = i18n.t('global.response.warning')) {
+ this.$root.$bvToast.toast(message, {
+ title,
+ variant: 'warning',
+ noAutoHide: true,
+ isStatus: true,
+ solid: true
+ });
}
}
};