isite 2022.9.19 → 2022.9.22
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 +19 -0
- package/apps/client-side/app.js +2 -0
- package/apps/client-side/site_files/css/bootstrap5-addon.css +14 -1
- package/apps/client-side/site_files/css/checkbox.css +80 -77
- package/apps/client-side/site_files/css/form.css +2 -2
- package/apps/client-side/site_files/css/images.css +32 -15
- package/apps/client-side/site_files/css/modal.css +153 -154
- package/apps/client-side/site_files/css/scrollbar.css +4 -3
- package/apps/client-side/site_files/css/theme.css +4 -2
- package/apps/client-side/site_files/css/theme_paper.css +4 -2
- package/apps/client-side/site_files/css/treeview.css +17 -4
- package/apps/client-side/site_files/html/directive/i-button.html +1 -1
- package/apps/client-side/site_files/html/directive/i-date.html +3 -3
- package/apps/client-side/site_files/html/directive/i-datetime.html +5 -5
- package/apps/client-side/site_files/html/directive/i-treenode.html +3 -3
- package/apps/client-side/site_files/html/directive/i-treeview.html +6 -11
- package/apps/client-side/site_files/js/bootstrap-5-directive.js +32 -10
- package/apps/client-side/site_files/js/last.js +5 -3
- package/apps/client-side/site_files/js/site.js +5 -3
- package/index.js +2 -0
- package/lib/helper.js +43 -0
- package/lib/session.js +5 -2
- package/object-options/index.js +238 -234
- package/package.json +1 -1
|
@@ -52,7 +52,7 @@ app.directive('iTextarea', function () {
|
|
|
52
52
|
} else {
|
|
53
53
|
attrs.disabled = '';
|
|
54
54
|
}
|
|
55
|
-
$scope.rows = $scope.rows ||
|
|
55
|
+
$scope.rows = $scope.rows || 10;
|
|
56
56
|
$scope.id2 = $scope.id2 || 'input_' + Math.random().toString().replace('0.', '');
|
|
57
57
|
$(element)
|
|
58
58
|
.find('textarea')
|
|
@@ -121,6 +121,7 @@ app.directive('iButton', function () {
|
|
|
121
121
|
scope: {
|
|
122
122
|
label: '@',
|
|
123
123
|
type: '@',
|
|
124
|
+
class2: '@',
|
|
124
125
|
loading: '@',
|
|
125
126
|
click: '&',
|
|
126
127
|
fa: '@',
|
|
@@ -167,6 +168,9 @@ app.directive('iButton', function () {
|
|
|
167
168
|
if ($scope.type.like('*default*')) {
|
|
168
169
|
$scope.class = '';
|
|
169
170
|
}
|
|
171
|
+
if ($scope.class2) {
|
|
172
|
+
$scope.class = $scope.class2;
|
|
173
|
+
}
|
|
170
174
|
$scope.$watch('loading', (loading) => {
|
|
171
175
|
if (loading === 'true') {
|
|
172
176
|
$scope.busy = true;
|
|
@@ -367,7 +371,7 @@ app.directive('iChecklist', [
|
|
|
367
371
|
link: function ($scope, element, attrs, ctrl) {
|
|
368
372
|
$scope.primary = $scope.primary || 'id';
|
|
369
373
|
$scope.display = $scope.display || 'name';
|
|
370
|
-
$scope.class2 = $scope.class2 || '
|
|
374
|
+
$scope.class2 = $scope.class2 || 'col3';
|
|
371
375
|
$scope.selectedItems = [];
|
|
372
376
|
|
|
373
377
|
$scope.$watch('ngModel', (ngModel) => {
|
|
@@ -480,8 +484,15 @@ app.directive('iDate', function () {
|
|
|
480
484
|
name: i,
|
|
481
485
|
});
|
|
482
486
|
}
|
|
487
|
+
$scope.dayTitle = 'Day';
|
|
488
|
+
$scope.monthTitle = 'Month';
|
|
489
|
+
$scope.yearTitle = 'Year';
|
|
490
|
+
|
|
483
491
|
$scope.lang = site.session ? site.session.lang : 'en';
|
|
484
492
|
if ($scope.lang === 'ar') {
|
|
493
|
+
$scope.dayTitle = 'يوم';
|
|
494
|
+
$scope.monthTitle = 'شهر';
|
|
495
|
+
$scope.yearTitle = 'سنة';
|
|
485
496
|
$scope.monthes = [
|
|
486
497
|
{ id: 0, name: 'يناير' },
|
|
487
498
|
{ id: 1, name: 'فبراير' },
|
|
@@ -501,15 +512,15 @@ app.directive('iDate', function () {
|
|
|
501
512
|
{ id: 0, name: 'Jan' },
|
|
502
513
|
{ id: 1, name: 'Feb' },
|
|
503
514
|
{ id: 2, name: 'Mar' },
|
|
504
|
-
{ id: 3, name: '
|
|
515
|
+
{ id: 3, name: 'Apr' },
|
|
505
516
|
{ id: 4, name: 'May' },
|
|
506
|
-
{ id: 5, name: '
|
|
507
|
-
{ id: 6, name: '
|
|
517
|
+
{ id: 5, name: 'Jun' },
|
|
518
|
+
{ id: 6, name: 'Jul' },
|
|
508
519
|
{ id: 7, name: 'Aug' },
|
|
509
520
|
{ id: 8, name: 'Sep' },
|
|
510
521
|
{ id: 9, name: 'Oct' },
|
|
511
522
|
{ id: 10, name: 'Nov' },
|
|
512
|
-
{ id: 11, name: '
|
|
523
|
+
{ id: 11, name: 'Dec' },
|
|
513
524
|
];
|
|
514
525
|
}
|
|
515
526
|
|
|
@@ -604,8 +615,19 @@ app.directive('iDatetime', function () {
|
|
|
604
615
|
name: i,
|
|
605
616
|
});
|
|
606
617
|
}
|
|
618
|
+
$scope.dayTitle = 'Day';
|
|
619
|
+
$scope.monthTitle = 'Month';
|
|
620
|
+
$scope.yearTitle = 'Year';
|
|
621
|
+
$scope.hourTitle = 'Hour';
|
|
622
|
+
$scope.minuteTitle = 'Minute';
|
|
623
|
+
|
|
607
624
|
$scope.lang = site.session ? site.session.lang : 'en';
|
|
608
625
|
if ($scope.lang === 'ar') {
|
|
626
|
+
$scope.dayTitle = 'يوم';
|
|
627
|
+
$scope.monthTitle = 'شهر';
|
|
628
|
+
$scope.yearTitle = 'سنة';
|
|
629
|
+
$scope.hourTitle = 'ساعة';
|
|
630
|
+
$scope.minuteTitle = 'دقيقة';
|
|
609
631
|
$scope.monthes = [
|
|
610
632
|
{ id: 0, name: 'يناير' },
|
|
611
633
|
{ id: 1, name: 'فبراير' },
|
|
@@ -625,15 +647,15 @@ app.directive('iDatetime', function () {
|
|
|
625
647
|
{ id: 0, name: 'Jan' },
|
|
626
648
|
{ id: 1, name: 'Feb' },
|
|
627
649
|
{ id: 2, name: 'Mar' },
|
|
628
|
-
{ id: 3, name: '
|
|
650
|
+
{ id: 3, name: 'Apr' },
|
|
629
651
|
{ id: 4, name: 'May' },
|
|
630
|
-
{ id: 5, name: '
|
|
631
|
-
{ id: 6, name: '
|
|
652
|
+
{ id: 5, name: 'Jun' },
|
|
653
|
+
{ id: 6, name: 'Jul' },
|
|
632
654
|
{ id: 7, name: 'Aug' },
|
|
633
655
|
{ id: 8, name: 'Sep' },
|
|
634
656
|
{ id: 9, name: 'Oct' },
|
|
635
657
|
{ id: 10, name: 'Nov' },
|
|
636
|
-
{ id: 11, name: '
|
|
658
|
+
{ id: 11, name: 'Dec' },
|
|
637
659
|
];
|
|
638
660
|
}
|
|
639
661
|
|
|
@@ -2,7 +2,9 @@ if (window.module) {
|
|
|
2
2
|
module = window.module;
|
|
3
3
|
}
|
|
4
4
|
site.onLoad(() => {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
setTimeout(() => {
|
|
6
|
+
document.querySelectorAll('.loaded').forEach((el) => {
|
|
7
|
+
el.classList.remove('loaded');
|
|
8
|
+
});
|
|
9
|
+
}, 1000);
|
|
8
10
|
});
|
|
@@ -132,6 +132,9 @@
|
|
|
132
132
|
.then((res) => res.json())
|
|
133
133
|
.then((data) => {
|
|
134
134
|
site.printerList = data.list;
|
|
135
|
+
})
|
|
136
|
+
.catch((err) => {
|
|
137
|
+
site.printerList = [];
|
|
135
138
|
});
|
|
136
139
|
}
|
|
137
140
|
|
|
@@ -682,15 +685,14 @@
|
|
|
682
685
|
en: 'Data Is Required',
|
|
683
686
|
ar: 'هذا البيان مطلوب',
|
|
684
687
|
});
|
|
685
|
-
}
|
|
686
|
-
if (el.nodeName === 'I-DATETIME' && !el.getAttribute('value')) {
|
|
688
|
+
} else if (el.nodeName === 'I-DATETIME' && !el.getAttribute('value')) {
|
|
687
689
|
el.classList.add('is-invalid');
|
|
688
690
|
res.ok = !1;
|
|
689
691
|
res.messages.push({
|
|
690
692
|
en: 'Data Is Required',
|
|
691
693
|
ar: 'هذا البيان مطلوب',
|
|
692
694
|
});
|
|
693
|
-
} else {
|
|
695
|
+
} else if (el.nodeName === 'INPUT' || el.nodeName === 'SELECT' || el.nodeName === 'TEXTAREA' || el.nodeName === 'I-DATETIME') {
|
|
694
696
|
el.classList.add('is-valid');
|
|
695
697
|
}
|
|
696
698
|
} else if (vl.like('ml*')) {
|
package/index.js
CHANGED
|
@@ -196,6 +196,7 @@ module.exports = function init(options) {
|
|
|
196
196
|
require('./lib/email.js')(____0);
|
|
197
197
|
require('./lib/integrated.js')(____0);
|
|
198
198
|
require('./lib/browser.js')(____0);
|
|
199
|
+
require('./lib/helper.js')(____0);
|
|
199
200
|
|
|
200
201
|
//Master Pages
|
|
201
202
|
____0.masterPages = [];
|
|
@@ -294,6 +295,7 @@ module.exports = function init(options) {
|
|
|
294
295
|
|
|
295
296
|
____0.createDir(____0.options.upload_dir);
|
|
296
297
|
____0.createDir(____0.options.download_dir);
|
|
298
|
+
____0.createDir(____0.options.backup_dir);
|
|
297
299
|
____0.addfeatures(____0.dir + '/json/features.json');
|
|
298
300
|
|
|
299
301
|
____0.log('');
|
package/lib/helper.js
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
module.exports = function init(____0) {
|
|
2
|
+
____0.backupDB = function (options, callback) {
|
|
3
|
+
options = options || {};
|
|
4
|
+
callback = callback || function () {};
|
|
5
|
+
|
|
6
|
+
options.db = options.db || ____0.options.mongodb.db;
|
|
7
|
+
options.path = options.path || ____0.options.backup_dir;
|
|
8
|
+
if (!options.path.like('*.gz')) {
|
|
9
|
+
options.path += '/' + options.db + '.gz';
|
|
10
|
+
}
|
|
11
|
+
options.path = ____0.path.resolve(options.path);
|
|
12
|
+
options.cmd = 'mongodump --db=' + options.db + ' --archive=' + options.path + ' --gzip';
|
|
13
|
+
let subProcess = ____0.child_process.spawn('mongodump', ['--db=' + options.db, '--archive=' + options.path, '--gzip']);
|
|
14
|
+
|
|
15
|
+
subProcess.on('exit', (code, signal) => {
|
|
16
|
+
if (code || signal) {
|
|
17
|
+
callback({ message: `Exit With Code [ ${code} ] and signal [ ${signal} ] ` }, options);
|
|
18
|
+
} else {
|
|
19
|
+
callback(null, options);
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
____0.restoreDB = function (options, callback) {
|
|
24
|
+
options = options || {};
|
|
25
|
+
callback = callback || function () {};
|
|
26
|
+
|
|
27
|
+
options.db = options.db || ____0.options.mongodb.db;
|
|
28
|
+
options.path = options.path || ____0.options.backup_dir;
|
|
29
|
+
if (!options.path.like('*.gz')) {
|
|
30
|
+
options.path += '/' + options.db + '.gz';
|
|
31
|
+
}
|
|
32
|
+
options.path = ____0.path.resolve(options.path);
|
|
33
|
+
options.cmd = 'mongorestore --db=' + options.db + ' --archive=' + options.path + ' --gzip --drop';
|
|
34
|
+
let subProcess = ____0.child_process.spawn('mongorestore', ['--db=' + options.db, '--archive=' + options.path, '--gzip' , '--drop']);
|
|
35
|
+
subProcess.on('exit', (code, signal) => {
|
|
36
|
+
if (code || signal) {
|
|
37
|
+
callback({ message: `Exit With Code [ ${code} ] and signal [ ${signal} ] ` }, options);
|
|
38
|
+
} else {
|
|
39
|
+
callback(null, options);
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
};
|
|
43
|
+
};
|
package/lib/session.js
CHANGED
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
module.exports = function init(req, res, ____0, callback) {
|
|
2
|
-
____0.getSession({ accessToken: req.cookie('access_token') || req.headers['Access-Token'] || req.headers['access-token'] }, (session) => {
|
|
2
|
+
____0.getSession({ accessToken: req.cookie('access_token') || req.headers['Access-Token'] || req.headers['access-token'] || req.query['access-token'] }, (session) => {
|
|
3
3
|
if (!session.accessToken) {
|
|
4
4
|
session.accessToken = new Date().getTime().toString() + '_' + Math.random() * (10000 - 1000) + 1000;
|
|
5
5
|
session.accessToken = ____0.x0md50x(session.accessToken);
|
|
6
6
|
res.cookie('access_token', session.accessToken);
|
|
7
7
|
res.set('Access-Token', session.accessToken);
|
|
8
8
|
}
|
|
9
|
+
if (req.query['access-token']) {
|
|
10
|
+
res.cookie('access_token', session.accessToken);
|
|
11
|
+
res.set('Access-Token', session.accessToken);
|
|
12
|
+
}
|
|
9
13
|
|
|
10
14
|
session.ip = req.ip;
|
|
11
15
|
session.modifiedTime = new Date().getTime();
|
|
@@ -154,7 +158,6 @@ module.exports = function init(req, res, ____0, callback) {
|
|
|
154
158
|
}
|
|
155
159
|
|
|
156
160
|
AssignFeatures();
|
|
157
|
-
|
|
158
161
|
if (____0.security && session.user_id) {
|
|
159
162
|
____0.security.getUser(
|
|
160
163
|
{
|