import { defineComponent, onMounted, ref, watch, onUnmounted, nextTick } from 'vue'

import { CTitleBanner } from '../../../components/CTitleBanner'
import { CDateTime } from '../../../components/CDateTime'
import { CMyFieldDb } from '../../../components/CMyFieldDb'
import { useQuasar } from 'quasar'
import { useI18n } from 'vue-i18n'
import { useUserStore } from '@store/UserStore'
import { useGlobalStore } from '@store/globalStore'
import { useCircuitStore } from '@store/CircuitStore'
import { tools } from '@tools'
import { costanti } from '@costanti'
import { shared_consts } from '@src/common/shared_vuejs'


export default defineComponent({
  name: 'servermysql',
  components: { CTitleBanner, CDateTime, CMyFieldDb },
  props: {},
  setup() {
    const $q = useQuasar()
    const { t } = useI18n()
    const circuitStore = useCircuitStore()
    const userStore = useUserStore()
    const globalStore = useGlobalStore()

    function mounted() {

    }

    const serverData = ref({
      NameServer: '',
      IPServer: '',
      Attivo: false,
      VersioneServer: '',
      LastBackupServer: ''
    });

    async function submitForm() {
      await globalStore.saveServerMysql(serverData.value)
    }

    onMounted(mounted)

    return {
      tools,
      costanti,
      serverData,
      submitForm,
    }
  },
})
