@opengis/gis 0.2.166 → 0.2.168

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,9 +1,9 @@
1
1
  import { defineComponent as te, resolveDirective as We, openBlock as u, createElementBlock as m, createElementVNode as n, Fragment as W, renderList as X, toDisplayString as d, withDirectives as we, createTextVNode as Xe, normalizeClass as ae, ref as $, watch as S, computed as h, vModelText as Ke, onMounted as Ye, onBeforeUnmount as Ze, createCommentVNode as q, createVNode as B, withCtx as He, createBlock as F, resolveDynamicComponent as Je } from "vue";
2
2
  import { useRouter as et, useRoute as tt } from "vue-router";
3
3
  import { TooltipDirective as st, notify as M } from "@opengis/core";
4
- import { _ as nt, u as lt, f as rt, M as ot, i as it, j as be, F as at } from "./index-ClqqnPEd.js";
5
- import { _ as ut, a as ct, b as dt, c as ft } from "./HeaderActions.vue_vue_type_script_setup_true_lang-D3oMTMO0.js";
6
- import { _ as he } from "./ExtentOutlineLayer.vue_vue_type_script_setup_true_lang-L9BfGfUU.js";
4
+ import { _ as nt, u as lt, f as rt, M as ot, i as it, j as be, F as at } from "./index-C3bl1qBS.js";
5
+ import { _ as ut, a as ct, b as dt, c as ft } from "./HeaderActions.vue_vue_type_script_setup_true_lang-D1iwSeRN.js";
6
+ import { _ as he } from "./ExtentOutlineLayer.vue_vue_type_script_setup_true_lang-B-6axJUY.js";
7
7
  const mt = { class: "flex-1 overflow-y-auto p-4 sm:p-6" }, pt = { class: "space-y-3" }, gt = { class: "bg-white p-3 rounded-xl border border-gray-200 shadow-sm" }, yt = { class: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-2" }, vt = { class: "text-xs text-gray-500 mb-1" }, xt = {
8
8
  key: 0,
9
9
  class: "text-base text-md font-semibold text-gray-900"
@@ -2,9 +2,9 @@ import { defineComponent as B, mergeModels as j, useModel as S, computed as h, d
2
2
  import { useRoute as Z, useRouter as ee } from "vue-router";
3
3
  import { notify as F } from "@opengis/core";
4
4
  import { _ as te } from "./TableFormHeader.vue_vue_type_script_setup_true_lang-Mci_tseM.js";
5
- import { V as N } from "./vs-datatable-C27Dlfo3.js";
6
- import { _ as z, n as R, m as E, r as H } from "./import-utils-HEL359RU.js";
7
- import { a as ae, b as le, c as se, d as oe, e as ie } from "./index-ClqqnPEd.js";
5
+ import { V as N } from "./vs-datatable-Cd2Gp4jo.js";
6
+ import { _ as z, n as R, m as E, r as H } from "./import-utils-DkKPU_Nd.js";
7
+ import { a as ae, b as le, c as se, d as oe, e as ie } from "./index-C3bl1qBS.js";
8
8
  import { LucideChevronRight as re } from "lucide-vue-next";
9
9
  import { _ as ne } from "./MapSettingsTabs.vue_vue_type_script_setup_true_lang-CKCK3NqY.js";
10
10
  const ue = { class: "vs-form" }, de = { class: "vs-form__body auto-rows-max container" }, ce = { class: "flex flex-wrap" }, me = { class: "h-fit w-full mb-6 bg-white border border-gray-200 rounded-lg p-6" }, ve = { class: "h-fit w-full flex flex-wrap" }, pe = { class: "w-full" }, fe = /* @__PURE__ */ B({
@@ -4,12 +4,12 @@ var L = (e, n, t) => pi(e, typeof n != "symbol" ? n + "" : n, t);
4
4
  import { openBlock as _, createElementBlock as M, createElementVNode as g, defineComponent as ae, ref as E, watch as $, createTextVNode as mi, createVNode as D, createBlock as P, createCommentVNode as W, defineAsyncComponent as hi, unref as ze, withCtx as bn, withDirectives as fn, vModelText as dn, normalizeClass as _e, Fragment as kt, renderList as At, toDisplayString as fe, getCurrentInstance as Ct, onBeforeUnmount as wt, toRef as gi, computed as ve, onMounted as yi, resolveDynamicComponent as vi } from "vue";
5
5
  import { useRoute as bi, useRouter as xi } from "vue-router";
6
6
  import { notify as X } from "@opengis/core";
7
- import { _ as Xe, u as Ge, f as Si, M as ki, g as Ai, h as Ci, i as wi, j as tt, k as Ti, l as _i, m as Ei, s as it, n as Ii } from "./index-ClqqnPEd.js";
8
- import { _ as Ni, a as $i, b as Li, c as Fi } from "./HeaderActions.vue_vue_type_script_setup_true_lang-D3oMTMO0.js";
9
- import { S as Oi, C as Ri } from "./CardIcon-B-HKyoDs.js";
7
+ import { _ as Xe, u as Ge, f as Si, M as ki, g as Ai, h as Ci, i as wi, j as tt, k as Ti, l as _i, m as Ei, s as it, n as Ii } from "./index-C3bl1qBS.js";
8
+ import { _ as Ni, a as $i, b as Li, c as Fi } from "./HeaderActions.vue_vue_type_script_setup_true_lang-D1iwSeRN.js";
9
+ import { S as Oi, C as Ri } from "./CardIcon-DzERD2T8.js";
10
10
  import { _ as Tt } from "./MonacoEditor.vue_vue_type_script_setup_true_lang-D3ZPeXMw.js";
11
- import { V as Ze } from "./vs-datatable-C27Dlfo3.js";
12
- import { _ as Nn, m as $n, r as $e } from "./import-utils-HEL359RU.js";
11
+ import { V as Ze } from "./vs-datatable-Cd2Gp4jo.js";
12
+ import { _ as Nn, m as $n, r as $e } from "./import-utils-DkKPU_Nd.js";
13
13
  /*! js-yaml 5.2.1 https://github.com/nodeca/js-yaml @license MIT */
14
14
  var T = Symbol("NOT_RESOLVED"), Ln = Symbol("MERGE_KEY");
15
15
  function U(e, n) {
@@ -1,7 +1,7 @@
1
1
  import { defineComponent as F, mergeModels as O, defineAsyncComponent as I, useModel as R, ref as y, watch as K, openBlock as o, createElementBlock as s, createElementVNode as e, createVNode as $, unref as x, withCtx as S, createStaticVNode as V, useSlots as P, computed as H, Fragment as b, createTextVNode as U, createCommentVNode as N, renderList as A, normalizeStyle as Q, toDisplayString as M, normalizeClass as z, withModifiers as X, createBlock as Y, resolveDynamicComponent as ee, withDirectives as te, renderSlot as ne } from "vue";
2
2
  import { notify as E } from "@opengis/core";
3
3
  import { Edit as le, Trash as oe } from "lucide-vue-next";
4
- import { _ as u } from "./index-ClqqnPEd.js";
4
+ import { _ as u } from "./index-C3bl1qBS.js";
5
5
  const se = { class: "flex items-center justify-center col-span-3 gap-2" }, re = { class: "flex justify-end p-[20px] gap-[10px] border-t w-full" }, ie = /* @__PURE__ */ F({
6
6
  __name: "vs-datatable-controls",
7
7
  props: /* @__PURE__ */ O({
@@ -725,12 +725,11 @@ const kt = /* @__PURE__ */ u(pt, [["render", wt]]), W = {
725
725
  ])
726
726
  ])) : (o(), s(b, { key: 1 }, [
727
727
  a.slot && g(a.slot) ? ne(i.$slots, a.slot, {
728
- key: 0,
729
728
  row: l,
730
729
  column: a,
731
730
  value: l[a.key],
732
731
  rowIndex: f
733
- }, void 0, !0) : a.type === "color" ? (o(), s("div", zt, [
732
+ }, void 0, !0, 0) : a.type === "color" ? (o(), s("div", zt, [
734
733
  e("div", {
735
734
  class: z(["w-4 h-4 rounded-full align-middle", `bg-[${l[a.key]}]`])
736
735
  }, null, 2)
package/package.json CHANGED
@@ -1,8 +1,7 @@
1
1
  {
2
2
  "name": "@opengis/gis",
3
- "version": "0.2.166",
3
+ "version": "0.2.168",
4
4
  "type": "module",
5
-
6
5
  "author": "Softpro",
7
6
  "main": "./dist/index.js",
8
7
  "files": [
@@ -2,15 +2,7 @@ import { config } from '@opengis/fastify-table/utils.js';
2
2
 
3
3
  import mapnik from '../../../plugins/mapnik/funcs/mapnik.js';
4
4
 
5
- const { GetLogs } = mapnik();
6
-
7
- function sendTextOrJson(reply, contentType, payload) {
8
- if (typeof payload === 'string' || Buffer.isBuffer(payload)) {
9
- return reply.type(contentType).send(payload);
10
- }
11
-
12
- return reply.type('application/json').send(payload);
13
- }
5
+ const { GetLogs } = mapnik();
14
6
 
15
7
  export default async function mapnikLogger({
16
8
  params,
@@ -20,21 +12,18 @@ export default async function mapnikLogger({
20
12
  }
21
13
 
22
14
  const { data, links, err } = await GetLogs({ path: params['*'] });
23
- if (err) {
24
- return reply.status(400).send(err);
25
- }
26
-
27
- if (links) {
28
- if (typeof links !== 'string') {
29
- return sendTextOrJson(reply, 'text/html; charset=UTF-8', links);
30
- }
31
-
32
- return reply.headers({
15
+ console.log(links);
16
+ if (err) {
17
+ return reply.status(400).send(err);
18
+ }
19
+
20
+ if (links) {
21
+ return reply.headers({
33
22
  "Content-Type": "text/html; charset=UTF-8",
34
23
  "Content-Security-Policy": "default-src 'none'",
35
24
  "X-Content-Type-Options": "nosniff",
36
25
  }).send(links.replace(/\/api\/gis-logger/g, '/logger-gis'));
37
26
  }
38
27
 
39
- return sendTextOrJson(reply, 'text/plain; charset=UTF-8', data);
40
- }
28
+ return reply.headers({ "Content-type": "text/plain; charset=UTF-8" }).send(data);
29
+ }
@@ -9,13 +9,9 @@ import {
9
9
 
10
10
  import mapnik from '../../../plugins/mapnik/funcs/mapnik.js';
11
11
 
12
- const { RenderTile } = mapnik();
13
-
14
- const mercator = new SphericalMercator({ size: 256 });
15
-
16
- function isTrue(value) {
17
- return value === true || value === 'true' || value === '1';
18
- }
12
+ const { RenderTile } = mapnik();
13
+
14
+ const mercator = new SphericalMercator({ size: 256 });
19
15
 
20
16
  /**
21
17
  * Формування растрового tile cartoCss
@@ -32,16 +28,14 @@ function isTrue(value) {
32
28
  * @param {String} y - координата x
33
29
  */
34
30
 
35
- export default async function gisRtile({
36
- pg = pgClients.client, params, query, user,
37
- }, reply) {
31
+ export default async function gisRtile({
32
+ pg = pgClients.client, params, query, user,
33
+ }, reply) {
38
34
  if (!RenderTile) {
39
35
  return reply.status(400).send({ error: 'mapnik server address needed', code: 400 });
40
36
  }
41
37
 
42
- const { id, z, y } = params;
43
- const nocache = isTrue(query.nocache);
44
- const nottl = isTrue(query.nottl);
38
+ const { id, z, y } = params;
45
39
 
46
40
  const x = params.x.split('.')[0] - 0;
47
41
 
@@ -91,10 +85,8 @@ export default async function gisRtile({
91
85
  const meta = config?.mapnik?.meta ? true : false;
92
86
 
93
87
  try {
94
- // ttl: '0' tells the Mapnik service to skip its tile cache and render again.
95
- const ttl = nocache
96
- ? '0'
97
- : (data.type === 'css' && !data.is_static ? '1w' : null);
88
+ const ttl = (query.nocache ? '0' : null)
89
+ || (data.type === 'css' && !data.is_static ? '1w' : null);
98
90
 
99
91
  const md5 = data.source_path
100
92
  ? createHash('md5').update(data.source_path).digest('hex')
@@ -140,18 +132,10 @@ export default async function gisRtile({
140
132
  const accelPath = result.tile_path?.startsWith('/') ? result.tile_path : `/${result.tile_path}`;
141
133
  const metaHeaders = {
142
134
  'Content-Type': 'image/webp',
143
- 'Cache-Control': nocache || nottl ? 'no-store, no-cache, must-revalidate' : 'public, max-age=2592000',
135
+ 'Cache-Control': query.nocache || query.nottl ? 'no-store, no-cache, must-revalidate' : 'public, max-age=2592000',
144
136
  'X-Accel-Redirect': accelPath,
145
137
  };
146
- if (query.debug) {
147
- return reply.type('application/json').send({
148
- ...metaHeaders,
149
- base64: result.base64,
150
- z,
151
- x,
152
- y,
153
- });
154
- }
138
+ if (query.debug) return reply.send({ ...metaHeaders, base64: result.base64, z, x, y });
155
139
  reply.headers(metaHeaders);
156
140
  return reply.code(204).send();
157
141
  }
@@ -172,7 +156,7 @@ export default async function gisRtile({
172
156
 
173
157
  const buffer = result.data || Buffer.from(result.base64, 'base64');
174
158
 
175
- return reply.headers({ 'Content-Type': 'image/webp', 'Cache-Control': nocache || nottl ? 'no-store, no-cache, must-revalidate' : 'public, max-age=2592000' }).send(buffer);
159
+ return reply.headers({ 'Content-Type': 'image/webp', 'Cache-Control': query.nocache || query.nottl ? 'no-store, no-cache, must-revalidate' : 'public, max-age=2592000' }).send(buffer);
176
160
  }
177
161
  catch (err) {
178
162
  logger.file('rtile/error', {