summaryrefslogtreecommitdiff
path: root/src/views/_sila/Settings/TransferInfo/Transfer.vue
blob: 4b70778bafbc12f649183c7acc64dc59daaf0148 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<template>
  <b-container fluid="xl">
    <page-title :description="$t('pageTransfer.description')" />
    <snmp />
    <hr />
    <smtp />
    <hr />
    <syslog />
    <hr />
    <modal-snmp @ok="saveSnmp" />
    <modal-smtp @ok="saveSmtp" />
  </b-container>
</template>

<script>
import BVToastMixin from '@/components/_sila/Mixins/BVToastMixin';
import LoadingBarMixin, {
  loading,
} from '@/components/_sila/Mixins/LoadingBarMixin';

import PageTitle from '@/components/_sila/Global/PageTitle';
import Snmp from './Snmp';
import Smtp from './Smtp';
import ModalSnmp from './ModalSnmp.vue';
import ModalSmtp from './ModalSmtp.vue';
import Syslog from './Syslog';

export default {
  name: 'PowerRestorePolicy',
  components: {
    PageTitle,
    Snmp,
    ModalSnmp,
    Smtp,
    ModalSmtp,
    Syslog,
  },
  mixins: [BVToastMixin, LoadingBarMixin],
  data() {
    return {
      loading,
    };
  },
  methods: {
    saveSnmp(modalFormData) {
      this.startLoader();
      this.$store
        .dispatch('snmpStore/addSubscriber', modalFormData)
        .then((message) => this.successToast(message))
        .catch(({ message }) => this.errorToast(message))
        .finally(() => this.endLoader());
    },

    saveSmtp(modalFormData) {
      this.startLoader();
      this.$store
        .dispatch('smtpStore/addSubscriber', modalFormData)
        .then((message) => this.successToast(message))
        .catch(({ message }) => this.errorToast(message))
        .finally(() => this.endLoader());
    },
  },
};
</script>