- Cloudflare e configurazione dominio DNS (host, host_test, host_ip, ecc...)

This commit is contained in:
Surya Paolo
2024-09-09 21:49:31 +02:00
parent e9ac281125
commit 16ddb8095e
39 changed files with 438 additions and 64 deletions

View File

@@ -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"

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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"

View File

@@ -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

View File

@@ -1,6 +1,6 @@
{
"name": "abitaregliiblei",
"version": "1.0.56",
"version": "1.0.57",
"description": "Abitare Gli Iblei",
"productName": "AbitareGliIblei",
"author": "Paolo Arena",

View File

@@ -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"

View File

@@ -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

View File

@@ -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",

View File

@@ -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"

View File

@@ -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

View File

@@ -1,6 +1,6 @@
{
"name": "gruppomacro",
"version": "1.0.56",
"version": "1.0.57",
"description": "GruppoMacro",
"productName": "Gruppo Macro",
"author": "Paolo Arena",

View File

@@ -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"

View File

@@ -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

View File

@@ -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',

View File

@@ -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"

View File

@@ -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

View File

@@ -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

View File

@@ -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",

View File

@@ -1,6 +1,6 @@
{
"name": "abitaregliiblei",
"version": "1.0.56",
"version": "1.0.57",
"description": "Abitare Gli Iblei",
"productName": "AbitareGliIblei",
"author": "Paolo Arena",

View File

@@ -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');

View File

@@ -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',

View File

@@ -10,7 +10,7 @@
<meta name="description" content="<%= productDescription %>">
<meta name="format-detection" content="telephone=no">
<meta name="msapplication-tap-highlight" content="no">
<meta name="version" content="1.0.56">
<meta name="version" content="1.0.57">
<meta name="viewport"
content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width<% if (ctx.mode.cordova || ctx.mode.capacitor) { %>, viewport-fit=cover<% } %>">

View File

@@ -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

View File

@@ -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,
}
}
})

View File

@@ -203,24 +203,114 @@
</q-tab-panel>
<q-tab-panel name="server">
<CMyFieldDb
title="Host"
:title="$t('site.cf_token')"
table="sites"
:id="mysite._id"
:rec="mysite"
mykey="cf_token"
debounce="1000"
:type="costanti.FieldType.string"
@save="updateSite"
>
</CMyFieldDb>
<CMyFieldDb
:title="$t('site.cf_zoneId')"
table="sites"
:id="mysite._id"
:rec="mysite"
mykey="cf_zoneId"
debounce="1000"
:type="costanti.FieldType.string"
@save="updateSite"
>
</CMyFieldDb>
<CMyFieldDb
:title="$t('site.host')"
table="sites"
:id="mysite._id"
:rec="mysite"
mykey="host"
debounce="1000"
:type="costanti.FieldType.string"
@save="updateSite"
>
</CMyFieldDb>
<CMyFieldDb
:title="$t('site.host_ip')"
table="sites"
:id="mysite._id"
:rec="mysite"
mykey="host_ip"
debounce="1000"
:type="costanti.FieldType.string"
@save="updateSite"
>
</CMyFieldDb>
<CMyFieldDb
title="Host Test"
:title="$t('site.host_api')"
table="sites"
:id="mysite._id"
:rec="mysite"
mykey="host_api"
debounce="1000"
:type="costanti.FieldType.string"
@save="updateSite"
>
</CMyFieldDb>
<CMyFieldDb
:title="$t('site.host_api_ip')"
table="sites"
:id="mysite._id"
:rec="mysite"
mykey="host_api_ip"
debounce="1000"
:type="costanti.FieldType.string"
@save="updateSite"
>
</CMyFieldDb>
<CMyFieldDb
:title="$t('site.host_testapi')"
table="sites"
:id="mysite._id"
:rec="mysite"
mykey="host_testapi"
debounce="1000"
:type="costanti.FieldType.string"
@save="updateSite"
>
</CMyFieldDb>
<CMyFieldDb
:title="$t('site.host_testapi_ip')"
table="sites"
:id="mysite._id"
:rec="mysite"
mykey="host_testapi_ip"
debounce="1000"
:type="costanti.FieldType.string"
@save="updateSite"
>
</CMyFieldDb>
<CMyFieldDb
:title="$t('site.host_test')"
table="sites"
:id="mysite._id"
:rec="mysite"
mykey="host_test"
debounce="1000"
:type="costanti.FieldType.string"
@save="updateSite"
>
</CMyFieldDb>
<CMyFieldDb
:title="$t('site.host_test_ip')"
table="sites"
:id="mysite._id"
:rec="mysite"
mykey="host_test_ip"
debounce="1000"
:type="costanti.FieldType.string"
@save="updateSite"
>
</CMyFieldDb>
@@ -234,6 +324,7 @@
field="confsite.options"
jointable="confsite_opt"
:type="costanti.FieldType.binary"
@save="updateSite"
>
</CMyFieldDb>
</q-tab-panel>
@@ -573,6 +664,46 @@
:type="costanti.FieldType.boolean"
>
</CMyFieldDb>
<CMyFieldDb
table="sites"
:title="$t('confpages.enableGoods')"
:id="mysite._id"
:rec="mysite"
mykey="confpages"
mysubkey="enableGoods"
:type="costanti.FieldType.boolean"
>
</CMyFieldDb>
<CMyFieldDb
table="sites"
:title="$t('confpages.enableServices')"
:id="mysite._id"
:rec="mysite"
mykey="confpages"
mysubkey="enableServices"
:type="costanti.FieldType.boolean"
>
</CMyFieldDb>
<CMyFieldDb
table="sites"
:title="$t('confpages.enableActivities')"
:id="mysite._id"
:rec="mysite"
mykey="confpages"
mysubkey="enableActivities"
:type="costanti.FieldType.boolean"
>
</CMyFieldDb>
<CMyFieldDb
table="sites"
:title="$t('confpages.enableHosps')"
:id="mysite._id"
:rec="mysite"
mykey="confpages"
mysubkey="enableHosps"
:type="costanti.FieldType.boolean"
>
</CMyFieldDb>
<CMyFieldDb
table="sites"
:title="$t('confpages.enableGroups')"
@@ -583,6 +714,16 @@
:type="costanti.FieldType.boolean"
>
</CMyFieldDb>
<CMyFieldDb
table="sites"
:title="$t('confpages.enableEvents')"
:id="mysite._id"
:rec="mysite"
mykey="confpages"
mysubkey="enableEvents"
:type="costanti.FieldType.boolean"
>
</CMyFieldDb>
<CMyFieldDb
table="sites"
:title="$t('confpages.enableCircuits')"
@@ -839,3 +980,12 @@
<style lang="scss" scoped>
@import 'confsite.scss';
</style>
{
"_id" : ObjectId("620a71e194438ecd1acfdbbg"),
"idapp" : "19",
"chiave" : "vers",
"userId" : "ALL",
"valore" : "1.0.57"
}

View File

@@ -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',
},

View File

@@ -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 }),

View File

@@ -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 += ' (<strong>al posto di -> ' + paramsulServer + '</strong>)'
} else {
ok = true
}
} else {
checkDomain = tofind + ' N/A'
}
return { text: '<span style="color: ' + color + ';">' + checkDomain + '</span><br>', ok }
}
// FINE !

View File

@@ -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'))

View File

@@ -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(<string>'');
const dnsPageActive = ref(false)
const dnsCheckMySite = ref(false)
const optionsApi = ref(<any>[])
const arrZones = ref(<any>[])
@@ -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 = '<br>'
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,
}
},
})

View File

@@ -63,6 +63,25 @@
</div>
</div>
<div v-if="dnsCheckMySite && !incaricamento">
<q-btn
class=""
:label="'Controllo DNS sito ' + tools.getDomainSite()"
color="positive"
@click="checkDNSSite"
>
</q-btn>
<div v-if="rischeckDNS" v-html="rischeckDNS"></div>
<q-btn
v-if="errorDNS"
class=""
:label="'Correggi sito ' + tools.getDomainSite()"
color="negative"
@click="setCorrectIpsOnDNS"
>
</q-btn>
</div>
<div v-if="dnsPageActive" class="">
<div>
<q-select
@@ -147,6 +166,34 @@
autogrow
/>
</q-popup-edit>
<q-popup-edit
v-if="col.name === 'priority'"
v-model="props.row.priority"
v-slot="scope"
buttons
@save="savePriorityDNS"
>
<q-input
type="textarea"
v-model="scope.value"
autofocus
autogrow
/>
</q-popup-edit>
<q-popup-edit
v-if="col.name === 'ttl'"
v-model="props.row.ttl"
v-slot="scope"
buttons
@save="saveTTLDNS"
>
<q-input
type="textarea"
v-model="scope.value"
autofocus
autogrow
/>
</q-popup-edit>
<!--<q-popup-edit
v-if="col.name === 'type'"
@@ -165,9 +212,9 @@
<q-toggle
v-if="col.name === 'proxied'"
v-show="props.row.proxiable === true"
v-model="props.row.proxied"
label="Proxy"
:disable="props.row.proxiable !== true"
label=""
@click.stop="
props.row.proxiable === true
? saveRecordDNS(props.row)