isite 2021.12.16 → 2022.1.13
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 +5 -4
- package/apps/client-side/app.js +9 -6
- package/apps/client-side/site_files/css/dropdown.css +6 -4
- package/apps/client-side/site_files/css/form.css +2 -3
- package/apps/client-side/site_files/css/print.css +5 -48
- package/apps/client-side/site_files/css/theme.css +147 -146
- package/apps/client-side/site_files/css/theme_dark.css +2 -0
- package/apps/client-side/site_files/css/theme_paper.css +5 -3
- package/index.js +277 -294
- package/lib/collection.js +14 -18
- package/lib/collectionFile.js +16 -0
- package/lib/dashboard.js +28 -28
- package/lib/fsm.js +15 -1
- package/lib/parser.js +22 -11
- package/lib/routing.js +5 -1
- package/lib/security.js +1081 -1045
- package/lib/session.js +13 -78
- package/lib/sessions.js +22 -37
- package/package.json +3 -2
package/lib/collection.js
CHANGED
|
@@ -1,14 +1,25 @@
|
|
|
1
1
|
module.exports = function init(____0, option, db) {
|
|
2
|
-
const $collection =
|
|
2
|
+
const $collection = {};
|
|
3
3
|
|
|
4
4
|
____0.on(____0.strings[4], (_) => {
|
|
5
5
|
$collection.busy = !_;
|
|
6
6
|
});
|
|
7
7
|
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
if (typeof option === 'string') {
|
|
11
|
+
option = {
|
|
12
|
+
collection : option
|
|
13
|
+
}
|
|
14
|
+
$collection.collection = option;
|
|
15
|
+
$collection.db = db || ____0.options.mongodb.db;
|
|
16
|
+
}
|
|
8
17
|
$collection.options = { ...____0.options.mongodb, ...option };
|
|
9
18
|
|
|
10
|
-
$collection.
|
|
11
|
-
$collection.
|
|
19
|
+
$collection.db = $collection.options.db.trim().replace(' ', '');
|
|
20
|
+
$collection.collection = $collection.options.collection.trim().replace(' ', '');
|
|
21
|
+
$collection.docs = [];
|
|
22
|
+
|
|
12
23
|
$collection.busy = !1;
|
|
13
24
|
$collection.insertBusy = !1;
|
|
14
25
|
$collection.updateBusy = !1;
|
|
@@ -521,21 +532,6 @@ module.exports = function init(____0, option, db) {
|
|
|
521
532
|
}
|
|
522
533
|
};
|
|
523
534
|
|
|
524
|
-
$collection.docs = [];
|
|
525
|
-
|
|
526
|
-
if (typeof option === 'string') {
|
|
527
|
-
$collection.collection = option;
|
|
528
|
-
$collection.db = db || ____0.options.mongodb.db;
|
|
529
|
-
} else if (typeof option === 'object') {
|
|
530
|
-
$collection.collection = option.collection || ____0.options.mongodb.collection;
|
|
531
|
-
$collection.db = option.db || ____0.options.mongodb.db;
|
|
532
|
-
} else {
|
|
533
|
-
$collection.collection = ____0.options.mongodb.collection;
|
|
534
|
-
$collection.db = ____0.options.mongodb.db;
|
|
535
|
-
}
|
|
536
|
-
|
|
537
|
-
$collection.db = $collection.db.trim().replace(' ', '');
|
|
538
|
-
$collection.collection = $collection.collection.trim().replace(' ', '');
|
|
539
535
|
|
|
540
536
|
$collection.ObjectID = function (_id) {
|
|
541
537
|
return new ____0.mongodb.ObjectID(_id);
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
module.exports = function init(____0, option, db) {
|
|
2
|
+
const $collection = {
|
|
3
|
+
busy: !0,
|
|
4
|
+
deleteDuplicate: function () {},
|
|
5
|
+
createUnique: function () {},
|
|
6
|
+
findOne: function () {},
|
|
7
|
+
findAll: function () {},
|
|
8
|
+
get: function () {},
|
|
9
|
+
getAll: function () {},
|
|
10
|
+
find: function () {},
|
|
11
|
+
add: function () {},
|
|
12
|
+
update: function () {},
|
|
13
|
+
delete: function () {},
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
}
|
package/lib/dashboard.js
CHANGED
|
@@ -2,63 +2,63 @@ module.exports = function init(____0) {
|
|
|
2
2
|
let dir = __dirname + '/../isite_files';
|
|
3
3
|
|
|
4
4
|
____0.get({
|
|
5
|
-
name: '/x-admin',
|
|
5
|
+
name: '/x-dashboard-admin',
|
|
6
6
|
path: dir + '/html/index.html',
|
|
7
7
|
parser: 'html',
|
|
8
8
|
parserDir: dir,
|
|
9
9
|
hide: !0,
|
|
10
10
|
});
|
|
11
11
|
____0.get({
|
|
12
|
-
name: '/x-images',
|
|
12
|
+
name: '/x-dashboard-images',
|
|
13
13
|
path: dir + '/images',
|
|
14
14
|
hide: !0,
|
|
15
15
|
});
|
|
16
16
|
____0.get({
|
|
17
|
-
name: '/x-fonts',
|
|
17
|
+
name: '/x-dashboard-fonts',
|
|
18
18
|
path: dir + '/fonts',
|
|
19
19
|
hide: !0,
|
|
20
20
|
});
|
|
21
21
|
____0.get({
|
|
22
|
-
name: '/x-js',
|
|
22
|
+
name: '/x-dashboard-js',
|
|
23
23
|
path: dir + '/js',
|
|
24
24
|
hide: !0,
|
|
25
25
|
});
|
|
26
26
|
____0.get({
|
|
27
|
-
name: '/x-css',
|
|
27
|
+
name: '/x-dashboard-css',
|
|
28
28
|
path: dir + '/css',
|
|
29
29
|
compress: !0,
|
|
30
30
|
hide: !0,
|
|
31
31
|
});
|
|
32
32
|
____0.get({
|
|
33
|
-
name: '/x-css/bootstrap3.css',
|
|
33
|
+
name: '/x-dashboard-css/bootstrap3.css',
|
|
34
34
|
path: [dir + '/css/bootstrap.css', dir + '/css/navbar.css'],
|
|
35
35
|
compress: !0,
|
|
36
36
|
hide: !0,
|
|
37
37
|
});
|
|
38
38
|
____0.get({
|
|
39
|
-
name: '/x-js/bootstrap3.js',
|
|
39
|
+
name: '/x-dashboard-js/bootstrap3.js',
|
|
40
40
|
path: dir + '/js/bootstrap.js',
|
|
41
41
|
hide: !0,
|
|
42
42
|
});
|
|
43
43
|
|
|
44
44
|
____0.get({
|
|
45
|
-
name: '/x-js/script.js',
|
|
45
|
+
name: '/x-dashboard-js/script.js',
|
|
46
46
|
hide: !0,
|
|
47
47
|
compress: !0,
|
|
48
48
|
path: [dir + '/js/jquery.js', dir + '/js/bootstrap.js', dir + '/js/angular.js', dir + '/js/prism.js', dir + '/js/client.js'],
|
|
49
49
|
});
|
|
50
50
|
____0.get({
|
|
51
|
-
name: '/x-css/style.css',
|
|
51
|
+
name: '/x-dashboard-css/style.css',
|
|
52
52
|
hide: !0,
|
|
53
53
|
compress: !0,
|
|
54
54
|
path: [dir + '/css/bootstrap.css', dir + '/css/font-awesome.css', dir + '/css/navbar.css', dir + '/css/custom.css', dir + '/css/prism.css'],
|
|
55
55
|
});
|
|
56
56
|
|
|
57
57
|
____0.all({
|
|
58
|
-
name: '/x-admin/api/vars',
|
|
58
|
+
name: '/x-dashboard-admin/api/vars',
|
|
59
59
|
hide: !0,
|
|
60
60
|
callback: function (req, res) {
|
|
61
|
-
res.setHeader('x-content', 'from x-server');
|
|
61
|
+
res.setHeader('x-dashboard-content', 'from x-dashboard-server');
|
|
62
62
|
res.setHeader('Content-Type', 'application/json');
|
|
63
63
|
res.writeHeader(200);
|
|
64
64
|
res.end(JSON.stringify(____0.vars));
|
|
@@ -66,10 +66,10 @@ module.exports = function init(____0) {
|
|
|
66
66
|
});
|
|
67
67
|
|
|
68
68
|
____0.all({
|
|
69
|
-
name: '/x-admin/api/routes',
|
|
69
|
+
name: '/x-dashboard-admin/api/routes',
|
|
70
70
|
hide: !0,
|
|
71
71
|
callback: function (req, res) {
|
|
72
|
-
res.setHeader('x-content', 'from x-server');
|
|
72
|
+
res.setHeader('x-dashboard-content', 'from x-dashboard-server');
|
|
73
73
|
res.setHeader('Content-Type', 'application/json');
|
|
74
74
|
res.writeHeader(200);
|
|
75
75
|
var arr = [];
|
|
@@ -89,7 +89,7 @@ module.exports = function init(____0) {
|
|
|
89
89
|
});
|
|
90
90
|
|
|
91
91
|
____0.all({
|
|
92
|
-
name: '/x-admin/api/session',
|
|
92
|
+
name: '/x-dashboard-admin/api/session',
|
|
93
93
|
hide: !0,
|
|
94
94
|
callback: function (req, res) {
|
|
95
95
|
res.htmlContent(____0.toHtmlTable(req.session));
|
|
@@ -97,10 +97,10 @@ module.exports = function init(____0) {
|
|
|
97
97
|
});
|
|
98
98
|
|
|
99
99
|
____0.all({
|
|
100
|
-
name: '/x-admin/api/sessions',
|
|
100
|
+
name: '/x-dashboard-admin/api/sessions',
|
|
101
101
|
hide: !0,
|
|
102
102
|
callback: function (req, res) {
|
|
103
|
-
res.setHeader('x-content', 'from x-server');
|
|
103
|
+
res.setHeader('x-dashboard-content', 'from x-dashboard-server');
|
|
104
104
|
res.setHeader('Content-Type', 'application/json');
|
|
105
105
|
res.writeHeader(200);
|
|
106
106
|
var arr = [];
|
|
@@ -120,10 +120,10 @@ module.exports = function init(____0) {
|
|
|
120
120
|
});
|
|
121
121
|
|
|
122
122
|
____0.all({
|
|
123
|
-
name: '/x-admin/api/cookie',
|
|
123
|
+
name: '/x-dashboard-admin/api/cookie',
|
|
124
124
|
hide: !0,
|
|
125
125
|
callback: function (req, res) {
|
|
126
|
-
res.setHeader('x-content', 'from x-server');
|
|
126
|
+
res.setHeader('x-dashboard-content', 'from x-dashboard-server');
|
|
127
127
|
res.setHeader('Content-Type', 'application/json');
|
|
128
128
|
res.writeHeader(200);
|
|
129
129
|
res.end(JSON.stringify(req.cookie));
|
|
@@ -131,30 +131,30 @@ module.exports = function init(____0) {
|
|
|
131
131
|
});
|
|
132
132
|
|
|
133
133
|
____0.all({
|
|
134
|
-
name: '/x-admin/api/users',
|
|
134
|
+
name: '/x-dashboard-admin/api/users',
|
|
135
135
|
hide: !0,
|
|
136
136
|
callback: function (req, res) {
|
|
137
|
-
res.set('x-content', 'from x-server');
|
|
137
|
+
res.set('x-dashboard-content', 'from x-dashboard-server');
|
|
138
138
|
res.set('Content-Type', 'application/json');
|
|
139
139
|
res.json(____0.security.users);
|
|
140
140
|
},
|
|
141
141
|
});
|
|
142
142
|
|
|
143
143
|
____0.all({
|
|
144
|
-
name: '/x-admin/api/user',
|
|
144
|
+
name: '/x-dashboard-admin/api/user',
|
|
145
145
|
hide: !0,
|
|
146
146
|
callback: function (req, res) {
|
|
147
|
-
res.set('x-content', 'from x-server');
|
|
147
|
+
res.set('x-dashboard-content', 'from x-dashboard-server');
|
|
148
148
|
res.set('Content-Type', 'application/json');
|
|
149
149
|
res.json(req.session.user);
|
|
150
150
|
},
|
|
151
151
|
});
|
|
152
152
|
|
|
153
153
|
____0.all({
|
|
154
|
-
name: '/x-admin/api/files',
|
|
154
|
+
name: '/x-dashboard-admin/api/files',
|
|
155
155
|
hide: !0,
|
|
156
156
|
callback: function (req, res) {
|
|
157
|
-
res.setHeader('x-content', 'from x-server');
|
|
157
|
+
res.setHeader('x-dashboard-content', 'from x-dashboard-server');
|
|
158
158
|
res.setHeader('Content-Type', 'application/json');
|
|
159
159
|
res.writeHeader(200);
|
|
160
160
|
var arr = [];
|
|
@@ -170,20 +170,20 @@ module.exports = function init(____0) {
|
|
|
170
170
|
});
|
|
171
171
|
|
|
172
172
|
____0.all({
|
|
173
|
-
name: '/x-admin/api*',
|
|
173
|
+
name: '/x-dashboard-admin/api*',
|
|
174
174
|
hide: !0,
|
|
175
175
|
callback: function (req, res) {
|
|
176
|
-
res.setHeader('x-content', 'from x-server');
|
|
176
|
+
res.setHeader('x-dashboard-content', 'from x-dashboard-server');
|
|
177
177
|
res.setHeader('Content-Type', 'application/json');
|
|
178
178
|
res.writeHeader(200);
|
|
179
179
|
res.end(JSON.stringify('USING BY BUILTIN ROUTING !! '));
|
|
180
180
|
},
|
|
181
181
|
});
|
|
182
182
|
|
|
183
|
-
____0.post('/x-Language/Change', function (req, res) {
|
|
183
|
+
____0.post('/x-dashboard-Language/Change', function (req, res) {
|
|
184
184
|
let name = req.body.name || 'ar';
|
|
185
185
|
req.session.lang = name;
|
|
186
|
-
req.session
|
|
186
|
+
____0.saveSession(req.session);
|
|
187
187
|
res.ending(0, JSON.stringify({ done: !0 }));
|
|
188
188
|
});
|
|
189
189
|
};
|
package/lib/fsm.js
CHANGED
|
@@ -185,13 +185,27 @@ module.exports = function init(____0) {
|
|
|
185
185
|
}
|
|
186
186
|
|
|
187
187
|
if (!____0.isFileExistsSync(path)) {
|
|
188
|
-
|
|
188
|
+
// ____0.log(name, 'PATH NOT EXISTS fsm.getFilePath()');
|
|
189
189
|
return null;
|
|
190
190
|
}
|
|
191
191
|
|
|
192
192
|
return path;
|
|
193
193
|
};
|
|
194
194
|
|
|
195
|
+
fsm.off = function (path) {
|
|
196
|
+
if (path && typeof path == 'string') {
|
|
197
|
+
for (let i = fsm.list.length; i--; ) {
|
|
198
|
+
if (fsm.list[i] && fsm.list[i].path.like(path)) {
|
|
199
|
+
fsm.list.splice(i, 1);
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
} else if (path && Array.isArray(path)) {
|
|
203
|
+
path.forEach((p) => {
|
|
204
|
+
fsm.off(p);
|
|
205
|
+
});
|
|
206
|
+
}
|
|
207
|
+
};
|
|
208
|
+
|
|
195
209
|
fsm.readFileSync = function (path, callback) {
|
|
196
210
|
callback =
|
|
197
211
|
callback ||
|
package/lib/parser.js
CHANGED
|
@@ -224,7 +224,18 @@ module.exports = function init(req, res, ____0, route) {
|
|
|
224
224
|
} else if (v == 'theme') {
|
|
225
225
|
return req.session.theme;
|
|
226
226
|
} else {
|
|
227
|
-
|
|
227
|
+
v = v.split('.');
|
|
228
|
+
if (v.length === 1) {
|
|
229
|
+
return req.session[v[0]];
|
|
230
|
+
}
|
|
231
|
+
if (v.length === 2) {
|
|
232
|
+
let s1 = req.session[v[0]];
|
|
233
|
+
if (s1) {
|
|
234
|
+
return s1[v[1]];
|
|
235
|
+
} else {
|
|
236
|
+
return '';
|
|
237
|
+
}
|
|
238
|
+
}
|
|
228
239
|
}
|
|
229
240
|
}
|
|
230
241
|
|
|
@@ -437,10 +448,10 @@ module.exports = function init(req, res, ____0, route) {
|
|
|
437
448
|
$($('[x-import]').get().reverse()).each(function (i, elem) {
|
|
438
449
|
let file = $(this).attr('x-import');
|
|
439
450
|
$(this).removeAttr('x-import');
|
|
440
|
-
$(this).attr('x-server'
|
|
451
|
+
$(this).attr('x-server', 'x-import');
|
|
441
452
|
if (file.endsWith('.html')) {
|
|
442
453
|
$(this).html(getContent(file) + $(this).html());
|
|
443
|
-
}else if (file.endsWith('.css')) {
|
|
454
|
+
} else if (file.endsWith('.css')) {
|
|
444
455
|
$(this).text(getContent(file) + $(this).html());
|
|
445
456
|
} else {
|
|
446
457
|
$(this).text(getContent(file) + $(this).text());
|
|
@@ -450,10 +461,10 @@ module.exports = function init(req, res, ____0, route) {
|
|
|
450
461
|
$($('[x-append]').get().reverse()).each(function (i, elem) {
|
|
451
462
|
let file = $(this).attr('x-append');
|
|
452
463
|
$(this).removeAttr('x-append');
|
|
453
|
-
$(this).attr('x-server'
|
|
464
|
+
$(this).attr('x-server', 'x-append');
|
|
454
465
|
if (file.endsWith('.html')) {
|
|
455
466
|
$(this).html($(this).html() + getContent(file));
|
|
456
|
-
}else if (file.endsWith('.css')) {
|
|
467
|
+
} else if (file.endsWith('.css')) {
|
|
457
468
|
$(this).text($(this).html() + getContent(file));
|
|
458
469
|
} else {
|
|
459
470
|
$(this).text($(this).text() + getContent(file));
|
|
@@ -463,10 +474,10 @@ module.exports = function init(req, res, ____0, route) {
|
|
|
463
474
|
$($('[x-replace]').get().reverse()).each(function (i, elem) {
|
|
464
475
|
let file = $(this).attr('x-replace');
|
|
465
476
|
$(this).removeAttr('x-replace');
|
|
466
|
-
$(this).attr('x-server'
|
|
477
|
+
$(this).attr('x-server', 'x-replace');
|
|
467
478
|
if (file.endsWith('.html')) {
|
|
468
479
|
$(this).html(getContent(file));
|
|
469
|
-
}else {
|
|
480
|
+
} else {
|
|
470
481
|
$(this).text(getContent(file));
|
|
471
482
|
}
|
|
472
483
|
});
|
|
@@ -543,22 +554,22 @@ module.exports = function init(req, res, ____0, route) {
|
|
|
543
554
|
parser.css = function (content) {
|
|
544
555
|
content = parser.handleMatches(content);
|
|
545
556
|
|
|
546
|
-
let matches = content.match(/var\(
|
|
557
|
+
let matches = content.match(/var\(---.*?\)/g);
|
|
547
558
|
if (matches) {
|
|
548
559
|
for (let i = 0; i < matches.length; i++) {
|
|
549
560
|
let v = matches[i];
|
|
550
561
|
|
|
551
|
-
v = v.replace('var(
|
|
562
|
+
v = v.replace('var(---', '').replace(')', '');
|
|
552
563
|
content = content.replace(matches[i], renderVar(v));
|
|
553
564
|
}
|
|
554
565
|
}
|
|
555
566
|
|
|
556
|
-
let matches2 = content.match(/word\(
|
|
567
|
+
let matches2 = content.match(/word\(---.*?\)/g);
|
|
557
568
|
if (matches2) {
|
|
558
569
|
for (let i = 0; i < matches2.length; i++) {
|
|
559
570
|
let v = matches2[i];
|
|
560
571
|
|
|
561
|
-
v = v.replace('word(
|
|
572
|
+
v = v.replace('word(---', '').replace(')', '');
|
|
562
573
|
content = content.replace(matches2[i], renderWord(v));
|
|
563
574
|
}
|
|
564
575
|
}
|
package/lib/routing.js
CHANGED
|
@@ -305,10 +305,14 @@ module.exports = function init(____0) {
|
|
|
305
305
|
let r0 = _0xrrxo.list[i];
|
|
306
306
|
if (r.name && r.method && r0.name.like(r.name) && r0.method.like(r.method)) {
|
|
307
307
|
_0xrrxo.list.splice(i, 1);
|
|
308
|
+
____0.fsm.off(r0.path);
|
|
308
309
|
} else if (r.name && r0.name.like(r.name)) {
|
|
309
310
|
_0xrrxo.list.splice(i, 1);
|
|
311
|
+
____0.fsm.off('*' + r0.name.replace('/', '') + '*');
|
|
312
|
+
____0.fsm.off(r0.path);
|
|
310
313
|
} else if (r.method && r0.method.like(r.method)) {
|
|
311
314
|
_0xrrxo.list.splice(i, 1);
|
|
315
|
+
____0.fsm.off(r0.path);
|
|
312
316
|
}
|
|
313
317
|
}
|
|
314
318
|
};
|
|
@@ -1087,7 +1091,7 @@ module.exports = function init(____0) {
|
|
|
1087
1091
|
}
|
|
1088
1092
|
});
|
|
1089
1093
|
} else if (req.method.contains('post') && req.headers[____0.strings[18]] && req.headers[____0.strings[18]].contains('multipart')) {
|
|
1090
|
-
let form =
|
|
1094
|
+
let form = ____0.formidable({
|
|
1091
1095
|
multiples: !0,
|
|
1092
1096
|
uploadDir: ____0.options.upload_dir,
|
|
1093
1097
|
});
|