@opengis/admin 0.3.21 → 0.3.23

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.
Files changed (99) hide show
  1. package/dist/{add-page-DsqxZzEq.js → add-page-2cPkdIAC.js} +29 -26
  2. package/dist/{admin-interface-C8SGlC1N.js → admin-interface-D9Dx7QqK.js} +234 -232
  3. package/dist/{admin-view-DtdqTUPa.js → admin-view-C_Ecdip-.js} +29 -29
  4. package/dist/admin.js +1 -1
  5. package/dist/admin.umd.cjs +88 -88
  6. package/dist/{card-view-juhvChuX.js → card-view-MuS2Gqq6.js} +3 -3
  7. package/dist/{edit-page-DB1hlRzp.js → edit-page-Dr397YuE.js} +33 -31
  8. package/dist/{import-file-BSdaeh6s.js → import-file-CcRnsq1s.js} +23212 -23090
  9. package/dist/{profile-page-B-RhB5JP.js → profile-page-BrKTAsqO.js} +2 -2
  10. package/dist/style.css +1 -1
  11. package/module/settings/card/admin.roles.table/access.hbs +11 -11
  12. package/module/settings/card/admin.roles.table/general_info.hbs +9 -9
  13. package/module/settings/card/admin.roles.table/index.yml +22 -22
  14. package/module/settings/card/admin.roles.table/users.hbs +12 -12
  15. package/module/settings/card/admin.routes.table/general_info.hbs +13 -13
  16. package/module/settings/card/admin.routes.table/index.yml +15 -15
  17. package/module/settings/card/admin.table_properties.table/custom_columns.hbs +22 -22
  18. package/module/settings/card/admin.table_properties.table/index.yml +12 -12
  19. package/module/settings/card/admin.table_properties.table/info.hbs +17 -17
  20. package/module/settings/card/admin.users.table/general_info.hbs +18 -18
  21. package/module/settings/card/admin.users.table/index.yml +20 -20
  22. package/module/settings/card/admin.users.table/last_login.hbs +17 -17
  23. package/module/settings/card/admin.users.table/logs.hbs +16 -16
  24. package/module/settings/card/admin.users.table/routes.hbs +13 -13
  25. package/module/settings/card/admin.users.table/user_roles.hbs +35 -35
  26. package/module/settings/cls/change_type.json +13 -13
  27. package/module/settings/cls/core.column_type.json +14 -14
  28. package/module/settings/form/admin.custom_column.form.json +55 -55
  29. package/module/settings/form/admin.routes.form.json +25 -25
  30. package/module/settings/form/admin.rules.form.json +30 -30
  31. package/module/settings/form/admin.table_properties.form.json +19 -19
  32. package/module/settings/form/admin.user_roles.form.json +24 -24
  33. package/module/settings/form/admin.users.form.json +177 -177
  34. package/module/settings/form/admin.users_edit.form.json +145 -145
  35. package/module/settings/form/context.account_grants.form.json +24 -24
  36. package/module/settings/form/context.account_users.form.json +12 -12
  37. package/module/settings/form/user.user_roles.form.json +13 -13
  38. package/module/settings/menu.json +72 -72
  39. package/module/settings/table/admin.accounts.table.json +49 -49
  40. package/module/settings/table/admin.custom_column.table.json +100 -100
  41. package/module/settings/table/admin.roles.table.json +77 -77
  42. package/module/settings/table/admin.routes.table.json +73 -73
  43. package/module/settings/table/admin.rules.table.json +77 -77
  44. package/module/settings/table/admin.table_properties.table.json +37 -37
  45. package/module/settings/table/admin.user_roles.table.json +74 -74
  46. package/module/settings/table/admin.users.table.json +135 -135
  47. package/module/settings/table/context.account_grants.table.json +88 -88
  48. package/module/settings/table/context.account_users.table.json +53 -53
  49. package/module/settings/table/log.table_changes.table.json +100 -100
  50. package/package.json +102 -102
  51. package/plugin.js +30 -30
  52. package/server/helpers/index.js +40 -40
  53. package/server/helpers/list/descriptionList.js +45 -45
  54. package/server/helpers/list/tableList.js +82 -82
  55. package/server/helpers/list/utils/buttonDel.js +12 -12
  56. package/server/helpers/list/utils/buttonEdit.js +14 -14
  57. package/server/helpers/utils/buttonAdd.js +6 -6
  58. package/server/helpers/utils/buttonDel.js +6 -6
  59. package/server/helpers/utils/buttonEdit.js +5 -5
  60. package/server/helpers/utils/paddingNumber.js +3 -3
  61. package/server/plugins/access/funcs/getAdminAccess.js +12 -12
  62. package/server/plugins/hook.js +276 -275
  63. package/server/plugins/vite.js +77 -77
  64. package/server/routes/access/controllers/access.interface.js +33 -33
  65. package/server/routes/data/controllers/cardData.js +127 -127
  66. package/server/routes/data/controllers/tableFilter.js +9 -9
  67. package/server/routes/data/controllers/tableInfo.js +112 -112
  68. package/server/routes/dblist/controllers/readItems.js +20 -20
  69. package/server/routes/dblist/controllers/setItem.js +22 -22
  70. package/server/routes/dblist/index.mjs +18 -18
  71. package/server/routes/dblist/utils/formatData.js +7 -7
  72. package/server/routes/menu/controllers/getMenu.js +77 -77
  73. package/server/routes/menu/controllers/interfaces.js +20 -20
  74. package/server/routes/menu/index.mjs +7 -7
  75. package/server/routes/print/controllers/printTemplate.add.js +37 -37
  76. package/server/routes/print/controllers/printTemplate.delete.js +29 -29
  77. package/server/routes/print/controllers/printTemplate.edit.js +42 -42
  78. package/server/routes/print/controllers/printTemplate.js +67 -67
  79. package/server/routes/print/controllers/printTemplateList.js +19 -19
  80. package/server/routes/print/controllers/printTemplatePreview.js +87 -87
  81. package/server/routes/print/index.mjs +19 -19
  82. package/server/routes/properties/controllers/admin.properties.get.js +31 -31
  83. package/server/routes/properties/controllers/table.properties.get.js +120 -120
  84. package/server/routes/properties/controllers/table.properties.post.js +115 -115
  85. package/server/routes/properties/controllers/user.properties.get.js +19 -19
  86. package/server/routes/properties/controllers/user.properties.post.js +10 -10
  87. package/server/routes/properties/index.mjs +21 -21
  88. package/server/routes/properties/utils/dataInsert.js +26 -26
  89. package/server/routes/properties/utils/getColumnMetaData.js +17 -17
  90. package/server/routes/properties/utils/refreshData.js +128 -128
  91. package/server/routes/report/utils/getFilterQuery.js +67 -67
  92. package/server/routes/templates/index.mjs +16 -16
  93. package/server/routes/user/controllers/user.cls.post.js +54 -54
  94. package/server/routes/util/index.mjs +5 -5
  95. package/server/routes/widget/controllers/widget.get.js +125 -125
  96. package/server/templates/form/admin.profile.form.json +31 -31
  97. package/server/templates/form/cp_building.form.json +32 -32
  98. package/server/templates/pt/card-print.pt.hbs +245 -245
  99. package/utils.js +26 -26
@@ -1,40 +1,40 @@
1
-
2
- import { handlebars, handlebarsSync } from "@opengis/fastify-table/utils.js";
3
-
4
- import token from "./core/token.js";
5
- import descriptionList from "./list/descriptionList.js";
6
- import tableList from "./list/tableList.js";
7
- import buttonHelper from "./core/buttonHelper.js";
8
- import select from "./core/select.js";
9
- import badge from "./core/badge.js";
10
- import coalesce from "./core/coalesce.js";
11
- import mdToHTML from "./utils/mdToHTML.js";
12
-
13
-
14
- import ifCond from "./temp/ifCond.js";
15
- import contentList from "./temp/contentList.js";
16
- import paddingNumber from './utils/paddingNumber.js';
17
-
18
-
19
-
20
- export default async function route() {
21
-
22
- handlebars.registerHelper('token', token);
23
- handlebars.registerHelper('mdToHTML', mdToHTML);
24
- handlebars.registerHelper('descriptionList', descriptionList);
25
- handlebars.registerHelper('tableList', tableList);
26
- handlebars.registerHelper('button', buttonHelper);
27
- handlebars.registerHelper('select', select);
28
- handlebars.registerHelper('badge', badge);
29
- handlebars.registerHelper('contentList', contentList);
30
- handlebarsSync.registerHelper('ifCond', ifCond);
31
- handlebarsSync.registerHelper('button', buttonHelper);
32
- handlebars.registerHelper('ifCond', ifCond);
33
- handlebars.registerHelper('empty', () => { });
34
- handlebarsSync.registerHelper('empty', () => { });
35
- handlebars.registerHelper('coalesce', coalesce);
36
- handlebarsSync.registerHelper('coalesce', coalesce);
37
-
38
- handlebarsSync.registerHelper('paddingNumber', paddingNumber);
39
- handlebars.registerHelper('paddingNumber', paddingNumber);
40
- }
1
+
2
+ import { handlebars, handlebarsSync } from "@opengis/fastify-table/utils.js";
3
+
4
+ import token from "./core/token.js";
5
+ import descriptionList from "./list/descriptionList.js";
6
+ import tableList from "./list/tableList.js";
7
+ import buttonHelper from "./core/buttonHelper.js";
8
+ import select from "./core/select.js";
9
+ import badge from "./core/badge.js";
10
+ import coalesce from "./core/coalesce.js";
11
+ import mdToHTML from "./utils/mdToHTML.js";
12
+
13
+
14
+ import ifCond from "./temp/ifCond.js";
15
+ import contentList from "./temp/contentList.js";
16
+ import paddingNumber from './utils/paddingNumber.js';
17
+
18
+
19
+
20
+ export default async function route() {
21
+
22
+ handlebars.registerHelper('token', token);
23
+ handlebars.registerHelper('mdToHTML', mdToHTML);
24
+ handlebars.registerHelper('descriptionList', descriptionList);
25
+ handlebars.registerHelper('tableList', tableList);
26
+ handlebars.registerHelper('button', buttonHelper);
27
+ handlebars.registerHelper('select', select);
28
+ handlebars.registerHelper('badge', badge);
29
+ handlebars.registerHelper('contentList', contentList);
30
+ handlebarsSync.registerHelper('ifCond', ifCond);
31
+ handlebarsSync.registerHelper('button', buttonHelper);
32
+ handlebars.registerHelper('ifCond', ifCond);
33
+ handlebars.registerHelper('empty', () => { });
34
+ handlebarsSync.registerHelper('empty', () => { });
35
+ handlebars.registerHelper('coalesce', coalesce);
36
+ handlebarsSync.registerHelper('coalesce', coalesce);
37
+
38
+ handlebarsSync.registerHelper('paddingNumber', paddingNumber);
39
+ handlebars.registerHelper('paddingNumber', paddingNumber);
40
+ }
@@ -1,46 +1,46 @@
1
- import { config, handlebarsSync, handlebars } from '@opengis/fastify-table/utils.js'
2
-
3
- async function format(d, key, data) {
4
-
5
- if (!key?.includes) return '';
6
- if (d === true) return 'Так';
7
- if (d === false) return 'Ні';
8
-
9
- if (key.includes('{{')) {
10
- return await handlebars.compile(key)(data);
11
- }
12
-
13
- return d;
14
- }
15
- export default async function descriptionList(data, opt) {
16
- const { hash } = opt;
17
-
18
- // no data
19
- if (hash.nodata && !data) {
20
- const noDataText = typeof hash.nodata == 'string' ? hash.nodata : '<div class="bg-gray-200 text-center p-6 rounded-xl"><h3 class="text-lg font-semibold">Інформація відсутня</h3></div>';
21
- return noDataText
22
- }
23
- if (!hash.columns) return 'columns empty'
24
- const keys = hash.columns.split(hash.divider || ',').map(el => hash.comma ? el.trim().replace(new RegExp(hash.comma || '#', 'g'), ',') : el.trim());
25
-
26
- const result = [];
27
-
28
- for (let i = 0; i < keys.length; i += 2) {
29
- const name = keys[i];
30
- const nameHBS = name.includes('{{') ? await handlebars.compile(name)({ ...data, hash }) : false;
31
-
32
- if (!nameHBS && name.includes('{{')) continue;
33
-
34
- const key = keys[i + 1];
35
-
36
- const d1 = await format(data[key], key, data) || '-';
37
-
38
- result.push(`<div class="grid grid-cols-1 gap-1 py-3 sm:grid-cols-3 sm:gap-4">
39
- <dt class="text-gray-900">${nameHBS || name}</dt>
40
- <dd class="text-gray-700 sm:col-span-2">${d1}</dd>
41
- </div>
42
- `);
43
-
44
- }
45
- return '<dl class=" divide-y divide-gray-100 py-[5px]">' + result.join('') + '</dl>';
1
+ import { config, handlebarsSync, handlebars } from '@opengis/fastify-table/utils.js'
2
+
3
+ async function format(d, key, data) {
4
+
5
+ if (!key?.includes) return '';
6
+ if (d === true) return 'Так';
7
+ if (d === false) return 'Ні';
8
+
9
+ if (key.includes('{{')) {
10
+ return await handlebars.compile(key)(data);
11
+ }
12
+
13
+ return d;
14
+ }
15
+ export default async function descriptionList(data, opt) {
16
+ const { hash } = opt;
17
+
18
+ // no data
19
+ if (hash.nodata && !data) {
20
+ const noDataText = typeof hash.nodata == 'string' ? hash.nodata : '<div class="bg-gray-200 text-center p-6 rounded-xl"><h3 class="text-lg font-semibold">Інформація відсутня</h3></div>';
21
+ return noDataText
22
+ }
23
+ if (!hash.columns) return 'columns empty'
24
+ const keys = hash.columns.split(hash.divider || ',').map(el => hash.comma ? el.trim().replace(new RegExp(hash.comma || '#', 'g'), ',') : el.trim());
25
+
26
+ const result = [];
27
+
28
+ for (let i = 0; i < keys.length; i += 2) {
29
+ const name = keys[i];
30
+ const nameHBS = name.includes('{{') ? await handlebars.compile(name)({ ...data, hash }) : false;
31
+
32
+ if (!nameHBS && name.includes('{{')) continue;
33
+
34
+ const key = keys[i + 1];
35
+
36
+ const d1 = await format(data[key], key, data) || '-';
37
+
38
+ result.push(`<div class="grid grid-cols-1 gap-1 py-3 sm:grid-cols-3 sm:gap-4 even:bg-gray-50">
39
+ <dt class="text-gray-900">${nameHBS || name}</dt>
40
+ <dd class="text-gray-700 sm:col-span-2">${d1}</dd>
41
+ </div>
42
+ `);
43
+
44
+ }
45
+ return '<dl class=" divide-y divide-gray-100 py-[5px]">' + result.join('') + '</dl>';
46
46
  }
@@ -1,83 +1,83 @@
1
- import { handlebarsSync, setToken, handlebars } from '@opengis/fastify-table/utils.js'
2
-
3
- import buttonEdit from './utils/buttonEdit.js';
4
- import buttonDel from './utils/buttonDel.js';
5
-
6
- function format(d, key, data, hash) {
7
- if (!key?.includes) return '';
8
- if (d === true) return 'Так';
9
- if (d === false) return 'Ні';
10
- if (key === 'actions') {
11
- return `<div class="flex items-center gap-2">${(hash.form ? buttonEdit(d, 'Редагувати') : '') + buttonDel(d)}</div>`
12
- }
13
- if (key.startsWith('{{')) {
14
- return handlebars.compile(key)(data);
15
- } else if (key.startsWith('{{') && key.includes(' ') && !(key.match(/\{\{([^\s]+)/)?.[1] in handlebars.helpers)) {
16
- return null;
17
- }
18
- if (!d) return '-';
19
- return d;
20
- }
21
- export default async function tableList(data, opt) {
22
- const { hash } = opt;
23
- // no data
24
- // const time = Date.now();
25
- if (hash.nodata && !data?.length) {
26
- const noDataText = typeof hash.nodata == 'string' ? hash.nodata : '<div class="bg-gray-200 text-center p-6 rounded-xl"><h3 class="text-lg font-semibold">Інформація відсутня</h3></div>';
27
- return noDataText
28
- }
29
- if (!hash.columns) return 'columns empty'
30
- const keys = hash.columns.split(hash.divider || ',').map(el => hash.comma ? el.trim().replace(new RegExp(hash.comma, 'g'), ',') : el.trim()).concat(hash.uid && hash.table && hash.id && !hash.noactions ? ['Дії', 'actions'] : []);
31
-
32
- const result = [];
33
- result.push('<thead class="text-left"> <tr>');
34
-
35
- // thead
36
- const skip = {}
37
- for (let i = 0; i < keys.length; i += 2) {
38
- const name = keys[i];
39
-
40
- // check hbs
41
- if (name.includes('{{')) {
42
- console.log(hash)
43
- }
44
- const nameHBS = name.includes('{{') ? handlebarsSync.compile(name)({ ...data, hash }) : false;
45
- // console.log(name, data, nameHBS)
46
- skip[name] = name.includes('{{') && !nameHBS;
47
- if (skip[name]) continue;
48
-
49
- result.push(`<th class="whitespace-nowrap py-3 font-medium text-gray-900 ">
50
- ${nameHBS || name}
51
- </th>`)
52
- }
53
- result.push('</tr></thead><tbody class="divide-y divide-gray-200">');
54
-
55
- // body
56
- for (let k = 0; k < data.length; k += 1) {
57
- const row = data[k];
58
- result.push('<tr>');
59
- const obj = { form: hash.form, table: hash.table, id: row[hash.id] }
60
- const token = hash.table ? setToken({ ids: [JSON.stringify(obj)], uid: hash.uid, array: 1 })[0] : null;
61
- for (let i = 0; i < keys.length; i += 2) {
62
-
63
- const name = keys[i];
64
- const key = keys[i + 1];
65
- if (!key) continue;
66
- if (skip[name]) continue;
67
-
68
- const tokenData = key == 'actions' ? token : null;
69
- const d1 = key.includes('{{') ? await handlebars.compile(key)({ ...row, token, hash }) || '-' : null
70
- result.push(`<td class="whitespace-nowrap py-2 text-gray-900">
71
- ${d1 || format(tokenData || row[key], key, row, hash)}
72
- </td>`);
73
-
74
- }
75
- // action token
76
-
77
- result.push('</tr>');
78
- }
79
- result.push('</tbody>');
80
-
81
- // console.log(Date.now() - time)
82
- return '<table class="min-w-full divide-y-2 divide-gray-200 bg-white min-w-full divide-y-2 divide-gray-200 bg-white "> ' + result.join('') + '</table>';
1
+ import { handlebarsSync, setToken, handlebars } from '@opengis/fastify-table/utils.js'
2
+
3
+ import buttonEdit from './utils/buttonEdit.js';
4
+ import buttonDel from './utils/buttonDel.js';
5
+
6
+ function format(d, key, data, hash) {
7
+ if (!key?.includes) return '';
8
+ if (d === true) return 'Так';
9
+ if (d === false) return 'Ні';
10
+ if (key === 'actions') {
11
+ return `<div class="flex items-center gap-2">${(hash.form ? buttonEdit(d, 'Редагувати') : '') + buttonDel(d)}</div>`
12
+ }
13
+ if (key.startsWith('{{')) {
14
+ return handlebars.compile(key)(data);
15
+ } else if (key.startsWith('{{') && key.includes(' ') && !(key.match(/\{\{([^\s]+)/)?.[1] in handlebars.helpers)) {
16
+ return null;
17
+ }
18
+ if (!d) return '-';
19
+ return d;
20
+ }
21
+ export default async function tableList(data, opt) {
22
+ const { hash } = opt;
23
+ // no data
24
+ // const time = Date.now();
25
+ if (hash.nodata && !data?.length) {
26
+ const noDataText = typeof hash.nodata == 'string' ? hash.nodata : '<div class="bg-gray-200 text-center p-6 rounded-xl"><h3 class="text-lg font-semibold">Інформація відсутня</h3></div>';
27
+ return noDataText
28
+ }
29
+ if (!hash.columns) return 'columns empty'
30
+ const keys = hash.columns.split(hash.divider || ',').map(el => hash.comma ? el.trim().replace(new RegExp(hash.comma, 'g'), ',') : el.trim()).concat(hash.uid && hash.table && hash.id && !hash.noactions ? ['Дії', 'actions'] : []);
31
+
32
+ const result = [];
33
+ result.push('<thead class="text-left"> <tr>');
34
+
35
+ // thead
36
+ const skip = {}
37
+ for (let i = 0; i < keys.length; i += 2) {
38
+ const name = keys[i];
39
+
40
+ // check hbs
41
+ if (name.includes('{{')) {
42
+ console.log(hash)
43
+ }
44
+ const nameHBS = name.includes('{{') ? handlebarsSync.compile(name)({ ...data, hash }) : false;
45
+ // console.log(name, data, nameHBS)
46
+ skip[name] = name.includes('{{') && !nameHBS;
47
+ if (skip[name]) continue;
48
+
49
+ result.push(`<th class="whitespace-nowrap py-3 font-medium text-gray-900 ">
50
+ ${nameHBS || name}
51
+ </th>`)
52
+ }
53
+ result.push('</tr></thead><tbody class="divide-y divide-gray-200">');
54
+
55
+ // body
56
+ for (let k = 0; k < data.length; k += 1) {
57
+ const row = data[k];
58
+ result.push('<tr>');
59
+ const obj = { form: hash.form, table: hash.table, id: row[hash.id] }
60
+ const token = hash.table ? setToken({ ids: [JSON.stringify(obj)], uid: hash.uid, array: 1 })[0] : null;
61
+ for (let i = 0; i < keys.length; i += 2) {
62
+
63
+ const name = keys[i];
64
+ const key = keys[i + 1];
65
+ if (!key) continue;
66
+ if (skip[name]) continue;
67
+
68
+ const tokenData = key == 'actions' ? token : null;
69
+ const d1 = key.includes('{{') ? await handlebars.compile(key)({ ...row, token, hash }) || '-' : null
70
+ result.push(`<td class="whitespace-nowrap py-2 text-gray-900">
71
+ ${d1 || format(tokenData || row[key], key, row, hash)}
72
+ </td>`);
73
+
74
+ }
75
+ // action token
76
+
77
+ result.push('</tr>');
78
+ }
79
+ result.push('</tbody>');
80
+
81
+ // console.log(Date.now() - time)
82
+ return '<table class="min-w-full divide-y-2 divide-gray-200 bg-white min-w-full divide-y-2 divide-gray-200 bg-white "> ' + result.join('') + '</table>';
83
83
  }
@@ -1,13 +1,13 @@
1
- // export default function button(token, title) {
2
- // return `<button onclick="window.v3plugin.$api({ api: '/api/table/${token}', method:'delete',confirm: { title:'Підтвердити операцію', text: 'Ви впевнені що хочете вилучити запис?', cancel: 'Скасувати', confirm : 'Виконати'} })"
3
- // class="inline-flex items-center px-2 py-1 text-sm font-medium text-white duration-300 bg-red-600 border border-transparent rounded-lg gap-x-2 hover:bg-red-700 hover:text-white">${title || 'Вилучити'}</button>`;
4
- // }
5
-
6
-
7
- const newColor = 'red'
8
- export default function button(token, title) {
9
- return `<button onclick="window.v3plugin.$api({ api: '/api/table/${token}', method:'delete',confirm: { title:'Підтвердити операцію', text: 'Ви впевнені що хочете вилучити запис?', cancel: 'Скасувати', confirm : 'Виконати'} })"
10
- class="group px-2 py-1 inline-flex border-solid justify-center items-center gap-2 rounded-md font-semibold focus:outline-none text-sm transition-all border border-transparent hover:text-white ring-offset-white bg-${newColor}-100 text-${newColor}-100 hover:bg-${newColor}-500 focus:ring-${newColor}-500">
11
- <svg class="group-hover:fill-white" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512" width="15" height="15" fill="#ef4444"><path d="M135.2 17.7L128 32 32 32C14.3 32 0 46.3 0 64S14.3 96 32 96l384 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-96 0-7.2-14.3C307.4 6.8 296.3 0 284.2 0L163.8 0c-12.1 0-23.2 6.8-28.6 17.7zM416 128L32 128 53.2 467c1.6 25.3 22.6 45 47.9 45l245.8 0c25.3 0 46.3-19.7 47.9-45L416 128z"/></svg>
12
- </button>`;
1
+ // export default function button(token, title) {
2
+ // return `<button onclick="window.v3plugin.$api({ api: '/api/table/${token}', method:'delete',confirm: { title:'Підтвердити операцію', text: 'Ви впевнені що хочете вилучити запис?', cancel: 'Скасувати', confirm : 'Виконати'} })"
3
+ // class="inline-flex items-center px-2 py-1 text-sm font-medium text-white duration-300 bg-red-600 border border-transparent rounded-lg gap-x-2 hover:bg-red-700 hover:text-white">${title || 'Вилучити'}</button>`;
4
+ // }
5
+
6
+
7
+ const newColor = 'red'
8
+ export default function button(token, title) {
9
+ return `<button onclick="window.v3plugin.$api({ api: '/api/table/${token}', method:'delete',confirm: { title:'Підтвердити операцію', text: 'Ви впевнені що хочете вилучити запис?', cancel: 'Скасувати', confirm : 'Виконати'} })"
10
+ class="group px-2 py-1 inline-flex border-solid justify-center items-center gap-2 rounded-md font-semibold focus:outline-none text-sm transition-all border border-transparent hover:text-white ring-offset-white bg-${newColor}-100 text-${newColor}-100 hover:bg-${newColor}-500 focus:ring-${newColor}-500">
11
+ <svg class="group-hover:fill-white" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512" width="15" height="15" fill="#ef4444"><path d="M135.2 17.7L128 32 32 32C14.3 32 0 46.3 0 64S14.3 96 32 96l384 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-96 0-7.2-14.3C307.4 6.8 296.3 0 284.2 0L163.8 0c-12.1 0-23.2 6.8-28.6 17.7zM416 128L32 128 53.2 467c1.6 25.3 22.6 45 47.9 45l245.8 0c25.3 0 46.3-19.7 47.9-45L416 128z"/></svg>
12
+ </button>`;
13
13
  }
@@ -1,15 +1,15 @@
1
-
2
-
3
- // export default function button(token, title) {
4
- // return `<button onclick="window.v3plugin.$form({ token: '${token}' })"
5
- // class="inline-flex items-center px-2 py-1 text-sm font-medium text-white duration-300 bg-blue-600 border border-transparent rounded-lg gap-x-2 hover:bg-blue-700 hover:text-white">${title || 'Редагувати'}</button>`;
6
- // }
7
-
8
-
9
- const newColor = 'blue'
10
- export default function button(token, title) {
11
- return `<button onclick="window.v3plugin.$form({ token: '${token}' })"
12
- class="group px-2 py-1 inline-flex border-solid justify-center items-center gap-2 rounded-md font-semibold focus:outline-none text-sm transition-all border border-transparent hover:text-white ring-offset-white bg-${newColor}-100 text-${newColor}-100 hover:bg-${newColor}-500 focus:ring-${newColor}-500">
13
- <svg class="group-hover:fill-white" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" width="15" height="15" fill="#3b82f6"><path d="M471.6 21.7c-21.9-21.9-57.3-21.9-79.2 0L362.3 51.7l97.9 97.9 30.1-30.1c21.9-21.9 21.9-57.3 0-79.2L471.6 21.7zm-299.2 220c-6.1 6.1-10.8 13.6-13.5 21.9l-29.6 88.8c-2.9 8.6-.6 18.1 5.8 24.6s15.9 8.7 24.6 5.8l88.8-29.6c8.2-2.7 15.7-7.4 21.9-13.5L437.7 172.3 339.7 74.3 172.4 241.7zM96 64C43 64 0 107 0 160L0 416c0 53 43 96 96 96l256 0c53 0 96-43 96-96l0-96c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 96c0 17.7-14.3 32-32 32L96 448c-17.7 0-32-14.3-32-32l0-256c0-17.7 14.3-32 32-32l96 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L96 64z"/></svg>
14
- </button>`;
1
+
2
+
3
+ // export default function button(token, title) {
4
+ // return `<button onclick="window.v3plugin.$form({ token: '${token}' })"
5
+ // class="inline-flex items-center px-2 py-1 text-sm font-medium text-white duration-300 bg-blue-600 border border-transparent rounded-lg gap-x-2 hover:bg-blue-700 hover:text-white">${title || 'Редагувати'}</button>`;
6
+ // }
7
+
8
+
9
+ const newColor = 'blue'
10
+ export default function button(token, title) {
11
+ return `<button onclick="window.v3plugin.$form({ token: '${token}' })"
12
+ class="group px-2 py-1 inline-flex border-solid justify-center items-center gap-2 rounded-md font-semibold focus:outline-none text-sm transition-all border border-transparent hover:text-white ring-offset-white bg-${newColor}-100 text-${newColor}-100 hover:bg-${newColor}-500 focus:ring-${newColor}-500">
13
+ <svg class="group-hover:fill-white" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" width="15" height="15" fill="#3b82f6"><path d="M471.6 21.7c-21.9-21.9-57.3-21.9-79.2 0L362.3 51.7l97.9 97.9 30.1-30.1c21.9-21.9 21.9-57.3 0-79.2L471.6 21.7zm-299.2 220c-6.1 6.1-10.8 13.6-13.5 21.9l-29.6 88.8c-2.9 8.6-.6 18.1 5.8 24.6s15.9 8.7 24.6 5.8l88.8-29.6c8.2-2.7 15.7-7.4 21.9-13.5L437.7 172.3 339.7 74.3 172.4 241.7zM96 64C43 64 0 107 0 160L0 416c0 53 43 96 96 96l256 0c53 0 96-43 96-96l0-96c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 96c0 17.7-14.3 32-32 32L96 448c-17.7 0-32-14.3-32-32l0-256c0-17.7 14.3-32 32-32l96 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L96 64z"/></svg>
14
+ </button>`;
15
15
  }
@@ -1,7 +1,7 @@
1
-
2
-
3
- const newColor = 'blue'
4
- export default function button(token, title) {
5
- return `<button onclick="window.v3plugin.$form({ token: '${token}' })"
6
- class="px-2 py-1 inline-flex border-solid justify-center items-center gap-2 rounded-md font-semibold focus:outline-none text-sm transition-all border border-transparent hover:text-white ring-offset-white bg-${newColor}-100 text-${newColor}-500 hover:bg-${newColor}-500 focus:ring-${newColor}-500">${title || 'Додати'}</button>`;
1
+
2
+
3
+ const newColor = 'blue'
4
+ export default function button(token, title) {
5
+ return `<button onclick="window.v3plugin.$form({ token: '${token}' })"
6
+ class="px-2 py-1 inline-flex border-solid justify-center items-center gap-2 rounded-md font-semibold focus:outline-none text-sm transition-all border border-transparent hover:text-white ring-offset-white bg-${newColor}-100 text-${newColor}-500 hover:bg-${newColor}-500 focus:ring-${newColor}-500">${title || 'Додати'}</button>`;
7
7
  }
@@ -1,7 +1,7 @@
1
-
2
-
3
- const newColor = 'red'
4
- export default function button(token, title) {
5
- return `<button onclick="window.v3plugin.$api({ api: '/api/table/${token}', method:'delete',confirm: { title:'Підтвердити операцію', text: 'Ви впевнені що хочете вилучити запис?', cancel: 'Скасувати', confirm : 'Виконати'} })"
6
- class="px-2 py-1 inline-flex border-solid justify-center items-center gap-2 rounded-md font-semibold focus:outline-none text-sm transition-all border border-transparent hover:text-white ring-offset-white bg-${newColor}-100 text-${newColor}-500 hover:bg-${newColor}-500 focus:ring-${newColor}-500">${title || 'Вилучити'}</button>`;
1
+
2
+
3
+ const newColor = 'red'
4
+ export default function button(token, title) {
5
+ return `<button onclick="window.v3plugin.$api({ api: '/api/table/${token}', method:'delete',confirm: { title:'Підтвердити операцію', text: 'Ви впевнені що хочете вилучити запис?', cancel: 'Скасувати', confirm : 'Виконати'} })"
6
+ class="px-2 py-1 inline-flex border-solid justify-center items-center gap-2 rounded-md font-semibold focus:outline-none text-sm transition-all border border-transparent hover:text-white ring-offset-white bg-${newColor}-100 text-${newColor}-500 hover:bg-${newColor}-500 focus:ring-${newColor}-500">${title || 'Вилучити'}</button>`;
7
7
  }
@@ -1,6 +1,6 @@
1
-
2
- const newColor = 'blue'
3
- export default function button(token, title) {
4
- return `<button onclick="window.v3plugin.$form({ token: '${token}' })"
5
- class="px-2 py-1 inline-flex border-solid justify-center items-center gap-2 rounded-md font-semibold focus:outline-none text-sm transition-all border border-transparent hover:text-white ring-offset-white bg-${newColor}-100 text-${newColor}-500 hover:bg-${newColor}-500 focus:ring-${newColor}-500">${title || 'Редагувати'}</button>`;
1
+
2
+ const newColor = 'blue'
3
+ export default function button(token, title) {
4
+ return `<button onclick="window.v3plugin.$form({ token: '${token}' })"
5
+ class="px-2 py-1 inline-flex border-solid justify-center items-center gap-2 rounded-md font-semibold focus:outline-none text-sm transition-all border border-transparent hover:text-white ring-offset-white bg-${newColor}-100 text-${newColor}-500 hover:bg-${newColor}-500 focus:ring-${newColor}-500">${title || 'Редагувати'}</button>`;
6
6
  }
@@ -1,4 +1,4 @@
1
- export default function (num) {
2
- const padding = arguments.length === 3 ? arguments[1] : 6;
3
- return num.toLocaleString('en', { minimumIntegerDigits: padding, useGrouping: false })
1
+ export default function (num) {
2
+ const padding = arguments.length === 3 ? arguments[1] : 6;
3
+ return num.toLocaleString('en', { minimumIntegerDigits: padding, useGrouping: false })
4
4
  }
@@ -1,13 +1,13 @@
1
- import { config } from '@opengis/fastify-table/utils.js';
2
-
3
- export default async function getAdminAccess({
4
- id, user = {},
5
- }) {
6
- if (!id) {
7
- return { message: 'not enough params: id', status: 400 };
8
- }
9
-
10
- if (!config?.local && !['admin'].includes(user.user_type, user.type)) {
11
- return { message: 'access restricted: admin', status: 403 };
12
- }
1
+ import { config } from '@opengis/fastify-table/utils.js';
2
+
3
+ export default async function getAdminAccess({
4
+ id, user = {},
5
+ }) {
6
+ if (!id) {
7
+ return { message: 'not enough params: id', status: 400 };
8
+ }
9
+
10
+ if (!config?.local && !['admin'].includes(user.user_type, user.type)) {
11
+ return { message: 'access restricted: admin', status: 403 };
12
+ }
13
13
  }