@opengis/cms 0.0.36 → 0.0.37
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/MenuAddPage-DJPQEn2D.js +4 -0
- package/dist/MenuItemPage-EH8svyv5.js +4 -0
- package/dist/MenuPage-BgE0yNpY.js +4 -0
- package/dist/index.js +22726 -13
- package/dist/index.umd.cjs +38 -38
- package/module/cms/cls/content.status.json +18 -0
- package/module/cms/cls/user_type.json +10 -0
- package/module/cms/form/admin.users.form.json +78 -0
- package/module/cms/select/cms.page_type.sql +2 -0
- package/module/cms/select/collection.sql +1 -0
- package/module/cms/select/news_tag_id.sql +12 -0
- package/module/cms/select/tag_id.sql +1 -0
- package/module/cms/table/admin.users.table.json +54 -0
- package/module/cms/table/collection.default.table.json +96 -0
- package/module/cms/table/single.default.table.json +114 -0
- package/package.json +2 -1
- package/dist/MenuAddPage-CUvJmUMq.js +0 -112
- package/dist/MenuItemPage-sG5nAbiE.js +0 -1375
- package/dist/MenuPage-jPWKpo5C.js +0 -102
- package/dist/index-7TVhDCPx.js +0 -21173
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schema": {
|
|
3
|
+
"user_name": {
|
|
4
|
+
"type": "Text",
|
|
5
|
+
"rules": [
|
|
6
|
+
"required"
|
|
7
|
+
],
|
|
8
|
+
"ua": "Ім'я",
|
|
9
|
+
"i": "Вноситься ім'я користувача, що буде відображатися у системі"
|
|
10
|
+
},
|
|
11
|
+
"sur_name": {
|
|
12
|
+
"type": "Text",
|
|
13
|
+
"rules": [
|
|
14
|
+
"required"
|
|
15
|
+
],
|
|
16
|
+
"ua": "Прізвище",
|
|
17
|
+
"i": "Вноситься прізвище користувача, що буде відображатися у системі"
|
|
18
|
+
},
|
|
19
|
+
"father_name": {
|
|
20
|
+
"ua": "По-батькові",
|
|
21
|
+
"type": "Text"
|
|
22
|
+
},
|
|
23
|
+
"phone": {
|
|
24
|
+
"type": "Text",
|
|
25
|
+
"mask": "+389999999999",
|
|
26
|
+
"ua": "Телефон",
|
|
27
|
+
"i": "Вноситься телефон користувача"
|
|
28
|
+
},
|
|
29
|
+
"email": {
|
|
30
|
+
"type": "Text",
|
|
31
|
+
"ua": "E-mail",
|
|
32
|
+
"i": "Вноситься електронна адреса користувача",
|
|
33
|
+
"rules": [
|
|
34
|
+
"email"
|
|
35
|
+
]
|
|
36
|
+
},
|
|
37
|
+
"login": {
|
|
38
|
+
"type": "Text",
|
|
39
|
+
"ua": "Логін",
|
|
40
|
+
"i": "Вноситься довільний логін користувача латинськими літерами, що буде використовуватися для входу в систему",
|
|
41
|
+
"rules": [
|
|
42
|
+
"required"
|
|
43
|
+
]
|
|
44
|
+
},
|
|
45
|
+
"password": {
|
|
46
|
+
"type": "Text",
|
|
47
|
+
"ua": "Пароль",
|
|
48
|
+
"rules": [
|
|
49
|
+
"required",
|
|
50
|
+
{
|
|
51
|
+
"type": "regexp",
|
|
52
|
+
"pattern": "^.{8,}$",
|
|
53
|
+
"message": "Пароль повинен бути більше 8 символів"
|
|
54
|
+
}
|
|
55
|
+
],
|
|
56
|
+
"i": "Вноситься пароль, що буде використовуватися для входу в систему (рекомендоване використання складних паролів)"
|
|
57
|
+
},
|
|
58
|
+
"avatar": {
|
|
59
|
+
"type": "File",
|
|
60
|
+
"ua": "Аватар",
|
|
61
|
+
"i": "Додається зображення, що буде відображено в системі у якості аватара цього користувача"
|
|
62
|
+
},
|
|
63
|
+
"user_type": {
|
|
64
|
+
"type": "Select",
|
|
65
|
+
"ua": "Тип користувача",
|
|
66
|
+
"i": "Вноситься тип користувача",
|
|
67
|
+
"data": "user_type"
|
|
68
|
+
},
|
|
69
|
+
"enabled": {
|
|
70
|
+
"type": "Switcher",
|
|
71
|
+
"label": "Доступ"
|
|
72
|
+
},
|
|
73
|
+
"twofa": {
|
|
74
|
+
"type": "Switcher",
|
|
75
|
+
"label": "Двофакторна авторизація"
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
SELECT content_type_id, name FROM site.content_types where type='collection'
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
select a.id, a.title, tags from data.news a
|
|
2
|
+
left join lateral(select array_agg(tag_id) as tags from site.tag_data b where a.id=b.data_id)b on 1=1
|
|
3
|
+
|
|
4
|
+
where
|
|
5
|
+
case when '{{parent}}'<> ''
|
|
6
|
+
then '{{parent}}'=any(b.tags)
|
|
7
|
+
else true
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
and status='published'
|
|
11
|
+
|
|
12
|
+
order by a.updated_at
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
select tag_id, value from site.tags order by value
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
{
|
|
2
|
+
"ua": "Користувачі",
|
|
3
|
+
"key": "uid",
|
|
4
|
+
"order": "cdate desc",
|
|
5
|
+
"access": "admin",
|
|
6
|
+
"sqlColumns": "*",
|
|
7
|
+
"form": "admin.users.form",
|
|
8
|
+
"table": "admin.users",
|
|
9
|
+
"sql": [
|
|
10
|
+
{
|
|
11
|
+
"name": "social_auth_sql",
|
|
12
|
+
"sql": "select social_auth_obj,social_auth_date from admin.users_social_auth where uid=t.uid limit 1"
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"sql": "SELECT coalesce(sur_name, '') || ' ' || coalesce(user_name, '') || ' ' || coalesce(father_name, '') as full_name FROM admin.users WHERE uid = t.uid",
|
|
16
|
+
"name": "full_name_sql"
|
|
17
|
+
}
|
|
18
|
+
],
|
|
19
|
+
"columns": [
|
|
20
|
+
{
|
|
21
|
+
"ua": "ПІБ",
|
|
22
|
+
"name": "full_name",
|
|
23
|
+
"format": "select",
|
|
24
|
+
"data": "full_name_sql"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"ua": "Тип користувача",
|
|
28
|
+
"name": "user_type_text",
|
|
29
|
+
"format": "select",
|
|
30
|
+
"data": "user_type_text"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"ua": "Статус доступу",
|
|
34
|
+
"name": "enabled"
|
|
35
|
+
}
|
|
36
|
+
],
|
|
37
|
+
"filters": [
|
|
38
|
+
{
|
|
39
|
+
"label": "Тип користувача",
|
|
40
|
+
"type": "Check",
|
|
41
|
+
"name": "user_type",
|
|
42
|
+
"data": "user_type"
|
|
43
|
+
}
|
|
44
|
+
],
|
|
45
|
+
"meta": {
|
|
46
|
+
"title": "full_name",
|
|
47
|
+
"search": "user_name,user_rnokpp"
|
|
48
|
+
},
|
|
49
|
+
"actions": [
|
|
50
|
+
"edit",
|
|
51
|
+
"del",
|
|
52
|
+
"add"
|
|
53
|
+
]
|
|
54
|
+
}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
{
|
|
2
|
+
"table": "site.contents",
|
|
3
|
+
"columns": [
|
|
4
|
+
{
|
|
5
|
+
"label": "Slug",
|
|
6
|
+
"name": "slug",
|
|
7
|
+
"parent": "title",
|
|
8
|
+
"required": true,
|
|
9
|
+
"type": "slug"
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"label": "Title",
|
|
13
|
+
"name": "title",
|
|
14
|
+
"required": true,
|
|
15
|
+
"type": "text",
|
|
16
|
+
"localization": true
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"label": "Status",
|
|
20
|
+
"name": "status",
|
|
21
|
+
"type": "select",
|
|
22
|
+
"data": "content.status",
|
|
23
|
+
"options": [
|
|
24
|
+
{
|
|
25
|
+
"id": "draft",
|
|
26
|
+
"text": "Draft"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"id": "published",
|
|
30
|
+
"text": "Published"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"id": "archived",
|
|
34
|
+
"text": "Archived"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"id": "delayPublished",
|
|
38
|
+
"text": "Delay Published"
|
|
39
|
+
}
|
|
40
|
+
],
|
|
41
|
+
"required": true
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"label": "Publish at",
|
|
45
|
+
"name": "published_at",
|
|
46
|
+
"required": true,
|
|
47
|
+
"type": "datetime"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"label": "Зображення",
|
|
51
|
+
"name": "main_image",
|
|
52
|
+
"type": "mediaselect"
|
|
53
|
+
}
|
|
54
|
+
],
|
|
55
|
+
"filters": [
|
|
56
|
+
{
|
|
57
|
+
"extra": false,
|
|
58
|
+
"id": "status",
|
|
59
|
+
"name": "status",
|
|
60
|
+
"title": "Статус",
|
|
61
|
+
"type": "Check",
|
|
62
|
+
"data": "content.status",
|
|
63
|
+
"ua": "Статус"
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
"extra": false,
|
|
67
|
+
"label": "Publish at",
|
|
68
|
+
"name": "published_at",
|
|
69
|
+
"type": "Date"
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
"extra": false,
|
|
73
|
+
"name": "tag_list",
|
|
74
|
+
"type": "Tags",
|
|
75
|
+
"sql": "id in (select b.data_id from site.tags a left join site.tag_data b on a.tag_id=b.tag_id where a.tag_id=any($1))",
|
|
76
|
+
"label": "Теги"
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
"extra": false,
|
|
80
|
+
"columns": "slug,title",
|
|
81
|
+
"id": "search",
|
|
82
|
+
"name": "search",
|
|
83
|
+
"placeholder": "Пошук по тексту",
|
|
84
|
+
"title": "Пошук по тексту",
|
|
85
|
+
"type": "Text"
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
"extra": false,
|
|
89
|
+
"id": "created_at",
|
|
90
|
+
"name": "created_at",
|
|
91
|
+
"title": "Дата створення",
|
|
92
|
+
"type": "Date",
|
|
93
|
+
"ua": "Дата створення"
|
|
94
|
+
}
|
|
95
|
+
]
|
|
96
|
+
}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
{
|
|
2
|
+
"table": "site.contents",
|
|
3
|
+
"columns": [
|
|
4
|
+
{
|
|
5
|
+
"label": "Slug",
|
|
6
|
+
"name": "slug",
|
|
7
|
+
"parent": "title",
|
|
8
|
+
"required": true,
|
|
9
|
+
"type": "slug"
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"label": "Title",
|
|
13
|
+
"name": "title",
|
|
14
|
+
"required": true,
|
|
15
|
+
"type": "text",
|
|
16
|
+
"localization": true
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"label": "Status",
|
|
20
|
+
"name": "status",
|
|
21
|
+
"type": "select",
|
|
22
|
+
"data": "content.status",
|
|
23
|
+
"options": [
|
|
24
|
+
{
|
|
25
|
+
"id": "draft",
|
|
26
|
+
"text": "Draft"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"id": "published",
|
|
30
|
+
"text": "Published"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"id": "archived",
|
|
34
|
+
"text": "Archived"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"id": "delayPublished",
|
|
38
|
+
"text": "Delay Published"
|
|
39
|
+
}
|
|
40
|
+
],
|
|
41
|
+
"required": true
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"label": "Publish at",
|
|
45
|
+
"name": "published_at",
|
|
46
|
+
"required": true,
|
|
47
|
+
"type": "datetime"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"label": "Контент",
|
|
51
|
+
"name": "single_body",
|
|
52
|
+
"type": "richtext",
|
|
53
|
+
"localization": true
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"name": "single_sections",
|
|
57
|
+
"label": "Секції",
|
|
58
|
+
"type": "reference",
|
|
59
|
+
"localization": true
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
"label": "Зображення",
|
|
63
|
+
"name": "main_image",
|
|
64
|
+
"type": "mediaselect"
|
|
65
|
+
}
|
|
66
|
+
],
|
|
67
|
+
"filters": [
|
|
68
|
+
{
|
|
69
|
+
"extra": false,
|
|
70
|
+
"id": "status",
|
|
71
|
+
"name": "status",
|
|
72
|
+
"title": "Статус",
|
|
73
|
+
"type": "Check",
|
|
74
|
+
"data": "content.status",
|
|
75
|
+
"ua": "Статус"
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
"extra": false,
|
|
79
|
+
"label": "Publish at",
|
|
80
|
+
"name": "published_at",
|
|
81
|
+
"type": "Date"
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
"extra": false,
|
|
85
|
+
"label": "Контент",
|
|
86
|
+
"name": "single_body",
|
|
87
|
+
"type": "Text"
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
"extra": false,
|
|
91
|
+
"name": "tag_list",
|
|
92
|
+
"type": "Tags",
|
|
93
|
+
"sql": "id in (select b.data_id from site.tags a left join site.tag_data b on a.tag_id=b.tag_id where a.tag_id=any($1))",
|
|
94
|
+
"label": "Теги"
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
"extra": false,
|
|
98
|
+
"columns": "slug,title",
|
|
99
|
+
"id": "search",
|
|
100
|
+
"name": "search",
|
|
101
|
+
"placeholder": "Пошук по тексту",
|
|
102
|
+
"title": "Пошук по тексту",
|
|
103
|
+
"type": "Text"
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
"extra": false,
|
|
107
|
+
"id": "created_at",
|
|
108
|
+
"name": "created_at",
|
|
109
|
+
"title": "Дата створення",
|
|
110
|
+
"type": "Date",
|
|
111
|
+
"ua": "Дата створення"
|
|
112
|
+
}
|
|
113
|
+
]
|
|
114
|
+
}
|
package/package.json
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opengis/cms",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.37",
|
|
4
4
|
"description": "cms",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": "Softpro",
|
|
7
7
|
"main": "./dist/index.js",
|
|
8
8
|
"license": "EULA",
|
|
9
9
|
"files": [
|
|
10
|
+
"module",
|
|
10
11
|
"dist",
|
|
11
12
|
"server",
|
|
12
13
|
"plugin.js"
|
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
import { defineComponent as y, ref as m, openBlock as x, createElementBlock as b, createElementVNode as t, unref as r, createVNode as l, toDisplayString as f, createTextVNode as w } from "vue";
|
|
2
|
-
import { useRouter as k, useRoute as _ } from "vue-router";
|
|
3
|
-
import { u as V, A as q, S, l as C, y as c, Q as M, e as N } from "./index-7TVhDCPx.js";
|
|
4
|
-
const $ = { class: "space-y-6 max-w-7xl mx-auto" }, j = { class: "flex items-center justify-between" }, A = { class: "flex items-center gap-4" }, E = { class: "text-2xl font-semibold text-gray-900 dark:text-white" }, T = { class: "flex items-center space-x-3" }, U = { class: "max-w-[1000px]" }, R = /* @__PURE__ */ y({
|
|
5
|
-
__name: "MenuAddPage",
|
|
6
|
-
setup(B) {
|
|
7
|
-
M["vs-input-monaco-editor"] = N;
|
|
8
|
-
const { t: e } = V(), u = k(), g = _(), h = m([
|
|
9
|
-
{
|
|
10
|
-
key: "name",
|
|
11
|
-
title: e("cms.menu.form.name"),
|
|
12
|
-
type: "text",
|
|
13
|
-
placeholder: e("cms.menu.form.name"),
|
|
14
|
-
required: !0,
|
|
15
|
-
validators: ["required"]
|
|
16
|
-
},
|
|
17
|
-
{
|
|
18
|
-
key: "description",
|
|
19
|
-
title: e("cms.menu.form.description"),
|
|
20
|
-
type: "text",
|
|
21
|
-
placeholder: e("cms.menu.form.description"),
|
|
22
|
-
required: !0,
|
|
23
|
-
validators: ["required"]
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
key: "locale",
|
|
27
|
-
title: e("cms.menu.form.language"),
|
|
28
|
-
type: "select",
|
|
29
|
-
placeholder: e("cms.menu.form.language"),
|
|
30
|
-
options: [
|
|
31
|
-
{ text: "Ukrainian", id: "uk" },
|
|
32
|
-
{ text: "English", id: "en" }
|
|
33
|
-
],
|
|
34
|
-
required: !0,
|
|
35
|
-
validators: ["required"]
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
key: "content",
|
|
39
|
-
title: e("cms.menu.form.content"),
|
|
40
|
-
type: "monaco-editor",
|
|
41
|
-
height: "500px",
|
|
42
|
-
language: "yaml",
|
|
43
|
-
theme: "vs-light"
|
|
44
|
-
}
|
|
45
|
-
]), a = m({}), i = m({}), v = async () => {
|
|
46
|
-
try {
|
|
47
|
-
if (await i.value.validate()) {
|
|
48
|
-
c({
|
|
49
|
-
type: "warning",
|
|
50
|
-
title: e("cms.common.actions.warning"),
|
|
51
|
-
message: e("cms.menu.createMenuFailed")
|
|
52
|
-
});
|
|
53
|
-
return;
|
|
54
|
-
}
|
|
55
|
-
await fetch("/api/cms-menu", {
|
|
56
|
-
method: "POST",
|
|
57
|
-
headers: {
|
|
58
|
-
"Content-Type": "application/json"
|
|
59
|
-
},
|
|
60
|
-
body: JSON.stringify(a.value)
|
|
61
|
-
}), c({
|
|
62
|
-
title: e("cms.common.success"),
|
|
63
|
-
type: "success",
|
|
64
|
-
message: e("cms.common.successMessage")
|
|
65
|
-
}), a.value = {}, u.push("/menu");
|
|
66
|
-
} catch (o) {
|
|
67
|
-
console.log(o), c({
|
|
68
|
-
title: e("cms.common.error"),
|
|
69
|
-
type: "error",
|
|
70
|
-
message: e("cms.common.errorMessage")
|
|
71
|
-
});
|
|
72
|
-
}
|
|
73
|
-
};
|
|
74
|
-
return (o, s) => {
|
|
75
|
-
var d, p;
|
|
76
|
-
return x(), b("div", $, [
|
|
77
|
-
t("div", j, [
|
|
78
|
-
t("div", A, [
|
|
79
|
-
t("button", {
|
|
80
|
-
onClick: s[0] || (s[0] = (n) => r(u).back()),
|
|
81
|
-
class: "p-2 text-gray-500 rounded-full hover:text-gray-900 dark:text-gray-400 dark:hover:text-white hover:bg-gray-100 dark:hover:bg-gray-700"
|
|
82
|
-
}, [
|
|
83
|
-
l(r(q), { class: "w-5 h-5" })
|
|
84
|
-
]),
|
|
85
|
-
t("h1", E, f(o.$t((p = (d = r(g)) == null ? void 0 : d.meta) == null ? void 0 : p.title)), 1)
|
|
86
|
-
]),
|
|
87
|
-
t("div", T, [
|
|
88
|
-
t("button", {
|
|
89
|
-
onClick: v,
|
|
90
|
-
class: "inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium h-9 px-4 py-2 bg-blue-600 text-white shadow-md transition-all duration-200 transform hover:bg-blue-700 hover:shadow-lg hover:scale-105 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50"
|
|
91
|
-
}, [
|
|
92
|
-
l(r(S), { class: "w-4 h-4 mr-2" }),
|
|
93
|
-
w(" " + f(o.$t("cms.common.actions.save")), 1)
|
|
94
|
-
])
|
|
95
|
-
])
|
|
96
|
-
]),
|
|
97
|
-
t("div", U, [
|
|
98
|
-
l(r(C), {
|
|
99
|
-
schema: h.value,
|
|
100
|
-
modelValue: a.value,
|
|
101
|
-
"onUpdate:modelValue": s[1] || (s[1] = (n) => a.value = n),
|
|
102
|
-
form: i.value,
|
|
103
|
-
"onUpdate:form": s[2] || (s[2] = (n) => i.value = n)
|
|
104
|
-
}, null, 8, ["schema", "modelValue", "form"])
|
|
105
|
-
])
|
|
106
|
-
]);
|
|
107
|
-
};
|
|
108
|
-
}
|
|
109
|
-
});
|
|
110
|
-
export {
|
|
111
|
-
R as default
|
|
112
|
-
};
|