diff --git a/web/app/layouts/default.vue b/web/app/layouts/default.vue index 282f92e3af37a0f04188f502e9d4708691def994..03cf06b6d1b5b3f44e9aaffcdac6b0c5ef5b971f 100644 --- a/web/app/layouts/default.vue +++ b/web/app/layouts/default.vue @@ -37,6 +37,7 @@ <v-spacer></v-spacer> <v-chip + v-if="false" class="ma-2 px-6" :color="isConnect ? 'green' : 'red'" text-color="white" @@ -111,7 +112,7 @@ export default { async mounted() { const self = this - const task = [self.checkinConnect()] + const task = [] await axios.all(task).then(axios.spread((...responses) => {})) }, diff --git a/web/app/pages/sync/index.vue b/web/app/pages/sync/index.vue index c3bb3d1cbbf0e2ef15daa4ac93329d1884401719..208437a08daea77c67561c22fe0654e7ec9ef06b 100644 --- a/web/app/pages/sync/index.vue +++ b/web/app/pages/sync/index.vue @@ -1,5 +1,5 @@ <template> - <div> + <div class="pt-4"> <v-card class="mx-auto mb-4"> <v-list-item> <v-icon class="primary--text text--darken-2 font-weight-bold" @@ -28,10 +28,10 @@ <v-icon left>mdi-sync</v-icon> {{ syncTab === 0 - ? "Sync Check-In" + ? 'Sync Check-In' : syncTab === 1 - ? "Sync Ticket" - : "Sync All" + ? 'Sync Ticket' + : 'Sync All' }}</v-btn > </div> @@ -69,10 +69,10 @@ <v-icon left>mdi-sync</v-icon> {{ syncTab === 0 - ? "Sync Check-In" + ? 'Sync Check-In' : syncTab === 1 - ? "Sync Ticket" - : "Sync Gate" + ? 'Sync Ticket' + : 'Sync Gate' }}</v-btn > </div> @@ -119,12 +119,12 @@ > <template #[`item.checkin_date`]="{ item }"> <span>{{ - $tool.formatDate(item.checkin_date, "DD MMM YYYY HH:mm:ss") + $tool.formatDate(item.checkin_date, 'DD MMM YYYY HH:mm:ss') }}</span> </template> <template #[`item.checkout_date`]="{ item }"> <span>{{ - $tool.formatDate(item.checkout_date, "DD MMM YYYY HH:mm:ss") + $tool.formatDate(item.checkout_date, 'DD MMM YYYY HH:mm:ss') }}</span> </template> </v-data-table> @@ -185,22 +185,22 @@ </template> <script> -import axios from "axios"; -import { cloneDeep, isEmpty } from "lodash"; -import { mapState } from "vuex"; +import axios from 'axios' +import { cloneDeep, isEmpty } from 'lodash' +import { mapState } from 'vuex' export default { - name: "ManualSync", + name: 'ManualSync', meta: { - menuID: "manualsync", - module: "manualsync", - submodule: "manualsync", - action: ["read"], - title: "Manual Sync", - subtitle: "manualsync", + menuID: 'manualsync', + module: 'manualsync', + submodule: 'manualsync', + action: ['read'], + title: 'Manual Sync', + subtitle: 'manualsync', backTo: null, breadcrumbs: [ { - text: "Manual Sync", + text: 'Manual Sync', }, ], }, @@ -211,27 +211,27 @@ export default { data() { return { // TODO: move activation to another page - title: "Sync", + title: 'Sync', syncTab: 0, loadingSyncCheck: true, loadingSyncTiket: true, loadingSyncGate: true, loadingAction: false, is_all: false, - searchCheckIn: "", - searchTiket: "", - searchGate: "", - lastSyncCheck: "", - lastSyncTiket: "", - lastSyncGate: "", + searchCheckIn: '', + searchTiket: '', + searchGate: '', + lastSyncCheck: '', + lastSyncTiket: '', + lastSyncGate: '', headerCheck: [ - { text: "Ticket ID", value: "ticket_id" }, - { text: "Status", value: "state", width: "100px" }, + { text: 'Ticket ID', value: 'ticket_id' }, + { text: 'Status', value: 'state', width: '100px' }, { - text: "Check-In Date", - value: "checkin_date", - align: "right", - width: "200px", + text: 'Check-In Date', + value: 'checkin_date', + align: 'right', + width: '200px', }, // { // text: "Check-Out Date", @@ -241,26 +241,26 @@ export default { // }, ], headerTiket: [ - { text: "Event", value: "event_reff.name", width: "200px" }, - { text: "Name", value: "general_information.name", width: "200px" }, + { text: 'Event', value: 'event_reff.name', width: '200px' }, + { text: 'Name', value: 'general_information.name', width: '200px' }, // { text: "Gender", value: "gender", width: "100px" }, // { text: "Company", value: "company", width: "100px" }, // { text: "Occupation", value: "occupation", width: "100px" }, - { text: "Ticket", value: "ticket_kind_reff.name", width: "200px" }, - { text: "Email", value: "general_information.email", width: "200px" }, - { text: "Status", value: "general_information.status", width: "100px" }, + { text: 'Ticket', value: 'ticket_kind_reff.name', width: '200px' }, + { text: 'Email', value: 'general_information.email', width: '200px' }, + { text: 'Status', value: 'general_information.status', width: '100px' }, ], headerGate: [ - { text: "Event", value: "event_name", width: "200px" }, - { text: "Gate", value: "gate_name", width: "200px" }, - { text: "Gate Type", value: "gate_type", width: "150px" }, - { text: "Ticket", value: "ticket_name", width: "200px" }, - { text: "Description", value: "gate_description", width: "300px" }, + { text: 'Event', value: 'event_name', width: '200px' }, + { text: 'Gate', value: 'gate_name', width: '200px' }, + { text: 'Gate Type', value: 'gate_type', width: '150px' }, + { text: 'Ticket', value: 'ticket_name', width: '200px' }, + { text: 'Description', value: 'gate_description', width: '300px' }, { - text: "Updated Date", - value: "ticket_updated_date", - align: "right", - width: "200px", + text: 'Updated Date', + value: 'ticket_updated_date', + align: 'right', + width: '200px', }, ], listSyncCheckIn: [], @@ -272,13 +272,13 @@ export default { optionsSyncCheckIn: {}, optionsSyncTiket: {}, optionsSyncGate: {}, - }; + } }, head() { return { title: this.title, - }; + } }, computed: { @@ -287,131 +287,131 @@ export default { watch: { optionsSyncCheckIn(v) { - const take = v.itemsPerPage; - const skip = v.itemsPerPage * (v.page - 1); - this.getSyncCheckIn(take, skip); + const take = v.itemsPerPage + const skip = v.itemsPerPage * (v.page - 1) + this.getSyncCheckIn(take, skip) }, optionsSyncTiket(v) { - const take = v.itemsPerPage; - const skip = v.itemsPerPage * (v.page - 1); - this.getSyncTiket(take, skip); + const take = v.itemsPerPage + const skip = v.itemsPerPage * (v.page - 1) + this.getSyncTiket(take, skip) }, optionsSyncGate(v) { - const take = v.itemsPerPage; - const skip = v.itemsPerPage * (v.page - 1); - this.getSyncGate(take, skip); + const take = v.itemsPerPage + const skip = v.itemsPerPage * (v.page - 1) + this.getSyncGate(take, skip) }, searchCheckIn() { - this.getSyncCheckIn(5, 0); + this.getSyncCheckIn(5, 0) }, searchTiket() { - this.getSyncTiket(5, 0); + this.getSyncTiket(5, 0) }, searchGate() { - this.getSyncGate(5, 0); + this.getSyncGate(5, 0) }, syncTab(val) { - const self = this; - self.is_all = false; + const self = this + self.is_all = false if (val === 0 && !isEmpty(self.optionsSyncCheckIn)) { - self.getSyncCheckIn(5, 0); + self.getSyncCheckIn(5, 0) } else if (val === 1 && !isEmpty(self.optionsSyncTiket)) { - self.getSyncTiket(5, 0); + self.getSyncTiket(5, 0) } else if (val === 2 && !isEmpty(self.optionsSyncGate)) { - self.getSyncGate(5, 0); + self.getSyncGate(5, 0) } }, }, async mounted() { - const self = this; - const task = []; + const self = this + const task = [] await axios.all(task).then( axios.spread((...responses) => { setTimeout(function () { - self.$vuetify.goTo(0); - }, 300); - }) - ); + self.$vuetify.goTo(0) + }, 300) + }), + ) }, methods: { sync() { - const self = this; - self.loadingAction = true; + const self = this + self.loadingAction = true if (self.syncTab === 0) { - self.syncCheckIn(); + self.syncCheckIn() } else if (self.syncTab === 1) { - self.syncTiket(); + self.syncTiket() } else { // self.syncGate(); } }, refresh() { - const self = this; - self.loadingAction = true; + const self = this + self.loadingAction = true if (self.syncTab === 0) { - self.getSyncCheckIn(5, 0); + self.getSyncCheckIn(5, 0) } else if (self.syncTab === 1) { - self.getSyncTiket(5, 0); + self.getSyncTiket(5, 0) } else { // self.getSyncGate(5, 0); } }, getSyncCheckIn(getTake, getSkip) { - const self = this; - self.loadingSyncCheck = true; + const self = this + self.loadingSyncCheck = true const params = { skip: getSkip, take: getTake, // status_sync: "", // search: self.searchCheckIn, - }; - self.$axios.post("checklog/getsnotsynced", params).then( + } + self.$axios.post('checklog/getsnotsynced', params).then( (r) => { - console.log(r); - const datas = cloneDeep(r.data.data); - const count = cloneDeep(r.data.total); + console.log(r) + const datas = cloneDeep(r.data.data) + const count = cloneDeep(r.data.total) // const lastSync = cloneDeep(r.data.LastRefreshDate); - self.loadingSyncCheck = false; - self.loadingAction = false; - self.listSyncCheckIn = datas; - self.totalSycnCheckIn = count; + self.loadingSyncCheck = false + self.loadingAction = false + self.listSyncCheckIn = datas + self.totalSycnCheckIn = count // self.lastSyncCheck = lastSync; }, (e) => { - self.loadingSyncCheck = false; - self.loadingAction = false; - self.$dialog.notify.error(e.response.data); - } - ); + self.loadingSyncCheck = false + self.loadingAction = false + self.$dialog.notify.error(e.response.data) + }, + ) }, getSyncTiket(getTake, getSkip) { - const self = this; - self.loadingSyncTiket = true; + const self = this + self.loadingSyncTiket = true const params = { skip: getSkip, take: getTake, - }; + } - self.$axios.post("ticket/gets", params).then( + self.$axios.post('ticket/gets', params).then( (r) => { - console.log(r.data); - const datas = cloneDeep(r.data.data); - const count = cloneDeep(r.data.total); + console.log(r.data) + const datas = cloneDeep(r.data.data) + const count = cloneDeep(r.data.total) // const lastSync = cloneDeep(r.data.LastRefreshDate); - self.loadingSyncTiket = false; - self.loadingAction = false; - self.listSyncTiket = datas; - self.totalSyncTiket = count; + self.loadingSyncTiket = false + self.loadingAction = false + self.listSyncTiket = datas + self.totalSyncTiket = count // self.lastSyncTiket = lastSync; }, (e) => { - self.loadingSyncTiket = false; - self.loadingAction = false; - self.$dialog.notify.error(e.response.data); - } - ); + self.loadingSyncTiket = false + self.loadingAction = false + self.$dialog.notify.error(e.response.data) + }, + ) }, // getSyncGate(getTake, getSkip) { // const self = this; @@ -441,54 +441,54 @@ export default { // ); // }, syncCheckIn() { - const self = this; - self.loadingSyncCheck = true; - const params = {}; - self.$axios.post("sync/checkin", params).then( + const self = this + self.loadingSyncCheck = true + const params = {} + self.$axios.post('sync/checkin', params).then( (r) => { - self.getSyncCheckIn(5, 0); + self.getSyncCheckIn(5, 0) }, (e) => { - self.loadingSyncCheck = false; - self.loadingAction = false; - self.$dialog.notify.error(e.response.data); - } - ); + self.loadingSyncCheck = false + self.loadingAction = false + self.$dialog.notify.error(e.response.data) + }, + ) }, syncTiket() { - const self = this; - self.loadingSyncTiket = true; + const self = this + self.loadingSyncTiket = true const params = { is_all: self.is_all, - }; - self.$axios.post("sync/ticket", params).then( + } + self.$axios.post('sync/ticket', params).then( (r) => { - self.getSyncTiket(5, 0); + self.getSyncTiket(5, 0) }, (e) => { - self.loadingSyncTiket = false; - self.loadingAction = false; - self.$dialog.notify.error(e.response.data); - } - ); + self.loadingSyncTiket = false + self.loadingAction = false + self.$dialog.notify.error(e.response.data) + }, + ) }, syncGate() { - const self = this; - self.loadingSyncGate = true; - const params = {}; - self.$axios.post("gate/manualsync", params).then( + const self = this + self.loadingSyncGate = true + const params = {} + self.$axios.post('gate/manualsync', params).then( (r) => { - self.getSyncGate(5, 0); + self.getSyncGate(5, 0) }, (e) => { - self.loadingSyncGate = false; - self.loadingAction = false; - self.$dialog.notify.error(e.response.data); - } - ); + self.loadingSyncGate = false + self.loadingAction = false + self.$dialog.notify.error(e.response.data) + }, + ) }, }, -}; +} </script> <style scoped>