isite 2021.12.15 → 2022.1.12
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 +6 -5
- 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 +3 -4
- 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/apps/client-side/site_files/js/custom.js +3 -3
- package/apps/security/site_files/js/navbar.js +1 -1
- package/index.js +277 -293
- package/isite_files/js/custom.js +3 -3
- 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/mongodb.js +87 -82
- package/lib/parser.js +22 -11
- package/lib/routing.js +41 -15
- package/lib/security.js +1081 -1045
- package/lib/session.js +13 -78
- package/lib/sessions.js +22 -37
- package/lib/strings.js +1 -1
- package/object-options/index.js +3 -1
- package/package.json +5 -4
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: '
|
|
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: '
|
|
12
|
+
name: '/x-dashboard-images',
|
|
13
13
|
path: dir + '/images',
|
|
14
14
|
hide: !0,
|
|
15
15
|
});
|
|
16
16
|
____0.get({
|
|
17
|
-
name: '
|
|
17
|
+
name: '/x-dashboard-fonts',
|
|
18
18
|
path: dir + '/fonts',
|
|
19
19
|
hide: !0,
|
|
20
20
|
});
|
|
21
21
|
____0.get({
|
|
22
|
-
name: '
|
|
22
|
+
name: '/x-dashboard-js',
|
|
23
23
|
path: dir + '/js',
|
|
24
24
|
hide: !0,
|
|
25
25
|
});
|
|
26
26
|
____0.get({
|
|
27
|
-
name: '
|
|
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: '
|
|
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: '
|
|
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: '
|
|
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: '
|
|
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: '
|
|
58
|
+
name: '/x-dashboard-admin/api/vars',
|
|
59
59
|
hide: !0,
|
|
60
60
|
callback: function (req, res) {
|
|
61
|
-
res.setHeader('x-content', 'from
|
|
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: '
|
|
69
|
+
name: '/x-dashboard-admin/api/routes',
|
|
70
70
|
hide: !0,
|
|
71
71
|
callback: function (req, res) {
|
|
72
|
-
res.setHeader('x-content', 'from
|
|
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: '
|
|
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: '
|
|
100
|
+
name: '/x-dashboard-admin/api/sessions',
|
|
101
101
|
hide: !0,
|
|
102
102
|
callback: function (req, res) {
|
|
103
|
-
res.setHeader('x-content', 'from
|
|
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: '
|
|
123
|
+
name: '/x-dashboard-admin/api/cookie',
|
|
124
124
|
hide: !0,
|
|
125
125
|
callback: function (req, res) {
|
|
126
|
-
res.setHeader('x-content', 'from
|
|
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: '
|
|
134
|
+
name: '/x-dashboard-admin/api/users',
|
|
135
135
|
hide: !0,
|
|
136
136
|
callback: function (req, res) {
|
|
137
|
-
res.set('x-content', 'from
|
|
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: '
|
|
144
|
+
name: '/x-dashboard-admin/api/user',
|
|
145
145
|
hide: !0,
|
|
146
146
|
callback: function (req, res) {
|
|
147
|
-
res.set('x-content', 'from
|
|
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: '
|
|
154
|
+
name: '/x-dashboard-admin/api/files',
|
|
155
155
|
hide: !0,
|
|
156
156
|
callback: function (req, res) {
|
|
157
|
-
res.setHeader('x-content', 'from
|
|
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: '
|
|
173
|
+
name: '/x-dashboard-admin/api*',
|
|
174
174
|
hide: !0,
|
|
175
175
|
callback: function (req, res) {
|
|
176
|
-
res.setHeader('x-content', 'from
|
|
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('
|
|
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/mongodb.js
CHANGED
|
@@ -117,7 +117,6 @@ module.exports = function init(____0) {
|
|
|
117
117
|
serverSelectionTimeoutMS: 1000 * 60,
|
|
118
118
|
connectTimeoutMS: 1000 * 60,
|
|
119
119
|
socketTimeoutMS: 1000 * 60 * 5,
|
|
120
|
-
useUnifiedTopology: !0,
|
|
121
120
|
...____0.options.mongodb.config,
|
|
122
121
|
},
|
|
123
122
|
function (err, client) {
|
|
@@ -126,7 +125,7 @@ module.exports = function init(____0) {
|
|
|
126
125
|
|
|
127
126
|
_mongo.connections.push({
|
|
128
127
|
name: name,
|
|
129
|
-
url
|
|
128
|
+
url: db_url,
|
|
130
129
|
db: db,
|
|
131
130
|
client: client,
|
|
132
131
|
connected: !0,
|
|
@@ -162,12 +161,13 @@ module.exports = function init(____0) {
|
|
|
162
161
|
db.collection(____0.options.mongodb.prefix.collection + options.collectionName).createIndex(options.obj, options.option, function (err, result) {
|
|
163
162
|
if (!err) {
|
|
164
163
|
callback(null, result);
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
164
|
+
if (____0.options.mongodb.events) {
|
|
165
|
+
____0.call('mongodb after create index', {
|
|
166
|
+
db: options.dbName,
|
|
167
|
+
collection: options.collectionName,
|
|
168
|
+
obj: options.obj,
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
171
|
} else {
|
|
172
172
|
callback(err);
|
|
173
173
|
}
|
|
@@ -263,15 +263,16 @@ module.exports = function init(____0) {
|
|
|
263
263
|
|
|
264
264
|
db.collection(____0.options.mongodb.prefix.collection + obj.collectionName).insertOne(obj.doc, function (err, result) {
|
|
265
265
|
if (!err) {
|
|
266
|
-
callback(null, result.
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
266
|
+
callback(null, { ...obj.doc, _id: result.insertedId }, result);
|
|
267
|
+
if (____0.options.mongodb.events) {
|
|
268
|
+
____0.call('mongodb after insert', {
|
|
269
|
+
db: obj.dbName,
|
|
270
|
+
collection: obj.collectionName,
|
|
271
|
+
doc: result,
|
|
272
|
+
$req: $req,
|
|
273
|
+
$res: $res,
|
|
274
|
+
});
|
|
275
|
+
}
|
|
275
276
|
} else {
|
|
276
277
|
if (callback) {
|
|
277
278
|
callback(err);
|
|
@@ -303,18 +304,20 @@ module.exports = function init(____0) {
|
|
|
303
304
|
});
|
|
304
305
|
db.collection(____0.options.mongodb.prefix.collection + obj.collectionName).insertMany(obj.docs, obj.options, function (err, result) {
|
|
305
306
|
if (!err) {
|
|
306
|
-
callback(null, result);
|
|
307
|
-
____0.
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
307
|
+
callback(null, obj.docs , result);
|
|
308
|
+
if (____0.options.mongodb.events) {
|
|
309
|
+
____0.call('mongodb after insert many', {
|
|
310
|
+
db: obj.dbName,
|
|
311
|
+
collection: obj.collectionName,
|
|
312
|
+
docs: obj.docs,
|
|
313
|
+
});
|
|
314
|
+
}
|
|
312
315
|
} else {
|
|
313
|
-
|
|
316
|
+
callback(err, obj.docs , result);
|
|
314
317
|
}
|
|
315
318
|
});
|
|
316
319
|
} else {
|
|
317
|
-
|
|
320
|
+
callback(err);
|
|
318
321
|
}
|
|
319
322
|
});
|
|
320
323
|
};
|
|
@@ -359,12 +362,13 @@ module.exports = function init(____0) {
|
|
|
359
362
|
db.collection(____0.options.mongodb.prefix.collection + obj.collectionName).findOne(obj.where, options, function (err, doc) {
|
|
360
363
|
if (!err) {
|
|
361
364
|
callback(null, doc);
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
365
|
+
if (____0.options.mongodb.events) {
|
|
366
|
+
____0.call('mongodb after find', {
|
|
367
|
+
db: obj.dbName,
|
|
368
|
+
collection: obj.collectionName,
|
|
369
|
+
doc: doc,
|
|
370
|
+
});
|
|
371
|
+
}
|
|
368
372
|
} else {
|
|
369
373
|
callback(err);
|
|
370
374
|
}
|
|
@@ -401,11 +405,13 @@ module.exports = function init(____0) {
|
|
|
401
405
|
.toArray(function (err, docs) {
|
|
402
406
|
if (!err) {
|
|
403
407
|
callback(null, docs, count);
|
|
404
|
-
____0.
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
408
|
+
if (____0.options.mongodb.events) {
|
|
409
|
+
____0.call('mongodb after find many', {
|
|
410
|
+
db: obj.dbName,
|
|
411
|
+
collection: obj.collectionName,
|
|
412
|
+
docs: docs,
|
|
413
|
+
});
|
|
414
|
+
}
|
|
409
415
|
} else {
|
|
410
416
|
callback(err, [], 0);
|
|
411
417
|
}
|
|
@@ -495,8 +501,6 @@ module.exports = function init(____0) {
|
|
|
495
501
|
{
|
|
496
502
|
$req: $req,
|
|
497
503
|
$res: $res,
|
|
498
|
-
count: result.result.nModified,
|
|
499
|
-
ok: result.result.ok,
|
|
500
504
|
doc: doc2,
|
|
501
505
|
old_doc: doc,
|
|
502
506
|
where: obj.where,
|
|
@@ -506,18 +510,19 @@ module.exports = function init(____0) {
|
|
|
506
510
|
},
|
|
507
511
|
result,
|
|
508
512
|
);
|
|
509
|
-
____0.
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
513
|
+
if (____0.options.mongodb.events) {
|
|
514
|
+
____0.call('mongodb after update', {
|
|
515
|
+
db: obj.dbName,
|
|
516
|
+
collection: obj.collectionName,
|
|
517
|
+
doc: doc2,
|
|
518
|
+
old_doc: doc,
|
|
519
|
+
where: obj.where,
|
|
520
|
+
update: $update,
|
|
521
|
+
|
|
522
|
+
$req: $req,
|
|
523
|
+
$res: $res,
|
|
524
|
+
});
|
|
525
|
+
}
|
|
521
526
|
},
|
|
522
527
|
);
|
|
523
528
|
} else {
|
|
@@ -571,17 +576,19 @@ module.exports = function init(____0) {
|
|
|
571
576
|
},
|
|
572
577
|
result,
|
|
573
578
|
);
|
|
574
|
-
____0.
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
579
|
+
if (____0.options.mongodb.events) {
|
|
580
|
+
____0.call('mongodb after update many', {
|
|
581
|
+
db: obj.dbName,
|
|
582
|
+
collection: obj.collectionName,
|
|
583
|
+
exists: result.result.n,
|
|
584
|
+
count: result.result.nModified,
|
|
585
|
+
ok: result.result.ok,
|
|
586
|
+
where: obj.where,
|
|
587
|
+
update: $update,
|
|
588
|
+
$req: req,
|
|
589
|
+
$res: res,
|
|
590
|
+
});
|
|
591
|
+
}
|
|
585
592
|
} else {
|
|
586
593
|
callback(err);
|
|
587
594
|
}
|
|
@@ -624,19 +631,19 @@ module.exports = function init(____0) {
|
|
|
624
631
|
db: obj.dbName,
|
|
625
632
|
collection: obj.collectionName,
|
|
626
633
|
count: result.deletedCount,
|
|
627
|
-
ok: result.result.ok,
|
|
628
634
|
doc: doc,
|
|
629
635
|
},
|
|
630
636
|
result,
|
|
631
637
|
);
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
638
|
+
if (____0.options.mongodb.events) {
|
|
639
|
+
____0.call('mongodb after delete', {
|
|
640
|
+
db: obj.dbName,
|
|
641
|
+
collection: obj.collectionName,
|
|
642
|
+
doc: doc,
|
|
643
|
+
$req: $req,
|
|
644
|
+
$res: $res,
|
|
645
|
+
});
|
|
646
|
+
}
|
|
640
647
|
} else {
|
|
641
648
|
callback(err);
|
|
642
649
|
}
|
|
@@ -696,21 +703,19 @@ module.exports = function init(____0) {
|
|
|
696
703
|
$req: $req,
|
|
697
704
|
$res: $res,
|
|
698
705
|
count: result.deletedCount,
|
|
699
|
-
ok: result.result.ok,
|
|
700
|
-
exists: result.result.n,
|
|
701
706
|
},
|
|
702
707
|
result,
|
|
703
708
|
);
|
|
704
|
-
____0.
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
}
|
|
709
|
+
if (____0.options.mongodb.events) {
|
|
710
|
+
____0.call('mongodb after delete many', {
|
|
711
|
+
db: obj.dbName,
|
|
712
|
+
collection: obj.collectionName,
|
|
713
|
+
$req: $req,
|
|
714
|
+
$res: $res,
|
|
715
|
+
where: obj.where,
|
|
716
|
+
count: result.deletedCount,
|
|
717
|
+
});
|
|
718
|
+
}
|
|
714
719
|
} else {
|
|
715
720
|
callback(err);
|
|
716
721
|
}
|
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
|
}
|