@opengis/gis 0.2.7 → 0.2.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.css +1 -1
- package/dist/index.js +3609 -3206
- package/dist/index.umd.cjs +39 -39
- package/module/gis/table/gis.services.table.json +8 -3
- package/module/test/cls/doc_status.json +31 -31
- package/module/test/map/mbd.json +1 -1
- package/module/test/select/core.user_uid.sql +1 -1
- package/package.json +2 -2
- package/server/plugins/vite.js +9 -8
- package/server/routes/map/maps/get.map.js +18 -4
|
@@ -26,7 +26,8 @@
|
|
|
26
26
|
"ua": "Назва",
|
|
27
27
|
"meta": "title",
|
|
28
28
|
"name": "name",
|
|
29
|
-
"link": "/service/{id}",
|
|
29
|
+
"link": "/service/{id}",
|
|
30
|
+
"width": 200,
|
|
30
31
|
"format": "text"
|
|
31
32
|
},
|
|
32
33
|
{
|
|
@@ -35,14 +36,15 @@
|
|
|
35
36
|
"edit":true,
|
|
36
37
|
"width": 300,
|
|
37
38
|
"format": "text"
|
|
39
|
+
|
|
38
40
|
},
|
|
39
41
|
{
|
|
40
42
|
"ua": "Група",
|
|
41
43
|
"name": "group_id",
|
|
42
|
-
"width":
|
|
44
|
+
"width": 220,
|
|
43
45
|
"edit":true,
|
|
44
46
|
"data": "gis.group_list",
|
|
45
|
-
"format": "
|
|
47
|
+
"format": "badge"
|
|
46
48
|
},
|
|
47
49
|
{
|
|
48
50
|
"ua": "Ключові слова",
|
|
@@ -67,6 +69,7 @@
|
|
|
67
69
|
"ua": "Публічний",
|
|
68
70
|
"name": "is_public",
|
|
69
71
|
"edit":true,
|
|
72
|
+
"width": 100,
|
|
70
73
|
"format": "boolean"
|
|
71
74
|
},
|
|
72
75
|
{
|
|
@@ -74,6 +77,7 @@
|
|
|
74
77
|
"name": "is_active",
|
|
75
78
|
"data": "yes_no",
|
|
76
79
|
"edit":true,
|
|
80
|
+
"width": 100,
|
|
77
81
|
"format": "boolean"
|
|
78
82
|
},
|
|
79
83
|
{
|
|
@@ -81,6 +85,7 @@
|
|
|
81
85
|
"name": "is_downloadable",
|
|
82
86
|
"data": "yes_no",
|
|
83
87
|
"edit":true,
|
|
88
|
+
"width": 180,
|
|
84
89
|
"format": "boolean"
|
|
85
90
|
}
|
|
86
91
|
],
|
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
[
|
|
2
|
-
{
|
|
3
|
-
"id": "1",
|
|
4
|
-
"text": "Діючий",
|
|
5
|
-
"color": "#1ab394"
|
|
6
|
-
},
|
|
7
|
-
{
|
|
8
|
-
"id": "2",
|
|
9
|
-
"text": "Зупинений",
|
|
10
|
-
"color": "#ed82c8"
|
|
11
|
-
},
|
|
12
|
-
{
|
|
13
|
-
"id": "3",
|
|
14
|
-
"text": "Скасований",
|
|
15
|
-
"color": "#4a4a4a"
|
|
16
|
-
},
|
|
17
|
-
{
|
|
18
|
-
"id": "5",
|
|
19
|
-
"text": "Проектний",
|
|
20
|
-
"color": "#6495ed"
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
"id": "7",
|
|
24
|
-
"text": "Очікує розгляду",
|
|
25
|
-
"color": "#92b8ef"
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
"id": "10",
|
|
29
|
-
"text": "Архівний",
|
|
30
|
-
"color": "#d48428"
|
|
31
|
-
}
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"id": "1",
|
|
4
|
+
"text": "Діючий",
|
|
5
|
+
"color": "#1ab394"
|
|
6
|
+
},
|
|
7
|
+
{
|
|
8
|
+
"id": "2",
|
|
9
|
+
"text": "Зупинений",
|
|
10
|
+
"color": "#ed82c8"
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"id": "3",
|
|
14
|
+
"text": "Скасований",
|
|
15
|
+
"color": "#4a4a4a"
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"id": "5",
|
|
19
|
+
"text": "Проектний",
|
|
20
|
+
"color": "#6495ed"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"id": "7",
|
|
24
|
+
"text": "Очікує розгляду",
|
|
25
|
+
"color": "#92b8ef"
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"id": "10",
|
|
29
|
+
"text": "Архівний",
|
|
30
|
+
"color": "#d48428"
|
|
31
|
+
}
|
|
32
32
|
]
|
package/module/test/map/mbd.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
select uid, coalesce(coalesce(sur_name,'')||coalesce(' '||user_name,'') ||coalesce(' '||father_name,''),login) as text from admin.users
|
|
1
|
+
select uid, coalesce(coalesce(sur_name,'')||coalesce(' '||user_name,'') ||coalesce(' '||father_name,''),login) as text from admin.users
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opengis/gis",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.8",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"author": "Softpro",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@opengis/core": "^0.0.23",
|
|
47
|
-
"@opengis/fastify-table": "^2.0.
|
|
47
|
+
"@opengis/fastify-table": "^2.0.43",
|
|
48
48
|
"@opengis/filter": "^0.1.11",
|
|
49
49
|
"@opengis/form": "^0.0.48",
|
|
50
50
|
"@opengis/table": "^0.0.27",
|
package/server/plugins/vite.js
CHANGED
|
@@ -26,14 +26,14 @@ async function plugin(fastify, opts) {
|
|
|
26
26
|
});
|
|
27
27
|
|
|
28
28
|
// this is middleware for vite's dev server
|
|
29
|
-
fastify.addHook('onRequest', async (
|
|
30
|
-
const { user } =
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}
|
|
29
|
+
fastify.addHook('onRequest', async (req, reply) => {
|
|
30
|
+
const { user } = req.session?.passport || {};
|
|
31
|
+
// console.log(req.url);
|
|
32
|
+
|
|
34
33
|
const next = () => new Promise((resolve) => {
|
|
35
|
-
viteServer.middlewares(
|
|
34
|
+
viteServer.middlewares(req.raw, reply.raw, () => resolve());
|
|
36
35
|
});
|
|
36
|
+
|
|
37
37
|
await next();
|
|
38
38
|
});
|
|
39
39
|
}
|
|
@@ -61,8 +61,9 @@ async function plugin(fastify, opts) {
|
|
|
61
61
|
|
|
62
62
|
fastify.get('*', async (req, reply) => {
|
|
63
63
|
const { user } = req.session?.passport || {};
|
|
64
|
-
|
|
65
|
-
|
|
64
|
+
// console.log(req.url);
|
|
65
|
+
if (!user && req.url !== '/login') {
|
|
66
|
+
return reply.redirect('/login');
|
|
66
67
|
}
|
|
67
68
|
if (!isProduction) return null; // admin vite
|
|
68
69
|
const stream = fs.createReadStream('admin/dist/index.html');
|
|
@@ -43,14 +43,28 @@ export default async function getMap({ params = {}, pg = pgClients.client }, rep
|
|
|
43
43
|
|
|
44
44
|
const obj = loadTemplate;
|
|
45
45
|
|
|
46
|
+
const layers = [];
|
|
47
|
+
|
|
48
|
+
if (Array.isArray(obj?.ogc) && obj.ogc.length && ['string', 'number'].includes(typeof obj.ogc[0])) {
|
|
49
|
+
await Promise.all(obj.ogc.map(async (layer) => {
|
|
50
|
+
const ogcData = await pg.query('select ogc_service_id as id, url as service_url, * from gis.ogc_service where ogc_service_id=$1', [layer]).then(el => el.rows?.[0]);
|
|
51
|
+
layers.push({
|
|
52
|
+
...(ogcData || {}), id: layer, /* center: [], bbox: null, filters: [], style: { color: 'red' }, */ visible: !!ogcData, type: 'ogc',
|
|
53
|
+
});
|
|
54
|
+
}));
|
|
55
|
+
}
|
|
56
|
+
|
|
46
57
|
if (Array.isArray(obj?.layers) && typeof obj?.layers?.[0] === 'string') {
|
|
47
|
-
|
|
58
|
+
await Promise.all(obj.layers.map(async (layer) => {
|
|
48
59
|
const layerData = await getTemplate('layer', layer);
|
|
49
60
|
const serviceData = layerData || await pg.query('select service_id as id, *, st_asgeojson(bbox)::json as bbox, st_asgeojson(center)::json as center from gis.services where service_id=$1', [layer]).then(el => el.rows?.[0]);
|
|
50
|
-
Object.assign(serviceData, { count: totals[serviceData
|
|
51
|
-
serviceData.style = typeof serviceData.style === 'object' ? serviceData.style : yaml.load(serviceData.style);
|
|
52
|
-
|
|
61
|
+
Object.assign(serviceData || {}, { count: totals[serviceData?.source_path || ''] || 0 });
|
|
62
|
+
if (serviceData) { serviceData.style = typeof serviceData.style === 'object' ? serviceData.style : yaml.load(serviceData.style); }
|
|
63
|
+
layers.push({ ...(serviceData || {}), id: layer, visible: !!serviceData });
|
|
53
64
|
}));
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
if (obj?.layers || obj?.ogc) {
|
|
54
68
|
return {
|
|
55
69
|
maps, ...rows[0], ...obj, layers,
|
|
56
70
|
};
|