diff --git a/.env.development b/.env.development index ec161ecb..158377fa 100755 --- a/.env.development +++ b/.env.development @@ -1,4 +1,4 @@ -APP_VERSION="1.0.56" +APP_VERSION="1.0.57" SERVICE_WORKER_FILE="service-worker.js" APP_ID="19" DIRECTORY_LOCAL="newfreeplanet" diff --git a/.env.example.production b/.env.example.production index 4ca61c80..3c5ee1ad 100755 --- a/.env.example.production +++ b/.env.example.production @@ -1,4 +1,4 @@ -APP_VERSION="1.0.56" +APP_VERSION="1.0.57" SERVICE_WORKER_FILE="service-worker.js" APP_ID="13" DIRECTORY_LOCAL=newfreeplanet diff --git a/.env.prod.gruppomacro b/.env.prod.gruppomacro index 8173f968..c788e121 100644 --- a/.env.prod.gruppomacro +++ b/.env.prod.gruppomacro @@ -1,4 +1,4 @@ -APP_VERSION="1.0.56" +APP_VERSION="1.0.57" SERVICE_WORKER_FILE="service-worker.js" APP_ID="18" DIRECTORY_LOCAL=newfreeplanet diff --git a/.env.prod.pcb b/.env.prod.pcb index 1d62a13a..5f0f3ef8 100644 --- a/.env.prod.pcb +++ b/.env.prod.pcb @@ -1,4 +1,4 @@ -APP_VERSION="1.0.56" +APP_VERSION="1.0.57" SERVICE_WORKER_FILE="service-worker.js" APP_ID="17" DIRECTORY_LOCAL=newfreeplanet diff --git a/.env.test.abitaregliiblei.it b/.env.test.abitaregliiblei.it index 95163069..0d2c108c 100755 --- a/.env.test.abitaregliiblei.it +++ b/.env.test.abitaregliiblei.it @@ -1,4 +1,4 @@ -APP_VERSION="1.0.56" +APP_VERSION="1.0.57" SERVICE_WORKER_FILE="service-worker.js" APP_ID="19" DIRECTORY_LOCAL=newfreeplanet diff --git a/.env.test.gruppomacro b/.env.test.gruppomacro index 680c55a4..aca51a77 100755 --- a/.env.test.gruppomacro +++ b/.env.test.gruppomacro @@ -1,4 +1,4 @@ -APP_VERSION="1.0.56" +APP_VERSION="1.0.57" SERVICE_WORKER_FILE="service-worker.js" APP_ID="18" DIRECTORY_LOCAL=newfreeplanet diff --git a/.env.test.pcb b/.env.test.pcb index c8d2f38c..b8d1b3b3 100755 --- a/.env.test.pcb +++ b/.env.test.pcb @@ -1,4 +1,4 @@ -APP_VERSION="1.0.56" +APP_VERSION="1.0.57" SERVICE_WORKER_FILE="service-worker.js" APP_ID="17" DIRECTORY_LOCAL=newfreeplanet diff --git a/.env.test.risosrv b/.env.test.risosrv index 29f28b25..f9aeddec 100755 --- a/.env.test.risosrv +++ b/.env.test.risosrv @@ -1,4 +1,4 @@ -APP_VERSION="1.0.56" +APP_VERSION="1.0.57" SERVICE_WORKER_FILE="service-worker_1.0.39.js" APP_ID="13" DIRECTORY_LOCAL=newfreeplanet diff --git a/.env.test2 b/.env.test2 index 05b36302..d1e9ec49 100755 --- a/.env.test2 +++ b/.env.test2 @@ -1,4 +1,4 @@ -APP_VERSION="1.0.56" +APP_VERSION="1.0.57" SERVICE_WORKER_FILE="service-worker.js" APP_ID="13" DIRECTORY_LOCAL=newfreeplanet diff --git a/.env.test_riso.pcb b/.env.test_riso.pcb index 5ad4a0e6..c212e305 100755 --- a/.env.test_riso.pcb +++ b/.env.test_riso.pcb @@ -1,4 +1,4 @@ -APP_VERSION="1.0.56" +APP_VERSION="1.0.57" SERVICE_WORKER_FILE="service-worker.js" APP_ID="13" DIRECTORY_LOCAL=newfreeplanet diff --git a/_ALL_SITES/abitaregliiblei.it/.env.development b/_ALL_SITES/abitaregliiblei.it/.env.development index 2054dc98..db837025 100755 --- a/_ALL_SITES/abitaregliiblei.it/.env.development +++ b/_ALL_SITES/abitaregliiblei.it/.env.development @@ -1,4 +1,4 @@ -APP_VERSION="1.0.56" +APP_VERSION="1.0.57" SERVICE_WORKER_FILE="service-worker.js" APP_ID="19" DIRECTORY_LOCAL="newfreeplanet" diff --git a/_ALL_SITES/abitaregliiblei.it/.env.test b/_ALL_SITES/abitaregliiblei.it/.env.test index e67aa81a..979a52f8 100755 --- a/_ALL_SITES/abitaregliiblei.it/.env.test +++ b/_ALL_SITES/abitaregliiblei.it/.env.test @@ -1,4 +1,4 @@ -APP_VERSION="1.0.56" +APP_VERSION="1.0.57" SERVICE_WORKER_FILE="service-worker.js" APP_ID="16" DIRECTORY_LOCAL=newfreeplanet diff --git a/_ALL_SITES/abitaregliiblei.it/package.json b/_ALL_SITES/abitaregliiblei.it/package.json index e5383a03..68370db2 100755 --- a/_ALL_SITES/abitaregliiblei.it/package.json +++ b/_ALL_SITES/abitaregliiblei.it/package.json @@ -1,6 +1,6 @@ { "name": "abitaregliiblei", - "version": "1.0.56", + "version": "1.0.57", "description": "Abitare Gli Iblei", "productName": "AbitareGliIblei", "author": "Paolo Arena", diff --git a/_ALL_SITES/fioredellavita.riso.app/.env.development b/_ALL_SITES/fioredellavita.riso.app/.env.development index d97f9f35..50b0ed1d 100755 --- a/_ALL_SITES/fioredellavita.riso.app/.env.development +++ b/_ALL_SITES/fioredellavita.riso.app/.env.development @@ -1,4 +1,4 @@ -APP_VERSION="1.0.56" +APP_VERSION="1.0.57" SERVICE_WORKER_FILE="service-worker.js" APP_ID="15" DIRECTORY_LOCAL="newfreeplanet" diff --git a/_ALL_SITES/fioredellavita.riso.app/.env.test b/_ALL_SITES/fioredellavita.riso.app/.env.test index 661caa9c..0267873a 100755 --- a/_ALL_SITES/fioredellavita.riso.app/.env.test +++ b/_ALL_SITES/fioredellavita.riso.app/.env.test @@ -1,4 +1,4 @@ -APP_VERSION="1.0.56" +APP_VERSION="1.0.57" SERVICE_WORKER_FILE="service-worker.js" APP_ID="15" DIRECTORY_LOCAL=newfreeplanet diff --git a/_ALL_SITES/fioredellavita.riso.app/package.json b/_ALL_SITES/fioredellavita.riso.app/package.json index b72a197d..bba83673 100755 --- a/_ALL_SITES/fioredellavita.riso.app/package.json +++ b/_ALL_SITES/fioredellavita.riso.app/package.json @@ -1,6 +1,6 @@ { "name": "fioredellavita", - "version": "1.0.56", + "version": "1.0.57", "description": "Fiore Della Vita", "productName": "Fiore Della Vita", "author": "Paolo Arena", diff --git a/_ALL_SITES/gruppomacro.app/.env.development b/_ALL_SITES/gruppomacro.app/.env.development index 9acaa7b7..70387af7 100755 --- a/_ALL_SITES/gruppomacro.app/.env.development +++ b/_ALL_SITES/gruppomacro.app/.env.development @@ -1,4 +1,4 @@ -APP_VERSION="1.0.56" +APP_VERSION="1.0.57" SERVICE_WORKER_FILE="service-worker.js" APP_ID="18" DIRECTORY_LOCAL="newfreeplanet" diff --git a/_ALL_SITES/gruppomacro.app/.env.test b/_ALL_SITES/gruppomacro.app/.env.test index 2e22bd43..fc20a7bd 100755 --- a/_ALL_SITES/gruppomacro.app/.env.test +++ b/_ALL_SITES/gruppomacro.app/.env.test @@ -1,4 +1,4 @@ -APP_VERSION="1.0.56" +APP_VERSION="1.0.57" SERVICE_WORKER_FILE="service-worker.js" APP_ID="16" DIRECTORY_LOCAL=newfreeplanet diff --git a/_ALL_SITES/gruppomacro.app/package.json b/_ALL_SITES/gruppomacro.app/package.json index 12306180..74f686cd 100755 --- a/_ALL_SITES/gruppomacro.app/package.json +++ b/_ALL_SITES/gruppomacro.app/package.json @@ -1,6 +1,6 @@ { "name": "gruppomacro", - "version": "1.0.56", + "version": "1.0.57", "description": "GruppoMacro", "productName": "Gruppo Macro", "author": "Paolo Arena", diff --git a/_ALL_SITES/piuchebuono.app/.env.development b/_ALL_SITES/piuchebuono.app/.env.development index 520dde8f..05d667ec 100755 --- a/_ALL_SITES/piuchebuono.app/.env.development +++ b/_ALL_SITES/piuchebuono.app/.env.development @@ -1,4 +1,4 @@ -APP_VERSION="1.0.56" +APP_VERSION="1.0.57" SERVICE_WORKER_FILE="service-worker.js" APP_ID="17" DIRECTORY_LOCAL="newfreeplanet" diff --git a/_ALL_SITES/piuchebuono.app/.env.test b/_ALL_SITES/piuchebuono.app/.env.test index 1194bd23..eda00445 100755 --- a/_ALL_SITES/piuchebuono.app/.env.test +++ b/_ALL_SITES/piuchebuono.app/.env.test @@ -1,4 +1,4 @@ -APP_VERSION="1.0.56" +APP_VERSION="1.0.57" SERVICE_WORKER_FILE="service-worker.js" APP_ID="13" DIRECTORY_LOCAL=newfreeplanet diff --git a/_ALL_SITES/piuchebuono.app/db/static_data.ts b/_ALL_SITES/piuchebuono.app/db/static_data.ts index 799d1f4a..67c306af 100755 --- a/_ALL_SITES/piuchebuono.app/db/static_data.ts +++ b/_ALL_SITES/piuchebuono.app/db/static_data.ts @@ -67,7 +67,7 @@ function getDynamicPages(site: ISites): IListRoutes[] { infooter: false, }, { - active: site.confpages && site.confpages.showProfile, + active: true, order: 120, path: '/editprofile', materialIcon: 'fas fa-user', @@ -124,7 +124,7 @@ function getDynamicPages(site: ISites): IListRoutes[] { meta: { requiresAuth: true, newpage: true }, inmenu: false, infooter: false, - }, + }, { active: true, order: 137, diff --git a/_ALL_SITES/riso.app/.env.development b/_ALL_SITES/riso.app/.env.development index b7e70016..721c007b 100755 --- a/_ALL_SITES/riso.app/.env.development +++ b/_ALL_SITES/riso.app/.env.development @@ -1,4 +1,4 @@ -APP_VERSION="1.0.56" +APP_VERSION="1.0.57" SERVICE_WORKER_FILE="service-worker.js" APP_ID="13" DIRECTORY_LOCAL="newfreeplanet" diff --git a/_ALL_SITES/riso.app/.env.production b/_ALL_SITES/riso.app/.env.production index a5dc3d6c..04aaebc1 100644 --- a/_ALL_SITES/riso.app/.env.production +++ b/_ALL_SITES/riso.app/.env.production @@ -1,4 +1,4 @@ -APP_VERSION="1.0.56" +APP_VERSION="1.0.57" 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 2e22bd43..fc20a7bd 100755 --- a/_ALL_SITES/riso.app/.env.test +++ b/_ALL_SITES/riso.app/.env.test @@ -1,4 +1,4 @@ -APP_VERSION="1.0.56" +APP_VERSION="1.0.57" SERVICE_WORKER_FILE="service-worker.js" APP_ID="16" DIRECTORY_LOCAL=newfreeplanet diff --git a/_ALL_SITES/riso.app/package.json b/_ALL_SITES/riso.app/package.json index c6be183b..168cd6fa 100755 --- a/_ALL_SITES/riso.app/package.json +++ b/_ALL_SITES/riso.app/package.json @@ -1,6 +1,6 @@ { "name": "riso", - "version": "1.0.56", + "version": "1.0.57", "description": "Siamo la Rete Italiana di Scambio Orizzontale, abbiamo creato questa piattaforma per metterla al servizio di chi vuole riscoprire il valore della condivisione e della cooperazione. Valori semplici e profondi che ci aiutano a ritrovare il Senso della Vita, perduto in questa società consumista, e riporti quei Sani Pricìpi Naturali ed Umani di Fratellanza che intere popolazioni antiche conoscevano bene.", "productName": "Riso", "author": "Paolo Arena", diff --git a/package.json b/package.json index 0eebe9e3..0446662b 100755 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "abitaregliiblei", - "version": "1.0.56", + "version": "1.0.57", "description": "Abitare Gli Iblei", "productName": "AbitareGliIblei", "author": "Paolo Arena", diff --git a/src-pwa/custom-service-worker.js b/src-pwa/custom-service-worker.js index fd1862e1..58bb105f 100755 --- a/src-pwa/custom-service-worker.js +++ b/src-pwa/custom-service-worker.js @@ -34,7 +34,7 @@ self.addEventListener('activate', (event) => { }); -const VersioneApp = "1.0.56"; +const VersioneApp = "1.0.57"; console.log(' [ VER-' + VersioneApp + ' ] _---------________------ PAO: this is my custom service worker'); diff --git a/src/db/static_data.ts b/src/db/static_data.ts index 2efff3dd..43cea4ee 100755 --- a/src/db/static_data.ts +++ b/src/db/static_data.ts @@ -68,7 +68,7 @@ function getDynamicPages(site: ISites): IListRoutes[] { infooter: false, }, { - active: true, + active: site.confpages && site.confpages.enableGoods, order: 12, path: '/goods', materialIcon: 'fas fa-tshirt', @@ -79,7 +79,7 @@ function getDynamicPages(site: ISites): IListRoutes[] { infooter: true, }, { - active: true, + active: site.confpages && site.confpages.enableServices, order: 15, path: '/services', materialIcon: 'fas fa-house-user', @@ -90,7 +90,7 @@ function getDynamicPages(site: ISites): IListRoutes[] { infooter: true, }, { - active: true, + active: site.confpages && site.confpages.enableActivities, order: 15, path: '/activities', materialIcon: 'fas fa-house-user', @@ -112,7 +112,7 @@ function getDynamicPages(site: ISites): IListRoutes[] { infooter: false, }, { - active: true, + active: site.confpages && site.confpages.enableHosps, order: 15, path: '/hosps', materialIcon: 'fas fa-bed', @@ -134,7 +134,7 @@ function getDynamicPages(site: ISites): IListRoutes[] { infooter: true, }, { - active: true, + active: site.confpages && site.confpages.enableEvents, order: 20, path: '/events', materialIcon: 'fas fa-bullhorn', @@ -156,7 +156,7 @@ function getDynamicPages(site: ISites): IListRoutes[] { infooter: false, }, { - active: true, + active: site.confpages && site.confpages.showProfile, order: 120, path: '/myprofile', materialIcon: 'fas fa-user', @@ -178,7 +178,7 @@ function getDynamicPages(site: ISites): IListRoutes[] { infooter: false, }, { - active: true, + active: site.confpages && site.confpages.showiscrittiMenu, order: 130, path: '/friends', materialIcon: 'fas fa-user-friends', @@ -209,7 +209,7 @@ function getDynamicPages(site: ISites): IListRoutes[] { meta: { requiresAuth: true, newpage: true }, inmenu: false, infooter: false, - }, + }, { active: true, order: 137, diff --git a/src/index.template.html b/src/index.template.html index f95a17bf..722d852f 100755 --- a/src/index.template.html +++ b/src/index.template.html @@ -10,7 +10,7 @@ - + diff --git a/src/model/GlobalStore.ts b/src/model/GlobalStore.ts index dbc1ceb5..1c847a15 100755 --- a/src/model/GlobalStore.ts +++ b/src/model/GlobalStore.ts @@ -251,6 +251,11 @@ export interface IConfPages { enableTokenExpired: boolean enableDebugOn: boolean enabledRegNeedTelegram: boolean + enableGoods: boolean + enableServices: boolean + enableActivities: boolean + enableHosps: boolean + enableEvents: boolean showViewGroups: boolean showViewEventi: boolean showViewCircuits: boolean @@ -305,7 +310,15 @@ export interface ISites { manageremail?: string replyTo?: string host?: string + host_ip?: string host_test?: string + host_test_ip?: string + host_api?: string + host_api_ip?: string + host_testapi?: string + host_testapi_ip?: string + cf_token?: string + cf_zoneId?: string portapp?: string dir?: string email_from?: string @@ -1284,7 +1297,7 @@ export interface IAttivita { telegram_username: string cell_phone: string whatsapp: string - website: string + website: string //++Todo: Aggiungere ORARI diff --git a/src/rootgen/admin/confsite/confsite.ts b/src/rootgen/admin/confsite/confsite.ts index 0cb33d6d..d87cf49d 100755 --- a/src/rootgen/admin/confsite/confsite.ts +++ b/src/rootgen/admin/confsite/confsite.ts @@ -47,6 +47,10 @@ export default defineComponent({ globalStore.site.confpages.show_darkopt = mycol } } + function updateSite() { + globalStore.loadSite() + } + onMounted(mounted) return { @@ -59,6 +63,7 @@ export default defineComponent({ saveBgCol, globalStore, saveShowDark, + updateSite, } } }) diff --git a/src/rootgen/admin/confsite/confsite.vue b/src/rootgen/admin/confsite/confsite.vue index 8340f5ae..0f8ef977 100755 --- a/src/rootgen/admin/confsite/confsite.vue +++ b/src/rootgen/admin/confsite/confsite.vue @@ -203,24 +203,114 @@ + + + + + + + + + + + + + + + + @@ -234,6 +324,7 @@ field="confsite.options" jointable="confsite_opt" :type="costanti.FieldType.binary" + @save="updateSite" > @@ -573,6 +664,46 @@ :type="costanti.FieldType.boolean" > + + + + + + + + + + @import 'confsite.scss'; + + +{ + "_id" : ObjectId("620a71e194438ecd1acfdbbg"), + "idapp" : "19", + "chiave" : "vers", + "userId" : "ALL", + "valore" : "1.0.57" +} \ No newline at end of file diff --git a/src/statics/lang/it.js b/src/statics/lang/it.js index 72acad62..fb74b80e 100755 --- a/src/statics/lang/it.js +++ b/src/statics/lang/it.js @@ -1116,7 +1116,11 @@ const msg_it = { manageremail: 'Email Gestione', replyTo: 'Reply To', host: 'Host', + host_ip: 'Host IP', host_test: 'Host Test', + host_test_ip: 'Host Test IP', + host_testapi: 'Host TestApi', + host_testapi_ip: 'Host TestApi IP', portapp: 'Porta', dir: 'Dir', dir_test: 'Dir Test', @@ -1627,6 +1631,12 @@ const msg_it = { showViewOrders: 'Bott. Ordini', enablePwa: 'PWA', PDFPromo: 'PDF Presentazione', + enableGoods: 'Menu Beni', + enableServices: 'Menu Servizi', + enableActivities: 'Menu Attività', + enableHosps: 'Menu Ospitalità', + enableEvents: 'Menu Eventi', + enable: 'Beni', }, diff --git a/src/store/Modules/fieldsTable.ts b/src/store/Modules/fieldsTable.ts index b51853a1..98526414 100755 --- a/src/store/Modules/fieldsTable.ts +++ b/src/store/Modules/fieldsTable.ts @@ -1255,9 +1255,9 @@ export const colAttivita = [ numpag_carousel: 3, }), AddCol({ - name: 'coordinate_gps', - label_trans: 'attivita.coordinate_gps', - fieldtype: costanti.FieldType.coordinates, + name: 'coordinate_gps', + label_trans: 'attivita.coordinate_gps', + fieldtype: costanti.FieldType.coordinates, showWhen: costanti.showWhen.NewRec + costanti.showWhen.InPage + costanti.showWhen.InEdit + costanti.showWhen.InView_OnlyifExist, required: false, }), @@ -1875,7 +1875,13 @@ export const colTableSites = [ AddCol({ name: 'manageremail', label_trans: 'sites.manageremail', fieldtype: costanti.FieldType.string }), AddCol({ name: 'replyTo', label_trans: 'sites.replyTo', fieldtype: costanti.FieldType.string }), AddCol({ name: 'host', label_trans: 'sites.host', fieldtype: costanti.FieldType.string }), + AddCol({ name: 'host_ip', label_trans: 'sites.host_ip', fieldtype: costanti.FieldType.string }), AddCol({ name: 'host_test', label_trans: 'sites.host_test', fieldtype: costanti.FieldType.string }), + AddCol({ name: 'host_test_ip', label_trans: 'sites.host_test_ip', fieldtype: costanti.FieldType.string }), + AddCol({ name: 'host_testapi', label_trans: 'sites.host_testapi', fieldtype: costanti.FieldType.string }), + AddCol({ name: 'host_testapi_ip', label_trans: 'sites.host_testapi_ip', fieldtype: costanti.FieldType.string }), + AddCol({ name: 'cf_token', label_trans: 'sites.cf_token', fieldtype: costanti.FieldType.string }), + AddCol({ name: 'cf_zoneId', label_trans: 'sites.cf_zoneId', fieldtype: costanti.FieldType.string }), AddCol({ name: 'portapp', label_trans: 'sites.portapp', fieldtype: costanti.FieldType.string }), AddCol({ name: 'dir', label_trans: 'sites.dir' }), AddCol({ name: 'dir_test', label_trans: 'sites.dir_test', fieldtype: costanti.FieldType.string }), diff --git a/src/store/Modules/tools.ts b/src/store/Modules/tools.ts index 97504fb7..2b089ca1 100644 --- a/src/store/Modules/tools.ts +++ b/src/store/Modules/tools.ts @@ -5235,6 +5235,16 @@ export const tools = { return (site.confpages.enableDebugOn) }, + getDomainSite(): string { + const globalStore = useGlobalStore() + const site = globalStore.site + + if (site) { + return site.host! + } + return '' + }, + isVerified(): boolean { const globalStore = useGlobalStore() const site = globalStore.site @@ -8735,6 +8745,28 @@ export const tools = { return `Coordinate: ${lng}, Lat: ${lat}` } } + }, + + getHostPuntamento(arrDNS: any, tofind: string, paramsulServer: string): any { + let checkDomain = '' + let indrec = arrDNS.findIndex((rec: any) => rec.name === tofind && rec.type === 'A') + let color = 'red' + let ok = false + if (indrec >= 0) { + checkDomain = tofind + ' -> ' + arrDNS[indrec].content + let giusto = (paramsulServer === arrDNS[indrec].content) + color = giusto ? 'green' : 'red' + if (!giusto) { + checkDomain += ' (al posto di -> ' + paramsulServer + ')' + } else { + ok = true + } + } else { + checkDomain = tofind + ' N/A' + } + + return { text: '' + checkDomain + '
', ok } + } // FINE ! diff --git a/src/store/globalStore.ts b/src/store/globalStore.ts index b72f2eef..36b9eb03 100644 --- a/src/store/globalStore.ts +++ b/src/store/globalStore.ts @@ -182,6 +182,11 @@ export const useGlobalStore = defineStore('GlobalStore', { enableRegMultiChoice: false, enableTokenExpired: false, enabledRegNeedTelegram: false, + enableGoods: false, + enableServices: false, + enableActivities: false, + enableHosps: false, + enableEvents: false, enableDebugOn: false, showButtHome: false, showViewGroups: false, @@ -2032,6 +2037,10 @@ export const useGlobalStore = defineStore('GlobalStore', { return await this.DeleteRec({ table: 'myelems', id: myelem._id }).then((ris) => { if (ris) { this.myelems = this.myelems.filter((rec) => rec._id !== myelem._id) + + // Aggiorna anche tutto il sito... + this.loadSite() + tools.showPositiveNotif($q, t('db.deletedrecord')) } else { tools.showNegativeNotif($q, t('db.recdelfailed')) @@ -2058,6 +2067,10 @@ export const useGlobalStore = defineStore('GlobalStore', { return await this.saveTable(mydata) .then((ris) => { if (ris) { + + // Aggiorna anche tutto il sito... + this.loadSite() + tools.showPositiveNotif($q, t('db.recupdated')) } else { tools.showNegativeNotif($q, t('db.recfailed')) diff --git a/src/views/admin/server/server.ts b/src/views/admin/server/server.ts index 38e917bc..13264a79 100755 --- a/src/views/admin/server/server.ts +++ b/src/views/admin/server/server.ts @@ -29,6 +29,8 @@ export default defineComponent({ const inputRequired = ref(false) const inputPrompt = ref('') const statusWs = ref('') + const rischeckDNS = ref('') + const errorDNS = ref(false) let ws: any = null; @@ -61,6 +63,7 @@ export default defineComponent({ const selectedApi = ref(''); const dnsPageActive = ref(false) + const dnsCheckMySite = ref(false) const optionsApi = ref([]) const arrZones = ref([]) @@ -83,6 +86,8 @@ export default defineComponent({ { name: 'name', required: true, label: 'Nome', align: 'left', field: 'name', sortable: true, visible: true }, { name: 'type', required: true, label: 'Tipo', align: 'left', field: 'type', sortable: true, visible: true }, { name: 'proxied', required: true, align: 'center', label: 'Proxy', field: 'proxied', sortable: true, visible: true }, + { name: 'priority', required: true, align: 'center', label: 'Priorità', field: 'priority', sortable: true, visible: true }, + { name: 'ttl', required: true, align: 'center', label: 'TTL', field: 'ttl', sortable: false, visible: true }, { name: 'content', required: true, label: 'Valore', align: 'left', field: 'content', sortable: true, visible: true }, ]; @@ -90,6 +95,8 @@ export default defineComponent({ { name: 'name', required: true, label: 'Nome', align: 'left', field: 'name', sortable: true, visible: true, editable: true }, { name: 'type', required: true, label: 'Tipo', align: 'left', field: 'type', sortable: true, visible: true, editable: true }, { name: 'proxied', required: true, align: 'center', label: 'Proxy', field: 'proxied', sortable: true, visible: true, editable: true }, + { name: 'priority', required: true, align: 'center', label: 'Priorità', field: 'priority', sortable: true, visible: true }, + { name: 'ttl', required: true, align: 'center', label: 'TTL', field: 'ttl', sortable: false, visible: true }, { name: 'content', required: true, label: 'Valore', align: 'left', field: 'content', sortable: true, visible: true, editable: true }, ]; @@ -118,24 +125,6 @@ export default defineComponent({ } }) - watch(() => selZoneId.value, async (to: any, from: any) => { - if (selZoneId.value) { - incaricamento.value = true - arrDNS.value = await globalStore.getCloudFlareTok("getDNS", selectedApi.value, selZoneId.value) - - incaricamento.value = false - - tools.setCookie('CF_API_ZONE_ID_' + selectedApi.value, selZoneId.value) - - /*optDNS.value = [] - - for (let i = 0; i < arrZones.value.length; i++) { - optDNS.value.push({ label: arrZones.value[i].name, value: arrZones.value[i].id }) - }*/ - - } - }) - watch(() => mydir.value, async (to: any, from: any) => { // ... @@ -143,6 +132,8 @@ export default defineComponent({ myarrscript.value = [] + optionsApi.value = [] + dnsPageActive.value = (mydir.value === '2_DNS') incaricamento.value = true @@ -160,6 +151,37 @@ export default defineComponent({ incaricamento.value = false }) + async function updateArrDns() { + arrDNS.value = [] + arrDNS.value = await globalStore.getCloudFlareTok("getDNS", selectedApi.value, selZoneId.value) + } + + watch(() => selZoneId.value, async (to: any, from: any) => { + if (selZoneId.value) { + incaricamento.value = true + await updateArrDns() + + const checksiteprec = dnsCheckMySite.value + + dnsCheckMySite.value = dnsPageActive.value && (getNameBySelZoneinId() === tools.getDomainSite()) + + if (dnsCheckMySite.value && !checksiteprec) { + await checkDNSSite() + } + + incaricamento.value = false + + tools.setCookie('CF_API_ZONE_ID_' + selectedApi.value, selZoneId.value) + + /*optDNS.value = [] + + for (let i = 0; i < arrZones.value.length; i++) { + optDNS.value.push({ label: arrZones.value[i].name, value: arrZones.value[i].id }) + }*/ + + } + }) + watch(() => messages.value, async (to: any, from: any) => { await nextTick(); // Aspetta che il DOM si aggiorni scrollToBottom(); @@ -209,6 +231,7 @@ export default defineComponent({ } async function mounted() { + myarrdir.value = await getArrayByScript('cd admin_scripts; ls -d */', '') myarroptionsdir.value = [] @@ -389,6 +412,24 @@ export default defineComponent({ await saveRecordDNS(arrDNS.value[indrec]) } } + const saveTTLDNS = async (ttl: string, initialValue: string) => { + + if (selected.value && selected.value.length > 0 && selected.value[0].id) { + const indrec = arrDNS.value.findIndex((rec: any) => rec.id === selected.value[0].id) + arrDNS.value[indrec].ttl = ttl + + await saveRecordDNS(arrDNS.value[indrec]) + } + } + const savePriorityDNS = async (priority: string, initialValue: string) => { + + if (selected.value && selected.value.length > 0 && selected.value[0].id) { + const indrec = arrDNS.value.findIndex((rec: any) => rec.id === selected.value[0].id) + arrDNS.value[indrec].priority = priority + + await saveRecordDNS(arrDNS.value[indrec]) + } + } const saveTypeDNS = async (type: string, initialValue: string) => { if (selected.value && selected.value.length > 0 && selected.value[0].id) { @@ -399,6 +440,17 @@ export default defineComponent({ } } + const setCorrectIpsOnDNS = async () => { + + let myrecord = { + name: tools.getDomainSite() + } + await globalStore.getCloudFlareTok("setCorrectIpsOnDNS", selectedApi.value, selZoneId.value, null, myrecord) + + await checkDNSSite() + } + + const saveRecordDNS = async (row: any) => { console.log('record da salvare su CF:', row) @@ -417,6 +469,44 @@ export default defineComponent({ } + async function checkDNSSite() { + incaricamento.value = true + await updateArrDns() + await globalStore.loadSite() + + rischeckDNS.value = '
' + errorDNS.value = false + + const domainSite = tools.getDomainSite(); + const domains = [ + domainSite, + 'api.' + domainSite, + 'test.' + domainSite, + 'testapi.' + domainSite + ]; + + const ips = [ + globalStore.site.host_ip, + globalStore.site.host_api_ip, + globalStore.site.host_test_ip, + globalStore.site.host_testapi_ip + ]; + + if (dnsPageActive.value) { + let checkDomainA1 = ''; + errorDNS.value = false + for (let i = 0; i < domains.length; i++) { + let ris = tools.getHostPuntamento(arrDNS.value, domains[i], ips[i]!) + checkDomainA1 += ris.text + if (!ris.ok) { + errorDNS.value = true + } + } + rischeckDNS.value = checkDomainA1 + } + + incaricamento.value = false + } onMounted(mounted) return { @@ -468,6 +558,14 @@ export default defineComponent({ saveContentDNS, saveNameDNS, saveTypeDNS, + saveTTLDNS, + savePriorityDNS, + dnsCheckMySite, + checkDNSSite, + rischeckDNS, + globalStore, + setCorrectIpsOnDNS, + errorDNS, } }, }) diff --git a/src/views/admin/server/server.vue b/src/views/admin/server/server.vue index e90f3d2d..45cb83f8 100755 --- a/src/views/admin/server/server.vue +++ b/src/views/admin/server/server.vue @@ -63,6 +63,25 @@ +
+ + +
+ + +
+
+ + + + + +