@underpostnet/underpost 2.8.1 → 2.8.31
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/.dockerignore +1 -0
- package/.github/workflows/ghpkg.yml +4 -4
- package/.vscode/extensions.json +8 -71
- package/CHANGELOG.md +55 -3
- package/Dockerfile +22 -36
- package/README.md +0 -27
- package/bin/deploy.js +57 -17
- package/bin/file.js +30 -2
- package/bin/index.js +2 -13
- package/bin/ssl.js +19 -11
- package/bin/vs.js +3 -2
- package/conf.js +9 -0
- package/docker-compose.yml +1 -1
- package/manifests/mariadb/config.yaml +10 -0
- package/manifests/mariadb/kustomization.yaml +9 -0
- package/manifests/mariadb/pv.yaml +12 -0
- package/manifests/mariadb/pvc.yaml +10 -0
- package/manifests/mariadb/secret.yaml +8 -0
- package/manifests/mariadb/service.yaml +10 -0
- package/manifests/mariadb/statefulset.yaml +55 -0
- package/manifests/test/mongo-express.yaml +60 -0
- package/manifests/test/phpmyadmin.yaml +54 -0
- package/manifests/test/underpost-engine-mongodb-configmap.yaml +26 -0
- package/manifests/test/underpost-engine-pod.yaml +108 -0
- package/manifests/underpost-engine-backup-access.yaml +16 -0
- package/manifests/underpost-engine-backup-pv-pvc.yaml +22 -0
- package/manifests/underpost-engine-headless-service.yaml +10 -0
- package/manifests/underpost-engine-mongodb-backup-cronjob.yaml +40 -0
- package/manifests/underpost-engine-pv-pvc.yaml +23 -0
- package/manifests/underpost-engine-statefulset.yaml +91 -0
- package/manifests/valkey/kustomization.yaml +7 -0
- package/manifests/valkey/underpost-engine-valkey-service.yaml +17 -0
- package/manifests/valkey/underpost-engine-valkey-statefulset.yaml +39 -0
- package/package.json +12 -4
- package/src/api/user/user.model.js +9 -1
- package/src/api/user/user.service.js +1 -1
- package/src/client/components/core/CalendarCore.js +112 -49
- package/src/client/components/core/CommonJs.js +125 -19
- package/src/client/components/core/CssCore.js +6 -0
- package/src/client/components/core/DropDown.js +5 -1
- package/src/client/components/core/Input.js +17 -3
- package/src/client/components/core/Modal.js +5 -0
- package/src/client/components/core/Panel.js +81 -24
- package/src/client/components/core/PanelForm.js +4 -18
- package/src/client/components/core/Translate.js +30 -8
- package/src/db/mongo/MongooseDB.js +13 -1
- package/src/index.js +1 -1
- package/src/server/conf.js +2 -2
- package/src/server/process.js +25 -2
- package/src/server/ssl.js +1 -1
- package/src/server/valkey.js +2 -0
- package/startup.cjs +12 -0
- package/startup.js +0 -11
|
@@ -237,7 +237,7 @@ const UserService = {
|
|
|
237
237
|
const validatePassword = validatePasswordMiddleware(req.body.password);
|
|
238
238
|
if (validatePassword.status === 'error') throw new Error(validatePassword.message);
|
|
239
239
|
req.body.password = await hashPassword(req.body.password);
|
|
240
|
-
req.body.role = 'user';
|
|
240
|
+
req.body.role = req.body.role === 'guest' ? 'guest' : 'user';
|
|
241
241
|
req.body.profileImageId = await getDefaultProfileImageId(File);
|
|
242
242
|
const { _id } = await new User(req.body).save();
|
|
243
243
|
if (_id) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { EventSchedulerService } from '../../services/event-scheduler/event-scheduler.service.js';
|
|
2
2
|
import { Auth } from './Auth.js';
|
|
3
3
|
import { BtnIcon } from './BtnIcon.js';
|
|
4
|
-
import { newInstance, range, s4 } from './CommonJs.js';
|
|
4
|
+
import { isValidDate, newInstance, range, s4 } from './CommonJs.js';
|
|
5
5
|
import { renderCssAttr } from './Css.js';
|
|
6
6
|
import { Modal } from './Modal.js';
|
|
7
7
|
import { NotificationManager } from './NotificationManager.js';
|
|
@@ -13,15 +13,27 @@ import { append, getQueryParams, getTimeZone, htmls, s, sa } from './VanillaJs.j
|
|
|
13
13
|
|
|
14
14
|
// https://fullcalendar.io/docs/event-object
|
|
15
15
|
|
|
16
|
+
const daysOfWeekOptions = ['sunday', 'monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday'];
|
|
17
|
+
|
|
18
|
+
const eventDateFactory = (event) =>
|
|
19
|
+
newInstance({
|
|
20
|
+
event: { ...event.extendedProps, title: event._def.title },
|
|
21
|
+
start: event.start,
|
|
22
|
+
end: event.end,
|
|
23
|
+
});
|
|
24
|
+
|
|
16
25
|
const CalendarCore = {
|
|
17
26
|
RenderStyle: async function () {},
|
|
18
27
|
Data: {},
|
|
19
|
-
Render: async function (
|
|
28
|
+
Render: async function (
|
|
29
|
+
options = { idModal: '', Elements: {}, heightTopBar: 50, heightBottomBar: 50, hiddenDates: [] },
|
|
30
|
+
) {
|
|
20
31
|
this.Data[options.idModal] = {
|
|
21
32
|
data: [],
|
|
22
33
|
originData: [],
|
|
23
34
|
filesData: [],
|
|
24
35
|
calendar: {},
|
|
36
|
+
hiddenDates: options.hiddenDates ? options.hiddenDates : [],
|
|
25
37
|
};
|
|
26
38
|
|
|
27
39
|
const { heightTopBar, heightBottomBar } = options;
|
|
@@ -40,56 +52,87 @@ const CalendarCore = {
|
|
|
40
52
|
};
|
|
41
53
|
getSrrData();
|
|
42
54
|
|
|
43
|
-
const dateFormat = (date) =>
|
|
44
|
-
html`<span
|
|
45
|
-
style="${renderCssAttr({
|
|
46
|
-
style: {
|
|
47
|
-
'font-size': '14px',
|
|
48
|
-
color: '#888',
|
|
49
|
-
},
|
|
50
|
-
})}"
|
|
51
|
-
>${new Date(date).toLocaleString().replaceAll(',', '')}</span
|
|
52
|
-
>`;
|
|
53
|
-
|
|
54
55
|
const getPanelData = async () => {
|
|
55
56
|
const result = await EventSchedulerService.get({
|
|
56
|
-
id: `${getQueryParams().cid ? getQueryParams().cid : 'creatorUser'}`,
|
|
57
|
+
id: `${getQueryParams().cid ? getQueryParams().cid : Auth.getToken() ? 'creatorUser' : ''}`,
|
|
57
58
|
});
|
|
58
59
|
NotificationManager.Push({
|
|
59
60
|
html: result.status === 'success' ? Translate.Render('success-get-events-scheduler') : result.message,
|
|
60
61
|
status: result.status,
|
|
61
62
|
});
|
|
62
63
|
if (result.status === 'success') {
|
|
63
|
-
const resultData = Array.isArray(result.data) ? result.data : [result.data];
|
|
64
|
+
const resultData = Array.isArray(result.data) ? result.data : result.data ? [result.data] : [];
|
|
64
65
|
this.Data[options.idModal].filesData = [];
|
|
65
66
|
this.Data[options.idModal].originData = newInstance(resultData);
|
|
66
67
|
this.Data[options.idModal].data = resultData.map((o) => {
|
|
67
68
|
if (o.creatorUserId && options.Elements.Data.user.main.model.user._id === o.creatorUserId) o.tools = true;
|
|
68
69
|
o.id = o._id;
|
|
69
|
-
|
|
70
|
-
o.end = dateFormat(o.end);
|
|
70
|
+
|
|
71
71
|
this.Data[options.idModal].filesData.push({});
|
|
72
72
|
return o;
|
|
73
73
|
});
|
|
74
|
+
setTimeout(() => {
|
|
75
|
+
renderCalendar(
|
|
76
|
+
resultData.map((o) => {
|
|
77
|
+
// FREQ=WEEKLY;
|
|
78
|
+
// if (o.daysOfWeek && o.daysOfWeek.length > 0) {
|
|
79
|
+
// o.rrule = `RRULE:BYDAY=${o.daysOfWeek.map((d) => `${d[0]}${d[1]}`.toUpperCase()).join(',')}`;
|
|
80
|
+
// }
|
|
81
|
+
// o.rrule = 'FREQ=WEEKLY;BYDAY=SU;BYHOUR=10,11;COUNT=10';
|
|
82
|
+
if (o.daysOfWeek && o.daysOfWeek.length > 0)
|
|
83
|
+
o.daysOfWeek = o.daysOfWeek.map((v, i) => daysOfWeekOptions.indexOf(v));
|
|
84
|
+
else delete o.daysOfWeek;
|
|
85
|
+
// o.exdate = ['2024-04-02'];
|
|
86
|
+
// delete o.end;
|
|
87
|
+
// delete o.start;
|
|
88
|
+
|
|
89
|
+
return o;
|
|
90
|
+
}),
|
|
91
|
+
);
|
|
92
|
+
});
|
|
74
93
|
}
|
|
75
94
|
};
|
|
76
95
|
|
|
77
|
-
const renderCalendar = () => {
|
|
96
|
+
const renderCalendar = (events) => {
|
|
78
97
|
const calendarEl = s(`.calendar-${idPanel}`);
|
|
79
98
|
this.Data[options.idModal].calendar = new FullCalendar.Calendar(calendarEl, {
|
|
80
|
-
plugins: [
|
|
99
|
+
plugins: [
|
|
100
|
+
FullCalendar.DayGrid.default,
|
|
101
|
+
FullCalendar.TimeGrid.default,
|
|
102
|
+
FullCalendar.List.default,
|
|
103
|
+
// https://fullcalendar.io/docs/rrule-plugin
|
|
104
|
+
FullCalendar.RRule.default,
|
|
105
|
+
],
|
|
81
106
|
// initialView: 'dayGridWeek',
|
|
82
107
|
timeZone: getTimeZone(),
|
|
83
108
|
dateClick: function (arg) {
|
|
84
109
|
console.error('calendar dateClick', arg.date.toString());
|
|
85
110
|
},
|
|
86
|
-
events: [{ title: 'Meeting', start: new Date() }],
|
|
111
|
+
events: events ?? [{ title: 'Meeting', start: new Date() }],
|
|
87
112
|
initialView: 'dayGridMonth',
|
|
88
113
|
headerToolbar: {
|
|
89
114
|
left: 'prev,next today',
|
|
90
115
|
center: 'title',
|
|
91
116
|
right: 'dayGridMonth,timeGridWeek,listWeek',
|
|
92
117
|
},
|
|
118
|
+
eventClick: async function (args) {
|
|
119
|
+
const dateData = eventDateFactory(args.event);
|
|
120
|
+
// element -> args.el
|
|
121
|
+
// remove all events associated -> args.event.remove();
|
|
122
|
+
// console.error('eventClick', JSON.stringify(dateData, null, 4));
|
|
123
|
+
if (options.eventClick) await options.eventClick(dateData, args);
|
|
124
|
+
},
|
|
125
|
+
eventClassNames: function (args) {
|
|
126
|
+
// console.error('eventClassNames', JSON.stringify(dateData, null, 4));
|
|
127
|
+
if (!args.event.extendedProps._id) return args.event.remove();
|
|
128
|
+
const dateData = eventDateFactory(args.event);
|
|
129
|
+
if (
|
|
130
|
+
CalendarCore.Data[options.idModal].hiddenDates.find(
|
|
131
|
+
(d) => d.eventSchedulerId === dateData.event._id && d.date === dateData.start,
|
|
132
|
+
)
|
|
133
|
+
)
|
|
134
|
+
return ['hide'];
|
|
135
|
+
},
|
|
93
136
|
});
|
|
94
137
|
|
|
95
138
|
this.Data[options.idModal].calendar.render();
|
|
@@ -139,29 +182,52 @@ const CalendarCore = {
|
|
|
139
182
|
rules: [{ type: 'isEmpty' }],
|
|
140
183
|
},
|
|
141
184
|
{
|
|
142
|
-
id: '
|
|
143
|
-
model: '
|
|
185
|
+
id: 'title',
|
|
186
|
+
model: 'title',
|
|
144
187
|
inputType: 'text',
|
|
145
188
|
rules: [{ type: 'isEmpty' }],
|
|
146
189
|
panel: { type: 'title' },
|
|
147
190
|
},
|
|
148
191
|
{
|
|
149
|
-
id: '
|
|
150
|
-
model: '
|
|
151
|
-
inputType: '
|
|
152
|
-
rules: [],
|
|
153
|
-
panel: { type: 'info-row'
|
|
192
|
+
id: 'description',
|
|
193
|
+
model: 'description',
|
|
194
|
+
inputType: 'text',
|
|
195
|
+
rules: [{ type: 'isEmpty' }],
|
|
196
|
+
panel: { type: 'info-row' },
|
|
154
197
|
},
|
|
155
198
|
{
|
|
156
199
|
id: 'start',
|
|
157
200
|
model: 'start',
|
|
158
201
|
inputType: 'datetime-local',
|
|
159
|
-
|
|
202
|
+
translateCode: 'startTime',
|
|
203
|
+
panel: { type: 'info-row' },
|
|
160
204
|
},
|
|
161
205
|
{
|
|
162
206
|
id: 'end',
|
|
163
207
|
model: 'end',
|
|
164
208
|
inputType: 'datetime-local',
|
|
209
|
+
translateCode: 'endTime',
|
|
210
|
+
panel: { type: 'info-row' },
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
id: 'daysOfWeek',
|
|
214
|
+
model: 'daysOfWeek',
|
|
215
|
+
inputType: 'dropdown-checkbox',
|
|
216
|
+
dropdown: {
|
|
217
|
+
options: daysOfWeekOptions,
|
|
218
|
+
},
|
|
219
|
+
panel: { type: 'list' },
|
|
220
|
+
},
|
|
221
|
+
{
|
|
222
|
+
id: 'startTime',
|
|
223
|
+
model: 'startTime',
|
|
224
|
+
inputType: 'time',
|
|
225
|
+
panel: { type: 'info-row' },
|
|
226
|
+
},
|
|
227
|
+
{
|
|
228
|
+
id: 'endTime',
|
|
229
|
+
model: 'endTime',
|
|
230
|
+
inputType: 'time',
|
|
165
231
|
panel: { type: 'info-row' },
|
|
166
232
|
},
|
|
167
233
|
];
|
|
@@ -215,8 +281,7 @@ const CalendarCore = {
|
|
|
215
281
|
if (options.route) {
|
|
216
282
|
setQueryPath({ path: options.route, queryPath: payload._id });
|
|
217
283
|
if (options.parentIdModal) Modal.Data[options.parentIdModal].query = `${window.location.search}`;
|
|
218
|
-
|
|
219
|
-
await CalendarCore.Data[options.idModal].updatePanel();
|
|
284
|
+
await CalendarCore.Data[options.idModal].updatePanel();
|
|
220
285
|
}
|
|
221
286
|
},
|
|
222
287
|
titleIcon,
|
|
@@ -250,12 +315,19 @@ const CalendarCore = {
|
|
|
250
315
|
],
|
|
251
316
|
on: {
|
|
252
317
|
add: async function ({ data, editId }) {
|
|
318
|
+
if (data.daysOfWeek && data.daysOfWeek.length > 0 && daysOfWeekOptions[data.daysOfWeek[0]]) {
|
|
319
|
+
data.daysOfWeek = data.daysOfWeek.map((d) => daysOfWeekOptions[d]);
|
|
320
|
+
}
|
|
321
|
+
data.timeZoneClient = getTimeZone();
|
|
253
322
|
const {
|
|
254
323
|
status,
|
|
255
324
|
message,
|
|
256
325
|
data: documentData,
|
|
257
326
|
} = editId
|
|
258
|
-
? await EventSchedulerService.put({
|
|
327
|
+
? await EventSchedulerService.put({
|
|
328
|
+
id: editId,
|
|
329
|
+
body: { ...data, _id: undefined },
|
|
330
|
+
})
|
|
259
331
|
: await EventSchedulerService.post({ body: data });
|
|
260
332
|
NotificationManager.Push({
|
|
261
333
|
html:
|
|
@@ -268,10 +340,9 @@ const CalendarCore = {
|
|
|
268
340
|
});
|
|
269
341
|
|
|
270
342
|
if (status === 'success') {
|
|
271
|
-
|
|
272
|
-
data.
|
|
273
|
-
data
|
|
274
|
-
data._id = documentData._id;
|
|
343
|
+
documentData.tools = true;
|
|
344
|
+
// data._id = documentData._id;
|
|
345
|
+
data = documentData;
|
|
275
346
|
|
|
276
347
|
let originObj, indexOriginObj;
|
|
277
348
|
let filesData = {};
|
|
@@ -291,8 +362,7 @@ const CalendarCore = {
|
|
|
291
362
|
|
|
292
363
|
setQueryPath({ path: options.route, queryPath: documentData._id });
|
|
293
364
|
if (options.parentIdModal) Modal.Data[options.parentIdModal].query = `${window.location.search}`;
|
|
294
|
-
|
|
295
|
-
await CalendarCore.Data[options.idModal].updatePanel();
|
|
365
|
+
await CalendarCore.Data[options.idModal].updatePanel();
|
|
296
366
|
}
|
|
297
367
|
return { data, status, message };
|
|
298
368
|
},
|
|
@@ -319,11 +389,8 @@ const CalendarCore = {
|
|
|
319
389
|
status,
|
|
320
390
|
});
|
|
321
391
|
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
if (CalendarCore.Data[options.idModal].updatePanel)
|
|
325
|
-
await CalendarCore.Data[options.idModal].updatePanel();
|
|
326
|
-
}
|
|
392
|
+
setQueryPath({ path: options.route, queryPath: '' });
|
|
393
|
+
await CalendarCore.Data[options.idModal].updatePanel();
|
|
327
394
|
|
|
328
395
|
return { status };
|
|
329
396
|
}
|
|
@@ -334,17 +401,13 @@ const CalendarCore = {
|
|
|
334
401
|
<div class="in" style="margin-bottom: 100px"></div>`;
|
|
335
402
|
};
|
|
336
403
|
|
|
337
|
-
let lastCid;
|
|
338
|
-
let lasUserId;
|
|
339
404
|
this.Data[options.idModal].updatePanel = async () => {
|
|
340
405
|
const cid = getQueryParams().cid ? getQueryParams().cid : '';
|
|
341
|
-
if (lastCid === cid && lasUserId === options.Elements.Data.user.main.model.user._id) return;
|
|
342
406
|
if (options.route === 'home') Modal.homeCid = newInstance(cid);
|
|
343
|
-
lasUserId = newInstance(options.Elements.Data.user.main.model.user._id);
|
|
344
|
-
lastCid = cid;
|
|
345
407
|
if (s(`.main-body-calendar-${options.idModal}`)) {
|
|
346
|
-
if (Auth.getToken())
|
|
347
|
-
else getSrrData();
|
|
408
|
+
// if (Auth.getToken())
|
|
409
|
+
// else getSrrData();
|
|
410
|
+
await getPanelData();
|
|
348
411
|
htmls(`.main-body-calendar-${options.idModal}`, await panelRender());
|
|
349
412
|
}
|
|
350
413
|
};
|
|
@@ -518,25 +518,25 @@ function getDirname(path) {
|
|
|
518
518
|
return parts.join('/'); // Adjust separator if needed for Windows ('\')
|
|
519
519
|
}
|
|
520
520
|
|
|
521
|
-
const isDayValid = (day) => {
|
|
522
|
-
const date = new Date();
|
|
523
|
-
date.setDate(day);
|
|
524
|
-
return date.getDate() === day;
|
|
525
|
-
};
|
|
526
|
-
|
|
527
|
-
const isMonthValid = (month) => {
|
|
528
|
-
const date = new Date();
|
|
529
|
-
date.setMonth(month - 1);
|
|
530
|
-
return date.getMonth() === month - 1;
|
|
531
|
-
};
|
|
532
|
-
|
|
533
521
|
const isValidDate = (day, month, year) => {
|
|
534
|
-
if (!
|
|
535
|
-
|
|
536
|
-
|
|
522
|
+
if (!month && !year) return !(new Date(day) == 'Invalid Date');
|
|
523
|
+
// new Date('2025-12-28')
|
|
524
|
+
// Sat Dec 27 2025 19:00:00 GMT-0500 (Eastern Standard Time)
|
|
525
|
+
// new Date('2025/12/28')
|
|
526
|
+
// Sun Dec 28 2025 00:00:00 GMT-0500 (Eastern Standard Time)
|
|
527
|
+
return !(new Date(`${year}/${month}/${day}`) == 'Invalid Date');
|
|
528
|
+
};
|
|
537
529
|
|
|
538
|
-
|
|
539
|
-
|
|
530
|
+
// console.log(req.body.timeZoneClient, Intl.DateTimeFormat().resolvedOptions().timeZone);
|
|
531
|
+
// DateTime.fromISO("2017-05-15T09:10:23", { zone: "Europe/Paris" });
|
|
532
|
+
const strToDateUTC = (date = '2025-01-30T14:32') => {
|
|
533
|
+
const year = parseInt(date.split('-')[0]);
|
|
534
|
+
const month = parseInt(date.split('-')[1]);
|
|
535
|
+
const day = parseInt(date.split('-')[2].split('T')[0]);
|
|
536
|
+
const hour = parseInt(date.split('T')[1].split(':')[0]);
|
|
537
|
+
const minute = parseInt(date.split('T')[1].split(':')[1]);
|
|
538
|
+
date = new Date(Date.UTC(year, month - 1, day, hour, minute, 0, 0));
|
|
539
|
+
return date;
|
|
540
540
|
};
|
|
541
541
|
|
|
542
542
|
const isValidFormat = (value, format) => {
|
|
@@ -685,6 +685,112 @@ const hexToNumber = (hex = 0xdc) => Number(hex) || parseFloat(hex, 16);
|
|
|
685
685
|
|
|
686
686
|
const numberToHex = (number = 0) => number.toString(16);
|
|
687
687
|
|
|
688
|
+
const generateRandomPasswordSelection = (length) => {
|
|
689
|
+
const _random = (arr) => {
|
|
690
|
+
const rand = Math.floor(Math.random() * arr.length);
|
|
691
|
+
return arr[rand];
|
|
692
|
+
};
|
|
693
|
+
|
|
694
|
+
const uppercase = [
|
|
695
|
+
'A',
|
|
696
|
+
'B',
|
|
697
|
+
'C',
|
|
698
|
+
'D',
|
|
699
|
+
'E',
|
|
700
|
+
'F',
|
|
701
|
+
'G',
|
|
702
|
+
'H',
|
|
703
|
+
'I',
|
|
704
|
+
'J',
|
|
705
|
+
'K',
|
|
706
|
+
'L',
|
|
707
|
+
'M',
|
|
708
|
+
'N',
|
|
709
|
+
'O',
|
|
710
|
+
'P',
|
|
711
|
+
'Q',
|
|
712
|
+
'R',
|
|
713
|
+
'S',
|
|
714
|
+
'T',
|
|
715
|
+
'U',
|
|
716
|
+
'V',
|
|
717
|
+
'W',
|
|
718
|
+
'X',
|
|
719
|
+
'Y',
|
|
720
|
+
'Z',
|
|
721
|
+
];
|
|
722
|
+
const lowercase = [
|
|
723
|
+
'a',
|
|
724
|
+
'b',
|
|
725
|
+
'c',
|
|
726
|
+
'd',
|
|
727
|
+
'e',
|
|
728
|
+
'f',
|
|
729
|
+
'g',
|
|
730
|
+
'h',
|
|
731
|
+
'i',
|
|
732
|
+
'j',
|
|
733
|
+
'k',
|
|
734
|
+
'l',
|
|
735
|
+
'm',
|
|
736
|
+
'n',
|
|
737
|
+
'o',
|
|
738
|
+
'p',
|
|
739
|
+
'q',
|
|
740
|
+
'r',
|
|
741
|
+
's',
|
|
742
|
+
't',
|
|
743
|
+
'u',
|
|
744
|
+
'v',
|
|
745
|
+
'w',
|
|
746
|
+
'x',
|
|
747
|
+
'y',
|
|
748
|
+
'z',
|
|
749
|
+
];
|
|
750
|
+
const special = [
|
|
751
|
+
'~',
|
|
752
|
+
'!',
|
|
753
|
+
'@',
|
|
754
|
+
'#',
|
|
755
|
+
'$',
|
|
756
|
+
'%',
|
|
757
|
+
'^',
|
|
758
|
+
'&',
|
|
759
|
+
'*',
|
|
760
|
+
'(',
|
|
761
|
+
')',
|
|
762
|
+
'_',
|
|
763
|
+
'+',
|
|
764
|
+
'-',
|
|
765
|
+
'=',
|
|
766
|
+
'{',
|
|
767
|
+
'}',
|
|
768
|
+
'[',
|
|
769
|
+
']',
|
|
770
|
+
':',
|
|
771
|
+
';',
|
|
772
|
+
'?',
|
|
773
|
+
',',
|
|
774
|
+
'.',
|
|
775
|
+
'|',
|
|
776
|
+
'\\',
|
|
777
|
+
];
|
|
778
|
+
const numbers = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'];
|
|
779
|
+
|
|
780
|
+
const nonSpecial = [...uppercase, ...lowercase, ...numbers];
|
|
781
|
+
|
|
782
|
+
let password = '';
|
|
783
|
+
|
|
784
|
+
for (let i = 0; i < length; i++) {
|
|
785
|
+
// Previous character is a special character
|
|
786
|
+
if (i !== 0 && special.includes(password[i - 1])) {
|
|
787
|
+
password += _random(nonSpecial);
|
|
788
|
+
} else password += _random([...nonSpecial, ...special]);
|
|
789
|
+
}
|
|
790
|
+
|
|
791
|
+
return password;
|
|
792
|
+
};
|
|
793
|
+
|
|
688
794
|
// 0x = Hexadecimal
|
|
689
795
|
// 0b = Binary
|
|
690
796
|
// 0o = Octal
|
|
@@ -727,10 +833,9 @@ export {
|
|
|
727
833
|
getSubpaths,
|
|
728
834
|
formatBytes,
|
|
729
835
|
getDirname,
|
|
730
|
-
isDayValid,
|
|
731
|
-
isMonthValid,
|
|
732
836
|
isValidDate,
|
|
733
837
|
isValidFormat,
|
|
838
|
+
strToDateUTC,
|
|
734
839
|
getTimezoneOffset,
|
|
735
840
|
cleanString,
|
|
736
841
|
splitEveryXChar,
|
|
@@ -742,4 +847,5 @@ export {
|
|
|
742
847
|
getCapVariableName,
|
|
743
848
|
hexToNumber,
|
|
744
849
|
numberToHex,
|
|
850
|
+
generateRandomPasswordSelection,
|
|
745
851
|
};
|
|
@@ -117,6 +117,12 @@ const CssCommonCore = async () => {
|
|
|
117
117
|
animation: ripple 600ms linear;
|
|
118
118
|
background-color: rgba(137, 137, 137, 0.503);
|
|
119
119
|
}
|
|
120
|
+
.slide-menu-top-bar-fix {
|
|
121
|
+
top: 0;
|
|
122
|
+
left: 0;
|
|
123
|
+
width: 100%;
|
|
124
|
+
z-index: 1;
|
|
125
|
+
}
|
|
120
126
|
@keyframes ripple {
|
|
121
127
|
to {
|
|
122
128
|
transform: scale(4);
|
|
@@ -16,7 +16,11 @@ const DropDown = {
|
|
|
16
16
|
onClick: () => {
|
|
17
17
|
console.log('DropDown onClick', this.value);
|
|
18
18
|
if (options && options.resetOnClick) options.resetOnClick();
|
|
19
|
-
|
|
19
|
+
if (options && options.type === 'checkbox')
|
|
20
|
+
for (const opt of DropDown.Tokens[id].value) {
|
|
21
|
+
s(`.dropdown-option-${id}-${opt}`).click();
|
|
22
|
+
}
|
|
23
|
+
else this.Tokens[id].value = undefined;
|
|
20
24
|
},
|
|
21
25
|
});
|
|
22
26
|
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { AgGrid } from './AgGrid.js';
|
|
2
2
|
import { BtnIcon } from './BtnIcon.js';
|
|
3
|
+
import { isValidDate } from './CommonJs.js';
|
|
3
4
|
import { darkTheme } from './Css.js';
|
|
5
|
+
import { DropDown } from './DropDown.js';
|
|
4
6
|
import { loggerFactory } from './Logger.js';
|
|
5
7
|
import { RichText } from './RichText.js';
|
|
6
8
|
import { ToggleSwitch } from './ToggleSwitch.js';
|
|
@@ -147,6 +149,10 @@ const Input = {
|
|
|
147
149
|
htmls(`.file-name-render-${inputData.id}`, `${s(`.${inputData.id}`).fileNameInputExtDefaultContent}`);
|
|
148
150
|
continue;
|
|
149
151
|
break;
|
|
152
|
+
case 'dropdown-checkbox': {
|
|
153
|
+
s(`.dropdown-option-${inputData.id}-reset`).click();
|
|
154
|
+
break;
|
|
155
|
+
}
|
|
150
156
|
case 'md':
|
|
151
157
|
RichText.Tokens[inputData.id].easyMDE.value('');
|
|
152
158
|
continue;
|
|
@@ -196,6 +202,12 @@ const Input = {
|
|
|
196
202
|
RichText.Tokens[inputData.id].easyMDE.value(fileObj[inputData.model].mdPlain);
|
|
197
203
|
continue;
|
|
198
204
|
break;
|
|
205
|
+
|
|
206
|
+
case 'dropdown-checkbox': {
|
|
207
|
+
s(`.dropdown-option-${inputData.id}-reset`).click();
|
|
208
|
+
for (const opt of originObj[inputData.model]) s(`.dropdown-option-${inputData.id}-${opt}`).click();
|
|
209
|
+
break;
|
|
210
|
+
}
|
|
199
211
|
case 'checkbox':
|
|
200
212
|
case 'checkbox-on-off':
|
|
201
213
|
if (
|
|
@@ -207,9 +219,11 @@ const Input = {
|
|
|
207
219
|
break;
|
|
208
220
|
case 'datetime-local':
|
|
209
221
|
{
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
222
|
+
if (isValidDate(originObj[inputData.model])) {
|
|
223
|
+
const date = new Date(originObj[inputData.model]);
|
|
224
|
+
// date.setMinutes(date.getMinutes() - date.getTimezoneOffset());
|
|
225
|
+
s(`.${inputData.id}`).value = date.toISOString().slice(0, 16);
|
|
226
|
+
} else s(`.${inputData.id}`).value = null;
|
|
213
227
|
}
|
|
214
228
|
continue;
|
|
215
229
|
break;
|
|
@@ -403,6 +403,11 @@ const Modal = {
|
|
|
403
403
|
})}
|
|
404
404
|
</div>
|
|
405
405
|
</div>
|
|
406
|
+
${options?.slideMenuTopBarFix
|
|
407
|
+
? html`<div class="abs modal slide-menu-top-bar-fix" style="height: ${options.heightTopBar}px">
|
|
408
|
+
${await options.slideMenuTopBarFix()}
|
|
409
|
+
</div>`
|
|
410
|
+
: ''}
|
|
406
411
|
</div>`,
|
|
407
412
|
);
|
|
408
413
|
EventsUI.onClick(`.action-btn-profile-log-in`, () => {
|