From 64579ccabf3670c575278f1b445bf02ad8017922 Mon Sep 17 00:00:00 2001 From: paoloar77 Date: Thu, 10 Mar 2022 23:20:09 +0100 Subject: [PATCH] Sistemazioni varie BUGS --- .env.development | 2 +- _ALL_SITES/insiemesipuo.app/.env.development | 2 +- .../popolodelnuovomondo.app/.env.development | 2 +- _ALL_SITES/riso.app/.env.development | 2 +- _ALL_SITES/riso.app/.env.test | 2 +- .../CGridTableRec/CGridTableRec.vue | 1 + src/components/CLineChart/CLineChart.ts | 12 +++++- src/components/CStatusReg/CStatusReg.ts | 39 ++++++++++++------- src/components/CStatusReg/CStatusReg.vue | 6 ++- .../CUserNonVerif/CUserNonVerif.vue | 4 +- src/db/lang/ws_it.js | 1 + src/model/GlobalStore.ts | 1 + src/store/Modules/tools.ts | 1 + 13 files changed, 52 insertions(+), 23 deletions(-) diff --git a/.env.development b/.env.development index 810c48c3..a080aa54 100755 --- a/.env.development +++ b/.env.development @@ -1,4 +1,4 @@ -APP_VERSION="0.3.8" +APP_VERSION="0.3.10" SERVICE_WORKER_FILE="service-worker.js" APP_ID="13" DIRECTORY_LOCAL="newfreeplanet" diff --git a/_ALL_SITES/insiemesipuo.app/.env.development b/_ALL_SITES/insiemesipuo.app/.env.development index 5abedd30..7faab557 100755 --- a/_ALL_SITES/insiemesipuo.app/.env.development +++ b/_ALL_SITES/insiemesipuo.app/.env.development @@ -1,4 +1,4 @@ - APP_VERSION="0.3.8" +APP_VERSION="0.3.10" SERVICE_WORKER_FILE="service-worker.js" APP_ID="13" DIRECTORY_LOCAL="newfreeplanet" diff --git a/_ALL_SITES/popolodelnuovomondo.app/.env.development b/_ALL_SITES/popolodelnuovomondo.app/.env.development index 6fd33db2..010ae292 100755 --- a/_ALL_SITES/popolodelnuovomondo.app/.env.development +++ b/_ALL_SITES/popolodelnuovomondo.app/.env.development @@ -1,4 +1,4 @@ - APP_VERSION="0.3.8" +APP_VERSION="0.3.10" SERVICE_WORKER_FILE="service-worker.js" APP_ID="12" DIRECTORY_LOCAL="newfreeplanet" diff --git a/_ALL_SITES/riso.app/.env.development b/_ALL_SITES/riso.app/.env.development index b6228e4d..1f3b4a10 100755 --- a/_ALL_SITES/riso.app/.env.development +++ b/_ALL_SITES/riso.app/.env.development @@ -1,4 +1,4 @@ - APP_VERSION="0.3.8" +APP_VERSION="0.3.10" SERVICE_WORKER_FILE="service-worker.js" APP_ID="13" DIRECTORY_LOCAL="newfreeplanet" diff --git a/_ALL_SITES/riso.app/.env.test b/_ALL_SITES/riso.app/.env.test index 1c245a39..e1ad7cf8 100755 --- a/_ALL_SITES/riso.app/.env.test +++ b/_ALL_SITES/riso.app/.env.test @@ -1,4 +1,4 @@ - APP_VERSION="0.3.8" +APP_VERSION="0.3.10" SERVICE_WORKER_FILE="service-worker.js" APP_ID="13" DIRECTORY_LOCAL=newfreeplanet diff --git a/src/components/CGridTableRec/CGridTableRec.vue b/src/components/CGridTableRec/CGridTableRec.vue index 89004f13..f4f89fe1 100755 --- a/src/components/CGridTableRec/CGridTableRec.vue +++ b/src/components/CGridTableRec/CGridTableRec.vue @@ -385,6 +385,7 @@
[]) const myarrdata = ref([]) + const myarrbg = ref([]) const myarrsum = ref([]) // @ts-ignore @@ -50,7 +51,7 @@ export default defineComponent({ label: props.title, data: myarrdata.value, borderColor: tools.colourNameToHex('red'), - backgroundColor: tools.colourNameToHex(props.color), + backgroundColor: myarrbg.value, fill: true, }, ], @@ -77,6 +78,7 @@ export default defineComponent({ function mounted() { myarrdata.value = [] + myarrbg.value = [] myarrlabel.value = [] myarrsum.value = [] @@ -88,6 +90,8 @@ export default defineComponent({ let ind = '' + let num = 1 + for (rec of props.mydata) { if (props.sum) { somma += rec.count @@ -100,7 +104,13 @@ export default defineComponent({ //myarrlabel.value.push(rec._id) myarrlabel.value.push(ind) myarrdata.value.push(rec.count) + if (num === props.mydata.length) { + myarrbg.value.push(tools.colourNameToHex('green')) + } else { + myarrbg.value.push(tools.colourNameToHex(props.color)) + } myarrsum.value.push(somma) + num++ // ind++ } } diff --git a/src/components/CStatusReg/CStatusReg.ts b/src/components/CStatusReg/CStatusReg.ts index 21b301aa..c6e842ba 100755 --- a/src/components/CStatusReg/CStatusReg.ts +++ b/src/components/CStatusReg/CStatusReg.ts @@ -20,6 +20,7 @@ import { costanti } from '@costanti' import { useGlobalStore } from '@store/globalStore' import { useUserStore } from '@store/UserStore' import { useI18n } from '@/boot/i18n' +import { useQuasar } from 'quasar' export default defineComponent({ name: 'CStatusReg', @@ -27,11 +28,12 @@ export default defineComponent({ components: { CTitleBanner, CCardState, CCardStat, CLineChart, CMyFieldRec }, setup(props, { attrs, slots, emit }) { const { t } = useI18n() + const $q = useQuasar() const globalStore = useGlobalStore() const userStore = useUserStore() - const NUMSEC_TO_POLLING = ref(300) - const MAXNUM_POLLING = ref(10) + const NUMSEC_TO_POLLING = ref(60) + const MAXNUM_POLLING = ref(1000) const myloadingload = ref(false) const eseguipolling = ref(false) @@ -40,6 +42,7 @@ export default defineComponent({ const datastat = ref({ num_reg: 0, + online_today: 0, num_passeggeri: 0, num_imbarcati: 0, num_teleg_attivo: 0, @@ -67,6 +70,19 @@ export default defineComponent({ return datastat.value.lastsreg }) + watch(() => $q.appVisible, (value: any, oldval: any) => { + // console.log('visible', value) + + if (value && !oldval) { + // console.log('Ora รจ visibile !') + riaggiorna() + } + if (!value && oldval) { + // console.log('Ora รจ invisibile !') + beforeDestroy() + } + }) + function checkifpolling() { if (userStore.my.profile) { if (!tools.isUserOk() && tools.appid() === tools.IDAPP_RISO) @@ -74,9 +90,8 @@ export default defineComponent({ } if (eseguipolling.value) { - clearInterval(polling.value) - polling.value = null - if (numpolled.value > 100) { + beforeDestroy() + if (numpolled.value > 200) { NUMSEC_TO_POLLING.value = 60 * 5 } if (numpolled.value < MAXNUM_POLLING.value) { @@ -91,12 +106,15 @@ export default defineComponent({ } function beforeDestroy() { - clearInterval(polling.value) + if (polling.value) { + clearInterval(polling.value) + polling.value = null + } } function created() { if (tools.isManager()) { - MAXNUM_POLLING.value = 100 + MAXNUM_POLLING.value = 10000 } load() } @@ -106,15 +124,8 @@ export default defineComponent({ myloadingload.value = true datastat.value = await globalStore.getStatSite() - // console.log('datastat.value.lastsreg') - // console.table(datastat.value.lastsreg) - - // console.log('newsstate') - // console.table('GlobalStore.state.serv_settings', GlobalStore.state.serv_settings) - eseguipolling.value = true - // console.log('eseguipolling', eseguipolling) myloadingload.value = false if (userStore.my) { diff --git a/src/components/CStatusReg/CStatusReg.vue b/src/components/CStatusReg/CStatusReg.vue index 996c67da..d0e79f75 100755 --- a/src/components/CStatusReg/CStatusReg.vue +++ b/src/components/CStatusReg/CStatusReg.vue @@ -8,10 +8,14 @@
+ + + mycolor="yellow" :myperc="(datastat.num_autorizzare / datastat.num_teleg_attivo) * 100">
diff --git a/src/components/CUserNonVerif/CUserNonVerif.vue b/src/components/CUserNonVerif/CUserNonVerif.vue index ac2ce840..68bd4ae3 100755 --- a/src/components/CUserNonVerif/CUserNonVerif.vue +++ b/src/components/CUserNonVerif/CUserNonVerif.vue @@ -1,6 +1,6 @@