@opengis/gis 0.2.19 → 0.2.21

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.
@@ -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
  ]
@@ -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.19",
3
+ "version": "0.2.21",
4
4
  "type": "module",
5
5
  "author": "Softpro",
6
6
  "main": "./dist/index.js",
@@ -48,7 +48,7 @@
48
48
  "@opengis/core": "^0.0.23",
49
49
  "@opengis/fastify-table": "^2.0.114",
50
50
  "@opengis/filter": "^0.1.25",
51
- "@opengis/form": "^0.0.48",
51
+ "@opengis/form": "^0.0.91",
52
52
  "@opengis/table": "^0.0.27",
53
53
  "@vitejs/plugin-vue": "^5.2.3",
54
54
  "axios": "^1.11.0",
@@ -0,0 +1,29 @@
1
+ import { pgClients } from '@opengis/fastify-table/utils.js';
2
+
3
+ export default async function getDashboard({ pg = pgClients.client }) {
4
+ try {
5
+ const statsQuery = `
6
+ SELECT
7
+ (SELECT COUNT(*)::int FROM gis.services) as services_count,
8
+ (SELECT COUNT(*)::int FROM gis.registers) as registers_count,
9
+ (SELECT COUNT(*)::int FROM gis.maps) as maps_count,
10
+ (SELECT COUNT(*)::int FROM gis.ogc_service) as ogc_count
11
+ `;
12
+
13
+ const result = await pg.query(statsQuery);
14
+ const stats = result?.rows?.[0] || {};
15
+
16
+ return {
17
+ cards: {
18
+ services: stats.services_count || 0,
19
+ registers: stats.registers_count || 0,
20
+ maps: stats.maps_count || 0,
21
+ ogc: stats.ogc_count || 0,
22
+ },
23
+ };
24
+ }
25
+ catch (error) {
26
+ console.error('Dashboard error:', error);
27
+ return { status: 500, error: 'Internal Server Error' };
28
+ }
29
+ }
@@ -15,6 +15,7 @@ import deleteGisRegistry from './registers/del.registry.js';
15
15
  import getServicesCol from './services/get.services.col.js';
16
16
  import legendAuto from './services/legend.auto.js';
17
17
  import mapInfoPoint from './ogc/map.info.point.js';
18
+ import getDashboard from './dashboard.js';
18
19
 
19
20
  const mapInfoPointSchema = {
20
21
  querystring: {
@@ -54,6 +55,7 @@ async function route(app) {
54
55
  app.get('/legend-auto/:id', { config: { policy: ['public'] } }, legendAuto);
55
56
 
56
57
  app.get('/map-info-point', { config: { policy: ['public'] }, schema: mapInfoPointSchema }, mapInfoPoint);
57
- }
58
58
 
59
+ app.get('/dashboard', { config: { policy: ['public'] } }, getDashboard);
60
+ }
59
61
  export default route;