@opengis/admin 0.1.41 → 0.1.43
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/README.md +29 -29
- package/config.js +4 -4
- package/dist/{add-page-CYAz9FdO.js → add-page-CPxPEwVb.js} +1 -1
- package/dist/{admin-interface-BfY0EPQi.js → admin-interface-BrR4cmQr.js} +128 -150
- package/dist/{admin-view-CcyuPjSQ.js → admin-view-Cn0uqU9D.js} +2 -2
- package/dist/admin.js +1 -1
- package/dist/admin.umd.cjs +44 -44
- package/dist/{card-page-DV3pe4fv.js → card-page-ts5Cy3fm.js} +21 -21
- package/dist/{card-view-pwoN8ZHo.js → card-view-DGQRwJ0_.js} +1 -1
- package/dist/{edit-page-PNY_GQBC.js → edit-page-CTf_uwUQ.js} +1 -1
- package/dist/{import-file-aqrl_bc7.js → import-file-CElPY9ks.js} +6934 -6694
- package/dist/style.css +1 -1
- package/module/settings/card/admin.roles.table/access.hbs +27 -27
- package/module/settings/card/admin.roles.table/general_info.hbs +16 -16
- package/module/settings/card/admin.roles.table/index.yml +14 -14
- package/module/settings/card/admin.roles.table/users.hbs +27 -27
- package/module/settings/card/admin.routes.table/general_info.hbs +40 -40
- package/module/settings/card/admin.routes.table/index.yml +8 -8
- package/module/settings/card/admin.routes.table/users.hbs +33 -33
- package/module/settings/card/admin.users.table/general_info.hbs +25 -25
- package/module/settings/card/admin.users.table/index.yml +12 -12
- package/module/settings/card/admin.users.table/logs.hbs +30 -30
- package/module/settings/card/admin.users.table/user_roles.hbs +24 -24
- package/module/settings/cls/core.actions.json +13 -13
- package/module/settings/cls/core.scope.json +13 -13
- package/module/settings/cls/properties.site_status.json +13 -13
- package/module/settings/cls/properties.widget_status.json +13 -13
- package/module/settings/cls/users.user_type.json +13 -13
- package/module/settings/form/admin.access.form.json +36 -36
- package/module/settings/form/admin.properties.form.json +15 -15
- package/module/settings/form/admin.roles.form.json +19 -19
- package/module/settings/form/admin.routes.form.json +25 -25
- package/module/settings/form/admin.table_properties.form.json +70 -70
- package/module/settings/form/admin.user_properties.form.json +15 -15
- package/module/settings/form/admin.user_roles.form.json +21 -21
- package/module/settings/form/admin.users.form.json +150 -150
- package/module/settings/form/user.user_roles.form.json +13 -13
- package/module/settings/interface/admin.properties.json +4 -4
- package/module/settings/interface/admin.roles.json +4 -4
- package/module/settings/interface/admin.routes.json +4 -4
- package/module/settings/interface/admin.users.json +4 -4
- package/module/settings/menu.json +56 -50
- package/module/settings/select/core.roles.json +2 -2
- package/module/settings/select/core.user_uid.sql +1 -1
- package/module/settings/table/admin.access.table.json +77 -77
- package/module/settings/table/admin.properties.table.json +33 -33
- package/module/settings/table/admin.roles.table.json +58 -58
- package/module/settings/table/admin.routes.table.json +55 -55
- package/module/settings/table/admin.table_properties.table.json +81 -81
- package/module/settings/table/admin.user_properties.table.json +28 -28
- package/module/settings/table/admin.user_roles.table.json +66 -66
- package/module/settings/table/admin.users.table.json +119 -119
- package/package.json +78 -74
- package/plugin.js +101 -101
- package/server/helpers/controllers/badge.js +11 -11
- package/server/helpers/controllers/hb.js +2 -2
- package/server/helpers/controllers/map.js +2 -2
- package/server/helpers/controllers/mls.js +2 -2
- package/server/helpers/controllers/vue.js +2 -2
- package/server/helpers/index.mjs +13 -13
- package/server/plugins/docs.js +28 -28
- package/server/plugins/hook.js +166 -166
- package/server/plugins/vite.js +69 -69
- package/server/routes/data/controllers/cardData.js +56 -56
- package/server/routes/data/controllers/cardTabData.js +49 -39
- package/server/routes/data/controllers/funcs/getFilterSQL/index.js +85 -85
- package/server/routes/data/controllers/funcs/getFilterSQL/util/formatValue.js +145 -145
- package/server/routes/data/controllers/funcs/getFilterSQL/util/getCustomQuery.js +13 -13
- package/server/routes/data/controllers/funcs/getFilterSQL/util/getFilterQuery.js +67 -67
- package/server/routes/data/controllers/funcs/getFilterSQL/util/getOptimizedQuery.js +12 -12
- package/server/routes/data/controllers/funcs/getFilterSQL/util/getTableSql.js +34 -34
- package/server/routes/data/controllers/tableData.js +121 -121
- package/server/routes/data/controllers/tableDataId.js +27 -27
- package/server/routes/data/controllers/tableFilter.js +55 -55
- package/server/routes/data/controllers/utils/assignTokens.js +30 -30
- package/server/routes/data/controllers/utils/getColumns.js +21 -21
- package/server/routes/data/index.mjs +12 -12
- package/server/routes/menu/controllers/getMenu.js +33 -33
- package/server/routes/menu/index.mjs +5 -5
- package/server/routes/properties/controllers/admin.properties.get.js +29 -29
- package/server/routes/properties/controllers/user.properties.get.js +34 -34
- package/server/routes/properties/controllers/user.properties.post.js +30 -30
- package/server/routes/properties/funcs/getSettings.js +56 -56
- package/server/routes/properties/funcs/setSettings.js +44 -44
- package/server/routes/properties/funcs/utils/dataInsert.js +26 -26
- package/server/routes/properties/index.mjs +26 -26
- package/server/routes/root.mjs +3 -3
- package/server/routes/templates/controllers/getTemplate.js +14 -14
- package/server/routes/templates/index.mjs +14 -14
- package/server/templates/cls/itree.recrzone_category.json +73 -73
- package/server/templates/cls/test.json +9 -9
- package/server/templates/form/admin.user_cls.data.form.json +49 -49
- package/server/templates/form/admin.user_group_rel.form.json +21 -21
- package/server/templates/form/cp_building.form.json +32 -32
- package/server/templates/form/form-user-pass.json +10 -10
- package/server/templates/form/form-user_group.json +39 -39
- package/server/templates/form/form-users.json +156 -156
- package/server/templates/form/user_group_access.form.json +22 -22
- package/server/templates/select/account_id.json +2 -2
- package/server/templates/table/gis.dataset.table.json +43 -43
- package/server/templates/table/management.user_group.table.json +112 -112
- package/server/templates/table/management.users.table.json +126 -126
- package/utils.js +8 -8
|
@@ -1,120 +1,120 @@
|
|
|
1
|
-
{
|
|
2
|
-
"key": "uid",
|
|
3
|
-
"ua": "Користувачі",
|
|
4
|
-
"table": "admin.users",
|
|
5
|
-
"form": "admin.users.form",
|
|
6
|
-
"order": "cdate desc",
|
|
7
|
-
"action": [
|
|
8
|
-
"edit",
|
|
9
|
-
"del"
|
|
10
|
-
],
|
|
11
|
-
"meta": {
|
|
12
|
-
"title": "user_name",
|
|
13
|
-
"search": "sur_name,user_name,uid,father_name,email,phone,login"
|
|
14
|
-
},
|
|
15
|
-
"sql": [
|
|
16
|
-
{
|
|
17
|
-
"sql": "select count(*) as group_count from admin.user_group_rel where user_uid=t.uid",
|
|
18
|
-
"name": "group_count_sql"
|
|
19
|
-
},
|
|
20
|
-
{
|
|
21
|
-
"sql": "select concat(user_name, ' ', sur_name, ' ', father_name, ' ') as full_name",
|
|
22
|
-
"name": "full_name_sql"
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
"sql": "select string_agg(group_name,',') as groups from admin.user_group where user_group_id in (select user_group_id from admin.user_group_rel where user_uid=t.uid)",
|
|
26
|
-
"name": "group_list_sql"
|
|
27
|
-
}
|
|
28
|
-
],
|
|
29
|
-
"columns": [
|
|
30
|
-
{
|
|
31
|
-
"ua": "ПІБ",
|
|
32
|
-
"name": "full_name",
|
|
33
|
-
"format": "text"
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
"ua": "Логін",
|
|
37
|
-
"name": "login",
|
|
38
|
-
"format": "text"
|
|
39
|
-
},
|
|
40
|
-
{
|
|
41
|
-
"ua": "Email",
|
|
42
|
-
"name": "email",
|
|
43
|
-
"hidden": true,
|
|
44
|
-
"format": "text"
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
"ua": "РНОКПП",
|
|
48
|
-
"name": "user_rnokpp",
|
|
49
|
-
"hidden": true,
|
|
50
|
-
"format": "text"
|
|
51
|
-
},
|
|
52
|
-
{
|
|
53
|
-
"name": "group_count",
|
|
54
|
-
"ua": "Кількість груп",
|
|
55
|
-
"format": "text"
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
"name": "groups",
|
|
59
|
-
"ua": "Групи",
|
|
60
|
-
"hidden": true,
|
|
61
|
-
"format": "text"
|
|
62
|
-
},
|
|
63
|
-
{
|
|
64
|
-
"name": "cdate",
|
|
65
|
-
"ua": "Створено",
|
|
66
|
-
"format": "date"
|
|
67
|
-
},
|
|
68
|
-
{
|
|
69
|
-
"name": "editor_date",
|
|
70
|
-
"ua": "Дата останньої активності",
|
|
71
|
-
"format": "date"
|
|
72
|
-
},
|
|
73
|
-
{
|
|
74
|
-
"name": "enabled",
|
|
75
|
-
"ua": "Вимикач",
|
|
76
|
-
"data": "yes_no",
|
|
77
|
-
"format": "select"
|
|
78
|
-
}
|
|
79
|
-
],
|
|
80
|
-
"filter_list": [
|
|
81
|
-
{
|
|
82
|
-
"ua": "РНОКПП",
|
|
83
|
-
"name": "user_rnokpp",
|
|
84
|
-
"type": "Text"
|
|
85
|
-
},
|
|
86
|
-
{
|
|
87
|
-
"ua": "Код ЄДРПОУ",
|
|
88
|
-
"name": "organ_edrpou",
|
|
89
|
-
"type": "Text"
|
|
90
|
-
},
|
|
91
|
-
{
|
|
92
|
-
"ua": "Email",
|
|
93
|
-
"name": "email",
|
|
94
|
-
"type": "Text"
|
|
95
|
-
},
|
|
96
|
-
{
|
|
97
|
-
"en": "Group",
|
|
98
|
-
"ua": "Група",
|
|
99
|
-
"name": "groups",
|
|
100
|
-
"type": "Text"
|
|
101
|
-
},
|
|
102
|
-
{
|
|
103
|
-
"en": "On/Off",
|
|
104
|
-
"ua": "On/Off",
|
|
105
|
-
"data": "enabled",
|
|
106
|
-
"name": "enabled",
|
|
107
|
-
"type": "Check"
|
|
108
|
-
},
|
|
109
|
-
{
|
|
110
|
-
"ua": "Дата створення",
|
|
111
|
-
"name": "cdate",
|
|
112
|
-
"type": "Date"
|
|
113
|
-
},
|
|
114
|
-
{
|
|
115
|
-
"name": "editor_date",
|
|
116
|
-
"type": "Date",
|
|
117
|
-
"ua": "Дата останньої активності"
|
|
118
|
-
}
|
|
119
|
-
]
|
|
1
|
+
{
|
|
2
|
+
"key": "uid",
|
|
3
|
+
"ua": "Користувачі",
|
|
4
|
+
"table": "admin.users",
|
|
5
|
+
"form": "admin.users.form",
|
|
6
|
+
"order": "cdate desc",
|
|
7
|
+
"action": [
|
|
8
|
+
"edit",
|
|
9
|
+
"del"
|
|
10
|
+
],
|
|
11
|
+
"meta": {
|
|
12
|
+
"title": "user_name",
|
|
13
|
+
"search": "sur_name,user_name,uid,father_name,email,phone,login"
|
|
14
|
+
},
|
|
15
|
+
"sql": [
|
|
16
|
+
{
|
|
17
|
+
"sql": "select count(*) as group_count from admin.user_group_rel where user_uid=t.uid",
|
|
18
|
+
"name": "group_count_sql"
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"sql": "select concat(user_name, ' ', sur_name, ' ', father_name, ' ') as full_name",
|
|
22
|
+
"name": "full_name_sql"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"sql": "select string_agg(group_name,',') as groups from admin.user_group where user_group_id in (select user_group_id from admin.user_group_rel where user_uid=t.uid)",
|
|
26
|
+
"name": "group_list_sql"
|
|
27
|
+
}
|
|
28
|
+
],
|
|
29
|
+
"columns": [
|
|
30
|
+
{
|
|
31
|
+
"ua": "ПІБ",
|
|
32
|
+
"name": "full_name",
|
|
33
|
+
"format": "text"
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"ua": "Логін",
|
|
37
|
+
"name": "login",
|
|
38
|
+
"format": "text"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"ua": "Email",
|
|
42
|
+
"name": "email",
|
|
43
|
+
"hidden": true,
|
|
44
|
+
"format": "text"
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"ua": "РНОКПП",
|
|
48
|
+
"name": "user_rnokpp",
|
|
49
|
+
"hidden": true,
|
|
50
|
+
"format": "text"
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"name": "group_count",
|
|
54
|
+
"ua": "Кількість груп",
|
|
55
|
+
"format": "text"
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"name": "groups",
|
|
59
|
+
"ua": "Групи",
|
|
60
|
+
"hidden": true,
|
|
61
|
+
"format": "text"
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
"name": "cdate",
|
|
65
|
+
"ua": "Створено",
|
|
66
|
+
"format": "date"
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
"name": "editor_date",
|
|
70
|
+
"ua": "Дата останньої активності",
|
|
71
|
+
"format": "date"
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
"name": "enabled",
|
|
75
|
+
"ua": "Вимикач",
|
|
76
|
+
"data": "yes_no",
|
|
77
|
+
"format": "select"
|
|
78
|
+
}
|
|
79
|
+
],
|
|
80
|
+
"filter_list": [
|
|
81
|
+
{
|
|
82
|
+
"ua": "РНОКПП",
|
|
83
|
+
"name": "user_rnokpp",
|
|
84
|
+
"type": "Text"
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
"ua": "Код ЄДРПОУ",
|
|
88
|
+
"name": "organ_edrpou",
|
|
89
|
+
"type": "Text"
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
"ua": "Email",
|
|
93
|
+
"name": "email",
|
|
94
|
+
"type": "Text"
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
"en": "Group",
|
|
98
|
+
"ua": "Група",
|
|
99
|
+
"name": "groups",
|
|
100
|
+
"type": "Text"
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
"en": "On/Off",
|
|
104
|
+
"ua": "On/Off",
|
|
105
|
+
"data": "enabled",
|
|
106
|
+
"name": "enabled",
|
|
107
|
+
"type": "Check"
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
"ua": "Дата створення",
|
|
111
|
+
"name": "cdate",
|
|
112
|
+
"type": "Date"
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
"name": "editor_date",
|
|
116
|
+
"type": "Date",
|
|
117
|
+
"ua": "Дата останньої активності"
|
|
118
|
+
}
|
|
119
|
+
]
|
|
120
120
|
}
|
package/package.json
CHANGED
|
@@ -1,74 +1,78 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@opengis/admin",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "This project Softpro Admin",
|
|
5
|
-
"main": "dist/admin.js",
|
|
6
|
-
"type": "module",
|
|
7
|
-
"directories": {
|
|
8
|
-
"test": "test"
|
|
9
|
-
},
|
|
10
|
-
"files": [
|
|
11
|
-
"dist/*",
|
|
12
|
-
"module/*",
|
|
13
|
-
"server/*",
|
|
14
|
-
"plugin.js",
|
|
15
|
-
"utils.js",
|
|
16
|
-
"config.js"
|
|
17
|
-
],
|
|
18
|
-
"scripts": {
|
|
19
|
-
"test": "node --test test/**/*.test.js",
|
|
20
|
-
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore",
|
|
21
|
-
"build": "vite build",
|
|
22
|
-
"build-app": "cross-env APP=true vite build",
|
|
23
|
-
"admin": "cross-env NODE_ENV=admin npm run start",
|
|
24
|
-
"admin1": "cross-env NODE_ENV=admin1 npm run start",
|
|
25
|
-
"prod": "cross-env NODE_ENV=production npm run start",
|
|
26
|
-
"start": "node --watch-path=server server vite ",
|
|
27
|
-
"docs:dev": "vitepress dev docs",
|
|
28
|
-
"docs:build": "vitepress build docs",
|
|
29
|
-
"docs:preview": "vitepress preview docs"
|
|
30
|
-
},
|
|
31
|
-
"keywords": [],
|
|
32
|
-
"author": "Softpro",
|
|
33
|
-
"license": "ISC",
|
|
34
|
-
"dependencies": {
|
|
35
|
-
"@opengis/fastify-auth": "^1.0.35",
|
|
36
|
-
"@opengis/fastify-file": "^1.0.17",
|
|
37
|
-
"@opengis/fastify-table": "^1.1.27",
|
|
38
|
-
"@opengis/v3-core": "^0.1.105",
|
|
39
|
-
"@opengis/v3-filter": "^0.0.31",
|
|
40
|
-
|
|
41
|
-
"@tiptap/extension-
|
|
42
|
-
"@tiptap/extension-
|
|
43
|
-
"@tiptap/
|
|
44
|
-
"@tiptap/
|
|
45
|
-
"@tiptap/
|
|
46
|
-
"@tiptap/
|
|
47
|
-
"@
|
|
48
|
-
"@
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
"
|
|
54
|
-
"
|
|
55
|
-
"
|
|
56
|
-
"
|
|
57
|
-
"
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
"
|
|
61
|
-
"
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
"
|
|
65
|
-
"eslint-
|
|
66
|
-
"
|
|
67
|
-
"
|
|
68
|
-
"
|
|
69
|
-
"
|
|
70
|
-
"
|
|
71
|
-
"
|
|
72
|
-
"
|
|
73
|
-
|
|
74
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "@opengis/admin",
|
|
3
|
+
"version": "0.1.43",
|
|
4
|
+
"description": "This project Softpro Admin",
|
|
5
|
+
"main": "dist/admin.js",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"directories": {
|
|
8
|
+
"test": "test"
|
|
9
|
+
},
|
|
10
|
+
"files": [
|
|
11
|
+
"dist/*",
|
|
12
|
+
"module/*",
|
|
13
|
+
"server/*",
|
|
14
|
+
"plugin.js",
|
|
15
|
+
"utils.js",
|
|
16
|
+
"config.js"
|
|
17
|
+
],
|
|
18
|
+
"scripts": {
|
|
19
|
+
"test": "node --test test/**/*.test.js",
|
|
20
|
+
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore",
|
|
21
|
+
"build": "vite build",
|
|
22
|
+
"build-app": "cross-env APP=true vite build",
|
|
23
|
+
"admin": "cross-env NODE_ENV=admin npm run start",
|
|
24
|
+
"admin1": "cross-env NODE_ENV=admin1 npm run start",
|
|
25
|
+
"prod": "cross-env NODE_ENV=production npm run start",
|
|
26
|
+
"start": "node --watch-path=server server vite ",
|
|
27
|
+
"docs:dev": "vitepress dev docs",
|
|
28
|
+
"docs:build": "vitepress build docs",
|
|
29
|
+
"docs:preview": "vitepress preview docs"
|
|
30
|
+
},
|
|
31
|
+
"keywords": [],
|
|
32
|
+
"author": "Softpro",
|
|
33
|
+
"license": "ISC",
|
|
34
|
+
"dependencies": {
|
|
35
|
+
"@opengis/fastify-auth": "^1.0.35",
|
|
36
|
+
"@opengis/fastify-file": "^1.0.17",
|
|
37
|
+
"@opengis/fastify-table": "^1.1.27",
|
|
38
|
+
"@opengis/v3-core": "^0.1.105",
|
|
39
|
+
"@opengis/v3-filter": "^0.0.31",
|
|
40
|
+
"@tiptap/core": "^2.8.0",
|
|
41
|
+
"@tiptap/extension-color": "^2.8.0",
|
|
42
|
+
"@tiptap/extension-mention": "^2.8.0",
|
|
43
|
+
"@tiptap/extension-placeholder": "^2.8.0",
|
|
44
|
+
"@tiptap/extension-text": "^2.8.0",
|
|
45
|
+
"@tiptap/extension-text-style": "^2.8.0",
|
|
46
|
+
"@tiptap/extension-underline": "^2.8.0",
|
|
47
|
+
"@tiptap/pm": "^2.8.0",
|
|
48
|
+
"@tiptap/starter-kit": "^2.8.0",
|
|
49
|
+
"@tiptap/suggestion": "^2.8.0",
|
|
50
|
+
"@tiptap/vue-3": "^2.8.0",
|
|
51
|
+
"@turf/turf": "^7.1.0",
|
|
52
|
+
"@vitejs/plugin-vue": "^5.0.4",
|
|
53
|
+
"close-with-grace": "^1.3.0",
|
|
54
|
+
"cross-env": "^7.0.3",
|
|
55
|
+
"fastify": "^4.26.1",
|
|
56
|
+
"fastify-plugin": "^4.0.0",
|
|
57
|
+
"maplibre-gl": "^4.7.0",
|
|
58
|
+
"moment": "^2.30.1",
|
|
59
|
+
"vite": "^5.1.4",
|
|
60
|
+
"vue": "^3.4.21",
|
|
61
|
+
"vue-router": "^4.3.0"
|
|
62
|
+
},
|
|
63
|
+
"devDependencies": {
|
|
64
|
+
"@panzoom/panzoom": "^4.5.1",
|
|
65
|
+
"@vue/eslint-config-typescript": "^12.0.0",
|
|
66
|
+
"eslint": "^8.49.0",
|
|
67
|
+
"eslint-config-airbnb": "^19.0.4",
|
|
68
|
+
"eslint-plugin-import": "^2.25.3",
|
|
69
|
+
"eslint-plugin-vue": "^9.17.0",
|
|
70
|
+
"markdown-it-abbr": "^2.0.0",
|
|
71
|
+
"mermaid": "^10.9.0",
|
|
72
|
+
"sass-embedded": "^1.79.1",
|
|
73
|
+
"vitepress": "^1.1.3",
|
|
74
|
+
"vitepress-plugin-mermaid": "^2.0.16",
|
|
75
|
+
"vitepress-plugin-tabs": "^0.5.0",
|
|
76
|
+
"vitepress-sidebar": "^1.22.0"
|
|
77
|
+
}
|
|
78
|
+
}
|
package/plugin.js
CHANGED
|
@@ -1,102 +1,102 @@
|
|
|
1
|
-
import fp from 'fastify-plugin';
|
|
2
|
-
import path from 'node:path';
|
|
3
|
-
|
|
4
|
-
import { getTemplatePath, getTemplate, pgClients } from '@opengis/fastify-table/utils.js';
|
|
5
|
-
|
|
6
|
-
import config from './config.js';
|
|
7
|
-
import getMenu from './server/routes/menu/controllers/getMenu.js';
|
|
8
|
-
|
|
9
|
-
config.prefix = config.prefix || '/api';
|
|
10
|
-
|
|
11
|
-
async function plugin(fastify, opts = config) {
|
|
12
|
-
// const prefix = config.prefix || '/api';
|
|
13
|
-
|
|
14
|
-
// core
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
fastify.register(import('./server/helpers/index.mjs'), opts);
|
|
18
|
-
// fastify.register(import('@opengis/fastify-auth'), config);
|
|
19
|
-
|
|
20
|
-
fastify.addHook('onListen', async () => {
|
|
21
|
-
const { client } = pgClients;
|
|
22
|
-
const json = await getMenu();
|
|
23
|
-
// insert interface list to db (user access management)
|
|
24
|
-
if (client?.pk?.['admin.routes'] && json?.length) {
|
|
25
|
-
const menuList = json.filter((el) => el?.menu?.length && el?.ua || el?.en || el?.name);
|
|
26
|
-
const interfaces = menuList.reduce((acc, curr) => { curr.menu.forEach((el) => acc.push(el.path)); return acc; }, []);
|
|
27
|
-
await client.query('update admin.routes set enabled=false where not array[route_id] <@ $1::text[]', [interfaces]);
|
|
28
|
-
|
|
29
|
-
const q = `insert into admin.menu(name, ord) values${
|
|
30
|
-
menuList.map((el, i) => `('${(el?.ua || el?.en || el?.name).replace(/'/g, '’')}', ${i}) `).join(',')
|
|
31
|
-
} on conflict (name) do update set ord=excluded.ord, enabled=true returning name, menu_id`;
|
|
32
|
-
const { rows = [] } = await client.query(q);
|
|
33
|
-
await client.query('update admin.menu set enabled=false where not array[menu_id] <@ $1::text[]', [rows.map((el) => el.menu_id)]);
|
|
34
|
-
|
|
35
|
-
const menus = rows.reduce((acc, curr) => Object.assign(acc, { [curr.menu_id]: menuList.find((item) => (item?.ua || item?.en || item?.name) === curr.name) }), {});
|
|
36
|
-
const values = Object.entries(menus).reduce((acc, curr) => { curr[1]?.menu?.forEach((el) => acc.push({ ...el, menuId: curr[0] })); return acc; }, []);
|
|
37
|
-
|
|
38
|
-
await Promise.all(values.filter((el) => el?.table).map(async (el) => Object.assign(el, { table: (await getTemplate('table', el.table))?.table || el.table })));
|
|
39
|
-
|
|
40
|
-
const q1 = `insert into admin.routes(route_id, alias, title, menu_id, table_name) values ${values.map((el) => `('${el.path}', '${el.path}', '${el.title}', '${el.menuId}', '${el.table}')`).join(',')}
|
|
41
|
-
on conflict (route_id) do update set menu_id=excluded.menu_id, title=excluded.title, enabled=true,
|
|
42
|
-
table_name=excluded.table_name returning route_id, table_name`;
|
|
43
|
-
try {
|
|
44
|
-
const { rowCount } = await client.query(q1);
|
|
45
|
-
console.log('interface insert ok', values, rowCount);
|
|
46
|
-
} catch (err) {
|
|
47
|
-
console.log('interface insert error', values, q1, err);
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
});
|
|
51
|
-
|
|
52
|
-
fastify.addHook('onListen', async () => {
|
|
53
|
-
const { client: pg } = pgClients;
|
|
54
|
-
const clsQuery = [];
|
|
55
|
-
if (!pg.pk?.['admin.cls']) return;
|
|
56
|
-
|
|
57
|
-
const selectList = await getTemplatePath('select');
|
|
58
|
-
const clsList = (await getTemplatePath('cls'))?.filter((el) => !(selectList?.map((el) => el?.[0]) || []).includes(el[0]));
|
|
59
|
-
const cls = (selectList || []).concat(clsList || [])
|
|
60
|
-
?.map((el) => ({ name: el[0], module: path.basename(path.dirname(path.dirname(el[1]))), type: { 'json': 'cls', 'sql': 'select' }[el[2]] }))
|
|
61
|
-
if (!cls?.length) return;
|
|
62
|
-
|
|
63
|
-
const dupes = cls.filter((el, idx, arr) => arr.map((item) => item.name).indexOf(el.name) !== idx);
|
|
64
|
-
console.log('cls insert skip dupes', dupes.map((el) => el.name));
|
|
65
|
-
|
|
66
|
-
try {
|
|
67
|
-
await Promise.all(cls.filter((el, idx, arr) => arr.map((item) => item.name).indexOf(el.name) === idx).map(async (el) => {
|
|
68
|
-
const { name, module, type } = el;
|
|
69
|
-
const loadTemplate = await getTemplate(type, name);
|
|
70
|
-
console.log(name, type);
|
|
71
|
-
if (type === 'select') {
|
|
72
|
-
clsQuery.push(`insert into admin.cls(name,type,data,module) values('${name}','sql','${(loadTemplate?.sql || loadTemplate)?.replace(/'/g, "''")}', '${module?.replace(/'/g, "''")}')`);
|
|
73
|
-
} else if (type === 'cls' && loadTemplate?.length) {
|
|
74
|
-
clsQuery.push(`insert into admin.cls(name,type, module) values('${name}','json', '${module?.replace(/'/g, "''")}');
|
|
75
|
-
insert into admin.cls(code,name,parent,icon)
|
|
76
|
-
select value->>'id',value->>'text','${name}',value->>'icon'
|
|
77
|
-
from json_array_elements('${JSON.stringify(loadTemplate).replace(/'/g, "''")}'::json)`);
|
|
78
|
-
} else {
|
|
79
|
-
console.log(name, type, 'empty');
|
|
80
|
-
}
|
|
81
|
-
}));
|
|
82
|
-
|
|
83
|
-
await pg.query('truncate admin.cls');
|
|
84
|
-
if (clsQuery.filter((el) => el).length) {
|
|
85
|
-
await pg.query(clsQuery.filter((el) => el).join(';'));
|
|
86
|
-
console.log('cls insert ok', clsQuery?.length);
|
|
87
|
-
}
|
|
88
|
-
} catch (err) {
|
|
89
|
-
console.error('cls insert error', err.toString());
|
|
90
|
-
}
|
|
91
|
-
});
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
// API
|
|
95
|
-
|
|
96
|
-
fastify.register(import('./server/routes/properties/index.mjs'), opts);
|
|
97
|
-
fastify.register(import('./server/routes/templates/index.mjs'), opts);
|
|
98
|
-
fastify.register(import('./server/routes/menu/index.mjs'), opts);
|
|
99
|
-
fastify.register(import('./server/routes/data/index.mjs'), opts);
|
|
100
|
-
|
|
101
|
-
}
|
|
1
|
+
import fp from 'fastify-plugin';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
|
|
4
|
+
import { getTemplatePath, getTemplate, pgClients } from '@opengis/fastify-table/utils.js';
|
|
5
|
+
|
|
6
|
+
import config from './config.js';
|
|
7
|
+
import getMenu from './server/routes/menu/controllers/getMenu.js';
|
|
8
|
+
|
|
9
|
+
config.prefix = config.prefix || '/api';
|
|
10
|
+
|
|
11
|
+
async function plugin(fastify, opts = config) {
|
|
12
|
+
// const prefix = config.prefix || '/api';
|
|
13
|
+
|
|
14
|
+
// core
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
fastify.register(import('./server/helpers/index.mjs'), opts);
|
|
18
|
+
// fastify.register(import('@opengis/fastify-auth'), config);
|
|
19
|
+
|
|
20
|
+
fastify.addHook('onListen', async () => {
|
|
21
|
+
const { client } = pgClients;
|
|
22
|
+
const json = await getMenu();
|
|
23
|
+
// insert interface list to db (user access management)
|
|
24
|
+
if (client?.pk?.['admin.routes'] && json?.length) {
|
|
25
|
+
const menuList = json.filter((el) => el?.menu?.length && el?.ua || el?.en || el?.name);
|
|
26
|
+
const interfaces = menuList.reduce((acc, curr) => { curr.menu.forEach((el) => acc.push(el.path)); return acc; }, []);
|
|
27
|
+
await client.query('update admin.routes set enabled=false where not array[route_id] <@ $1::text[]', [interfaces]);
|
|
28
|
+
|
|
29
|
+
const q = `insert into admin.menu(name, ord) values${
|
|
30
|
+
menuList.map((el, i) => `('${(el?.ua || el?.en || el?.name).replace(/'/g, '’')}', ${i}) `).join(',')
|
|
31
|
+
} on conflict (name) do update set ord=excluded.ord, enabled=true returning name, menu_id`;
|
|
32
|
+
const { rows = [] } = await client.query(q);
|
|
33
|
+
await client.query('update admin.menu set enabled=false where not array[menu_id] <@ $1::text[]', [rows.map((el) => el.menu_id)]);
|
|
34
|
+
|
|
35
|
+
const menus = rows.reduce((acc, curr) => Object.assign(acc, { [curr.menu_id]: menuList.find((item) => (item?.ua || item?.en || item?.name) === curr.name) }), {});
|
|
36
|
+
const values = Object.entries(menus).reduce((acc, curr) => { curr[1]?.menu?.forEach((el) => acc.push({ ...el, menuId: curr[0] })); return acc; }, []);
|
|
37
|
+
|
|
38
|
+
await Promise.all(values.filter((el) => el?.table).map(async (el) => Object.assign(el, { table: (await getTemplate('table', el.table))?.table || el.table })));
|
|
39
|
+
|
|
40
|
+
const q1 = `insert into admin.routes(route_id, alias, title, menu_id, table_name) values ${values.map((el) => `('${el.path}', '${el.path}', '${el.title}', '${el.menuId}', '${el.table}')`).join(',')}
|
|
41
|
+
on conflict (route_id) do update set menu_id=excluded.menu_id, title=excluded.title, enabled=true,
|
|
42
|
+
table_name=excluded.table_name returning route_id, table_name`;
|
|
43
|
+
try {
|
|
44
|
+
const { rowCount } = await client.query(q1);
|
|
45
|
+
console.log('interface insert ok', values, rowCount);
|
|
46
|
+
} catch (err) {
|
|
47
|
+
console.log('interface insert error', values, q1, err);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
fastify.addHook('onListen', async () => {
|
|
53
|
+
const { client: pg } = pgClients;
|
|
54
|
+
const clsQuery = [];
|
|
55
|
+
if (!pg.pk?.['admin.cls']) return;
|
|
56
|
+
|
|
57
|
+
const selectList = await getTemplatePath('select');
|
|
58
|
+
const clsList = (await getTemplatePath('cls'))?.filter((el) => !(selectList?.map((el) => el?.[0]) || []).includes(el[0]));
|
|
59
|
+
const cls = (selectList || []).concat(clsList || [])
|
|
60
|
+
?.map((el) => ({ name: el[0], module: path.basename(path.dirname(path.dirname(el[1]))), type: { 'json': 'cls', 'sql': 'select' }[el[2]] }))
|
|
61
|
+
if (!cls?.length) return;
|
|
62
|
+
|
|
63
|
+
const dupes = cls.filter((el, idx, arr) => arr.map((item) => item.name).indexOf(el.name) !== idx);
|
|
64
|
+
console.log('cls insert skip dupes', dupes.map((el) => el.name));
|
|
65
|
+
|
|
66
|
+
try {
|
|
67
|
+
await Promise.all(cls.filter((el, idx, arr) => arr.map((item) => item.name).indexOf(el.name) === idx).map(async (el) => {
|
|
68
|
+
const { name, module, type } = el;
|
|
69
|
+
const loadTemplate = await getTemplate(type, name);
|
|
70
|
+
console.log(name, type);
|
|
71
|
+
if (type === 'select') {
|
|
72
|
+
clsQuery.push(`insert into admin.cls(name,type,data,module) values('${name}','sql','${(loadTemplate?.sql || loadTemplate)?.replace(/'/g, "''")}', '${module?.replace(/'/g, "''")}')`);
|
|
73
|
+
} else if (type === 'cls' && loadTemplate?.length) {
|
|
74
|
+
clsQuery.push(`insert into admin.cls(name,type, module) values('${name}','json', '${module?.replace(/'/g, "''")}');
|
|
75
|
+
insert into admin.cls(code,name,parent,icon)
|
|
76
|
+
select value->>'id',value->>'text','${name}',value->>'icon'
|
|
77
|
+
from json_array_elements('${JSON.stringify(loadTemplate).replace(/'/g, "''")}'::json)`);
|
|
78
|
+
} else {
|
|
79
|
+
console.log(name, type, 'empty');
|
|
80
|
+
}
|
|
81
|
+
}));
|
|
82
|
+
|
|
83
|
+
await pg.query('truncate admin.cls');
|
|
84
|
+
if (clsQuery.filter((el) => el).length) {
|
|
85
|
+
await pg.query(clsQuery.filter((el) => el).join(';'));
|
|
86
|
+
console.log('cls insert ok', clsQuery?.length);
|
|
87
|
+
}
|
|
88
|
+
} catch (err) {
|
|
89
|
+
console.error('cls insert error', err.toString());
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
// API
|
|
95
|
+
|
|
96
|
+
fastify.register(import('./server/routes/properties/index.mjs'), opts);
|
|
97
|
+
fastify.register(import('./server/routes/templates/index.mjs'), opts);
|
|
98
|
+
fastify.register(import('./server/routes/menu/index.mjs'), opts);
|
|
99
|
+
fastify.register(import('./server/routes/data/index.mjs'), opts);
|
|
100
|
+
|
|
101
|
+
}
|
|
102
102
|
export default fp(plugin)
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
export default async function badge(data, options = {}) {
|
|
2
|
-
if (!data) return '-';
|
|
3
|
-
//const cls = await getSelect(options.data, { val: data, full: 1 });
|
|
4
|
-
|
|
5
|
-
return data;
|
|
6
|
-
/*const html = cls?.map((el) => {
|
|
7
|
-
const color = bscolor[el.color] || el.color || '#aaa';
|
|
8
|
-
return `<span class="el-tag el-tag--mini" style="color:${color || '#aaa'};border-color:${color || '#aaa'};background:unset;">
|
|
9
|
-
${funcs.locale(el.id, { lang: root.lang, prefix: opt.data, type: 'cls' }) || el.text}</span>`;
|
|
10
|
-
}).join(', ');
|
|
11
|
-
return html;*/
|
|
1
|
+
export default async function badge(data, options = {}) {
|
|
2
|
+
if (!data) return '-';
|
|
3
|
+
//const cls = await getSelect(options.data, { val: data, full: 1 });
|
|
4
|
+
|
|
5
|
+
return data;
|
|
6
|
+
/*const html = cls?.map((el) => {
|
|
7
|
+
const color = bscolor[el.color] || el.color || '#aaa';
|
|
8
|
+
return `<span class="el-tag el-tag--mini" style="color:${color || '#aaa'};border-color:${color || '#aaa'};background:unset;">
|
|
9
|
+
${funcs.locale(el.id, { lang: root.lang, prefix: opt.data, type: 'cls' }) || el.text}</span>`;
|
|
10
|
+
}).join(', ');
|
|
11
|
+
return html;*/
|
|
12
12
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export default async function _hb() {
|
|
2
|
-
return '';
|
|
1
|
+
export default async function _hb() {
|
|
2
|
+
return '';
|
|
3
3
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export default async function map() {
|
|
2
|
-
return '';
|
|
1
|
+
export default async function map() {
|
|
2
|
+
return '';
|
|
3
3
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export default async function _mls(data, options={}) {
|
|
2
|
-
return data.hash?.ua || options?.hash?.ua || '';
|
|
1
|
+
export default async function _mls(data, options={}) {
|
|
2
|
+
return data.hash?.ua || options?.hash?.ua || '';
|
|
3
3
|
}
|