- attivita
- gestione degli script sul server - creato websocket per interagire con gli script del server.
This commit is contained in:
@@ -1212,16 +1212,9 @@ export const colAttivita = [
|
||||
// inline: true,
|
||||
// typeobj: 'radio',
|
||||
}),
|
||||
AddCol({
|
||||
name: 'nome_attivita',
|
||||
label_trans: 'attivita.nome_attivita',
|
||||
fieldtype: costanti.FieldType.string,
|
||||
maxlength: 100,
|
||||
required: true,
|
||||
}),
|
||||
AddCol({
|
||||
name: 'descr',
|
||||
label_trans: 'proj.shortdescr',
|
||||
label_trans: 'attivita.descr',
|
||||
fieldtype: costanti.FieldType.string,
|
||||
maxlength: 300,
|
||||
required: true,
|
||||
@@ -1254,7 +1247,7 @@ export const colAttivita = [
|
||||
}),
|
||||
|
||||
AddCol({
|
||||
name: 'note', label_trans: 'proj.descrapprof', fieldtype: costanti.FieldType.html,
|
||||
name: 'note', label_trans: 'attivita.note', fieldtype: costanti.FieldType.html,
|
||||
showWhen: costanti.showWhen.NewRec + costanti.showWhen.InEdit + costanti.showWhen.InView_OnlyifExist,
|
||||
titlepopupedit: 'Dettagli', field_extra1: 'username', subfield_extra1: '',
|
||||
required: false,
|
||||
@@ -4397,14 +4390,14 @@ export const fieldsTable = {
|
||||
},
|
||||
{
|
||||
value: 'skills',
|
||||
label: 'Competenze',
|
||||
label: 'Sottocategorie Competenze',
|
||||
columns: colSkills,
|
||||
colkey: '_id',
|
||||
collabel: 'descr',
|
||||
},
|
||||
{
|
||||
value: 'goods',
|
||||
label: 'Beni',
|
||||
label: 'Sottocategorie Beni',
|
||||
columns: colGoods,
|
||||
colkey: '_id',
|
||||
collabel: 'descr',
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import { tools } from "./tools";
|
||||
|
||||
// geocoding.ts
|
||||
export const getCityFromCoordinates = async (lat: number, lon: number): Promise<string | null> => {
|
||||
const url = `https://nominatim.openstreetmap.org/reverse?lat=${lat}&lon=${lon}&format=json`;
|
||||
@@ -17,3 +19,12 @@ export const getCityFromCoordinates = async (lat: number, lon: number): Promise<
|
||||
}
|
||||
};
|
||||
|
||||
export const getMapBoundaries = (): any => {
|
||||
const ne = tools.getCookie(tools.COOK_MAPBOUNDS + 'ne', '{"lat": 20, "lng": 30}', false)
|
||||
const sw = tools.getCookie(tools.COOK_MAPBOUNDS + 'sw', '{"lat": 25, "lng": 35}', false)
|
||||
|
||||
// console.log('getMapBoundaries', ne, sw)
|
||||
|
||||
return { ne, sw }
|
||||
};
|
||||
|
||||
@@ -74,12 +74,15 @@ export const tools = {
|
||||
COOK_MAP_CENTER_LONG: 'MAP_LONG',
|
||||
COOK_MAP_ZOOM: 'MAP_Z',
|
||||
COOK_CATEGORIA: 'CATEG',
|
||||
COOK_MAPBOUNDS: 'MAP-B',
|
||||
|
||||
FRIENDS_SEARCH: 'FR_SE',
|
||||
GROUP_SEARCH: 'GR_SE',
|
||||
CIRCUIT_SEARCH: 'CI_SE',
|
||||
CIRCUIT_USE: 'CIR_U',
|
||||
|
||||
BUTT_ADDREC: 1,
|
||||
|
||||
getprefCountries: ['it', 'es', 'us'],
|
||||
|
||||
APORTADOR_NONE: '------',
|
||||
@@ -2148,9 +2151,10 @@ export const tools = {
|
||||
},
|
||||
|
||||
strToObj(mystr: string): any {
|
||||
if (mystr)
|
||||
if (mystr) {
|
||||
mystr = decodeURIComponent(mystr)
|
||||
return JSON.parse(mystr)
|
||||
else
|
||||
} else
|
||||
return null
|
||||
},
|
||||
|
||||
@@ -4407,6 +4411,13 @@ export const tools = {
|
||||
getvers() {
|
||||
return process.env.APP_VERSION
|
||||
},
|
||||
getWssUrl(): string | URL {
|
||||
let myurl = process.env.APP_URL!
|
||||
if (myurl)
|
||||
return myurl.replace(/(https?:\/\/[^:]+):\d+/, `$1:3000`).replace(/^http/, 'wss');
|
||||
else
|
||||
return ''
|
||||
},
|
||||
getheaders() {
|
||||
const userStore = useUserStore()
|
||||
return [{ name: 'x-auth', value: userStore.x_auth_token }, { name: 'x-refrtok', value: userStore.refreshToken }]
|
||||
@@ -8709,6 +8720,21 @@ export const tools = {
|
||||
console.error('Errore durante la conversione:', error);
|
||||
return 0
|
||||
}
|
||||
},
|
||||
|
||||
getLabelAddrec(ind: any) {
|
||||
return (ind >= 0) ? translate('grid.newrecord') + ` ` + costanti.MAINCARDS[ind].strsingolo : ''
|
||||
},
|
||||
|
||||
getCoordinatesToShow(coordinate_gps: any) {
|
||||
|
||||
if (coordinate_gps) {
|
||||
if (coordinate_gps.coordinates) {
|
||||
const lng = coordinate_gps.coordinates[0]
|
||||
const lat = coordinate_gps.coordinates[1]
|
||||
return `Coordinate: ${lng}, Lat: ${lat}`
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// FINE !
|
||||
|
||||
Reference in New Issue
Block a user