underpost 2.8.878 → 2.8.882
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/.env.development +35 -3
- package/.env.production +40 -3
- package/.env.test +35 -3
- package/.github/workflows/release.cd.yml +3 -3
- package/README.md +20 -2
- package/bin/deploy.js +40 -0
- package/cli.md +3 -1
- package/conf.js +29 -3
- package/manifests/deployment/dd-default-development/deployment.yaml +2 -2
- package/manifests/deployment/dd-test-development/deployment.yaml +6 -6
- package/package.json +1 -2
- package/src/api/document/document.controller.js +66 -0
- package/src/api/document/document.model.js +51 -0
- package/src/api/document/document.router.js +24 -0
- package/src/api/document/document.service.js +133 -0
- package/src/cli/deploy.js +1 -1
- package/src/cli/index.js +2 -0
- package/src/cli/repository.js +2 -0
- package/src/cli/run.js +27 -1
- package/src/client/Default.index.js +46 -1
- package/src/client/components/core/Account.js +8 -1
- package/src/client/components/core/AgGrid.js +18 -9
- package/src/client/components/core/Auth.js +258 -89
- package/src/client/components/core/BtnIcon.js +13 -3
- package/src/client/components/core/Content.js +2 -1
- package/src/client/components/core/CssCore.js +40 -27
- package/src/client/components/core/Docs.js +189 -88
- package/src/client/components/core/Input.js +34 -19
- package/src/client/components/core/LoadingAnimation.js +5 -10
- package/src/client/components/core/Modal.js +280 -123
- package/src/client/components/core/ObjectLayerEngine.js +470 -104
- package/src/client/components/core/ObjectLayerEngineModal.js +1 -0
- package/src/client/components/core/Panel.js +9 -2
- package/src/client/components/core/PanelForm.js +234 -76
- package/src/client/components/core/Router.js +15 -15
- package/src/client/components/core/ToolTip.js +83 -19
- package/src/client/components/core/Translate.js +1 -1
- package/src/client/components/core/VanillaJs.js +7 -3
- package/src/client/components/core/windowGetDimensions.js +202 -0
- package/src/client/components/default/MenuDefault.js +105 -41
- package/src/client/components/default/RoutesDefault.js +2 -0
- package/src/client/services/default/default.management.js +1 -0
- package/src/client/services/document/document.service.js +97 -0
- package/src/client/services/file/file.service.js +2 -0
- package/src/client/ssr/Render.js +1 -1
- package/src/client/ssr/head/DefaultScripts.js +2 -0
- package/src/client/ssr/head/Seo.js +1 -0
- package/src/index.js +1 -1
- package/src/mailer/EmailRender.js +1 -1
- package/src/server/auth.js +68 -17
- package/src/server/client-build.js +2 -3
- package/src/server/client-formatted.js +40 -12
- package/src/server/conf.js +5 -1
- package/src/server/crypto.js +195 -76
- package/src/server/object-layer.js +196 -0
- package/src/server/peer.js +47 -5
- package/src/server/process.js +85 -1
- package/src/server/runtime.js +23 -23
- package/src/server/ssr.js +52 -10
- package/src/server/valkey.js +89 -1
- package/test/crypto.test.js +117 -0
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* windowGetDimensions.js
|
|
3
|
+
* ES6 vanilla utilities: windowGetH and windowGetW
|
|
4
|
+
* Returns the most reliable viewport height/width available, with fallbacks
|
|
5
|
+
* from modern to old browsers.
|
|
6
|
+
*
|
|
7
|
+
* Usage:
|
|
8
|
+
* import { windowGetH, windowGetW } from './windowGetDimensions.js';
|
|
9
|
+
* const h = windowGetH();
|
|
10
|
+
* const w = windowGetW();
|
|
11
|
+
*
|
|
12
|
+
* Notes:
|
|
13
|
+
* - visualViewport (when present) reflects the *visible* viewport (changes when
|
|
14
|
+
* the on-screen keyboard opens, or when mobile address/toolbars show/hide).
|
|
15
|
+
* - documentElement.clientHeight/Width reflect the layout viewport.
|
|
16
|
+
* - window.innerHeight/innerWidth include scrollbars and are widely supported.
|
|
17
|
+
* - screen.* values are last-resort and reflect the physical screen, not the
|
|
18
|
+
* browser chrome.
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
// Helper: coerce a candidate to a finite integer (or null if not usable)
|
|
22
|
+
const toInt = (v) => {
|
|
23
|
+
const n = Number(v);
|
|
24
|
+
return Number.isFinite(n) && n > 0 ? Math.round(n) : null;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Try visualViewport values (most accurate for "what's actually visible").
|
|
29
|
+
* @returns {{height: number|null, width: number|null}}
|
|
30
|
+
*/
|
|
31
|
+
const getFromVisualViewport = () => {
|
|
32
|
+
if (typeof window !== 'undefined' && window.visualViewport) {
|
|
33
|
+
const { height, width } = window.visualViewport;
|
|
34
|
+
return { height: toInt(height), width: toInt(width) };
|
|
35
|
+
}
|
|
36
|
+
return { height: null, width: null };
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Try layout viewport (doctype-root) measurements.
|
|
41
|
+
* document.documentElement.clientHeight/clientWidth are stable and widely used.
|
|
42
|
+
* @returns {{height: number|null, width: number|null}}
|
|
43
|
+
*/
|
|
44
|
+
const getFromDocumentElement = () => {
|
|
45
|
+
if (typeof document !== 'undefined' && document.documentElement) {
|
|
46
|
+
const { clientHeight, clientWidth } = document.documentElement;
|
|
47
|
+
return { height: toInt(clientHeight), width: toInt(clientWidth) };
|
|
48
|
+
}
|
|
49
|
+
return { height: null, width: null };
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Try window.* measurements (innerHeight/innerWidth are widely supported).
|
|
54
|
+
* @returns {{height: number|null, width: number|null}}
|
|
55
|
+
*/
|
|
56
|
+
const getFromWindowInner = () => {
|
|
57
|
+
if (typeof window !== 'undefined') {
|
|
58
|
+
return { height: toInt(window.innerHeight), width: toInt(window.innerWidth) };
|
|
59
|
+
}
|
|
60
|
+
return { height: null, width: null };
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Try body measurements.
|
|
65
|
+
* @returns {{height: number|null, width: number|null}}
|
|
66
|
+
*/
|
|
67
|
+
const getFromBody = () => {
|
|
68
|
+
if (typeof document !== 'undefined' && document.body) {
|
|
69
|
+
return { height: toInt(document.body.clientHeight), width: toInt(document.body.clientWidth) };
|
|
70
|
+
}
|
|
71
|
+
return { height: null, width: null };
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Try screen measurements (physical screen/fallback).
|
|
76
|
+
* screen.availHeight/availWidth are often available; outer* might also exist.
|
|
77
|
+
* @returns {{height: number|null, width: number|null}}
|
|
78
|
+
*/
|
|
79
|
+
const getFromScreen = () => {
|
|
80
|
+
if (typeof window !== 'undefined' && window.screen) {
|
|
81
|
+
const { availHeight, availWidth, height, width } = window.screen;
|
|
82
|
+
return {
|
|
83
|
+
height: toInt(availHeight) || toInt(height) || null,
|
|
84
|
+
width: toInt(availWidth) || toInt(width) || null,
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
return { height: null, width: null };
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Try outer dimensions (less reliable, but sometimes available).
|
|
92
|
+
* @returns {{height: number|null, width: number|null}}
|
|
93
|
+
*/
|
|
94
|
+
const getFromOuter = () => {
|
|
95
|
+
if (typeof window !== 'undefined') {
|
|
96
|
+
return { height: toInt(window.outerHeight), width: toInt(window.outerWidth) };
|
|
97
|
+
}
|
|
98
|
+
return { height: null, width: null };
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Merge candidates in priority order and return first valid value.
|
|
103
|
+
* @param {...(number|null)[]} candidates
|
|
104
|
+
* @returns {number|null}
|
|
105
|
+
*/
|
|
106
|
+
const pickFirst = (...candidates) => {
|
|
107
|
+
for (const c of candidates) {
|
|
108
|
+
if (Number.isFinite(c) && c > 0) return Math.round(c);
|
|
109
|
+
}
|
|
110
|
+
return null;
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* Get the best-available viewport height in pixels.
|
|
115
|
+
* Priority (from most reliable for "visible" to least):
|
|
116
|
+
* 1. window.visualViewport.height
|
|
117
|
+
* 2. document.documentElement.clientHeight
|
|
118
|
+
* 3. window.innerHeight
|
|
119
|
+
* 4. document.body.clientHeight
|
|
120
|
+
* 5. window.screen.availHeight / window.screen.height
|
|
121
|
+
* 6. window.outerHeight
|
|
122
|
+
*
|
|
123
|
+
* @param {Object} [options]
|
|
124
|
+
* @param {boolean} [options.preferVisualViewport=true] - when true, prefer visualViewport if present
|
|
125
|
+
* @returns {number|null} height in px (rounded integer) or null if none found
|
|
126
|
+
*/
|
|
127
|
+
export const windowGetH = (options = {}) => {
|
|
128
|
+
const { preferVisualViewport = true } = options;
|
|
129
|
+
|
|
130
|
+
const vv = getFromVisualViewport();
|
|
131
|
+
const de = getFromDocumentElement();
|
|
132
|
+
const wi = getFromWindowInner();
|
|
133
|
+
const bd = getFromBody();
|
|
134
|
+
const sc = getFromScreen();
|
|
135
|
+
const ot = getFromOuter();
|
|
136
|
+
|
|
137
|
+
if (preferVisualViewport) {
|
|
138
|
+
return pickFirst(vv.height, de.height, wi.height, bd.height, sc.height, ot.height) || null;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
// if not preferring visualViewport, still include it but later
|
|
142
|
+
return pickFirst(de.height, wi.height, bd.height, vv.height, sc.height, ot.height) || null;
|
|
143
|
+
};
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* Get the best-available viewport width in pixels.
|
|
147
|
+
* Priority (from most reliable for "visible" to least):
|
|
148
|
+
* 1. window.visualViewport.width
|
|
149
|
+
* 2. document.documentElement.clientWidth
|
|
150
|
+
* 3. window.innerWidth
|
|
151
|
+
* 4. document.body.clientWidth
|
|
152
|
+
* 5. window.screen.availWidth / window.screen.width
|
|
153
|
+
* 6. window.outerWidth
|
|
154
|
+
*
|
|
155
|
+
* @param {Object} [options]
|
|
156
|
+
* @param {boolean} [options.preferVisualViewport=true] - when true, prefer visualViewport if present
|
|
157
|
+
* @returns {number|null} width in px (rounded integer) or null if none found
|
|
158
|
+
*/
|
|
159
|
+
export const windowGetW = (options = {}) => {
|
|
160
|
+
const { preferVisualViewport = true } = options;
|
|
161
|
+
|
|
162
|
+
const vv = getFromVisualViewport();
|
|
163
|
+
const de = getFromDocumentElement();
|
|
164
|
+
const wi = getFromWindowInner();
|
|
165
|
+
const bd = getFromBody();
|
|
166
|
+
const sc = getFromScreen();
|
|
167
|
+
const ot = getFromOuter();
|
|
168
|
+
|
|
169
|
+
if (preferVisualViewport) {
|
|
170
|
+
return pickFirst(vv.width, de.width, wi.width, bd.width, sc.width, ot.width) || null;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
return pickFirst(de.width, wi.width, bd.width, vv.width, sc.width, ot.width) || null;
|
|
174
|
+
};
|
|
175
|
+
|
|
176
|
+
// Convenience default export (optional)
|
|
177
|
+
export default {
|
|
178
|
+
windowGetH,
|
|
179
|
+
windowGetW,
|
|
180
|
+
};
|
|
181
|
+
|
|
182
|
+
/* --------------------------------------------------------------------------
|
|
183
|
+
* Example usage:
|
|
184
|
+
*
|
|
185
|
+
* import { windowGetH, windowGetW } from './windowGetDimensions.js';
|
|
186
|
+
*
|
|
187
|
+
* // Get values now
|
|
188
|
+
* const currentH = windowGetH();
|
|
189
|
+
* const currentW = windowGetW();
|
|
190
|
+
*
|
|
191
|
+
* // React to changes (recommended on mobile)
|
|
192
|
+
* if (window.visualViewport) {
|
|
193
|
+
* window.visualViewport.addEventListener('resize', () => {
|
|
194
|
+
* console.log('visualViewport resize ->', windowGetH(), windowGetW());
|
|
195
|
+
* });
|
|
196
|
+
* } else {
|
|
197
|
+
* window.addEventListener('resize', () => {
|
|
198
|
+
* console.log('window resize ->', windowGetH(), windowGetW());
|
|
199
|
+
* });
|
|
200
|
+
* }
|
|
201
|
+
*
|
|
202
|
+
* --------------------------------------------------------------------------*/
|
|
@@ -29,6 +29,8 @@ import { Recover } from '../core/Recover.js';
|
|
|
29
29
|
import { DefaultManagement } from '../../services/default/default.management.js';
|
|
30
30
|
import { Page500 } from '../core/500.js';
|
|
31
31
|
import { Page404 } from '../core/404.js';
|
|
32
|
+
import { PanelForm } from '../core/PanelForm.js';
|
|
33
|
+
import { Chat } from '../core/Chat.js';
|
|
32
34
|
|
|
33
35
|
const MenuDefault = {
|
|
34
36
|
Data: {},
|
|
@@ -49,6 +51,7 @@ const MenuDefault = {
|
|
|
49
51
|
<div class="fl menu-btn-container">
|
|
50
52
|
${await BtnIcon.Render({
|
|
51
53
|
class: 'in wfa main-btn-menu main-btn-home main-btn-menu-active',
|
|
54
|
+
useMenuBtn: true,
|
|
52
55
|
label: renderMenuLabel({
|
|
53
56
|
icon: html`<i class="fas fa-home"></i>`,
|
|
54
57
|
text: html`<span class="menu-label-text">${Translate.Render('home')}</span>`,
|
|
@@ -61,6 +64,7 @@ const MenuDefault = {
|
|
|
61
64
|
})}
|
|
62
65
|
${await BtnIcon.Render({
|
|
63
66
|
class: 'in wfa main-btn-menu main-btn-log-in',
|
|
67
|
+
useMenuBtn: true,
|
|
64
68
|
label: renderMenuLabel({
|
|
65
69
|
icon: html`<i class="fas fa-sign-in-alt"></i>`,
|
|
66
70
|
text: html`<span class="menu-label-text">${Translate.Render('log-in')}</span>`,
|
|
@@ -72,6 +76,7 @@ const MenuDefault = {
|
|
|
72
76
|
})}
|
|
73
77
|
${await BtnIcon.Render({
|
|
74
78
|
class: 'in wfa main-btn-menu main-btn-sign-up',
|
|
79
|
+
useMenuBtn: true,
|
|
75
80
|
label: renderMenuLabel({
|
|
76
81
|
icon: html`<i class="fas fa-user-plus"></i>`,
|
|
77
82
|
text: html`<span class="menu-label-text">${Translate.Render('sign-up')}</span>`,
|
|
@@ -83,6 +88,7 @@ const MenuDefault = {
|
|
|
83
88
|
})}
|
|
84
89
|
${await BtnIcon.Render({
|
|
85
90
|
class: 'in wfa main-btn-menu main-btn-log-out',
|
|
91
|
+
useMenuBtn: true,
|
|
86
92
|
label: renderMenuLabel({
|
|
87
93
|
icon: html`<i class="fas fa-sign-out-alt"></i>`,
|
|
88
94
|
text: html`<span class="menu-label-text">${Translate.Render('log-out')}</span>`,
|
|
@@ -95,6 +101,7 @@ const MenuDefault = {
|
|
|
95
101
|
})}
|
|
96
102
|
${await BtnIcon.Render({
|
|
97
103
|
class: 'in wfa main-btn-menu main-btn-account',
|
|
104
|
+
useMenuBtn: true,
|
|
98
105
|
label: renderMenuLabel({
|
|
99
106
|
icon: html`<i class="fas fa-user-circle"></i>`,
|
|
100
107
|
text: html`<span class="menu-label-text">${Translate.Render('account')}</span>`,
|
|
@@ -107,6 +114,7 @@ const MenuDefault = {
|
|
|
107
114
|
})}
|
|
108
115
|
${await BtnIcon.Render({
|
|
109
116
|
class: 'in wfa main-btn-menu main-btn-settings',
|
|
117
|
+
useMenuBtn: true,
|
|
110
118
|
label: renderMenuLabel({
|
|
111
119
|
icon: html`<i class="fas fa-sliders-h"></i>`,
|
|
112
120
|
text: html`<span class="menu-label-text">${Translate.Render('settings')}</span>`,
|
|
@@ -118,6 +126,7 @@ const MenuDefault = {
|
|
|
118
126
|
})}
|
|
119
127
|
${await BtnIcon.Render({
|
|
120
128
|
class: 'in wfa main-btn-menu main-btn-recover hide',
|
|
129
|
+
useMenuBtn: true,
|
|
121
130
|
label: renderMenuLabel({
|
|
122
131
|
icon: html`<i class="fa-solid fa-arrow-rotate-left"></i>`,
|
|
123
132
|
text: html`<span class="menu-label-text">${Translate.Render('recover')}</span>`,
|
|
@@ -129,6 +138,7 @@ const MenuDefault = {
|
|
|
129
138
|
})}
|
|
130
139
|
${await BtnIcon.Render({
|
|
131
140
|
class: 'in wfa main-btn-menu main-btn-default-management',
|
|
141
|
+
useMenuBtn: true,
|
|
132
142
|
label: renderMenuLabel({
|
|
133
143
|
icon: html`<i class="fa-solid fa-rectangle-list"></i>`,
|
|
134
144
|
text: html`<span class="menu-label-text">${Translate.Render('default-management')}</span>`,
|
|
@@ -140,6 +150,7 @@ const MenuDefault = {
|
|
|
140
150
|
})}
|
|
141
151
|
${await BtnIcon.Render({
|
|
142
152
|
class: 'in wfa main-btn-menu main-btn-404 hide',
|
|
153
|
+
useMenuBtn: true,
|
|
143
154
|
label: renderMenuLabel({
|
|
144
155
|
icon: html`<i class="fa-solid fa-triangle-exclamation"></i>`,
|
|
145
156
|
text: html`<span class="menu-label-text">${Translate.Render('404')}</span>`,
|
|
@@ -151,6 +162,7 @@ const MenuDefault = {
|
|
|
151
162
|
})}
|
|
152
163
|
${await BtnIcon.Render({
|
|
153
164
|
class: 'in wfa main-btn-menu main-btn-500 hide',
|
|
165
|
+
useMenuBtn: true,
|
|
154
166
|
label: renderMenuLabel({
|
|
155
167
|
icon: html`<i class="fa-solid fa-circle-exclamation"></i>`,
|
|
156
168
|
text: html`<span class="menu-label-text">${Translate.Render('500')}</span>`,
|
|
@@ -160,6 +172,35 @@ const MenuDefault = {
|
|
|
160
172
|
handleContainerClass: 'handle-btn-container',
|
|
161
173
|
tooltipHtml: await Badge.Render(buildBadgeToolTipMenuOption('500')),
|
|
162
174
|
})}
|
|
175
|
+
${await BtnIcon.Render({
|
|
176
|
+
class: 'in wfa main-btn-menu main-btn-blog',
|
|
177
|
+
useMenuBtn: true,
|
|
178
|
+
label: renderMenuLabel({
|
|
179
|
+
icon: html`<i class="fa-solid fa-file-invoice"></i>`,
|
|
180
|
+
text: html`<span class="menu-label-text">${Translate.Render('blog')}</span>`,
|
|
181
|
+
}),
|
|
182
|
+
attrs: `data-id="blog"`,
|
|
183
|
+
tabHref: `${getProxyPath()}blog`,
|
|
184
|
+
handleContainerClass: 'handle-btn-container',
|
|
185
|
+
tooltipHtml: await Badge.Render(buildBadgeToolTipMenuOption('blog')),
|
|
186
|
+
})}
|
|
187
|
+
${await BtnIcon.Render({
|
|
188
|
+
class: 'in wfa main-btn-menu main-btn-chat',
|
|
189
|
+
label: html`${renderMenuLabel({
|
|
190
|
+
icon: html`<i class="far fa-comments"></i>`,
|
|
191
|
+
text: html`<span class="menu-label-text">${Translate.Render('chat')}</span>`,
|
|
192
|
+
})}
|
|
193
|
+
${await Badge.Render({
|
|
194
|
+
id: 'main-btn-chat',
|
|
195
|
+
type: 'circle-red',
|
|
196
|
+
style: badgeNotificationMenuStyle,
|
|
197
|
+
classList: 'hide',
|
|
198
|
+
})}`,
|
|
199
|
+
attrs: `data-id="chat"`,
|
|
200
|
+
tabHref: `${getProxyPath()}chat`,
|
|
201
|
+
handleContainerClass: 'handle-btn-container',
|
|
202
|
+
tooltipHtml: await Badge.Render(buildBadgeToolTipMenuOption('chat')),
|
|
203
|
+
})}
|
|
163
204
|
</div>
|
|
164
205
|
`,
|
|
165
206
|
barConfig: newInstance(barConfig),
|
|
@@ -181,47 +222,7 @@ const MenuDefault = {
|
|
|
181
222
|
RouterInstance,
|
|
182
223
|
heightTopBar,
|
|
183
224
|
heightBottomBar,
|
|
184
|
-
htmlMainBody:
|
|
185
|
-
setTimeout(() => {
|
|
186
|
-
EventsUI.onClick('.get-started-button', (e) => {
|
|
187
|
-
e.preventDefault();
|
|
188
|
-
location.href = `https://www.nexodev.org/docs/?cid=src`;
|
|
189
|
-
});
|
|
190
|
-
});
|
|
191
|
-
return html`
|
|
192
|
-
<div class="landing-container">
|
|
193
|
-
<div class="content-wrapper">
|
|
194
|
-
<h1 class="animated-text">
|
|
195
|
-
<span class="greeting">Hello, World!</span>
|
|
196
|
-
<span class="subtitle">Welcome to Our Platform</span>
|
|
197
|
-
</h1>
|
|
198
|
-
|
|
199
|
-
<div class="features">
|
|
200
|
-
<div class="feature-card">
|
|
201
|
-
<i class="icon">🚀</i>
|
|
202
|
-
<h3>Fast & Reliable</h3>
|
|
203
|
-
<p>Lightning-fast performance with 99.9% uptime</p>
|
|
204
|
-
</div>
|
|
205
|
-
<div class="feature-card">
|
|
206
|
-
<i class="icon">🎨</i>
|
|
207
|
-
<h3>Beautiful UI</h3>
|
|
208
|
-
<p>Modern and intuitive user interface</p>
|
|
209
|
-
</div>
|
|
210
|
-
<div class="feature-card">
|
|
211
|
-
<i class="icon">⚡</i>
|
|
212
|
-
<h3>Powerful Features</h3>
|
|
213
|
-
<p>Everything you need in one place</p>
|
|
214
|
-
</div>
|
|
215
|
-
</div>
|
|
216
|
-
|
|
217
|
-
<button class="cta-button get-started-button">
|
|
218
|
-
Get Started
|
|
219
|
-
<span class="button-icon">→</span>
|
|
220
|
-
</button>
|
|
221
|
-
</div>
|
|
222
|
-
</div>
|
|
223
|
-
`;
|
|
224
|
-
},
|
|
225
|
+
htmlMainBody: options.htmlMainBody,
|
|
225
226
|
});
|
|
226
227
|
|
|
227
228
|
ThemeEvents['main-theme-handler'] = () => {
|
|
@@ -626,6 +627,7 @@ const MenuDefault = {
|
|
|
626
627
|
RouterInstance,
|
|
627
628
|
heightTopBar,
|
|
628
629
|
heightBottomBar,
|
|
630
|
+
observer: true,
|
|
629
631
|
});
|
|
630
632
|
});
|
|
631
633
|
|
|
@@ -672,6 +674,68 @@ const MenuDefault = {
|
|
|
672
674
|
observer: true,
|
|
673
675
|
});
|
|
674
676
|
});
|
|
677
|
+
|
|
678
|
+
EventsUI.onClick(`.main-btn-blog`, async () => {
|
|
679
|
+
const { barConfig } = await Themes[Css.currentTheme]();
|
|
680
|
+
const idModal = 'modal-blog';
|
|
681
|
+
const routeModal = 'blog';
|
|
682
|
+
const idEvent = `form-panel-${idModal}`;
|
|
683
|
+
await Modal.Render({
|
|
684
|
+
id: idModal,
|
|
685
|
+
route: routeModal,
|
|
686
|
+
barConfig,
|
|
687
|
+
title: renderViewTitle({
|
|
688
|
+
icon: html`<i class="fa-solid fa-file-invoice"></i>`,
|
|
689
|
+
text: Translate.Render('blog'),
|
|
690
|
+
}),
|
|
691
|
+
observer: true,
|
|
692
|
+
html: async () => {
|
|
693
|
+
setTimeout(async () => {
|
|
694
|
+
await PanelForm.instance({
|
|
695
|
+
idPanel: 'default-blog',
|
|
696
|
+
heightTopBar,
|
|
697
|
+
heightBottomBar,
|
|
698
|
+
defaultUrlImage: `${getProxyPath()}android-chrome-96x96.png`,
|
|
699
|
+
Elements: ElementsDefault,
|
|
700
|
+
parentIdModal: idModal,
|
|
701
|
+
scrollClassContainer: `html-${idModal}`,
|
|
702
|
+
route: routeModal,
|
|
703
|
+
});
|
|
704
|
+
});
|
|
705
|
+
},
|
|
706
|
+
handleType: 'bar',
|
|
707
|
+
maximize: true,
|
|
708
|
+
mode: 'view',
|
|
709
|
+
slideMenu: 'modal-menu',
|
|
710
|
+
RouterInstance,
|
|
711
|
+
heightTopBar,
|
|
712
|
+
heightBottomBar,
|
|
713
|
+
barMode,
|
|
714
|
+
});
|
|
715
|
+
});
|
|
716
|
+
|
|
717
|
+
EventsUI.onClick(`.main-btn-chat`, async () => {
|
|
718
|
+
const { barConfig } = await Themes[Css.currentTheme]();
|
|
719
|
+
await Modal.Render({
|
|
720
|
+
id: 'modal-chat',
|
|
721
|
+
route: 'chat',
|
|
722
|
+
barConfig,
|
|
723
|
+
title: renderViewTitle({
|
|
724
|
+
icon: html` <i class="far fa-comments"></i>`,
|
|
725
|
+
text: Translate.Render('chat'),
|
|
726
|
+
}),
|
|
727
|
+
html: async () => await Chat.Render({ idModal: 'modal-chat' }),
|
|
728
|
+
handleType: 'bar',
|
|
729
|
+
maximize: true,
|
|
730
|
+
observer: true,
|
|
731
|
+
mode: 'view',
|
|
732
|
+
slideMenu: 'modal-menu',
|
|
733
|
+
RouterInstance,
|
|
734
|
+
heightTopBar,
|
|
735
|
+
heightBottomBar,
|
|
736
|
+
barMode,
|
|
737
|
+
});
|
|
738
|
+
});
|
|
675
739
|
},
|
|
676
740
|
};
|
|
677
741
|
|
|
@@ -27,6 +27,8 @@ const RoutesDefault = () => {
|
|
|
27
27
|
render: () => s(`.main-btn-account`).click(),
|
|
28
28
|
},
|
|
29
29
|
'/docs': { title: 'docs', render: () => s(`.main-btn-docs`).click() },
|
|
30
|
+
'/chat': { title: 'docs', render: () => s(`.main-btn-chat`).click() },
|
|
31
|
+
'/blog': { title: 'docs', render: () => s(`.main-btn-blog`).click() },
|
|
30
32
|
'/recover': { title: 'recover', render: () => s(`.main-btn-recover`).click() },
|
|
31
33
|
'/default-management': {
|
|
32
34
|
title: 'default-management',
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { Auth } from '../../components/core/Auth.js';
|
|
2
|
+
import { loggerFactory } from '../../components/core/Logger.js';
|
|
3
|
+
import { getApiBaseUrl, headersFactory, payloadFactory } from '../core/core.service.js';
|
|
4
|
+
|
|
5
|
+
const logger = loggerFactory(import.meta);
|
|
6
|
+
|
|
7
|
+
logger.info('Load service');
|
|
8
|
+
|
|
9
|
+
const endpoint = 'document';
|
|
10
|
+
|
|
11
|
+
const DocumentService = {
|
|
12
|
+
post: (options = { id: '', body: {} }) =>
|
|
13
|
+
new Promise((resolve, reject) =>
|
|
14
|
+
fetch(getApiBaseUrl({ id: options.id, endpoint }), {
|
|
15
|
+
method: 'POST',
|
|
16
|
+
headers: headersFactory(),
|
|
17
|
+
credentials: 'include',
|
|
18
|
+
body: payloadFactory(options.body),
|
|
19
|
+
})
|
|
20
|
+
.then(async (res) => {
|
|
21
|
+
return await res.json();
|
|
22
|
+
})
|
|
23
|
+
.then((res) => {
|
|
24
|
+
logger.info(res);
|
|
25
|
+
return resolve(res);
|
|
26
|
+
})
|
|
27
|
+
.catch((error) => {
|
|
28
|
+
logger.error(error);
|
|
29
|
+
return reject(error);
|
|
30
|
+
}),
|
|
31
|
+
),
|
|
32
|
+
get: (options = { id: '' }) =>
|
|
33
|
+
new Promise((resolve, reject) => {
|
|
34
|
+
const url = new URL(getApiBaseUrl({ id: options.id, endpoint }));
|
|
35
|
+
if (options.params) {
|
|
36
|
+
Object.keys(options.params).forEach((key) => url.searchParams.append(key, options.params[key]));
|
|
37
|
+
}
|
|
38
|
+
fetch(url, {
|
|
39
|
+
method: 'GET',
|
|
40
|
+
headers: headersFactory(),
|
|
41
|
+
credentials: 'include',
|
|
42
|
+
})
|
|
43
|
+
.then(async (res) => {
|
|
44
|
+
return await res.json();
|
|
45
|
+
})
|
|
46
|
+
.then((res) => {
|
|
47
|
+
logger.info(res);
|
|
48
|
+
return resolve(res);
|
|
49
|
+
})
|
|
50
|
+
.catch((error) => {
|
|
51
|
+
logger.error(error);
|
|
52
|
+
return reject(error);
|
|
53
|
+
});
|
|
54
|
+
}),
|
|
55
|
+
delete: (options = { id: '', body: {} }) =>
|
|
56
|
+
new Promise((resolve, reject) =>
|
|
57
|
+
fetch(getApiBaseUrl({ id: options.id, endpoint }), {
|
|
58
|
+
method: 'DELETE',
|
|
59
|
+
headers: headersFactory(),
|
|
60
|
+
credentials: 'include',
|
|
61
|
+
body: payloadFactory(options.body),
|
|
62
|
+
})
|
|
63
|
+
.then(async (res) => {
|
|
64
|
+
return await res.json();
|
|
65
|
+
})
|
|
66
|
+
.then((res) => {
|
|
67
|
+
logger.info(res);
|
|
68
|
+
return resolve(res);
|
|
69
|
+
})
|
|
70
|
+
.catch((error) => {
|
|
71
|
+
logger.error(error);
|
|
72
|
+
return reject(error);
|
|
73
|
+
}),
|
|
74
|
+
),
|
|
75
|
+
put: (options = { id: '', body: {} }) =>
|
|
76
|
+
new Promise((resolve, reject) =>
|
|
77
|
+
fetch(getApiBaseUrl({ id: options.id, endpoint }), {
|
|
78
|
+
method: 'PUT',
|
|
79
|
+
headers: headersFactory(),
|
|
80
|
+
credentials: 'include',
|
|
81
|
+
body: payloadFactory(options.body),
|
|
82
|
+
})
|
|
83
|
+
.then(async (res) => {
|
|
84
|
+
return await res.json();
|
|
85
|
+
})
|
|
86
|
+
.then((res) => {
|
|
87
|
+
logger.info(res);
|
|
88
|
+
return resolve(res);
|
|
89
|
+
})
|
|
90
|
+
.catch((error) => {
|
|
91
|
+
logger.error(error);
|
|
92
|
+
return reject(error);
|
|
93
|
+
}),
|
|
94
|
+
),
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
export { DocumentService };
|
|
@@ -33,6 +33,7 @@ const FileService = {
|
|
|
33
33
|
fetch(getApiBaseUrl({ id: options.id, endpoint }), {
|
|
34
34
|
method: 'GET',
|
|
35
35
|
headers: headersFactory(),
|
|
36
|
+
credentials: 'include',
|
|
36
37
|
})
|
|
37
38
|
.then(async (res) => {
|
|
38
39
|
return await res.json();
|
|
@@ -51,6 +52,7 @@ const FileService = {
|
|
|
51
52
|
fetch(getApiBaseUrl({ id: options.id, endpoint }), {
|
|
52
53
|
method: 'DELETE',
|
|
53
54
|
headers: headersFactory(),
|
|
55
|
+
credentials: 'include',
|
|
54
56
|
body: payloadFactory(options.body),
|
|
55
57
|
})
|
|
56
58
|
.then(async (res) => {
|
package/src/client/ssr/Render.js
CHANGED
|
@@ -5,7 +5,7 @@ SrrComponent = ({ title, ssrPath, buildId, ssrHeadComponents, ssrBodyComponents,
|
|
|
5
5
|
<title>${title}</title>
|
|
6
6
|
<link rel="icon" type="image/x-icon" href="${ssrPath}favicon.ico" />
|
|
7
7
|
<meta charset="UTF-8" />
|
|
8
|
-
<meta name="viewport" content="
|
|
8
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover" />
|
|
9
9
|
<script>
|
|
10
10
|
window.renderPayload = ${renderApi.JSONweb(renderPayload)};
|
|
11
11
|
</script>
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
SrrComponent = ({ ssrPath }) => html`
|
|
2
2
|
<script type="text/javascript" src="${ssrPath}dist/validator/validator.min.js"></script>
|
|
3
3
|
<script type="text/javascript" src="${ssrPath}dist/ag-grid-community/ag-grid-community.min.js"></script>
|
|
4
|
+
<script type="text/javascript" src="${ssrPath}dist/easymde/easymde.min.js"></script>
|
|
5
|
+
<link rel="stylesheet" href="${ssrPath}dist/easymde/easymde.min.css" />
|
|
4
6
|
`;
|
|
@@ -7,6 +7,7 @@ SrrComponent = ({ title, author, keywords, description, themeColor, ssrPath, can
|
|
|
7
7
|
<meta name="theme-color" content="${themeColor}" />
|
|
8
8
|
|
|
9
9
|
<meta property="og:title" content="${title}" />
|
|
10
|
+
<meta property="og:type" content="website" />
|
|
10
11
|
<meta property="og:description" content="${description}" />
|
|
11
12
|
<meta property="og:image" content="${thumbnail}" />
|
|
12
13
|
<meta property="og:url" content="${canonicalURL}" />
|
package/src/index.js
CHANGED