@opengis/cms 0.0.24 → 0.0.27
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 +98 -98
- package/dist/index-W-qQIppj-DunG40EG.js +2452 -0
- package/dist/index.html +29 -35
- package/dist/index.js +19855 -0
- package/dist/index.umd.cjs +199 -0
- package/package.json +68 -67
- package/plugin.js +76 -76
- package/server/app.js +35 -35
- package/server/config.js +4 -4
- package/server/functions/getDraftKey.js +22 -22
- package/server/index.js +22 -22
- package/server/migrations/fixes.sql +123 -123
- package/server/migrations/site.sql +545 -545
- package/server/plugins/adminHook.js +78 -78
- package/server/plugins/hook.js +59 -59
- package/server/plugins/vite.js +84 -84
- package/server/routes/category/controllers/cms.category.delete.js +21 -21
- package/server/routes/category/controllers/cms.category.get.js +17 -17
- package/server/routes/category/controllers/cms.category.list.js +16 -16
- package/server/routes/category/controllers/cms.category.post.js +21 -21
- package/server/routes/category/controllers/cms.category.put.js +23 -23
- package/server/routes/category/index.mjs +22 -22
- package/server/routes/cms/controllers/cmsStat.js +55 -55
- package/server/routes/cms/controllers/cmsSuggest.js +57 -57
- package/server/routes/cms/controllers/deleteContent.js +114 -114
- package/server/routes/cms/controllers/deleteMedia.js +75 -75
- package/server/routes/cms/controllers/downloadMedia.js +48 -48
- package/server/routes/cms/controllers/getContent.js +110 -110
- package/server/routes/cms/controllers/getContentBySlug.js +95 -95
- package/server/routes/cms/controllers/getPermissions.js +15 -15
- package/server/routes/cms/controllers/insertContent.js +218 -218
- package/server/routes/cms/controllers/listMedia.js +93 -93
- package/server/routes/cms/controllers/metadataMedia.js +38 -38
- package/server/routes/cms/controllers/properties.get.js +53 -53
- package/server/routes/cms/controllers/properties.post.js +99 -99
- package/server/routes/cms/controllers/searchContent.js +205 -205
- package/server/routes/cms/controllers/setPermissions.js +49 -49
- package/server/routes/cms/controllers/translate.js +89 -89
- package/server/routes/cms/controllers/updateContent.js +238 -238
- package/server/routes/cms/controllers/uploadMedia.js +78 -78
- package/server/routes/cms/index.mjs +114 -114
- package/server/routes/cms/utils/additionalData.js +35 -35
- package/server/routes/cms/utils/getCollection.js +81 -81
- package/server/routes/cms/utils/getSingle.js +187 -187
- package/server/routes/cms/utils/insertContentLocalization.js +86 -86
- package/server/routes/cms/utils/requestTranslation.js +85 -85
- package/server/routes/cms/utils/updateLocalization.js +47 -47
- package/server/routes/cmsSpace/controllers/deleteSpace.js +25 -25
- package/server/routes/cmsSpace/controllers/getSpaces.js +27 -27
- package/server/routes/cmsSpace/controllers/insertSpace.js +21 -21
- package/server/routes/cmsSpace/controllers/updateSpace.js +23 -23
- package/server/routes/cmsSpace/index.mjs +20 -20
- package/server/routes/contentType/controllers/addContentType.js +162 -162
- package/server/routes/contentType/controllers/contentTypeList.js +54 -54
- package/server/routes/contentType/controllers/delContentType.js +75 -75
- package/server/routes/contentType/controllers/editContentType.js +61 -61
- package/server/routes/contentType/controllers/getContentType.js +37 -37
- package/server/routes/contentType/index.mjs +35 -35
- package/server/routes/contentType/utils/updateContents.js +28 -28
- package/server/routes/contentType/utils/updateCustomContentTable.js +55 -55
- package/server/routes/feedback/controllers/email.list.js +24 -24
- package/server/routes/feedback/controllers/feedback.js +48 -48
- package/server/routes/feedback/controllers/feedback.list.js +37 -37
- package/server/routes/feedback/controllers/news.subscriptions.js +44 -44
- package/server/routes/feedback/index.mjs +71 -71
- package/server/routes/logs/controllers/export.user.logs.js +77 -77
- package/server/routes/logs/controllers/user.logs.js +44 -44
- package/server/routes/logs/index.mjs +9 -9
- package/server/routes/menu/controllers/addMenu.js +37 -37
- package/server/routes/menu/controllers/delMenu.js +31 -31
- package/server/routes/menu/controllers/editMenu.js +41 -41
- package/server/routes/menu/controllers/getMenu.js +42 -42
- package/server/routes/menu/index.mjs +13 -13
- package/server/routes/migration/controllers/collectionToCustom.js +137 -137
- package/server/routes/migration/index.mjs +8 -8
- package/server/routes/root.mjs +8 -8
- package/server/routes/tags/controllers/add.tags.js +24 -24
- package/server/routes/tags/controllers/del.tags.js +19 -19
- package/server/routes/tags/controllers/edit.tags.js +25 -25
- package/server/routes/tags/controllers/get.tags.js +15 -15
- package/server/routes/tags/index.mjs +14 -14
- package/server/templates/cls/cms.category_type.json +9 -9
- package/server/templates/cls/cms.content_review_status.json +9 -9
- package/server/templates/cls/cms.content_status.json +9 -9
- package/server/templates/cls/cms.content_type.json +9 -9
- package/server/templates/cls/cms.lang.json +9 -9
- package/server/templates/page/login.html +126 -126
- package/server/templates/select/core.user_mentioned.sql +1 -1
- package/dist/assets/AddUser-CX-McfRW.js +0 -1
- package/dist/assets/ApiKeys-DSv1exYv.js +0 -16
- package/dist/assets/Appearance-DDtOUvCV.js +0 -6
- package/dist/assets/ArticlesPage-D6B3cZsl.js +0 -6
- package/dist/assets/BuilderPage-CCeSMVWe.js +0 -1
- package/dist/assets/CollectionsBreadcrumb.vue_vue_type_script_setup_true_lang-DVYVfYF4.js +0 -1
- package/dist/assets/CollectionsPage-CHk8Cn5k.js +0 -1
- package/dist/assets/Dashboard-Bs7sXO6h.js +0 -11
- package/dist/assets/EditCollectionPage-gPuLJrN8.js +0 -41
- package/dist/assets/EmailPage-DhlWsPxk.js +0 -1
- package/dist/assets/EmptyData-Ct-xQv_N.js +0 -1
- package/dist/assets/FeedbackPage-DtaOncVv.js +0 -1
- package/dist/assets/Logs-CZ5klHNK.js +0 -1
- package/dist/assets/MediaBreadcrumb-BpOxt5PK.js +0 -11
- package/dist/assets/MediaPage-DqRcZFlO.js +0 -16
- package/dist/assets/MenuAddPage-BLcoVgrS.js +0 -1
- package/dist/assets/MenuItemPage-B2otXqkz.js +0 -20
- package/dist/assets/MenuPage-C00m4Fc_.js +0 -1
- package/dist/assets/MonacoEditor.vue_vue_type_script_setup_true_lang-CjoEsC67.js +0 -3
- package/dist/assets/PermissionsPage-LtqcCJ14.js +0 -1
- package/dist/assets/Settings-BHH6RoBP.js +0 -1
- package/dist/assets/SettingsTable-CY5pZx1z.js +0 -1
- package/dist/assets/SettingsTitle-t4WJBFxZ.js +0 -1
- package/dist/assets/SingletonsPage-Bn2Ypjhs.js +0 -6
- package/dist/assets/TagsPage-DAiakEth.js +0 -1
- package/dist/assets/UniversalTable.vue_vue_type_script_setup_true_lang-BQ5m4aZd.js +0 -11
- package/dist/assets/UniversalTablePagination.vue_vue_type_script_setup_true_lang-DppVBws0.js +0 -1
- package/dist/assets/Users-CMH5j0db.js +0 -1
- package/dist/assets/UsersPage-CDGreEib.js +0 -1
- package/dist/assets/arrow-up-DCe0WsrM.js +0 -16
- package/dist/assets/calendar-o9t4MkD2.js +0 -6
- package/dist/assets/chevron-left-WFftVS9c.js +0 -6
- package/dist/assets/chevron-right-BiiSb3Be.js +0 -6
- package/dist/assets/contentForm-unZQhjCu.js +0 -6
- package/dist/assets/en-BDx3Svx8.js +0 -1
- package/dist/assets/eye-Dijywc6g.js +0 -6
- package/dist/assets/file-B_duymIT.js +0 -6
- package/dist/assets/general-CkN_0qIV.js +0 -1
- package/dist/assets/index-BIp7eSXk.js +0 -1
- package/dist/assets/index-DCW2e4Az.js +0 -9
- package/dist/assets/index-DGweaj24.js +0 -1
- package/dist/assets/index-W-qQIppj-BDlsxaGB.js +0 -1
- package/dist/assets/index-W-qQIppj-BsopI3Hz-BIZR-dhy.js +0 -1
- package/dist/assets/index-oQz9FOqL.css +0 -1
- package/dist/assets/index-yMJAVBXk.js +0 -290
- package/dist/assets/list-CXRbSNky.js +0 -6
- package/dist/assets/logo-Cct5WB26.png +0 -0
- package/dist/assets/pencil-CwnPP4IJ.js +0 -6
- package/dist/assets/plus-DLR44m6p.js +0 -6
- package/dist/assets/save-FeDrOUOd.js +0 -6
- package/dist/assets/search-C4-fHihx.js +0 -6
- package/dist/assets/square-pen-xVs4e8Yb.js +0 -6
- package/dist/assets/trash-2-BGXMNU3d.js +0 -6
- package/dist/assets/uk-BA7DIKEL.js +0 -1
- package/dist/assets/useDebounce-DFq3rxAW.js +0 -1
- package/dist/assets/vs-form-reletion-link-C-xrdHDl.js +0 -20
- package/dist/assets/vue.-sixQ7xP-CUPNuJcq.js +0 -1
- package/dist/assets/vuedraggable.umd-W_2WTF6i.js +0 -14
- package/dist/assets/x-D2t-wfBe.js +0 -6
- package/src/index.js +0 -23
- /package/dist/{assets/vs-form-reletion-link-bk-9ZkDH.css → style.css} +0 -0
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import { dataUpdate } from "@opengis/fastify-table/utils.js";
|
|
2
|
-
|
|
3
|
-
export default async function editTags({ pg, body, user, params }, reply) {
|
|
4
|
-
const { uid } = user || {};
|
|
5
|
-
|
|
6
|
-
if (!uid) {
|
|
7
|
-
return reply.code(401).send({ message: 'access restricted', status: 401 });
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
if (!params?.id) {
|
|
11
|
-
return reply.code(400).send({ message: 'id is required!', status: 400 });
|
|
12
|
-
}
|
|
13
|
-
if (!body) {
|
|
14
|
-
return reply.code(400).send({ message: 'body is empty!', status: 400 });
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
await dataUpdate({
|
|
18
|
-
pg,
|
|
19
|
-
id: params.id,
|
|
20
|
-
table: 'site.tags',
|
|
21
|
-
data: body,
|
|
22
|
-
uid,
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
return reply.code(200).send({ message: 'Tag updated successfully', status: 200 });
|
|
1
|
+
import { dataUpdate } from "@opengis/fastify-table/utils.js";
|
|
2
|
+
|
|
3
|
+
export default async function editTags({ pg, body, user, params }, reply) {
|
|
4
|
+
const { uid } = user || {};
|
|
5
|
+
|
|
6
|
+
if (!uid) {
|
|
7
|
+
return reply.code(401).send({ message: 'access restricted', status: 401 });
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
if (!params?.id) {
|
|
11
|
+
return reply.code(400).send({ message: 'id is required!', status: 400 });
|
|
12
|
+
}
|
|
13
|
+
if (!body) {
|
|
14
|
+
return reply.code(400).send({ message: 'body is empty!', status: 400 });
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
await dataUpdate({
|
|
18
|
+
pg,
|
|
19
|
+
id: params.id,
|
|
20
|
+
table: 'site.tags',
|
|
21
|
+
data: body,
|
|
22
|
+
uid,
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
return reply.code(200).send({ message: 'Tag updated successfully', status: 200 });
|
|
26
26
|
}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
export default async function getTags(req, reply) {
|
|
2
|
-
const { pg, query } = req;
|
|
3
|
-
const { page = 1, limit = 16, search } = query;
|
|
4
|
-
const offset = limit * (page - 1) || 0;
|
|
5
|
-
|
|
6
|
-
const { total, filtered } = await pg.one(`select count(*)::int as total, (count(*) filter (where 1=1 ${search ? `and value ilike'%${search}%'` : ''}))::int as filtered from site.tags`);
|
|
7
|
-
|
|
8
|
-
const selectSql = `select *,(select count(*)::int as count_data from site.tag_data where tag_id=a.tag_id) from site.tags a
|
|
9
|
-
where 1=1 ${search ? `and value ilike'%${search}%'` : ''}
|
|
10
|
-
order by created_at desc limit ${limit} offset ${offset}`;
|
|
11
|
-
|
|
12
|
-
const { rows } = await pg.query(selectSql);
|
|
13
|
-
|
|
14
|
-
return reply.code(200).send({ message: { total, filtered, rows }, status: 200 })
|
|
15
|
-
|
|
1
|
+
export default async function getTags(req, reply) {
|
|
2
|
+
const { pg, query } = req;
|
|
3
|
+
const { page = 1, limit = 16, search } = query;
|
|
4
|
+
const offset = limit * (page - 1) || 0;
|
|
5
|
+
|
|
6
|
+
const { total, filtered } = await pg.one(`select count(*)::int as total, (count(*) filter (where 1=1 ${search ? `and value ilike'%${search}%'` : ''}))::int as filtered from site.tags`);
|
|
7
|
+
|
|
8
|
+
const selectSql = `select *,(select count(*)::int as count_data from site.tag_data where tag_id=a.tag_id) from site.tags a
|
|
9
|
+
where 1=1 ${search ? `and value ilike'%${search}%'` : ''}
|
|
10
|
+
order by created_at desc limit ${limit} offset ${offset}`;
|
|
11
|
+
|
|
12
|
+
const { rows } = await pg.query(selectSql);
|
|
13
|
+
|
|
14
|
+
return reply.code(200).send({ message: { total, filtered, rows }, status: 200 })
|
|
15
|
+
|
|
16
16
|
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import getTags from './controllers/get.tags.js';
|
|
2
|
-
import addTags from './controllers/add.tags.js';
|
|
3
|
-
import editTags from './controllers/edit.tags.js';
|
|
4
|
-
import delTags from './controllers/del.tags.js';
|
|
5
|
-
|
|
6
|
-
const policyPublic = { config: { policy: ['public'] } };
|
|
7
|
-
|
|
8
|
-
export default async function route(app) {
|
|
9
|
-
app.get('/tags', policyPublic, getTags);
|
|
10
|
-
app.post('/tags', policyPublic, addTags);
|
|
11
|
-
app.put('/tags/:id', policyPublic, editTags);
|
|
12
|
-
app.delete('/tags/:id', policyPublic, delTags);
|
|
13
|
-
|
|
14
|
-
}
|
|
1
|
+
import getTags from './controllers/get.tags.js';
|
|
2
|
+
import addTags from './controllers/add.tags.js';
|
|
3
|
+
import editTags from './controllers/edit.tags.js';
|
|
4
|
+
import delTags from './controllers/del.tags.js';
|
|
5
|
+
|
|
6
|
+
const policyPublic = { config: { policy: ['public'] } };
|
|
7
|
+
|
|
8
|
+
export default async function route(app) {
|
|
9
|
+
app.get('/tags', policyPublic, getTags);
|
|
10
|
+
app.post('/tags', policyPublic, addTags);
|
|
11
|
+
app.put('/tags/:id', policyPublic, editTags);
|
|
12
|
+
app.delete('/tags/:id', policyPublic, delTags);
|
|
13
|
+
|
|
14
|
+
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
[
|
|
2
|
-
{
|
|
3
|
-
"id": "1",
|
|
4
|
-
"text": "Important"
|
|
5
|
-
},
|
|
6
|
-
{
|
|
7
|
-
"id": "2",
|
|
8
|
-
"text": "Common"
|
|
9
|
-
}
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"id": "1",
|
|
4
|
+
"text": "Important"
|
|
5
|
+
},
|
|
6
|
+
{
|
|
7
|
+
"id": "2",
|
|
8
|
+
"text": "Common"
|
|
9
|
+
}
|
|
10
10
|
]
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
[
|
|
2
|
-
{
|
|
3
|
-
"id": "1",
|
|
4
|
-
"text": "Pending"
|
|
5
|
-
},
|
|
6
|
-
{
|
|
7
|
-
"id": "2",
|
|
8
|
-
"text": "Approved"
|
|
9
|
-
}
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"id": "1",
|
|
4
|
+
"text": "Pending"
|
|
5
|
+
},
|
|
6
|
+
{
|
|
7
|
+
"id": "2",
|
|
8
|
+
"text": "Approved"
|
|
9
|
+
}
|
|
10
10
|
]
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
[
|
|
2
|
-
{
|
|
3
|
-
"id": "1",
|
|
4
|
-
"text": "Draft"
|
|
5
|
-
},
|
|
6
|
-
{
|
|
7
|
-
"id": "2",
|
|
8
|
-
"text": "Publish"
|
|
9
|
-
}
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"id": "1",
|
|
4
|
+
"text": "Draft"
|
|
5
|
+
},
|
|
6
|
+
{
|
|
7
|
+
"id": "2",
|
|
8
|
+
"text": "Publish"
|
|
9
|
+
}
|
|
10
10
|
]
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
[
|
|
2
|
-
{
|
|
3
|
-
"id": "1",
|
|
4
|
-
"text": "Single"
|
|
5
|
-
},
|
|
6
|
-
{
|
|
7
|
-
"id": "2",
|
|
8
|
-
"text": "Collection"
|
|
9
|
-
}
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"id": "1",
|
|
4
|
+
"text": "Single"
|
|
5
|
+
},
|
|
6
|
+
{
|
|
7
|
+
"id": "2",
|
|
8
|
+
"text": "Collection"
|
|
9
|
+
}
|
|
10
10
|
]
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
[
|
|
2
|
-
{
|
|
3
|
-
"id": "uk",
|
|
4
|
-
"text": "Українська"
|
|
5
|
-
},
|
|
6
|
-
{
|
|
7
|
-
"id": "en",
|
|
8
|
-
"text": "English"
|
|
9
|
-
}
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"id": "uk",
|
|
4
|
+
"text": "Українська"
|
|
5
|
+
},
|
|
6
|
+
{
|
|
7
|
+
"id": "en",
|
|
8
|
+
"text": "English"
|
|
9
|
+
}
|
|
10
10
|
]
|
|
@@ -1,127 +1,127 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="en" dir="">
|
|
3
|
-
|
|
4
|
-
<head>
|
|
5
|
-
<!-- scripts -->
|
|
6
|
-
<script src="https://cdn.tailwindcss.com"></script>
|
|
7
|
-
<script src="/src/assets/tailwind-3.4.17.js"></script>
|
|
8
|
-
<!-- <script src="https://cdn.softpro.ua/assets/js/tailwind-3.4.17.js"></script> -->
|
|
9
|
-
</head>
|
|
10
|
-
|
|
11
|
-
<body class="bg-[#f3f4f6] flex items-center flex-1 w-full h-[100vh] overflow-x-hidden min-h-full ">
|
|
12
|
-
<main class="w-full">
|
|
13
|
-
<div class="flex w-full max-w-sm mx-auto overflow-hidden bg-white rounded-lg shadow-lg dark:bg-gray-800 lg:max-w-4xl">
|
|
14
|
-
<div id="background-image" class="hidden bg-cover lg:block lg:w-1/2 bg-center" style="background-image: url('https://nipo.gov.ua/wp-content/uploads/2023/02/Pro_nas_2301-768x512.jpg');"></div>
|
|
15
|
-
|
|
16
|
-
<div class="w-full px-6 py-8 md:px-8 lg:w-1/2">
|
|
17
|
-
<div class="flex justify-center mx-auto">
|
|
18
|
-
<img class="w-auto h-7 sm:h-16" id="logo-cms" src="https://nipo.gov.ua/wp-content/uploads/2023/01/IP_office_logo_UA-1-1.png" alt="logo">
|
|
19
|
-
</div>
|
|
20
|
-
|
|
21
|
-
<p id="site-name" class="mt-3 mb-[32px] text-xl text-center text-gray-600 dark:text-gray-200">
|
|
22
|
-
Український національний офіс інтелектуальної власності та інновацій
|
|
23
|
-
</p>
|
|
24
|
-
|
|
25
|
-
<form action="/api/login" method="get" >
|
|
26
|
-
<div class="mt-4">
|
|
27
|
-
<label class="block mb-2 text-sm font-medium text-gray-600 dark:text-gray-200" for="LoggingEmailAddress">Електронна пошта / Логін</label>
|
|
28
|
-
<input name="username" id="LoggingEmailAddress" class="block w-full px-4 py-2 text-gray-700 bg-white border rounded-lg dark:bg-gray-800 dark:text-gray-300 dark:border-gray-600 focus:border-blue-400 focus:ring-opacity-40 dark:focus:border-blue-300 focus:outline-none focus:ring focus:ring-blue-300" type="text">
|
|
29
|
-
</div>
|
|
30
|
-
|
|
31
|
-
<div class="mt-4">
|
|
32
|
-
<div class="flex justify-between">
|
|
33
|
-
<label class="block mb-2 text-sm font-medium text-gray-600 dark:text-gray-200" for="loggingPassword">Пароль</label>
|
|
34
|
-
<!-- <a class="text-xs text-gray-500 dark:text-gray-300 hover:underline">Forget Password?</a> -->
|
|
35
|
-
</div>
|
|
36
|
-
|
|
37
|
-
<input id="loggingPassword" name="password" class="block w-full px-4 py-2 text-gray-700 bg-white border rounded-lg dark:bg-gray-800 dark:text-gray-300 dark:border-gray-600 focus:border-blue-400 focus:ring-opacity-40 dark:focus:border-blue-300 focus:outline-none focus:ring focus:ring-blue-300" type="password">
|
|
38
|
-
</div>
|
|
39
|
-
|
|
40
|
-
<div class="mt-6">
|
|
41
|
-
<button type="submit" class="w-full px-6 py-3 text-sm font-medium tracking-wide text-white capitalize transition-colors duration-300 transform bg-gray-800 rounded-lg hover:bg-gray-700 focus:outline-none focus:ring focus:ring-gray-300 focus:ring-opacity-50">
|
|
42
|
-
Увійти
|
|
43
|
-
</button>
|
|
44
|
-
|
|
45
|
-
{{!-- <a href="https://nsdi.gov.ua/auth/redirect"
|
|
46
|
-
class="block text-center mt-2 w-full px-6 py-3 text-sm font-medium tracking-wide text-white capitalize transition-colors duration-300 transform bg-gray-800 rounded-lg hover:bg-gray-700 focus:outline-none focus:ring focus:ring-gray-300 focus:ring-opacity-50">
|
|
47
|
-
Авторизуватись з
|
|
48
|
-
<span class="ml-2 inline-flex items-center bg-white text-gray-900 px-2 py-1 rounded-md">
|
|
49
|
-
ID GOV UA
|
|
50
|
-
</span>
|
|
51
|
-
</a> --}}
|
|
52
|
-
{{!--<a
|
|
53
|
-
href="https://id.softpro.ua/oauth/authorize?response_type=code&provider=google&client_id=photo-client-123&redirect_uri={{coalesce protocol 'https'}}://{{req.raw.headers.host}}/auth/by_data&scope=profile email"
|
|
54
|
-
class="flex items-center justify-center mt-4 text-gray-600 transition-colors duration-300 transform border rounded-lg hover:bg-gray-50">
|
|
55
|
-
<div class="px-4 py-2">
|
|
56
|
-
<svg class="w-6 h-6" viewBox="0 0 40 40">
|
|
57
|
-
<path
|
|
58
|
-
d="M36.3425 16.7358H35V16.6667H20V23.3333H29.4192C28.045 27.2142 24.3525 30 20 30C14.4775 30 10 25.5225 10 20C10 14.4775 14.4775 9.99999 20 9.99999C22.5492 9.99999 24.8683 10.9617 26.6342 12.5325L31.3483 7.81833C28.3717 5.04416 24.39 3.33333 20 3.33333C10.7958 3.33333 3.33335 10.7958 3.33335 20C3.33335 29.2042 10.7958 36.6667 20 36.6667C29.2042 36.6667 36.6667 29.2042 36.6667 20C36.6667 18.8825 36.5517 17.7917 36.3425 16.7358Z"
|
|
59
|
-
fill="#FFC107"></path>
|
|
60
|
-
<path
|
|
61
|
-
d="M5.25497 12.2425L10.7308 16.2583C12.2125 12.59 15.8008 9.99999 20 9.99999C22.5491 9.99999 24.8683 10.9617 26.6341 12.5325L31.3483 7.81833C28.3716 5.04416 24.39 3.33333 20 3.33333C13.5983 3.33333 8.04663 6.94749 5.25497 12.2425Z"
|
|
62
|
-
fill="#FF3D00"></path>
|
|
63
|
-
<path
|
|
64
|
-
d="M20 36.6667C24.305 36.6667 28.2167 35.0192 31.1742 32.34L26.0159 27.975C24.3425 29.2425 22.2625 30 20 30C15.665 30 11.9842 27.2359 10.5975 23.3784L5.16254 27.5659C7.92087 32.9634 13.5225 36.6667 20 36.6667Z"
|
|
65
|
-
fill="#4CAF50"></path>
|
|
66
|
-
<path
|
|
67
|
-
d="M36.3425 16.7358H35V16.6667H20V23.3333H29.4192C28.7592 25.1975 27.56 26.805 26.0133 27.9758C26.0142 27.975 26.015 27.975 26.0158 27.9742L31.1742 32.3392C30.8092 32.6708 36.6667 28.3333 36.6667 20C36.6667 18.8825 36.5517 17.7917 36.3425 16.7358Z"
|
|
68
|
-
fill="#1976D2"></path>
|
|
69
|
-
</svg>
|
|
70
|
-
</div>
|
|
71
|
-
|
|
72
|
-
<span class="w-5/6 px-4 py-3 font-bold text-center"> Увійти через Google</span>
|
|
73
|
-
</a>--}}
|
|
74
|
-
</div>
|
|
75
|
-
|
|
76
|
-
</form>
|
|
77
|
-
</div>
|
|
78
|
-
</div>
|
|
79
|
-
</main>
|
|
80
|
-
|
|
81
|
-
</body>
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
<script>
|
|
85
|
-
const error = location.search.includes('wrong_pass')
|
|
86
|
-
if (error) {
|
|
87
|
-
document.getElementById('login_error').innerHTML = 'Не вірний користувач або пароль';
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
// Отримання даних з налаштувань
|
|
91
|
-
(async function() {
|
|
92
|
-
try {
|
|
93
|
-
const response = await fetch('/api/settings');
|
|
94
|
-
const data = await response.json();
|
|
95
|
-
const siteInfo = data?.settings?.site_info || {};
|
|
96
|
-
|
|
97
|
-
// Оновлення назви сайту
|
|
98
|
-
if (siteInfo.name) {
|
|
99
|
-
const nameElement = document.getElementById('site-name');
|
|
100
|
-
if (nameElement) {
|
|
101
|
-
nameElement.textContent = siteInfo.name;
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
// Оновлення логотипу CMS
|
|
106
|
-
if (siteInfo['logo-cms']) {
|
|
107
|
-
const logoElement = document.getElementById('logo-cms');
|
|
108
|
-
if (logoElement) {
|
|
109
|
-
logoElement.src = siteInfo['logo-cms'];
|
|
110
|
-
logoElement.alt = siteInfo.name || 'logo';
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
// Оновлення фонового зображення для логіну
|
|
115
|
-
if (siteInfo['image-login']) {
|
|
116
|
-
const bgElement = document.getElementById('background-image');
|
|
117
|
-
if (bgElement) {
|
|
118
|
-
bgElement.style.backgroundImage = `url('${siteInfo['image-login']}')`;
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
} catch (error) {
|
|
122
|
-
console.error('Помилка при завантаженні налаштувань:', error);
|
|
123
|
-
}
|
|
124
|
-
})();
|
|
125
|
-
</script>
|
|
126
|
-
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en" dir="">
|
|
3
|
+
|
|
4
|
+
<head>
|
|
5
|
+
<!-- scripts -->
|
|
6
|
+
<script src="https://cdn.tailwindcss.com"></script>
|
|
7
|
+
<script src="/src/assets/tailwind-3.4.17.js"></script>
|
|
8
|
+
<!-- <script src="https://cdn.softpro.ua/assets/js/tailwind-3.4.17.js"></script> -->
|
|
9
|
+
</head>
|
|
10
|
+
|
|
11
|
+
<body class="bg-[#f3f4f6] flex items-center flex-1 w-full h-[100vh] overflow-x-hidden min-h-full ">
|
|
12
|
+
<main class="w-full">
|
|
13
|
+
<div class="flex w-full max-w-sm mx-auto overflow-hidden bg-white rounded-lg shadow-lg dark:bg-gray-800 lg:max-w-4xl">
|
|
14
|
+
<div id="background-image" class="hidden bg-cover lg:block lg:w-1/2 bg-center" style="background-image: url('https://nipo.gov.ua/wp-content/uploads/2023/02/Pro_nas_2301-768x512.jpg');"></div>
|
|
15
|
+
|
|
16
|
+
<div class="w-full px-6 py-8 md:px-8 lg:w-1/2">
|
|
17
|
+
<div class="flex justify-center mx-auto">
|
|
18
|
+
<img class="w-auto h-7 sm:h-16" id="logo-cms" src="https://nipo.gov.ua/wp-content/uploads/2023/01/IP_office_logo_UA-1-1.png" alt="logo">
|
|
19
|
+
</div>
|
|
20
|
+
|
|
21
|
+
<p id="site-name" class="mt-3 mb-[32px] text-xl text-center text-gray-600 dark:text-gray-200">
|
|
22
|
+
Український національний офіс інтелектуальної власності та інновацій
|
|
23
|
+
</p>
|
|
24
|
+
|
|
25
|
+
<form action="/api/login" method="get" >
|
|
26
|
+
<div class="mt-4">
|
|
27
|
+
<label class="block mb-2 text-sm font-medium text-gray-600 dark:text-gray-200" for="LoggingEmailAddress">Електронна пошта / Логін</label>
|
|
28
|
+
<input name="username" id="LoggingEmailAddress" class="block w-full px-4 py-2 text-gray-700 bg-white border rounded-lg dark:bg-gray-800 dark:text-gray-300 dark:border-gray-600 focus:border-blue-400 focus:ring-opacity-40 dark:focus:border-blue-300 focus:outline-none focus:ring focus:ring-blue-300" type="text">
|
|
29
|
+
</div>
|
|
30
|
+
|
|
31
|
+
<div class="mt-4">
|
|
32
|
+
<div class="flex justify-between">
|
|
33
|
+
<label class="block mb-2 text-sm font-medium text-gray-600 dark:text-gray-200" for="loggingPassword">Пароль</label>
|
|
34
|
+
<!-- <a class="text-xs text-gray-500 dark:text-gray-300 hover:underline">Forget Password?</a> -->
|
|
35
|
+
</div>
|
|
36
|
+
|
|
37
|
+
<input id="loggingPassword" name="password" class="block w-full px-4 py-2 text-gray-700 bg-white border rounded-lg dark:bg-gray-800 dark:text-gray-300 dark:border-gray-600 focus:border-blue-400 focus:ring-opacity-40 dark:focus:border-blue-300 focus:outline-none focus:ring focus:ring-blue-300" type="password">
|
|
38
|
+
</div>
|
|
39
|
+
|
|
40
|
+
<div class="mt-6">
|
|
41
|
+
<button type="submit" class="w-full px-6 py-3 text-sm font-medium tracking-wide text-white capitalize transition-colors duration-300 transform bg-gray-800 rounded-lg hover:bg-gray-700 focus:outline-none focus:ring focus:ring-gray-300 focus:ring-opacity-50">
|
|
42
|
+
Увійти
|
|
43
|
+
</button>
|
|
44
|
+
|
|
45
|
+
{{!-- <a href="https://nsdi.gov.ua/auth/redirect"
|
|
46
|
+
class="block text-center mt-2 w-full px-6 py-3 text-sm font-medium tracking-wide text-white capitalize transition-colors duration-300 transform bg-gray-800 rounded-lg hover:bg-gray-700 focus:outline-none focus:ring focus:ring-gray-300 focus:ring-opacity-50">
|
|
47
|
+
Авторизуватись з
|
|
48
|
+
<span class="ml-2 inline-flex items-center bg-white text-gray-900 px-2 py-1 rounded-md">
|
|
49
|
+
ID GOV UA
|
|
50
|
+
</span>
|
|
51
|
+
</a> --}}
|
|
52
|
+
{{!--<a
|
|
53
|
+
href="https://id.softpro.ua/oauth/authorize?response_type=code&provider=google&client_id=photo-client-123&redirect_uri={{coalesce protocol 'https'}}://{{req.raw.headers.host}}/auth/by_data&scope=profile email"
|
|
54
|
+
class="flex items-center justify-center mt-4 text-gray-600 transition-colors duration-300 transform border rounded-lg hover:bg-gray-50">
|
|
55
|
+
<div class="px-4 py-2">
|
|
56
|
+
<svg class="w-6 h-6" viewBox="0 0 40 40">
|
|
57
|
+
<path
|
|
58
|
+
d="M36.3425 16.7358H35V16.6667H20V23.3333H29.4192C28.045 27.2142 24.3525 30 20 30C14.4775 30 10 25.5225 10 20C10 14.4775 14.4775 9.99999 20 9.99999C22.5492 9.99999 24.8683 10.9617 26.6342 12.5325L31.3483 7.81833C28.3717 5.04416 24.39 3.33333 20 3.33333C10.7958 3.33333 3.33335 10.7958 3.33335 20C3.33335 29.2042 10.7958 36.6667 20 36.6667C29.2042 36.6667 36.6667 29.2042 36.6667 20C36.6667 18.8825 36.5517 17.7917 36.3425 16.7358Z"
|
|
59
|
+
fill="#FFC107"></path>
|
|
60
|
+
<path
|
|
61
|
+
d="M5.25497 12.2425L10.7308 16.2583C12.2125 12.59 15.8008 9.99999 20 9.99999C22.5491 9.99999 24.8683 10.9617 26.6341 12.5325L31.3483 7.81833C28.3716 5.04416 24.39 3.33333 20 3.33333C13.5983 3.33333 8.04663 6.94749 5.25497 12.2425Z"
|
|
62
|
+
fill="#FF3D00"></path>
|
|
63
|
+
<path
|
|
64
|
+
d="M20 36.6667C24.305 36.6667 28.2167 35.0192 31.1742 32.34L26.0159 27.975C24.3425 29.2425 22.2625 30 20 30C15.665 30 11.9842 27.2359 10.5975 23.3784L5.16254 27.5659C7.92087 32.9634 13.5225 36.6667 20 36.6667Z"
|
|
65
|
+
fill="#4CAF50"></path>
|
|
66
|
+
<path
|
|
67
|
+
d="M36.3425 16.7358H35V16.6667H20V23.3333H29.4192C28.7592 25.1975 27.56 26.805 26.0133 27.9758C26.0142 27.975 26.015 27.975 26.0158 27.9742L31.1742 32.3392C30.8092 32.6708 36.6667 28.3333 36.6667 20C36.6667 18.8825 36.5517 17.7917 36.3425 16.7358Z"
|
|
68
|
+
fill="#1976D2"></path>
|
|
69
|
+
</svg>
|
|
70
|
+
</div>
|
|
71
|
+
|
|
72
|
+
<span class="w-5/6 px-4 py-3 font-bold text-center"> Увійти через Google</span>
|
|
73
|
+
</a>--}}
|
|
74
|
+
</div>
|
|
75
|
+
|
|
76
|
+
</form>
|
|
77
|
+
</div>
|
|
78
|
+
</div>
|
|
79
|
+
</main>
|
|
80
|
+
|
|
81
|
+
</body>
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
<script>
|
|
85
|
+
const error = location.search.includes('wrong_pass')
|
|
86
|
+
if (error) {
|
|
87
|
+
document.getElementById('login_error').innerHTML = 'Не вірний користувач або пароль';
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
// Отримання даних з налаштувань
|
|
91
|
+
(async function() {
|
|
92
|
+
try {
|
|
93
|
+
const response = await fetch('/api/settings');
|
|
94
|
+
const data = await response.json();
|
|
95
|
+
const siteInfo = data?.settings?.site_info || {};
|
|
96
|
+
|
|
97
|
+
// Оновлення назви сайту
|
|
98
|
+
if (siteInfo.name) {
|
|
99
|
+
const nameElement = document.getElementById('site-name');
|
|
100
|
+
if (nameElement) {
|
|
101
|
+
nameElement.textContent = siteInfo.name;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
// Оновлення логотипу CMS
|
|
106
|
+
if (siteInfo['logo-cms']) {
|
|
107
|
+
const logoElement = document.getElementById('logo-cms');
|
|
108
|
+
if (logoElement) {
|
|
109
|
+
logoElement.src = siteInfo['logo-cms'];
|
|
110
|
+
logoElement.alt = siteInfo.name || 'logo';
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
// Оновлення фонового зображення для логіну
|
|
115
|
+
if (siteInfo['image-login']) {
|
|
116
|
+
const bgElement = document.getElementById('background-image');
|
|
117
|
+
if (bgElement) {
|
|
118
|
+
bgElement.style.backgroundImage = `url('${siteInfo['image-login']}')`;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
} catch (error) {
|
|
122
|
+
console.error('Помилка при завантаженні налаштувань:', error);
|
|
123
|
+
}
|
|
124
|
+
})();
|
|
125
|
+
</script>
|
|
126
|
+
|
|
127
127
|
</html>
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
select uid, coalesce(sur_name,'')||coalesce(' '||user_name,'') as text, email from admin.users
|
|
1
|
+
select uid, coalesce(sur_name,'')||coalesce(' '||user_name,'') as text, email from admin.users
|
|
2
2
|
where enabled order by coalesce(sur_name,'')||coalesce(' '||user_name,'')
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{l as b}from"./index-DCW2e4Az.js";import{m as a,u as y,J as x,p as k,a as _,b as t,e as u,t as p,g as U,h as V,v as j,o as h,l as B}from"./index-yMJAVBXk.js";import{y as v}from"./index-DGweaj24.js";const C={class:"space-y-6 max-w-6xl mx-auto relative bg-white"},$={class:"p-4 sticky top-[-24px] z-10 bg-white dark:bg-slate-800"},S={class:"flex items-center justify-between"},N={class:"flex items-center gap-4"},T={class:"text-2xl font-semibold text-gray-900 dark:text-white"},M={class:"flex items-center space-x-3"},z={class:"container mx-auto bg-white rounded-md pb-4 px-5"},P={__name:"AddUser",setup(D){const r=a(null),n=a({}),c=a({}),f=a(!0),d=B(),{t:l}=y(),m=a(null),i=x().params.id,g=async()=>{let o=i?"PUT":"POST";try{if(await c.value.validate()){v({type:"warning",title:l("common.actions.warning"),message:l("users.createUserFailed")});return}await fetch(`/api/table/${m.value}`,{method:o,body:JSON.stringify(n.value),headers:{"Content-Type":"application/json"}}),v({type:"success",title:l("common.actions.success"),message:l("users.createUserSuccess")}),d.back()}catch(e){console.error(e)}},w=async()=>{let o=i?`/api/form/admin.users.table/${i}`:"/api/form/admin.users.table";try{const s=await(await fetch(o)).json();n.value=(s==null?void 0:s.data)||{},m.value=s.token,r.value=s.schema}catch{r.value=[]}finally{f.value=!1}};return k(()=>{w()}),(o,e)=>(h(),_("div",C,[t("div",$,[t("div",S,[t("div",N,[t("button",{onClick:e[0]||(e[0]=s=>u(d).back()),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"},[...e[3]||(e[3]=[t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"lucide lucide-arrow-left-icon w-5 h-5"},[t("path",{d:"m12 19-7-7 7-7"}),t("path",{d:"M19 12H5"})],-1)])]),t("h1",T,p(u(i)?o.$t("users.editUser"):o.$t("users.createUser")),1)]),t("div",M,[t("button",{onClick:g,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"},[e[4]||(e[4]=t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"lucide lucide-save-icon w-4 h-4 mr-2"},[t("path",{d:"M19 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11l5 5v11a2 2 0 0 1-2 2z"}),t("polyline",{points:"17 21 17 13 7 13 7 21"}),t("polyline",{points:"7 3 7 8 15 8"})],-1)),U(" "+p(o.$t("common.actions.save")),1)])])])]),t("div",z,[r.value?(h(),V(u(b),{key:0,modelValue:n.value,"onUpdate:modelValue":e[1]||(e[1]=s=>n.value=s),form:c.value,"onUpdate:form":e[2]||(e[2]=s=>c.value=s),schema:r.value},null,8,["modelValue","form","schema"])):j("",!0)])]))}};export{P as default};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import{_ as m}from"./SettingsTitle-t4WJBFxZ.js";import{_ as d}from"./SettingsTable-CY5pZx1z.js";import{c as r,u as h,m as b,a as p,f as a,b as e,w as y,e as o,o as u,j as k,k as f,t as n}from"./index-yMJAVBXk.js";import{E as v}from"./eye-Dijywc6g.js";/**
|
|
2
|
-
* @license lucide-vue-next v0.344.0 - ISC
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the ISC license.
|
|
5
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/const x=r("KeyIcon",[["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["path",{d:"m15.5 7.5 3 3L22 7l-3-3",key:"1rn1fs"}]]);/**
|
|
7
|
-
* @license lucide-vue-next v0.344.0 - ISC
|
|
8
|
-
*
|
|
9
|
-
* This source code is licensed under the ISC license.
|
|
10
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
-
*/const _=r("RefreshCcwIcon",[["path",{d:"M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"14sxne"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16",key:"1hlbsb"}],["path",{d:"M16 16h5v5",key:"ccwih5"}]]);/**
|
|
12
|
-
* @license lucide-vue-next v0.344.0 - ISC
|
|
13
|
-
*
|
|
14
|
-
* This source code is licensed under the ISC license.
|
|
15
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
16
|
-
*/const w=r("ShieldIcon",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]),L={class:"w-full max-w-7xl mx-auto space-y-6"},K={class:"space-y-6 max-w-7xl mx-auto"},$={class:"font-medium text-slate-800 dark:text-slate-100"},j={class:"text-sm text-slate-500 dark:text-slate-400"},V={class:"flex space-x-2"},C={class:"inline-flex items-center justify-center whitespace-nowrap font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 border shadow-sm hover:text-accent-foreground h-8 rounded-md px-3 text-xs bg-white dark:bg-slate-700 border-slate-300 dark:border-slate-600 text-slate-700 dark:text-slate-300 hover:bg-slate-50 dark:hover:bg-slate-600"},D={class:"inline-flex items-center justify-center whitespace-nowrap font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 border shadow-sm hover:text-accent-foreground h-8 rounded-md px-3 text-xs bg-white dark:bg-slate-700 border-slate-300 dark:border-slate-600 text-slate-700 dark:text-slate-300 hover:bg-slate-50 dark:hover:bg-slate-600"},I={class:"inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none text-white focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 text-primary-foreground shadow h-9 px-4 py-2 mt-4 bg-purple-600 hover:bg-purple-700"},N={__name:"ApiKeys",setup(M){const{t}=h(),g=[{name:"production",label:t("settings.api-keys.productionApiKey"),value:"pk_live_••••••••••••••••"},{name:"development",label:t("settings.api-keys.developmentApiKey"),value:"pk_test_••••••••••••••••"}],l=b([{key:"rateLimiting",label:t("settings.api-keys.rateLimiting"),description:t("settings.api-keys.rateLimitingDescription"),checked:!0},{key:"corsProtection",label:t("settings.api-keys.corsProtection"),description:t("settings.api-keys.corsProtectionDescription"),checked:!0},{key:"apiLogging",label:t("settings.api-keys.apiLogging"),description:t("settings.api-keys.apiLoggingDescription"),checked:!1}]);return(s,c)=>(u(),p("div",L,[a(m,{title:s.$t("settings.api-keys.apiKeys"),description:s.$t("settings.api-keys.apiKeysDescription")},null,8,["title","description"]),e("div",K,[a(d,{icon:o(x),title:s.$t("settings.api-keys.apiKeys"),color:"purple"},{content:y(()=>[(u(),p(k,null,f(g,i=>e("div",{key:i.name,class:"flex items-center justify-between p-4 border border-slate-200 dark:border-slate-600 rounded-lg bg-slate-50 dark:bg-slate-700"},[e("div",null,[e("h3",$,n(i.label),1),e("p",j,n(i.value),1)]),e("div",V,[e("button",C,[a(o(v),{class:"w-4 h-4"})]),e("button",D,[a(o(_),{class:"w-4 h-4"})])])])),64)),e("button",I,n(s.$t("settings.api-keys.generateNewKey")),1)]),_:1},8,["icon","title"]),a(d,{modelValue:l.value,"onUpdate:modelValue":c[0]||(c[0]=i=>l.value=i),icon:o(w),title:s.$t("settings.api-keys.apiSecurity"),color:"purple"},null,8,["modelValue","icon","title"])])]))}};export{N as default};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import{_ as m}from"./SettingsTitle-t4WJBFxZ.js";import{_ as k}from"./SettingsTable-CY5pZx1z.js";import{c as f,u as _,c3 as x,m as y,a as s,f as c,e as r,w as h,o as l,b as t,t as i,j as C,k as v,n as p}from"./index-yMJAVBXk.js";/**
|
|
2
|
-
* @license lucide-vue-next v0.344.0 - ISC
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the ISC license.
|
|
5
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/const w=f("PaletteIcon",[["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["path",{d:"M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10c.926 0 1.648-.746 1.648-1.688 0-.437-.18-.835-.437-1.125-.29-.289-.438-.652-.438-1.125a1.64 1.64 0 0 1 1.668-1.668h1.996c3.051 0 5.555-2.503 5.555-5.554C21.965 6.012 17.461 2 12 2z",key:"12rzf8"}]]),M={class:"w-full max-w-7xl mx-auto space-y-6"},D={class:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 text-slate-700 dark:text-slate-300"},V={class:"grid grid-cols-3 gap-3 mt-2"},$=["onClick"],z={class:"text-sm font-medium text-slate-700 dark:text-slate-300"},P={__name:"Appearance",setup(B){const{t:e}=_(),{color:d,toggleColor:u}=x(),g=[{name:"blue",color:"border-2 bg-blue-50 border-blue-500 dark:bg-blue-900/20",bg:"bg-blue-600"},{name:"green",color:"border-2 bg-green-50 border-green-500 dark:bg-green-900/20",bg:"bg-green-600"},{name:"purple",color:"border-2 bg-purple-50 border-purple-500 dark:bg-purple-900/20",bg:"bg-purple-600"}],o=y([{key:"darkMode",label:e("settings.appearance.darkMode"),description:e("settings.appearance.darkModeDescription"),checked:!0},{key:"compactMode",label:e("settings.appearance.compactMode"),description:e("settings.appearance.compactModeDescription"),checked:!1},{key:"animations",label:e("settings.appearance.animations"),description:e("settings.appearance.animationsDescription"),checked:!1}]);return(b,n)=>(l(),s("div",M,[c(m,{title:r(e)("settings.appearance.appearance"),description:r(e)("settings.appearance.appearanceDescription")},null,8,["title","description"]),c(k,{modelValue:o.value,"onUpdate:modelValue":n[0]||(n[0]=a=>o.value=a),icon:r(w),title:r(e)("settings.appearance.appearance"),color:"pink"},{content:h(()=>[t("div",null,[t("label",D,i(b.$t("settings.appearance.colorTheme")),1),t("div",V,[(l(),s(C,null,v(g,a=>t("button",{key:a.name,class:p(["p-3 rounded-lg text-center",a.name===r(d)?a.color:"border border-slate-200 dark:border-slate-600 bg-white dark:bg-slate-700 hover:border-slate-300 dark:hover:border-slate-500"]),onClick:I=>r(u)(a.name)},[t("div",{class:p(["w-full h-8 rounded mb-2",a.bg])},null,2),t("span",z,i(a.name),1)],10,$)),64))])])]),_:1},8,["modelValue","icon","title"])]))}};export{P as default};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import{c as Z,d as W,m as r,u as X,A as B,p as Y,z as D,o,a as d,f as _,b as i,t as A,e as v,H as ee,g as te,v as f,h as q,K as ae,J as se,l as le,q as re,M as ne,F as oe,N as L}from"./index-yMJAVBXk.js";import{_ as ie}from"./UniversalTable.vue_vue_type_script_setup_true_lang-BQ5m4aZd.js";import{_ as ue}from"./UniversalTablePagination.vue_vue_type_script_setup_true_lang-DppVBws0.js";import{y as ce}from"./index-DCW2e4Az.js";import{D as me}from"./index-BIp7eSXk.js";import{Z as de}from"./index-DGweaj24.js";import{_ as pe}from"./EmptyData-Ct-xQv_N.js";import{_ as ve}from"./CollectionsBreadcrumb.vue_vue_type_script_setup_true_lang-DVYVfYF4.js";import{P as fe}from"./plus-DLR44m6p.js";import{C as O}from"./calendar-o9t4MkD2.js";import"./eye-Dijywc6g.js";import"./file-B_duymIT.js";import"./pencil-CwnPP4IJ.js";import"./trash-2-BGXMNU3d.js";import"./square-pen-xVs4e8Yb.js";import"./chevron-left-WFftVS9c.js";import"./chevron-right-BiiSb3Be.js";/**
|
|
2
|
-
* @license lucide-vue-next v0.344.0 - ISC
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the ISC license.
|
|
5
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/const he=Z("GlobeIcon",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]),ge={class:"space-y-6 max-w-7xl mx-auto"},ye={class:"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between"},be={class:"flex items-center gap-2"},we={class:"text-3xl font-bold text-slate-800 dark:text-white mb-2"},_e=["href","title"],xe={key:0,class:"text-card-foreground shadow-lg border-0 bg-white/80 dark:bg-slate-800/80 backdrop-blur-sm"},ke={key:0,class:"p-2 border-b border-gray-200 sm:px-4 sm:py-2 dark:border-gray-700"},Ce={class:"flex flex-col gap-4 sm:flex-row"},$e={class:"relative flex items-center gap-2 ml-auto"},Ae={key:1,class:"absolute top-full right-1/2 translate-x-1/2 min-w-full p-4 z-10 bg-white border border-gray-300 rounded-md mt-2 dark:bg-slate-800 dark:border-slate-700"},qe={class:"max-h-60 overflow-y-auto overflow-x-hidden"},Ue={key:1},Ke=W({__name:"ArticlesPage",setup(Fe){const l=se(),p=le(),c=r(null),z=r(""),{t:E,locale:I}=X(),x=r([]),M=re("menu")||[],m=r(""),k=r(1),h=r(!1),u=r(["title","slug","author","publish_at","published_at","status"]),C=r([]),g=r([]),U=r([]),y=r({}),$=r(0),F=r(!1),N=()=>{var a;let t=(a=c.value)==null?void 0:a.columns.filter(e=>{var s;return(s=u==null?void 0:u.value)==null?void 0:s.includes(e.name)});C.value=t.map(e=>{switch(e.name){case"title":return{...e,title:e.name?e.name.charAt(0).toUpperCase()+e.name.slice(1):"--",icon:oe};case"slug":return{...e,title:e.name?e.name.charAt(0).toUpperCase()+e.name.slice(1):"-",icon:he};case"author":return{...e,title:e.name?e.name.charAt(0).toUpperCase()+e.name.slice(1):"-",icon:ne};case"publish_at":return{...e,title:e.name?e.name.charAt(0).toUpperCase()+e.name.slice(1):"-",icon:O};case"published_at":return{...e,title:e.name?e.name.charAt(0).toUpperCase()+e.name.slice(1):"-",icon:O};default:return{...e,title:e.name?e.name.charAt(0).toUpperCase()+e.name.slice(1):"-"}}}),h.value=!1},T=B(()=>{var t;return(t=M.value.find(a=>a.id===l.params.id))==null?void 0:t.title}),R=B(()=>[{label:T.value||l.params.id,route:`collections/${l.params.id}`}]),P=t=>{t==="collections"?p.push("/collections"):p.push(`/${t}`)},V=()=>{p.push(`/collections/${l.params.id}/create`)},S=async t=>{console.log("handleRemoveArticle"),de({title:E("builder.deleteTitle"),message:E("builder.deleteObject"),type:"error",onConfirm:async()=>{await fetch(`/api/cms/${l.params.id}/${t.id}`,{method:"DELETE"}),b()}})},G=t=>{p.push(`/collections/${l.params.id}/${t.id}`)},b=async()=>{if(!F.value){F.value=!0;try{const a=await(await fetch(`/api/cms/${l.params.id}?page=${k.value}&filter=${m.value}`)).json();x.value=a.rows||[],c.value=a;const e=(a.filters||[]).map(s=>{const{extra:n,title:w,...Q}=s;return Q});U.value=e,l.params.id==="pages"&&u.value.push("type"),H(),N()}finally{F.value=!1}}},H=()=>{var a;if(!((a=c.value)!=null&&a.columns))return;const t=c.value.columns.map((e,s)=>({text:e.label,id:e.name}));g.value=[...u.value.map(e=>t.find(s=>s.id===e)).filter(Boolean),...t.filter(e=>!u.value.includes(e.id))]},K=(t,a)=>{if(!a)return!0;const e=a.toLowerCase();return C.value.some(s=>{const n=t[s.name];return n&&n.toString().toLowerCase().includes(e)})},J=t=>{const a=Object.entries(t==null?void 0:t.data).filter(([,s])=>s!=null).map(([s,n])=>`${s}=${n}`).join("|");m.value=a;const e={...l.query};a?e.filter=a:delete e.filter,p.replace({query:e})},j=()=>{if(l.query.filter){m.value=l.query.filter;const t=l.query.filter.split("|"),a={};t.forEach(e=>{const[s,n]=e.split("=");s&&n&&(a[s]=n)}),y.value=a}else m.value="",y.value={},$.value++};return Y(()=>{j(),b()}),D(()=>l.params.id,()=>{y.value={},m.value="",U.value=[];const t={...l.query};delete t.filter,p.replace({query:t}),$.value++,j(),b()}),D(()=>l.query,async()=>{j(),await L(),b()},{deep:!0}),D(k,async()=>{l.query.filter||(m.value="",y.value={},$.value++),await L(),b()}),(t,a)=>{var e,s,n;return o(),d("div",ge,[_(ve,{items:R.value,onNavigate:P},null,8,["items"]),i("div",ye,[i("div",be,[i("h1",we,A(T.value),1),i("a",{href:`https://cms.opengis.info/${v(I)}/guides/content/`,target:"_blank",title:t.$t("guide.content")},[_(v(ee),{class:"w-5 h-5"})],8,_e)]),x.value.length?(o(),d("button",{key:0,onClick:V,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"},[_(v(fe),{class:"w-4 h-4 mr-2"}),te(" "+A(t.$t("articles.createArticle")),1)])):f("",!0)]),x.value.length||m.value.length?(o(),d("div",xe,[(o(),d("div",ke,[i("div",Ce,[(o(),q(v(me),{key:$.value,schema:U.value,history:!0,value:y.value,view:"inline",onChange:J},null,8,["schema","value"])),i("div",$e,[g.value.length>0?(o(),d("div",{key:0,class:"flex items-center gap-2 cursor-pointer text-sm border border-gray-300 rounded-md p-2 dark:text-white",onClick:a[0]||(a[0]=w=>h.value=!h.value)},[i("p",null,A(t.$t("articles.showColumns")),1),_(v(ae),{class:"w-4 h-4"})])):f("",!0),g.value.length>0&&h.value?(o(),d("div",Ae,[i("div",qe,[g.value.length>0&&h.value?(o(),q(v(ce),{key:0,options:g.value,modelValue:u.value,"onUpdate:modelValue":a[1]||(a[1]=w=>u.value=w)},null,8,["options","modelValue"])):f("",!0)]),i("button",{class:"text-sm bg-blue-600 text-white rounded-md p-2 mt-4 w-full",onClick:N},A(t.$t("articles.update")),1)])):f("",!0)])])])),C.value.length>0?(o(),q(ie,{key:1,class:"max-h-[calc(100vh-270px)] overflow-y-auto",rows:x.value,columns:C.value,query:z.value,filterFn:K,onDelete:S,onEdit:G},null,8,["rows","columns","query"])):f("",!0),((e=c.value)==null?void 0:e.total)>20?(o(),q(ue,{key:2,total:(s=c.value)==null?void 0:s.filtered,count:(n=c.value)==null?void 0:n.count,page:k.value,"onUpdate:page":a[2]||(a[2]=w=>k.value=w),limit:20},null,8,["total","count","page"])):f("",!0)])):(o(),d("div",Ue,[_(pe,{onAction:V})]))])}}});export{Ke as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{q as O,u as R,l as z,m as b,o as p,a as k,b as e,f as g,e as i,g as J,t as c,w as L,_ as Q,s as X,d as W,j as Z,k as ee,h as M,L as N,n as S,i as te,v as D,x as oe,H as K,y as F,z as P,p as se,A as re,B as le,C as ae}from"./index-yMJAVBXk.js";import{J as ne,y as q}from"./index-DGweaj24.js";import{l as ie}from"./index-DCW2e4Az.js";import{P as de}from"./plus-DLR44m6p.js";import{u as ce}from"./useDebounce-DFq3rxAW.js";import{X as ue,C as pe,_ as he}from"./UniversalTable.vue_vue_type_script_setup_true_lang-BQ5m4aZd.js";import{_ as me}from"./UniversalTablePagination.vue_vue_type_script_setup_true_lang-DppVBws0.js";import{F as ge}from"./file-B_duymIT.js";import{S as G}from"./square-pen-xVs4e8Yb.js";import{T as be}from"./trash-2-BGXMNU3d.js";import{L as Y}from"./list-CXRbSNky.js";import{u as fe}from"./vue.-sixQ7xP-CUPNuJcq.js";import{S as xe}from"./search-C4-fHihx.js";import"./eye-Dijywc6g.js";import"./pencil-CwnPP4IJ.js";import"./chevron-left-WFftVS9c.js";import"./chevron-right-BiiSb3Be.js";const ve={class:"flex justify-end p-[20px] gap-[10px] border-t w-full"},we={__name:"CreateForm",setup(_){const a=O("fetchContentTypes"),{t:o}=R(),v=z(),f=b({}),x=b(!1),m=b({type:"collection"}),n={name:{type:"text",label:o("builder.scheme.name.label"),required:!0,placeholder:o("builder.scheme.name.placeholder"),validators:["required"]},title:{type:"text",label:o("builder.scheme.title.label"),required:!0,placeholder:o("builder.scheme.title.placeholder"),validators:["required"]},type:{type:"combobox",mode:"combo",label:o("builder.scheme.type.label"),required:!0,placeholder:o("builder.scheme.type.placeholder"),validators:["required"],options:[{text:o("builder.scheme.type.options.collection"),id:"collection"},{text:o("builder.scheme.type.options.single"),id:"single"}]},customTable:{type:"switcher",label:o("builder.scheme.customTable.label")}},h=async()=>{if(await f.value.validate()){q({type:"warning",title:o("common.actions.warning"),message:o("collections.collectionCreationFailed")});return}try{const l=await(await fetch("/api/cms-type",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(m.value)})).json();v.push(`/settings/collections/edit/${l.id}`),a(),q({type:"success",title:o("common.actions.success"),message:o("collections.collectionCreated")})}catch(s){q({type:"error",title:o("common.actions.error"),message:o("collections.collectionCreationFailed")}),console.error(s)}};return(t,s)=>(p(),k("div",null,[e("button",{onClick:s[0]||(s[0]=l=>x.value=!0),class:"inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 h-9 px-4 py-2 bg-blue-600 hover:bg-blue-700 text-white shadow-md hover:shadow-lg transition-all duration-200 transform hover:scale-105"},[g(i(de),{class:"w-4 h-4 mr-2"}),J(" "+c(t.$t("collections.createCollection")),1)]),g(i(ne),{teleport:"#modal",visible:x.value,title:t.$t("collections.createCollection"),onClose:s[4]||(s[4]=l=>x.value=!1)},{footer:L(()=>[e("div",ve,[e("button",{class:"inline-flex items-center px-3 py-2 text-sm text-black duration-300 border border-gray-200 rounded-lg gap-x-2 whitespace-nowrap hover:bg-gray-100",onClick:s[3]||(s[3]=l=>x.value=!1)},c(t.$t("common.actions.cancel")),1),e("button",{onClick:h,class:"py-2 px-3 inline-flex items-center gap-x-2 text-sm whitespace-nowrap text-white bg-blue-500 rounded-lg !border-gray-200 hover:bg-blue-700 duration-300"},c(t.$t("common.actions.save")),1)])]),default:L(()=>[g(i(ie),{form:f.value,"onUpdate:form":s[1]||(s[1]=l=>f.value=l),modelValue:m.value,"onUpdate:modelValue":s[2]||(s[2]=l=>m.value=l),schema:n},null,8,["form","modelValue"])]),_:1},8,["visible","title"])]))}},ye={},ke={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"};function _e(_,a){return p(),k("svg",ke,[...a[0]||(a[0]=[X('<line x1="8" x2="21" y1="6" y2="6"></line><line x1="8" x2="21" y1="12" y2="12"></line><line x1="8" x2="21" y1="18" y2="18"></line><line x1="3" x2="3.01" y1="6" y2="6"></line><line x1="3" x2="3.01" y1="12" y2="12"></line><line x1="3" x2="3.01" y1="18" y2="18"></line>',6)])])}const $e=Q(ye,[["render",_e]]),Ce={},je={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"};function Ve(_,a){return p(),k("svg",je,[...a[0]||(a[0]=[X('<rect width="18" height="18" x="3" y="3" rx="2"></rect><path d="M3 9h18"></path><path d="M3 15h18"></path><path d="M9 3v18"></path><path d="M15 3v18"></path>',5)])])}const Me=Q(Ce,[["render",Ve]]),Se={class:"grid grid-cols-1 lg:grid-cols-2 xl:grid-cols-3 gap-6 pb-6"},De={class:"flex items-center gap-2 space-y-1.5 p-6 border-b border-slate-200 dark:border-slate-700 bg-gradient-to-r from-slate-50 dark:from-slate-800 to-white dark:to-slate-800"},Te={class:"line-clamp-1 tracking-tight text-lg font-semibold text-slate-800 dark:text-slate-100 vertical-center"},Ee={class:"w-full flex flex-col gap-2 p-6"},Fe=["title"],qe={class:"flex items-center justify-between gap-2"},Be={class:"text-sm text-slate-600 dark:text-slate-400"},Le={class:"font-semibold text-slate-800 dark:text-slate-100"},Ne={class:"flex items-center justify-between gap-2"},Pe={class:"text-sm text-slate-500 dark:text-slate-400"},Ie={class:"font-semibold text-slate-800 dark:text-slate-100"},Ue={class:"flex items-center justify-between gap-2"},Ae={class:"text-sm text-slate-500 dark:text-slate-400"},He={class:"text-sm text-slate-600 dark:text-slate-300"},Ge={class:"flex items-center justify-between gap-2 mt-6"},Oe=["onClick"],Re={class:"text-slate-800 dark:text-slate-200 group-hover:text-green-600 dark:group-hover:text-blue-50"},ze=["onClick"],Je=["onClick"],Qe=W({__name:"CollectionsGrid",props:{collections:{},onEdit:{type:Function},onView:{type:Function},onDelete:{type:Function}},emits:["edit","view","delete"],setup(_,{emit:a}){b(!1),b(null);const o=_,v=a,f=(n,h)=>{switch(n){case"edit":v("edit",h),o.onEdit&&o.onEdit(h);break;case"view":v("view",h),o.onView&&o.onView(h);break;case"delete":v("delete",h),o.onDelete&&o.onDelete(h);break}},x=n=>{const h=new Date,t=new Date(n),s=h.getTime()-t.getTime(),l=Math.floor(s/1e3),u=Math.floor(l/60),y=Math.floor(u/60),w=Math.floor(y/24),j=Math.floor(w/7);return j>=2?`${j} weeks ago`:j===1?"1 week ago":w>=2?`${w} days ago`:w===1?"1 day ago":y>=2?`${y} hours ago`:y===1?"1 hour ago":u>=2?`${u} minutes ago`:u===1?"1 minute ago":"just now"},m=n=>{switch(n){case"published":return{icon:pe,text:"Published",classes:"bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-200 border-green-200 dark:border-green-700"};case"draft":return{icon:G,text:"Draft",classes:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900/30 dark:text-yellow-200 border-yellow-200 dark:border-yellow-700"};case"archived":return{icon:ue,text:"Archived",classes:"bg-gray-100 text-gray-800 dark:bg-gray-900/30 dark:text-gray-300 border-gray-200 dark:border-gray-700"};default:return{icon:K,text:"--",classes:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900/30 dark:text-yellow-200 border-yellow-200 dark:border-yellow-700"}}};return(n,h)=>(p(),k("div",Se,[(p(!0),k(Z,null,ee(n.collections,t=>{var s,l,u;return p(),k("div",{key:t.id,class:"rounded-xl text-card-foreground shadow-lg border-0 bg-white dark:bg-slate-800 backdrop-blur-sm hover:shadow-xl transition-all duration-200 transform hover:bg-slate-50"},[e("div",De,[t.type==="single"?(p(),M(i(ge),{key:0,class:"shrink-0 lucide lucide-page w-5 h-5 text-blue-600"})):(p(),M(i(N),{key:1,class:"shrink-0 lucide lucide-layers w-5 h-5 text-blue-600"})),e("p",Te,c(t.title),1),m(t.status)?(p(),k("div",{key:2,class:S(["whitespace-nowrap rounded-md border ml-auto px-2.5 py-0.5 text-xs font-semibold transition-colors hover:bg-secondary/80 flex items-center w-fit bg-green-100 text-green-800 border-green-200 dark:bg-green-900/30 dark:text-green-300 dark:border-green-700",(s=m(t.status))==null?void 0:s.classes])},[(p(),M(te((l=m(t.status))==null?void 0:l.icon),{class:"w-3 h-3 mr-1"})),J(" "+c((u=m(t.status))==null?void 0:u.text),1)],2)):D("",!0)]),e("div",Ee,[e("p",{class:"text-slate-600 dark:text-slate-300 mb-4 line-clamp-2",title:t.description},c(t.description!==null?t.description:"No description"),9,Fe),e("div",qe,[e("p",Be,c(n.$t("collections.entries"))+":",1),e("p",Le,c(t.entries),1)]),e("div",Ne,[e("p",Pe,c(n.$t("collections.fields"))+":",1),e("p",Ie,c(t.fields),1)]),e("div",Ue,[e("p",Ae,c(n.$t("collections.lastModified"))+":",1),e("p",He,c(x(t.last_edit)),1)]),e("div",Ge,[oe(n.$slots,"actions",{collection:t,handleAction:f},()=>[e("button",{class:"inline-flex gap-1 items-center justify-center whitespace-nowrap font-medium border rounded-md text-xs h-8 w-4/5 p-0 border-slate-300 bg-white transition-all duration-200 shadow-sm group dark:border-slate-600 dark:bg-slate-700 dark:hover:bg-slate-600 dark:hover:border-slate-500 dark:hover:text-slate-200 hover:bg-green-50 hover:border-green-300",onClick:F(y=>f("edit",t),["stop"])},[g(i(G),{class:"text-slate-800 dark:text-slate-200 w-4 h-4 group-hover:text-green-600 dark:group-hover:text-blue-50"}),e("span",Re,c(n.$t("common.actions.edit")),1)],8,Oe),e("button",{class:S([t.id==="pages"?"disabled":"","inline-flex items-center justify-center whitespace-nowrap font-medium border rounded-md text-xs h-8 w-8 p-0 border-slate-300 bg-white transition-all duration-200 shadow-sm group dark:border-slate-600 dark:bg-slate-700 dark:hover:bg-slate-600 dark:hover:border-slate-500 dark:hover:text-slate-200 hover:bg-red-50 hover:border-red-300"]),onClick:F(y=>t.id==="pages"?null:f("delete",t),["stop"])},[g(i(be),{class:"text-slate-800 dark:text-slate-200 w-4 h-4 group-hover:text-red-600 dark:group-hover:text-blue-50"})],10,ze),e("button",{class:S([t.type==="single"?"disabled cursor-not-allowed":"","inline-flex items-center justify-center whitespace-nowrap font-medium border rounded-md text-xs h-8 w-8 p-0 border-slate-300 bg-white transition-all duration-200 shadow-sm group dark:border-slate-600 dark:bg-slate-700 dark:hover:bg-slate-600 dark:hover:border-slate-500 dark:hover:text-slate-200 hover:bg-blue-50 hover:border-blue-300"]),onClick:F(y=>t.type==="single"?null:f("view",t),["stop"])},[g(i(Y),{class:"text-slate-800 dark:text-slate-200 w-4 h-4 group-hover:text-blue-600 dark:group-hover:text-blue-50"})],10,Je)])])])])}),128))]))}}),B=localStorage.getItem("collectionView"),T=b(B==="list"||B==="grid"?B:"list");P(T,_=>{localStorage.setItem("collectionView",_)});function Xe(){T.value=T.value==="grid"?"list":"grid"}function We(){return{collectionView:T,toggleCollectionView:Xe}}const Ke={class:"space-y-6 max-w-7xl mx-auto"},Ye={class:"flex items-center justify-between mb-8"},Ze={class:"flex gap-4"},et={class:"text-3xl font-bold text-slate-800 dark:text-slate-100 mb-2"},tt={class:"text-slate-600 dark:text-slate-300"},ot=["href","title"],st={class:"flex items-center gap-3"},rt={class:"relative"},lt={class:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none"},at=["placeholder"],nt={class:"flex items-center bg-white dark:bg-slate-700 border border-slate-200 dark:border-slate-600 rounded-lg p-1 max-w-[fit-content]"},it=["onClick"],Vt=W({__name:"BuilderPage",setup(_){const{t:a,locale:o}=R(),v=z(),f=[{name:"name",title:a("builder.collectionName"),type:"text",icon:N},{name:"title",title:a("builder.title"),type:"text",icon:N},{name:"description",title:a("common.description"),type:"text"},{name:"entries",title:a("builder.entries"),type:"number"},{name:"fields",title:a("builder.fields"),type:"number"},{name:"status",title:a("builder.status"),type:"text"},{name:"last_edit",title:a("builder.lastModified"),type:"date"}],x=b(""),m=ce(x,300);fe({title:()=>a("collections.title")+" | CMS"});const n=b([]),h=O("fetchContentTypes"),t=b(1),s=b(16),l=b(null),{collectionView:u,toggleCollectionView:y}=We();async function w(){try{const r=m.value?`&search=${encodeURIComponent(String(m.value))}`:"",d=`/api/cms-type?page=${t.value}&limit=${s.value}${r}`;console.log("Fetching collections with URL:",d);const $=await fetch(d);if(!$.ok)throw new Error("Failed to fetch collections");const V=await $.json();console.log("Collections fetched:",V),n.value=V.rows,l.value=V}catch(r){console.error("Error fetching collections:",r)}}se(()=>{w()});const j=re(()=>[...n.value].sort((d,$)=>d.id==="pages"?-1:$.id==="pages"?1:0)),I=async r=>{try{await fetch(`/api/cms-type/${r.id}`,{method:"DELETE"}),w(),h()}catch(d){console.error("Error deleting collection:",d)}},U=r=>{v.push(`/settings/collections/edit/${r.id||r.name}`)},E=r=>{r.type==="single"?v.push(`/collections/single/${r.name}`):v.push(`/collections/${r.name}`)};return P(t,()=>{w()}),P(m,r=>{console.log("Search query changed:",r),t.value=1,w()}),(r,d)=>{var $,V,A,H;return p(),k("div",Ke,[e("div",Ye,[e("div",Ze,[e("div",null,[e("h1",et,c(r.$t("builder.collections")),1),e("p",tt,c(r.$t("builder.manageContentCollections")),1)]),e("a",{href:`https://cms.opengis.info/${i(o)}/guides/collections/`,target:"_blank",title:r.$t("guide.collections"),class:"mt-2"},[g(i(K),{class:"w-5 h-5"})],8,ot)]),e("div",st,[e("div",rt,[e("div",lt,[g(i(xe),{class:"w-5 h-5 text-gray-400"})]),le(e("input",{type:"text",class:"block w-full py-2 pl-10 pr-3 leading-5 text-gray-900 placeholder-gray-500 transition-colors bg-white border border-gray-300 rounded-md dark:border-gray-600 dark:bg-gray-700 dark:placeholder-gray-400 focus:outline-none focus:ring-sky-500 focus:border-sky-500 dark:text-white sm:text-sm",placeholder:r.$t("builder.searchCollections"),"onUpdate:modelValue":d[0]||(d[0]=C=>x.value=C)},null,8,at),[[ae,x.value]])]),e("div",nt,[e("button",{class:S(["inline-flex items-center justify-center whitespace-nowrap font-medium transition-colors rounded-md text-xs h-8 w-8 p-0 hover:bg-blue-700 hover:text-white cursor-pointer",{"bg-blue-600 text-white":i(u)==="list"}]),onClick:d[1]||(d[1]=C=>u.value="list")},[g($e,{class:"dark:text-blue-50 w-4 h-4"})],2),e("button",{class:S(["inline-flex items-center justify-center whitespace-nowrap font-medium transition-colors rounded-md text-xs h-8 w-8 p-0 hover:bg-blue-700 hover:text-white cursor-pointer",{"bg-blue-600 text-white":i(u)==="grid"}]),onClick:d[2]||(d[2]=C=>u.value="grid")},[g(Me,{class:"dark:text-blue-50 w-4 h-4"})],2)]),g(we)])]),e("div",null,[i(u)==="list"?(p(),M(he,{key:0,class:"max-h-[calc(100vh-270px)] overflow-y-auto overflow-x-hidden",columns:f,rows:j.value,onDelete:I,onEdit:U,onView:E},{actions:L(({row:C})=>[e("button",{class:"inline-flex items-center justify-center whitespace-nowrap font-medium border rounded-md text-xs h-8 w-8 p-0 border-slate-300 bg-white transition-all duration-200 shadow-sm group dark:border-slate-600 dark:bg-slate-700 dark:hover:bg-slate-600 dark:hover:border-slate-500 dark:hover:text-slate-200 hover:bg-blue-50 hover:border-blue-300 hover:text-blue-600",onClick:dt=>E(C)},[g(i(Y),{class:"text-slate-800 dark:text-slate-200 w-4 h-4 group-hover:text-blue-600 dark:group-hover:text-blue-50"})],8,it)]),_:1},8,["rows"])):D("",!0),i(u)==="grid"?(p(),M(Qe,{key:1,collections:j.value,onEdit:U,onView:E,onDelete:I,class:"max-h-[calc(100vh-270px)] overflow-y-auto overflow-x-hidden"},null,8,["collections"])):D("",!0),(($=l.value)==null?void 0:$.total)>16?(p(),M(me,{key:2,total:(V=l.value)==null?void 0:V.filtered,count:((A=l.value)==null?void 0:A.count)||((H=l.value)==null?void 0:H.total),page:t.value,"onUpdate:page":d[3]||(d[3]=C=>t.value=C),limit:s.value},null,8,["total","count","page","limit"])):D("",!0)])])}}});export{Vt as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{d as b,o as t,a,b as c,f as g,e as r,L as p,g as k,t as o,h as i,v as u,j as m,k as x}from"./index-yMJAVBXk.js";import{C as d}from"./chevron-right-BiiSb3Be.js";const h={class:"flex items-center space-x-1 mb-4"},f=["onClick"],v={key:1,class:"flex gap-x-1 items-center px-2 py-1 rounded text-sm font-medium text-slate-700 dark:text-slate-300"},$=b({__name:"CollectionsBreadcrumb",props:{items:{}},emits:["navigate"],setup(y){return(e,n)=>(t(),a("div",h,[c("button",{class:"flex gap-x-1 items-center px-2 py-1 rounded text-sm font-medium transition-all duration-200 text-blue-600 dark:text-blue-400 bg-blue-50 dark:bg-blue-900/20 hover:bg-blue-100 dark:hover:bg-blue-900/30",onClick:n[0]||(n[0]=s=>e.$emit("navigate","collections"))},[g(r(p),{class:"w-3 h-3"}),k(" "+o(e.$t("navigation.collections")),1)]),e.items.length>0?(t(),i(r(d),{key:0,class:"w-3 h-3 text-slate-400 dark:text-slate-500"})):u("",!0),(t(!0),a(m,null,x(e.items,(s,l)=>(t(),a(m,{key:l},[l<e.items.length-1?(t(),a("button",{key:0,class:"flex gap-x-1 items-center px-2 py-1 rounded text-sm font-medium transition-all duration-200 text-blue-700 dark:text-blue-300 bg-blue-50 dark:bg-blue-900/20 hover:bg-blue-100 dark:hover:bg-blue-900/30",onClick:C=>e.$emit("navigate",s.route)},o(s.label),9,f)):(t(),a("span",v,o(s.label),1)),l<e.items.length-1?(t(),i(r(d),{key:2,class:"w-3 h-3 text-slate-400 dark:text-slate-500"})):u("",!0)],64))),128))]))}});export{$ as _};
|